Basic Renderer
|
A geometry object containing vertices and indices that can be rendered to the screen. More...
#include <Geometry.h>
Inherits IDrawable.
Public Types | |
typedef std::shared_ptr< Vertex > | VertexDataPtr |
typedef std::shared_ptr< GLushort > | IndexDataPtr |
typedef std::unordered_map< std::string, PropertiesPtr > | PropertiesMap |
Public Member Functions | |
Geometry () | |
Constructor. More... | |
virtual | ~Geometry () |
Virtual destructor. More... | |
virtual void | initialize (GeometryDataPtr geometryData) |
Initializes the geometry object based on geometry data. More... | |
virtual void | draw (GLenum mode=GL_TRIANGLES) override |
Draws the geometry to the screen. More... | |
virtual void | drawInstance (const std::string &instanceName, GLenum mode=GL_TRIANGLES) override |
Draws an instance of the geometry to the screen. More... | |
PropertiesPtr | addInstance (const std::string &instanceName) |
Creates an instance of this geometry. More... | |
virtual void | addInstance (const std::string &instanceName, PropertiesPtr instanceProperties) |
Creates an instance of this geometry. More... | |
virtual PropertiesPtr | getInstanceProperties (const std::string &instanceName) |
Get the properties of a geometry instance. More... | |
virtual void | removeInstance (const std::string &instanceName) |
Removes an instance. More... | |
virtual void | clearInstances () |
Removes all instances. More... | |
VertexDataPtr | getVertexData () |
Returns a pointer to the vertices of the geometry. More... | |
IndexDataPtr | getIndexData () |
Returns a pointer to the indices of the geometry. More... | |
size_t | getNumVertices () |
Returns the number of vertices in the geometry. More... | |
size_t | getNumIndices () |
Returns the number of indices in the geometry. More... | |
void | setVertexData (VertexDataPtr arg) |
Sets the vertices of the geometry. More... | |
void | setIndexData (IndexDataPtr arg) |
Sets the indices of the geometry. More... | |
MaterialPtr | getMaterial () |
Returns a pointer to the material of the geometry. More... | |
void | setMaterial (MaterialPtr arg) |
Sets the material of the geometry. More... | |
PropertiesPtr | getProperties () |
Returns a pointer to the properties of the geometry. More... | |
void | setProperties (PropertiesPtr arg) |
Sets the properties of the geometry. More... | |
vmml::AABBf & | getBoundingBoxObjectSpace () |
Returns the bounding box of the geometry in object space. More... | |
void | setBoundingBoxObjectSpace (vmml::AABBf arg) |
Sets the bounding box of the geometry in object space. More... | |
virtual void | deleteGeometry () |
Deletes the geometry. More... | |
Public Member Functions inherited from IDrawable | |
virtual | ~IDrawable () |
Virtual destructor. More... | |
Protected Member Functions | |
virtual void | initializeVertexBuffer () |
Initializes a vertex buffer for the geometry data. More... | |
virtual VertexDataPtr | allocVertexData (size_t nVertices) |
Allocates the vertex data. More... | |
virtual IndexDataPtr | allocIndexData (size_t nIndices) |
Allocates the index data. More... | |
virtual VertexDataPtr | copyVertexData (const GeometryData::VboVertices &arg) |
Copies the given vertices into the geometry object. More... | |
virtual IndexDataPtr | copyIndexData (const GeometryData::VboIndices &arg) |
Copies the given indices into the geometry object. More... | |
virtual vmml::AABBf | createBoundingBoxObjectSpace (const GeometryData::VboVertices &arg) |
Creates an axis-aligned bounding box around the object. More... | |
A geometry object containing vertices and indices that can be rendered to the screen.
typedef std::shared_ptr< GLushort > Geometry::IndexDataPtr |
typedef std::unordered_map< std::string, PropertiesPtr > Geometry::PropertiesMap |
typedef std::shared_ptr< Vertex > Geometry::VertexDataPtr |
|
inline |
Constructor.
|
inlinevirtual |
Virtual destructor.
PropertiesPtr Geometry::addInstance | ( | const std::string & | instanceName | ) |
Creates an instance of this geometry.
[in] | instanceName | Name of the instance |
|
virtual |
Creates an instance of this geometry.
[in] | instanceName | Name of the instance |
[in] | instanceProperties | Properties for the instance |
|
protectedvirtual |
Allocates the index data.
|
protectedvirtual |
Allocates the vertex data.
|
virtual |
Removes all instances.
|
protectedvirtual |
Copies the given indices into the geometry object.
[in] | arg | The indices that should be used in the geometry |
|
protectedvirtual |
Copies the given vertices into the geometry object.
[in] | arg | The vertices that should be used in the geometry |
|
protectedvirtual |
Creates an axis-aligned bounding box around the object.
[in] | arg | The vertices that should be used in the geometry |
|
inlinevirtual |
Deletes the geometry.
|
overridevirtual |
|
overridevirtual |
Draws an instance of the geometry to the screen.
[in] | instanceName | |
[in] | mode |
Implements IDrawable.
|
inline |
Returns the bounding box of the geometry in object space.
|
inline |
Returns a pointer to the indices of the geometry.
|
virtual |
Get the properties of a geometry instance.
[in] | instanceName | Name of the instance |
|
inline |
Returns a pointer to the material of the geometry.
|
inline |
Returns the number of indices in the geometry.
|
inline |
Returns the number of vertices in the geometry.
|
inline |
Returns a pointer to the properties of the geometry.
|
inline |
Returns a pointer to the vertices of the geometry.
|
virtual |
Initializes the geometry object based on geometry data.
[in] | geometryData |
|
protectedvirtual |
Initializes a vertex buffer for the geometry data.
|
virtual |
Removes an instance.
[in] | instanceName | Name of the instance |
|
inline |
Sets the bounding box of the geometry in object space.
[in] | arg | The bounding box for the geometry in object space |
|
inline |
Sets the indices of the geometry.
[in] | arg | The new indices that should be used for the geometry |
|
inline |
Sets the material of the geometry.
[in] | arg | The new material that should be used for the geometry |
|
inline |
Sets the properties of the geometry.
[in] | arg | The properties for the geometry |
|
inline |
Sets the vertices of the geometry.
[in] | arg | The new vertices that should be used for the geometry |