VTK  9.4.20251007
vtkClipClosedSurface.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
59
60#ifndef vtkClipClosedSurface_h
61#define vtkClipClosedSurface_h
62
63#include "vtkFiltersGeneralModule.h" // For export macro
65
66VTK_ABI_NAMESPACE_BEGIN
69class vtkDoubleArray;
70class vtkIdTypeArray;
71class vtkCellArray;
72class vtkPointData;
73class vtkCellData;
74class vtkPolygon;
75class vtkIdList;
76class vtkCCSEdgeLocator;
77
78enum
79{
83};
84
85class VTKFILTERSGENERAL_EXPORT vtkClipClosedSurface : public vtkPolyDataAlgorithm
86{
87public:
89
94 void PrintSelf(ostream& os, vtkIndent indent) override;
96
98
104
106
111 vtkSetMacro(Tolerance, double);
112 vtkGetMacro(Tolerance, double);
114
116
121 vtkBooleanMacro(PassPointData, vtkTypeBool);
124
126
131 vtkBooleanMacro(GenerateOutline, vtkTypeBool);
134
136
141 vtkBooleanMacro(GenerateFaces, vtkTypeBool);
144
146
159 vtkGetMacro(ScalarMode, int);
162
164
170 vtkSetVector3Macro(BaseColor, double);
171 vtkGetVector3Macro(BaseColor, double);
173
175
180 vtkSetVector3Macro(ClipColor, double);
181 vtkGetVector3Macro(ClipColor, double);
183
185
190 vtkSetMacro(ActivePlaneId, int);
191 vtkGetMacro(ActivePlaneId, int);
193
195
200 vtkSetVector3Macro(ActivePlaneColor, double);
201 vtkGetVector3Macro(ActivePlaneColor, double);
203
205
215
217
226 vtkSetMacro(InsideOut, vtkTypeBool);
227 vtkGetMacro(InsideOut, vtkTypeBool);
228 vtkBooleanMacro(InsideOut, vtkTypeBool);
230
232
241
246
247protected:
250
252
253 double Tolerance;
254
260 double BaseColor[3];
261 double ClipColor[3];
265
267
269
271 vtkInformationVector* outputVector, int requestFromOutputPort, vtkMTimeType* mtime) override;
272
274 vtkInformationVector* outputVector) override;
275
279 void ClipLines(vtkPoints* points, vtkDoubleArray* pointScalars, vtkPointData* pointData,
280 vtkCCSEdgeLocator* edgeLocator, vtkCellArray* inputCells, vtkCellArray* outputLines,
281 vtkCellData* inCellData, vtkCellData* outLineData);
282
289 void ClipAndContourPolys(vtkPoints* points, vtkDoubleArray* pointScalars, vtkPointData* pointData,
290 vtkCCSEdgeLocator* edgeLocator, int triangulate, vtkCellArray* inputCells,
291 vtkCellArray* outputPolys, vtkCellArray* outputLines, vtkCellData* inCellData,
292 vtkCellData* outPolyData, vtkCellData* outLineData);
293
300 static int InterpolateEdge(vtkPoints* points, vtkPointData* pointData,
301 vtkCCSEdgeLocator* edgeLocator, double tol, vtkIdType i0, vtkIdType i1, double v0, double v1,
302 vtkIdType& i);
303
309 int TriangulatePolygon(vtkIdList* polygon, vtkPoints* points, vtkCellArray* triangles);
310
320 void TriangulateContours(vtkPolyData* data, vtkIdType firstLine, vtkIdType numLines,
321 vtkCellArray* outputPolys, const double normal[3]);
322
329 static void BreakPolylines(vtkCellArray* inputLines, vtkCellArray* outputLines,
330 vtkUnsignedCharArray* inputScalars, vtkIdType firstLineScalar,
331 vtkUnsignedCharArray* outputScalars, const unsigned char color[3]);
332
338 static void CopyPolygons(vtkCellArray* inputPolys, vtkCellArray* outputPolys,
339 vtkUnsignedCharArray* inputScalars, vtkIdType firstPolyScalar,
340 vtkUnsignedCharArray* outputScalars, const unsigned char color[3]);
341
346 static void BreakTriangleStrips(vtkCellArray* inputStrips, vtkCellArray* outputPolys,
347 vtkUnsignedCharArray* inputScalars, vtkIdType firstStripScalar,
348 vtkUnsignedCharArray* outputScalars, const unsigned char color[3]);
349
356 vtkPolyData* output, vtkPoints* points, vtkPointData* pointData, int outputPointDataType);
357
361 static void CreateColorValues(const double color1[3], const double color2[3],
362 const double color3[3], unsigned char colors[3][3]);
363
364private:
366 void operator=(const vtkClipClosedSurface&) = delete;
367};
368
369VTK_ABI_NAMESPACE_END
370#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:32
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.
virtual void SetScalarMode(int)
Set whether to add cell scalars, so that new faces and outlines can be distinguished from original fa...
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...
vtkPolyData * GetClipFaceOutput()
Return the clip face triangulated output.
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:24
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:29
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:30
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
a cell that represents an n-sided polygon
Definition vtkPolygon.h:33
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition vtkABI.h:64
@ VTK_CCS_SCALAR_MODE_NONE
@ VTK_CCS_SCALAR_MODE_LABELS
@ VTK_CCS_SCALAR_MODE_COLORS
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270