VTK  9.2.5
vtkFindCellStrategy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFindCellStrategy.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
48 #ifndef vtkFindCellStrategy_h
49 #define vtkFindCellStrategy_h
50 
51 #include "vtkCommonDataModelModule.h" // For export macro
52 #include "vtkObject.h"
53 
54 class vtkCell;
55 class vtkGenericCell;
56 class vtkPointSet;
57 
58 class VTKCOMMONDATAMODEL_EXPORT vtkFindCellStrategy : public vtkObject
59 {
60 public:
62 
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
76  virtual int Initialize(vtkPointSet* ps);
77 
86  virtual vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
87  double tol2, int& subId, double pcoords[3], double* weights) = 0;
88 
105  virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3],
106  vtkGenericCell* cell, vtkIdType& cellId, int& subId, double& dist2, int& inside) = 0;
107 
111  virtual bool InsideCellBounds(double x[3], vtkIdType cellId) = 0;
112 
119  virtual void CopyParameters(vtkFindCellStrategy* from);
120 
121 protected:
124 
125  // You may ask why this OwnsLocator rigamarole. The reason is that the reference counting garbage
126  // collector gets confused when the (cell/point) locator, point set, and strategy are all mixed
127  // together; resulting in memory leaks etc, So this defines if the locator specified or taken from
128  // another strategy instance or the dataset.
130  vtkPointSet* PointSet; // vtkPointSet which this strategy is associated with
131  double Bounds[6]; // bounding box of vtkPointSet
132 
133  vtkTimeStamp InitializeTime; // time at which strategy was initialized
134 
135 private:
136  vtkFindCellStrategy(const vtkFindCellStrategy&) = delete;
137  void operator=(const vtkFindCellStrategy&) = delete;
138 };
139 
140 #endif
abstract class to specify cell behavior
Definition: vtkCell.h:150
helper class to manage the vtkPointSet::FindCell() METHOD
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:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
concrete class for storing a set of points
Definition: vtkPointSet.h:109
record modification and/or execution time
Definition: vtkTimeStamp.h:55
@ radius
Definition: vtkX3D.h:258
int vtkIdType
Definition: vtkType.h:332