|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.BufferState
org.j3d.aviatrix3d.ColorBufferState
public class ColorBufferState
Describes attributes used when interacting with the colour buffer.
Including this state class in the global setup automatically enables colour buffering. If an instance of this state is not included in the scene, the default values, and depth testing are enabled automatically. Use this class to override the defaults, or to deliberately disable depth testing.
The default setup for this class has all 4 colour channels enabled:
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.BufferState |
---|
lastParent, liveCount, parentList |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.rendering.BufferStateRenderable |
---|
ACCUMULATION_BUFFER, COLOR_BUFFER, DEPTH_BUFFER, GENERAL_BUFFER, STENCIL_BUFFER |
Constructor Summary | |
---|---|
ColorBufferState()
Constructs a state set with default values. |
Method Summary | |
---|---|
boolean |
checkClearBufferState()
Check to see if this buffer should be cleared at the start of this run. |
void |
clearBufferState(javax.media.opengl.GL gl)
Restore all state to the default values. |
int |
compareTo(ColorBufferState cbs)
Compares this object with the specified object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(ColorBufferState cbs)
Compares this object with the specified object to check for equivalence. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
float |
getAlpha()
Get the current alpha channel clear value |
float |
getBlue()
Get the current blue channel clear value |
int |
getBufferBitMask()
Get the GL buffer bit flag that this state class represents. |
int |
getBufferType()
Get the type of buffer this state represents. |
float |
getGreen()
Get the current green channel clear value |
float |
getRed()
Get the current red channel clear value |
boolean |
isAlphaEnabled()
Check to see if the alpha channel is currently enabled |
boolean |
isBlueEnabled()
Check to see if the blue channel is currently enabled |
boolean |
isGreenEnabled()
Check to see if the green channel is currently enabled |
boolean |
isRedEnabled()
Check to see if the red channel is currently enabled |
void |
setBufferState(javax.media.opengl.GL gl)
Issue ogl commands needed for this buffer to set the initial state, including the initial enabling. |
void |
setClearBufferState(boolean clear)
Set the flag for whether the buffer state should be cleared when this state object is executed. |
void |
setClearColor(float red,
float green,
float blue,
float alpha)
Set the value that each of the colour channels should be cleared to. |
void |
setColorMask(boolean red,
boolean green,
boolean blue,
boolean alpha)
Set the flags describing which channels should be enabled in the colour buffer. |
void |
updateBufferState(javax.media.opengl.GL gl)
Issue ogl commands needed for this component to change the state, assuming that it is already enabled. |
Methods inherited from class org.j3d.aviatrix3d.BufferState |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorBufferState()
Method Detail |
---|
public int getBufferType()
getBufferType
in interface BufferStateRenderable
public int getBufferBitMask()
getBufferBitMask
in interface BufferStateRenderable
public boolean checkClearBufferState()
checkClearBufferState
in interface BufferStateRenderable
public void setBufferState(javax.media.opengl.GL gl)
setBufferState
in interface BufferStateRenderable
gl
- The gl context to draw withpublic void updateBufferState(javax.media.opengl.GL gl)
updateBufferState
in interface BufferStateRenderable
gl
- The gl context to draw withpublic void clearBufferState(javax.media.opengl.GL gl)
clearBufferState
in interface BufferStateRenderable
gl
- The gl context to draw withpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public void setClearBufferState(boolean clear) throws InvalidWriteTimingException
clear
- True if the buffer should be cleared when this is the first
state to be used in the current operation
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setColorMask(boolean red, boolean green, boolean blue, boolean alpha) throws InvalidWriteTimingException
red
- true if the red channel should be enabledgreen
- true if the green channel should be enabledblue
- true if the blue channel should be enabledalpha
- true if the alpha channel should be enabled
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isRedEnabled()
public boolean isGreenEnabled()
public boolean isBlueEnabled()
public boolean isAlphaEnabled()
public void setClearColor(float red, float green, float blue, float alpha) throws InvalidWriteTimingException
red
- The red channel clear valuegreen
- The green channel clear valueblue
- The blue channel clear valuealpha
- The alpha channel clear value
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data update callback methodpublic float getRed()
public float getGreen()
public float getBlue()
public float getAlpha()
public int compareTo(ColorBufferState cbs)
cbs
- The attributes instance to be comcbsred
public boolean equals(ColorBufferState cbs)
cbs
- The attributes instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |