VTK  9.2.6
vtkDepthSortPolyData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDepthSortPolyData.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
43 #ifndef vtkDepthSortPolyData_h
44 #define vtkDepthSortPolyData_h
45 
46 #include "vtkFiltersHybridModule.h" // For export macro
47 #include "vtkPolyDataAlgorithm.h"
48 
49 class vtkCamera;
50 class vtkProp3D;
51 class vtkTransform;
52 
53 class VTKFILTERSHYBRID_EXPORT vtkDepthSortPolyData : public vtkPolyDataAlgorithm
54 {
55 public:
60 
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65  {
66  VTK_DIRECTION_BACK_TO_FRONT = 0,
67  VTK_DIRECTION_FRONT_TO_BACK = 1,
68  VTK_DIRECTION_SPECIFIED_VECTOR = 2
69  };
70 
72 
76  vtkSetMacro(Direction, int);
77  vtkGetMacro(Direction, int);
78  void SetDirectionToFrontToBack() { this->SetDirection(VTK_DIRECTION_FRONT_TO_BACK); }
79  void SetDirectionToBackToFront() { this->SetDirection(VTK_DIRECTION_BACK_TO_FRONT); }
80  void SetDirectionToSpecifiedVector() { this->SetDirection(VTK_DIRECTION_SPECIFIED_VECTOR); }
82 
83  enum SortMode
84  {
85  VTK_SORT_FIRST_POINT = 0,
86  VTK_SORT_BOUNDS_CENTER = 1,
87  VTK_SORT_PARAMETRIC_CENTER = 2
88  };
89 
91 
97  vtkSetMacro(DepthSortMode, int);
98  vtkGetMacro(DepthSortMode, int);
99  void SetDepthSortModeToFirstPoint() { this->SetDepthSortMode(VTK_SORT_FIRST_POINT); }
100  void SetDepthSortModeToBoundsCenter() { this->SetDepthSortMode(VTK_SORT_BOUNDS_CENTER); }
101  void SetDepthSortModeToParametricCenter() { this->SetDepthSortMode(VTK_SORT_PARAMETRIC_CENTER); }
103 
105 
110  virtual void SetCamera(vtkCamera*);
111  vtkGetObjectMacro(Camera, vtkCamera);
113 
121  vtkProp3D* GetProp3D() { return this->Prop3D; }
122 
124 
129  vtkSetVector3Macro(Vector, double);
130  vtkGetVectorMacro(Vector, double, 3);
132 
134 
140  vtkSetVector3Macro(Origin, double);
141  vtkGetVectorMacro(Origin, double, 3);
143 
145 
151  vtkSetMacro(SortScalars, vtkTypeBool);
152  vtkGetMacro(SortScalars, vtkTypeBool);
153  vtkBooleanMacro(SortScalars, vtkTypeBool);
155 
160  vtkMTimeType GetMTime() override;
161 
162 protected:
165 
167  void ComputeProjectionVector(double direction[3], double origin[3]);
168 
174  double Vector[3];
175  double Origin[3];
177 
178 private:
180  void operator=(const vtkDepthSortPolyData&) = delete;
181 };
182 
183 #endif
a virtual camera for 3D rendering
Definition: vtkCamera.h:61
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:49
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:59
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:70
@ direction
Definition: vtkX3D.h:266
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287