osgCal::Model Class Reference

List of all members.

Public Types

typedef std::map< std::string,
TargetMap
FlattenConf
typedef CoreModel::Textures2D Textures2D
typedef std::vector
< osg::ref_ptr< osg::Drawable > > 
Drawables
typedef std::map< int, DrawablesCoreMeshId2Drawables
typedef std::vector< int > VectorInt

Public Member Functions

 META_Object (osgCal, Model)
 Model ()
 Model (const Model &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
bool create (void)
 Create model from a templated CoreModel. Remember to set CoreModel with setCoreModel function.
void update (void)
CoreModelgetCoreModel ()
 Retrieves CoreModel.
bool setCoreModel (CoreModel *coreModel)
 Sets CoreModel.
CalCoreModel * getCalCoreModel (void)
 Retrieves the Cal3d CalCoreModel.
CalModel * getCalModel (void)
 Retrieves the Cal3d CalModel associated with the current osgCalModel instance.
Textures2DgetTextures2D (const std::string &materialName)
 Retrieves the 2D textures given a material name.
Textures2DgetTextures2D (int coreMaterialId)
 Retrieves the 2D textures given a material id.
DrawablesgetDrawables (const std::string &materialName)
 Retrieves the drawables given a material name.
DrawablesgetDrawables (int coreMaterialId)
 Retrieves the drawables given a material id.
bool hasDrawables (int coreMeshId)
bool setActiveMesh (const std::string &_meshName)
 Activates meshes.
bool setActiveMeshes (const std::vector< int > &activeMeshes)
const std::vector< int > & getActiveMeshes (void) const
bool bindMaterials (const std::string &meshName, const std::vector< std::string > &materials)
bool setInvisibleMesh (const std::string &meshName)
bool setInvisibleMeshes (const std::vector< int > &invisibleMeshes)
const std::vector< int > & getInvisibleMeshes (void) const
bool setCollisionMesh (const std::string &meshName)
bool setCollisionMeshNames (const std::vector< std::string > &meshNames)
const std::vector< std::string > & getCollisionMeshNames (void) const
bool setCollisionMeshes (const std::vector< int > &collisionMeshes)
const std::vector< int > & getCollisionMeshes (void) const
bool setUseVertexProgram (bool useVertexProgram, unsigned int contextID=0)
bool getUseVertexProgram (void)
bool setUseColorOrTexture (bool useColorOrTexture)
bool getUseColorOrTexture (void)
bool bindMesh (const CoreModel::MeshDescription &meshDescription)
void unapplySlot (const std::string &slotType, int slotIndex)
std::vector< int > & getCoreMeshIdUsedForMesh (const std::string &_itemName)
const std::string & getItemUsedForMesh (int _coreMeshId)
std::vector< std::string > getMeshFromSlot (const std::string &slotType, int index=0)
bool getSlotListFromSlotType (const std::string &name, CoreModel::SlotBank &result)
bool applySlot (const std::string &slotType, const std::string &slotName, int slotIndex)
void setupLayers (const std::string &slotType, const std::string &slotName, int slotIndex)
void setupTLF (const std::string &slotType, int slotIndex)
void freeAllLayersRessource ()
void setFXGroup (osg::Group *_grp)
osg::Group * getFXGroup ()
void setFXState (osg::State *_state)
osg::State * getFXState ()
bool setParam (const std::string &name, const std::string &type, int value)
FlattenConfgetFlattenConfFromSlotType (const std::string &_type)
void flushTextureCache ()
bool removeCollisionMesh (const std::string &meshName)
bool removeInvisibleMesh (const std::string &meshName)
bool unBindMesh (const CoreModel::MeshDescription &meshDescription)
OutfitDescriptiongetOutfit ()
bool initOutfitFromFile (const std::string &fname, std::vector< std::string > *excludeMesh=0)
bool initOutfitFromXMLString (const std::string &xmlString, std::vector< std::string > *excludeMesh=0)
bool installOutfitFromXMLString (const std::string &xmlString)
bool applyParameterFromOutfitDescription ()
bool loadOutfit (OutfitDescription *outfit, std::vector< std::string > *toBeIgnored=NULL)

Static Public Member Functions

static void freeLayersRessource ()

Protected Member Functions

virtual ~Model ()
bool createSoftware (void)
bool createSubMeshSoftware (int coreMeshId)
bool createHardware (void)
bool setupMaterial (osg::Drawable *drawable, CalSubmesh *calSubmesh)
void invertUVs (int coreMeshId)
bool isInvisibleMesh (int coreMeshId)
bool isCollisionMesh (int coreMeshId)
bool find (const std::vector< int > &vector, int item)
bool isSlotAlreadyApplied (const std::string &_slotType, const std::string &_slotName)
void fixNormalSW (float ptThreshold)
void fixNormalHW (int nbVertices, osg::Vec3f *pos, osg::Vec3f *normal, char *imesh, float ptThreshold)

Protected Attributes

GlueCalHardwareModelmHardwareModel
bool _useVertexProgram
bool _useColorOrTexture
unsigned int _vbo [MODEL_VBO_SIZE]
osg::ref_ptr< CoreModel_coreModel
std::vector< int > _activeMeshes
std::vector< int > _invisibleMeshes
std::vector< int > _collisionMeshes
std::map< int, std::string > _coreMeshId2Item
std::map< std::string, VectorInt_mesh2CoreMeshId
std::map< CalCoreSubmesh *,
SubMeshSoftware * > 
_calCoreSubmesh2SubMeshSoftware
OutfitDescription _outfit
std::vector< std::string > _collisionMeshNames
CoreMeshId2Drawables _coreMeshId2Drawables
CalModel * _calModel
osg::ref_ptr< osg::VertexProgram > _vp
osg::BoundingBox _bbox
std::string _outfitName
std::map< std::string,
FlattenConf
slotName2FlattenConf_
std::map< std::string,
osg::ref_ptr< osg::Texture2D > > 
targetmap2texture_
osg::ref_ptr< osg::Group > fxGroup_
osg::ref_ptr< osg::State > fxState_
std::map< std::string,
std::vector< std::string > > 
slotDependencies_
osg::NotifySeverity _notify

Friends

class SubMeshHardware

Classes

struct  OutfitDescription
class  TargetMap


Member Typedef Documentation

typedef std::map<std::string, TargetMap> osgCal::Model::FlattenConf

typedef CoreModel::Textures2D osgCal::Model::Textures2D

typedef std::vector<osg::ref_ptr<osg::Drawable> > osgCal::Model::Drawables

typedef std::map<int,Drawables> osgCal::Model::CoreMeshId2Drawables

typedef std::vector<int> osgCal::Model::VectorInt


Constructor & Destructor Documentation

osgCal::Model::Model (  ) 

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

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


Member Function Documentation

osgCal::Model::META_Object ( osgCal  ,
Model   
)

bool osgCal::Model::create ( void   ) 

Create model from a templated CoreModel. Remember to set CoreModel with setCoreModel function.

void osgCal::Model::update ( void   ) 

CoreModel* osgCal::Model::getCoreModel (  )  [inline]

Retrieves CoreModel.

bool osgCal::Model::setCoreModel ( CoreModel coreModel  ) 

Sets CoreModel.

Returns:
false if case of error, otherwise true.

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

Retrieves the Cal3d CalCoreModel.

CalModel* osgCal::Model::getCalModel ( void   )  [inline]

Retrieves the Cal3d CalModel associated with the current osgCalModel instance.

Textures2D* osgCal::Model::getTextures2D ( const std::string &  materialName  ) 

Retrieves the 2D textures given a material name.

Parameters:
materialName a valid materialName
Remarks:
Each material has map(s) associated, i.e. texture(s).

Textures2D* osgCal::Model::getTextures2D ( int  coreMaterialId  ) 

Retrieves the 2D textures given a material id.

Parameters:
materialId a valid material Id
Remarks:
Each material has map(s) associated, i.e. texture(s).

Drawables* osgCal::Model::getDrawables ( const std::string &  materialName  ) 

Retrieves the drawables given a material name.

Parameters:
materialName a valid materialName
Remarks:
Each material has map(s) associated, i.e. texture(s). The drawables are osg objects that can be rendered.

Drawables* osgCal::Model::getDrawables ( int  coreMaterialId  ) 

Retrieves the drawables given a material id.

Parameters:
materialId a valid materialId
Remarks:
Each material has map(s) associated, i.e. texture(s). The drawables are osg objects that can be rendered.

bool osgCal::Model::hasDrawables ( int  coreMeshId  ) 

bool osgCal::Model::setActiveMesh ( const std::string &  _meshName  ) 

Activates meshes.

Parameters:
meshName name of the mesh to active
Remarks:
By default all the meshes are set to active.

bool osgCal::Model::setActiveMeshes ( const std::vector< int > &  activeMeshes  )  [inline]

const std::vector<int>& osgCal::Model::getActiveMeshes ( void   )  const [inline]

bool osgCal::Model::bindMaterials ( const std::string &  meshName,
const std::vector< std::string > &  materials 
)

bool osgCal::Model::setInvisibleMesh ( const std::string &  meshName  ) 

bool osgCal::Model::setInvisibleMeshes ( const std::vector< int > &  invisibleMeshes  )  [inline]

const std::vector<int>& osgCal::Model::getInvisibleMeshes ( void   )  const [inline]

bool osgCal::Model::setCollisionMesh ( const std::string &  meshName  ) 

bool osgCal::Model::setCollisionMeshNames ( const std::vector< std::string > &  meshNames  ) 

const std::vector<std::string>& osgCal::Model::getCollisionMeshNames ( void   )  const [inline]

bool osgCal::Model::setCollisionMeshes ( const std::vector< int > &  collisionMeshes  )  [inline]

const std::vector<int>& osgCal::Model::getCollisionMeshes ( void   )  const [inline]

bool osgCal::Model::setUseVertexProgram ( bool  useVertexProgram,
unsigned int  contextID = 0 
)

bool osgCal::Model::getUseVertexProgram ( void   )  [inline]

bool osgCal::Model::setUseColorOrTexture ( bool  useColorOrTexture  )  [inline]

bool osgCal::Model::getUseColorOrTexture ( void   )  [inline]

bool osgCal::Model::bindMesh ( const CoreModel::MeshDescription meshDescription  ) 

void osgCal::Model::unapplySlot ( const std::string &  slotType,
int  slotIndex 
)

std::vector<int>& osgCal::Model::getCoreMeshIdUsedForMesh ( const std::string &  _itemName  )  [inline]

const std::string& osgCal::Model::getItemUsedForMesh ( int  _coreMeshId  )  [inline]

std::vector<std::string> osgCal::Model::getMeshFromSlot ( const std::string &  slotType,
int  index = 0 
)

bool osgCal::Model::getSlotListFromSlotType ( const std::string &  name,
CoreModel::SlotBank result 
)

bool osgCal::Model::applySlot ( const std::string &  slotType,
const std::string &  slotName,
int  slotIndex 
)

void osgCal::Model::setupLayers ( const std::string &  slotType,
const std::string &  slotName,
int  slotIndex 
)

void osgCal::Model::setupTLF ( const std::string &  slotType,
int  slotIndex 
)

void osgCal::Model::freeAllLayersRessource (  ) 

static void osgCal::Model::freeLayersRessource (  )  [static]

void osgCal::Model::setFXGroup ( osg::Group *  _grp  )  [inline]

osg::Group* osgCal::Model::getFXGroup (  )  [inline]

void osgCal::Model::setFXState ( osg::State *  _state  )  [inline]

osg::State* osgCal::Model::getFXState (  )  [inline]

bool osgCal::Model::setParam ( const std::string &  name,
const std::string &  type,
int  value 
)

FlattenConf& osgCal::Model::getFlattenConfFromSlotType ( const std::string &  _type  )  [inline]

void osgCal::Model::flushTextureCache (  ) 

bool osgCal::Model::removeCollisionMesh ( const std::string &  meshName  ) 

bool osgCal::Model::removeInvisibleMesh ( const std::string &  meshName  ) 

bool osgCal::Model::unBindMesh ( const CoreModel::MeshDescription meshDescription  ) 

OutfitDescription* osgCal::Model::getOutfit (  )  [inline]

bool osgCal::Model::initOutfitFromFile ( const std::string &  fname,
std::vector< std::string > *  excludeMesh = 0 
)

bool osgCal::Model::initOutfitFromXMLString ( const std::string &  xmlString,
std::vector< std::string > *  excludeMesh = 0 
)

bool osgCal::Model::installOutfitFromXMLString ( const std::string &  xmlString  ) 

bool osgCal::Model::applyParameterFromOutfitDescription (  ) 

bool osgCal::Model::loadOutfit ( OutfitDescription outfit,
std::vector< std::string > *  toBeIgnored = NULL 
)

bool osgCal::Model::createSoftware ( void   )  [protected]

bool osgCal::Model::createSubMeshSoftware ( int  coreMeshId  )  [protected]

bool osgCal::Model::createHardware ( void   )  [protected]

bool osgCal::Model::setupMaterial ( osg::Drawable *  drawable,
CalSubmesh *  calSubmesh 
) [protected]

void osgCal::Model::invertUVs ( int  coreMeshId  )  [protected]

bool osgCal::Model::isInvisibleMesh ( int  coreMeshId  )  [inline, protected]

bool osgCal::Model::isCollisionMesh ( int  coreMeshId  )  [inline, protected]

bool osgCal::Model::find ( const std::vector< int > &  vector,
int  item 
) [protected]

bool osgCal::Model::isSlotAlreadyApplied ( const std::string &  _slotType,
const std::string &  _slotName 
) [protected]

void osgCal::Model::fixNormalSW ( float  ptThreshold  )  [protected]

void osgCal::Model::fixNormalHW ( int  nbVertices,
osg::Vec3f *  pos,
osg::Vec3f *  normal,
char *  imesh,
float  ptThreshold 
) [protected]


Friends And Related Function Documentation

friend class SubMeshHardware [friend]


Member Data Documentation

GlueCalHardwareModel* osgCal::Model::mHardwareModel [protected]

bool osgCal::Model::_useVertexProgram [protected]

bool osgCal::Model::_useColorOrTexture [protected]

unsigned int osgCal::Model::_vbo[MODEL_VBO_SIZE] [protected]

osg::ref_ptr<CoreModel> osgCal::Model::_coreModel [protected]

std::vector<int> osgCal::Model::_activeMeshes [protected]

std::vector<int> osgCal::Model::_invisibleMeshes [protected]

std::vector<int> osgCal::Model::_collisionMeshes [protected]

std::map<int, std::string> osgCal::Model::_coreMeshId2Item [protected]

std::map<std::string, VectorInt> osgCal::Model::_mesh2CoreMeshId [protected]

std::map<CalCoreSubmesh*, SubMeshSoftware*> osgCal::Model::_calCoreSubmesh2SubMeshSoftware [protected]

OutfitDescription osgCal::Model::_outfit [protected]

std::vector<std::string> osgCal::Model::_collisionMeshNames [protected]

CoreMeshId2Drawables osgCal::Model::_coreMeshId2Drawables [protected]

CalModel* osgCal::Model::_calModel [protected]

osg::ref_ptr<osg::VertexProgram> osgCal::Model::_vp [protected]

osg::BoundingBox osgCal::Model::_bbox [protected]

std::string osgCal::Model::_outfitName [protected]

std::map<std::string, FlattenConf> osgCal::Model::slotName2FlattenConf_ [protected]

std::map<std::string, osg::ref_ptr<osg::Texture2D> > osgCal::Model::targetmap2texture_ [protected]

osg::ref_ptr<osg::Group> osgCal::Model::fxGroup_ [protected]

osg::ref_ptr<osg::State> osgCal::Model::fxState_ [protected]

std::map<std::string, std::vector<std::string> > osgCal::Model::slotDependencies_ [protected]

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


The documentation for this class was generated from the following file:
Generated on Sun Jan 6 13:47:25 2008 for osgCal by  doxygen 1.5.4