16 #ifndef SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H 17 #define SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H 22 #include <osg/ref_ptr> 24 #include "SurgSim/Framework/Macros.h" 25 #include "SurgSim/Framework/ObjectFactory.h" 26 #include "SurgSim/Graphics/OsgRepresentation.h" 27 #include "SurgSim/Graphics/MeshRepresentation.h" 28 #include "SurgSim/Framework/LockedContainer.h" 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;
91 std::shared_ptr<Mesh> m_mesh;
94 std::string m_filename;
98 osg::ref_ptr<osg::Switch> m_meshSwitch;
99 osg::ref_ptr<osg::Geometry> m_geometry;
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();
134 size_t m_updateCount;
140 #if defined(_MSC_VER) 147 #endif // SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
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
A simple thread-safe data container that can support multiple writers and readers.
Definition: LockedContainer.h:54
Definition: OsgImGuiHandler.h:8
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55