| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Group com.sun.j3d.utils.geometry.Primitive
All known Subclasses: com.sun.j3d.utils.geometry.Cone, com.sun.j3d.utils.geometry.Box, com.sun.j3d.utils.geometry.Sphere, com.sun.j3d.utils.geometry.Cylinder,
Primitive | abstract public class Primitive extends Group (Code) | | Base class for all Java 3D primitives. By default all primitives
with the same parameters share their geometry (e.g., you can have 50
shperes in your scene, but the geometry is stored only once). A
change to one primitive will effect all shared nodes. Another
implication of this implementation is that the capabilities of the
geometry are shared, and once one of the shared nodes is live, the
capabilities cannot be set. Use the GEOMETRY_NOT_SHARED flag if
you do not wish to share geometry among primitives with the same
parameters.
|
Constructor Summary | |
public | Primitive() Constructs a default primitive. |
Method Summary | |
protected void | cacheGeometry(int kind, float a, float b, float c, int d, int e, int flags, GeomBuffer geo) | public static void | clearGeometryCache() Clear the shared geometry cache for all Primitive types.
Existing Shapes with shared geometry will continue to share
the geometry. | public Appearance | getAppearance() Gets the appearance of the primitive (defaults to first subpart). | abstract public Appearance | getAppearance(int partId) Gets the appearance of the specified part of the primitive.
Parameters: partId - identifier for a given subpart of the primitive The appearance object associated with the partID. | protected GeomBuffer | getCachedGeometry(int kind, float a, float b, float c, int d, int e, int flags) | public int | getNumTriangles() Returns the total number of triangles in this primitive. | public int | getNumVertices() Returns the total number of vertices in this primitive. | public int | getPrimitiveFlags() Returns the flags of primitive (generate normal, textures, caching, etc). | abstract public Shape3D | getShape(int partid) Obtains a shape node of a subpart of the primitive. | public void | setAppearance(int partid, Appearance ap) Sets the appearance of a subpart given a partid. | abstract public void | setAppearance(Appearance ap) Sets the main appearance of the primitive (all subparts) to
same appearance. | public void | setAppearance() Sets the main appearance of the primitive (all subparts) to
a default white appearance. | public void | setNumTriangles(int num) | public void | setNumVertices(int num) | public void | setPrimitiveFlags(int fl) | String | strfloat(float x) |
BOTTOM_DISK | final static int BOTTOM_DISK(Code) | | |
CONE | final static int CONE(Code) | | |
CONE_DIVISIONS | final static int CONE_DIVISIONS(Code) | | |
CYLINDER | final static int CYLINDER(Code) | | |
ENABLE_APPEARANCE_MODIFY | final public static int ENABLE_APPEARANCE_MODIFY(Code) | | Specifies that the ALLOW_APPEARANCE_READ and
ALLOW_APPEARANCE_WRITE bits are to be set on the generated
geometry's Shape3D nodes.
|
ENABLE_GEOMETRY_PICKING | final public static int ENABLE_GEOMETRY_PICKING(Code) | | Specifies that the ALLOW_INTERSECT
capability bit should be set on the generated geometry.
This allows the object
to be picked using Geometry based picking.
|
GENERATE_NORMALS | final public static int GENERATE_NORMALS(Code) | | Specifies that normals are generated along with the positions.
|
GENERATE_NORMALS_INWARD | final public static int GENERATE_NORMALS_INWARD(Code) | | Specifies that normals are to be flipped along the surface.
|
GENERATE_TEXTURE_COORDS | final public static int GENERATE_TEXTURE_COORDS(Code) | | Specifies that texture coordinates are generated along with the
positions.
|
GENERATE_TEXTURE_COORDS_Y_UP | final public static int GENERATE_TEXTURE_COORDS_Y_UP(Code) | | Specifies that texture coordinates are to be Y up.
since: Java 3D 1.5.1 |
GEOMETRY_NOT_SHARED | final public static int GEOMETRY_NOT_SHARED(Code) | | Specifies that the geometry being created will not be shared by
another scene graph node. By default all primitives created with
the same parameters share their geometry (e.g., you can have 50
spheres in your scene, but the geometry is stored only once). A
change to one primitive will effect all shared nodes. You
specify this flag if you do not wish to share any geometry among
primitives of the same parameters.
|
SPHERE | final static int SPHERE(Code) | | |
TOP_DISK | final static int TOP_DISK(Code) | | |
flags | int flags(Code) | | Primitive flags.
|
Primitive | public Primitive()(Code) | | Constructs a default primitive.
|
cacheGeometry | protected void cacheGeometry(int kind, float a, float b, float c, int d, int e, int flags, GeomBuffer geo)(Code) | | |
clearGeometryCache | public static void clearGeometryCache()(Code) | | Clear the shared geometry cache for all Primitive types.
Existing Shapes with shared geometry will continue to share
the geometry. New Primitives will create new shared geometry.
since: Java 3D 1.3.2 |
getAppearance | public Appearance getAppearance()(Code) | | Gets the appearance of the primitive (defaults to first subpart).
|
getAppearance | abstract public Appearance getAppearance(int partId)(Code) | | Gets the appearance of the specified part of the primitive.
Parameters: partId - identifier for a given subpart of the primitive The appearance object associated with the partID. If aninvalid partId is passed in, null is returned. since: Java 3D 1.2.1 |
getCachedGeometry | protected GeomBuffer getCachedGeometry(int kind, float a, float b, float c, int d, int e, int flags)(Code) | | |
getNumTriangles | public int getNumTriangles()(Code) | | Returns the total number of triangles in this primitive.
the total number of triangles in this primitive |
getNumVertices | public int getNumVertices()(Code) | | Returns the total number of vertices in this primitive.
the total number of vertices in this primitive |
getPrimitiveFlags | public int getPrimitiveFlags()(Code) | | Returns the flags of primitive (generate normal, textures, caching, etc).
|
getShape | abstract public Shape3D getShape(int partid)(Code) | | Obtains a shape node of a subpart of the primitive.
Parameters: partid - identifier for a given subpart of the primitive. |
setAppearance | public void setAppearance(int partid, Appearance ap)(Code) | | Sets the appearance of a subpart given a partid.
|
setAppearance | abstract public void setAppearance(Appearance ap)(Code) | | Sets the main appearance of the primitive (all subparts) to
same appearance.
|
setAppearance | public void setAppearance()(Code) | | Sets the main appearance of the primitive (all subparts) to
a default white appearance.
|
setNumTriangles | public void setNumTriangles(int num)(Code) | | |
setNumVertices | public void setNumVertices(int num)(Code) | | |
setPrimitiveFlags | public void setPrimitiveFlags(int fl)(Code) | | |
|
|