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 =========================================================================*/
42 #ifndef vtkClipClosedSurface_h
43 #define vtkClipClosedSurface_h
44 
45 #include "vtkFiltersGeneralModule.h" // For export macro
46 #include "vtkPolyDataAlgorithm.h"
47 
48 class vtkPlaneCollection;
50 class vtkDoubleArray;
51 class vtkIdTypeArray;
52 class vtkCellArray;
53 class vtkPointData;
54 class vtkCellData;
55 class vtkPolygon;
56 class vtkIdList;
57 class vtkCCSEdgeLocator;
58 
59 enum {
63 };
64 
66 {
67 public:
70  void PrintSelf(ostream& os, vtkIndent indent);
71 
73 
74  virtual void SetClippingPlanes(vtkPlaneCollection *planes);
77 
79 
82  vtkSetMacro(Tolerance, double);
83  vtkGetMacro(Tolerance, double);
85 
87 
89  vtkSetMacro(PassPointData, int);
90  vtkBooleanMacro(PassPointData, int);
91  vtkGetMacro(PassPointData, int);
93 
95 
97  vtkSetMacro(GenerateOutline, int);
98  vtkBooleanMacro(GenerateOutline, int);
99  vtkGetMacro(GenerateOutline, int);
101 
103 
105  vtkSetMacro(GenerateFaces, int);
106  vtkBooleanMacro(GenerateFaces, int);
107  vtkGetMacro(GenerateFaces, int);
109 
111 
117  vtkSetClampMacro(ScalarMode, int,
120  this->SetScalarMode(VTK_CCS_SCALAR_MODE_NONE); };
122  this->SetScalarMode(VTK_CCS_SCALAR_MODE_COLORS); };
124  this->SetScalarMode(VTK_CCS_SCALAR_MODE_LABELS); };
125  vtkGetMacro(ScalarMode, int);
126  const char *GetScalarModeAsString();
128 
130 
134  vtkSetVector3Macro(BaseColor, double);
135  vtkGetVector3Macro(BaseColor, double);
137 
139 
142  vtkSetVector3Macro(ClipColor, double);
143  vtkGetVector3Macro(ClipColor, double);
145 
147 
150  vtkSetMacro(ActivePlaneId, int);
151  vtkGetMacro(ActivePlaneId, int);
153 
155 
158  vtkSetVector3Macro(ActivePlaneColor, double);
159  vtkGetVector3Macro(ActivePlaneColor, double);
161 
163 
167  vtkSetMacro(TriangulationErrorDisplay, int);
168  vtkBooleanMacro(TriangulationErrorDisplay, int);
169  vtkGetMacro(TriangulationErrorDisplay, int);
171 
172 protected:
175 
177 
178  double Tolerance;
179 
185  double BaseColor[3];
186  double ClipColor[3];
187  double ActivePlaneColor[3];
188 
190 
192 
193  virtual int ComputePipelineMTime(
194  vtkInformation* request, vtkInformationVector** inputVector,
195  vtkInformationVector* outputVector, int requestFromOutputPort,
196  unsigned long* mtime);
197 
198  virtual int RequestData(
199  vtkInformation* request, vtkInformationVector** inputVector,
200  vtkInformationVector* outputVector);
201 
203 
204  void ClipLines(
205  vtkPoints *points, vtkDoubleArray *pointScalars,
206  vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator,
207  vtkCellArray *inputCells, vtkCellArray *outputLines,
208  vtkCellData *inCellData, vtkCellData *outLineData);
210 
212 
217  vtkPoints *points, vtkDoubleArray *pointScalars, vtkPointData *pointData,
218  vtkCCSEdgeLocator *edgeLocator, int triangulate,
219  vtkCellArray *inputCells, vtkCellArray *outputPolys,
220  vtkCellArray *outputLines, vtkCellData *inPolyData,
221  vtkCellData *outPolyData, vtkCellData *outLineData);
223 
225 
229  static int InterpolateEdge(
230  vtkPoints *points, vtkPointData *pointData,
231  vtkCCSEdgeLocator *edgeLocator, double tol,
232  vtkIdType i0, vtkIdType i1, double v0, double v1, vtkIdType &i);
234 
236 
240  vtkIdList *polygon, vtkPoints *points, vtkCellArray *triangles);
242 
244 
252  vtkPolyData *data, vtkIdType firstLine, vtkIdType numLines,
253  vtkCellArray *outputPolys, const double normal[3]);
255 
257 
261  static void BreakPolylines(
262  vtkCellArray *inputLines, vtkCellArray *outputLines,
263  vtkUnsignedCharArray *inputScalars, vtkIdType firstLineScalar,
264  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
266 
268 
271  static void CopyPolygons(
272  vtkCellArray *inputPolys, vtkCellArray *outputPolys,
273  vtkUnsignedCharArray *inputScalars, vtkIdType firstPolyScalar,
274  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
276 
278 
280  static void BreakTriangleStrips(
281  vtkCellArray *inputStrips, vtkCellArray *outputPolys,
282  vtkUnsignedCharArray *inputScalars, vtkIdType firstStripScalar,
283  vtkUnsignedCharArray *outputScalars, const unsigned char color[3]);
285 
287 
290  static void SqueezeOutputPoints(
291  vtkPolyData *output, vtkPoints *points, vtkPointData *pointData,
292  int outputPointDataType);
294 
296 
297  static void CreateColorValues(
298  const double color1[3], const double color2[3], const double color3[3],
299  unsigned char colors[3][3]);
301 
302 private:
303  vtkClipClosedSurface(const vtkClipClosedSurface&); // Not implemented.
304  void operator=(const vtkClipClosedSurface&); // Not implemented.
305 };
306 
307 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
VTK_CCS_SCALAR_MODE_NONE
@ VTK_CCS_SCALAR_MODE_NONE
Definition: vtkClipClosedSurface.h:60
vtkClipClosedSurface::GenerateFaces
int GenerateFaces
Definition: vtkClipClosedSurface.h:182
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
VTK_CCS_SCALAR_MODE_COLORS
@ VTK_CCS_SCALAR_MODE_COLORS
Definition: vtkClipClosedSurface.h:61
vtkClipClosedSurface::New
static vtkClipClosedSurface * New()
vtkClipClosedSurface::SetClippingPlanes
virtual void SetClippingPlanes(vtkPlaneCollection *planes)
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkClipClosedSurface::GenerateOutline
int GenerateOutline
Definition: vtkClipClosedSurface.h:181
vtkPolygon
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:45
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkClipClosedSurface::ActivePlaneId
int ActivePlaneId
Definition: vtkClipClosedSurface.h:183
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkClipClosedSurface::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkClipClosedSurface::SetScalarModeToNone
void SetScalarModeToNone()
Definition: vtkClipClosedSurface.h:119
vtkClipClosedSurface::ScalarMode
int ScalarMode
Definition: vtkClipClosedSurface.h:184
vtkgl::points
GLsizei const GLfloat * points
Definition: vtkgl.h:14786
vtkgl::v1
GLfloat GLfloat v1
Definition: vtkgl.h:12014
vtkClipClosedSurface::SetScalarModeToColors
void SetScalarModeToColors()
Definition: vtkClipClosedSurface.h:121
vtkClipClosedSurface::ClipAndContourPolys
void ClipAndContourPolys(vtkPoints *points, vtkDoubleArray *pointScalars, vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator, int triangulate, vtkCellArray *inputCells, vtkCellArray *outputPolys, vtkCellArray *outputLines, vtkCellData *inPolyData, vtkCellData *outPolyData, vtkCellData *outLineData)
vtkClipClosedSurface::SetScalarModeToLabels
void SetScalarModeToLabels()
Definition: vtkClipClosedSurface.h:123
vtkClipClosedSurface::BreakTriangleStrips
static void BreakTriangleStrips(vtkCellArray *inputStrips, vtkCellArray *outputPolys, vtkUnsignedCharArray *inputScalars, vtkIdType firstStripScalar, vtkUnsignedCharArray *outputScalars, const unsigned char color[3])
vtkPolyDataAlgorithm.h
vtkClipClosedSurface::PassPointData
int PassPointData
Definition: vtkClipClosedSurface.h:180
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkClipClosedSurface::IdList
vtkIdList * IdList
Definition: vtkClipClosedSurface.h:191
vtkClipClosedSurface::SqueezeOutputPoints
static void SqueezeOutputPoints(vtkPolyData *output, vtkPoints *points, vtkPointData *pointData, int outputPointDataType)
vtkClipClosedSurface
Clip a closed surface with a plane collection.
Definition: vtkClipClosedSurface.h:66
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkClipClosedSurface::InterpolateEdge
static int InterpolateEdge(vtkPoints *points, vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator, double tol, vtkIdType i0, vtkIdType i1, double v0, double v1, vtkIdType &i)
vtkClipClosedSurface::ComputePipelineMTime
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, int requestFromOutputPort, unsigned long *mtime)
vtkClipClosedSurface::TriangulateContours
void TriangulateContours(vtkPolyData *data, vtkIdType firstLine, vtkIdType numLines, vtkCellArray *outputPolys, const double normal[3])
vtkFiltersGeneralModule.h
vtkClipClosedSurface::GetScalarModeAsString
const char * GetScalarModeAsString()
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
vtkClipClosedSurface::TriangulatePolygon
int TriangulatePolygon(vtkIdList *polygon, vtkPoints *points, vtkCellArray *triangles)
vtkClipClosedSurface::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
VTKFILTERSGENERAL_EXPORT
#define VTKFILTERSGENERAL_EXPORT
Definition: vtkFiltersGeneralModule.h:15
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkgl::color
GLuint color
Definition: vtkgl.h:12351
vtkClipClosedSurface::ClippingPlanes
vtkPlaneCollection * ClippingPlanes
Definition: vtkClipClosedSurface.h:176
vtkClipClosedSurface::TriangulationErrorDisplay
int TriangulationErrorDisplay
Definition: vtkClipClosedSurface.h:189
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkClipClosedSurface::Tolerance
double Tolerance
Definition: vtkClipClosedSurface.h:178
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:49
vtkClipClosedSurface::CreateColorValues
static void CreateColorValues(const double color1[3], const double color2[3], const double color3[3], unsigned char colors[3][3])
vtkClipClosedSurface::CopyPolygons
static void CopyPolygons(vtkCellArray *inputPolys, vtkCellArray *outputPolys, vtkUnsignedCharArray *inputScalars, vtkIdType firstPolyScalar, vtkUnsignedCharArray *outputScalars, const unsigned char color[3])
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkClipClosedSurface::vtkClipClosedSurface
vtkClipClosedSurface()
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkPlaneCollection
maintain a list of planes
Definition: vtkPlaneCollection.h:36
vtkClipClosedSurface::~vtkClipClosedSurface
~vtkClipClosedSurface()
VTK_CCS_SCALAR_MODE_LABELS
@ VTK_CCS_SCALAR_MODE_LABELS
Definition: vtkClipClosedSurface.h:62
vtkgl::v0
GLfloat v0
Definition: vtkgl.h:12013
vtkClipClosedSurface::ClipLines
void ClipLines(vtkPoints *points, vtkDoubleArray *pointScalars, vtkPointData *pointData, vtkCCSEdgeLocator *edgeLocator, vtkCellArray *inputCells, vtkCellArray *outputLines, vtkCellData *inCellData, vtkCellData *outLineData)
vtkClipClosedSurface::BreakPolylines
static void BreakPolylines(vtkCellArray *inputLines, vtkCellArray *outputLines, vtkUnsignedCharArray *inputScalars, vtkIdType firstLineScalar, vtkUnsignedCharArray *outputScalars, const unsigned char color[3])
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44