maspack.render
Class GLGridPlane

java.lang.Object
  extended by maspack.render.GLGridPlane
All Implemented Interfaces:
HasProperties
Direct Known Subclasses:
GLClipPlane

public class GLGridPlane
extends java.lang.Object
implements HasProperties


Field Summary
static PropertyList myProps
           
 
Constructor Summary
GLGridPlane()
           
 
Method Summary
 void alignPoint(Point3d aligned, Point3d pnt)
          Aligns a point with the nearest point defined by this grid.
 void centerInViewer()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 int getCellDivisions()
          Returns the number of subdivisions for each cell.
 double getCellSize()
          Returns the cell size for this grid.
 GLViewer.DraggerType getDragger()
           
 RigidTransform3d getGridToWorld()
           
 void getGridToWorld(RigidTransform3d X)
           
 int getLineWidth()
          Returns the line width used to render this grid.
 java.awt.Color getMajorColor()
           
 int getMinCellPixels()
          Returns the desired minimum number of pixels per cell or divided cell.
 java.awt.Color getMinorColor()
           
 double getMinSize()
           
 AxisAngle getOrientation()
           
 Plane getPlane()
           
 void getPlane(Plane plane)
           
 Point3d getPosition()
           
 Property getProperty(java.lang.String name)
          Returns a property associated with a specified path name.
 GLGridResolution getResolution()
          Retuns the resolution for this grid.
 GLViewer getViewer()
           
 java.awt.Color getXAxisColor()
           
 java.awt.Color getYAxisColor()
           
 boolean isAutoSized()
          Returns true is cell sizes for this grid are computed automatically.
 boolean isGridVisible()
           
 int numCellDivisions()
          Returns the number of subdivisions for each cell.
 void render(GLRenderer renderer, int flags)
           
 void resetInViewer()
           
 void setAutoSized(boolean enable)
          Enables or disables auto cell sizing for this grid.
 void setDragger(GLViewer.DraggerType type)
           
 void setGridToWorld(RigidTransform3d X)
           
 void setGridVisible(boolean enable)
           
 void setLineWidth(int width)
          Sets the line width used to render this grid.
 void setMajorColor(java.awt.Color color)
           
 void setMinCellPixels(int n)
          Sets the desired minimum number of pixels per cell or divided cell.
 void setMinorColor(java.awt.Color color)
           
 double setMinSize(double size)
          Sets the minimum grid size.
 void setOrientation(AxisAngle axisAng)
           
 void setPosition(Point3d pos)
           
 void setResolution(double majorCellSize, int numDivisions)
          Sets the resolution for this grid.
 void setResolution(GLGridResolution res)
          Sets the resolution for this grid.
 void setXAxisColor(java.awt.Color color)
           
 void setYAxisColor(java.awt.Color color)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

GLGridPlane

public GLGridPlane()
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Returns:
static information for all exported properties

getProperty

public Property getProperty(java.lang.String name)
Returns a property associated with a specified path name. All properties exported by this object must have a name which is a valid Java identifier. Specifying one of these names causes the corresponding Property to be returned. Handles to sub-properties can also be obtained by delimiting the sub-property name(s) by '.' characters. A sub-property exists if the value of a property is itself an object which exports properties. It is only possible to obtain a sub-property handle if each of its ancestor properties exports their values by reference.

Specified by:
getProperty in interface HasProperties
Parameters:
name - name of the desired property or sub-property
Returns:
handle to the property

getMinCellPixels

public int getMinCellPixels()
Returns the desired minimum number of pixels per cell or divided cell.

Returns:
minimum pixels for each cell or divided cell

setMinCellPixels

public void setMinCellPixels(int n)
Sets the desired minimum number of pixels per cell or divided cell. This is used when automatically computing cell sizes and/or divisions.

Parameters:
n - minimum pixels for each cell or divided cell

getCellSize

public double getCellSize()
Returns the cell size for this grid. If auto cell sizing is enabled, this value is computed automatically.

Returns:
size grid cell size

setLineWidth

public void setLineWidth(int width)
Sets the line width used to render this grid.

Parameters:
width - new line width

getLineWidth

public int getLineWidth()
Returns the line width used to render this grid.

Returns:
line width

getPosition

public Point3d getPosition()

setPosition

public void setPosition(Point3d pos)

getOrientation

public AxisAngle getOrientation()

setOrientation

public void setOrientation(AxisAngle axisAng)

setResolution

public void setResolution(double majorCellSize,
                          int numDivisions)
Sets the resolution for this grid.

If the major cell size is 0, then auto-sizing will be enabled and the grid size will be computed automatically, based on the viewer's current zoom level. Otherwise, auto-sizing will be turned off.

Parameters:
majorCellSize - major cell size
numDivisions - number of divisions per cell

setResolution

public void setResolution(GLGridResolution res)
Sets the resolution for this grid. The resolution res specifies the major cell size and the number of subdivisions per cell.

If the major cell size is 0, then auto-sizing will be enabled and the grid size will be computed automatically, based on the viewer's current zoom level. Otherwise, auto-sizing will be turned off.

Parameters:
res - specified new grid resolution, or auto-sizing.

getResolution

public GLGridResolution getResolution()
Retuns the resolution for this grid.

Returns:
grid resolution

isAutoSized

public boolean isAutoSized()
Returns true is cell sizes for this grid are computed automatically.

Returns:
true is auto cell sizing is enabled

setAutoSized

public void setAutoSized(boolean enable)
Enables or disables auto cell sizing for this grid.

Parameters:
enable - if true, enables auto cell sizing

numCellDivisions

public int numCellDivisions()
Returns the number of subdivisions for each cell. If auto cell dividing is enabled, this value is computed automatically.

Returns:
number of cell subdivisions

getCellDivisions

public int getCellDivisions()
Returns the number of subdivisions for each cell.

Returns:
number of cell subdivisions

setMinSize

public double setMinSize(double size)
Sets the minimum grid size.


getMinSize

public double getMinSize()

getGridToWorld

public RigidTransform3d getGridToWorld()

alignPoint

public void alignPoint(Point3d aligned,
                       Point3d pnt)
Aligns a point with the nearest point defined by this grid. Both the original and aligned points are described in grid coordinates.


setGridToWorld

public void setGridToWorld(RigidTransform3d X)

getGridToWorld

public void getGridToWorld(RigidTransform3d X)

getViewer

public GLViewer getViewer()

getDragger

public GLViewer.DraggerType getDragger()

setDragger

public void setDragger(GLViewer.DraggerType type)

isGridVisible

public boolean isGridVisible()

setGridVisible

public void setGridVisible(boolean enable)

render

public void render(GLRenderer renderer,
                   int flags)

getPlane

public void getPlane(Plane plane)

getPlane

public Plane getPlane()

centerInViewer

public void centerInViewer()

resetInViewer

public void resetInViewer()

getMajorColor

public java.awt.Color getMajorColor()

setMajorColor

public void setMajorColor(java.awt.Color color)

getXAxisColor

public java.awt.Color getXAxisColor()

setXAxisColor

public void setXAxisColor(java.awt.Color color)

getYAxisColor

public java.awt.Color getYAxisColor()

setYAxisColor

public void setYAxisColor(java.awt.Color color)

getMinorColor

public java.awt.Color getMinorColor()

setMinorColor

public void setMinorColor(java.awt.Color color)