VTK  9.2.6
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=========================================================================*/
64#ifndef vtkClipClosedSurface_h
65#define vtkClipClosedSurface_h
66
67#include "vtkFiltersGeneralModule.h" // For export macro
69
72class vtkDoubleArray;
73class vtkIdTypeArray;
74class vtkCellArray;
75class vtkPointData;
76class vtkCellData;
77class vtkPolygon;
78class vtkIdList;
79class vtkCCSEdgeLocator;
80
81enum
82{
86};
87
88class VTKFILTERSGENERAL_EXPORT vtkClipClosedSurface : public vtkPolyDataAlgorithm
89{
90public:
92
97 void PrintSelf(ostream& os, vtkIndent indent) override;
99
101
105 vtkGetObjectMacro(ClippingPlanes, vtkPlaneCollection);
107
109
114 vtkSetMacro(Tolerance, double);
115 vtkGetMacro(Tolerance, double);
117
119
123 vtkSetMacro(PassPointData, vtkTypeBool);
124 vtkBooleanMacro(PassPointData, vtkTypeBool);
125 vtkGetMacro(PassPointData, vtkTypeBool);
127
129
133 vtkSetMacro(GenerateOutline, vtkTypeBool);
134 vtkBooleanMacro(GenerateOutline, vtkTypeBool);
135 vtkGetMacro(GenerateOutline, vtkTypeBool);
137
139
143 vtkSetMacro(GenerateFaces, vtkTypeBool);
144 vtkBooleanMacro(GenerateFaces, vtkTypeBool);
145 vtkGetMacro(GenerateFaces, vtkTypeBool);
147
149
158 vtkSetClampMacro(ScalarMode, int, VTK_CCS_SCALAR_MODE_NONE, VTK_CCS_SCALAR_MODE_LABELS);
159 void SetScalarModeToNone() { this->SetScalarMode(VTK_CCS_SCALAR_MODE_NONE); }
160 void SetScalarModeToColors() { this->SetScalarMode(VTK_CCS_SCALAR_MODE_COLORS); }
161 void SetScalarModeToLabels() { this->SetScalarMode(VTK_CCS_SCALAR_MODE_LABELS); }
162 vtkGetMacro(ScalarMode, int);
165
167
173 vtkSetVector3Macro(BaseColor, double);
174 vtkGetVector3Macro(BaseColor, double);
176
178
183 vtkSetVector3Macro(ClipColor, double);
184 vtkGetVector3Macro(ClipColor, double);
186
188
193 vtkSetMacro(ActivePlaneId, int);
194 vtkGetMacro(ActivePlaneId, int);
196
198
203 vtkSetVector3Macro(ActivePlaneColor, double);
204 vtkGetVector3Macro(ActivePlaneColor, double);
206
208
214 vtkSetMacro(TriangulationErrorDisplay, vtkTypeBool);
215 vtkBooleanMacro(TriangulationErrorDisplay, vtkTypeBool);
216 vtkGetMacro(TriangulationErrorDisplay, vtkTypeBool);
218
219protected:
222
224
225 double Tolerance;
226
232 double BaseColor[3];
233 double ClipColor[3];
234 double ActivePlaneColor[3];
235
237
239
241 vtkInformationVector* outputVector, int requestFromOutputPort, vtkMTimeType* mtime) override;
242
244 vtkInformationVector* outputVector) override;
245
249 void ClipLines(vtkPoints* points, vtkDoubleArray* pointScalars, vtkPointData* pointData,
250 vtkCCSEdgeLocator* edgeLocator, vtkCellArray* inputCells, vtkCellArray* outputLines,
251 vtkCellData* inCellData, vtkCellData* outLineData);
252
259 void ClipAndContourPolys(vtkPoints* points, vtkDoubleArray* pointScalars, vtkPointData* pointData,
260 vtkCCSEdgeLocator* edgeLocator, int triangulate, vtkCellArray* inputCells,
261 vtkCellArray* outputPolys, vtkCellArray* outputLines, vtkCellData* inCellData,
262 vtkCellData* outPolyData, vtkCellData* outLineData);
263
270 static int InterpolateEdge(vtkPoints* points, vtkPointData* pointData,
271 vtkCCSEdgeLocator* edgeLocator, double tol, vtkIdType i0, vtkIdType i1, double v0, double v1,
272 vtkIdType& i);
273
279 int TriangulatePolygon(vtkIdList* polygon, vtkPoints* points, vtkCellArray* triangles);
280
290 void TriangulateContours(vtkPolyData* data, vtkIdType firstLine, vtkIdType numLines,
291 vtkCellArray* outputPolys, const double normal[3]);
292
299 static void BreakPolylines(vtkCellArray* inputLines, vtkCellArray* outputLines,
300 vtkUnsignedCharArray* inputScalars, vtkIdType firstLineScalar,
301 vtkUnsignedCharArray* outputScalars, const unsigned char color[3]);
302
308 static void CopyPolygons(vtkCellArray* inputPolys, vtkCellArray* outputPolys,
309 vtkUnsignedCharArray* inputScalars, vtkIdType firstPolyScalar,
310 vtkUnsignedCharArray* outputScalars, const unsigned char color[3]);
311
316 static void BreakTriangleStrips(vtkCellArray* inputStrips, vtkCellArray* outputPolys,
317 vtkUnsignedCharArray* inputScalars, vtkIdType firstStripScalar,
318 vtkUnsignedCharArray* outputScalars, const unsigned char color[3]);
319
326 vtkPolyData* output, vtkPoints* points, vtkPointData* pointData, int outputPointDataType);
327
331 static void CreateColorValues(const double color1[3], const double color2[3],
332 const double color3[3], unsigned char colors[3][3]);
333
334private:
336 void operator=(const vtkClipClosedSurface&) = delete;
337};
338
339#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:51
Clip a closed surface with a plane collection.
static void BreakTriangleStrips(vtkCellArray *inputStrips, vtkCellArray *outputPolys, vtkUnsignedCharArray *inputScalars, vtkIdType firstStripScalar, vtkUnsignedCharArray *outputScalars, const unsigned char color[3])
Break triangle strips and add the triangles to the output.
static void CopyPolygons(vtkCellArray *inputPolys, vtkCellArray *outputPolys, vtkUnsignedCharArray *inputScalars, vtkIdType firstPolyScalar, vtkUnsignedCharArray *outputScalars, const unsigned char color[3])
Copy polygons and their associated scalars to a new array.
void ClipLines(vtkPoints *points, vtkDoubleArray *pointScalars, vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator, vtkCellArray *inputCells, vtkCellArray *outputLines, vtkCellData *inCellData, vtkCellData *outLineData)
Method for clipping lines and copying the scalar data.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
static void SqueezeOutputPoints(vtkPolyData *output, vtkPoints *points, vtkPointData *pointData, int outputPointDataType)
Squeeze the points and store them in the output.
vtkPlaneCollection * ClippingPlanes
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, obtaining type information, and printing.
void SetScalarModeToLabels()
Set whether to add cell scalars, so that new faces and outlines can be distinguished from original fa...
void SetScalarModeToColors()
Set whether to add cell scalars, so that new faces and outlines can be distinguished from original fa...
virtual void SetClippingPlanes(vtkPlaneCollection *planes)
Set the vtkPlaneCollection that holds the clipping planes.
const char * GetScalarModeAsString()
Set whether to add cell scalars, so that new faces and outlines can be distinguished from original fa...
void TriangulateContours(vtkPolyData *data, vtkIdType firstLine, vtkIdType numLines, vtkCellArray *outputPolys, const double normal[3])
Given some closed contour lines, create a triangle mesh that fills those lines.
static void CreateColorValues(const double color1[3], const double color2[3], const double color3[3], unsigned char colors[3][3])
Take three colors as doubles, and convert to unsigned char.
void SetScalarModeToNone()
Set whether to add cell scalars, so that new faces and outlines can be distinguished from original fa...
int TriangulatePolygon(vtkIdList *polygon, vtkPoints *points, vtkCellArray *triangles)
A robust method for triangulating a polygon.
int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, int requestFromOutputPort, vtkMTimeType *mtime) override
A special version of ProcessRequest meant specifically for the pipeline modified time request.
~vtkClipClosedSurface() override
static vtkClipClosedSurface * New()
Standard methods for instantiation, obtaining type information, and printing.
static int InterpolateEdge(vtkPoints *points, vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator, double tol, vtkIdType i0, vtkIdType i1, double v0, double v1, vtkIdType &i)
A helper function for interpolating a new point along an edge.
static void BreakPolylines(vtkCellArray *inputLines, vtkCellArray *outputLines, vtkUnsignedCharArray *inputScalars, vtkIdType firstLineScalar, vtkUnsignedCharArray *outputScalars, const unsigned char color[3])
Break polylines into individual lines, copying scalar values from inputScalars starting at firstLineS...
void ClipAndContourPolys(vtkPoints *points, vtkDoubleArray *pointScalars, vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator, int triangulate, vtkCellArray *inputCells, vtkCellArray *outputPolys, vtkCellArray *outputLines, vtkCellData *inCellData, vtkCellData *outPolyData, vtkCellData *outLineData)
Clip and contour polys in one step, in order to guarantee that the contour lines exactly match the ne...
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:43
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
maintain a list of planes
represent and manipulate point attribute data
represent and manipulate 3D points
Definition vtkPoints.h:49
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
a cell that represents an n-sided polygon
Definition vtkPolygon.h:52
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition vtkABI.h:69
@ VTK_CCS_SCALAR_MODE_NONE
@ VTK_CCS_SCALAR_MODE_LABELS
@ VTK_CCS_SCALAR_MODE_COLORS
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287