|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jreality.geometry.CoordinateSystemFactory
public class CoordinateSystemFactory
Factory for creating a representation of a coordinate system in Euclidean space.
This is
created for an existing SceneGraphComponent (or for a given extent).
For a given SceneGraphComponent the factory creates a bounding box
and axes through the origin including ticks with their labels.
A new SceneGraphNode containing the coordinate system is added to
the children of the given SceneGraphComponent.
Use the factory as following:
Above line creates the coordinate system using default properties and adds it to the scene.
SceneGraphCompontent component;
double axisScale = 10.0;
[...]
CoordinateSystemFactory factory = new CoordinateSystemFactory(component, axisScale);
axisScale
(i.e. the distance between two ticks on the coordinate axes) depends on size of component.
You can change properties afterwards:
factory.showAxes(false);
factory.showBox(true);
factory.beautify(true);
[setting more properties]
The coordinate system may be removed from the SceneGraph by
component.removeChild(factory.getCoordinateSystem());
Field Summary | |
---|---|
static int |
X
Index of coordinate x (use in arrays). |
static int |
Y
Index of coordinate y (use in arrays). |
static int |
Z
Index of coordinate z (use in arrays). |
Constructor Summary | |
---|---|
CoordinateSystemFactory(double extent)
see CoordinateSystemFactory(double extent, double axisScale) here axisScale is set to 1.0 |
|
CoordinateSystemFactory(double[] extent)
see CoordinateSystemFactory(double[] extent, double axisScale) here axisScale is set to 1.0 |
|
CoordinateSystemFactory(double[] extent,
double axisScale)
Creates a coordinate system where min and max values of each of the three coordinate axes is specified by extent ,
i.e. |
|
CoordinateSystemFactory(double extent,
double axisScale)
Creates a coordinate system where min and max values of each coordinate axis are specified by extent ,
i.e. |
|
CoordinateSystemFactory(SceneGraphComponent component)
see CoordinateSystemFactory(SceneGraphComponent component, double axisScale) here axisScale is set to 1.0 |
|
CoordinateSystemFactory(SceneGraphComponent component,
double axisScale)
Creates a coordinate system where min and max values of each coordinate axis are specified by a given SceneGraphComponent. A new SceneGraphNode containing the coordinate system is added to the children of component . |
Method Summary | |
---|---|
void |
beautify(boolean b)
Beautify the coordinate system automatically iff set to true, i.e. |
void |
dispose()
|
double |
getAxisScale()
Get the current axis scale, i.e. |
java.awt.Color |
getBoxColor()
Get the current color of the bounding box. |
java.awt.Color |
getColor()
Get the current color of the coordinate system (axes and bounding box). |
SceneGraphComponent |
getCoordinateSystem()
Get the coordinate system specified in this factory. (The coordinate system may be removed from the SceneGraph using this method.) |
java.awt.Color |
getGridColor()
Get the current color of the grid on the bounding box faces. |
java.awt.Color |
getLabelColor()
Get the current color of all labels of the coordinate system. |
java.awt.Font |
getLabelFont()
Get the current font of all labels of the coordinate system. |
double |
getLabelScale()
Get the current label scale, i.e. |
void |
setAxisScale(double axisScale)
Set the axis scale, i.e. |
void |
setBoxColor(java.awt.Color c)
Set the color of the bounding box. |
void |
setColor(java.awt.Color c)
Set the color of the coordinate system (axes and bounding box). |
void |
setGridColor(java.awt.Color c)
Set the color of the grid on the bounding box faces. |
void |
setLabelBoxEdges(int[][] edges)
Set the box edges on which labels are to be shown. |
void |
setLabelColor(java.awt.Color c)
Set the color of all labels of the coordinate system. |
void |
setLabelFont(java.awt.Font f)
Set the font of all labels of the coordinate system. |
void |
setLabelScale(double labelScale)
Set the label scale, i.e. |
void |
showAxes(boolean b)
Show or hide the axes of the coordinate system going through the origin. |
void |
showAxesArrows(boolean b)
Show or hide the arrows of the axes of the coordinate system going through the origin. |
void |
showBox(boolean b)
Show or hide the bounding box of the coordinate system. |
void |
showBoxArrows(boolean b)
Show or hide the arrows of the bounding box of the coordinate system. |
void |
showGrid(boolean b)
Show or hide the grid on the bounding box faces. |
void |
showLabels(boolean b)
Show or hide the tick & axis labels of axes and bounding box of the coordinate system. |
void |
updateBox(double[] cameraToObject)
Beautifies the box regarding the current transformation from camera coordinates to local coordinates of the coordiante system, i.e. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int X
public static final int Y
public static final int Z
Constructor Detail |
---|
public CoordinateSystemFactory(double extent, double axisScale)
extent
,
i.e. x,y,z are within [-extent
, extent
].
extent
- extent of each coordinate axisaxisScale
- the axis scale, i.e. the distance between two ticks on the coordinate axespublic CoordinateSystemFactory(double extent)
CoordinateSystemFactory(double extent, double axisScale)
public CoordinateSystemFactory(double[] extent, double axisScale)
extent
,
i.e. x is within [-extent[0]
, extent[0]
] etc.
extent
- the extent of each of the three coordinate axesaxisScale
- the axis scale, i.e. the distance between two ticks on the coordinate axespublic CoordinateSystemFactory(double[] extent)
CoordinateSystemFactory(double[] extent, double axisScale)
public CoordinateSystemFactory(SceneGraphComponent component, double axisScale)
component
.
component
- the SceneGraphComponent specifying the extent of the coordinate systemaxisScale
- the axis scale, i.e. the distance between two ticks on the coordinate axespublic CoordinateSystemFactory(SceneGraphComponent component)
CoordinateSystemFactory(SceneGraphComponent component, double axisScale)
Method Detail |
---|
public void dispose()
public void updateBox(double[] cameraToObject)
cameraToObject
- the transformation matrix from camera coordinates to local coordinates of the coordinate system within the SceneGraphpublic SceneGraphComponent getCoordinateSystem()
public void setAxisScale(double axisScale)
axisScale
- the axis scalepublic double getAxisScale()
public void setLabelScale(double labelScale)
labelScale
- the label scalepublic double getLabelScale()
public void showAxes(boolean b)
b
- true iff axes are to be shownpublic void showBox(boolean b)
b
- true iff the box is to be shownpublic void showGrid(boolean b)
b
- true iff the grid is to be shownpublic void showAxesArrows(boolean b)
b
- true iff the arrows are to be shownpublic void showBoxArrows(boolean b)
b
- true iff the arrows are to be shownpublic void showLabels(boolean b)
b
- true iff the labels are to be shownpublic void setColor(java.awt.Color c)
c
- the colorpublic java.awt.Color getColor()
public void setGridColor(java.awt.Color c)
c
- the colorpublic java.awt.Color getGridColor()
public void setBoxColor(java.awt.Color c)
c
- the colorpublic java.awt.Color getBoxColor()
public void setLabelColor(java.awt.Color c)
c
- the colorpublic java.awt.Color getLabelColor()
public void setLabelFont(java.awt.Font f)
f
- the fontpublic java.awt.Font getLabelFont()
public void beautify(boolean b)
b
- true iff coordinate system is to be beautified automaticallypublic void setLabelBoxEdges(int[][] edges)
edges
- specifies on which edges of the bounding box labels are to be shown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |