Go to the documentation of this file.
16 #ifndef SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H
22 #include <osg/ref_ptr>
32 #pragma warning(disable:4250)
39 class DrawElementsUInt;
48 SURGSIM_STATIC_REGISTRATION(OsgMeshRepresentation);
63 std::shared_ptr<Mesh>
getMesh()
override;
65 void setMesh(std::shared_ptr<SurgSim::Framework::Asset> mesh)
override;
69 void setShape(std::shared_ptr<SurgSim::Math::Shape> shape)
override;
140 #if defined(_MSC_VER)
147 #endif // SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H
void privateUpdateMesh(const SurgSim::Graphics::Mesh &mesh)
Definition: OsgMeshRepresentation.cpp:112
osg::ref_ptr< osg::Geometry > m_geometry
Definition: OsgMeshRepresentation.h:99
osg::Object::DataVariance getDataVariance(int updateOption)
Gets data variance for a given update option.
Definition: OsgMeshRepresentation.cpp:304
void setMesh(std::shared_ptr< SurgSim::Framework::Asset > mesh) override
Sets the mesh.
Definition: OsgMeshRepresentation.cpp:67
int getUpdateOptions() const override
Gets update options for this mesh.
Definition: OsgMeshRepresentation.cpp:289
osg::ref_ptr< osg::Geometry > getOsgGeometry() const
Definition: OsgMeshRepresentation.cpp:294
bool doInitialize() override
Definition: OsgMeshRepresentation.cpp:144
void setUpdateOptions(int val) override
Sets the structures that are expected to change during the lifetime of the mesh, these will be update...
Definition: OsgMeshRepresentation.cpp:281
int updateOsgArrays(const Mesh &mesh, osg::Geometry *geometry)
Updates the internal arrays in accordance to the sizes given in the mesh.
Definition: OsgMeshRepresentation.cpp:218
void setShape(std::shared_ptr< SurgSim::Math::Shape > shape) override
Sets the shape of the representation param shape the shape of this representation.
Definition: OsgMeshRepresentation.cpp:82
void updateMesh(const SurgSim::Graphics::Mesh &mesh) override
Definition: OsgMeshRepresentation.cpp:299
std::shared_ptr< Mesh > m_mesh
The mesh.
Definition: OsgMeshRepresentation.h:91
Definition: OculusView.h:25
void loadMesh(const std::string &fileName) override
Convenience function to trigger the load of the mesh with the given filename.
Definition: OsgMeshRepresentation.cpp:60
Framework::LockedContainer< Mesh > m_writeBuffer
Definition: OsgMeshRepresentation.h:136
void updateVertices(const Mesh &mesh, osg::Geometry *geometry, int updateOptions)
Copies the attributes for each mesh vertex in the appropriate osg structure, this will only be done f...
Definition: OsgMeshRepresentation.cpp:149
Implementation of a MeshRepresentation for rendering under osg.
Definition: OsgMeshRepresentation.h:51
Definition: CompoundShapeToGraphics.cpp:29
osg::ref_ptr< osg::Switch > m_meshSwitch
Definition: OsgMeshRepresentation.h:98
std::shared_ptr< Mesh > getMesh() override
Gets the mesh.
Definition: OsgMeshRepresentation.cpp:77
A simple thread-safe data container that can support multiple writers and readers.
Definition: LockedContainer.h:54
size_t m_updateCount
Cache for the update count pull from the mesh.
Definition: OsgMeshRepresentation.h:134
int m_updateOptions
Indicates which elements of the mesh should be updated on every frame.
Definition: OsgMeshRepresentation.h:88
void updateTriangles(const Mesh &mesh, osg::Geometry *geometry)
Updates the triangles.
Definition: OsgMeshRepresentation.cpp:199
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgMeshRepresentation)
std::string m_filename
File name of the external file which contains the mesh to be used by this class.
Definition: OsgMeshRepresentation.h:94
void buildGeometry()
Create the appropriate geometry nodes.
Definition: OsgMeshRepresentation.cpp:309
void doUpdate(double dt) override
Definition: OsgMeshRepresentation.cpp:91
OsgMeshRepresentation(const std::string &name)
Constructor.
Definition: OsgMeshRepresentation.cpp:43
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
~OsgMeshRepresentation()
Destructor.
Definition: OsgMeshRepresentation.cpp:56
void updateNormals(osg::Geometry *geometry)
Updates the normals.
Definition: OsgMeshRepresentation.cpp:188
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55
Graphics representation of a mesh, can be initialized from a Mesh structure.
Definition: MeshRepresentation.h:34