VTK  9.3.1
vtkImprintFilter.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
84 #ifndef vtkImprintFilter_h
85 #define vtkImprintFilter_h
86 
87 #include "vtkFiltersModelingModule.h" // For export macro
88 #include "vtkPolyDataAlgorithm.h"
89 
90 VTK_ABI_NAMESPACE_BEGIN
92 
93 class VTKFILTERSMODELING_EXPORT vtkImprintFilter : public vtkPolyDataAlgorithm
94 {
95 public:
97 
100  static vtkImprintFilter* New();
102  void PrintSelf(ostream& os, vtkIndent indent) override;
104 
109  void SetTargetConnection(vtkAlgorithmOutput* algOutput);
110  vtkAlgorithmOutput* GetTargetConnection();
111 
113 
118  void SetTargetData(vtkDataObject* target);
119  vtkDataObject* GetTarget();
121 
127  void SetImprintConnection(vtkAlgorithmOutput* algOutput);
128  vtkAlgorithmOutput* GetImprintConnection();
129 
131 
135  void SetImprintData(vtkDataObject* imprint);
136  vtkDataObject* GetImprint();
138 
140 
145  vtkSetClampMacro(Tolerance, double, 0.0, VTK_FLOAT_MAX);
146  vtkGetMacro(Tolerance, double);
148 
149  // Used to control how the merge tolerance is interpreted.
150  // ABSOLUTE_TOLERANCE is a tolerance expressed in world coordinates;
151  // RELATIVE_TO_TOLERANCE is a tolerance relative to the projection
152  // tolerance; and RELATIVE_TO_MIN_EDGE_LENGTH is a tolerance relative
153  // to the minimum edge length of the tool/imprint mesh.
155  {
156  ABSOLUTE_TOLERANCE = 0,
157  RELATIVE_TO_PROJECTION_TOLERANCE = 1,
158  RELATIVE_TO_MIN_EDGE_LENGTH = 2
159  };
160 
162 
167  vtkSetClampMacro(MergeToleranceType, int, ABSOLUTE_TOLERANCE, RELATIVE_TO_MIN_EDGE_LENGTH);
168  vtkGetMacro(MergeToleranceType, int);
169  void SetMergeToleranceTypeToAbsolute() { this->SetMergeToleranceType(ABSOLUTE_TOLERANCE); }
171  {
172  this->SetMergeToleranceType(RELATIVE_TO_PROJECTION_TOLERANCE);
173  }
175  {
176  this->SetMergeToleranceType(RELATIVE_TO_MIN_EDGE_LENGTH);
177  }
178  vtkSetClampMacro(MergeTolerance, double, 0.0, VTK_FLOAT_MAX);
179  vtkGetMacro(MergeTolerance, double);
181 
183  {
184  TARGET_CELLS = 0,
185  IMPRINTED_CELLS = 1,
186  PROJECTED_IMPRINT = 2,
187  IMPRINTED_REGION = 3,
188  MERGED_IMPRINT = 5
189  };
190 
192 
205  vtkSetClampMacro(OutputType, int, TARGET_CELLS, MERGED_IMPRINT);
206  vtkGetMacro(OutputType, int);
207  void SetOutputTypeToTargetCells() { this->SetOutputType(TARGET_CELLS); }
208  void SetOutputTypeToImprintedCells() { this->SetOutputType(IMPRINTED_CELLS); }
209  void SetOutputTypeToProjectedImprint() { this->SetOutputType(PROJECTED_IMPRINT); }
210  void SetOutputTypeToImprintedRegion() { this->SetOutputType(IMPRINTED_REGION); }
211  void SetOutputTypeToMergedImprint() { this->SetOutputType(MERGED_IMPRINT); }
213 
215 
222  vtkSetMacro(BoundaryEdgeInsertion, bool);
223  vtkGetMacro(BoundaryEdgeInsertion, bool);
224  vtkBooleanMacro(BoundaryEdgeInsertion, bool);
226 
228 
232  vtkSetMacro(PassCellData, bool);
233  vtkGetMacro(PassCellData, bool);
234  vtkBooleanMacro(PassCellData, bool);
236 
238 
246  vtkSetMacro(PassPointData, bool);
247  vtkGetMacro(PassPointData, bool);
248  vtkBooleanMacro(PassPointData, bool);
250 
252  {
253  USE_TARGET_EDGES = 0,
254  USE_IMPRINT_EDGES = 1
255  };
256 
258 
263  vtkSetClampMacro(PointInterpolation, int, USE_TARGET_EDGES, USE_IMPRINT_EDGES);
264  vtkGetMacro(PointInterpolation, int);
265  void SetPointInterpolationToTargetEdges() { this->SetPointInterpolation(USE_TARGET_EDGES); }
266  void SetPointInterpolationToImprintEdges() { this->SetPointInterpolation(USE_IMPRINT_EDGES); }
268 
270  {
271  NO_DEBUG_OUTPUT = 0,
272  TRIANGULATION_INPUT = 1,
273  TRIANGULATION_OUTPUT = 2
274  };
275 
277 
284  vtkSetMacro(TriangulateOutput, bool);
285  vtkGetMacro(TriangulateOutput, bool);
286  vtkBooleanMacro(TriangulateOutput, bool);
288 
290 
298  vtkSetClampMacro(DebugOutputType, int, NO_DEBUG_OUTPUT, TRIANGULATION_OUTPUT);
299  vtkGetMacro(DebugOutputType, int);
300  void SetDebugOutputTypeToNoDebugOutput() { this->SetDebugOutputType(NO_DEBUG_OUTPUT); }
301  void SetDebugOutputTypeToTriangulationInput() { this->SetDebugOutputType(TRIANGULATION_INPUT); }
302  void SetDebugOutputTypeToTriangulationOutput() { this->SetDebugOutputType(TRIANGULATION_OUTPUT); }
303  vtkSetMacro(DebugCellId, vtkIdType);
304  vtkGetMacro(DebugCellId, vtkIdType);
306 
308 
312  vtkPolyData* GetDebugOutput();
314 
315 protected:
317  ~vtkImprintFilter() override;
318 
319  double Tolerance;
322  double ComputeMergeTolerance(vtkPolyData* pdata);
323 
327 
331 
334 
337 
338 private:
339  vtkImprintFilter(const vtkImprintFilter&) = delete;
340  void operator=(const vtkImprintFilter&) = delete;
341 };
342 
343 VTK_ABI_NAMESPACE_END
344 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SetMergeToleranceTypeToMinEdge()
Specify a tolerance which is used to determine whether two points are considered coincident to one an...
void SetOutputTypeToProjectedImprint()
Control what is output by the filter.
void SetMergeToleranceTypeToRelativeToProjection()
Specify a tolerance which is used to determine whether two points are considered coincident to one an...
perform fast cell location operations
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
void SetOutputTypeToImprintedRegion()
Control what is output by the filter.
void SetOutputTypeToImprintedCells()
Control what is output by the filter.
Proxy object to connect input/output ports.
static vtkPolyDataAlgorithm * New()
void SetPointInterpolationToImprintEdges()
If PassPointData is on, indicate how new point data is to generated at the intersection points betwee...
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
#define VTK_FLOAT_MAX
Definition: vtkType.h:152
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void SetPointInterpolationToTargetEdges()
If PassPointData is on, indicate how new point data is to generated at the intersection points betwee...
Imprint the contact surface of one object onto another surface.
void SetOutputTypeToMergedImprint()
Control what is output by the filter.
void SetDebugOutputTypeToNoDebugOutput()
The following methods support debugging.
Store zero or more vtkInformation instances.
void SetMergeToleranceTypeToAbsolute()
Specify a tolerance which is used to determine whether two points are considered coincident to one an...
void SetDebugOutputTypeToTriangulationOutput()
The following methods support debugging.
general representation of visualization data
Definition: vtkDataObject.h:54
void SetDebugOutputTypeToTriangulationInput()
The following methods support debugging.
void SetOutputTypeToTargetCells()
Control what is output by the filter.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.