#include <OgreVisualModel.h>


Public Member Functions | |
| int | getNbTriangles () |
| OgreVisualModel () | |
| std::string | getOgreName () |
| void | parse (core::objectmodel::BaseObjectDescription *) |
| Parse the given description to assign values to this object's fields and potentially other parameters. | |
| void | reinit () |
| Update method called when variables used in precomputation are modified. | |
| virtual void | attach (Ogre::SceneManager *sceneMgr) |
| virtual void | draw () |
| Render internal data of this object, for debugging purposes. | |
| virtual void | initTextures () |
| Initialize the textures, or other graphical resources. | |
| virtual void | updateVisual () |
| used to update the model if necessary. | |
Data Fields | |
| Data< std::string > | materialname |
| float | dx |
| float | dy |
| float | dz |
| float | scale |
| int | meshRevision |
| Ogre::MeshPtr | ogreMesh |
| Ogre::Entity * | ogreEntity |
| Ogre::SceneNode * | ogreNode |
| Ogre::HardwareVertexBufferSharedPtr | vBuffer |
| Ogre::HardwareIndexBufferSharedPtr | iBuffer |
Static Public Attributes | |
| static bool | lightSwitched |
| static int | counter |
Protected Member Functions | |
| void | uploadVertices () |
| void | uploadIndices () |
| void | computeNormals () |
| void | computeBounds () |
| void | updateMaterial (Ogre::MaterialPtr &mat) |
| std::string | uniqueName (void) |
Protected Attributes | |
| ResizableExtVector< Vec < 2, float > > | mirror_tex |
| std::string | submesh_material |
Definition at line 62 of file OgreVisualModel.h.
| sofa::component::visualmodel::OgreVisualModel::OgreVisualModel | ( | ) |
Definition at line 52 of file OgreVisualModel.cpp.
| void sofa::component::visualmodel::OgreVisualModel::attach | ( | Ogre::SceneManager * | sceneMgr | ) | [virtual] |
Definition at line 100 of file OgreVisualModel.cpp.
References computeBounds(), getNbTriangles(), getOgreName(), sofa::core::objectmodel::Data< T >::getValue(), iBuffer, materialname, ogreEntity, ogreMesh, ogreNode, sofa::core::objectmodel::Base::setName(), sofa::defaulttype::ExtVector< T >::size(), submesh_material, sofa::component::visualmodel::VisualModelImpl::texturename, uniqueName(), updateMaterial(), uploadIndices(), uploadVertices(), vBuffer, sofa::component::visualmodel::VisualModelImpl::vertices, and sofa::component::visualmodel::VisualModelImpl::vtexcoords.
| void sofa::component::visualmodel::OgreVisualModel::computeBounds | ( | ) | [protected] |
Definition at line 496 of file OgreVisualModel.cpp.
References sofa::component::visualmodel::conv(), ogreMesh, ogreNode, sofa::defaulttype::ExtVector< T >::size(), and sofa::component::visualmodel::VisualModelImpl::vertices.
Referenced by attach(), and updateVisual().
| void sofa::component::visualmodel::OgreVisualModel::computeNormals | ( | ) | [protected, virtual] |
Reimplemented from sofa::component::visualmodel::VisualModelImpl.
Definition at line 428 of file OgreVisualModel.cpp.
References sofa::component::clear(), cross(), sofa::core::objectmodel::BaseObject::getContext(), sofa::core::componentmodel::topology::BaseMeshTopology::getQuads(), sofa::core::objectmodel::BaseContext::getTopology(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangles(), sofa::component::visualmodel::VisualModelImpl::quads, sofa::defaulttype::ExtVector< T >::resize(), sofa::defaulttype::ExtVector< T >::size(), sofa::component::visualmodel::VisualModelImpl::triangles, sofa::component::visualmodel::VisualModelImpl::useTopology, sofa::component::visualmodel::VisualModelImpl::vertices, sofa::component::visualmodel::VisualModelImpl::vertNormIdx, and sofa::component::visualmodel::VisualModelImpl::vnormals.
Referenced by updateVisual(), and uploadVertices().
| virtual void sofa::component::visualmodel::OgreVisualModel::draw | ( | ) | [inline, virtual] |
Render internal data of this object, for debugging purposes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 104 of file OgreVisualModel.h.
| int sofa::component::visualmodel::OgreVisualModel::getNbTriangles | ( | ) | [inline] |
Definition at line 75 of file OgreVisualModel.h.
References sofa::core::objectmodel::BaseObject::getContext(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbQuads(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTriangles(), sofa::core::objectmodel::BaseContext::getTopology(), sofa::component::visualmodel::VisualModelImpl::quads, sofa::component::visualmodel::VisualModelImpl::triangles, and sofa::component::visualmodel::VisualModelImpl::useTopology.
Referenced by attach(), and uploadIndices().
| std::string sofa::component::visualmodel::OgreVisualModel::getOgreName | ( | ) |
Definition at line 67 of file OgreVisualModel.cpp.
References sofa::core::objectmodel::BaseObject::getContext(), and sofa::core::objectmodel::Base::getName().
Referenced by attach(), and uniqueName().
| virtual void sofa::component::visualmodel::OgreVisualModel::initTextures | ( | ) | [inline, virtual] |
Initialize the textures, or other graphical resources.
Reimplemented from sofa::core::VisualModel.
Definition at line 106 of file OgreVisualModel.h.
| void sofa::component::visualmodel::OgreVisualModel::parse | ( | core::objectmodel::BaseObjectDescription * | arg | ) | [virtual] |
Parse the given description to assign values to this object's fields and potentially other parameters.
Reimplemented from sofa::component::visualmodel::VisualModelImpl.
Definition at line 72 of file OgreVisualModel.cpp.
References dx, dy, dz, sofa::core::objectmodel::BaseObjectDescription::getAttribute(), and scale.
| void sofa::component::visualmodel::OgreVisualModel::reinit | ( | ) | [virtual] |
Update method called when variables used in precomputation are modified.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 200 of file OgreVisualModel.cpp.
References submesh_material, updateMaterial(), and updateVisual().
| std::string sofa::component::visualmodel::OgreVisualModel::uniqueName | ( | void | ) | [protected] |
Definition at line 59 of file OgreVisualModel.cpp.
References counter, and getOgreName().
Referenced by attach().
| void sofa::component::visualmodel::OgreVisualModel::updateMaterial | ( | Ogre::MaterialPtr & | mat | ) | [protected] |
Definition at line 210 of file OgreVisualModel.cpp.
References sofa::core::objectmodel::Data< T >::getValue(), and sofa::component::visualmodel::VisualModelImpl::material.
| void sofa::component::visualmodel::OgreVisualModel::updateVisual | ( | ) | [virtual] |
used to update the model if necessary.
Reimplemented from sofa::component::visualmodel::VisualModelImpl.
Definition at line 239 of file OgreVisualModel.cpp.
References computeBounds(), computeNormals(), sofa::core::objectmodel::BaseObject::getContext(), sofa::core::componentmodel::topology::BaseMeshTopology::getRevision(), sofa::core::objectmodel::BaseContext::getTopology(), lightSwitched, meshRevision, sofa::component::visualmodel::ExtVec3fMappedModel::modified, ogreMesh, uploadIndices(), and uploadVertices().
Referenced by reinit().
| void sofa::component::visualmodel::OgreVisualModel::uploadIndices | ( | ) | [protected] |
Definition at line 333 of file OgreVisualModel.cpp.
References sofa::core::objectmodel::BaseObject::getContext(), getNbTriangles(), sofa::core::componentmodel::topology::BaseMeshTopology::getQuads(), sofa::core::componentmodel::topology::BaseMeshTopology::getRevision(), sofa::core::objectmodel::BaseContext::getTopology(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangles(), iBuffer, meshRevision, ogreMesh, sofa::component::visualmodel::VisualModelImpl::quads, sofa::component::visualmodel::VisualModelImpl::triangles, and sofa::component::visualmodel::VisualModelImpl::useTopology.
Referenced by attach(), and updateVisual().
| void sofa::component::visualmodel::OgreVisualModel::uploadVertices | ( | ) | [protected] |
Definition at line 258 of file OgreVisualModel.cpp.
References computeNormals(), dx, dy, dz, sofa::defaulttype::ExtVector< T >::getData(), sofa::component::visualmodel::ExtVec3fMappedModel::modified, ogreMesh, scale, sofa::defaulttype::ExtVector< T >::size(), vBuffer, sofa::component::visualmodel::VisualModelImpl::vertices, and sofa::component::visualmodel::VisualModelImpl::vnormals.
Referenced by attach(), and updateVisual().
| Ogre::HardwareIndexBufferSharedPtr sofa::component::visualmodel::OgreVisualModel::iBuffer |
Definition at line 66 of file OgreVisualModel.h.
Referenced by sofa::gui::qt::viewer::qtogre::QtOgreViewer::keyPressEvent(), and updateVisual().
ResizableExtVector<Vec<2,float> > sofa::component::visualmodel::OgreVisualModel::mirror_tex [protected] |
Definition at line 113 of file OgreVisualModel.h.
| Ogre::MeshPtr sofa::component::visualmodel::OgreVisualModel::ogreMesh |
Definition at line 85 of file OgreVisualModel.h.
Referenced by attach(), computeBounds(), updateVisual(), uploadIndices(), and uploadVertices().
| Ogre::SceneNode* sofa::component::visualmodel::OgreVisualModel::ogreNode |
Reimplemented from sofa::component::visualmodel::VisualModelImpl.
Definition at line 71 of file OgreVisualModel.h.
Referenced by parse(), and uploadVertices().
std::string sofa::component::visualmodel::OgreVisualModel::submesh_material [protected] |
| Ogre::HardwareVertexBufferSharedPtr sofa::component::visualmodel::OgreVisualModel::vBuffer |
1.5.7.1