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=========================================================================*/
52#ifndef vtkClipClosedSurface_h
53#define vtkClipClosedSurface_h
54
55#include "vtkFiltersGeneralModule.h" // For export macro
57
60class vtkDoubleArray;
61class vtkIdTypeArray;
62class vtkCellArray;
63class vtkPointData;
64class vtkCellData;
65class vtkPolygon;
66class vtkIdList;
67class vtkCCSEdgeLocator;
68
69enum {
73};
74
75class VTKFILTERSGENERAL_EXPORT vtkClipClosedSurface : public vtkPolyDataAlgorithm
76{
77public:
80 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
81
83
87 vtkGetObjectMacro(ClippingPlanes,vtkPlaneCollection);
89
91
96 vtkSetMacro(Tolerance, double);
97 vtkGetMacro(Tolerance, double);
99
101
105 vtkSetMacro(PassPointData, int);
106 vtkBooleanMacro(PassPointData, int);
107 vtkGetMacro(PassPointData, int);
109
111
115 vtkSetMacro(GenerateOutline, int);
116 vtkBooleanMacro(GenerateOutline, int);
117 vtkGetMacro(GenerateOutline, int);
119
121
125 vtkSetMacro(GenerateFaces, int);
126 vtkBooleanMacro(GenerateFaces, int);
127 vtkGetMacro(GenerateFaces, int);
129
131
140 vtkSetClampMacro(ScalarMode, int,
143 this->SetScalarMode(VTK_CCS_SCALAR_MODE_NONE); };
145 this->SetScalarMode(VTK_CCS_SCALAR_MODE_COLORS); };
147 this->SetScalarMode(VTK_CCS_SCALAR_MODE_LABELS); };
148 vtkGetMacro(ScalarMode, int);
151
153
159 vtkSetVector3Macro(BaseColor, double);
160 vtkGetVector3Macro(BaseColor, double);
162
164
169 vtkSetVector3Macro(ClipColor, double);
170 vtkGetVector3Macro(ClipColor, double);
172
174
179 vtkSetMacro(ActivePlaneId, int);
180 vtkGetMacro(ActivePlaneId, int);
182
184
189 vtkSetVector3Macro(ActivePlaneColor, double);
190 vtkGetVector3Macro(ActivePlaneColor, double);
192
194
200 vtkSetMacro(TriangulationErrorDisplay, int);
201 vtkBooleanMacro(TriangulationErrorDisplay, int);
202 vtkGetMacro(TriangulationErrorDisplay, int);
204
205protected:
207 ~vtkClipClosedSurface() VTK_OVERRIDE;
208
209 vtkPlaneCollection *ClippingPlanes;
210
211 double Tolerance;
212
213 int PassPointData;
214 int GenerateOutline;
215 int GenerateFaces;
216 int ActivePlaneId;
217 int ScalarMode;
218 double BaseColor[3];
219 double ClipColor[3];
220 double ActivePlaneColor[3];
221
222 int TriangulationErrorDisplay;
223
224 vtkIdList *IdList;
225
226 int ComputePipelineMTime(
227 vtkInformation* request, vtkInformationVector** inputVector,
228 vtkInformationVector* outputVector, int requestFromOutputPort,
229 vtkMTimeType* mtime) VTK_OVERRIDE;
230
231 int RequestData(
232 vtkInformation* request, vtkInformationVector** inputVector,
233 vtkInformationVector* outputVector) VTK_OVERRIDE;
234
238 void ClipLines(
239 vtkPoints *points, vtkDoubleArray *pointScalars,
240 vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator,
241 vtkCellArray *inputCells, vtkCellArray *outputLines,
242 vtkCellData *inCellData, vtkCellData *outLineData);
243
250 void ClipAndContourPolys(
251 vtkPoints *points, vtkDoubleArray *pointScalars, vtkPointData *pointData,
252 vtkCCSEdgeLocator *edgeLocator, int triangulate,
253 vtkCellArray *inputCells, vtkCellArray *outputPolys,
254 vtkCellArray *outputLines, vtkCellData *inPolyData,
255 vtkCellData *outPolyData, vtkCellData *outLineData);
256
263 static int InterpolateEdge(
264 vtkPoints *points, vtkPointData *pointData,
265 vtkCCSEdgeLocator *edgeLocator, double tol,
266 vtkIdType i0, vtkIdType i1, double v0, double v1, vtkIdType &i);
267
273 int TriangulatePolygon(
274 vtkIdList *polygon, vtkPoints *points, vtkCellArray *triangles);
275
285 void TriangulateContours(
286 vtkPolyData *data, vtkIdType firstLine, vtkIdType numLines,
287 vtkCellArray *outputPolys, const double normal[3]);
288
295 static void BreakPolylines(
296 vtkCellArray *inputLines, vtkCellArray *outputLines,
297 vtkUnsignedCharArray *inputScalars, vtkIdType firstLineScalar,
298 vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
299
305 static void CopyPolygons(
306 vtkCellArray *inputPolys, vtkCellArray *outputPolys,
307 vtkUnsignedCharArray *inputScalars, vtkIdType firstPolyScalar,
308 vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
309
314 static void BreakTriangleStrips(
315 vtkCellArray *inputStrips, vtkCellArray *outputPolys,
316 vtkUnsignedCharArray *inputScalars, vtkIdType firstStripScalar,
317 vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
318
324 static void SqueezeOutputPoints(
325 vtkPolyData *output, vtkPoints *points, vtkPointData *pointData,
326 int outputPointDataType);
327
331 static void CreateColorValues(
332 const double color1[3], const double color2[3], const double color3[3],
333 unsigned char colors[3][3]);
334
335private:
336 vtkClipClosedSurface(const vtkClipClosedSurface&) VTK_DELETE_FUNCTION;
337 void operator=(const vtkClipClosedSurface&) VTK_DELETE_FUNCTION;
338};
339
340#endif
object to represent cell connectivity
Definition: vtkCellArray.h:51
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
Clip a closed surface with a plane collection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetClippingPlanes(vtkPlaneCollection *planes)
Set the vtkPlaneCollection that holds the clipping planes.
const char * GetScalarModeAsString()
~vtkClipClosedSurface() override
static vtkClipClosedSurface * New()
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:37
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
maintain a list of planes
represent and manipulate point attribute data
Definition: vtkPointData.h:38
represent and manipulate 3D points
Definition: vtkPoints.h:40
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:46
dynamic, self-adjusting array of unsigned char
@ points
Definition: vtkX3D.h:446
@ color
Definition: vtkX3D.h:221
@ data
Definition: vtkX3D.h:315
@ VTK_CCS_SCALAR_MODE_NONE
@ VTK_CCS_SCALAR_MODE_LABELS
@ VTK_CCS_SCALAR_MODE_COLORS
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248