VTK  9.3.1
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
22 #ifndef vtkDepthSortPolyData_h
23 #define vtkDepthSortPolyData_h
24 
25 #include "vtkFiltersHybridModule.h" // For export macro
26 #include "vtkPolyDataAlgorithm.h"
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkCamera;
30 class vtkProp3D;
31 class vtkTransform;
32 
33 class VTKFILTERSHYBRID_EXPORT vtkDepthSortPolyData : public vtkPolyDataAlgorithm
34 {
35 public:
39  static vtkDepthSortPolyData* New();
40 
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45  {
46  VTK_DIRECTION_BACK_TO_FRONT = 0,
47  VTK_DIRECTION_FRONT_TO_BACK = 1,
48  VTK_DIRECTION_SPECIFIED_VECTOR = 2
49  };
50 
52 
56  vtkSetMacro(Direction, int);
57  vtkGetMacro(Direction, int);
58  void SetDirectionToFrontToBack() { this->SetDirection(VTK_DIRECTION_FRONT_TO_BACK); }
59  void SetDirectionToBackToFront() { this->SetDirection(VTK_DIRECTION_BACK_TO_FRONT); }
60  void SetDirectionToSpecifiedVector() { this->SetDirection(VTK_DIRECTION_SPECIFIED_VECTOR); }
62 
63  enum SortMode
64  {
65  VTK_SORT_FIRST_POINT = 0,
66  VTK_SORT_BOUNDS_CENTER = 1,
67  VTK_SORT_PARAMETRIC_CENTER = 2
68  };
69 
71 
77  vtkSetMacro(DepthSortMode, int);
78  vtkGetMacro(DepthSortMode, int);
79  void SetDepthSortModeToFirstPoint() { this->SetDepthSortMode(VTK_SORT_FIRST_POINT); }
80  void SetDepthSortModeToBoundsCenter() { this->SetDepthSortMode(VTK_SORT_BOUNDS_CENTER); }
81  void SetDepthSortModeToParametricCenter() { this->SetDepthSortMode(VTK_SORT_PARAMETRIC_CENTER); }
83 
85 
90  virtual void SetCamera(vtkCamera*);
91  vtkGetObjectMacro(Camera, vtkCamera);
93 
100  void SetProp3D(vtkProp3D*);
101  vtkProp3D* GetProp3D() { return this->Prop3D; }
102 
104 
109  vtkSetVector3Macro(Vector, double);
110  vtkGetVectorMacro(Vector, double, 3);
112 
114 
120  vtkSetVector3Macro(Origin, double);
121  vtkGetVectorMacro(Origin, double, 3);
123 
125 
131  vtkSetMacro(SortScalars, vtkTypeBool);
132  vtkGetMacro(SortScalars, vtkTypeBool);
133  vtkBooleanMacro(SortScalars, vtkTypeBool);
135 
140  vtkMTimeType GetMTime() override;
141 
142 protected:
144  ~vtkDepthSortPolyData() override;
145 
147  void ComputeProjectionVector(double direction[3], double origin[3]);
148 
154  double Vector[3];
155  double Origin[3];
157 
158 private:
160  void operator=(const vtkDepthSortPolyData&) = delete;
161 };
162 
163 VTK_ABI_NAMESPACE_END
164 #endif
void SetDepthSortModeToFirstPoint()
Specify the point to use when sorting.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
sort poly data along camera view direction
void SetDirectionToBackToFront()
Specify the sort method for the polygonal primitives.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:49
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:38
void SetDepthSortModeToBoundsCenter()
Specify the point to use when sorting.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
a virtual camera for 3D rendering
Definition: vtkCamera.h:40
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void SetDirectionToFrontToBack()
Specify the sort method for the polygonal primitives.
Store zero or more vtkInformation instances.
void SetDirectionToSpecifiedVector()
Specify the sort method for the polygonal primitives.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetDepthSortModeToParametricCenter()
Specify the point to use when sorting.