VTK
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 =========================================================================*/
31 #ifndef vtkDepthSortPolyData_h
32 #define vtkDepthSortPolyData_h
33 
34 #include "vtkFiltersHybridModule.h" // For export macro
35 #include "vtkPolyDataAlgorithm.h"
36 
37 class vtkCamera;
38 class vtkProp3D;
39 class vtkTransform;
40 
41 class VTKFILTERSHYBRID_EXPORT vtkDepthSortPolyData : public vtkPolyDataAlgorithm
42 {
43 public:
47  static vtkDepthSortPolyData* New();
48 
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53  {
54  VTK_DIRECTION_BACK_TO_FRONT = 0,
55  VTK_DIRECTION_FRONT_TO_BACK = 1,
56  VTK_DIRECTION_SPECIFIED_VECTOR = 2
57  };
58 
60 
64  vtkSetMacro(Direction, int);
65  vtkGetMacro(Direction, int);
66  void SetDirectionToFrontToBack() { this->SetDirection(VTK_DIRECTION_FRONT_TO_BACK); }
67  void SetDirectionToBackToFront() { this->SetDirection(VTK_DIRECTION_BACK_TO_FRONT); }
68  void SetDirectionToSpecifiedVector() { this->SetDirection(VTK_DIRECTION_SPECIFIED_VECTOR); }
70 
71  enum SortMode
72  {
73  VTK_SORT_FIRST_POINT = 0,
74  VTK_SORT_BOUNDS_CENTER = 1,
75  VTK_SORT_PARAMETRIC_CENTER = 2
76  };
77 
79 
85  vtkSetMacro(DepthSortMode, int);
86  vtkGetMacro(DepthSortMode, int);
87  void SetDepthSortModeToFirstPoint() { this->SetDepthSortMode(VTK_SORT_FIRST_POINT); }
88  void SetDepthSortModeToBoundsCenter() { this->SetDepthSortMode(VTK_SORT_BOUNDS_CENTER); }
89  void SetDepthSortModeToParametricCenter() { this->SetDepthSortMode(VTK_SORT_PARAMETRIC_CENTER); }
91 
93 
98  virtual void SetCamera(vtkCamera*);
99  vtkGetObjectMacro(Camera, vtkCamera);
101 
108  void SetProp3D(vtkProp3D*);
109  vtkProp3D* GetProp3D() { return this->Prop3D; }
110 
112 
117  vtkSetVector3Macro(Vector, double);
118  vtkGetVectorMacro(Vector, double, 3);
120 
122 
128  vtkSetVector3Macro(Origin, double);
129  vtkGetVectorMacro(Origin, double, 3);
131 
133 
139  vtkSetMacro(SortScalars, vtkTypeBool);
140  vtkGetMacro(SortScalars, vtkTypeBool);
141  vtkBooleanMacro(SortScalars, vtkTypeBool);
143 
148  vtkMTimeType GetMTime() override;
149 
150 protected:
152  ~vtkDepthSortPolyData() override;
153 
155  void ComputeProjectionVector(double vector[3], double origin[3]);
156 
162  double Vector[3];
163  double Origin[3];
165 
166 private:
168  void operator=(const vtkDepthSortPolyData&) = delete;
169 };
170 
171 #endif
vtkDepthSortPolyData::SetDepthSortModeToBoundsCenter
void SetDepthSortModeToBoundsCenter()
Definition: vtkDepthSortPolyData.h:88
vtkX3D::vector
Definition: vtkX3D.h:243
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkDepthSortPolyData
sort poly data along camera view direction
Definition: vtkDepthSortPolyData.h:41
vtkDepthSortPolyData::SetDirectionToFrontToBack
void SetDirectionToFrontToBack()
Definition: vtkDepthSortPolyData.h:66
vtkDepthSortPolyData::SetDirectionToBackToFront
void SetDirectionToBackToFront()
Definition: vtkDepthSortPolyData.h:67
vtkDepthSortPolyData::GetProp3D
vtkProp3D * GetProp3D()
Definition: vtkDepthSortPolyData.h:109
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDepthSortPolyData::Transform
vtkTransform * Transform
Definition: vtkDepthSortPolyData.h:161
vtkPolyDataAlgorithm.h
vtkDepthSortPolyData::DepthSortMode
int DepthSortMode
Definition: vtkDepthSortPolyData.h:158
vtkDepthSortPolyData::Camera
vtkCamera * Camera
Definition: vtkDepthSortPolyData.h:159
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkDepthSortPolyData::Prop3D
vtkProp3D * Prop3D
Definition: vtkDepthSortPolyData.h:160
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkDepthSortPolyData::Direction
int Direction
Definition: vtkDepthSortPolyData.h:157
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:45
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkDepthSortPolyData::SortScalars
vtkTypeBool SortScalars
Definition: vtkDepthSortPolyData.h:164
vtkDepthSortPolyData::SortMode
SortMode
Definition: vtkDepthSortPolyData.h:71
vtkDepthSortPolyData::Directions
Directions
Definition: vtkDepthSortPolyData.h:52
vtkDepthSortPolyData::SetDepthSortModeToParametricCenter
void SetDepthSortModeToParametricCenter()
Definition: vtkDepthSortPolyData.h:89
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkDepthSortPolyData::SetDepthSortModeToFirstPoint
void SetDepthSortModeToFirstPoint()
Definition: vtkDepthSortPolyData.h:87
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41
vtkDepthSortPolyData::SetDirectionToSpecifiedVector
void SetDirectionToSpecifiedVector()
Definition: vtkDepthSortPolyData.h:68