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;
67 void loadMesh(
const std::string& fileName)
override;
69 void setShape(std::shared_ptr<SurgSim::Math::Shape> shape)
override;
71 void setUpdateOptions(
int val)
override;
72 int getUpdateOptions()
const override;
74 osg::ref_ptr<osg::Geometry> getOsgGeometry()
const;
79 void doUpdate(
double dt)
override;
82 bool doInitialize()
override;
107 int updateOsgArrays(
const Mesh& mesh, osg::Geometry* geometry);
114 void updateVertices(
const Mesh& mesh, osg::Geometry* geometry,
int updateOptions);
118 void updateNormals(osg::Geometry* geometry);
123 void updateTriangles(
const Mesh& mesh, osg::Geometry* geometry);
128 osg::Object::DataVariance getDataVariance(
int updateOption);
131 void buildGeometry();
140 #if defined(_MSC_VER) 147 #endif // SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H Definition: CompoundShapeToGraphics.cpp:29
Implementation of a MeshRepresentation for rendering under osg.
Definition: OsgMeshRepresentation.h:51
Graphics representation of a mesh, can be initialized from a Mesh structure.
Definition: MeshRepresentation.h:34
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
std::string m_filename
File name of the external file which contains the mesh to be used by this class.
Definition: OsgMeshRepresentation.h:94
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
std::shared_ptr< Mesh > m_mesh
The mesh.
Definition: OsgMeshRepresentation.h:91
osg::ref_ptr< osg::Switch > m_meshSwitch
Definition: OsgMeshRepresentation.h:98
osg::ref_ptr< osg::Geometry > m_geometry
Definition: OsgMeshRepresentation.h:99
Framework::LockedContainer< Mesh > m_writeBuffer
Definition: OsgMeshRepresentation.h:136
A simple thread-safe data container that can support multiple writers and readers.
Definition: LockedContainer.h:54
Definition: OculusView.h:25
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55