VTK  9.3.1
vtkCompositePolyDataMapperDelegator.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 vtkCompositePolyDataMapperDelegator_h
15 #define vtkCompositePolyDataMapperDelegator_h
16 
17 #include "vtkObject.h"
18 
19 #include "vtkColor.h" // for ivar
20 #include "vtkRenderingCoreModule.h" // for export macro
21 #include "vtkSmartPointer.h" // for ivar
22 #include "vtkVector.h" // for ivar
23 
24 #include <memory> // for shared_ptr
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkAbstractMapper;
29 class vtkPolyData;
30 class vtkPolyDataMapper;
31 class vtkScalarsToColors;
32 class vtkImageData;
33 
34 class VTKRENDERINGCORE_EXPORT vtkCompositePolyDataMapperDelegator : public vtkObject
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  virtual void ShallowCopy(vtkCompositePolyDataMapper* polydataMapper);
45 
49  inline vtkSmartPointer<vtkPolyDataMapper> GetDelegate() noexcept { return this->Delegate; }
50 
51  // This class encapsulates rendering attributes for a vtkPolyData
52  struct BatchElement
53  {
54  bool Marked;
55  bool IsOpaque;
56  bool Visibility;
62 
63  int ColorMode;
67  int ArrayId;
69 
70  unsigned int FlatIndex;
71 
76 
77  double Opacity;
80 
82  vtkScalarsToColors* LookupTable = nullptr;
83  vtkPolyData* PolyData = nullptr;
84  };
85 
87 
91  inline bool GetMarked() { return this->Marked; }
92  inline void Mark() { this->Marked = true; }
93  inline void Unmark()
94  {
95  this->Marked = false;
96  this->UnmarkBatchElements();
97  }
98  virtual void ClearUnmarkedBatchElements() = 0;
99  virtual void UnmarkBatchElements() = 0;
101 
105  virtual std::vector<vtkPolyData*> GetRenderedList() const = 0;
106 
115  virtual void SetParent(vtkCompositePolyDataMapper* mapper) = 0;
116 
120  virtual void Insert(BatchElement&& element) = 0;
121 
125  virtual BatchElement* Get(vtkPolyData* polydata) = 0;
126 
130  virtual void Clear() = 0;
131 
132 protected:
135 
137 
138  bool Marked = false;
139 
140 private:
142  void operator=(const vtkCompositePolyDataMapperDelegator&) = delete;
143 };
144 
145 VTK_ABI_NAMESPACE_END
146 #endif
void Mark()
Keep track of what data is being used as the structure can change.
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkPolyDataMapper > GetDelegate() noexcept
Get a reference to the delegate.
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Superclass for mapping scalar values to colors.
Delegates rendering of multiple polydata that share similar signatures.
a simple class to control print indentation
Definition: vtkIndent.h:28
bool GetMarked()
Keep track of what data is being used as the structure can change.
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
abstract class specifies interface to map data
map vtkPolyData to graphics primitives
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
a class that renders hierarchical polygonal data
void Unmark()
Keep track of what data is being used as the structure can change.