VTK  9.3.0
vtkOpenGLCompositePolyDataMapperDelegator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
14#ifndef vtkOpenGLCompositePolyDataMapperDelegator_h
15#define vtkOpenGLCompositePolyDataMapperDelegator_h
16
18
19#include "vtkNew.h" // for ivar
20#include "vtkOpenGLPolyDataMapper.h" // for PrimitiveEnd
21#include "vtkRenderingOpenGL2Module.h" // for export macro
22
23VTK_ABI_NAMESPACE_BEGIN
25
26class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLCompositePolyDataMapperDelegator
28{
29public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
34 // This class extends the rendering attributes for a vtkPolyData with OpenGL specifics.
37 {
39
40 unsigned int StartVertex;
41 unsigned int NextVertex;
42
43 // point line poly strip edge stripedge
44 unsigned int StartIndex[vtkOpenGLPolyDataMapper::PrimitiveEnd];
46
47 // stores the mapping from vtk cells to gl_PrimitiveId
49 };
50
52
55 // Copy array names used for selection. Ex: PointIdArrayName, CompositeIdArrayName, ..
58 void UnmarkBatchElements() override;
60
61protected:
64
66
69 std::vector<vtkPolyData*> GetRenderedList() const override;
70 void SetParent(vtkCompositePolyDataMapper* mapper) override;
71 void Insert(BatchElement&& item) override;
72 BatchElement* Get(vtkPolyData* polydata) override;
73 void Clear() override;
75
76 // The actual mapper which renders multiple vtkPolyData.
77 // Constructor assigns it to vtkBatchedPolyDataMapperDelegator::Delegate.
78 // From that point on, parent class manages lifetime of this GLDelegate.
79 // Instead of repeatedly downcasting the abstract Delegate, we trampoline
80 // calls to GLDelegate.
81 vtkOpenGLBatchedPolyDataMapper* GLDelegate = nullptr;
82
83private:
86 void operator=(const vtkOpenGLCompositePolyDataMapperDelegator&) = delete;
87};
88
89VTK_ABI_NAMESPACE_END
90#endif
Delegates rendering of multiple polydata that share similar signatures.
a class that renders hierarchical polygonal data
a simple class to control print indentation
Definition vtkIndent.h:29
Allocate and hold a VTK object.
Definition vtkNew.h:51
An OpenGL mapper for batched rendering of vtkPolyData.
An OpenGL delegator for batched rendering of multipler polydata with similar structure.
std::vector< vtkPolyData * > GetRenderedList() const override
Implement parent class API.
void Clear() override
Implement parent class API.
void UnmarkBatchElements() override
Implement parent class API.
void ShallowCopy(vtkCompositePolyDataMapper *mapper) override
Implement parent class API.
void SetParent(vtkCompositePolyDataMapper *mapper) override
Implement parent class API.
static vtkOpenGLCompositePolyDataMapperDelegator * New()
BatchElement * Get(vtkPolyData *polydata) override
Implement parent class API.
void Insert(BatchElement &&item) override
Implement parent class API.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ClearUnmarkedBatchElements() override
Implement parent class API.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80