Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkCapPolyData.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Kyle Sunderland, PerkLab, Queen's University
16 and was supported in part through NIH grant R01 HL153166.
17
18==============================================================================*/
30
31#ifndef vtkCapPolyData_h
32#define vtkCapPolyData_h
33
34 // VTK includes
35#include <vtkAppendPolyData.h>
36#include <vtkImplicitFunction.h>
37#include <vtkPolyDataAlgorithm.h>
38
39// MRML includes
40#include "vtkMRML.h"
41
42class vtkPlaneCollection;
43
44class VTK_MRML_EXPORT vtkCapPolyData : public vtkPolyDataAlgorithm
45{
46public:
47 vtkTypeMacro(vtkCapPolyData, vtkPolyDataAlgorithm);
48 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
57 vtkSetMacro(ClipFunction, vtkSmartPointer<vtkImplicitFunction>);
58 vtkGetMacro(ClipFunction, vtkSmartPointer<vtkImplicitFunction>);
60
62 vtkMTimeType GetMTime() override;
63
65 static void GetPlanes(vtkImplicitFunction* function, vtkPlaneCollection* planes, vtkAbstractTransform* parentTransform = nullptr);
66
68
72 vtkSetMacro(GenerateOutline, bool);
73 vtkGetMacro(GenerateOutline, bool);
75
77
83 vtkSetMacro(GenerateCellTypeScalars, bool);
84 vtkGetMacro(GenerateCellTypeScalars, bool);
86
87protected:
89 ~vtkCapPolyData() override;
90
92 void CreateEndCap(vtkPlaneCollection* planes, vtkPolyData* originalPolyData,
93 vtkImplicitFunction* cutFunction, vtkPolyData* outputEndCap);
94
96 void UpdateCellTypeArray(vtkPolyData* polyData);
97
98 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
99
100protected:
101
102 vtkSmartPointer<vtkImplicitFunction> ClipFunction;
103
104 bool GenerateOutline{ true };
106
107private:
108 vtkCapPolyData(const vtkCapPolyData&) = delete;
109 void operator=(const vtkCapPolyData&) = delete;
110};
111#endif
Filter to generate an end cap for a polydata cut with the specified function.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void PrintSelf(ostream &os, vtkIndent indent) override
void CreateEndCap(vtkPlaneCollection *planes, vtkPolyData *originalPolyData, vtkImplicitFunction *cutFunction, vtkPolyData *outputEndCap)
Generate the end cap for the input polydata cut using planes in the cutFunction.
vtkSmartPointer< vtkImplicitFunction > ClipFunction
void UpdateCellTypeArray(vtkPolyData *polyData)
Updates the polydata cell scalar array to reflect the cell type.
vtkMTimeType GetMTime() override
Return the mtime also considering the locator and clip function.
static vtkCapPolyData * New()
static void GetPlanes(vtkImplicitFunction *function, vtkPlaneCollection *planes, vtkAbstractTransform *parentTransform=nullptr)
Get the list of planes from the implicit function.
~vtkCapPolyData() override