osgCal::CoreModel Class Reference

Core Model class that creates a templated core object. In order to create an animated model, a cal3d core model has to be created. Given this core model it is possible to instanciate it by creating a model which is in fact the real animated model and object which can be inserted into an osg graph. More...

List of all members.

Classes

struct  LayerDescription
struct  Material
struct  ParameterDescription
struct  SlotDescription

Public Types

typedef std::vector
< osg::ref_ptr< osg::Texture2D > > 
Textures2D
typedef std::map< int, Textures2DCoreMaterialId2Textures2D
typedef std::map< std::string,
std::string > 
Name2Filename
typedef std::map< std::string,
std::string > 
MeshDescription
typedef std::map< std::string,
SlotDescription
SlotBank

Public Member Functions

 META_Object (osgCal, CoreModel)
 CoreModel ()
 CoreModel (const CoreModel &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
void setCollisionDefault (bool collisionDefault)
bool getCollisionDefault ()
void setVersion (int version)
int getVersion ()
CalCoreModel * getCalCoreModel (void)
 Returns the cal3d core model associated with osgCal CoreModel.
void garbageCollect (void)
 Cleans and releases dead objects.
Textures2DgetTextures2D (const std::string &strFilename)
Textures2DgetTextures2D (int materialId)
 Returns the texture associated to a material.
bool getTexturesNameFromMaterialID (int _coreMaterialId, std::vector< std::string > &_res)
void setMeshName2Filename (const Name2Filename &meshName2Filename)
 Sets the mesh name to mesh filename map.
const Name2FilenamegetMeshName2Filename (void)
 Returns the mesh name to file mesh name map.
bool SubUsingMeshId (int coreMeshId)
bool AddUsingMeshId (int coreMeshId)
const std::vector< std::string > & getCommonMeshes () const
const std::map< std::string,
MeshDescription > & 
getMeshes () const
SlotDescriptiongetSlotFromTypeAndName (const std::string &slotType, const std::string &slotName)
const std::map< std::string,
SlotBank > & 
getSlots () const
const std::string & getFilename () const
void setFilename (const std::string &fname)

Public Attributes

std::map< std::string,
ParameterDescription
_parameters
std::map< std::string,
LayerDescription
_layers
std::map< std::string, SlotBank_slots
std::map< std::string,
MeshDescription
_meshes
std::vector< std::string > _commonMeshes
std::map< std::string, Material_materials
std::map< std::string,
CalVector * > 
_name2Normal
std::string _path
bool _configurable

Protected Member Functions

virtual ~CoreModel ()

Protected Attributes

CalCoreModel _calCoreModel
 Cal3d core model.
CoreMaterialId2Textures2D _coreMaterialId2Textures
 Material Id to associated texture map.
Name2Filename _meshName2Filename
 Mesh name to mesh filename map.
std::map< int, int > _mReferenceCountCoreMeshIds
bool _collisionDefault
int _version
osg::NotifySeverity _notify
std::string _filename

Friends

class ReaderWriterXFG


Detailed Description

Core Model class that creates a templated core object. In order to create an animated model, a cal3d core model has to be created. Given this core model it is possible to instanciate it by creating a model which is in fact the real animated model and object which can be inserted into an osg graph.

Member Typedef Documentation

typedef std::map<std::string,std::string> osgCal::CoreModel::MeshDescription

typedef std::map<std::string, std::string> osgCal::CoreModel::Name2Filename

typedef std::map<std::string,SlotDescription> osgCal::CoreModel::SlotBank

typedef std::vector<osg::ref_ptr<osg::Texture2D> > osgCal::CoreModel::Textures2D


Constructor & Destructor Documentation

osgCal::CoreModel::CoreModel (  ) 

osgCal::CoreModel::CoreModel ( const CoreModel ,
const osg::CopyOp &  copyop = osg::CopyOp::SHALLOW_COPY 
)

virtual osgCal::CoreModel::~CoreModel (  )  [protected, virtual]


Member Function Documentation

bool osgCal::CoreModel::AddUsingMeshId ( int  coreMeshId  ) 

void osgCal::CoreModel::garbageCollect ( void   ) 

Cleans and releases dead objects.

CalCoreModel* osgCal::CoreModel::getCalCoreModel ( void   )  [inline]

Returns the cal3d core model associated with osgCal CoreModel.

bool osgCal::CoreModel::getCollisionDefault (  )  [inline]

const std::vector<std::string>& osgCal::CoreModel::getCommonMeshes (  )  const [inline]

const std::string& osgCal::CoreModel::getFilename (  )  const [inline]

const std::map<std::string, MeshDescription>& osgCal::CoreModel::getMeshes (  )  const [inline]

const Name2Filename& osgCal::CoreModel::getMeshName2Filename ( void   )  [inline]

Returns the mesh name to file mesh name map.

SlotDescription* osgCal::CoreModel::getSlotFromTypeAndName ( const std::string &  slotType,
const std::string &  slotName 
) [inline]

const std::map<std::string,SlotBank>& osgCal::CoreModel::getSlots (  )  const [inline]

Textures2D* osgCal::CoreModel::getTextures2D ( int  materialId  ) 

Returns the texture associated to a material.

Parameters:
materialId the Id of the material

Textures2D* osgCal::CoreModel::getTextures2D ( const std::string &  strFilename  ) 

Returns a texture2D* given a texture filename

Parameters:
strFilename name of the texture file ( typically an image )
Remarks:
If texture has been already loaded by a previous call of this function, the stored texture2D pointed is returned

bool osgCal::CoreModel::getTexturesNameFromMaterialID ( int  _coreMaterialId,
std::vector< std::string > &  _res 
)

int osgCal::CoreModel::getVersion (  )  [inline]

osgCal::CoreModel::META_Object ( osgCal  ,
CoreModel   
)

void osgCal::CoreModel::setCollisionDefault ( bool  collisionDefault  )  [inline]

void osgCal::CoreModel::setFilename ( const std::string &  fname  )  [inline]

void osgCal::CoreModel::setMeshName2Filename ( const Name2Filename meshName2Filename  )  [inline]

Sets the mesh name to mesh filename map.

void osgCal::CoreModel::setVersion ( int  version  )  [inline]

bool osgCal::CoreModel::SubUsingMeshId ( int  coreMeshId  ) 


Friends And Related Function Documentation

friend class ReaderWriterXFG [friend]


Member Data Documentation

CalCoreModel osgCal::CoreModel::_calCoreModel [protected]

Cal3d core model.

std::vector<std::string> osgCal::CoreModel::_commonMeshes

Material Id to associated texture map.

std::string osgCal::CoreModel::_filename [protected]

std::map<std::string, Material> osgCal::CoreModel::_materials

Mesh name to mesh filename map.

std::map<int,int> osgCal::CoreModel::_mReferenceCountCoreMeshIds [protected]

std::map<std::string, CalVector*> osgCal::CoreModel::_name2Normal

osg::NotifySeverity osgCal::CoreModel::_notify [protected]

std::map<std::string,SlotBank> osgCal::CoreModel::_slots

int osgCal::CoreModel::_version [protected]


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

Generated on Wed Aug 19 01:36:27 2009 for osgCal by  doxygen 1.5.9