VTK  9.3.20240419
vtkVisibilitySort.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2003 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4 
26 #ifndef vtkVisibilitySort_h
27 #define vtkVisibilitySort_h
28 
29 #include "vtkObject.h"
30 #include "vtkRenderingCoreModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkIdTypeArray;
34 class vtkDataSet;
35 class vtkMatrix4x4;
36 class vtkCamera;
37 
38 class VTKRENDERINGCORE_EXPORT vtkVisibilitySort : public vtkObject
39 {
40 public:
41  vtkTypeMacro(vtkVisibilitySort, vtkObject);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
56  virtual void InitTraversal() = 0;
57  virtual vtkIdTypeArray* GetNextCells() = 0;
59 
61 
65  vtkSetClampMacro(MaxCellsReturned, int, 1, VTK_INT_MAX);
66  vtkGetMacro(MaxCellsReturned, int);
68 
70 
75  virtual void SetModelTransform(vtkMatrix4x4* mat);
76  vtkGetObjectMacro(ModelTransform, vtkMatrix4x4);
78 
79  vtkGetObjectMacro(InverseModelTransform, vtkMatrix4x4);
80 
82 
85  virtual void SetCamera(vtkCamera* camera);
86  vtkGetObjectMacro(Camera, vtkCamera);
88 
90 
93  virtual void SetInput(vtkDataSet* data);
94  vtkGetObjectMacro(Input, vtkDataSet);
96 
98 
102  vtkGetMacro(Direction, int);
103  vtkSetMacro(Direction, int);
104  void SetDirectionToBackToFront() { this->SetDirection(BACK_TO_FRONT); }
105  void SetDirectionToFrontToBack() { this->SetDirection(FRONT_TO_BACK); }
107 
108  enum
109  {
111  FRONT_TO_BACK
112  };
113 
115 
118  bool UsesGarbageCollector() const override { return true; }
120 
121 protected:
123  ~vtkVisibilitySort() override;
124 
126 
131 
133 
135 
136  void ReportReferences(vtkGarbageCollector* collector) override;
137 
138 private:
139  vtkVisibilitySort(const vtkVisibilitySort&) = delete;
140  void operator=(const vtkVisibilitySort&) = delete;
141 };
142 
143 VTK_ABI_NAMESPACE_END
144 #endif // vtkVisibilitySort_h
a virtual camera for 3D rendering
Definition: vtkCamera.h:151
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
Detect and break reference loops.
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:141
abstract base class for most VTK objects
Definition: vtkObject.h:162
record modification and/or execution time
Definition: vtkTimeStamp.h:44
Abstract class that can sort cell data along a viewpoint.
void ReportReferences(vtkGarbageCollector *collector) override
~vtkVisibilitySort() override
virtual void SetCamera(vtkCamera *camera)
Set/Get the camera that specifies the viewing parameters.
vtkMatrix4x4 * ModelTransform
void SetDirectionToBackToFront()
Set/Get the sorting direction.
virtual vtkIdTypeArray * GetNextCells()=0
To facilitate incremental sorting algorithms, the cells are retrieved in an iteration process.
vtkTimeStamp LastSortTime
bool UsesGarbageCollector() const override
Overwritten to enable garbage collection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMatrix4x4 * InverseModelTransform
virtual void InitTraversal()=0
To facilitate incremental sorting algorithms, the cells are retrieved in an iteration process.
virtual void SetInput(vtkDataSet *data)
Set/Get the data set containing the cells to sort.
void SetDirectionToFrontToBack()
Set/Get the sorting direction.
virtual void SetModelTransform(vtkMatrix4x4 *mat)
Set/Get the matrix that transforms from object space to world space.
@ data
Definition: vtkX3D.h:315
#define VTK_INT_MAX
Definition: vtkType.h:144