VTK  9.3.1
vtkPlaneCutter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
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 VTK_ABI_NAMESPACE_BEGIN
71 class vtkDataObjectTree;
72 class vtkPlane;
73 class vtkPolyData;
74 class vtkSphereTree;
75 
76 class VTKFILTERSCORE_EXPORT vtkPlaneCutter : public vtkDataObjectAlgorithm
77 {
78 public:
80 
83  static vtkPlaneCutter* New();
85  void PrintSelf(ostream& os, vtkIndent indent) override;
87 
91  vtkMTimeType GetMTime() override;
92 
94 
99  virtual void SetPlane(vtkPlane*);
100  vtkGetObjectMacro(Plane, vtkPlane);
102 
104 
110  vtkSetMacro(ComputeNormals, bool);
111  vtkGetMacro(ComputeNormals, bool);
112  vtkBooleanMacro(ComputeNormals, bool);
114 
116 
121  vtkSetMacro(InterpolateAttributes, bool);
122  vtkGetMacro(InterpolateAttributes, bool);
123  vtkBooleanMacro(InterpolateAttributes, bool);
125 
127 
132  vtkSetMacro(GeneratePolygons, bool);
133  vtkGetMacro(GeneratePolygons, bool);
134  vtkBooleanMacro(GeneratePolygons, bool);
136 
138 
144  vtkSetMacro(BuildTree, bool);
145  vtkGetMacro(BuildTree, bool);
146  vtkBooleanMacro(BuildTree, bool);
148 
150 
156  vtkSetMacro(BuildHierarchy, bool);
157  vtkGetMacro(BuildHierarchy, bool);
158  vtkBooleanMacro(BuildHierarchy, bool);
160 
162 
170  vtkSetMacro(MergePoints, bool);
171  vtkGetMacro(MergePoints, bool);
172  vtkBooleanMacro(MergePoints, bool);
174 
176 
181  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
182  vtkGetMacro(OutputPointsPrecision, int);
184 
185 protected:
186  vtkPlaneCutter();
187  ~vtkPlaneCutter() override;
188 
193  bool BuildTree;
197 
198  // Support delegation to vtkPolyDataPlaneCutter/vtk3DLinearGridPlaneCutter.
200 
201  std::map<vtkDataSet*, vtkSmartPointer<vtkSphereTree>> SphereTrees;
202  std::map<vtkDataSet*, bool> CanBeFullyProcessed;
204  {
207 
209  : Input(nullptr)
210  , LastMTime(0)
211  {
212  }
214  : Input(input)
215  , LastMTime(mtime)
216  {
217  }
218  };
220 
221  // Pipeline-related methods
225  int FillInputPortInformation(int port, vtkInformation* info) override;
227 
228  int ExecuteDataObjectTree(vtkDataObjectTree* input, vtkDataObjectTree* output);
229  int ExecuteDataSet(vtkDataSet* input, vtkPolyData* output);
230 
231  static void AddNormalArray(double* planeNormal, vtkPolyData* polyData);
232 
233 private:
234  vtkPlaneCutter(const vtkPlaneCutter&) = delete;
235  void operator=(const vtkPlaneCutter&) = delete;
236 };
237 
238 VTK_ABI_NAMESPACE_END
239 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
static vtkDataObjectAlgorithm * New()
std::map< vtkDataSet *, vtkSmartPointer< vtkSphereTree > > SphereTrees
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:28
cut any dataset with a plane and generate a polygonal cut surface
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
std::map< vtkDataSet *, bool > CanBeFullyProcessed
perform various plane computations
Definition: vtkPlane.h:25
bool InterpolateAttributes
vtkInputInfo InputInfo
Superclass for algorithms that produce only data object as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
class to build and traverse sphere trees
Definition: vtkSphereTree.h:61
Store zero or more vtkInformation instances.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
general representation of visualization data
Definition: vtkDataObject.h:54
vtkPlane * Plane
vtkInputInfo(vtkDataObject *input, vtkMTimeType mtime)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.