VTK  9.7.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 value 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 (i.e., MergeTolerance is a scale factor on Tolerance);
153  // RELATIVE_TO_MIN_EDGE_LENGTH is a tolerance relative to the minimum edge
154  // length of the tool/imprint mesh; and RELATIVE_TO_AVERAGE_EDGE_LENGTH is
155  // a tolerance based on the average edge length of all imprint mesh edges.
157  {
158  ABSOLUTE_TOLERANCE = 0,
159  RELATIVE_TO_PROJECTION_TOLERANCE = 1,
160  RELATIVE_TO_MIN_EDGE_LENGTH = 2,
161  RELATIVE_TO_AVERAGE_EDGE_LENGTH = 3
162  };
163 
165 
170  vtkSetClampMacro(MergeToleranceType, int, ABSOLUTE_TOLERANCE, RELATIVE_TO_AVERAGE_EDGE_LENGTH);
171  vtkGetMacro(MergeToleranceType, int);
172  void SetMergeToleranceTypeToAbsolute() { this->SetMergeToleranceType(ABSOLUTE_TOLERANCE); }
174  {
175  this->SetMergeToleranceType(RELATIVE_TO_PROJECTION_TOLERANCE);
176  }
178  {
179  this->SetMergeToleranceType(RELATIVE_TO_MIN_EDGE_LENGTH);
180  }
182  {
183  this->SetMergeToleranceType(RELATIVE_TO_AVERAGE_EDGE_LENGTH);
184  }
185  vtkSetClampMacro(MergeTolerance, double, 0.0, VTK_FLOAT_MAX);
186  vtkGetMacro(MergeTolerance, double);
188 
189  // Used to control the relationship between the merge tolerance
190  // (MergeTolerance) and projection tolerance (Tolerance) as these need to
191  // be treated consistently to minimize numerical issues. The projection
192  // tolerance addresses projection of the imprint onto the target, while
193  // the merge tolerance is about computing accurate in-plane edge-edge
194  // intersections.
196  {
197  DECOUPLED_TOLERANCES = 0,
198  LINKED_TOLERANCES = 1
199  };
200 
202 
209  vtkSetClampMacro(ToleranceStrategy, int, DECOUPLED_TOLERANCES, LINKED_TOLERANCES);
210  vtkGetMacro(ToleranceStrategy, int);
211  void SetToleranceStrategyToDecoupled() { this->SetToleranceStrategy(DECOUPLED_TOLERANCES); }
212  void SetToleranceStrategyToLinked() { this->SetToleranceStrategy(LINKED_TOLERANCES); }
214 
216  {
217  TARGET_CELLS = 0,
218  IMPRINTED_CELLS = 1,
219  PROJECTED_IMPRINT = 2,
220  IMPRINTED_REGION = 3,
221  MERGED_IMPRINT = 5
222  };
223 
225 
238  vtkSetClampMacro(OutputType, int, TARGET_CELLS, MERGED_IMPRINT);
239  vtkGetMacro(OutputType, int);
240  void SetOutputTypeToTargetCells() { this->SetOutputType(TARGET_CELLS); }
241  void SetOutputTypeToImprintedCells() { this->SetOutputType(IMPRINTED_CELLS); }
242  void SetOutputTypeToProjectedImprint() { this->SetOutputType(PROJECTED_IMPRINT); }
243  void SetOutputTypeToImprintedRegion() { this->SetOutputType(IMPRINTED_REGION); }
244  void SetOutputTypeToMergedImprint() { this->SetOutputType(MERGED_IMPRINT); }
246 
248 
255  vtkSetMacro(BoundaryEdgeInsertion, bool);
256  vtkGetMacro(BoundaryEdgeInsertion, bool);
257  vtkBooleanMacro(BoundaryEdgeInsertion, bool);
259 
261 
265  vtkSetMacro(PassCellData, bool);
266  vtkGetMacro(PassCellData, bool);
267  vtkBooleanMacro(PassCellData, bool);
269 
271 
279  vtkSetMacro(PassPointData, bool);
280  vtkGetMacro(PassPointData, bool);
281  vtkBooleanMacro(PassPointData, bool);
283 
285  {
286  USE_TARGET_EDGES = 0,
287  USE_IMPRINT_EDGES = 1
288  };
289 
291 
296  vtkSetClampMacro(PointInterpolation, int, USE_TARGET_EDGES, USE_IMPRINT_EDGES);
297  vtkGetMacro(PointInterpolation, int);
298  void SetPointInterpolationToTargetEdges() { this->SetPointInterpolation(USE_TARGET_EDGES); }
299  void SetPointInterpolationToImprintEdges() { this->SetPointInterpolation(USE_IMPRINT_EDGES); }
301 
303  {
304  NO_DEBUG_OUTPUT = 0,
305  TRIANGULATION_INPUT = 1,
306  TRIANGULATION_OUTPUT = 2
307  };
308 
310 
317  vtkSetMacro(TriangulateOutput, bool);
318  vtkGetMacro(TriangulateOutput, bool);
319  vtkBooleanMacro(TriangulateOutput, bool);
321 
323 
331  vtkSetClampMacro(DebugOutputType, int, NO_DEBUG_OUTPUT, TRIANGULATION_OUTPUT);
332  vtkGetMacro(DebugOutputType, int);
333  void SetDebugOutputTypeToNoDebugOutput() { this->SetDebugOutputType(NO_DEBUG_OUTPUT); }
334  void SetDebugOutputTypeToTriangulationInput() { this->SetDebugOutputType(TRIANGULATION_INPUT); }
335  void SetDebugOutputTypeToTriangulationOutput() { this->SetDebugOutputType(TRIANGULATION_OUTPUT); }
336  vtkSetMacro(DebugCellId, vtkIdType);
337  vtkGetMacro(DebugCellId, vtkIdType);
339 
341 
345  vtkPolyData* GetDebugOutput();
347 
348 protected:
350  ~vtkImprintFilter() override;
351 
352  double Tolerance;
356  double ComputeMergeTolerance(vtkPolyData* pdata);
357 
361 
365 
368 
371 
372 private:
373  vtkImprintFilter(const vtkImprintFilter&) = delete;
374  void operator=(const vtkImprintFilter&) = delete;
375 };
376 
377 VTK_ABI_NAMESPACE_END
378 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SetMergeToleranceTypeToAverageEdge()
Specify a tolerance which is used to determine whether two points are considered coincident to one an...
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:363
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
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:200
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetToleranceStrategyToLinked()
Specify the relationship between the merge tolerance and the projection tolerance.
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:55
void SetDebugOutputTypeToTriangulationInput()
The following methods support debugging.
void SetOutputTypeToTargetCells()
Control what is output by the filter.
void SetToleranceStrategyToDecoupled()
Specify the relationship between the merge tolerance and the projection tolerance.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.