: Class PolygonAttributes

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.media.j3d
Class PolygonAttributes

    java.lang.Object
      |
      +--javax.media.j3d.SceneGraphObject
            |
            +--javax.media.j3d.NodeComponent
                  |
                  +--javax.media.j3d.PolygonAttributes

public class PolygonAttributes
extends NodeComponent

The PolygonAttributes object defines all rendering state that can be set as a component object of a Shape3D node.

Field Summary
`static int` | `ALLOW_CULL_FACE_READ` Specifies that this PolygonAttributes object allows reading its cull face information.
`static int` | `ALLOW_CULL_FACE_WRITE` Specifies that this PolygonAttributes object allows writing its cull face information.
`static int` | `ALLOW_MODE_READ` Specifies that this PolygonAttributes object allows reading its polygon mode information.
`static int` | `ALLOW_MODE_WRITE` Specifies that this PolygonAttributes object allows writing its polygon mode information.
`static int` | `ALLOW_NORMAL_FLIP_READ` Specifies that this PolygonAttributes object allows reading its back face normal flip flag.
`static int` | `ALLOW_NORMAL_FLIP_WRITE` Specifies that this PolygonAttributes object allows writing its back face normal flip flag.
`static int` | `ALLOW_OFFSET_READ` Specifies that this PolygonAttributes object allows reading its polygon offset information.
`static int` | `ALLOW_OFFSET_WRITE` Specifies that this PolygonAttributes object allows writing its polygon offset information.
`static int` | `CULL_BACK` Cull all back-facing polygons.
`static int` | `CULL_FRONT` Cull all front-facing polygons.
`static int` | `CULL_NONE` Don't perform any face culling.
`static int` | `POLYGON_FILL` Render polygonal primitives by filling the interior of the polygon.
`static int` | `POLYGON_LINE` Render polygonal primitives as lines drawn between consecutive vertices of the polygon.
`static int` | `POLYGON_POINT` Render polygonal primitives as points drawn at the vertices of the polygon.

Constructor Summary
`PolygonAttributes()` Constructs a PolygonAttributes object with default parameters.
`PolygonAttributes(int polygonMode, int cullFace, float polygonOffset)` Constructs a PolygonAttributes object with specified values.
`PolygonAttributes(int polygonMode, int cullFace, float polygonOffset, boolean backFaceNormalFlip)` Constructs PolygonAttributes object with specified values.

Method Summary
`NodeComponent` | `cloneNodeComponent()` Creates a new PolygonAttributes object.
`void` | `duplicateNodeComponent(NodeComponent originalNodeComponent)` Copies the information found in `originalNodeComponent` to the current node.
`boolean` | `getBackFaceNormalFlip()` Gets the back face normal flip flag.
`int` | `getCullFace()` Gets the face culling for this appearance component object.
`int` | `getPolygonMode()` Gets the polygon rasterization mode for this appearance component object.
`float` | `getPolygonOffset()` Gets the polygon offset.
`void` | `setBackFaceNormalFlip(boolean backFaceNormalFlip)` Sets the back face normal flip flag to the specified value.
`void` | `setCullFace(int cullFace)` Sets the face culling for this appearance component object.
`void` | `setPolygonMode(int polygonMode)` Sets the polygon rasterization mode for this appearance component object.
`void` | `setPolygonOffset(float polygonOffset)` Sets the polygon offset to the specified value.

Methods inherited from class javax.media.j3d.NodeComponent
`getDuplicateOnCloneTree, setDuplicateOnCloneTree`

Methods inherited from class javax.media.j3d.SceneGraphObject
`clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ALLOW_CULL_FACE_READ

    public static final int ALLOW_CULL_FACE_READ

  Specifies that this PolygonAttributes object allows reading its cull face information.

### ALLOW_CULL_FACE_WRITE

    public static final int ALLOW_CULL_FACE_WRITE

  Specifies that this PolygonAttributes object allows writing its cull face information.

### ALLOW_NORMAL_FLIP_READ

    public static final int ALLOW_NORMAL_FLIP_READ

  Specifies that this PolygonAttributes object allows reading its back face normal flip flag.

### ALLOW_NORMAL_FLIP_WRITE

    public static final int ALLOW_NORMAL_FLIP_WRITE

  Specifies that this PolygonAttributes object allows writing its back face normal flip flag.

### ALLOW_MODE_READ

    public static final int ALLOW_MODE_READ

  Specifies that this PolygonAttributes object allows reading its polygon mode information.

### ALLOW_MODE_WRITE

    public static final int ALLOW_MODE_WRITE

  Specifies that this PolygonAttributes object allows writing its polygon mode information.

### ALLOW_OFFSET_READ

    public static final int ALLOW_OFFSET_READ

  Specifies that this PolygonAttributes object allows reading its polygon offset information.

### ALLOW_OFFSET_WRITE

    public static final int ALLOW_OFFSET_WRITE

  Specifies that this PolygonAttributes object allows writing its polygon offset information.

### POLYGON_POINT

    public static final int POLYGON_POINT

  Render polygonal primitives as points drawn at the vertices of the polygon.

### POLYGON_LINE

    public static final int POLYGON_LINE

  Render polygonal primitives as lines drawn between consecutive vertices of the polygon.

### POLYGON_FILL

    public static final int POLYGON_FILL

  Render polygonal primitives by filling the interior of the polygon.

### CULL_NONE

    public static final int CULL_NONE

  Don't perform any face culling.

### CULL_BACK

    public static final int CULL_BACK

  Cull all back-facing polygons.

### CULL_FRONT

    public static final int CULL_FRONT

  Cull all front-facing polygons.

Constructor Detail

### PolygonAttributes

    public PolygonAttributes()

  Constructs a PolygonAttributes object with default parameters. The default values are as follows:
  cull face : CULL_BACK
  back face normal flip : false
  polygon mode : POLYGON_FILL
  polygon offset : 0.0

### PolygonAttributes

    public PolygonAttributes(int polygonMode,
                             int cullFace,
                             float polygonOffset)

  Constructs a PolygonAttributes object with specified values.
  Parameters:
    `polygonMode` - polygon rasterization mode.
    `cullFace` - polygon culling mode.
    `polygonOffset` - polygon offset.

### PolygonAttributes

    public PolygonAttributes(int polygonMode,
                             int cullFace,
                             float polygonOffset,
                             boolean backFaceNormalFlip)

  Constructs PolygonAttributes object with specified values.
  Parameters:
    `polygonMode` - polygon rasterization mode.
    `cullFace` - polygon culling mode.
    `polygonOffset` - polygon offset.
    `backFaceNormalFlip` - back face normal flip flag

Method Detail

### setCullFace

    public final void setCullFace(int cullFace)

  Sets the face culling for this appearance component object.
  Parameters:
    `cullFace` - the face to be culled, one of: CULL_NONE, CULL_FRONT, or CULL_BACK
  Throws:
    CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

### getCullFace

    public final int getCullFace()

  Gets the face culling for this appearance component object.
  Returns:
    the face to be culled
  Throws:
    CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

### setBackFaceNormalFlip

    public final void setBackFaceNormalFlip(boolean backFaceNormalFlip)

  Sets the back face normal flip flag to the specified value. This flag indicates whether vertex normals of back facing polygons should be flipped (negated) prior to lighting. When this flag is set to true and back face culling is disabled, polygons are rendered as if the polygon had two sides with opposing normals. This feature is disabled by default.
  Parameters:
    `backFaceNormalFlip` - the back face normal flip flag
  Throws:
    CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

### getBackFaceNormalFlip

    public final boolean getBackFaceNormalFlip()

  Gets the back face normal flip flag.
  Returns:
    the back face normal flip flag
  Throws:
    CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

### setPolygonMode

    public final void setPolygonMode(int polygonMode)

  Sets the polygon rasterization mode for this appearance component object.
  Parameters:
    `polygonMode` - the polygon rasterization mode to be used; one of POLYGON_FILL, POLYGON_LINE, or POLYGON_POINT
  Throws:
    CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

### getPolygonMode

    public final int getPolygonMode()

  Gets the polygon rasterization mode for this appearance component object.
  Returns:
    the polygon rasterization mode
  Throws:
    CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

### setPolygonOffset

    public final void setPolygonOffset(float polygonOffset)

  Sets the polygon offset to the specified value. This screen space offset is added to the final, device coordinate Z value of polygon primitives.
  Parameters:
    `polygonOffset` - the polygon offset
  Throws:
    CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

### getPolygonOffset

    public final float getPolygonOffset()

  Gets the polygon offset.
  Returns:
    the polygon offset
  Throws:
    CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

### cloneNodeComponent

    public NodeComponent cloneNodeComponent()

  Creates a new PolygonAttributes object. Called from a Leaf node's `duplicateNode` method.
  Overrides:
    cloneNodeComponent in class NodeComponent
  Returns:
    a duplicate of the PolygonAttributes object.
  See Also:
    `Node.duplicateNode(javax.media.j3d.Node, boolean)`, `Node.cloneTree()`, `NodeComponent.setDuplicateOnCloneTree(boolean)`

### duplicateNodeComponent

    public void duplicateNodeComponent(NodeComponent originalNodeComponent)

  Copies the information found in `originalNodeComponent` to the current node. This routine is called as part of the `cloneTree` operation.
  Overrides:
    duplicateNodeComponent in class NodeComponent
  Parameters:
    `originalNodeComponent` - the node to duplicate.
  See Also:
    `Node.cloneTree()`, `Node.duplicateNode(javax.media.j3d.Node, boolean)`, `NodeComponent.setDuplicateOnCloneTree(boolean)`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD