VTK  9.2.6
vtkLinearTransformCellLocator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLinearTransformCellLocator.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 =========================================================================*/
41 #ifndef vtkLinearTransformCellLocator_h
42 #define vtkLinearTransformCellLocator_h
43 
44 #include "vtkAbstractCellLocator.h"
45 #include "vtkFiltersFlowPathsModule.h" // For export macro
46 #include "vtkSmartPointer.h" // For vtkSmartPointer
47 
48 class vtkTransform;
49 
50 class VTKFILTERSFLOWPATHS_EXPORT vtkLinearTransformCellLocator : public vtkAbstractCellLocator
51 {
52 public:
54 
59  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
68  virtual void SetCellLocator(vtkAbstractCellLocator* locator);
69  vtkGetObjectMacro(CellLocator, vtkAbstractCellLocator);
71 
73 
80  vtkSetMacro(UseAllPoints, bool);
81  vtkBooleanMacro(UseAllPoints, bool);
82  vtkGetMacro(UseAllPoints, bool);
84 
89  vtkGetMacro(IsLinearTransformation, bool);
90 
91  // Re-use any superclass signatures that we don't override.
96 
103  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
104  double pcoords[3], int& subId, vtkIdType& cellId, vtkGenericCell* cell) override;
105 
115  int IntersectWithLine(const double p1[3], const double p2[3], const double tol, vtkPoints* points,
116  vtkIdList* cellIds, vtkGenericCell* cell) override;
117 
125  void FindClosestPoint(const double x[3], double closestPoint[3], vtkGenericCell* cell,
126  vtkIdType& cellId, int& subId, double& dist2) override
127  {
128  this->Superclass::FindClosestPoint(x, closestPoint, cell, cellId, subId, dist2);
129  }
130 
141  vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3],
142  vtkGenericCell* cell, vtkIdType& cellId, int& subId, double& dist2, int& inside) override;
143 
150  void FindCellsWithinBounds(double* bbox, vtkIdList* cells) override;
151 
159  const double p1[3], const double p2[3], double tolerance, vtkIdList* cellsIds) override
160  {
161  this->Superclass::FindCellsAlongLine(p1, p2, tolerance, cellsIds);
162  }
163 
170  void FindCellsAlongPlane(
171  const double o[3], const double n[3], double tolerance, vtkIdList* cells) override;
172 
180  vtkIdType FindCell(double x[3], double vtkNotUsed(tol2), vtkGenericCell* cell, int& subId,
181  double pcoords[3], double* weights) override;
182 
187  bool InsideCellBounds(double x[3], vtkIdType cellId) override;
188 
190 
193  void GenerateRepresentation(int level, vtkPolyData* pd) override;
194  void FreeSearchStructure() override;
195  void BuildLocator() override;
196  void ForceBuildLocator() override;
198 
202  void ShallowCopy(vtkAbstractCellLocator* locator) override;
203 
204 protected:
206  ~vtkLinearTransformCellLocator() override;
207 
208  void BuildLocatorInternal() override;
209 
210  bool ComputeTransformation();
211 
214  bool IsLinearTransformation = false;
215  bool UseAllPoints = false;
216 
218 
219 private:
221  void operator=(const vtkLinearTransformCellLocator&) = delete;
222 };
223 
224 #endif
virtual void BuildLocator()=0
Build the locator from the input dataset.
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
Return the closest point within a specified radius and the cell which is closest to the point x...
virtual void FindCellsWithinBounds(double *bbox, vtkIdList *cells)
Return a list of unique cell ids inside of a given bounding box.
virtual bool InsideCellBounds(double x[3], vtkIdType cell_ID)
Quickly test if a point is inside the bounds of a particular cell.
vtkSmartPointer< vtkTransform > InverseTransform
an abstract base class for locators which find cells
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
int vtkIdType
Definition: vtkType.h:332
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
void FindClosestPoint(const double x[3], double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2) override
Return the closest point and the cell which is closest to the point x.
virtual void FreeSearchStructure()=0
Free the memory required for the spatial data structure.
provides thread-safe access to cells
vtkSmartPointer< vtkTransform > Transform
virtual void FindClosestPoint(const double x[3], double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
Return the closest point and the cell which is closest to the point x.
virtual void ShallowCopy(vtkAbstractCellLocator *)
Shallow copy of a vtkAbstractCellLocator.
void FindCellsAlongLine(const double p1[3], const double p2[3], double tolerance, vtkIdList *cellsIds) override
Take the passed line segment and intersect it with the data set.
virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)
Return intersection point (if any) of finite line with cells contained in cell locator.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition: vtkLocator.h:203
virtual vtkIdType FindCell(double x[3])
Returns the Id of the cell containing the point, returns -1 if no cell found.
list of point or cell ids
Definition: vtkIdList.h:33
Cell locator adaptor to perform cell Location on datasets that are a linear transformation of the ori...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void FindCellsAlongPlane(const double o[3], const double n[3], double tolerance, vtkIdList *cells)
Given an unbounded plane defined by an origin o[3] and unit normal n[3], return the list of unique ce...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GenerateRepresentation(int level, vtkPolyData *pd)=0
Method to build a representation at a particular level.
represent and manipulate 3D points
Definition: vtkPoints.h:39
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition: vtkLocator.h:167