VTK  9.3.20240418
vtkDepthSortPolyData.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
51 #ifndef vtkDepthSortPolyData_h
52 #define vtkDepthSortPolyData_h
53 
54 #include "vtkFiltersHybridModule.h" // For export macro
55 #include "vtkPolyDataAlgorithm.h"
56 
57 VTK_ABI_NAMESPACE_BEGIN
58 class vtkCamera;
59 class vtkProp3D;
60 class vtkTransform;
61 
62 class VTKFILTERSHYBRID_EXPORT vtkDepthSortPolyData : public vtkPolyDataAlgorithm
63 {
64 public:
69 
71  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
74  {
75  VTK_DIRECTION_BACK_TO_FRONT = 0,
76  VTK_DIRECTION_FRONT_TO_BACK = 1,
77  VTK_DIRECTION_SPECIFIED_VECTOR = 2
78  };
79 
81 
85  vtkSetMacro(Direction, int);
86  vtkGetMacro(Direction, int);
87  void SetDirectionToFrontToBack() { this->SetDirection(VTK_DIRECTION_FRONT_TO_BACK); }
88  void SetDirectionToBackToFront() { this->SetDirection(VTK_DIRECTION_BACK_TO_FRONT); }
89  void SetDirectionToSpecifiedVector() { this->SetDirection(VTK_DIRECTION_SPECIFIED_VECTOR); }
91 
92  enum SortMode
93  {
94  VTK_SORT_FIRST_POINT = 0,
95  VTK_SORT_BOUNDS_CENTER = 1,
96  VTK_SORT_PARAMETRIC_CENTER = 2
97  };
98 
100 
106  vtkSetMacro(DepthSortMode, int);
107  vtkGetMacro(DepthSortMode, int);
108  void SetDepthSortModeToFirstPoint() { this->SetDepthSortMode(VTK_SORT_FIRST_POINT); }
109  void SetDepthSortModeToBoundsCenter() { this->SetDepthSortMode(VTK_SORT_BOUNDS_CENTER); }
110  void SetDepthSortModeToParametricCenter() { this->SetDepthSortMode(VTK_SORT_PARAMETRIC_CENTER); }
112 
114 
119  virtual void SetCamera(vtkCamera*);
120  vtkGetObjectMacro(Camera, vtkCamera);
122 
130  vtkProp3D* GetProp3D() { return this->Prop3D; }
131 
133 
138  vtkSetVector3Macro(Vector, double);
139  vtkGetVectorMacro(Vector, double, 3);
141 
143 
149  vtkSetVector3Macro(Origin, double);
150  vtkGetVectorMacro(Origin, double, 3);
152 
154 
160  vtkSetMacro(SortScalars, vtkTypeBool);
161  vtkGetMacro(SortScalars, vtkTypeBool);
162  vtkBooleanMacro(SortScalars, vtkTypeBool);
164 
169  vtkMTimeType GetMTime() override;
170 
171 protected:
174 
176  void ComputeProjectionVector(double direction[3], double origin[3]);
177 
183  double Vector[3];
184  double Origin[3];
186 
187 private:
189  void operator=(const vtkDepthSortPolyData&) = delete;
190 };
191 
192 VTK_ABI_NAMESPACE_END
193 #endif
a virtual camera for 3D rendering
Definition: vtkCamera.h:151
sort poly data along camera view direction
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetDirectionToBackToFront()
Specify the sort method for the polygonal primitives.
virtual void SetCamera(vtkCamera *)
Specify a camera that is used to define a view direction along which the cells are sorted.
void SetDirectionToFrontToBack()
Specify the sort method for the polygonal primitives.
void SetDepthSortModeToParametricCenter()
Specify the point to use when sorting.
vtkMTimeType GetMTime() override
Return MTime also considering the dependent objects: the camera and/or the prop3D.
void SetDepthSortModeToBoundsCenter()
Specify the point to use when sorting.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetDepthSortModeToFirstPoint()
Specify the point to use when sorting.
~vtkDepthSortPolyData() override
void ComputeProjectionVector(double direction[3], double origin[3])
void SetDirectionToSpecifiedVector()
Specify the sort method for the polygonal primitives.
static vtkDepthSortPolyData * New()
Instantiate object.
void SetProp3D(vtkProp3D *)
Specify a transformation matrix (via the vtkProp3D::GetMatrix() method) that is used to include the e...
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:89
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:160
@ direction
Definition: vtkX3D.h:260
int vtkTypeBool
Definition: vtkABI.h:64
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270