VTK  9.7.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 "vtkWrappingHints.h" // For VTK_MARSHALAUTO
69 #include <map> // For std::map
70 
71 VTK_ABI_NAMESPACE_BEGIN
72 class vtkDataObjectTree;
73 class vtkPlane;
74 class vtkPolyData;
75 class vtkSphereTree;
76 
77 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkPlaneCutter : public vtkDataObjectAlgorithm
78 {
79 public:
81 
84  static vtkPlaneCutter* New();
86  void PrintSelf(ostream& os, vtkIndent indent) override;
88 
92  vtkMTimeType GetMTime() override;
93 
95 
100  virtual void SetPlane(vtkPlane*);
101  vtkGetObjectMacro(Plane, vtkPlane);
103 
105 
111  vtkSetMacro(ComputeNormals, bool);
112  vtkGetMacro(ComputeNormals, bool);
113  vtkBooleanMacro(ComputeNormals, bool);
115 
117 
122  vtkSetMacro(InterpolateAttributes, bool);
123  vtkGetMacro(InterpolateAttributes, bool);
124  vtkBooleanMacro(InterpolateAttributes, bool);
126 
128 
133  vtkSetMacro(GeneratePolygons, bool);
134  vtkGetMacro(GeneratePolygons, bool);
135  vtkBooleanMacro(GeneratePolygons, bool);
137 
139 
145  vtkSetMacro(BuildTree, bool);
146  vtkGetMacro(BuildTree, bool);
147  vtkBooleanMacro(BuildTree, bool);
149 
151 
157  vtkSetMacro(BuildHierarchy, bool);
158  vtkGetMacro(BuildHierarchy, bool);
159  vtkBooleanMacro(BuildHierarchy, bool);
161 
163 
171  vtkSetMacro(MergePoints, bool);
172  vtkGetMacro(MergePoints, bool);
173  vtkBooleanMacro(MergePoints, bool);
175 
177 
182  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
183  vtkGetMacro(OutputPointsPrecision, int);
185 
186 protected:
187  vtkPlaneCutter();
188  ~vtkPlaneCutter() override;
189 
194  bool BuildTree;
198 
199  // Support delegation to vtkPolyDataPlaneCutter/vtk3DLinearGridPlaneCutter.
201 
202  std::map<vtkDataSet*, vtkSmartPointer<vtkSphereTree>> SphereTrees;
203  std::map<vtkDataSet*, bool> CanBeFullyProcessed;
205  {
208 
210  : Input(nullptr)
211  , LastMTime(0)
212  {
213  }
215  : Input(input)
216  , LastMTime(mtime)
217  {
218  }
219  };
221 
222  // Pipeline-related methods
226  int FillInputPortInformation(int port, vtkInformation* info) override;
228 
229  int ExecuteDataObjectTree(vtkDataObjectTree* input, vtkDataObjectTree* output);
230  int ExecuteDataSet(vtkDataSet* input, vtkPolyData* output);
231 
232  static void AddNormalArray(double* planeNormal, vtkPolyData* polyData);
233 
234  // Garbage collection method
235  void ReportReferences(vtkGarbageCollector*) override;
236 
237 private:
238  vtkPlaneCutter(const vtkPlaneCutter&) = delete;
239  void operator=(const vtkPlaneCutter&) = delete;
240 };
241 
242 VTK_ABI_NAMESPACE_END
243 #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:318
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
static vtkDataObjectAlgorithm * New()
std::map< vtkDataSet *, vtkSmartPointer< vtkSphereTree > > SphereTrees
void ReportReferences(vtkGarbageCollector *) override
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
Detect and break reference loops.
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:31
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.
#define VTK_MARSHALAUTO
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
general representation of visualization data
Definition: vtkDataObject.h:55
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.