Class MeshModelImpl
java.lang.Object
cz.fidentis.analyst.data.mesh.impl.MeshModelImpl
- All Implemented Interfaces:
MeshModel
,Serializable
The main object for triangular meshes. Each mesh model consists of one or
more mesh facets.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor of MeshModelMeshModelImpl
(MeshModel meshModel) Copy constructor of MeshModel -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new mesh facet to the model.void
addFacets
(Collection<MeshFacet> newFacets) Adds a new mesh facets to the model.void
compute
(MeshVisitor visitor) Applies the visitor to all mesh facets sequentially.void
compute
(MeshVisitor visitor, boolean concurrently) Applies the visitor to all mesh facets.boolean
estimateVertexNormals
(boolean recomputeAll) Recomputes normals of vertices.javax.vecmath.Point3d
Returns central point computed from mesh verticesreturns list of mesh facetsgets the material of the modellong
Returns number of vertices (sum of all facets).boolean
Returnstrue
if the mesh vertices have set curvature values.boolean
Returnstrue
if at least any vertex normals were automatically estimated.boolean
removeFacet
(int index) Removes facet from the model.void
change facetsvoid
setMaterial
(Material mtl) changes material of the modelvoid
Removes duplicate vertices that differ only in normal vectors or texture coordinates.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface cz.fidentis.analyst.data.mesh.MeshModel
estimateMissingVertexNormals
-
Constructor Details
-
MeshModelImpl
public MeshModelImpl()Constructor of MeshModel -
MeshModelImpl
Copy constructor of MeshModel- Parameters:
meshModel
- copied MeshModel
-
-
Method Details
-
setFacets
Description copied from interface:MeshModel
change facets -
getFacets
Description copied from interface:MeshModel
returns list of mesh facets -
addFacet
Description copied from interface:MeshModel
Adds a new mesh facet to the model. -
removeFacet
Description copied from interface:MeshModel
Removes facet from the model.- Specified by:
removeFacet
in interfaceMeshModel
- Parameters:
index
- Index of the facet- Returns:
- Removed facet or
null
-
addFacets
Description copied from interface:MeshModel
Adds a new mesh facets to the model. -
getMaterial
Description copied from interface:MeshModel
gets the material of the model- Specified by:
getMaterial
in interfaceMeshModel
- Returns:
- material
-
setMaterial
Description copied from interface:MeshModel
changes material of the model- Specified by:
setMaterial
in interfaceMeshModel
- Parameters:
mtl
- Material
-
hasMaterial
public boolean hasMaterial()- Specified by:
hasMaterial
in interfaceMeshModel
- Returns:
true
if material exists
-
hasCurvature
public boolean hasCurvature()Description copied from interface:MeshModel
Returnstrue
if the mesh vertices have set curvature values.- Specified by:
hasCurvature
in interfaceMeshModel
- Returns:
true
if the mesh vertices have set curvature values.
-
compute
Description copied from interface:MeshModel
Applies the visitor to all mesh facets. If the visitor is thread-safe and theconcurrently
istrue
, then the visitor is applied to all mesh facet concurrently using all CPU cores. -
compute
Description copied from interface:MeshModel
Applies the visitor to all mesh facets sequentially. -
simplifyModel
public void simplifyModel()Description copied from interface:MeshModel
Removes duplicate vertices that differ only in normal vectors or texture coordinates. Multiple normals are replaced with the average normal. If the texture coordinate differ then randomly selected one is used.- Specified by:
simplifyModel
in interfaceMeshModel
-
toString
-
getNumVertices
public long getNumVertices()Description copied from interface:MeshModel
Returns number of vertices (sum of all facets).- Specified by:
getNumVertices
in interfaceMeshModel
- Returns:
- Number of vertices
-
getCentroid
public javax.vecmath.Point3d getCentroid()Description copied from interface:MeshModel
Returns central point computed from mesh vertices- Specified by:
getCentroid
in interfaceMeshModel
- Returns:
- centroid
-
hasEstimatedVertNormals
public boolean hasEstimatedVertNormals()Description copied from interface:MeshModel
Returnstrue
if at least any vertex normals were automatically estimated. Returnsfalse
if all vertex normals were predefined in the mesh file- Specified by:
hasEstimatedVertNormals
in interfaceMeshModel
- Returns:
true
if at least any vertex normals were automatically estimated.
-
estimateVertexNormals
public boolean estimateVertexNormals(boolean recomputeAll) Description copied from interface:MeshModel
Recomputes normals of vertices.- Specified by:
estimateVertexNormals
in interfaceMeshModel
- Parameters:
recomputeAll
- Iftrue
, then all normals are recomputed (estimated). Iffalse
, then only missing vertex normals are recomputed.- Returns:
true
if some normals were recomputed
-