|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecty.view.NodeRealizer
y.view.ShapeNodeRealizer
y25.view.realizer.ShapeNodeRealizer25D
Extends the ShapeNodeRealizer
with 25D information.
This realizer aims to provide the same functionality as the
y.view.ShapeNodeRealizer
, except that it
can also be used inside a Graph25D
and therefore rendered into
a Graph25DView
.
Field Summary | |
protected double |
depth
The depth of this realizer. |
Fields inherited from class y.view.ShapeNodeRealizer |
DIAMOND, ELLIPSE, HEXAGON, OCTAGON, PARALLELOGRAM, RECT, RECT_3D, ROUND_RECT, shape, TRAPEZOID, TRAPEZOID_2, TRIANGLE |
Fields inherited from class y.view.NodeRealizer |
height, HOTSPOT_E, HOTSPOT_N, HOTSPOT_NE, HOTSPOT_NONE, HOTSPOT_NW, HOTSPOT_S, HOTSPOT_SE, HOTSPOT_SW, HOTSPOT_W, width, x, y |
Constructor Summary | |
ShapeNodeRealizer25D()
Creates a new ShapeNodeRealizer25D with the default depth. |
|
ShapeNodeRealizer25D(NodeRealizer nr)
Creates a new ShapeNodeRealizer25D that copies as many
attributes of the passed realizer as possible. |
Method Summary | |
NodeRealizer |
createCopy(NodeRealizer nr)
|
double |
getDepth()
Returns the depth of the node, which is its extent in the z-dimension. |
BoundingBox |
getRelativeBoundingBox()
Returns the relative bounding box that encompasses the node. |
Point3D |
intersect(Point3D source,
Point3D target,
float nodeZ)
Intersects a line segment with this node and returns the intersection point. |
void |
paintGL(GLAutoDrawable drawable,
Camera camera)
Renders the node this realizer belongs to into the given drawable. |
void |
setDepth(double depth)
Sets the depth of the node, which is its extent in the z-dimension. |
void |
setSize(double width,
double height,
double depth)
Sets the size of the node in all three dimensions. |
Methods inherited from class y.view.ShapeNodeRealizer |
contains, findIntersection, getShapeType, moveBy, paintNode, read, setCenter, setLocation, setShapeType, setSize, shapeTypeToStringMap, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface y.layout.NodeLayout |
getHeight, getWidth, getX, getY, setLocation, setSize |
Field Detail |
protected double depth
Constructor Detail |
public ShapeNodeRealizer25D()
ShapeNodeRealizer25D
with the default depth.
public ShapeNodeRealizer25D(NodeRealizer nr)
ShapeNodeRealizer25D
that copies as many
attributes of the passed realizer as possible.
Method Detail |
public NodeRealizer createCopy(NodeRealizer nr)
NodeRealizer.createCopy(y.view.NodeRealizer)
public double getDepth()
NodeLayout25D
getDepth
in interface NodeLayout25D
NodeLayout25D.getDepth()
public void setDepth(double depth)
NodeLayout25D
setDepth
in interface NodeLayout25D
NodeLayout25D.setDepth(double)
public void setSize(double width, double height, double depth)
NodeLayout25D
setSize
in interface NodeLayout25D
NodeLayout25D.setSize(double, double, double)
public BoundingBox getRelativeBoundingBox()
NodeLayout25D
"Relative" means, that the z-position of the node is treated as the
origin. For example, if a node is located at position (x,y,z) = (4,5,80)
and has a width, height and depth of 4 then the relative bounding box is
defined by the two points bb_min = (2, 3, -2)
and
bb_max = (6, 7, 2)
. Simply put, the z-position of the
node is just irrelevant.
getRelativeBoundingBox
in interface NodeLayout25D
NodeLayout25D.getRelativeBoundingBox()
public void paintGL(GLAutoDrawable drawable, Camera camera)
NodeRealizer25D
The passed camera is the one that is used to display this node. It can be used, for example, to render a node differently depending on the viewing position, or to display labels that always face the viewer.
paintGL
in interface NodeRealizer25D
NodeRealizer25D.paintGL(javax.media.opengl.GLAutoDrawable,
y25.graphics.Camera)
public Point3D intersect(Point3D source, Point3D target, float nodeZ)
NodeRealizer25D
The line segment in three dimensional space is defined by the two points:
source
and target
. Since a node's
z-position is determined only by the layer it resides in, this
information is not available inside the realizer and therefore has to be
passed in nodeZ
.
This method should return an intersection point only if the passed line
segment actually intersects the node. It should return null
,
if the line segment is completely outside or completely inside the node.
If the line segment intersects the node at more than one position, the
first of these intersections has to be returned, i.e. the one that is
closest to source
.
intersect
in interface NodeRealizer25D
NodeRealizer25D.intersect(y25.graphics.Point3D,
y25.graphics.Point3D, float)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |