Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Member Functions | Protected Member Functions | List of all members
om::graphics::shapes::SubdivisionShape Class Referenceabstract

A base class for graphics shapes that have multiple subdivisions (e.g. sphere, cylinder) More...

#include <omGraphicsSubdivisionShape.h>

Inheritance diagram for om::graphics::shapes::SubdivisionShape:
om::graphics::shapes::GraphicsShape om::graphics::base::Renderable om::graphics::devices::GraphicsContextObject om::graphics::shapes::CapsuleShape om::graphics::shapes::CylinderShape om::graphics::shapes::SphereShape om::graphics::shapes::SphericalFunctionShape om::graphics::shapes::TorusShape

Classes

class  Subdivision
 A class that stores a subdivision and its data for a subdivision shape. More...
 

Public Member Functions

 SubdivisionShape (const SubdivisionShape &other)
 Create a copy of another subdivision shape. More...
 
 ~SubdivisionShape ()
 Destroy a subdivision shape, releasing all internal resources. More...
 
SubdivisionShapeoperator= (const SubdivisionShape &other)
 Assign the state of another subdivision shape to this one. More...
 
Real getLODBias () const
 Get a value that multiplicatively biases the size of a pixel radius query. More...
 
void setLODBias (Real newLODBias)
 Set a value that multiplicatively biases the size of a pixel radius query. More...
 
virtual void setContext (devices::GraphicsContext *newContext)
 Change the graphics context that is used to create this subdivision shape. More...
 
virtual void upload (UploadRequest &request)
 Upload this subdivision shape's current CPU representation to the GPU device. More...
 
virtual void download (DownloadRequest &request)
 Download the subdivision shape's GPU representation to CPU memory. More...
 
virtual void getRenderables (const RenderRequest &request, const Transform3 &worldTransform, RenderQueue &outputQueue) const
 Process the renderable and add all child renderable objects to the output render queue. More...
 
virtual void intersectRay (GraphicsRay &ray) const
 Trace a ray against this shape and compute the closest intersection. More...
 
virtual void testRay (GraphicsRay &ray) const
 Trace a ray against this shape and determine if any intersection exist along the ray. More...
 
- Public Member Functions inherited from om::graphics::shapes::GraphicsShape
ShapeTypeID getShapeTypeID () const
 Return an integer identifying the sub type of this shape. More...
 
const ShapeTypegetShapeType () const
 Return a reference to an object representing the type of this Shape. More...
 
Sphere3 getBoundingSphere () const
 Return a bounding sphere for this transformable in its parent coordinate space. More...
 
const AABB3getBoundingBox () const
 Return an axis-aligned bounding box that encompases this entire transformable in its parent coordinate space. More...
 
virtual void updateBoundingBox ()
 Update the shape's bounding box based on its current geometric representation. More...
 
- Public Member Functions inherited from om::graphics::base::Renderable
 Renderable ()
 Create a new renderable object with the default renderable flags. More...
 
 Renderable (const RenderableFlags &newFlags)
 Create a new renderable object with the specified renderable flags. More...
 
RenderableFlagsgetFlags ()
 Return a reference to an object that contains boolean parameters of the renderable. More...
 
const RenderableFlagsgetFlags () const
 Return an object that contains boolean parameters of the renderable. More...
 
void setFlags (const RenderableFlags &newFlags)
 Set an object that contains boolean parameters of the renderable. More...
 
Bool flagIsSet (RenderableFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this renderable. More...
 
Bool flagsAreSet (const RenderableFlags &otherFlags) const
 Return whether or not all of the specified boolan flags are set for this renderable. More...
 
void setFlag (RenderableFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this renderable. More...
 
Bool getIsVisible () const
 Get whether or not the renderable and its children are visible in the scene. More...
 
void setIsVisible (Bool newIsVisible)
 Set whether or not the renderable and its children are visible in the scene. More...
 
Bool getShadowsEnabled () const
 Return whether or not this renderable can cast shadows. More...
 
void setShadowsEnabled (Bool newCanCastShadows)
 Set whether or not this renderable can cast shadows. 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...
 

Protected Member Functions

 SubdivisionShape (const ShapeType *newShapeType)
 Create a subdivision shape for the specified shape type. More...
 
void clearSubdivisions ()
 Clear all previously-generated subdivisions for this subdivision shape. More...
 
Size getSubdivisionCount () const
 Return the number of subdivisions there are in this shape. More...
 
SubdivisiongetSubdivision (Index subdivisionLevel) const
 Return a pointer to the subdivision in this shape for the specified level. More...
 
GraphicsShapegetSubdivisionForPixelRadius (Real pixelRadius) const
 Return the shape which should be used when the shape has the specified screen-space radius. More...
 
virtual SubdivisionnewSubdivision (Size subdivisionLevel) const =0
 Generate a subdivision shape for the specified subdivision level. More...
 
virtual void deleteSubdivision (Size subdivisionLevel, Subdivision *subdivision)=0
 Delete the previously generated subdivision for the specified subdivision level. More...
 
- Protected Member Functions inherited from om::graphics::shapes::GraphicsShape
 GraphicsShape (const ShapeType *newType)
 Create a new shape with the specified type. More...
 
void setBoundingBox (const AABB3 &newBoundingBox)
 Set the local axis-aligned bounding box for this shape. More...
 
- 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...
 

Additional Inherited Members

- Static Public Attributes inherited from om::graphics::shapes::GraphicsShape
static const ResourceType RESOURCE_TYPE
 The resource type for a graphics shape. More...
 
- Protected Attributes inherited from om::graphics::base::Renderable
RenderableFlags flags
 An object containing boolean configuration flags for this renderable. More...
 
- Protected Attributes inherited from om::graphics::devices::GraphicsContextObject
GraphicsContextcontext
 A pointer to the graphics context this object is using. More...
 

Detailed Description

A base class for graphics shapes that have multiple subdivisions (e.g. sphere, cylinder)

Constructor & Destructor Documentation

om::graphics::shapes::SubdivisionShape::SubdivisionShape ( const SubdivisionShape other)

Create a copy of another subdivision shape.

om::graphics::shapes::SubdivisionShape::~SubdivisionShape ( )

Destroy a subdivision shape, releasing all internal resources.

om::graphics::shapes::SubdivisionShape::SubdivisionShape ( const ShapeType newShapeType)
protected

Create a subdivision shape for the specified shape type.

Member Function Documentation

SubdivisionShape& om::graphics::shapes::SubdivisionShape::operator= ( const SubdivisionShape other)

Assign the state of another subdivision shape to this one.

Real om::graphics::shapes::SubdivisionShape::getLODBias ( ) const
inline

Get a value that multiplicatively biases the size of a pixel radius query.

void om::graphics::shapes::SubdivisionShape::setLODBias ( Real  newLODBias)
inline

Set a value that multiplicatively biases the size of a pixel radius query.

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

Change the graphics context that is used to create this subdivision shape.

Calling this method causes the previously generated capsule geometry to be discarded and regenerated using the new context.

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

Reimplemented in om::graphics::shapes::SphericalFunctionShape.

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

Upload this subdivision shape's current CPU representation to the GPU device.

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

Reimplemented in om::graphics::shapes::SphericalFunctionShape.

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

Download the subdivision shape's GPU representation to CPU memory.

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

Reimplemented in om::graphics::shapes::SphericalFunctionShape.

virtual void om::graphics::shapes::SubdivisionShape::getRenderables ( const RenderRequest request,
const Transform3 worldTransform,
RenderQueue outputQueue 
) const
virtual

Process the renderable and add all child renderable objects to the output render queue.

Implements om::graphics::base::Renderable.

virtual void om::graphics::shapes::SubdivisionShape::intersectRay ( GraphicsRay ray) const
virtual

Trace a ray against this shape and compute the closest intersection.

The default implementation intersects the ray against the most detailed subdivision's mesh.

Reimplemented from om::graphics::shapes::GraphicsShape.

Reimplemented in om::graphics::shapes::CapsuleShape, om::graphics::shapes::CylinderShape, and om::graphics::shapes::SphereShape.

virtual void om::graphics::shapes::SubdivisionShape::testRay ( GraphicsRay ray) const
virtual

Trace a ray against this shape and determine if any intersection exist along the ray.

The default implementation intersects the ray against the most detailed subdivision's mesh.

Reimplemented from om::graphics::shapes::GraphicsShape.

Reimplemented in om::graphics::shapes::CapsuleShape, om::graphics::shapes::CylinderShape, and om::graphics::shapes::SphereShape.

void om::graphics::shapes::SubdivisionShape::clearSubdivisions ( )
protected

Clear all previously-generated subdivisions for this subdivision shape.

Size om::graphics::shapes::SubdivisionShape::getSubdivisionCount ( ) const
inlineprotected

Return the number of subdivisions there are in this shape.

Subdivision* om::graphics::shapes::SubdivisionShape::getSubdivision ( Index  subdivisionLevel) const
inlineprotected

Return a pointer to the subdivision in this shape for the specified level.

GraphicsShape* om::graphics::shapes::SubdivisionShape::getSubdivisionForPixelRadius ( Real  pixelRadius) const
protected

Return the shape which should be used when the shape has the specified screen-space radius.

virtual Subdivision* om::graphics::shapes::SubdivisionShape::newSubdivision ( Size  subdivisionLevel) const
protectedpure virtual

Generate a subdivision shape for the specified subdivision level.

virtual void om::graphics::shapes::SubdivisionShape::deleteSubdivision ( Size  subdivisionLevel,
Subdivision subdivision 
)
protectedpure virtual

Delete the previously generated subdivision for the specified subdivision level.


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