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 =========================================================================*/
49 #ifndef vtkClipClosedSurface_h
50 #define vtkClipClosedSurface_h
51 
52 #include "vtkFiltersGeneralModule.h" // For export macro
53 #include "vtkPolyDataAlgorithm.h"
54 
55 class vtkPlaneCollection;
57 class vtkDoubleArray;
58 class vtkIdTypeArray;
59 class vtkCellArray;
60 class vtkPointData;
61 class vtkCellData;
62 class vtkPolygon;
63 class vtkIdList;
64 class vtkCCSEdgeLocator;
65 
66 enum {
70 };
71 
72 class VTKFILTERSGENERAL_EXPORT vtkClipClosedSurface : public vtkPolyDataAlgorithm
73 {
74 public:
75  static vtkClipClosedSurface *New();
77  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
80 
83  virtual void SetClippingPlanes(vtkPlaneCollection *planes);
84  vtkGetObjectMacro(ClippingPlanes,vtkPlaneCollection);
86 
88 
93  vtkSetMacro(Tolerance, double);
94  vtkGetMacro(Tolerance, double);
96 
98 
102  vtkSetMacro(PassPointData, vtkTypeBool);
103  vtkBooleanMacro(PassPointData, vtkTypeBool);
104  vtkGetMacro(PassPointData, vtkTypeBool);
106 
108 
112  vtkSetMacro(GenerateOutline, vtkTypeBool);
113  vtkBooleanMacro(GenerateOutline, vtkTypeBool);
114  vtkGetMacro(GenerateOutline, vtkTypeBool);
116 
118 
122  vtkSetMacro(GenerateFaces, vtkTypeBool);
123  vtkBooleanMacro(GenerateFaces, vtkTypeBool);
124  vtkGetMacro(GenerateFaces, vtkTypeBool);
126 
128 
137  vtkSetClampMacro(ScalarMode, int,
140  this->SetScalarMode(VTK_CCS_SCALAR_MODE_NONE); };
142  this->SetScalarMode(VTK_CCS_SCALAR_MODE_COLORS); };
144  this->SetScalarMode(VTK_CCS_SCALAR_MODE_LABELS); };
145  vtkGetMacro(ScalarMode, int);
146  const char *GetScalarModeAsString();
148 
150 
156  vtkSetVector3Macro(BaseColor, double);
157  vtkGetVector3Macro(BaseColor, double);
159 
161 
166  vtkSetVector3Macro(ClipColor, double);
167  vtkGetVector3Macro(ClipColor, double);
169 
171 
176  vtkSetMacro(ActivePlaneId, int);
177  vtkGetMacro(ActivePlaneId, int);
179 
181 
186  vtkSetVector3Macro(ActivePlaneColor, double);
187  vtkGetVector3Macro(ActivePlaneColor, double);
189 
191 
197  vtkSetMacro(TriangulationErrorDisplay, vtkTypeBool);
198  vtkBooleanMacro(TriangulationErrorDisplay, vtkTypeBool);
199  vtkGetMacro(TriangulationErrorDisplay, vtkTypeBool);
201 
202 protected:
204  ~vtkClipClosedSurface() override;
205 
207 
208  double Tolerance;
209 
215  double BaseColor[3];
216  double ClipColor[3];
217  double ActivePlaneColor[3];
218 
220 
222 
224  vtkInformation* request, vtkInformationVector** inputVector,
225  vtkInformationVector* outputVector, int requestFromOutputPort,
226  vtkMTimeType* mtime) override;
227 
228  int RequestData(
229  vtkInformation* request, vtkInformationVector** inputVector,
230  vtkInformationVector* outputVector) override;
231 
235  void ClipLines(
236  vtkPoints *points, vtkDoubleArray *pointScalars,
237  vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator,
238  vtkCellArray *inputCells, vtkCellArray *outputLines,
239  vtkCellData *inCellData, vtkCellData *outLineData);
240 
247  void ClipAndContourPolys(
248  vtkPoints *points, vtkDoubleArray *pointScalars, vtkPointData *pointData,
249  vtkCCSEdgeLocator *edgeLocator, int triangulate,
250  vtkCellArray *inputCells, vtkCellArray *outputPolys,
251  vtkCellArray *outputLines, vtkCellData *inPolyData,
252  vtkCellData *outPolyData, vtkCellData *outLineData);
253 
260  static int InterpolateEdge(
261  vtkPoints *points, vtkPointData *pointData,
262  vtkCCSEdgeLocator *edgeLocator, double tol,
263  vtkIdType i0, vtkIdType i1, double v0, double v1, vtkIdType &i);
264 
270  int TriangulatePolygon(
271  vtkIdList *polygon, vtkPoints *points, vtkCellArray *triangles);
272 
282  void TriangulateContours(
283  vtkPolyData *data, vtkIdType firstLine, vtkIdType numLines,
284  vtkCellArray *outputPolys, const double normal[3]);
285 
292  static void BreakPolylines(
293  vtkCellArray *inputLines, vtkCellArray *outputLines,
294  vtkUnsignedCharArray *inputScalars, vtkIdType firstLineScalar,
295  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
296 
302  static void CopyPolygons(
303  vtkCellArray *inputPolys, vtkCellArray *outputPolys,
304  vtkUnsignedCharArray *inputScalars, vtkIdType firstPolyScalar,
305  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
306 
311  static void BreakTriangleStrips(
312  vtkCellArray *inputStrips, vtkCellArray *outputPolys,
313  vtkUnsignedCharArray *inputScalars, vtkIdType firstStripScalar,
314  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
315 
321  static void SqueezeOutputPoints(
322  vtkPolyData *output, vtkPoints *points, vtkPointData *pointData,
323  int outputPointDataType);
324 
328  static void CreateColorValues(
329  const double color1[3], const double color2[3], const double color3[3],
330  unsigned char colors[3][3]);
331 
332 private:
334  void operator=(const vtkClipClosedSurface&) = delete;
335 };
336 
337 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
VTK_CCS_SCALAR_MODE_NONE
Definition: vtkClipClosedSurface.h:67
VTK_CCS_SCALAR_MODE_COLORS
Definition: vtkClipClosedSurface.h:68
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkPolygon
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:39
vtkX3D::data
Definition: vtkX3D.h:315
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkClipClosedSurface::ActivePlaneId
int ActivePlaneId
Definition: vtkClipClosedSurface.h:213
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkClipClosedSurface::SetScalarModeToNone
void SetScalarModeToNone()
Definition: vtkClipClosedSurface.h:139
vtkClipClosedSurface::GenerateFaces
vtkTypeBool GenerateFaces
Definition: vtkClipClosedSurface.h:212
vtkClipClosedSurface::ScalarMode
int ScalarMode
Definition: vtkClipClosedSurface.h:214
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:141
vtkClipClosedSurface::SetScalarModeToLabels
void SetScalarModeToLabels()
Definition: vtkClipClosedSurface.h:143
vtkClipClosedSurface::TriangulationErrorDisplay
vtkTypeBool TriangulationErrorDisplay
Definition: vtkClipClosedSurface.h:219
vtkPolyDataAlgorithm.h
vtkX3D::color
Definition: vtkX3D.h:221
vtkX3D::points
Definition: vtkX3D.h:446
vtkClipClosedSurface::IdList
vtkIdList * IdList
Definition: vtkClipClosedSurface.h:221
vtkClipClosedSurface
Clip a closed surface with a plane collection.
Definition: vtkClipClosedSurface.h:72
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:32
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:44
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkClipClosedSurface::ClippingPlanes
vtkPlaneCollection * ClippingPlanes
Definition: vtkClipClosedSurface.h:206
vtkClipClosedSurface::GenerateOutline
vtkTypeBool GenerateOutline
Definition: vtkClipClosedSurface.h:211
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkClipClosedSurface::PassPointData
vtkTypeBool PassPointData
Definition: vtkClipClosedSurface.h:210
vtkClipClosedSurface::Tolerance
double Tolerance
Definition: vtkClipClosedSurface.h:208
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
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:35
vtkPlaneCollection
maintain a list of planes
Definition: vtkPlaneCollection.h:33
VTK_CCS_SCALAR_MODE_LABELS
Definition: vtkClipClosedSurface.h:69
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:41