VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
36 #ifndef __vtkDepthSortPolyData_h
37 #define __vtkDepthSortPolyData_h
38 
39 #include "vtkFiltersHybridModule.h" // For export macro
40 #include "vtkPolyDataAlgorithm.h"
41 
42 #define VTK_DIRECTION_BACK_TO_FRONT 0
43 #define VTK_DIRECTION_FRONT_TO_BACK 1
44 #define VTK_DIRECTION_SPECIFIED_VECTOR 2
45 
46 #define VTK_SORT_FIRST_POINT 0
47 #define VTK_SORT_BOUNDS_CENTER 1
48 #define VTK_SORT_PARAMETRIC_CENTER 2
49 
50 class vtkCamera;
51 class vtkProp3D;
52 class vtkTransform;
53 
54 class VTKFILTERSHYBRID_EXPORT vtkDepthSortPolyData : public vtkPolyDataAlgorithm
55 {
56 public:
58  static vtkDepthSortPolyData *New();
59 
60  vtkTypeMacro(vtkDepthSortPolyData,vtkPolyDataAlgorithm);
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
66  vtkSetMacro(Direction,int);
67  vtkGetMacro(Direction,int);
69  {this->SetDirection(VTK_DIRECTION_FRONT_TO_BACK);}
71  {this->SetDirection(VTK_DIRECTION_BACK_TO_FRONT);}
73  {this->SetDirection(VTK_DIRECTION_SPECIFIED_VECTOR);}
75 
77 
81  vtkSetMacro(DepthSortMode,int);
82  vtkGetMacro(DepthSortMode,int);
84  {this->SetDepthSortMode(VTK_SORT_FIRST_POINT);}
86  {this->SetDepthSortMode(VTK_SORT_BOUNDS_CENTER);}
88  {this->SetDepthSortMode(VTK_SORT_PARAMETRIC_CENTER);}
90 
92 
95  virtual void SetCamera(vtkCamera*);
96  vtkGetObjectMacro(Camera,vtkCamera);
98 
100 
105  void SetProp3D(vtkProp3D *);
106  vtkProp3D *GetProp3D();
108 
110 
113  vtkSetVector3Macro(Vector,double);
114  vtkGetVectorMacro(Vector,double,3);
116 
118 
122  vtkSetVector3Macro(Origin,double);
123  vtkGetVectorMacro(Origin,double,3);
125 
127 
131  vtkSetMacro(SortScalars, int);
132  vtkGetMacro(SortScalars, int);
133  vtkBooleanMacro(SortScalars, int);
135 
138  unsigned long GetMTime();
139 
140 protected:
143 
144  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
145  void ComputeProjectionVector(double vector[3], double origin[3]);
146 
149  vtkCamera *Camera;
150  vtkProp3D *Prop3D;
151  vtkTransform *Transform;
152  double Vector[3];
153  double Origin[3];
155 
156 private:
157  vtkDepthSortPolyData(const vtkDepthSortPolyData&); // Not implemented.
158  void operator=(const vtkDepthSortPolyData&); // Not implemented.
159 };
160 
161 #endif
#define VTK_SORT_BOUNDS_CENTER
#define VTK_DIRECTION_BACK_TO_FRONT
sort poly data along camera view direction
#define VTK_DIRECTION_FRONT_TO_BACK
#define VTK_SORT_PARAMETRIC_CENTER
#define VTK_SORT_FIRST_POINT
#define VTK_DIRECTION_SPECIFIED_VECTOR