Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class PointAttributes

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.NodeComponent
          extended by org.j3d.aviatrix3d.PointAttributes
All Implemented Interfaces:
java.lang.Comparable, AppearanceAttributeRenderable, ObjectRenderable, Renderable

public class PointAttributes
extends NodeComponent
implements AppearanceAttributeRenderable

Describes attributes used when rendering a point.

Points only have a two controllable attributes - the size and whether antialiasing should be available.

If point sprites are available, this class can be used to enable or disable their use. Note that to use them completely, you also need to enable the equivalent state with TextureAttributes.setPointSpriteCoordEnabled(boolean)

Version:
$Revision: 1.15 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
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.AppearanceAttributeRenderable
ALPHA_ATTRIBUTE, BLEND_ATTRIBUTE, DEPTH_ATTRIBUTE, LINE_ATTRIBUTE, POINT_ATTRIBUTE, POLYGON_ATTRIBUTE, STENCIL_ATTRIBUTE
 
Constructor Summary
PointAttributes()
          Constructs a attribute set with default values of 1.0 point size and no antialiasing.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 int compareTo(PointAttributes pa)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object o)
          Compare this object for equality to the given object.
 boolean equals(PointAttributes pa)
          Compares this object with the specified object to check for equivalence.
 void getAttenuationFactors(float[] factor)
          Attenuation factor values.
 int getAttributeType()
          Get the type this visual attribute represents.
 float getFadeThresholdSize()
          Get the current point size in use.
 float getMaxPointSize()
          Get the current maximum point size in use.
 float getMinPointSize()
          Get the current minimum point size in use.
 float getPointSize()
          Get the current point size in use.
 boolean isAntiAliased()
          Check the state of the antialiased flag setting for this geometry.
 boolean isPointSpriteAllowed()
          Convenience method to check if this code has detected the prescense of multitexture extensions.
 boolean isPointSpriteEnabled()
          Get the current state of the whether the point sprites coordinates are enabled.
 void postRender(javax.media.opengl.GL gl)
          Restore all openGL state to the given drawable.
 void render(javax.media.opengl.GL gl)
          Issue ogl commands needed for this component
 void setAntiAliased(boolean state)
          Set the antialiased flag state.
 void setAttenuationFactors(float a, float b, float c)
          Set the blend colour to use for this texture.
 void setFadeThresholdSize(float size)
          Set the minimum threshold size in pixels for when multisampling is enabled.
 void setMaxPointSize(float size)
          Set the size in pixels of the point size.
 void setMinPointSize(float size)
          Set the size in pixels of the point size.
 void setPointSize(float size)
          Set the size in pixels of the point size.
 void setPointSpriteEnabled(boolean state)
          Set the point sprite enabled flag.
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
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

PointAttributes

public PointAttributes()
Constructs a attribute set with default values of 1.0 point size and no antialiasing.

Method Detail

getAttributeType

public int getAttributeType()
Get the type this visual attribute represents.

Specified by:
getAttributeType in interface AppearanceAttributeRenderable
Returns:
One of the _ATTRIBUTE constants

render

public void render(javax.media.opengl.GL gl)
Issue ogl commands needed for this component

Specified by:
render in interface ObjectRenderable
Parameters:
gl - The gl context to draw with

postRender

public void postRender(javax.media.opengl.GL gl)
Restore all openGL state to the given drawable.

Specified by:
postRender in interface ObjectRenderable
Parameters:
gl - The gl context to draw with

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The objec to be compared
Returns:
-1, 0 or 1 depending on order
Throws:
java.lang.ClassCastException - The specified object's type prevents it from being compared to this Object

equals

public boolean equals(java.lang.Object o)
Compare this object for equality to the given object.

Specified by:
equals in interface Renderable
Overrides:
equals in class java.lang.Object
Parameters:
o - The object to be compared
Returns:
True if these represent the same values

setAntiAliased

public void setAntiAliased(boolean state)
                    throws InvalidWriteTimingException
Set the antialiased flag state. By antialiasing is off.

Parameters:
state - True to use antialiasing, false to turn it off
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

isAntiAliased

public boolean isAntiAliased()
Check the state of the antialiased flag setting for this geometry.

Returns:
true if antialiasing is currently enabled

setPointSize

public void setPointSize(float size)
                  throws InvalidWriteTimingException
Set the size in pixels of the point size. Point size must be greater than zero.

Parameters:
size - The size of the line in pixels
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException - Point size was non-positive

getPointSize

public float getPointSize()
Get the current point size in use.

Returns:
A value greater than zero

setFadeThresholdSize

public void setFadeThresholdSize(float size)
                          throws InvalidWriteTimingException
Set the minimum threshold size in pixels for when multisampling is enabled. Point size must be greater than zero. This overrides the normal minimum point size as per specification. A value of 1 will disable this setting.

Parameters:
size - The size of the line in pixels
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException - Point size was non-positive

getFadeThresholdSize

public float getFadeThresholdSize()
Get the current point size in use.

Returns:
A value greater than zero

setMinPointSize

public void setMinPointSize(float size)
                     throws InvalidWriteTimingException
Set the size in pixels of the point size. Point size must be greater than zero.

Parameters:
size - The size of the line in pixels
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException - Point size was non-positive

getMinPointSize

public float getMinPointSize()
Get the current minimum point size in use.

Returns:
A value greater than zero

setMaxPointSize

public void setMaxPointSize(float size)
                     throws InvalidWriteTimingException
Set the size in pixels of the point size. Point size must be greater than zero.

Parameters:
size - The size of the line in pixels
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException - Point size was non-positive

getMaxPointSize

public float getMaxPointSize()
Get the current maximum point size in use.

Returns:
A value greater than zero

setAttenuationFactors

public void setAttenuationFactors(float a,
                                  float b,
                                  float c)
                           throws InvalidWriteTimingException
Set the blend colour to use for this texture. Blend is a 4-component colour value. Setting all the factors to a value of 1 will effectively disable the use of this function.

Parameters:
a - The first param of the attenuation function
b - The second param of the attenuation function
c - The third param of the attenuation function
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getAttenuationFactors

public void getAttenuationFactors(float[] factor)
Attenuation factor values. If none have been set or have been cleared, nothing is copied in.

Parameters:
factor - An array, length 3 to copy the factors into

setPointSpriteEnabled

public void setPointSpriteEnabled(boolean state)
                           throws InvalidWriteTimingException
Set the point sprite enabled flag. By default this is disabled. Note that to use them completely, you also need to enable the equivalent state with TextureAttributes.setPointSpriteCoordEnabled(boolean)

Parameters:
state - true if this texture unit should enable point sprite coordinates. False to disable
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

isPointSpriteEnabled

public boolean isPointSpriteEnabled()
Get the current state of the whether the point sprites coordinates are enabled.

Returns:
true if the point sprite coordinates are enabled

isPointSpriteAllowed

public boolean isPointSpriteAllowed()
Convenience method to check if this code has detected the prescense of multitexture extensions. If none are found, this will return null. However, one node instance has to have passed through the rendering cycle for this to have detected it. A better option would be to make use of the appropriate callbacks on the GraphicsOutputDevice APIs to detect before you get to this point.

Returns:
true if multitexture is allowed

compareTo

public int compareTo(PointAttributes pa)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Parameters:
pa - The attributes instance to be compared
Returns:
-1, 0 or 1 depending on order

equals

public boolean equals(PointAttributes pa)
Compares this object with the specified object to check for equivalence.

Parameters:
pa - The attributes instance to be compared
Returns:
true if the objects represent identical values

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org