Workspace 6.21.5
Public Member Functions | List of all members
WSGLGeometry Class Reference

Encapsulates the geometry of an OpenGL rendered item. More...

#include <Rendering/OpenGL/wsglgeometry.h>

Public Member Functions

 WSGLGeometry (const QString &modelId, double edgeBreakThreshold)
 
 ~WSGLGeometry ()
 
void clearAllElements ()
 
void clearVertexData ()
 
bool containsAnyElements () const
 
bool containsElements (const Mesh::ElementType::Type &type) const
 
bool containsOnlyElements (const Mesh::ElementType::Type &type) const
 
Mesh::ElementType::List getAllElementTypes () const
 
WSGLBufferObjectCachegetBufferObjectCache () const
 
double getEdgeBreakThreshold () const
 
WSGLBufferObjectCacheItemPtr getElementBuffer (const Mesh::ElementType::Type &type) const
 
const ElementIdMapgetElementBufferIds () const
 
QString getGeomId () const
 
const Mesh::BoundingBoxMinimalgetLocalBoundingBox () const
 
const QString & getModelId () const
 
bool getOptimizeOutInternalVolumeElements () const
 
WSGLBufferObjectCacheItemPtr getVertexBuffer () const
 
bool isBoundingBoxUpToDate (const QDateTime &timestamp) const
 
bool isEmpty () const
 
bool isUpToDate (const QDateTime &timestamp) const
 
void setBufferObjectCache (WSGLBufferObjectCache &cache)
 
void setContainsElements (const Mesh::ElementType::Type &type, bool b)
 
void setEdgeBreakThreshold (double t)
 
void setIsEmpty (bool b)
 
void setLocalBoundingBox (const Mesh::BoundingBoxMinimal &bb)
 
void setOptimizeOutInternalVolumeElements (bool val)
 

Detailed Description

This class exists so that we can group all the geometry for a single model into one reusable object which has its own concept of "last updated". This enables the renderer to know everything about a cached model's geometry, and know when it needs to update it.

Constructor & Destructor Documentation

◆ WSGLGeometry()

WSGLGeometry ( const QString &  modelId,
double  edgeBreakThreshold 
)

◆ ~WSGLGeometry()

Member Function Documentation

◆ clearAllElements()

void clearAllElements ( )

Removes all primitives from the render item.

◆ clearVertexData()

void clearVertexData ( )

◆ containsAnyElements()

bool containsAnyElements ( ) const

◆ containsElements()

bool containsElements ( const Mesh::ElementType::Type type) const

Tests whether the specified primitive type exists in the render item.

Returns
true if primitives that match type exist in the item. False they do not.

◆ containsOnlyElements()

bool containsOnlyElements ( const Mesh::ElementType::Type type) const

Convenience function. Tests whether only the specified primitive type exists in this item.

Returns
true if only the specified primitive type is contained within this model - false if any other types exist.

◆ getAllElementTypes()

Mesh::ElementType::List getAllElementTypes ( ) const
Returns
A list of all element types this item contains

◆ getBufferObjectCache()

WSGLBufferObjectCache * getBufferObjectCache ( ) const

◆ getEdgeBreakThreshold()

double getEdgeBreakThreshold ( ) const

◆ getElementBuffer()

WSGLBufferObjectCacheItemPtr getElementBuffer ( const Mesh::ElementType::Type type) const

Returns the buffer object containing the primitives of the specified type associated with this render item.

Parameters
typeThe type of primitives to retrieve.

◆ getElementBufferIds()

const ElementIdMap & getElementBufferIds ( ) const

◆ getGeomId()

QString getGeomId ( ) const

◆ getLocalBoundingBox()

const Mesh::BoundingBoxMinimal & getLocalBoundingBox ( ) const
Returns
The bounding box of the mesh geometry.

◆ getModelId()

const QString & getModelId ( ) const

◆ getOptimizeOutInternalVolumeElements()

bool getOptimizeOutInternalVolumeElements ( ) const
Returns
True if the geometry will optimize away (i.e. not use) volume (tetrahedral) elements that are fully internal.

◆ getVertexBuffer()

WSGLBufferObjectCacheItemPtr getVertexBuffer ( ) const

Returns the buffer object containing the vertex data (positions and / or normals) for this render item.

Returns
A buffer object that can be used to store vertex data for the model. if no model id has been specified, an invalid pointer will be returned.
Precondition
A model ID must have been specified before this will work.

◆ isBoundingBoxUpToDate()

bool isBoundingBoxUpToDate ( const QDateTime &  timestamp) const

◆ isEmpty()

bool isEmpty ( ) const

◆ isUpToDate()

bool isUpToDate ( const QDateTime &  timestamp) const
Parameters
timestampThe time we are comparing the geometry's updated state against.
Returns
True if the geometry was updated at or after the specified timestamp. Returns False if the geometry was updated prior to the timestamp. This is usually used to determine whether the geometry itself is out-of-date, or a buffer dependent on the geometry requires updating.

◆ setBufferObjectCache()

void setBufferObjectCache ( WSGLBufferObjectCache cache)

◆ setContainsElements()

void setContainsElements ( const Mesh::ElementType::Type type,
bool  b 
)

Assigns the specified buffer object (of type ELEMENT_ARRAY_BUFFER) as the collection of primitives representing the specified type.

◆ setEdgeBreakThreshold()

void setEdgeBreakThreshold ( double  t)

◆ setIsEmpty()

void setIsEmpty ( bool  b)

◆ setLocalBoundingBox()

void setLocalBoundingBox ( const Mesh::BoundingBoxMinimal bb)
Parameters
bbThe bounding box of the geometry in local coordinates.

◆ setOptimizeOutInternalVolumeElements()

void setOptimizeOutInternalVolumeElements ( bool  val)
Parameters
valIf true, then the geometry render will optimize out internal volume (tetrahedral) elements.