|
Jazz API Documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.util.ZSceneGraphPath
ZSceneGraphPath represents a unique path in a scene graph from a top-level camera to a terminal node. The path is typically used in event handlers to determine what object is under the mouse pointer, and what camera(s) that object was rendered within. The path is typically generated by @link(ZDrawingSurface#pick). The terminal node can be a node or visual component, but is typically a visual component, or null. One exception to this is that if a group's children are not pickable than the group itself will be the terminal object if one if its children was actually picked. Also, cameras are not picked as objects, and thus do not typically appear as a terminal object.
The path also encapsulates a transform, indicating the composited transform from the top-level camera to the terminal object, possibly going through zero or more internal cameras. Even when the terminal object is null, the transform contains the complete transform through all the cameras that the mouse pointer is over (for pick operations).
The path also holds a list of the cameras traversed by the path. As with the transform, even if the terminal object is null, the camea list contains all the cameras the mouse pointer is over (for pick operations).
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
ZDrawingSurface.pick(int, int)
, Serialized FormConstructor Summary | |
ZSceneGraphPath()
Constructs a new ZSceneGraphPath. |
Method Summary | |
ZCamera |
getCamera()
Returns the nearest ZCamera to the picked object. |
ZCamera |
getCamera(int i)
Returns the i'th camera between the root and the terminal object. |
boolean |
getCameraFound()
Internal method. |
ZNode |
getNode()
Returns the nearest ZNode to the picked object. |
int |
getNumCameras()
Returns the number of internal cameras between the root and the terminal object. |
int |
getNumParents()
Returns the number of internal ZSceneGraphObjects between the root and the terminal object. |
ZSceneGraphObject |
getObject()
Returns the terminal object in the path. |
ZSceneGraphObject |
getParent(int i)
Returns the i'th scene graph object between the root and the terminal object. |
ZRoot |
getRoot()
Returns the root node for this path. |
ZCamera |
getTopCamera()
Returns the top-level camera in the path. |
ZNode |
getTopCameraNode()
Returns the node associated with the top-level camera in the path. |
java.awt.geom.AffineTransform |
getTransform()
Returns the transform for this path. |
void |
pop(ZSceneGraphObject sgo)
Removes a node (and any nodes after it) from the list of parent nodes. |
void |
popCamera(ZCamera camera)
Removes a camera (and any cameras after it) from the list of camera nodes. |
void |
popTransformer(ZSceneGraphObject transformer)
Removes a transformer (and any transformers after it) from the list of transformer nodes. |
void |
push(ZSceneGraphObject sgo)
Adds a node to the end of the list of parent nodes. |
void |
pushCamera(ZCamera camera)
Adds a node to the end of the list of camera nodes. |
void |
pushTransformer(ZSceneGraphObject transformer)
Internal method. |
void |
screenToGlobal(java.awt.geom.Point2D pt)
Converts the specified point from screen coordinates to global coordinates through the top-level camera of this path. |
void |
screenToGlobal(java.awt.geom.Rectangle2D rect)
Converts the specified rectangle from screen coordinates to global coordinates through the top-level camera of this path. |
void |
screenToLocal(java.awt.geom.Point2D pt)
Converts the specified point from screen coordinates to the local coordinate system of the terminal scene graph object in this path. |
void |
screenToLocal(java.awt.geom.Rectangle2D rect)
Converts the specified rectangle from screen coordinates to the local coordinate system of the terminal scene graph object in this path. |
void |
setCameraFound(boolean cf)
Internal method. |
void |
setObject(ZSceneGraphObject object)
Sets the terminal object in the path. |
void |
setRoot(ZRoot root)
Sets the root node for this path. |
void |
setTopCamera(ZCamera camera)
Sets the top-level camera in the path. |
void |
setTopCameraNode(ZNode node)
Sets the node associated with the top-level camera in the path. |
void |
setTransform(java.awt.geom.AffineTransform tm)
Sets the transform for this path. |
java.lang.String |
toString()
Returns a string description of this path useful for debugging. |
void |
trimCamerasToSize()
Trims the capacity of the array that stores the cameras to the actual number of points. |
void |
trimToSize()
Trims the capacity of the array that stores the parents list points to the actual number of points. |
void |
trimTransformersToSize()
Trims the capacity of the array that stores the transformers to the actual number of points. |
void |
updateTransform()
Update the path's transform. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public ZSceneGraphPath()
Method Detail |
public ZSceneGraphObject getObject()
public void setObject(ZSceneGraphObject object)
public ZNode getTopCameraNode()
public void setTopCameraNode(ZNode node)
public ZCamera getTopCamera()
public void setTopCamera(ZCamera camera)
public ZNode getNode()
public ZCamera getCamera()
public ZRoot getRoot()
public void setRoot(ZRoot root)
public java.awt.geom.AffineTransform getTransform()
public void setTransform(java.awt.geom.AffineTransform tm)
public void screenToGlobal(java.awt.geom.Point2D pt)
pt
- The pt to be transformedpublic void screenToGlobal(java.awt.geom.Rectangle2D rect)
rect
- The rect to be transformedpublic void screenToLocal(java.awt.geom.Point2D pt)
pt
- The pt to be transformedpublic void screenToLocal(java.awt.geom.Rectangle2D rect)
rect
- The rect to be transformedpublic int getNumParents()
public ZSceneGraphObject getParent(int i)
i
- The index of the path element to returnpublic void push(ZSceneGraphObject sgo)
sgo
- The scene graph object to be added to the pathpublic void pop(ZSceneGraphObject sgo)
sgo
- The scene graph object to be removed from the pathpublic void trimToSize()
public int getNumCameras()
public ZCamera getCamera(int i)
i
- The index of the camera to returnpublic void pushCamera(ZCamera camera)
camera
- The camera to be added to the pathpublic void popCamera(ZCamera camera)
camera
- The camera to be removed from the pathpublic void trimCamerasToSize()
public void pushTransformer(ZSceneGraphObject transformer)
transformer
- The transformer to be added to the pathpublic void popTransformer(ZSceneGraphObject transformer)
transformer
- The transformer to be removed from the pathpublic void trimTransformersToSize()
public void setCameraFound(boolean cf)
public boolean getCameraFound()
public void updateTransform()
public java.lang.String toString()
|
Jazz API Documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |