VTK  9.6.20260522
vtkFindCellStrategy.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
35
36#ifndef vtkFindCellStrategy_h
37#define vtkFindCellStrategy_h
38
39#include "vtkCommonDataModelModule.h" // For export macro
40#include "vtkObject.h"
41
42VTK_ABI_NAMESPACE_BEGIN
43class vtkCell;
44class vtkGenericCell;
46class vtkPointSet;
47
48class VTKCOMMONDATAMODEL_EXPORT vtkFindCellStrategy : public vtkObject
49{
50public:
52
56 void PrintSelf(ostream& os, vtkIndent indent) override;
58
65
73 virtual int Initialize(vtkPointSet* ps);
74
83 virtual vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
84 double tol2, int& subId, double pcoords[3], double* weights) = 0;
85
102 virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3],
103 vtkGenericCell* cell, vtkIdType& cellId, int& subId, double& dist2, int& inside) = 0;
104
108 virtual bool InsideCellBounds(double x[3], vtkIdType cellId) = 0;
109
119
120protected:
123
124 // You may ask why this OwnsLocator rigamarole. The reason is that the reference counting garbage
125 // collector gets confused when the (cell/point) locator, point set, and strategy are all mixed
126 // together; resulting in memory leaks etc, So this defines if the locator specified or taken from
127 // another strategy instance or the dataset.
129 // IsACopy is needed to ensure the point-set's locator is up-to-date
130 // otherwise thread-safety issue can arise.
132 vtkPointSet* PointSet; // vtkPointSet which this strategy is associated with
133 double Bounds[6]; // bounding box of vtkPointSet
134
135 vtkTimeStamp InitializeTime; // time at which strategy was initialized
136
137private:
139 void operator=(const vtkFindCellStrategy&) = delete;
140};
141
142VTK_ABI_NAMESPACE_END
143#endif
an abstract base class for locators which find cells
abstract class to specify cell behavior
Definition vtkCell.h:130
virtual vtkSmartPointer< vtkAbstractCellLocator > ConvertToCellLocator()=0
Convert FindCellStrategy to cellLocator.
virtual bool InsideCellBounds(double x[3], vtkIdType cellId)=0
Quickly test if a point is inside the bounds of a particular cell.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
virtual void CopyParameters(vtkFindCellStrategy *from)
Copy essential parameters between instances of this class.
virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)=0
Virtual method for finding a cell.
virtual int Initialize(vtkPointSet *ps)
All subclasses of this class must provide an initialize method.
~vtkFindCellStrategy() override
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2, int &inside)=0
Return the closest point within a specified radius and the cell which is closest to the point x.
provides thread-safe access to cells
a simple class to control print indentation
Definition vtkIndent.h:108
concrete class for storing a set of points
Definition vtkPointSet.h:98
Hold a reference to a vtkObjectBase instance.
record modification and/or execution time
int vtkIdType
Definition vtkType.h:363