VTK
vtkClipClosedSurface.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkClipClosedSurface.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 =========================================================================*/
42 #ifndef vtkClipClosedSurface_h
43 #define vtkClipClosedSurface_h
44 
45 #include "vtkFiltersGeneralModule.h" // For export macro
46 #include "vtkPolyDataAlgorithm.h"
47 
48 class vtkPlaneCollection;
50 class vtkDoubleArray;
51 class vtkIdTypeArray;
52 class vtkCellArray;
53 class vtkPointData;
54 class vtkCellData;
55 class vtkPolygon;
56 class vtkIdList;
57 class vtkCCSEdgeLocator;
58 
59 enum {
63 };
64 
66 {
67 public:
68  static vtkClipClosedSurface *New();
70  void PrintSelf(ostream& os, vtkIndent indent);
71 
73 
74  virtual void SetClippingPlanes(vtkPlaneCollection *planes);
75  vtkGetObjectMacro(ClippingPlanes,vtkPlaneCollection);
77 
79 
82  vtkSetMacro(Tolerance, double);
83  vtkGetMacro(Tolerance, double);
85 
87 
89  vtkSetMacro(PassPointData, int);
90  vtkBooleanMacro(PassPointData, int);
91  vtkGetMacro(PassPointData, int);
93 
95 
97  vtkSetMacro(GenerateOutline, int);
98  vtkBooleanMacro(GenerateOutline, int);
99  vtkGetMacro(GenerateOutline, int);
101 
103 
105  vtkSetMacro(GenerateFaces, int);
106  vtkBooleanMacro(GenerateFaces, int);
107  vtkGetMacro(GenerateFaces, int);
109 
111 
117  vtkSetClampMacro(ScalarMode, int,
120  this->SetScalarMode(VTK_CCS_SCALAR_MODE_NONE); };
122  this->SetScalarMode(VTK_CCS_SCALAR_MODE_COLORS); };
124  this->SetScalarMode(VTK_CCS_SCALAR_MODE_LABELS); };
125  vtkGetMacro(ScalarMode, int);
126  const char *GetScalarModeAsString();
128 
130 
134  vtkSetVector3Macro(BaseColor, double);
135  vtkGetVector3Macro(BaseColor, double);
137 
139 
142  vtkSetVector3Macro(ClipColor, double);
143  vtkGetVector3Macro(ClipColor, double);
145 
147 
150  vtkSetMacro(ActivePlaneId, int);
151  vtkGetMacro(ActivePlaneId, int);
153 
155 
158  vtkSetVector3Macro(ActivePlaneColor, double);
159  vtkGetVector3Macro(ActivePlaneColor, double);
161 
163 
167  vtkSetMacro(TriangulationErrorDisplay, int);
168  vtkBooleanMacro(TriangulationErrorDisplay, int);
169  vtkGetMacro(TriangulationErrorDisplay, int);
171 
172 protected:
175 
177 
178  double Tolerance;
179 
185  double BaseColor[3];
186  double ClipColor[3];
187  double ActivePlaneColor[3];
188 
190 
192 
193  virtual int ComputePipelineMTime(
194  vtkInformation* request, vtkInformationVector** inputVector,
195  vtkInformationVector* outputVector, int requestFromOutputPort,
196  unsigned long* mtime);
197 
198  virtual int RequestData(
199  vtkInformation* request, vtkInformationVector** inputVector,
200  vtkInformationVector* outputVector);
201 
203 
204  void ClipLines(
205  vtkPoints *points, vtkDoubleArray *pointScalars,
206  vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator,
207  vtkCellArray *inputCells, vtkCellArray *outputLines,
208  vtkCellData *inCellData, vtkCellData *outLineData);
210 
212 
216  void ClipAndContourPolys(
217  vtkPoints *points, vtkDoubleArray *pointScalars, vtkPointData *pointData,
218  vtkCCSEdgeLocator *edgeLocator, int triangulate,
219  vtkCellArray *inputCells, vtkCellArray *outputPolys,
220  vtkCellArray *outputLines, vtkCellData *inPolyData,
221  vtkCellData *outPolyData, vtkCellData *outLineData);
223 
225 
229  static int InterpolateEdge(
230  vtkPoints *points, vtkPointData *pointData,
231  vtkCCSEdgeLocator *edgeLocator, double tol,
232  vtkIdType i0, vtkIdType i1, double v0, double v1, vtkIdType &i);
234 
236 
239  int TriangulatePolygon(
240  vtkIdList *polygon, vtkPoints *points, vtkCellArray *triangles);
242 
244 
251  void TriangulateContours(
252  vtkPolyData *data, vtkIdType firstLine, vtkIdType numLines,
253  vtkCellArray *outputPolys, const double normal[3]);
255 
257 
261  static void BreakPolylines(
262  vtkCellArray *inputLines, vtkCellArray *outputLines,
263  vtkUnsignedCharArray *inputScalars, vtkIdType firstLineScalar,
264  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
266 
268 
271  static void CopyPolygons(
272  vtkCellArray *inputPolys, vtkCellArray *outputPolys,
273  vtkUnsignedCharArray *inputScalars, vtkIdType firstPolyScalar,
274  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
276 
278 
280  static void BreakTriangleStrips(
281  vtkCellArray *inputStrips, vtkCellArray *outputPolys,
282  vtkUnsignedCharArray *inputScalars, vtkIdType firstStripScalar,
283  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
285 
287 
290  static void SqueezeOutputPoints(
291  vtkPolyData *output, vtkPoints *points, vtkPointData *pointData,
292  int outputPointDataType);
294 
296 
297  static void CreateColorValues(
298  const double color1[3], const double color2[3], const double color3[3],
299  unsigned char colors[3][3]);
301 
302 private:
303  vtkClipClosedSurface(const vtkClipClosedSurface&); // Not implemented.
304  void operator=(const vtkClipClosedSurface&); // Not implemented.
305 };
306 
307 #endif
represent and manipulate point attribute data
Definition: vtkPointData.h:36
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
maintain a list of planes
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:247
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:44
#define VTKFILTERSGENERAL_EXPORT
dynamic, self-adjusting array of unsigned char
object to represent cell connectivity
Definition: vtkCellArray.h:49
Store zero or more vtkInformation instances.
vtkPlaneCollection * ClippingPlanes
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, unsigned long *mtime)
represent and manipulate 3D points
Definition: vtkPoints.h:38
Clip a closed surface with a plane collection.