#include <VisualModelImpl.h>


Public Member Functions | |
| VisualModelImpl () | |
| ~VisualModelImpl () | |
| void | parse (core::objectmodel::BaseObjectDescription *arg) |
| Parse the given description to assign values to this object's fields and potentially other parameters. | |
| bool | isTransparent () |
| void | drawVisual () |
| Display the VisualModel object. | |
| void | drawTransparent () |
| Display transparent surfaces. | |
| void | drawShadow () |
| Display shadow-casting surfaces. | |
| virtual bool | loadTexture (const std::string &) |
| bool | load (const std::string &filename, const std::string &loader, const std::string &textureName) |
| void | applyTranslation (const double dx, const double dy, const double dz) |
| Translate the positions. | |
| void | applyRotation (const double rx, const double ry, const double rz) |
| Rotate the positions using Euler Angles in degree. | |
| void | applyRotation (const Quat q) |
| Rotate the positions. | |
| void | applyScale (const double s) |
| Scale the positions. | |
| void | applyUVTranslation (const double dU, const double dV) |
| void | applyUVScale (const double su, const double sv) |
| void | flipFaces () |
| void | setFilename (std::string s) |
| std::string | getFilename () |
| void | setColor (float r, float g, float b, float a) |
| void | setColor (std::string color) |
| void | setUseNormals (bool val) |
| bool | getUseNormals () const |
| void | setCastShadow (bool val) |
| bool | getCastShadow () const |
| void | setMesh (helper::io::Mesh &m, bool tex=false) |
| bool | isUsingTopology () const |
| ResizableExtVector< Coord > * | getVertices () |
| void | setVertices (ResizableExtVector< Coord > *x) |
| ResizableExtVector< Triangle > * | getTriangles () |
| void | setTriangles (ResizableExtVector< Triangle > *t) |
| virtual void | computePositions () |
| virtual void | computeMesh () |
| virtual void | computeNormals () |
| virtual void | computeBBox () |
| virtual void | updateVisual () |
| used to update the model if necessary. | |
| virtual void | handleTopologyChange () |
| Handle topological Changes. | |
| void | init () |
| Initialization method called at graph modification, during bottom-up traversal. | |
| void | initVisual () |
| Initialize the textures, or other graphical resources. | |
| bool | addBBox (double *minBBox, double *maxBBox) |
| used to add the bounding-box of this visual model to the given bounding box in order to compute the scene bounding box or cull hidden objects. | |
| virtual void | exportOBJ (std::string name, std::ostream *out, std::ostream *mtl, int &vindex, int &nindex, int &tindex) |
| Append this mesh to an OBJ format stream. | |
| virtual std::string | getTemplateName () const |
| Get the template type names (if any) used to instantiate this object. | |
Static Public Member Functions | |
| static std::string | templateName (const VisualModelImpl *p=NULL) |
Data Fields | |
| Data < sofa::helper::io::Mesh::Material > | material |
Protected Types | |
| typedef ExtVec3fTypes::Real | Real |
| Scalar values (float or double). | |
| typedef ExtVec3fTypes::Coord | Coord |
| Position values. | |
| typedef ExtVec3fTypes::VecCoord | VecCoord |
| Container of Coord values with the same API as sofa::helper::vector. | |
| typedef ExtVec3fTypes::Deriv | Deriv |
| Derivative values (velocity, forces, displacements). | |
| typedef ExtVec3fTypes::VecDeriv | VecDeriv |
| Container of Deriv values with the same API as sofa::helper::vector. | |
| typedef Vec< 2, float > | TexCoord |
| typedef helper::fixed_array < int, 3 > | Triangle |
| typedef helper::fixed_array < int, 4 > | Quad |
Protected Member Functions | |
| virtual void | internalDraw () |
Protected Attributes | |
| bool | useTopology |
| True if list of facets should be taken from the attached topology. | |
| int | lastMeshRev |
| Time stamps from the last time the mesh was updated from the topology. | |
| bool | useNormals |
| True if normals should be read from file. | |
| bool | castShadow |
| True if object cast shadows. | |
| sofa::core::componentmodel::topology::BaseMeshTopology * | _topology |
| DataPtr< ResizableExtVector < Coord > > | field_vertices |
| ResizableExtVector< Coord > | vertices |
| DataPtr< ResizableExtVector < Coord > > | field_vnormals |
| ResizableExtVector< Coord > | vnormals |
| DataPtr< ResizableExtVector < TexCoord > > | field_vtexcoords |
| ResizableExtVector< TexCoord > | vtexcoords |
| DataPtr< ResizableExtVector < Triangle > > | field_triangles |
| ResizableExtVector< Triangle > | triangles |
| DataPtr< ResizableExtVector < Quad > > | field_quads |
| ResizableExtVector< Quad > | quads |
| ResizableExtVector< int > | vertPosIdx |
| If vertices have multiple normals/texcoords, then we need to separate them This vector store which input position is used for each vertice If it is empty then each vertex correspond to one position. | |
| ResizableExtVector< int > | vertNormIdx |
| Similarly this vector store which input normal is used for each vertice If it is empty then each vertex correspond to one normal. | |
| float | scaleTex |
| Data< std::string > | filename |
| Data< std::string > | texturename |
| Data< Vector3 > | translation |
| Data< Vector3 > | rotation |
| Data< SReal > | scale |
| Vec3f | bbox [2] |
This class implemented all non-hardware (i.e OpenGL or DirectX) specific functions for rendering. It takes a 3D model (basically a .OBJ model) and apply transformations on it. At the moment, it is only implemented by OglModel for OpenGL systems.
Definition at line 103 of file VisualModelImpl.h.
typedef ExtVec3fTypes::Coord sofa::component::visualmodel::VisualModelImpl::Coord [protected] |
Position values.
Reimplemented from sofa::core::componentmodel::behavior::MappedModel< TDataTypes >.
Reimplemented in SofaFlowVR::FlowVRRenderMesh.
Definition at line 109 of file VisualModelImpl.h.
typedef ExtVec3fTypes::Deriv sofa::component::visualmodel::VisualModelImpl::Deriv [protected] |
Derivative values (velocity, forces, displacements).
Reimplemented from sofa::core::componentmodel::behavior::MappedModel< TDataTypes >.
Definition at line 111 of file VisualModelImpl.h.
typedef helper::fixed_array<int, 4> sofa::component::visualmodel::VisualModelImpl::Quad [protected] |
Definition at line 117 of file VisualModelImpl.h.
typedef ExtVec3fTypes::Real sofa::component::visualmodel::VisualModelImpl::Real [protected] |
Scalar values (float or double).
Reimplemented from sofa::core::componentmodel::behavior::MappedModel< TDataTypes >.
Definition at line 108 of file VisualModelImpl.h.
typedef Vec<2, float> sofa::component::visualmodel::VisualModelImpl::TexCoord [protected] |
Definition at line 115 of file VisualModelImpl.h.
typedef helper::fixed_array<int, 3> sofa::component::visualmodel::VisualModelImpl::Triangle [protected] |
Definition at line 116 of file VisualModelImpl.h.
typedef ExtVec3fTypes::VecCoord sofa::component::visualmodel::VisualModelImpl::VecCoord [protected] |
Container of Coord values with the same API as sofa::helper::vector.
Reimplemented from sofa::core::componentmodel::behavior::MappedModel< TDataTypes >.
Reimplemented in SofaFlowVR::FlowVRRenderMesh.
Definition at line 110 of file VisualModelImpl.h.
typedef ExtVec3fTypes::VecDeriv sofa::component::visualmodel::VisualModelImpl::VecDeriv [protected] |
Container of Deriv values with the same API as sofa::helper::vector.
Reimplemented from sofa::core::componentmodel::behavior::MappedModel< TDataTypes >.
Definition at line 112 of file VisualModelImpl.h.
| sofa::component::visualmodel::VisualModelImpl::VisualModelImpl | ( | ) |
Definition at line 127 of file VisualModelImpl.cpp.
| sofa::component::visualmodel::VisualModelImpl::~VisualModelImpl | ( | ) |
Definition at line 145 of file VisualModelImpl.cpp.
References sofa::component::visualmodel::ExtVec3fMappedModel::inputVertices, and vertices.
| bool sofa::component::visualmodel::VisualModelImpl::addBBox | ( | double * | , | |
| double * | ||||
| ) | [virtual] |
used to add the bounding-box of this visual model to the given bounding box in order to compute the scene bounding box or cull hidden objects.
Reimplemented from sofa::core::VisualModel.
Definition at line 582 of file VisualModelImpl.cpp.
References bbox, sofa::helper::Quater< Real >::rotate(), sofa::defaulttype::ExtVector< T >::size(), and sofa::component::visualmodel::RigidMappedModel::xforms.
| void sofa::component::visualmodel::VisualModelImpl::applyRotation | ( | const Quat | ) | [virtual] |
Rotate the positions.
This method is optional, it is used when the user want to interactively change the position of an object
Reimplemented from sofa::core::VisualModel.
Definition at line 398 of file VisualModelImpl.cpp.
References sofa::component::visualmodel::ExtVec3fMappedModel::getVecX(), sofa::helper::Quater< Real >::rotate(), and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::applyRotation | ( | const double | double, | |
| const double | double, | |||
| const double | double | |||
| ) | [virtual] |
Rotate the positions using Euler Angles in degree.
This method is optional, it is used when the user want to interactively change the position of an object
Reimplemented from sofa::core::VisualModel.
Definition at line 393 of file VisualModelImpl.cpp.
Referenced by init().
| void sofa::component::visualmodel::VisualModelImpl::applyScale | ( | const double | double | ) | [virtual] |
Scale the positions.
This method is optional, it is used when the user want to interactively change the position of an object
Reimplemented from sofa::core::VisualModel.
Definition at line 408 of file VisualModelImpl.cpp.
References sofa::component::visualmodel::ExtVec3fMappedModel::getVecX(), and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::applyTranslation | ( | const double | double, | |
| const double | double, | |||
| const double | double | |||
| ) | [virtual] |
Translate the positions.
This method is optional, it is used when the user want to interactively change the position of an object
Reimplemented from sofa::core::VisualModel.
Definition at line 381 of file VisualModelImpl.cpp.
References sofa::component::visualmodel::ExtVec3fMappedModel::getVecX(), and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::applyUVScale | ( | const double | su, | |
| const double | sv | |||
| ) |
| void sofa::component::visualmodel::VisualModelImpl::applyUVTranslation | ( | const double | dU, | |
| const double | dV | |||
| ) |
| void sofa::component::visualmodel::VisualModelImpl::computeBBox | ( | ) | [virtual] |
Definition at line 564 of file VisualModelImpl.cpp.
References bbox, and vertices.
Referenced by load(), setMesh(), and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::computeMesh | ( | ) | [virtual] |
Definition at line 727 of file VisualModelImpl.cpp.
References _topology, sofa::defaulttype::ExtVector< T >::empty(), sofa::core::objectmodel::BaseObject::f_printLog, sofa::core::objectmodel::BaseObject::getContext(), sofa::helper::io::Mesh::getFacets(), sofa::core::objectmodel::BaseContext::getMechanicalState(), sofa::core::componentmodel::topology::Topology::getNbPoints(), sofa::core::componentmodel::behavior::BaseMechanicalState::getPX(), sofa::core::componentmodel::topology::BaseMeshTopology::getPX(), sofa::core::componentmodel::behavior::BaseMechanicalState::getPY(), sofa::core::componentmodel::topology::BaseMeshTopology::getPY(), sofa::core::componentmodel::behavior::BaseMechanicalState::getPZ(), sofa::core::componentmodel::topology::BaseMeshTopology::getPZ(), sofa::core::componentmodel::topology::BaseMeshTopology::getQuads(), sofa::core::componentmodel::topology::BaseMeshTopology::getRevision(), sofa::core::componentmodel::behavior::BaseMechanicalState::getSize(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangles(), sofa::core::objectmodel::Data< T >::getValue(), sofa::helper::io::Mesh::getVertices(), sofa::core::componentmodel::topology::BaseMeshTopology::hasPos(), lastMeshRev, quads, sofa::defaulttype::ExtVector< T >::resize(), setMesh(), sofa::defaulttype::ExtVector< T >::size(), texturename, triangles, useTopology, and vertices.
Referenced by SofaFlowVR::FlowVRRenderMesh::computeMesh(), and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::computeNormals | ( | ) | [virtual] |
Reimplemented in SofaFlowVR::FlowVRRenderMesh, and sofa::component::visualmodel::OgreVisualModel.
Definition at line 462 of file VisualModelImpl.cpp.
References sofa::component::clear(), cross(), sofa::defaulttype::ExtVector< T >::empty(), quads, sofa::defaulttype::ExtVector< T >::resize(), sofa::defaulttype::ExtVector< T >::size(), triangles, vertices, vertNormIdx, and vnormals.
Referenced by SofaFlowVR::FlowVRRenderMesh::computeNormals(), setMesh(), and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::computePositions | ( | ) | [virtual] |
Reimplemented in SofaFlowVR::FlowVRRenderMesh.
Definition at line 718 of file VisualModelImpl.cpp.
References sofa::defaulttype::ExtVector< T >::empty(), sofa::component::visualmodel::ExtVec3fMappedModel::inputVertices, sofa::defaulttype::ExtVector< T >::size(), vertices, and vertPosIdx.
Referenced by SofaFlowVR::FlowVRRenderMesh::computePositions(), and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::drawShadow | ( | ) | [virtual] |
Display shadow-casting surfaces.
This method default to calling draw(). Object that do not cast any shadows, or that use a different LOD for them should reimplement it.
Reimplemented from sofa::core::VisualModel.
Definition at line 167 of file VisualModelImpl.cpp.
References getCastShadow(), internalDraw(), and isTransparent().
| void sofa::component::visualmodel::VisualModelImpl::drawTransparent | ( | ) | [virtual] |
Display transparent surfaces.
Transparent objects should use this method to get a correct display order.
Reimplemented from sofa::core::VisualModel.
Definition at line 161 of file VisualModelImpl.cpp.
References internalDraw(), and isTransparent().
| void sofa::component::visualmodel::VisualModelImpl::drawVisual | ( | ) | [virtual] |
Display the VisualModel object.
Reimplemented from sofa::core::VisualModel.
Definition at line 155 of file VisualModelImpl.cpp.
References internalDraw(), and isTransparent().
| void sofa::component::visualmodel::VisualModelImpl::exportOBJ | ( | std::string | name, | |
| std::ostream * | out, | |||
| std::ostream * | mtl, | |||
| int & | vindex, | |||
| int & | nindex, | |||
| int & | tindex | |||
| ) | [virtual] |
Append this mesh to an OBJ format stream.
The number of vertices position, normal, and texture coordinates already written is given as parameters This method should update them
Reimplemented from sofa::core::VisualModel.
Definition at line 1163 of file VisualModelImpl.cpp.
References sofa::defaulttype::ExtVector< T >::empty(), sofa::core::objectmodel::Data< T >::getValue(), sofa::component::visualmodel::ExtVec3fMappedModel::inputVertices, material, quads, sofa::defaulttype::ExtVector< T >::size(), triangles, vertNormIdx, vertPosIdx, vnormals, and vtexcoords.
| void sofa::component::visualmodel::VisualModelImpl::flipFaces | ( | ) |
Definition at line 603 of file VisualModelImpl.cpp.
References quads, sofa::defaulttype::ExtVector< T >::size(), triangles, and vnormals.
Referenced by parse().
| bool sofa::component::visualmodel::VisualModelImpl::getCastShadow | ( | ) | const [inline] |
Definition at line 203 of file VisualModelImpl.h.
References castShadow.
Referenced by drawShadow().
| std::string sofa::component::visualmodel::VisualModelImpl::getFilename | ( | ) | [inline] |
Definition at line 194 of file VisualModelImpl.h.
References filename, and sofa::core::objectmodel::Data< T >::getValue().
| virtual std::string sofa::component::visualmodel::VisualModelImpl::getTemplateName | ( | ) | const [inline, virtual] |
Get the template type names (if any) used to instantiate this object.
Reimplemented from sofa::core::componentmodel::behavior::State< TDataTypes >.
Definition at line 240 of file VisualModelImpl.h.
| ResizableExtVector<Triangle>* sofa::component::visualmodel::VisualModelImpl::getTriangles | ( | ) | [inline] |
| bool sofa::component::visualmodel::VisualModelImpl::getUseNormals | ( | ) | const [inline] |
| ResizableExtVector<Coord>* sofa::component::visualmodel::VisualModelImpl::getVertices | ( | ) | [inline] |
| void sofa::component::visualmodel::VisualModelImpl::handleTopologyChange | ( | ) | [virtual] |
Handle topological Changes.
Reimplemented from sofa::core::objectmodel::BaseObject.
Definition at line 796 of file VisualModelImpl.cpp.
References _topology, sofa::core::componentmodel::topology::ENDING_EVENT, sofa::core::componentmodel::topology::BaseMeshTopology::firstChange(), sofa::component::topology::QuadsAdded::getNbAddedQuads(), sofa::component::topology::TrianglesAdded::getNbAddedTriangles(), sofa::core::componentmodel::topology::Topology::getNbPoints(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbQuads(), sofa::core::componentmodel::topology::BaseMeshTopology::getNbTriangles(), sofa::component::topology::QuadsAdded::getQuad(), sofa::core::componentmodel::topology::BaseMeshTopology::getQuadVertexShell(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangle(), sofa::core::componentmodel::topology::BaseMeshTopology::getTriangleVertexShell(), sofa::core::componentmodel::topology::BaseMeshTopology::lastChange(), sofa::core::componentmodel::topology::POINTSREMOVED, sofa::core::componentmodel::topology::POINTSRENUMBERING, quads, sofa::core::componentmodel::topology::QUADSADDED, sofa::core::componentmodel::topology::QUADSREMOVED, sofa::component::topology::TrianglesAdded::triangleArray, triangles, sofa::core::componentmodel::topology::TRIANGLESADDED, sofa::core::componentmodel::topology::TRIANGLESREMOVED, and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::init | ( | void | ) | [virtual] |
Initialization method called at graph modification, during bottom-up traversal.
Reimplemented from sofa::core::objectmodel::BaseObject.
Reimplemented in SofaFlowVR::FlowVRRenderMesh.
Definition at line 436 of file VisualModelImpl.cpp.
References _topology, applyRotation(), applyScale(), applyTranslation(), field_quads, field_triangles, field_vertices, field_vnormals, field_vtexcoords, filename, sofa::core::objectmodel::BaseObject::getContext(), sofa::core::objectmodel::BaseContext::getMeshTopology(), sofa::core::objectmodel::Data< T >::getValue(), load(), rotation, scale, sofa::core::objectmodel::Data< T >::setValue(), texturename, translation, and updateVisual().
| void sofa::component::visualmodel::VisualModelImpl::initVisual | ( | ) | [virtual] |
Initialize the textures, or other graphical resources.
Called once before the first frame is drawn, and if the graphical context has been recreated.
Reimplemented from sofa::core::VisualModel.
Reimplemented in sofa::component::visualmodel::OglModel.
Definition at line 1155 of file VisualModelImpl.cpp.
| virtual void sofa::component::visualmodel::VisualModelImpl::internalDraw | ( | ) | [inline, protected, virtual] |
Reimplemented in sofa::component::visualmodel::OglModel.
Definition at line 161 of file VisualModelImpl.h.
Referenced by drawShadow(), drawTransparent(), and drawVisual().
| bool sofa::component::visualmodel::VisualModelImpl::isTransparent | ( | ) |
Definition at line 150 of file VisualModelImpl.cpp.
References sofa::core::objectmodel::Data< T >::getValue(), and material.
Referenced by drawShadow(), drawTransparent(), drawVisual(), and sofa::component::visualmodel::OglModel::internalDraw().
| bool sofa::component::visualmodel::VisualModelImpl::isUsingTopology | ( | ) | const [inline] |
| bool sofa::component::visualmodel::VisualModelImpl::load | ( | const std::string & | filename, | |
| const std::string & | loader, | |||
| const std::string & | textureName | |||
| ) |
Definition at line 324 of file VisualModelImpl.cpp.
References computeBBox(), sofa::helper::io::Mesh::Create(), sofa::helper::Factory< TKey, TObject, TArgument >::CreateObject(), sofa::helper::system::DataRepository, loadTexture(), sofa::core::objectmodel::BaseObject::logWarning(), sofa::component::visualmodel::ExtVec3fMappedModel::modified, sofa::defaulttype::ExtVector< T >::resize(), setMesh(), sofa::defaulttype::ExtVector< T >::size(), useTopology, vertices, sofa::component::visualmodel::RigidMappedModel::xforms, and sofa::component::visualmodel::RigidMappedModel::xformsModified.
Referenced by sofa::filemanager::pml::PMLStiffSpringForceField::createVisualModel(), sofa::filemanager::pml::PMLRigidBody::createVisualModel(), sofa::filemanager::pml::PMLFemForceField::createVisualModel(), init(), and main().
| virtual bool sofa::component::visualmodel::VisualModelImpl::loadTexture | ( | const std::string & | ) | [inline, virtual] |
Reimplemented in sofa::component::visualmodel::OglModel, and SofaFlowVR::FlowVRRenderMesh.
Definition at line 179 of file VisualModelImpl.h.
Referenced by load().
| void sofa::component::visualmodel::VisualModelImpl::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::core::objectmodel::Base.
Reimplemented in SofaFlowVR::FlowVRRenderMesh, and sofa::component::visualmodel::OgreVisualModel.
Definition at line 63 of file VisualModelImpl.cpp.
References applyUVScale(), applyUVTranslation(), sofa::helper::system::DataRepository, filename, flipFaces(), sofa::core::objectmodel::BaseObjectDescription::getAttribute(), rotation, scaleTex, setCastShadow(), setColor(), setUseNormals(), sofa::core::objectmodel::Data< T >::setValue(), texturename, and translation.
| void sofa::component::visualmodel::VisualModelImpl::setCastShadow | ( | bool | val | ) | [inline] |
| void sofa::component::visualmodel::VisualModelImpl::setColor | ( | std::string | color | ) |
Definition at line 641 of file VisualModelImpl.cpp.
References sofa::component::visualmodel::hexval(), and setColor().
| void sofa::component::visualmodel::VisualModelImpl::setColor | ( | float | r, | |
| float | g, | |||
| float | b, | |||
| float | a | |||
| ) |
Definition at line 626 of file VisualModelImpl.cpp.
References sofa::core::objectmodel::Data< T >::getValue(), material, sofa::helper::io::Mesh::Material::setColor(), and sofa::core::objectmodel::Data< T >::setValue().
Referenced by sofa::filemanager::pml::PMLStiffSpringForceField::createVisualModel(), sofa::filemanager::pml::PMLRigidBody::createVisualModel(), sofa::filemanager::pml::PMLFemForceField::createVisualModel(), main(), parse(), and setColor().
| void sofa::component::visualmodel::VisualModelImpl::setFilename | ( | std::string | s | ) | [inline] |
Definition at line 193 of file VisualModelImpl.h.
References filename, and sofa::core::objectmodel::Data< T >::setValue().
| void sofa::component::visualmodel::VisualModelImpl::setMesh | ( | helper::io::Mesh & | m, | |
| bool | tex = false | |||
| ) |
Number of different normals
Definition at line 176 of file VisualModelImpl.cpp.
References sofa::helper::io::Mesh::Material::activated, computeBBox(), computeNormals(), sofa::helper::io::Mesh::getFacets(), sofa::helper::io::Mesh::getMaterial(), sofa::helper::io::Mesh::getNormals(), sofa::helper::io::Mesh::getTexCoords(), sofa::helper::io::Mesh::getVertices(), sofa::component::visualmodel::ExtVec3fMappedModel::inputVertices, sofa::core::objectmodel::BaseData::isSet(), sofa::helper::make_array(), material, quads, sofa::defaulttype::ExtVector< T >::resize(), sofa::core::objectmodel::Data< T >::setValue(), triangles, useNormals, vertices, vertNormIdx, vertPosIdx, vnormals, and vtexcoords.
Referenced by computeMesh(), and load().
| void sofa::component::visualmodel::VisualModelImpl::setTriangles | ( | ResizableExtVector< Triangle > * | t | ) | [inline] |
| void sofa::component::visualmodel::VisualModelImpl::setUseNormals | ( | bool | val | ) | [inline] |
| void sofa::component::visualmodel::VisualModelImpl::setVertices | ( | ResizableExtVector< Coord > * | x | ) | [inline] |
| static std::string sofa::component::visualmodel::VisualModelImpl::templateName | ( | const VisualModelImpl * | p = NULL |
) | [inline, static] |
Definition at line 245 of file VisualModelImpl.h.
| void sofa::component::visualmodel::VisualModelImpl::updateVisual | ( | ) | [virtual] |
used to update the model if necessary.
Reimplemented from sofa::core::VisualModel.
Reimplemented in sofa::component::visualmodel::OgreVisualModel.
Definition at line 685 of file VisualModelImpl.cpp.
References _topology, computeBBox(), computeMesh(), computeNormals(), computePositions(), sofa::defaulttype::ExtVector< T >::empty(), sofa::core::objectmodel::BaseContext::get(), sofa::core::objectmodel::BaseObject::getContext(), sofa::core::componentmodel::topology::BaseMeshTopology::getRevision(), lastMeshRev, sofa::component::visualmodel::ExtVec3fMappedModel::modified, useTopology, and vertices.
Referenced by applyRotation(), applyScale(), applyTranslation(), handleTopologyChange(), and init().
sofa::core::componentmodel::topology::BaseMeshTopology* sofa::component::visualmodel::VisualModelImpl::_topology [protected] |
Definition at line 127 of file VisualModelImpl.h.
Referenced by computeMesh(), handleTopologyChange(), init(), and updateVisual().
Vec3f sofa::component::visualmodel::VisualModelImpl::bbox[2] [protected] |
Definition at line 159 of file VisualModelImpl.h.
Referenced by addBBox(), computeBBox(), and SofaFlowVR::FlowVRRenderMesh::renderUpdate().
True if object cast shadows.
Definition at line 125 of file VisualModelImpl.h.
Referenced by getCastShadow(), and setCastShadow().
Data< std::string > sofa::component::visualmodel::VisualModelImpl::filename [protected] |
Definition at line 153 of file VisualModelImpl.h.
Referenced by getFilename(), init(), parse(), SofaFlowVR::FlowVRRenderMesh::parse(), and setFilename().
Time stamps from the last time the mesh was updated from the topology.
Definition at line 123 of file VisualModelImpl.h.
Referenced by computeMesh(), SofaFlowVR::FlowVRRenderMesh::renderUpdate(), and updateVisual().
Definition at line 165 of file VisualModelImpl.h.
Referenced by exportOBJ(), sofa::component::visualmodel::OglModel::internalDraw(), isTransparent(), SofaFlowVR::FlowVRRenderMesh::renderUpdate(), setColor(), setMesh(), and sofa::component::visualmodel::OgreVisualModel::updateMaterial().
Definition at line 141 of file VisualModelImpl.h.
Referenced by computeMesh(), computeNormals(), sofa::component::visualmodel::OgreVisualModel::computeNormals(), exportOBJ(), flipFaces(), sofa::component::visualmodel::OgreVisualModel::getNbTriangles(), handleTopologyChange(), sofa::component::visualmodel::OglModel::internalDraw(), SofaFlowVR::FlowVRRenderMesh::renderUpdate(), setMesh(), and sofa::component::visualmodel::OgreVisualModel::uploadIndices().
Data< Vector3 > sofa::component::visualmodel::VisualModelImpl::rotation [protected] |
Definition at line 156 of file VisualModelImpl.h.
Referenced by init(), parse(), and SofaFlowVR::FlowVRRenderMesh::renderUpdate().
Data< SReal > sofa::component::visualmodel::VisualModelImpl::scale [protected] |
Reimplemented in sofa::component::visualmodel::OgreVisualModel.
Definition at line 157 of file VisualModelImpl.h.
Referenced by init(), and SofaFlowVR::FlowVRRenderMesh::renderUpdate().
float sofa::component::visualmodel::VisualModelImpl::scaleTex [protected] |
Data< std::string > sofa::component::visualmodel::VisualModelImpl::texturename [protected] |
Definition at line 154 of file VisualModelImpl.h.
Referenced by sofa::component::visualmodel::OgreVisualModel::attach(), computeMesh(), init(), and parse().
Data< Vector3 > sofa::component::visualmodel::VisualModelImpl::translation [protected] |
Definition at line 139 of file VisualModelImpl.h.
Referenced by computeMesh(), computeNormals(), sofa::component::visualmodel::OgreVisualModel::computeNormals(), exportOBJ(), flipFaces(), sofa::component::visualmodel::OgreVisualModel::getNbTriangles(), getTriangles(), handleTopologyChange(), sofa::component::visualmodel::OglModel::internalDraw(), SofaFlowVR::FlowVRRenderMesh::renderUpdate(), setMesh(), setTriangles(), and sofa::component::visualmodel::OgreVisualModel::uploadIndices().
True if normals should be read from file.
Definition at line 124 of file VisualModelImpl.h.
Referenced by getUseNormals(), setMesh(), and setUseNormals().
True if list of facets should be taken from the attached topology.
Definition at line 122 of file VisualModelImpl.h.
Referenced by computeMesh(), sofa::component::visualmodel::OgreVisualModel::computeNormals(), sofa::component::visualmodel::OgreVisualModel::getNbTriangles(), isUsingTopology(), load(), updateVisual(), and sofa::component::visualmodel::OgreVisualModel::uploadIndices().
Definition at line 131 of file VisualModelImpl.h.
Referenced by sofa::component::visualmodel::OgreVisualModel::attach(), computeBBox(), sofa::component::visualmodel::OgreVisualModel::computeBounds(), computeMesh(), computeNormals(), sofa::component::visualmodel::OgreVisualModel::computeNormals(), computePositions(), getVertices(), sofa::component::visualmodel::OglModel::internalDraw(), load(), SofaFlowVR::FlowVRRenderMesh::renderUpdate(), setMesh(), setVertices(), updateVisual(), sofa::component::visualmodel::OgreVisualModel::uploadVertices(), and ~VisualModelImpl().
Similarly this vector store which input normal is used for each vertice If it is empty then each vertex correspond to one normal.
Definition at line 150 of file VisualModelImpl.h.
Referenced by computeNormals(), sofa::component::visualmodel::OgreVisualModel::computeNormals(), exportOBJ(), and setMesh().
If vertices have multiple normals/texcoords, then we need to separate them This vector store which input position is used for each vertice If it is empty then each vertex correspond to one position.
Definition at line 146 of file VisualModelImpl.h.
Referenced by computePositions(), exportOBJ(), and setMesh().
Definition at line 134 of file VisualModelImpl.h.
Referenced by computeNormals(), sofa::component::visualmodel::OgreVisualModel::computeNormals(), exportOBJ(), flipFaces(), sofa::component::visualmodel::OglModel::internalDraw(), SofaFlowVR::FlowVRRenderMesh::renderUpdate(), setMesh(), and sofa::component::visualmodel::OgreVisualModel::uploadVertices().
Definition at line 136 of file VisualModelImpl.h.
Referenced by applyUVScale(), applyUVTranslation(), sofa::component::visualmodel::OgreVisualModel::attach(), exportOBJ(), sofa::component::visualmodel::OglModel::internalDraw(), SofaFlowVR::FlowVRRenderMesh::renderUpdate(), and setMesh().
1.5.7.1