Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Attributes | List of all members
om::graphics::shapes::MeshGroup Class Reference

A class that encapsulates geometry and a material with which it should be rendered. More...

#include <omGraphicsMeshGroup.h>

Inheritance diagram for om::graphics::shapes::MeshGroup:
om::graphics::devices::GraphicsContextObject

Public Member Functions

 MeshGroup ()
 Create a new mesh group with no buffers or material. More...
 
 MeshGroup (VertexBufferSet *newVertexBuffers, IndexBuffer *newIndexBuffer, const IndexRange &newIndexRange, Material *newMaterial)
 Create a new mesh group with the specified material and vertex buffer pointers. More...
 
VertexBufferSetgetVertexBuffers () const
 Return a pointer to the vertex buffers for this mesh group. More...
 
void setVertexBuffers (VertexBufferSet *newVertexBuffers)
 Set a pointer to the vertex buffers for this mesh group. More...
 
IndexBuffergetIndexBuffer () const
 Return a pointer to the index buffer for this mesh group. More...
 
void setIndexBuffer (IndexBuffer *newIndexBuffer)
 Set a pointer to the index buffer for this mesh group. More...
 
IndexRangegetIndexRange ()
 Return a reference to the buffer range for this mesh group. More...
 
const IndexRangegetIndexRange () const
 Return a reference to the buffer range for this mesh group. More...
 
void setIndexRange (const IndexRange &newIndexRange)
 Set the buffer range for this mesh group. More...
 
MaterialgetMaterial () const
 Return a pointer to the material of this mesh group. More...
 
void setMaterial (Material *newMaterial)
 Set a pointer to the material of this mesh group. More...
 
ConstantSetgetConstants () const
 Return an object that describes a set of shader constants and their corresponding semantic usages for this mesh. More...
 
void setConstants (ConstantSet *newConstants)
 Set an object that describes a set of shader constants and their corresponding semantic usages for this mesh. More...
 
TextureSetgetTextures () const
 Return an object that describes a set of textures and their corresponding semantic usages for this mesh. More...
 
void setTextures (TextureSet *newTextures)
 Set an object that describes a set of textures and their corresponding semantic usages for this mesh. More...
 
virtual void setContext (devices::GraphicsContext *newContext)
 Set the graphics context that is used to render this mesh group. More...
 
virtual void upload (UploadRequest &request)
 Upload this mesh group's current CPU representation to the GPU device. More...
 
virtual void download (DownloadRequest &request)
 Download the mesh group's GPU representation to CPU memory. More...
 
const AABB3getBoundingBox () const
 Return a reference to the bounding box for this mesh group. More...
 
void updateBoundingBox ()
 Force an update the bounding box for this mesh group. More...
 
Bool getVertices (ArrayList< Vector3 > &vertices) const
 Get the vertex positions in this mesh group and add them to the end of the specified list. More...
 
Bool getTriangles (ArrayList< Triangle3 > &triangles) const
 Get the triangles in this mesh group and add them to the end of the specified list. More...
 
- Public Member Functions inherited from om::graphics::devices::GraphicsContextObject
virtual ~GraphicsContextObject ()
 Destory this graphics context object. More...
 
GraphicsContextgetContext () const
 Return a pointer to the graphics context this context object is using to do rendering. More...
 
void clearContext ()
 Clear the previous context from this object. More...
 
void upload ()
 Upload this resource's CPU representation to the GPU device. More...
 
void download ()
 Upload this resource's CPU representation to the GPU device. More...
 
virtual Bool isUploaded () const
 Return whether or not this graphics resource has been successfully created and uploaded to the device. More...
 
virtual Bool isDownloaded () const
 Return whether or not this graphics resource has a copy of its data stored in CPU-side memory. More...
 
virtual Bool isValid () const
 Return whether or not the state of this graphics resource is valid (either on CPU or GPU) and able to be used for rendering. More...
 

Static Public Attributes

static const ResourceType RESOURCE_TYPE
 The resource type for a mesh group. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::graphics::devices::GraphicsContextObject
 GraphicsContextObject ()
 Create a new graphics context object that doesn't have an associated graphics context. More...
 
 GraphicsContextObject (GraphicsContext *newContext)
 Create a new graphics context object that uses the specified context for rendering. More...
 
- Protected Attributes inherited from om::graphics::devices::GraphicsContextObject
GraphicsContextcontext
 A pointer to the graphics context this object is using. More...
 

Detailed Description

A class that encapsulates geometry and a material with which it should be rendered.

A MeshGroup specifies its geometry relative to the origin of its parent shape and does not have its own transformation.

Constructor & Destructor Documentation

om::graphics::shapes::MeshGroup::MeshGroup ( )

Create a new mesh group with no buffers or material.

om::graphics::shapes::MeshGroup::MeshGroup ( VertexBufferSet newVertexBuffers,
IndexBuffer newIndexBuffer,
const IndexRange newIndexRange,
Material newMaterial 
)

Create a new mesh group with the specified material and vertex buffer pointers.

Member Function Documentation

VertexBufferSet* om::graphics::shapes::MeshGroup::getVertexBuffers ( ) const
inline

Return a pointer to the vertex buffers for this mesh group.

void om::graphics::shapes::MeshGroup::setVertexBuffers ( VertexBufferSet newVertexBuffers)
inline

Set a pointer to the vertex buffers for this mesh group.

IndexBuffer* om::graphics::shapes::MeshGroup::getIndexBuffer ( ) const
inline

Return a pointer to the index buffer for this mesh group.

void om::graphics::shapes::MeshGroup::setIndexBuffer ( IndexBuffer newIndexBuffer)
inline

Set a pointer to the index buffer for this mesh group.

IndexRange& om::graphics::shapes::MeshGroup::getIndexRange ( )
inline

Return a reference to the buffer range for this mesh group.

If the mesh group has an index buffer, the valid range refers to the indices which should be used when drawing the group. Otherwise, the range refers to the valid contiguous range of vertices to use.

const IndexRange& om::graphics::shapes::MeshGroup::getIndexRange ( ) const
inline

Return a reference to the buffer range for this mesh group.

If the mesh group has an index buffer, the valid range refers to the indices which should be used when drawing the group. Otherwise, the range refers to the valid contiguous range of vertices to use.

void om::graphics::shapes::MeshGroup::setIndexRange ( const IndexRange newIndexRange)
inline

Set the buffer range for this mesh group.

If the mesh group has an index buffer, the valid range refers to the indices which should be used when drawing the group. Otherwise, the range refers to the valid contiguous range of vertices to use.

Material* om::graphics::shapes::MeshGroup::getMaterial ( ) const
inline

Return a pointer to the material of this mesh group.

void om::graphics::shapes::MeshGroup::setMaterial ( Material newMaterial)
inline

Set a pointer to the material of this mesh group.

ConstantSet* om::graphics::shapes::MeshGroup::getConstants ( ) const
inline

Return an object that describes a set of shader constants and their corresponding semantic usages for this mesh.

void om::graphics::shapes::MeshGroup::setConstants ( ConstantSet newConstants)
inline

Set an object that describes a set of shader constants and their corresponding semantic usages for this mesh.

TextureSet* om::graphics::shapes::MeshGroup::getTextures ( ) const
inline

Return an object that describes a set of textures and their corresponding semantic usages for this mesh.

void om::graphics::shapes::MeshGroup::setTextures ( TextureSet newTextures)
inline

Set an object that describes a set of textures and their corresponding semantic usages for this mesh.

virtual void om::graphics::shapes::MeshGroup::setContext ( devices::GraphicsContext newContext)
virtual

Set the graphics context that is used to render this mesh group.

Reimplemented from om::graphics::devices::GraphicsContextObject.

virtual void om::graphics::shapes::MeshGroup::upload ( UploadRequest request)
virtual

Upload this mesh group's current CPU representation to the GPU device.

Reimplemented from om::graphics::devices::GraphicsContextObject.

virtual void om::graphics::shapes::MeshGroup::download ( DownloadRequest request)
virtual

Download the mesh group's GPU representation to CPU memory.

Reimplemented from om::graphics::devices::GraphicsContextObject.

const AABB3& om::graphics::shapes::MeshGroup::getBoundingBox ( ) const
inline

Return a reference to the bounding box for this mesh group.

The bounding box returned here may not represent an accurate bounding volume for the mesh group if any of the underlying geometry changes without notice. If this occurs, call the updateBoundingBox() method directly to force an update of the bounding box.

void om::graphics::shapes::MeshGroup::updateBoundingBox ( )

Force an update the bounding box for this mesh group.

The user should call this method whenever the mesh group's geometry changes.

Bool om::graphics::shapes::MeshGroup::getVertices ( ArrayList< Vector3 > &  vertices) const

Get the vertex positions in this mesh group and add them to the end of the specified list.

The method returns whether or not the vertices were able to be accessed successfully. If there are no vertex positions that are part of this group, the size of the list does not change.

This method is provided so that a mesh's data can be easily accessed for use in external applications that need the raw mesh data.

Bool om::graphics::shapes::MeshGroup::getTriangles ( ArrayList< Triangle3 > &  triangles) const

Get the triangles in this mesh group and add them to the end of the specified list.

The method returns whether or not the triangles were able to be accessed successfully. If there are no triangles or quads that are part of this group, the size of the list does not change.

Quads are converted to triangles by this method. This method is provided so that a mesh can be easily converted to triangles for use in external applications that need the raw mesh data.

Member Data Documentation

const ResourceType om::graphics::shapes::MeshGroup::RESOURCE_TYPE
static

The resource type for a mesh group.


The documentation for this class was generated from the following file: