public abstract class NURBSObject extends java.lang.Object implements Renderable
TRANSPARENT, TWO_DIMENSIONAL
Modifier and Type | Method and Description |
---|---|
boolean |
controlPointIsSelected(int i) |
Vector4d |
getControlPoint(int i) |
Vector4d[] |
getControlPoints()
Returns the control points used by this curve.
|
boolean |
getDrawControlShape() |
int |
getLineWidth() |
RigidTransform3d |
getObjToWorld()
Returns the 3D transform from the coordinate frame of this
NURBS object to the world.
|
void |
getObjToWorld(RigidTransform3d TOW)
Gets the 3D transform from the coordinate frame of this
NURBS object to the world.
|
int |
getPointSize() |
int |
getRenderHints()
Returns a bit code giving rendering hints about this renderable.
|
RenderProps |
getRenderProps()
Returns the render properities for this object.
|
void |
getSelection(java.util.LinkedList<java.lang.Object> list,
int qid)
Append to
list the component (or components) associated with
the qid -th selection query issued by this component's render
method. |
boolean |
isSelectable()
Returns true if this object is in fact selectable.
|
int |
numControlPoints()
Returns the number of control points used by this curve.
|
int |
numSelectionQueriesNeeded()
If this selectable manages its own selection (by issuing selection
queries within its
render method), then this method should
return the maximum number of selection queries that will be
required. |
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
abstract void |
render(Renderer renderer,
RenderProps props,
int flags) |
void |
selectControlPoint(int i,
boolean selected) |
void |
setDrawControlShape(boolean enable) |
void |
setLineWidth(int w) |
void |
setObjToWorld(RigidTransform3d TOW)
Sets the 3D transform from the coordinate frame of this
NURBS object to the world.
|
void |
setPointSize(int w) |
void |
setRenderProps(RenderProps props)
Assigns a new set of render properties to this object.
|
void |
transform(AffineTransform3dBase X)
Applies an affine transformation to the control points this NURBS
object.
|
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
void |
write(java.io.PrintWriter pw)
Writes a text description of this NURBS object to a PrintWriter, using a
subset of the Wavefront OBJ format described in the documentation for the
read method for this object. |
void |
write(java.io.PrintWriter pw,
java.lang.String fmtStr)
Writes a text description of this NURBS object to a PrintWriter, using a
subset of the Wavefront OBJ format described in the documentation
for the
read method for this object. |
abstract void |
write(java.io.PrintWriter pw,
java.lang.String fmtStr,
boolean relative)
Writes a text description of this NURBS object to a PrintWriter, using a
subset of the Wavefront OBJ format as described in the documentation
for the
read method for this object. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createRenderProps
public RigidTransform3d getObjToWorld()
public void getObjToWorld(RigidTransform3d TOW)
public void setObjToWorld(RigidTransform3d TOW)
public void setLineWidth(int w)
public int getLineWidth()
public void setPointSize(int w)
public int getPointSize()
public boolean getDrawControlShape()
public void setDrawControlShape(boolean enable)
public int numControlPoints()
public Vector4d getControlPoint(int i)
public Vector4d[] getControlPoints()
public void selectControlPoint(int i, boolean selected)
public boolean controlPointIsSelected(int i)
public void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
IsSelectable
list
the component (or components) associated with
the qid
-th selection query issued by this component's render
method. This will only be called if this component manages its own
selection (i.e., the number nums
returned by IsSelectable.numSelectionQueriesNeeded()
is positive), and qid
will in
turn be a number between 0 and nums
-1.getSelection
in interface IsSelectable
list
- selected objects are appended to the end of this listqid
- index of the selection querypublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface IsRenderable
pmin
- minimum pointpmax
- maximum pointpublic boolean isSelectable()
isSelectable
in interface IsSelectable
public int numSelectionQueriesNeeded()
IsSelectable
render
method), then this method should
return the maximum number of selection queries that will be
required. Otherwise, this method should return -1.numSelectionQueriesNeeded
in interface IsSelectable
public void prerender(RenderList list)
IsRenderable
list.addIfVisible (obj);
for each of the objects in question.prerender
in interface IsRenderable
list
- list of objects to be renderedpublic int getRenderHints()
IsRenderable
TRANSPARENT
and
TWO_DIMENSIONAL
.getRenderHints
in interface IsRenderable
public void write(java.io.PrintWriter pw) throws java.io.IOException
read
method for this object.pw
- PrintWriter for outputing the text descriptionjava.io.IOException
- if an I/O error occurspublic void write(java.io.PrintWriter pw, java.lang.String fmtStr) throws java.io.IOException
read
method for this object.pw
- PrintWriter for outputing the text descriptionfmtStr
- printf-style format string for formatting the floating point values (e.g.,
"%g", "%10.3f").java.io.IOException
- if an I/O error occurspublic abstract void write(java.io.PrintWriter pw, java.lang.String fmtStr, boolean relative) throws java.io.IOException
read
method for this object.pw
- PrintWriter for outputing the text descriptionfmtStr
- printf-style format string for formatting the floating point values (e.g.,
"%g", "%10.3f").relative
- if true, then control point indices are written as negative values giving
their location relative to the curv
statement.java.io.IOException
- if an I/O error occurspublic void setRenderProps(RenderProps props)
null
will remove render properties from this object.setRenderProps
in interface HasRenderProps
props
- new render properties for this objectpublic RenderProps getRenderProps()
getRenderProps
in interface HasRenderProps
public void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
renderer
- provides the functionality used to perform the rendering.flags
- flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT
and
Renderer.SORT_FACES
.public abstract void render(Renderer renderer, RenderProps props, int flags)
public void transform(AffineTransform3dBase X)
X
- affine transformation