NGL  6.5
The NCCA Graphics Library
ngl::NCCAPointBake Class Reference

Class to load and manipulate NCCAPointBake data, this will replace the Houdini Clip files as they are now not supported in the educational version of Houdini. More...

#include <NCCAPointBake.h>

+ Collaboration diagram for ngl::NCCAPointBake:

Public Member Functions

 NCCAPointBake () noexcept
 ctor for the clip More...
 
 ~NCCAPointBake () noexcept
 the dtor erases all clip data allocated and also destroys the Obj reference held in the clip More...
 
 NCCAPointBake (const std::string &_fileName) noexcept
 ctor using a clip and an obj More...
 
void setFrame (const unsigned int frame) noexcept
 Set the current Frame and map the clip for that frame to the obj. More...
 
bool loadPointBake (const std::string &_fileName) noexcept
 method to load a point baked file More...
 
bool loadBinaryPointBake (const std::string &_fileName) noexcept
 method to load a binary point baked file More...
 
bool saveBinaryPointBake (const std::string &_fileName) noexcept
 method to save a binary point baked file basically re-ordered data only More...
 
bool attachMesh (AbstractMesh *_mesh) noexcept
 method to attach a mesh to the data this method will check for basic vetex compatibility and then re-order the data to match the VBO structure of the mesh More...
 
void setMeshToFrame (const unsigned int _frame) noexcept
 set the attached mesh to the current frame More...
 
unsigned int getNumFrames () const noexcept
 return the number of Frames loaded from the PointBake file More...
 
unsigned int getNumVerts () const noexcept
 return the number of verts loaded from the PointBake file More...
 
std::vector< std::vector< Vec3 > > & getRawDataPointer () noexcept
 get a Raw data pointer to the un-sorted PointBake data More...
 
std::vector< Vec3 > & getRawDataPointerAtFrame (unsigned int _f) noexcept
 get a Raw data pointer to the un-sorted PointBake for a particular frame More...
 

Protected Member Functions

void reorderVerts () noexcept
 method to create the vertorder container with the correct vertex order in place to match that of the obj file More...
 

Protected Attributes

unsigned int m_numFrames
 the number of frames in the clip file More...
 
unsigned int m_currFrame
 Current active frame when animating. More...
 
std::vector< std::vector< Vec3 > > m_data
 The actual data of the clip stored per vertex in sequence v0 - vn and then per frame frame index is always frame 0- endframe despite the start / end values in the clip file. More...
 
unsigned int m_nVerts
 Number of verts in the actual clip. More...
 
std::string m_meshName
 the name of the mesh More...
 
unsigned int m_startFrame
 the start frame More...
 
unsigned int m_endFrame
 the end frame More...
 
AbstractMeshm_mesh
 pointer to mesh attatched to data More...
 
bool m_binFile
 flag to indicate if we have a binary or xml based file loaded More...
 

Friends

class AbstractMesh
 

Detailed Description

Class to load and manipulate NCCAPointBake data, this will replace the Houdini Clip files as they are now not supported in the educational version of Houdini.

<?xml version="1.0" encoding="UTF-8" ?>
<NCCAPointBake>
  <MeshName> The name of the mesh exported </MeshName>
  <NumVerts> the number of verts </NumVerts>
  <StartFrame> start frame from export </StartFrame>
  <EndFrame> end frame from export </EndFrame>
  <NumFrames> Total number of frames </NumFrame>
  <TranslateMode> if data for translations are absolute or relative </TranslateMode>
  <Frame number="0">
    <Vertex number="0" attrib="translate"> 2.145875 9.490916 33.391218 </Vertex>
    etc
  </Frame>
</NCCAPointBake>
Author
Jonathan Macey
Version
1.0
Date
Last Revision 2/09/10

Definition at line 58 of file NCCAPointBake.h.

Constructor & Destructor Documentation

ngl::NCCAPointBake::NCCAPointBake ( )
noexcept

ctor for the clip

Definition at line 33 of file NCCAPointBake.cpp.

References m_binFile, m_currFrame, m_endFrame, m_mesh, m_numFrames, m_nVerts, and m_startFrame.

ngl::NCCAPointBake::~NCCAPointBake ( )
noexcept

the dtor erases all clip data allocated and also destroys the Obj reference held in the clip

Definition at line 134 of file NCCAPointBake.cpp.

ngl::NCCAPointBake::NCCAPointBake ( const std::string _fileName)
noexcept

ctor using a clip and an obj

Parameters
[in]_fileNamethe name of the bake file to load

Definition at line 139 of file NCCAPointBake.cpp.

References loadPointBake().

+ Here is the call graph for this function:

Member Function Documentation

bool ngl::NCCAPointBake::attachMesh ( AbstractMesh _mesh)
noexcept

method to attach a mesh to the data this method will check for basic vetex compatibility and then re-order the data to match the VBO structure of the mesh

Parameters
[in]_meshthe mesh to attach
Returns
true is mesh can be attached else false

Definition at line 281 of file NCCAPointBake.cpp.

References m_mesh, and m_nVerts.

unsigned int ngl::NCCAPointBake::getNumFrames ( ) const
inlinenoexcept

return the number of Frames loaded from the PointBake file

Returns
the number of frames

Definition at line 113 of file NCCAPointBake.h.

unsigned int ngl::NCCAPointBake::getNumVerts ( ) const
inlinenoexcept

return the number of verts loaded from the PointBake file

Returns
the number of verts

Definition at line 118 of file NCCAPointBake.h.

std::vector< std::vector<Vec3> >& ngl::NCCAPointBake::getRawDataPointer ( )
inlinenoexcept

get a Raw data pointer to the un-sorted PointBake data

Returns
a pointer to the data

Definition at line 123 of file NCCAPointBake.h.

std::vector< Vec3 > & ngl::NCCAPointBake::getRawDataPointerAtFrame ( unsigned int  _f)
noexcept

get a Raw data pointer to the un-sorted PointBake for a particular frame

Parameters
[in]_fthe frame to access
Returns
a pointer to the data at frame _f

Definition at line 301 of file NCCAPointBake.cpp.

References m_data, m_numFrames, and NGL_ASSERT.

bool ngl::NCCAPointBake::loadBinaryPointBake ( const std::string _fileName)
noexcept

method to load a binary point baked file

Parameters
[in]_fileNamethe file to load

The number of vertices in the object

Definition at line 149 of file NCCAPointBake.cpp.

References m_binFile, m_currFrame, m_data, m_numFrames, m_nVerts, and m_startFrame.

bool ngl::NCCAPointBake::loadPointBake ( const std::string _fileName)
noexcept

method to load a point baked file

Parameters
[in]_fileNamethe file to load

Definition at line 44 of file NCCAPointBake.cpp.

References rapidxml::xml_node< Ch >::first_attribute(), rapidxml::xml_node< Ch >::first_node(), m_binFile, m_currFrame, m_data, m_endFrame, m_mesh, m_meshName, m_numFrames, m_nVerts, m_startFrame, rapidxml::xml_node< Ch >::next_sibling(), rapidxml::xml_document< Ch >::parse(), rapidxml::parse_trim_whitespace, and rapidxml::xml_base< Ch >::value().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ngl::NCCAPointBake::reorderVerts ( )
protectednoexcept

method to create the vertorder container with the correct vertex order in place to match that of the obj file

bool ngl::NCCAPointBake::saveBinaryPointBake ( const std::string _fileName)
noexcept

method to save a binary point baked file basically re-ordered data only

Parameters
[in]_fileNamethe file to load

Definition at line 203 of file NCCAPointBake.cpp.

References m_binFile, m_currFrame, m_data, m_numFrames, m_nVerts, and m_startFrame.

void ngl::NCCAPointBake::setFrame ( const unsigned int  frame)
noexcept

Set the current Frame and map the clip for that frame to the obj.

Parameters
[in]framethe frame to set

Definition at line 144 of file NCCAPointBake.cpp.

References m_currFrame.

void ngl::NCCAPointBake::setMeshToFrame ( const unsigned int  _frame)
noexcept

set the attached mesh to the current frame

Parameters
[in]_framethe frame to set the mesh to

Definition at line 246 of file NCCAPointBake.cpp.

References ngl::AbstractMesh::getFaceList(), m_currFrame, m_data, m_mesh, ngl::AbstractMesh::mapVAOVerts(), and ngl::AbstractMesh::unMapVAO().

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend class AbstractMesh
friend

Definition at line 60 of file NCCAPointBake.h.

Member Data Documentation

bool ngl::NCCAPointBake::m_binFile
protected

flag to indicate if we have a binary or xml based file loaded

Definition at line 174 of file NCCAPointBake.h.

unsigned int ngl::NCCAPointBake::m_currFrame
protected

Current active frame when animating.

Definition at line 145 of file NCCAPointBake.h.

std::vector< std::vector<Vec3> > ngl::NCCAPointBake::m_data
protected

The actual data of the clip stored per vertex in sequence v0 - vn and then per frame frame index is always frame 0- endframe despite the start / end values in the clip file.

Definition at line 150 of file NCCAPointBake.h.

unsigned int ngl::NCCAPointBake::m_endFrame
protected

the end frame

Definition at line 166 of file NCCAPointBake.h.

AbstractMesh* ngl::NCCAPointBake::m_mesh
protected

pointer to mesh attatched to data

Definition at line 170 of file NCCAPointBake.h.

std::string ngl::NCCAPointBake::m_meshName
protected

the name of the mesh

Definition at line 158 of file NCCAPointBake.h.

unsigned int ngl::NCCAPointBake::m_numFrames
protected

the number of frames in the clip file

Definition at line 141 of file NCCAPointBake.h.

unsigned int ngl::NCCAPointBake::m_nVerts
protected

Number of verts in the actual clip.

Definition at line 154 of file NCCAPointBake.h.

unsigned int ngl::NCCAPointBake::m_startFrame
protected

the start frame

Definition at line 162 of file NCCAPointBake.h.


The documentation for this class was generated from the following files: