y25.view
Interface NodeRealizer25D

All Superinterfaces:
NodeLayout, NodeLayout25D
All Known Implementing Classes:
DummyNodeRealizer25D, ShapeNodeRealizer25D

public interface NodeRealizer25D
extends NodeLayout25D

Provides a mechanism for rendering nodes into an OpenGL context.

Note that this interface is not intended to "be used alone". When actually implementing a node realizer, you have to extend NodeRealizer and additionally implement this interface. This is the only way to make sure that the realizer you write works both with the yFiles package and the y25 package.


Method Summary
 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.
 
Methods inherited from interface y25.layout.NodeLayout25D
getDepth, getRelativeBoundingBox, setDepth, setSize
 
Methods inherited from interface y.layout.NodeLayout
getHeight, getWidth, getX, getY, setLocation, setSize
 

Method Detail

paintGL

public void paintGL(GLAutoDrawable drawable,
                    Camera camera)
Renders the node this realizer belongs to into the given drawable.

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.


intersect

public Point3D intersect(Point3D source,
                         Point3D target,
                         float nodeZ)
Intersects a line segment with this node and returns the intersection point.

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.