16 #ifndef SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H
22 #include <osg/ref_ptr>
31 #pragma warning(disable:4250)
37 class DrawElementsUInt;
61 virtual std::shared_ptr<Mesh>
getMesh()
override;
68 virtual void setFilename(std::string filename)
override;
72 virtual void doUpdate(
double dt)
override;
119 #if defined(_MSC_VER)
126 #endif // SURGSIM_GRAPHICS_OSGMESHREPRESENTATION_H
Definition: DriveElementFromInputBehavior.cpp:27
SURGSIM_STATIC_REGISTRATION(OsgBoxRepresentation)
Implementation of a MeshRepresentation for rendering under osg.
Definition: OsgMeshRepresentation.h:49
Graphics representation of a mesh, can be initialized from a Mesh structure.
Definition: MeshRepresentation.h:28
int m_updateOptions
Indicates which elements of the mesh should be updated on every frame.
Definition: OsgMeshRepresentation.h:79
void updateNormals()
Updates the normals.
Definition: OsgMeshRepresentation.cpp:174
void updateTriangles()
Updates the triangles.
Definition: OsgMeshRepresentation.cpp:182
void updateVertices(int updateOptions)
Copies the attributes for each mesh vertex in the appropriate osg structure, this will only be done f...
Definition: OsgMeshRepresentation.cpp:140
virtual void doUpdate(double dt) override
Definition: OsgMeshRepresentation.cpp:93
osg::ref_ptr< osg::DrawElementsUInt > m_triangles
Definition: OsgMeshRepresentation.h:94
std::string m_filename
File name of the external file which contains the mesh to be used by this class.
Definition: OsgMeshRepresentation.h:85
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgMeshRepresentation)
osg::ref_ptr< osg::Vec2Array > m_textureCoordinates
Definition: OsgMeshRepresentation.h:93
osg::ref_ptr< osg::Vec3Array > m_vertices
Definition: OsgMeshRepresentation.h:90
virtual std::string getFilename() const override
Get the file name of the external file which contains the triangle mesh.
Definition: OsgMeshRepresentation.cpp:277
~OsgMeshRepresentation()
Destructor.
Definition: OsgMeshRepresentation.cpp:84
OsgMeshRepresentation(const std::string &name)
Constructor.
Definition: OsgMeshRepresentation.cpp:40
std::shared_ptr< Mesh > m_mesh
The mesh.
Definition: OsgMeshRepresentation.h:82
osg::Object::DataVariance getDataVariance(int updateOption)
Gets data variance for a given update option.
Definition: OsgMeshRepresentation.cpp:267
virtual void setFilename(std::string filename) override
Set loading filename.
Definition: OsgMeshRepresentation.cpp:272
osg::ref_ptr< osg::Geometry > m_geometry
Definition: OsgMeshRepresentation.h:89
osg::ref_ptr< osg::Geometry > getOsgGeometry()
Definition: OsgMeshRepresentation.cpp:262
virtual int getUpdateOptions() const override
Gets update options for this mesh.
Definition: OsgMeshRepresentation.cpp:257
osg::ref_ptr< osg::Vec3Array > m_normals
Definition: OsgMeshRepresentation.h:92
int updateOsgArrays()
Updates the internal arrays in accordance to the sizes given in the mesh.
Definition: OsgMeshRepresentation.cpp:197
Definition: OsgLight.h:33
virtual bool doInitialize() override
Definition: OsgMeshRepresentation.cpp:114
virtual 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:249
virtual std::shared_ptr< Mesh > getMesh() override
Gets the mesh.
Definition: OsgMeshRepresentation.cpp:88
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:42
osg::ref_ptr< osg::Vec4Array > m_colors
Definition: OsgMeshRepresentation.h:91