|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcae.mesh.oemm.Storage
public class Storage
This class converts between disk and memory formats.
MeshOEMMIndex
is an example to show how to
convert a triangle soup into an out-of-core mesh data structure.
When an OEMM is generated on disk, octants can be loaded and unloaded
on demand. An OEMM
instance is first created by calling
readOEMMStructure(java.lang.String)
. Then MeshReader.buildMesh(TIntHashSet)
can be called
to select which octants are loaded into memory.
As can be seen in readOEMMStructure(java.lang.String)
, OEMM
instances
are serialized on disk. But this is different with partial mesh data
structure. Each child octant has a local number between 0 and 7 depending
on its spatial localization. A similar structure is kept on disk, each
child octant is put into a seperate directory named after its number.
Octant leaves contain vertex and triangle data. A file with a "v" suffix
contains coordinates of vertices stored as 3 double values. A file with
a "a" suffix contains for each vertex the list of leaves which are
connected to this vertex. This allows setting readable
and
writable
attributes, as explained in original paper.
A file with a "t" suffix contains for each triangle 6 int values, the first
3 are leaf numbers for its 3 vertices, and last 3 are local vertex number
in their respective leaf.
Field Summary | |
---|---|
protected static int |
TRIANGLE_SIZE
Number of bytes per triangle. |
protected static int |
VERTEX_SIZE
Number of bytes per vertex. |
Constructor Summary | |
---|---|
Storage()
|
Method Summary | |
---|---|
protected static java.io.File |
getAdjacencyFile(OEMM oemm,
OEMM.Node node)
|
protected static java.io.File |
getTrianglesFile(OEMM oemm,
OEMM.Node node)
|
protected static java.io.File |
getVerticesFile(OEMM oemm,
OEMM.Node current)
|
protected static java.util.List<TIntArrayList> |
readAdjacencyFile(OEMM oemm,
OEMM.Node node,
TIntHashSet storedLeaves)
Read adjacency file and returns List of adjacent nodes without nodes that are loaded. |
static OEMM |
readOEMMStructure(java.lang.String dir)
Creates an OEMM instance from its disk representation. |
static void |
saveNodes(OEMM oemm,
Mesh mesh,
TIntHashSet storedLeaves)
Saves mesh on the disk into octree structure. |
static void |
storeOEMMStructure(OEMM oemm)
Stores an OEMM instance to its disk representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int TRIANGLE_SIZE
protected static final int VERTEX_SIZE
Constructor Detail |
---|
public Storage()
Method Detail |
---|
public static OEMM readOEMMStructure(java.lang.String dir)
OEMM
instance from its disk representation.
dir
- directory containing disk representation
OEMM
instancepublic static void storeOEMMStructure(OEMM oemm)
OEMM
instance to its disk representation.
oemm
- stored objectpublic static void saveNodes(OEMM oemm, Mesh mesh, TIntHashSet storedLeaves)
oemm
- OEMM instancemesh
- mesh to be stored onto diskstoredLeaves
- set of leaves to store
TODO There is no support for moving vertices into another octree node.protected static java.io.File getAdjacencyFile(OEMM oemm, OEMM.Node node)
protected static java.io.File getTrianglesFile(OEMM oemm, OEMM.Node node)
protected static java.io.File getVerticesFile(OEMM oemm, OEMM.Node current)
protected static java.util.List<TIntArrayList> readAdjacencyFile(OEMM oemm, OEMM.Node node, TIntHashSet storedLeaves)
oemm
- OEMM instancenode
- OEMM nodestoredLeaves
- set of node indices being loaded
List
instance; for each vertex, returns indices of adjacent
and non-loaded nodes
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |