public class PointMesh extends MeshBase
Modifier and Type | Field and Description |
---|---|
static boolean |
useDisplayListsIfPossible |
isFixed, myDisplayListValid, myUseDisplayList, useVertexColoring, XMeshToWorld
TRANSLUCENT, TWO_DIMENSIONAL
Constructor and Description |
---|
PointMesh()
Creates an empty point mesh.
|
PointMesh(java.io.File file)
Creates a point mesh and initializes it from an file in Alias
Wavefront obj format, as decribed for the method
write(PrintWriter,NumberFormat,boolean) . |
PointMesh(PointMesh old) |
Modifier and Type | Method and Description |
---|---|
void |
addMesh(PointMesh mesh)
Adds copies of the vertices of another mesh to this mesh.
|
void |
clear()
Clears this mesh (makes it empty).
|
void |
clearNormals() |
PointMesh |
copy()
Creates a copy of this mesh.
|
PointMesh |
copyWithVertices(java.util.ArrayList<? extends Vertex3d> vtxs)
Creates a copy of this mesh using a specific set of vertices.
|
RenderProps |
createRenderProps(HasProperties host)
Creates an appropriate RenderProps for this Mesh.
|
boolean |
epsilonEquals(MeshBase base,
double eps)
Tests to see if a mesh equals this one.
|
AABBTree |
getBVTree() |
Vector3d |
getNormal(int idx)
Returns the idx-th normal in this mesh.
|
double |
getNormalRenderLen() |
java.util.ArrayList<Vector3d> |
getNormals() |
int |
getNumNormals()
Returns the number of normals in this mesh.
|
void |
inverseTransform(AffineTransform3dBase X)
Applies an inverse affine transformation to the vertices of this mesh.
|
void |
read(ReaderTokenizer rtok,
boolean zeroIndexed)
Reads the contents of this mesh from a ReaderTokenizer.
|
void |
readBinary(java.io.File file) |
void |
render(GLRenderer renderer,
RenderProps props,
int flags) |
void |
set(Point3d[] pnts,
Vector3d[] nrms)
Sets the vertex points and normals associated with this mesh.
|
void |
setNormalRenderLen(double len) |
void |
setNormals(java.util.ArrayList<Vector3d> normals) |
void |
transform(AffineTransform3dBase X)
Applies an affine transformation to the vertices of this mesh.
|
void |
write(java.io.PrintWriter pw,
NumberFormat fmt,
boolean zeroIndexed)
Writes this mesh to a PrintWriter, using an Alias Wavefront "obj" file
format.
|
void |
write(java.io.PrintWriter pw,
java.lang.String fmtStr)
Writes this mesh to a PrintWriter, using an Alias Wavefront "obj" file as
described for
write(PrintWriter,NumberFormat,boolean) . |
addVertex, addVertex, addVertex, addVertex, clearDisplayList, clearDisplayList, computeAverageRadius, computeCentroid, computeRadius, containsVertex, createRenderProps, getLocalBounds, getMeshToWorld, getMeshToWorld, getName, getNumVertices, getRadius, getRenderHints, getRenderProps, getSelection, getVertex, getVertexColor, getVertexColorArray, getVertices, getWorldBounds, isDisplayListValid, isEmpty, isFastRemoval, isFixed, isRenderBuffered, isSelectable, isUsingDisplayList, isUsingVertexColoring, meshToWorldIsIdentity, notifyVertexPositionsModified, numSelectionQueriesNeeded, prerender, read, read, removeVertex, removeVertices, render, saveRenderInfo, scale, scale, setFastRemoval, setFixed, setMeshToWorld, setName, setRenderBuffered, setRenderProps, setUseDisplayList, setUseVertexColoring, setVertexColor, setVertexColor, setVertexColor, setVertexColor, setVertexColor, setVertexColor, setVertexColorHSV, setVertexColorHSV, size, translate, updateBounds
public PointMesh()
public PointMesh(java.io.File file) throws java.io.IOException
write(PrintWriter,NumberFormat,boolean)
.file
- file containing the mesh descriptionjava.io.IOException
public PointMesh(PointMesh old)
public int getNumNormals()
getNumNormals
in class MeshBase
public Vector3d getNormal(int idx)
public java.util.ArrayList<Vector3d> getNormals()
public void setNormals(java.util.ArrayList<Vector3d> normals)
public void clearNormals()
public RenderProps createRenderProps(HasProperties host)
createRenderProps
in class MeshBase
host
- if non-null, is used to initialize inherited valuespublic double getNormalRenderLen()
public void setNormalRenderLen(double len)
public void transform(AffineTransform3dBase X)
public void inverseTransform(AffineTransform3dBase X)
inverseTransform
in class MeshBase
X
- affine transformationpublic void readBinary(java.io.File file) throws java.io.IOException
java.io.IOException
public void read(ReaderTokenizer rtok, boolean zeroIndexed) throws java.io.IOException
write(PrintWriter,NumberFormat,boolean)
.public void set(Point3d[] pnts, Vector3d[] nrms)
pnts
- points from which the vertices are formednrms
- (optional) if non-null, gives vectors from which the normals are formed.java.lang.IllegalArgumentException
- if nrms is non-null and does not have the
same size as pnts.public void write(java.io.PrintWriter pw, java.lang.String fmtStr) throws java.io.IOException
write(PrintWriter,NumberFormat,boolean)
. Index
numbering starts at one, and the format used to print vertex coordinates
is specified by a C printf
style format string contained in
the parameter fmtStr
. For a description of the format
string syntax, see NumberFormat
. Good
default choices for fmtStr
are either "%g"
(full
precision), or "%.Ng"
, where N is the number of
desired significant figures.public void write(java.io.PrintWriter pw, NumberFormat fmt, boolean zeroIndexed) throws java.io.IOException
The format used to print vertex coordinates is specified by a
NumberFormat
.
write
in class MeshBase
pw
- PrintWriter to write this mesh tofmt
- (optional) format for writing the vertex and normals coordinates. If null
,
a format of "%.8g"
is assumed.zeroIndexed
- if true, index numbering for mesh vertices starts at 0. Otherwise,
numbering starts at 1.java.io.IOException
public void render(GLRenderer renderer, RenderProps props, int flags)
public PointMesh copyWithVertices(java.util.ArrayList<? extends Vertex3d> vtxs)
copyWithVertices
in class MeshBase
public void addMesh(PointMesh mesh)
mesh
- Mesh to be added to this meshpublic AABBTree getBVTree()
public boolean epsilonEquals(MeshBase base, double eps)
eps
).epsilonEquals
in class MeshBase