public abstract class Handle extends Group
A handle maintains its constant pixel size by applying a context-dependent scaling to its children. A handle is much like a transform group, one that augments a specified transform with a context-dependent scaling.
A consequence of this constant-size-in-pixels property is that a handle's bounding sphere in local coordinates must be infinite. A bounding sphere cannot be context-dependent, and the only sphere that is guaranteed to bound a handle in any context in which it appears is the infinite sphere.
By convention, the geometry of a handle's node children is centered at the point (0,0,0). A handle first scales the bounding sphere of its children so that the radius of that sphere transforms to the handle pixel size. The handle then applies a specified transform to position and orient its children within its local coordinate system.
A handle is a group node, because the child leaf nodes of each handle subclass are typically shared by instances of that subclass. Then, any changes to the shared node children are conveniently reflected in all handles of that class. Often a handle subclass has a single leaf node child.
Modifier | Constructor and Description |
---|---|
protected |
Handle(double x,
double y,
double z)
Constructs a handle with specified center coordinates.
|
protected |
Handle(Matrix44 transform)
Constructs a handle with specified transform matrix.
|
protected |
Handle(Point3 p)
Constructs a handle with specified center location.
|
Modifier and Type | Method and Description |
---|---|
protected BoundingSphere |
computeBoundingSphere(boolean finite)
Computes the bounding sphere for this handle.
|
protected void |
cullBegin(CullContext cc)
Pushes the view-dependent transform onto the specified cull context.
|
protected void |
cullEnd(CullContext cc)
Pops the view-dependent transform from the specified cull context.
|
protected void |
drawBegin(DrawContext dc)
Pushes the view-dependent transform onto the specified draw context.
|
protected void |
drawEnd(DrawContext dc)
Pops the view-dependent transform from the specified draw context.
|
Point3 |
getLocation()
Gets the view-independent location of the center of this handle.
|
static double |
getSize()
Gets the size in pixels of all handles.
|
Matrix44 |
getTransform()
Gets the view-independent transform matrix for this handle.
|
protected void |
pickBegin(PickContext pc)
Pushes the view-dependent transform onto the specified pick context.
|
protected void |
pickEnd(PickContext pc)
Pops the view-dependent transform from the specified pick context.
|
void |
setLocation(double x,
double y,
double z)
Sets the view-independent location of the center of this handle.
|
void |
setLocation(Point3 p)
Sets the view-independent location of the center of this handle.
|
static void |
setSize(double size)
Sets the size in pixels of all handles.
|
void |
setTransform(Matrix44 transform)
Sets the view-independent transform matrix for this handle.
|
addChild, countChildren, cull, draw, getAttributeBits, getChildren, pick, removeChild
countParents, cullApply, dirtyBoundingSphere, dirtyDraw, drawApply, getBoundingSphere, getParents, getStates, getWorld, isSelected, pickApply, selectedChanged, setSelected, setStates
protected Handle(Matrix44 transform)
transform
- the transform matrix.protected Handle(Point3 p)
p
- the center point.protected Handle(double x, double y, double z)
x
- the center x coordinate.y
- the center y coordinate.z
- the center z coordinate.public static double getSize()
public static void setSize(double size)
size
- the size.public Matrix44 getTransform()
public void setTransform(Matrix44 transform)
transform
- the transform.public Point3 getLocation()
public void setLocation(Point3 p)
p
- the center point.public void setLocation(double x, double y, double z)
x
- the center x coordinate.y
- the center y coordinate.z
- the center z coordinate.protected BoundingSphere computeBoundingSphere(boolean finite)
computeBoundingSphere
in class Group
finite
- true, to force bounding sphere to be finite.protected void cullBegin(CullContext cc)
protected void cullEnd(CullContext cc)
protected void drawBegin(DrawContext dc)
protected void drawEnd(DrawContext dc)
protected void pickBegin(PickContext pc)
protected void pickEnd(PickContext pc)