VTK  9.1.0
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 =========================================================================*/
60 #ifndef vtkDepthSortPolyData_h
61 #define vtkDepthSortPolyData_h
62 
63 #include "vtkFiltersHybridModule.h" // For export macro
64 #include "vtkPolyDataAlgorithm.h"
65 
66 class vtkCamera;
67 class vtkProp3D;
68 class vtkTransform;
69 
70 class VTKFILTERSHYBRID_EXPORT vtkDepthSortPolyData : public vtkPolyDataAlgorithm
71 {
72 public:
77 
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
82  {
83  VTK_DIRECTION_BACK_TO_FRONT = 0,
84  VTK_DIRECTION_FRONT_TO_BACK = 1,
85  VTK_DIRECTION_SPECIFIED_VECTOR = 2
86  };
87 
89 
93  vtkSetMacro(Direction, int);
94  vtkGetMacro(Direction, int);
95  void SetDirectionToFrontToBack() { this->SetDirection(VTK_DIRECTION_FRONT_TO_BACK); }
96  void SetDirectionToBackToFront() { this->SetDirection(VTK_DIRECTION_BACK_TO_FRONT); }
97  void SetDirectionToSpecifiedVector() { this->SetDirection(VTK_DIRECTION_SPECIFIED_VECTOR); }
99 
100  enum SortMode
101  {
102  VTK_SORT_FIRST_POINT = 0,
103  VTK_SORT_BOUNDS_CENTER = 1,
104  VTK_SORT_PARAMETRIC_CENTER = 2
105  };
106 
108 
114  vtkSetMacro(DepthSortMode, int);
115  vtkGetMacro(DepthSortMode, int);
116  void SetDepthSortModeToFirstPoint() { this->SetDepthSortMode(VTK_SORT_FIRST_POINT); }
117  void SetDepthSortModeToBoundsCenter() { this->SetDepthSortMode(VTK_SORT_BOUNDS_CENTER); }
118  void SetDepthSortModeToParametricCenter() { this->SetDepthSortMode(VTK_SORT_PARAMETRIC_CENTER); }
120 
122 
127  virtual void SetCamera(vtkCamera*);
128  vtkGetObjectMacro(Camera, vtkCamera);
130 
138  vtkProp3D* GetProp3D() { return this->Prop3D; }
139 
141 
146  vtkSetVector3Macro(Vector, double);
147  vtkGetVectorMacro(Vector, double, 3);
149 
151 
157  vtkSetVector3Macro(Origin, double);
158  vtkGetVectorMacro(Origin, double, 3);
160 
162 
168  vtkSetMacro(SortScalars, vtkTypeBool);
169  vtkGetMacro(SortScalars, vtkTypeBool);
170  vtkBooleanMacro(SortScalars, vtkTypeBool);
172 
177  vtkMTimeType GetMTime() override;
178 
179 protected:
182 
184  void ComputeProjectionVector(double direction[3], double origin[3]);
185 
191  double Vector[3];
192  double Origin[3];
194 
195 private:
197  void operator=(const vtkDepthSortPolyData&) = delete;
198 };
199 
200 #endif
vtkDepthSortPolyData::SetDepthSortModeToBoundsCenter
void SetDepthSortModeToBoundsCenter()
Specify the point to use when sorting.
Definition: vtkDepthSortPolyData.h:117
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:93
vtkX3D::direction
@ direction
Definition: vtkX3D.h:266
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkDepthSortPolyData
sort poly data along camera view direction
Definition: vtkDepthSortPolyData.h:71
vtkDepthSortPolyData::ComputeProjectionVector
void ComputeProjectionVector(double direction[3], double origin[3])
vtkDepthSortPolyData::SetDirectionToFrontToBack
void SetDirectionToFrontToBack()
Specify the sort method for the polygonal primitives.
Definition: vtkDepthSortPolyData.h:95
vtkDepthSortPolyData::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDepthSortPolyData::SetDirectionToBackToFront
void SetDirectionToBackToFront()
Specify the sort method for the polygonal primitives.
Definition: vtkDepthSortPolyData.h:96
vtkDepthSortPolyData::~vtkDepthSortPolyData
~vtkDepthSortPolyData() override
vtkDepthSortPolyData::GetProp3D
vtkProp3D * GetProp3D()
Definition: vtkDepthSortPolyData.h:138
vtkDepthSortPolyData::vtkDepthSortPolyData
vtkDepthSortPolyData()
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:164
vtkDepthSortPolyData::Transform
vtkTransform * Transform
Definition: vtkDepthSortPolyData.h:190
vtkDepthSortPolyData::New
static vtkDepthSortPolyData * New()
Instantiate object.
vtkPolyDataAlgorithm.h
vtkDepthSortPolyData::GetMTime
vtkMTimeType GetMTime() override
Return MTime also considering the dependent objects: the camera and/or the prop3D.
vtkDepthSortPolyData::DepthSortMode
int DepthSortMode
Definition: vtkDepthSortPolyData.h:187
vtkDepthSortPolyData::Camera
vtkCamera * Camera
Definition: vtkDepthSortPolyData.h:188
vtkDepthSortPolyData::Prop3D
vtkProp3D * Prop3D
Definition: vtkDepthSortPolyData.h:189
vtkDepthSortPolyData::SetCamera
virtual void SetCamera(vtkCamera *)
Specify a camera that is used to define a view direction along which the cells are sorted.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkDepthSortPolyData::Direction
int Direction
Definition: vtkDepthSortPolyData.h:186
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:155
vtkDepthSortPolyData::SetProp3D
void SetProp3D(vtkProp3D *)
Specify a transformation matrix (via the vtkProp3D::GetMatrix() method) that is used to include the e...
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkDepthSortPolyData::SortScalars
vtkTypeBool SortScalars
Definition: vtkDepthSortPolyData.h:193
vtkDepthSortPolyData::SortMode
SortMode
Definition: vtkDepthSortPolyData.h:101
vtkDepthSortPolyData::Directions
Directions
Definition: vtkDepthSortPolyData.h:82
vtkDepthSortPolyData::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkDepthSortPolyData::SetDepthSortModeToParametricCenter
void SetDepthSortModeToParametricCenter()
Specify the point to use when sorting.
Definition: vtkDepthSortPolyData.h:118
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkDepthSortPolyData::SetDepthSortModeToFirstPoint
void SetDepthSortModeToFirstPoint()
Specify the point to use when sorting.
Definition: vtkDepthSortPolyData.h:116
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151
vtkDepthSortPolyData::SetDirectionToSpecifiedVector
void SetDirectionToSpecifiedVector()
Specify the sort method for the polygonal primitives.
Definition: vtkDepthSortPolyData.h:97