|
AWT Shape Extruder | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.interactivemesh.j3d.community.utils.geometry.AWTShapeExtrusion
public class AWTShapeExtrusion
An AWTShapeExtrusion object is used to describe the extrusion path for a AWTShapeExtruder object. The extrusion path defines the edge contour of its AWT Shape object. This contour is perpendicular to the face of the AWT Shape and must be monotonic in x.
The shape of the extrusion path is, by default, a straight line
from 0.0 to 0.2 (known as a straight bevel). The shape may be
modified via the extrusionShape parameter, also a java.awt.Shape
object that describes the 3D contour of the AWT Shape object.
User is responsible for data sanity and must make sure that extrusionShape does not cause intersections. Else undefined output may be generated.
AWTShapeExtrusion is a generalized version of javax.media.j3d.FontExtrusion
.
AWTShapeExtruder
Constructor Summary | |
---|---|
AWTShapeExtrusion()
Constructs an AWTShapeExtrusion object with default parameters. |
|
AWTShapeExtrusion(float depth)
Constructs an AWTShapeExtrusion object with a straight bevel extrusion shape, a straight line from 0.0 to depth. |
|
AWTShapeExtrusion(java.awt.Shape extrusionShape)
Constructs an AWTShapeExtrusion object with the specified extrusion shape, using the default tessellation tolerance. |
|
AWTShapeExtrusion(java.awt.Shape extrusionShape,
double tessellationTolerance)
Constructs an AWTShapeExtrusion object with the specified extrusion shape, using the specified tessellation tolerance. |
Method Summary | |
---|---|
float |
getDepth()
Returns the length of extrusion either of the straight bevel extrusion shape or of the specified extrusion shape. |
javax.vecmath.Point2f[] |
getExtrusion()
Returns the boundary of the specified extrusion shape. |
java.awt.Shape |
getExtrusionShape()
Returns the AWTShapeExtrusion's shape parameter. |
double |
getTessellationTolerance()
Returns the tessellation tolerance with which the geometry of the extrusion shape will be created. |
boolean |
isT3DStyleExtrusion()
Returns the state of the Text3D-style extrusion enable flag. |
void |
setExtrusionShape(java.awt.Shape extrusionShape)
Sets the AWTShapeExtrusion's shape parameter. |
void |
setStraightBevelExtrusionShape(float depth)
Sets the AWTShapeExtrusion's shape to a straight bevel extrusion shape, a straight line from 0.0 to depth. |
void |
setT3DStyleExtrusion(boolean enable)
Enables or disables Text3D-style extrusion. |
void |
setTessellationTolerance(double tessellationTolerance)
Sets the tessellation tolerance with which the geometry of the extrusion shape will be created. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AWTShapeExtrusion()
A null extrusion shape specifies that a straight line from 0.0 to 0.2 (straight bevel) is used.
AWTShapeExtruder
public AWTShapeExtrusion(float depth)
depth
- length of extrusion
java.lang.IllegalArgumentException
- if depth is less than 0.0AWTShapeExtruder
public AWTShapeExtrusion(java.awt.Shape extrusionShape)
extrusionShape
- the shape object to use to generate the
extrusion path.
A null shape specifies that a straight line from 0.0 to 0.2
(straight bevel) is used.
java.lang.IllegalArgumentException
- if multiple contours in
extrusionShape, or contour is not monotonic or least x-value
of a contour point is not 0.0fAWTShapeExtruder
public AWTShapeExtrusion(java.awt.Shape extrusionShape, double tessellationTolerance)
extrusionShape
- the shape object to use to generate the extrusion path.
A null shape specifies that a straight line from 0.0 to 0.2
(straight bevel) is used.tessellationTolerance
- the tessellation tolerance value
used in tessellating the extrusion shape.
This corresponds to the flatness
parameter in
the java.awt.Shape.getPathIterator
method.
java.lang.IllegalArgumentException
- if multiple contours in
extrusionShape, or contour is not monotonic or least x-value
of a contour point is not 0.0fAWTShapeExtruder
Method Detail |
---|
public java.awt.Shape getExtrusionShape()
null
if a straight bevel extrusion shape is setpublic void setExtrusionShape(java.awt.Shape extrusionShape)
extrusionShape
- the shape object to use to generate the
extrusion path.
A null shape specifies that a straight line from 0.0 to 0.2
(straight bevel) is used.
java.lang.IllegalArgumentException
- if multiple contours in
extrusionShape, or contour is not monotonic or least x-value
of a contour point is not 0.0fpublic void setStraightBevelExtrusionShape(float depth)
depth
- length of extrusion
java.lang.IllegalArgumentException
- if depth is less than 0.0public double getTessellationTolerance()
public void setTessellationTolerance(double tessellationTolerance)
This corresponds to the flatness
parameter in
the java.awt.Shape.getPathIterator
method.
tessellationTolerance
- the tessellation tolerance value
used in tessellating the extrusion shape.public boolean isT3DStyleExtrusion()
false
.
public void setT3DStyleExtrusion(boolean enable)
This flag allows to switch to Text3D-style extrusion
combined with the advantages of smooth shading and solid geometry.
This provides an (interim) alternative for the not yet perfectly functioning
curved shape extrusion.
The default state is false
.
enable
- true or false to enable or disable Text3D-style extrusionpublic javax.vecmath.Point2f[] getExtrusion()
null
if a straight bevel extrusion shape is setpublic float getDepth()
|
AWT Shape Extruder | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |