jvx.geom
Class PwMarkWithSphere
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.geom.PwMarkWithSphere
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf, PvPickListenerIf
public class PwMarkWithSphere extends PjWorkshop implements PvPickListenerIf
Workshop to selected vertices of a geometry that are inside a sphere. The center of the sphere can be moved on the geometry.- See Also:
- Serialized Form
- Author:
- Klaus Hildebrandt
- Version:
- 24.01.03, 1.10 revised (kh) Workshop can now switch between geometries. It works on the one that is picked.
00.11.02, 1.00 created (kh)
-
-
Field Summary
-
Fields inherited from class jv.object.PsObject
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
-
Fields inherited from interface jv.project.PjWorkshopIf
MODE_BUG, MODE_STANDARD, MODE_VALIDATE
-
-
Constructor Summary
Constructors Constructor and Description PwMarkWithSphere()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcancel()Cancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.voidclose()Close workshop and remove itself as listener from various classes.voiddragDisplay(PvPickEvent pos)Drag a location in the display with 2d display and 3d world coordinates.voiddragInitial(PvPickEvent pos)Drag an arbitrary point along a geometry, point may lie inside an element.voiddragVertex(PgGeometryIf geom, int index, PdVector vertex)Drag a picked vertex of a geometry.java.lang.StringgetName()The name of a listeners allows the display to issue verbal debug messages.voidinit()Initialize and reset project, stops the running animation if any.voidmarkVertices()Mark vertices on geometry, that are inside a sphere.voidmarkVertices(PvPickEvent pos)Mark a set of vertices of a geometry within a given bounding box.voidpickDisplay(PvPickEvent pos)Get a location in the display with 2d display and 3d world coordinates.voidpickInitial(PvPickEvent pos)Pick an arbitrary point on a geometry, point may lie inside an element.voidpickVertex(PgGeometryIf geom, int index, PdVector vertex)Get a picked vertex of a geometry.voidselectGeometry(PgGeometryIf geom)Currently not supported by display.voidsetCenter(PdVector center)Set center of sphere, but do not compute the new selection.voidsetDisplay(PvDisplayIf disp)Get the active display when this workshop was lauchned.voidsetGeometry(PgPointSet geom)Assign a geometry on which this workshop operates, and create a backup copy if workshop is cancelled.voidsetInvertMarks(boolean flag)Set flag.voidsetMarkElements(boolean flag)Set flag.voidsetRadius(double rad)Set the radius of sphere, but do not compute the new selection.voidunmarkVertices(PvPickEvent pos)Unmark a set of vertices of a geometry within a given bounding box.booleanupdate(java.lang.Object event)Updates the geometry if this workshop has changed, i.e. if the event isthisornull.-
Methods inherited from class jvx.project.PjWorkshop
getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, removeGeometry, reset, setDisplays, setGeometry, setModal, setMode, setStandalone, setViewer
-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
-
-
-
-
Method Detail
-
init
public void init()
Description copied from class:PjWorkshopInitialize and reset project, stops the running animation if any. Does not reset any registered display nor geometry. They must be reset individually in each subclass.- Overrides:
initin classPjWorkshop
-
setDisplay
public void setDisplay(PvDisplayIf disp)
Get the active display when this workshop was lauchned.- Specified by:
setDisplayin interfacePjWorkshopIf- Overrides:
setDisplayin classPjWorkshop
-
setGeometry
public void setGeometry(PgPointSet geom)
Assign a geometry on which this workshop operates, and create a backup copy if workshop is cancelled.
-
update
public boolean update(java.lang.Object event)
Description copied from class:PjWorkshopUpdates the geometry if this workshop has changed, i.e. if the event isthisornull. Also propagates update() to superclass with the original argument event.Some subclasses may register themselves as update listener of the geometry of this workshop. In order to prevent an update loop, this method safely uses isUpdateSender() when updating the geometry.
- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPjWorkshop- Parameters:
event- sender of this update.- Returns:
- true if update was correctly handled by superclass.
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
cancel
public void cancel()
Description copied from class:PjWorkshopCancel operation of this workshop by resetting the assigned geometry, and finally close this workshop.If necessary, the duplicate of the original geometry is restored into the geometry. The update method of the geometry is called.
- Overrides:
cancelin classPjWorkshop
-
close
public void close()
Description copied from class:PjWorkshopClose workshop and remove itself as listener from various classes. The workshop will no longer be working after this call.Subclasses may remove workshop from geometry as update listener, or remove any temporary geometries from display, if necessary.
Implementation in this class simply calls
removeGeometry().- Overrides:
closein classPjWorkshop
-
markVertices
public void markVertices()
Mark vertices on geometry, that are inside a sphere.
-
setRadius
public void setRadius(double rad)
Set the radius of sphere, but do not compute the new selection.
-
setCenter
public void setCenter(PdVector center)
Set center of sphere, but do not compute the new selection.
-
setInvertMarks
public void setInvertMarks(boolean flag)
Set flag. This method does not update info panel.
-
setMarkElements
public void setMarkElements(boolean flag)
Set flag. This method does not update info panel.
-
getName
public java.lang.String getName()
The name of a listeners allows the display to issue verbal debug messages.- Specified by:
getNamein interfacePsUpdateIf- Specified by:
getNamein interfacePvPickListenerIf- Overrides:
getNamein classPsObject
-
selectGeometry
public void selectGeometry(PgGeometryIf geom)
Currently not supported by display.- Specified by:
selectGeometryin interfacePvPickListenerIf- Parameters:
geom- Now selected geometry of display.
-
pickDisplay
public void pickDisplay(PvPickEvent pos)
Get a location in the display with 2d display and 3d world coordinates. Point may be independent of any geometry.- Specified by:
pickDisplayin interfacePvPickListenerIf- Parameters:
pos- Pick event issued by the display- See Also:
PvPickListenerIf
-
dragDisplay
public void dragDisplay(PvPickEvent pos)
Drag a location in the display with 2d display and 3d world coordinates. Point may be independent of any geometry.- Specified by:
dragDisplayin interfacePvPickListenerIf- Parameters:
pos- Pick event issued by the display- See Also:
PvPickListenerIf
-
pickInitial
public void pickInitial(PvPickEvent pos)
Pick an arbitrary point on a geometry, point may lie inside an element.- Specified by:
pickInitialin interfacePvPickListenerIf- Parameters:
pos- Pick event issued by the display- See Also:
PvPickListenerIf
-
dragInitial
public void dragInitial(PvPickEvent pos)
Drag an arbitrary point along a geometry, point may lie inside an element.- Specified by:
dragInitialin interfacePvPickListenerIf- Parameters:
pos- Pick event issued by the display- See Also:
PvPickListenerIf
-
pickVertex
public void pickVertex(PgGeometryIf geom, int index, PdVector vertex)
Get a picked vertex of a geometry.- Specified by:
pickVertexin interfacePvPickListenerIf- Parameters:
geom- Picked geometry on which vertex liesindex- Index of vertex in vertex array of geometryvertex- 3d coordinates of vertex position- See Also:
PvPickListenerIf
-
dragVertex
public void dragVertex(PgGeometryIf geom, int index, PdVector vertex)
Drag a picked vertex of a geometry.- Specified by:
dragVertexin interfacePvPickListenerIf- Parameters:
geom- Picked geometry on which vertex liesindex- Index of vertex in vertex array of geometryvertex- 3d coordinates of vertex position
-
markVertices
public void markVertices(PvPickEvent pos)
Mark a set of vertices of a geometry within a given bounding box.- Specified by:
markVerticesin interfacePvPickListenerIf- Parameters:
pos- contains four coplanar points on the bounding prism, and direction of prism.- See Also:
PvPickEvent.getMarkBox()
-
unmarkVertices
public void unmarkVertices(PvPickEvent pos)
Unmark a set of vertices of a geometry within a given bounding box.- Specified by:
unmarkVerticesin interfacePvPickListenerIf- Parameters:
pos- contains four coplanar points on the bounding prism, and direction of prism.- See Also:
PvPickEvent.getMarkBox()
-
-
"