VTK  9.3.0
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
abstract class specifies interface to map data
Delegates rendering of multiple polydata that share similar signatures.
virtual BatchElement * Get(vtkPolyData *polydata)=0
Get the batch element that describes attributes for a vtkPolyData.
virtual std::vector< vtkPolyData * > GetRenderedList() const =0
Accessor to the ordered list of PolyData that we last drew.
virtual void ClearUnmarkedBatchElements()=0
Keep track of what data is being used as the structure can change.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Mark()
Keep track of what data is being used as the structure can change.
vtkSmartPointer< vtkPolyDataMapper > GetDelegate() noexcept
Get a reference to the delegate.
virtual void ShallowCopy(vtkCompositePolyDataMapper *polydataMapper)
Shallow copies scalar array related properties into the delegate.
virtual void Clear()=0
Clear all batch elements.
virtual void Insert(BatchElement &&element)=0
Add input polydata and it's rendering attributes to internal storage.
virtual void SetParent(vtkCompositePolyDataMapper *mapper)=0
Assign a parent mapper.
void Unmark()
Keep track of what data is being used as the structure can change.
static vtkCompositePolyDataMapperDelegator * New()
bool GetMarked()
Keep track of what data is being used as the structure can change.
virtual void UnmarkBatchElements()=0
Keep track of what data is being used as the structure can change.
a class that renders hierarchical polygonal data
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
Superclass for mapping scalar values to colors.
@ string
Definition: vtkX3D.h:490
int vtkIdType
Definition: vtkType.h:315