VTK  9.1.0
vtkPlaneCutter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlaneCutter.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 =========================================================================*/
62 #ifndef vtkPlaneCutter_h
63 #define vtkPlaneCutter_h
64 
65 #include "vtkDataObjectAlgorithm.h"
66 #include "vtkFiltersCoreModule.h" // For export macro
67 #include "vtkSmartPointer.h" // For SmartPointer
68 #include <map> // For std::map
69 
70 class vtkCellArray;
71 class vtkCellData;
72 class vtkImageData;
74 class vtkPlane;
75 class vtkPointData;
76 class vtkPoints;
77 class vtkSphereTree;
78 class vtkStructuredGrid;
80 
81 class VTKFILTERSCORE_EXPORT vtkPlaneCutter : public vtkDataObjectAlgorithm
82 {
83 public:
85 
88  static vtkPlaneCutter* New();
90  void PrintSelf(ostream& os, vtkIndent indent) override;
92 
96  vtkMTimeType GetMTime() override;
97 
99 
104  virtual void SetPlane(vtkPlane*);
105  vtkGetObjectMacro(Plane, vtkPlane);
107 
109 
115  vtkSetMacro(ComputeNormals, bool);
116  vtkGetMacro(ComputeNormals, bool);
117  vtkBooleanMacro(ComputeNormals, bool);
119 
121 
126  vtkSetMacro(InterpolateAttributes, bool);
127  vtkGetMacro(InterpolateAttributes, bool);
128  vtkBooleanMacro(InterpolateAttributes, bool);
130 
132 
137  vtkSetMacro(GeneratePolygons, bool);
138  vtkGetMacro(GeneratePolygons, bool);
139  vtkBooleanMacro(GeneratePolygons, bool);
141 
143 
149  vtkSetMacro(BuildTree, bool);
150  vtkGetMacro(BuildTree, bool);
151  vtkBooleanMacro(BuildTree, bool);
153 
155 
161  vtkSetMacro(BuildHierarchy, bool);
162  vtkGetMacro(BuildHierarchy, bool);
163  vtkBooleanMacro(BuildHierarchy, bool);
165 
166 protected:
168  ~vtkPlaneCutter() override;
169 
174  bool BuildTree;
176 
177  // Helpers
179  std::map<vtkDataSet*, vtkSmartPointer<vtkSphereTree>> SphereTrees;
180 
181  // Pipeline-related methods
187 
188  virtual int ExecuteDataSet(vtkDataSet* input, vtkSphereTree* tree, vtkMultiPieceDataSet* output);
189 
190  static void AddNormalArray(double* planeNormal, vtkDataSet* ds);
192 
193 private:
194  vtkPlaneCutter(const vtkPlaneCutter&) = delete;
195  void operator=(const vtkPlaneCutter&) = delete;
196 };
197 
198 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkPlaneCutter::~vtkPlaneCutter
~vtkPlaneCutter() override
vtkPlaneCutter::vtkPlaneCutter
vtkPlaneCutter()
vtkPlane
perform various plane computations
Definition: vtkPlane.h:143
vtkPlaneCutter::Plane
vtkPlane * Plane
Definition: vtkPlaneCutter.h:170
vtkPlaneCutter::BuildHierarchy
bool BuildHierarchy
Definition: vtkPlaneCutter.h:175
vtkMultiPieceDataSet
composite dataset to encapsulates pieces of dataset.
Definition: vtkMultiPieceDataSet.h:41
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:142
vtkPlaneCutter::BuildTree
bool BuildTree
Definition: vtkPlaneCutter.h:174
vtkPlaneCutter::ComputeNormals
bool ComputeNormals
Definition: vtkPlaneCutter.h:171
vtkPlaneCutter::ExecuteDataSet
virtual int ExecuteDataSet(vtkDataSet *input, vtkSphereTree *tree, vtkMultiPieceDataSet *output)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkDataObjectAlgorithm
Superclass for algorithms that produce only data object as output.
Definition: vtkDataObjectAlgorithm.h:63
vtkPlaneCutter::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkStructuredGrid
topologically regular array of data
Definition: vtkStructuredGrid.h:167
vtkPlaneCutter::SphereTrees
std::map< vtkDataSet *, vtkSmartPointer< vtkSphereTree > > SphereTrees
Definition: vtkPlaneCutter.h:179
vtkPlaneCutter::InitializeOutput
static void InitializeOutput(vtkMultiPieceDataSet *output)
vtkPlaneCutter::InterpolateAttributes
bool InterpolateAttributes
Definition: vtkPlaneCutter.h:172
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkPlaneCutter::New
static vtkPlaneCutter * New()
Standard construction and print methods.
vtkPlaneCutter::RequestDataObject
int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:142
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:290
vtkSmartPointer.h
vtkPlaneCutter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkPlaneCutter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkPlaneCutter::GetMTime
vtkMTimeType GetMTime() override
The modified time depends on the delegated cut plane.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkSphereTree
class to build and traverse sphere trees
Definition: vtkSphereTree.h:70
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkPlaneCutter::GetSphereTree
vtkSphereTree * GetSphereTree(vtkDataSet *)
vtkPlaneCutter::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPlaneCutter::GeneratePolygons
bool GeneratePolygons
Definition: vtkPlaneCutter.h:173
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:204
vtkDataObjectAlgorithm.h
vtkPlaneCutter::SetPlane
virtual void SetPlane(vtkPlane *)
Specify the plane (an implicit function) to perform the cutting.
vtkPlaneCutter
cut any dataset with a plane and generate a polygonal cut surface
Definition: vtkPlaneCutter.h:82
vtkPlaneCutter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard construction and print methods.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkPlaneCutter::AddNormalArray
static void AddNormalArray(double *planeNormal, vtkDataSet *ds)