VTK: Rendering/Core/vtkVisibilitySort.h Source File

| VTK 9.3.1

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 {
110 BACK_TO_FRONT,
111 FRONT_TO_BACK
112 };
113
115
118 bool UsesGarbageCollector() const override { return true; }
120
121 protected:
122 vtkVisibilitySort();
123 ~vtkVisibilitySort() override;
124
125 vtkTimeStamp LastSortTime;
126
127 vtkMatrix4x4* ModelTransform;
128 vtkMatrix4x4* InverseModelTransform;
129 vtkCamera* Camera;
130 vtkDataSet* Input;
131
132 int MaxCellsReturned;
133
134 int Direction;
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
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:80
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkVisibilitySort
Abstract class that can sort cell data along a viewpoint.
Definition: vtkVisibilitySort.h:39
vtkVisibilitySort::ReportReferences
void ReportReferences(vtkGarbageCollector *collector) override
vtkVisibilitySort::~vtkVisibilitySort
~vtkVisibilitySort() override
vtkVisibilitySort::SetCamera
virtual void SetCamera(vtkCamera *camera)
Set/Get the camera that specifies the viewing parameters.
vtkVisibilitySort::Input
vtkDataSet * Input
Definition: vtkVisibilitySort.h:130
vtkVisibilitySort::vtkVisibilitySort
vtkVisibilitySort()
vtkVisibilitySort::MaxCellsReturned
int MaxCellsReturned
Definition: vtkVisibilitySort.h:132
vtkVisibilitySort::ModelTransform
vtkMatrix4x4 * ModelTransform
Definition: vtkVisibilitySort.h:127
vtkVisibilitySort::Camera
vtkCamera * Camera
Definition: vtkVisibilitySort.h:129
vtkVisibilitySort::SetDirectionToBackToFront
void SetDirectionToBackToFront()
Set/Get the sorting direction.
Definition: vtkVisibilitySort.h:104
vtkVisibilitySort::GetNextCells
virtual vtkIdTypeArray * GetNextCells()=0
To facilitate incremental sorting algorithms, the cells are retrieved in an iteration process.
vtkVisibilitySort::LastSortTime
vtkTimeStamp LastSortTime
Definition: vtkVisibilitySort.h:125
vtkVisibilitySort::Direction
int Direction
Definition: vtkVisibilitySort.h:134
vtkVisibilitySort::UsesGarbageCollector
bool UsesGarbageCollector() const override
Overwritten to enable garbage collection.
Definition: vtkVisibilitySort.h:118
vtkVisibilitySort::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVisibilitySort::InverseModelTransform
vtkMatrix4x4 * InverseModelTransform
Definition: vtkVisibilitySort.h:128
vtkVisibilitySort::InitTraversal
virtual void InitTraversal()=0
To facilitate incremental sorting algorithms, the cells are retrieved in an iteration process.
vtkVisibilitySort::SetInput
virtual void SetInput(vtkDataSet *data)
Set/Get the data set containing the cells to sort.
vtkVisibilitySort::SetDirectionToFrontToBack
void SetDirectionToFrontToBack()
Set/Get the sorting direction.
Definition: vtkVisibilitySort.h:105
vtkVisibilitySort::SetModelTransform
virtual void SetModelTransform(vtkMatrix4x4 *mat)
Set/Get the matrix that transforms from object space to world space.
vtkVisibilitySort::BACK_TO_FRONT
@ BACK_TO_FRONT
Definition: vtkVisibilitySort.h:110
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkObject.h
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:144