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

Special type of render item for rendering items that are drawn many times in different parts of the scene, slightly differently.

#include <Rendering/OpenGL/wsglinstanceditem.h>

Inheritance diagram for WSGLInstancedItem:
[legend]

Public Member Functions

 WSGLInstancedItem (const QString &modelId, const QString &modelName)
 
 ~WSGLInstancedItem () override
 
void addInstance (unsigned index, const Mesh::TransformMatrix &localTransform, bool isBillboarded=false)
 
void clearInstances ()
 
Mesh::TransformMatrix computeInstanceWorldMatrix (const Mesh::TransformMatrix &mView, const Mesh::TransformMatrix &mParentWorld, int instanceIndex)
 
Mesh::TransformMatrix computeInstanceWorldViewMatrix (const Mesh::TransformMatrix &mView, const Mesh::TransformMatrix &mParentWorld, int instanceIndex)
 
const QBitArray & getInstanceIsBillboarded () const
 
bool getInstanceIsBillboarded (int instanceIndex) const
 
const Mesh::TransformMatrixgetInstanceLocalTransform (int instanceIndex) const
 
const QVector< Mesh::TransformMatrix > & getInstanceLocalTransforms () const
 
unsigned getInstanceNodeIndex (int instanceIndex) const
 
const QVector< unsigned > & getInstanceNodeIndices () const
 
unsigned numInstances ()
 
- Public Member Functions inherited from WSGLRenderItem
 WSGLRenderItem (const QString &modelId, const QString &name)
 
 WSGLRenderItem (const WSGLRenderItem &)
 
virtual ~WSGLRenderItem ()
 
void clearAllGlyphs ()
 
void clearGlyphs ()
 
const ClipRegionListgetClipRegions () const
 
unsigned char getDepthLayer () const
 
WSGLInstancedItemgetElementGlyph (const Mesh::ElementType::Type *elementType, int i) const
 
const ElementGlyphSetsgetElementGlyphs () const
 
const WSGLGlyphSetPtrgetElementGlyphs (const Mesh::ElementType::Type *elementType) const
 
Mesh::ElementType::List getElementTypesGlyphed () const
 
WSGLGeometrygetGeometry ()
 
const WSGLGeometrygetGeometry () const
 
WSGLInstancedItemgetGlyph (int i) const
 
const WSGLGlyphSuperSetPtrgetGlyphs () const
 
Mesh::MeshModelLibrarygetMeshModelLibrary ()
 
const Mesh::MeshModelLibrarygetMeshModelLibrary () const
 
const QString & getModelId () const
 
const QString & getModelName () const
 
WSGLInstancedItemgetNodeGlyph (int i) const
 
const WSGLGlyphSetPtrgetNodeGlyphs () const
 
const QString & getOpIdPath () const
 
ShadergetShader ()
 
const ShadergetShader () const
 
SortingKey getSortingKey () const
 
const Mesh::BoundingBoxMinimalgetWorldBoundingBox () const
 
const Mesh::TransformMatrixgetWorldTransform () const
 
bool hasElementGlyphs (const Mesh::ElementType::Type *elementType=nullptr) const
 
bool hasGlyphs () const
 
bool hasNodeGlyphs () const
 
bool isDepthTested () const
 
bool isInteractive () const
 
bool isManipulatorSymbol () const
 
bool isSymbol () const
 
WSGLRenderItemoperator= (const WSGLRenderItem &)
 
void releaseAllCachedData ()
 
virtual bool render (WSGLRenderer &renderer, const WSGLRenderElementsFilter *elementFilter=nullptr, bool ignorePickFilter=false)
 
void setClipRegions (const ClipRegionList &list)
 
void setElementGlyphs (const Mesh::ElementType::Type *elementType, const WSGLGlyphSetPtr &glyphs)
 
void setFlags (RenderItemFlags flags)
 
void setGeometry (WSGLGeometry *geometry)
 
void setGlyphs (const WSGLGlyphSuperSetPtr &glyphs)
 
void setMeshModelLibrary (Mesh::MeshModelLibrary &)
 
void setModelId (const QString &)
 
void setModelName (const QString &)
 
void setNodeGlyphs (const WSGLGlyphSetPtr &glyphs)
 
void setOpIdPath (const QString &path)
 
void setShader (Shader *shader)
 
void setSortingKey (const SortingKey &key)
 
void setWorldBoundingBox (const Mesh::BoundingBoxMinimal &bb)
 
void setWorldTransform (const Mesh::TransformMatrix &matrix)
 

Additional Inherited Members

- Public Types inherited from WSGLRenderItem
enum  RenderItemFlag { IsSymbol = 0x01 , IsManipulatorSymbol = 0x02 , IsInteractive = 0x04 , IsDepthTested = 0x08 }
 
using SortingKey = quint64
 
- Static Public Attributes inherited from WSGLRenderItem
static const unsigned ID_ATTRIB_LOCATION = 2
 
static const unsigned NORMAL_ATTRIB_LOCATION = 1
 
static const unsigned VERTEX_ATTRIB_LOCATION = 0
 

Constructor & Destructor Documentation

◆ WSGLInstancedItem()

WSGLInstancedItem ( const QString &  modelId,
const QString &  modelName 
)

◆ ~WSGLInstancedItem()

~WSGLInstancedItem ( )
override

Member Function Documentation

◆ addInstance()

void addInstance ( unsigned  index,
const Mesh::TransformMatrix localTransform,
bool  isBillboarded = false 
)

◆ clearInstances()

void clearInstances ( )

◆ computeInstanceWorldMatrix()

Mesh::TransformMatrix computeInstanceWorldMatrix ( const Mesh::TransformMatrix mView,
const Mesh::TransformMatrix mParentWorld,
int  instanceIndex 
)

◆ computeInstanceWorldViewMatrix()

Mesh::TransformMatrix computeInstanceWorldViewMatrix ( const Mesh::TransformMatrix mView,
const Mesh::TransformMatrix mParentWorld,
int  instanceIndex 
)
Returns
the WorldView matrix of the given instance.

◆ getInstanceIsBillboarded() [1/2]

const QBitArray & getInstanceIsBillboarded ( ) const

◆ getInstanceIsBillboarded() [2/2]

bool getInstanceIsBillboarded ( int  instanceIndex) const
Returns
true if this instance is billboarding, false otherwise.

◆ getInstanceLocalTransform()

const Mesh::TransformMatrix & getInstanceLocalTransform ( int  instanceIndex) const
Parameters
instanceIndexThe index of the instance for which the transform is to be retrieved.
Warning
For performance reasons, this function does not bounds-check the index. The calling function must ensure that the index is valid.

◆ getInstanceLocalTransforms()

const QVector< Mesh::TransformMatrix > & getInstanceLocalTransforms ( ) const

◆ getInstanceNodeIndex()

unsigned getInstanceNodeIndex ( int  instanceIndex) const
Parameters
instanceIndexThe index of the instance for which the transform is to be retrieved.
Warning
For performance reasons, this function does not bounds-check the index. The calling function must ensure that the index is valid.

◆ getInstanceNodeIndices()

const QVector< unsigned > & getInstanceNodeIndices ( ) const

◆ numInstances()

unsigned numInstances ( )