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
56 #include "vtkPolyDataAlgorithm.h"
57 
58 class vtkPlaneCollection;
60 class vtkDoubleArray;
61 class vtkIdTypeArray;
62 class vtkCellArray;
63 class vtkPointData;
64 class vtkCellData;
65 class vtkPolygon;
66 class vtkIdList;
67 class vtkCCSEdgeLocator;
68 
69 enum {
73 };
74 
75 class VTKFILTERSGENERAL_EXPORT vtkClipClosedSurface : public vtkPolyDataAlgorithm
76 {
77 public:
78  static vtkClipClosedSurface *New();
80  void PrintSelf(ostream& os, vtkIndent indent) override;
81 
83 
86  virtual void SetClippingPlanes(vtkPlaneCollection *planes);
87  vtkGetObjectMacro(ClippingPlanes,vtkPlaneCollection);
89 
91 
96  vtkSetMacro(Tolerance, double);
97  vtkGetMacro(Tolerance, double);
99 
101 
105  vtkSetMacro(PassPointData, vtkTypeBool);
106  vtkBooleanMacro(PassPointData, vtkTypeBool);
107  vtkGetMacro(PassPointData, vtkTypeBool);
109 
111 
115  vtkSetMacro(GenerateOutline, vtkTypeBool);
116  vtkBooleanMacro(GenerateOutline, vtkTypeBool);
117  vtkGetMacro(GenerateOutline, vtkTypeBool);
119 
121 
125  vtkSetMacro(GenerateFaces, vtkTypeBool);
126  vtkBooleanMacro(GenerateFaces, vtkTypeBool);
127  vtkGetMacro(GenerateFaces, vtkTypeBool);
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);
149  const char *GetScalarModeAsString();
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, vtkTypeBool);
201  vtkBooleanMacro(TriangulationErrorDisplay, vtkTypeBool);
202  vtkGetMacro(TriangulationErrorDisplay, vtkTypeBool);
204 
205 protected:
207  ~vtkClipClosedSurface() override;
208 
210 
211  double Tolerance;
212 
218  double BaseColor[3];
219  double ClipColor[3];
220  double ActivePlaneColor[3];
221 
223 
225 
227  vtkInformation* request, vtkInformationVector** inputVector,
228  vtkInformationVector* outputVector, int requestFromOutputPort,
229  vtkMTimeType* mtime) override;
230 
231  int RequestData(
232  vtkInformation* request, vtkInformationVector** inputVector,
233  vtkInformationVector* outputVector) 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 
335 private:
337  void operator=(const vtkClipClosedSurface&) = delete;
338 };
339 
340 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
VTK_CCS_SCALAR_MODE_NONE
Definition: vtkClipClosedSurface.h:70
VTK_CCS_SCALAR_MODE_COLORS
Definition: vtkClipClosedSurface.h:71
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkPolygon
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:45
vtkX3D::data
Definition: vtkX3D.h:315
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkClipClosedSurface::ActivePlaneId
int ActivePlaneId
Definition: vtkClipClosedSurface.h:216
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:41
vtkClipClosedSurface::SetScalarModeToNone
void SetScalarModeToNone()
Definition: vtkClipClosedSurface.h:142
vtkClipClosedSurface::GenerateFaces
vtkTypeBool GenerateFaces
Definition: vtkClipClosedSurface.h:215
vtkClipClosedSurface::ScalarMode
int ScalarMode
Definition: vtkClipClosedSurface.h:217
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkClipClosedSurface::SetScalarModeToColors
void SetScalarModeToColors()
Definition: vtkClipClosedSurface.h:144
vtkClipClosedSurface::SetScalarModeToLabels
void SetScalarModeToLabels()
Definition: vtkClipClosedSurface.h:146
vtkClipClosedSurface::TriangulationErrorDisplay
vtkTypeBool TriangulationErrorDisplay
Definition: vtkClipClosedSurface.h:222
vtkPolyDataAlgorithm.h
vtkX3D::color
Definition: vtkX3D.h:221
vtkX3D::points
Definition: vtkX3D.h:446
vtkClipClosedSurface::IdList
vtkIdList * IdList
Definition: vtkClipClosedSurface.h:224
vtkClipClosedSurface
Clip a closed surface with a plane collection.
Definition: vtkClipClosedSurface.h:75
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkClipClosedSurface::ClippingPlanes
vtkPlaneCollection * ClippingPlanes
Definition: vtkClipClosedSurface.h:209
vtkClipClosedSurface::GenerateOutline
vtkTypeBool GenerateOutline
Definition: vtkClipClosedSurface.h:214
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkClipClosedSurface::PassPointData
vtkTypeBool PassPointData
Definition: vtkClipClosedSurface.h:213
vtkClipClosedSurface::Tolerance
double Tolerance
Definition: vtkClipClosedSurface.h:211
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkAlgorithm::ComputePipelineMTime
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, vtkMTimeType *mtime)
A special version of ProcessRequest meant specifically for the pipeline modified time request.
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:41
vtkPlaneCollection
maintain a list of planes
Definition: vtkPlaneCollection.h:36
VTK_CCS_SCALAR_MODE_LABELS
Definition: vtkClipClosedSurface.h:72
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44