public class PointMesh extends MeshBase
XMeshToWorldTRANSPARENT, 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). |
| Modifier and Type | Method and Description |
|---|---|
void |
addMesh(PointMesh mesh) |
void |
addMesh(PointMesh mesh,
boolean respectTransforms)
Adds copies of the vertices of another mesh to this mesh.
|
void |
addVertex(Vertex3d vtx)
Adds a vertex to the set of vertices associated with this mesh.
|
PointMesh |
clone()
Creates a clone of this mesh.
|
PointMesh |
copy()
Creates a copy of this mesh.
|
RenderProps |
createRenderProps(HasProperties host)
Creates an appropriate RenderProps for this Mesh.
|
int[] |
createVertexIndices()
Creates and returns the vertex indices associated with each geometric
feature in this mesh.
|
boolean |
epsilonEquals(MeshBase base,
double eps)
Tests to see if a mesh equals this one.
|
AABBTree |
getBVTree() |
double |
getNormalRenderLen() |
boolean |
getWriteNormals()
Returns
true if this mesh's normals should be written
to a file. |
boolean |
hasAutoNormalCreation()
Returns
true if this mesh automatically creates a default
set of normals if MeshBase.getNormals() is called and no normals have been
explicitly set using MeshBase.setNormals(java.util.List<maspack.matrix.Vector3d>, int[]). |
int |
numFeatures()
Returns the number of features in this mesh.
|
void |
prerender(RenderProps props) |
void |
read(ReaderTokenizer rtok,
boolean zeroIndexed)
Reads the contents of this mesh from a ReaderTokenizer.
|
void |
readBinary(java.io.File file) |
boolean |
removeVertex(Vertex3d vtx)
Removes a vertex from this mesh.
|
boolean |
removeVertexFast(Vertex3d vtx)
Removes a vertex from this mesh.
|
java.util.ArrayList<java.lang.Integer> |
removeVertices(java.util.Collection<Vertex3d> vertices)
Removes a set of vertices from this mesh, as indicated by a collection.
|
void |
render(Renderer 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 |
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, checksum, clear, clearColors, clearNormals, clearTextureCoords, computeAverageRadius, computeCentroid, computeOBB, computeOBB, computeRadius, containsVertex, createFeatureIndices, createRenderProps, getColor, getColorIndices, getColorInterpolation, getColors, getFeatureColor, getFeatureColoringEnabled, getFeatureIndexOffsets, getFeatureNormal, getFeatureTextureCoords, getLocalBounds, getMeshToWorld, getMeshToWorld, getName, getNormal, getNormalIndices, getNormals, getRadius, getRenderHints, getRenderNormal, getRenderProps, getSelection, getTextureCoords, getTextureCoords, getTextureIndices, getVersion, getVertex, getVertexColoringEnabled, getVertexColorMixing, getVertices, getWorldBounds, getXMeshToWorldRender, hasColors, hasExplicitColors, hasExplicitNormals, hasNormals, hasTextureCoords, inverseTransform, inverseTransform, isColorsFixed, isEmpty, isFixed, isRenderBuffered, isSelectable, isTextureCoordsFixed, meshToWorldIsIdentity, notifyVertexPositionsModified, numColors, numNormals, numSelectionQueriesNeeded, numTextureCoords, numVertices, prerender, read, read, render, replaceVertices, saveRenderInfo, scale, scale, setColor, setColor, setColor, setColor, setColorInterpolation, setColors, setColorsFixed, setFeatureColoringEnabled, setFixed, setMeshToWorld, setName, setNormal, setNormals, setRenderBuffered, setRenderProps, setTextureCoords, setTextureCoords, setTextureCoordsFixed, setVertexColoringEnabled, setVertexColorMixing, size, transform, transform, transformToLocal, transformToLocal, transformToOBB, transformToOBB, transformToWorld, transformToWorld, translate, translateToCentroid, updateBoundspublic PointMesh()
public PointMesh(java.io.File file)
throws java.io.IOException
write(PrintWriter,NumberFormat,boolean).file - file containing the mesh descriptionjava.io.IOExceptionpublic RenderProps createRenderProps(HasProperties host)
createRenderProps in class MeshBasehost - if non-null, is used to initialize inherited valuespublic double getNormalRenderLen()
public void setNormalRenderLen(double len)
public void readBinary(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic 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 MeshBasepw - 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.IOExceptionpublic void prerender(RenderProps props)
public void render(Renderer renderer, RenderProps props, int flags)
public PointMesh clone()
MeshBasepublic void addMesh(PointMesh mesh)
public void addMesh(PointMesh mesh, boolean respectTransforms)
mesh - Mesh to be added to this meshpublic AABBTree getBVTree()
public boolean epsilonEquals(MeshBase base, double eps)
eps).epsilonEquals in class MeshBasepublic int[] createVertexIndices()
MeshBaseThe indices are zero-based and specify the vertex indices for
each mesh feature. The number of indices and their structure hence
depends on the mesh subclass: for PolygonalMesh meshes,
this gives the vertices for each face; for PolylineMesh, the
vertices for each polyline, and for PointMesh, the vertices
for each point. For example, assume that we have a
PolygonalMesh with four vertices and
four triangles arranged to form a tetrahedron, so that the vertex
indices for each triangular face are given by (0, 2, 1),
(0, 3, 2), (0, 1, 3),
and (1, 2, 3). Then the returned vertex
indices will be
0 2 1 0 3 2 0 1 3 1 2 3
createVertexIndices in class MeshBasepublic int numFeatures()
MeshBasenumFeatures in class MeshBasepublic boolean hasAutoNormalCreation()
MeshBasetrue if this mesh automatically creates a default
set of normals if MeshBase.getNormals() is called and no normals have been
explicitly set using MeshBase.setNormals(java.util.List<maspack.matrix.Vector3d>, int[]).hasAutoNormalCreation in class MeshBasetrue if this mesh automatically creates normals.public boolean getWriteNormals()
true if this mesh's normals should be written
to a file. This will be the case if the normals were explicitly
set, or if they were automatically created using information
(such as hard edges) that cannot be easily reconstructed from the
information written to standard file formats.getWriteNormals in class MeshBasetrue if the normals should be written to a filepublic void addVertex(Vertex3d vtx)
MeshBasepnt field of the vertex should be
non-null. The index of the vertex will be set to reflect it's position in
the list of vertices.addVertex in class MeshBasevtx - vertex to addMeshBase.addVertex(Point3d,boolean),
MeshBase.addVertex(Point3d)public boolean removeVertex(Vertex3d vtx)
MeshBaseremoveVertex in class MeshBasevtx - vertex to removepublic boolean removeVertexFast(Vertex3d vtx)
MeshBaseremoveVertexFast in class MeshBasevtx - vertex to removepublic java.util.ArrayList<java.lang.Integer> removeVertices(java.util.Collection<Vertex3d> vertices)
MeshBaseremoveVertices in class MeshBasevertices - Collection of vertices to remove