vrecko
virtual reality framework
|
#include <GeometryLoaderBase.h>
Classes | |
struct | FaceBase |
struct | VertexBase |
Public Member Functions | |
GeometryLoaderBase () | |
~GeometryLoaderBase () | |
virtual bool | loadXMLParameters (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node) |
virtual bool | loadGeometry (osg::Node *pNode) |
virtual unsigned long | getVertexStructureSize () |
virtual void | allocateVertexArray (unsigned long numVertices) |
virtual void | deallocateVertexArray () |
virtual bool | saveVerticesToFile (vrecko::BufferedFileWrite *bfile) |
virtual bool | loadVerticesFromFile (vrecko::BufferedFile *bfile) |
virtual unsigned long | getFaceStructureSize () |
virtual void | allocateFaceArray (unsigned long numFaces) |
virtual void | deallocateFaceArray () |
virtual bool | saveFacesToFile (vrecko::BufferedFileWrite *bfile) |
virtual bool | loadFacesFromFile (vrecko::BufferedFile *bfile) |
void * | getFace (unsigned long index) |
void * | getVertex (unsigned long index) |
unsigned long | getFaceCount () |
unsigned long | getVertexCount () |
void | debugWriteNormals () |
Protected Member Functions | |
bool | getOSGInitCounts (osg::Node *pNode, unsigned long &pVertexCount, unsigned long &pPrimitiveCount) |
bool | loadGeometryHelper (osg::Node *pNode, osg::Matrix &transform, unsigned long &vertex_pos, unsigned long &face_pos) |
void | sortVerticesClockwise () |
virtual void | destroyGeometry () |
void | recalculateNormals () |
osg::Vec3 * | getNormalByIndex (osg::Geometry::AttributeBinding normalBinding, osg::Vec3Array *pNormArray, osg::IndexArray *pNormIndices, unsigned long index) |
Protected Attributes | |
void * | faces |
unsigned long | face_count |
unsigned long | face_size |
void * | vertices |
unsigned long | vertex_count |
unsigned long | vertex_size |
bool | bRecalculateNormals |
Basic class to load geometry from OpenSceneGraph node
Idea : This class contains the basic loading routines. Descendant classes can create their descendant versions of VertexBase and FaceBase classes but in that case it is IMPORTANT to also override methods that take care of allocation and returns the correct size of the used structure! You have to also call destroyGeometry() in your destructor (of the GeometryLoaderBase descendant).
SPACEPARTITIONING_IMP_EXP APSpacePartitioning::GeometryLoaderBase::GeometryLoaderBase | ( | ) |
SPACEPARTITIONING_IMP_EXP APSpacePartitioning::GeometryLoaderBase::~GeometryLoaderBase | ( | ) |
Don't forget to call destroyGeometry() in your destructor.
|
inlinevirtual |
allocate space required for storing the faces
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
inlinevirtual |
allocates the memory needed for storing the vhole structure
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
inlinevirtual |
deallocate the space required for faces
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
inlinevirtual |
deallocate the unnecessary space
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
SPACEPARTITIONING_IMP_EXP void APSpacePartitioning::GeometryLoaderBase::debugWriteNormals | ( | ) |
writes out the normals
|
protectedvirtual |
Deallocates loaded faces/vertices
|
inline |
returns specified face
|
inline |
returns total count of faces
|
inlinevirtual |
returns the size of structure of stored faces
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
inlineprotected |
|
protected |
Returns counts of vertices and primitives stored in OSG node.
|
inline |
returns specified vertex
|
inline |
returns total count of vertices
|
inlinevirtual |
returns the size of structure of stored vertices
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
virtual |
loads the faces to separate file
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
virtual |
Fills the buffers with vertices and faces loaded from a given OSG node.
|
protected |
For details contact Vit Kovalcik
|
virtual |
load the vertice from separate file
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
virtual |
Reimplemented in APSpacePartitioning::PointShell_Object_Data, and APSpacePartitioning::VoxelGrid_Object_Data.
|
protected |
Ignores the old normals and creates new ones.
|
virtual |
saves the faces to separate file
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
virtual |
saving the vertices to separate file
Reimplemented in APSpacePartitioning::SNCH_Object_Data.
|
protected |
Iterates throught all the faces and sorts vIndex-es clockwise
|
protected |
denotes whether to recalculate normals or take the one that come with the source file
|
protected |
total count of faces
|
protected |
cached number from getFaceStructureSize()
|
protected |
|
protected |
total count of vertices
|
protected |
cached number from getVertexStructureSize()
|
protected |