org.jcae.mesh.oemm
Class MeshReader

java.lang.Object
  extended by org.jcae.mesh.oemm.Storage
      extended by org.jcae.mesh.oemm.MeshReader

public class MeshReader
extends Storage

This class builds a mesh from disk.


Field Summary
 
Fields inherited from class org.jcae.mesh.oemm.Storage
TRIANGLE_SIZE, VERTEX_SIZE
 
Constructor Summary
MeshReader(OEMM o)
          Constructor.
 
Method Summary
 Mesh buildMesh(MeshTraitsBuilder mtb, TIntHashSet leaves)
          Builds a mesh composed of specified octants.
 Mesh buildMesh(TIntHashSet leaves)
          Builds a mesh composed of specified octants.
 void buildMeshes(MeshTraitsBuilder mtb)
          Builds meshes for all octants.
 Mesh buildWholeMesh()
          Builds a mesh composed of all octants.
 Mesh getMesh(int leafIndex)
          Gets the mesh contained in an octant.
 void setLoadNonReadableTriangles(boolean loadNonReadableTriangles)
          Allows reading non-readable triangles.
 
Methods inherited from class org.jcae.mesh.oemm.Storage
getAdjacencyFile, getTrianglesFile, getVerticesFile, readAdjacencyFile, readOEMMStructure, saveNodes, storeOEMMStructure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeshReader

public MeshReader(OEMM o)
Constructor.

Parameters:
o - OEMM instance
Method Detail

setLoadNonReadableTriangles

public void setLoadNonReadableTriangles(boolean loadNonReadableTriangles)
Allows reading non-readable triangles. On disk, a triangle is contained in one single leaf. If it contains vertices from octants which are not loaded, this triangle can not be drawn and is said to be non-readable. If argument is true, such vertices are loaded from disk to make these triangles as being readable.

Parameters:
loadNonReadableTriangles - behavior expected.

buildMeshes

public void buildMeshes(MeshTraitsBuilder mtb)
Builds meshes for all octants. This method maintains a map in memory of meshes from all octants; each mesh can be retrieved by getMesh(int).

Parameters:
mtb - mesh traits builder used to create Mesh instances

getMesh

public Mesh getMesh(int leafIndex)
Gets the mesh contained in an octant.

Parameters:
leafIndex - octant index
Returns:
mesh contained in these octants

buildWholeMesh

public Mesh buildWholeMesh()
Builds a mesh composed of all octants.

Returns:
mesh contained in all octants

buildMesh

public Mesh buildMesh(TIntHashSet leaves)
Builds a mesh composed of specified octants.

Parameters:
leaves - set of selected octants
Returns:
mesh contained in these octants

buildMesh

public Mesh buildMesh(MeshTraitsBuilder mtb,
                      TIntHashSet leaves)
Builds a mesh composed of specified octants.

Parameters:
mtb - mesh traits builder used to create Mesh instances
leaves - set of selected octants
Returns:
mesh contained in these octants