VTK  9.3.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkOpenGLBatchedPolyDataMapper Class Reference

An OpenGL mapper for batched rendering of vtkPolyData. More...

#include <vtkOpenGLBatchedPolyDataMapper.h>

Inheritance diagram for vtkOpenGLBatchedPolyDataMapper:
[legend]
Collaboration diagram for vtkOpenGLBatchedPolyDataMapper:
[legend]

Public Types

typedef vtkOpenGLPolyDataMapperImplementation Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 
vtkOpenGLBatchedPolyDataMapperNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
std::vector< vtkPolyData * > GetRenderedList () const
 Accessor to the ordered list of PolyData that we last drew.
 
void SetParent (vtkCompositePolyDataMapper *parent)
 
void RenderPiece (vtkRenderer *renderer, vtkActor *actor) override
 Implemented by sub classes.
 
void UnmarkBatchElements ()
 
void ClearUnmarkedBatchElements ()
 
void ProcessSelectorPixelBuffers (vtkHardwareSelector *sel, std::vector< unsigned int > &pixeloffsets, vtkProp *prop) override
 allows a mapper to update a selections color buffers Called from a prop which in turn is called from the selector
 
virtual void ProcessCompositePixelBuffers (vtkHardwareSelector *sel, vtkProp *prop, GLBatchElement *glBatchElement, std::vector< unsigned int > &mypixels)
 

Static Public Member Functions

static vtkOpenGLBatchedPolyDataMapperNew ()
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkOpenGLBatchedPolyDataMapperSafeDownCast (vtkObjectBase *o)
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkOpenGLBatchedPolyDataMapper ()
 
 ~vtkOpenGLBatchedPolyDataMapper () override
 
void RenderPieceDraw (vtkRenderer *renderer, vtkActor *actor) override
 
void UpdateCameraShiftScale (vtkRenderer *renderer, vtkActor *actoror) override
 
void DrawIBO (vtkRenderer *renderer, vtkActor *actoror, int primType, vtkOpenGLHelper &CellBO, GLenum mode, int pointSize)
 Draws primitives.
 
virtual void SetShaderValues (vtkShaderProgram *prog, GLBatchElement *glBatchElement, size_t primOffset)
 Applies rendering attributes for the corresponding polydata in the glBatchElement.
 
void UpdateShaders (vtkOpenGLHelper &cellBO, vtkRenderer *renderer, vtkActor *actor) override
 Make sure appropriate shaders are defined, compiled and bound.
 
void ReplaceShaderColor (std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *renderer, vtkActor *actor) override
 Perform string replacements on the shader templates, called from ReplaceShaderValues.
 
bool GetNeedToRebuildBufferObjects (vtkRenderer *renderer, vtkActor *actor) override
 Does the VBO/IBO need to be rebuilt.
 
void BuildBufferObjects (vtkRenderer *renderer, vtkActor *actor) override
 Build the VBO/IBO, called by UpdateBufferObjects.
 
virtual void AppendOneBufferObject (vtkRenderer *renderer, vtkActor *actor, GLBatchElement *glBatchElement, vtkIdType &vertexOffset, std::vector< unsigned char > &colors, std::vector< float > &norms)
 
void BuildSelectionIBO (vtkPolyData *poly, std::vector< unsigned int >(&indices)[4], vtkIdType offset) override
 Build the selection IBOs, called by UpdateBufferObjects.
 
int CanUseTextureMapForColoring (vtkDataObject *) override
 Returns if we can use texture maps for scalar coloring.
 

Protected Attributes

vtkCompositePolyDataMapperParent = nullptr
 
std::map< std::uintptr_t, std::unique_ptr< GLBatchElement > > VTKPolyDataToGLBatchElement
 
std::vector< unsigned int > IndexArray [PrimitiveEnd]
 
bool PrimIDUsed
 
bool OverideColorUsed
 
vtkHardwareSelectorCurrentSelector
 
std::vector< std::vector< unsigned int > > PickPixels
 
std::map< vtkAbstractArray *, vtkDataArray * > ColorArrayMap
 
using BatchElement = vtkOpenGLCompositePolyDataMapperDelegator::BatchElement
 API to add and query a GLBatchElement instance per vtkPolyData.
 
using GLBatchElement = vtkOpenGLCompositePolyDataMapperDelegator::GLBatchElement
 API to add and query a GLBatchElement instance per vtkPolyData.
 
void AddBatchElement (unsigned int flatIndex, BatchElement &&batchElement)
 API to add and query a GLBatchElement instance per vtkPolyData.
 
BatchElementGetBatchElement (vtkPolyData *polydata)
 API to add and query a GLBatchElement instance per vtkPolyData.
 
void ClearBatchElements ()
 API to add and query a GLBatchElement instance per vtkPolyData.
 

Detailed Description

An OpenGL mapper for batched rendering of vtkPolyData.

The parent class is determined at compile time. On OpenGL ES, the parent class is vtkOpenGLES30PolyDataMapper. Everywhere else, the parent class is vtkOpenGLPolyDataMapper.

See also
vtkOpenGLPolyDataMapper vtkOpenGLES30PolyDataMapper vtkOpenGLCompositePolyDataMapperDelegator

Definition at line 43 of file vtkOpenGLBatchedPolyDataMapper.h.

Member Typedef Documentation

◆ Superclass

Definition at line 48 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ BatchElement

API to add and query a GLBatchElement instance per vtkPolyData.

Definition at line 55 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ GLBatchElement

API to add and query a GLBatchElement instance per vtkPolyData.

Definition at line 56 of file vtkOpenGLBatchedPolyDataMapper.h.

Constructor & Destructor Documentation

◆ vtkOpenGLBatchedPolyDataMapper()

vtkOpenGLBatchedPolyDataMapper::vtkOpenGLBatchedPolyDataMapper ( )
protected

◆ ~vtkOpenGLBatchedPolyDataMapper()

vtkOpenGLBatchedPolyDataMapper::~vtkOpenGLBatchedPolyDataMapper ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkOpenGLBatchedPolyDataMapper * vtkOpenGLBatchedPolyDataMapper::New ( )
static

◆ IsTypeOf()

static vtkTypeBool vtkOpenGLBatchedPolyDataMapper::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkOpenGLBatchedPolyDataMapper::IsA ( const char *  type)
virtual

Reimplemented in vtkBatchedSurfaceLICMapper.

◆ SafeDownCast()

static vtkOpenGLBatchedPolyDataMapper * vtkOpenGLBatchedPolyDataMapper::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkOpenGLBatchedPolyDataMapper::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented in vtkBatchedSurfaceLICMapper.

◆ NewInstance()

vtkOpenGLBatchedPolyDataMapper * vtkOpenGLBatchedPolyDataMapper::NewInstance ( ) const

◆ PrintSelf()

void vtkOpenGLBatchedPolyDataMapper::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

◆ AddBatchElement()

void vtkOpenGLBatchedPolyDataMapper::AddBatchElement ( unsigned int  flatIndex,
BatchElement &&  batchElement 
)

API to add and query a GLBatchElement instance per vtkPolyData.

◆ GetBatchElement()

BatchElement * vtkOpenGLBatchedPolyDataMapper::GetBatchElement ( vtkPolyData polydata)

API to add and query a GLBatchElement instance per vtkPolyData.

◆ ClearBatchElements()

void vtkOpenGLBatchedPolyDataMapper::ClearBatchElements ( )

API to add and query a GLBatchElement instance per vtkPolyData.

◆ GetRenderedList()

std::vector< vtkPolyData * > vtkOpenGLBatchedPolyDataMapper::GetRenderedList ( ) const

Accessor to the ordered list of PolyData that we last drew.

◆ SetParent()

void vtkOpenGLBatchedPolyDataMapper::SetParent ( vtkCompositePolyDataMapper parent)

◆ RenderPiece()

void vtkOpenGLBatchedPolyDataMapper::RenderPiece ( vtkRenderer renderer,
vtkActor actor 
)
override

Implemented by sub classes.

Actual rendering is done here.

◆ UnmarkBatchElements()

void vtkOpenGLBatchedPolyDataMapper::UnmarkBatchElements ( )

◆ ClearUnmarkedBatchElements()

void vtkOpenGLBatchedPolyDataMapper::ClearUnmarkedBatchElements ( )

◆ ProcessSelectorPixelBuffers()

void vtkOpenGLBatchedPolyDataMapper::ProcessSelectorPixelBuffers ( vtkHardwareSelector sel,
std::vector< unsigned int > &  pixeloffsets,
vtkProp prop 
)
override

allows a mapper to update a selections color buffers Called from a prop which in turn is called from the selector

◆ ProcessCompositePixelBuffers()

virtual void vtkOpenGLBatchedPolyDataMapper::ProcessCompositePixelBuffers ( vtkHardwareSelector sel,
vtkProp prop,
GLBatchElement glBatchElement,
std::vector< unsigned int > &  mypixels 
)
virtual

◆ RenderPieceDraw()

void vtkOpenGLBatchedPolyDataMapper::RenderPieceDraw ( vtkRenderer renderer,
vtkActor actor 
)
overrideprotected

◆ UpdateCameraShiftScale()

void vtkOpenGLBatchedPolyDataMapper::UpdateCameraShiftScale ( vtkRenderer renderer,
vtkActor actoror 
)
overrideprotected

◆ DrawIBO()

void vtkOpenGLBatchedPolyDataMapper::DrawIBO ( vtkRenderer renderer,
vtkActor actoror,
int  primType,
vtkOpenGLHelper CellBO,
GLenum  mode,
int  pointSize 
)
protected

Draws primitives.

◆ SetShaderValues()

virtual void vtkOpenGLBatchedPolyDataMapper::SetShaderValues ( vtkShaderProgram prog,
GLBatchElement glBatchElement,
size_t  primOffset 
)
protectedvirtual

Applies rendering attributes for the corresponding polydata in the glBatchElement.

◆ UpdateShaders()

void vtkOpenGLBatchedPolyDataMapper::UpdateShaders ( vtkOpenGLHelper cellBO,
vtkRenderer renderer,
vtkActor actor 
)
overrideprotected

Make sure appropriate shaders are defined, compiled and bound.

This method orchistrates the process, much of the work is done in other methods

◆ ReplaceShaderColor()

void vtkOpenGLBatchedPolyDataMapper::ReplaceShaderColor ( std::map< vtkShader::Type, vtkShader * >  shaders,
vtkRenderer renderer,
vtkActor actor 
)
overrideprotected

Perform string replacements on the shader templates, called from ReplaceShaderValues.

◆ GetNeedToRebuildBufferObjects()

bool vtkOpenGLBatchedPolyDataMapper::GetNeedToRebuildBufferObjects ( vtkRenderer renderer,
vtkActor actor 
)
overrideprotected

Does the VBO/IBO need to be rebuilt.

◆ BuildBufferObjects()

void vtkOpenGLBatchedPolyDataMapper::BuildBufferObjects ( vtkRenderer renderer,
vtkActor actor 
)
overrideprotected

Build the VBO/IBO, called by UpdateBufferObjects.

◆ AppendOneBufferObject()

virtual void vtkOpenGLBatchedPolyDataMapper::AppendOneBufferObject ( vtkRenderer renderer,
vtkActor actor,
GLBatchElement glBatchElement,
vtkIdType vertexOffset,
std::vector< unsigned char > &  colors,
std::vector< float > &  norms 
)
protectedvirtual

Reimplemented in vtkBatchedSurfaceLICMapper.

◆ BuildSelectionIBO()

void vtkOpenGLBatchedPolyDataMapper::BuildSelectionIBO ( vtkPolyData poly,
std::vector< unsigned int >(&)  indices[4],
vtkIdType  offset 
)
overrideprotected

Build the selection IBOs, called by UpdateBufferObjects.

◆ CanUseTextureMapForColoring()

int vtkOpenGLBatchedPolyDataMapper::CanUseTextureMapForColoring ( vtkDataObject )
overrideprotected

Returns if we can use texture maps for scalar coloring.

Note this doesn't say we "will" use scalar coloring. It says, if we do use scalar coloring, we will use a texture. Always off for this mapper.

Member Data Documentation

◆ Parent

vtkCompositePolyDataMapper* vtkOpenGLBatchedPolyDataMapper::Parent = nullptr
protected

Definition at line 144 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ VTKPolyDataToGLBatchElement

std::map<std::uintptr_t, std::unique_ptr<GLBatchElement> > vtkOpenGLBatchedPolyDataMapper::VTKPolyDataToGLBatchElement
protected

Definition at line 146 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ IndexArray

std::vector<unsigned int> vtkOpenGLBatchedPolyDataMapper::IndexArray[PrimitiveEnd]
protected

Definition at line 148 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ PrimIDUsed

bool vtkOpenGLBatchedPolyDataMapper::PrimIDUsed
protected

Definition at line 150 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ OverideColorUsed

bool vtkOpenGLBatchedPolyDataMapper::OverideColorUsed
protected

Definition at line 152 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ CurrentSelector

vtkHardwareSelector* vtkOpenGLBatchedPolyDataMapper::CurrentSelector
protected

Definition at line 154 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ PickPixels

std::vector<std::vector<unsigned int> > vtkOpenGLBatchedPolyDataMapper::PickPixels
protected

Definition at line 156 of file vtkOpenGLBatchedPolyDataMapper.h.

◆ ColorArrayMap

std::map<vtkAbstractArray*, vtkDataArray*> vtkOpenGLBatchedPolyDataMapper::ColorArrayMap
protected

Definition at line 158 of file vtkOpenGLBatchedPolyDataMapper.h.


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