public class TriMeshView extends TiledView
Modifier and Type | Class and Description |
---|---|
static class |
TriMeshView.Orientation
Orientation of tri-mesh axes x and y.
|
static interface |
TriMeshView.TriPainter
Interface for custom triangle painting.
|
Constructor and Description |
---|
TriMeshView(TriMesh mesh)
Constructs a new view of the specified tri mesh.
|
Modifier and Type | Method and Description |
---|---|
TriMeshView.Orientation |
getOrientation()
Gets the orientation of (x,y) axes.
|
void |
hideNodes()
Hides (does not draw) the nodes.
|
void |
hidePolyBounds()
Hides (does not draw) the poly bounds.
|
void |
hidePolys()
Hides (does not draw) the polygons.
|
void |
hideTriBounds()
Hides (does not draw) the tri bounds.
|
void |
hideTris()
Hides (does not draw) the tris.
|
void |
paint(java.awt.Graphics2D g2d)
Paints this tiled view.
|
void |
setLineColor(java.awt.Color lineColor)
Sets the color of lines used to draw edges of triangles and polygons.
|
void |
setLineWidth(int lineWidth)
Sets the width of lines used to draw edges of triangles.
|
void |
setMarkColor(java.awt.Color markColor)
Sets the color of marks used to draw nodes.
|
void |
setMarkWidth(int markWidth)
Sets the width of marks used to draw nodes.
|
void |
setMesh(TriMesh mesh)
Sets the tri mesh rendered by this view.
|
void |
setNodesVisible(boolean drawNodes)
Sets the visibility (drawing or no drawing) of nodes.
|
void |
setOrientation(TriMeshView.Orientation orientation)
Sets the orientation of mesh (x,y) axes.
|
void |
setPolyBoundsVisible(boolean drawPolyBounds)
Sets the visibility (drawing or no drawing) of poly bounds.
|
void |
setPolyColor(java.awt.Color lineColor)
Sets the color of lines used to draw edges of polygons.
|
void |
setPolysVisible(boolean drawPolys)
Sets the visibility (drawing or no drawing) of polygons.
|
void |
setSubTrisVisible(boolean drawSubTris)
Sets the visibility (drawing or no drawing) of subdivided tris.
|
void |
setTriBoundsVisible(boolean drawTriBounds)
Sets the visibility (drawing or no drawing) of tri bounds.
|
void |
setTriColor(java.awt.Color lineColor)
Sets the color of lines used to draw edges of triangles.
|
void |
setTriEdgeWeights(java.util.Map<TriMesh.Edge,java.lang.Float> triEdgeWeights)
Sets the map from triangle edges to weights.
|
void |
setTriPainter(TriMeshView.TriPainter triPainter)
Sets the custom triangle painter.
|
void |
setTrisVisible(boolean drawTris)
Sets the visibility (drawing or no drawing) of tris.
|
void |
showNodes()
Shows (draws) the nodes.
|
void |
showPolyBounds()
Shows (draws) the poly bounds.
|
void |
showPolys()
Shows (draws) the polygons.
|
void |
showTriBounds()
Shows (draws) the tri bounds.
|
void |
showTris()
Shows (draws) the tris.
|
getBestHorizontalProjector, getBestVerticalProjector, getHorizontalProjector, getLineWidth, getTile, getTranscaler, getVerticalProjector, repaint, setBestProjectors
public TriMeshView(TriMesh mesh)
public void setMesh(TriMesh mesh)
mesh
- the tri mesh.public void setOrientation(TriMeshView.Orientation orientation)
orientation
- the orientation.public TriMeshView.Orientation getOrientation()
public void setNodesVisible(boolean drawNodes)
drawNodes
- true, to draw nodes; false, otherwise.
The default is true.public void setTrisVisible(boolean drawTris)
drawTris
- true, to draw tris; false, otherwise.
The default is true.public void setSubTrisVisible(boolean drawSubTris)
drawSubTris
- true, to draw subdivided tris; false, otherwise.
The default is false.public void setPolysVisible(boolean drawPolys)
drawPolys
- true, to draw polygons; false, otherwise.
The default is false.public void setTriBoundsVisible(boolean drawTriBounds)
drawTriBounds
- true, to draw tri bounds; false, otherwise.
The default is false.public void setPolyBoundsVisible(boolean drawPolyBounds)
drawPolyBounds
- true, to draw poly bounds; false, otherwise.
The default is false.public void showNodes()
public void hideNodes()
public void showTris()
public void hideTris()
public void showPolys()
public void hidePolys()
public void showTriBounds()
public void hideTriBounds()
public void showPolyBounds()
public void hidePolyBounds()
public void setLineColor(java.awt.Color lineColor)
lineColor
- the line color.public void setTriColor(java.awt.Color lineColor)
lineColor
- the line color.public void setTriEdgeWeights(java.util.Map<TriMesh.Edge,java.lang.Float> triEdgeWeights)
public void setPolyColor(java.awt.Color lineColor)
lineColor
- the line color.public void setLineWidth(int lineWidth)
lineWidth
- line width in pixels (or points, as for a font).public void setMarkColor(java.awt.Color markColor)
markColor
- mark color.public void setMarkWidth(int markWidth)
markWidth
- mark width in pixels (or points, as for a font).public void setTriPainter(TriMeshView.TriPainter triPainter)
triPainter
- the painter.public void paint(java.awt.Graphics2D g2d)
TiledView
Tiled views should not replace (set) entirely the transform in the specified graphics context. This transform may already have been set by the tile or its mosaic. Therefore, tiled views should modify this transform only by specifying additional scaling, translation, etc.