39 indirectRegionPatches_(),
51 indirectRegionPatches_(),
67 treeByRegion_.clear();
76 if (treeByRegion_.empty())
81 const label regionI = surface()[fI].region();
82 maxRegion =
max(maxRegion, regionI);
84 const label nRegions = maxRegion+1;
89 const label regionI = surface()[fI].region();
90 nFacesInRegions[regionI]++;
93 indirectRegionPatches_.
setSize(nRegions);
94 treeByRegion_.setSize(nRegions);
98 forAll(regionsAddressing, regionI)
100 regionsAddressing[regionI].
setSize(nFacesInRegions[regionI]);
102 nFacesInRegions =
Zero;
105 const label regionI = surface()[fI].region();
106 regionsAddressing[regionI][nFacesInRegions[regionI]++] = fI;
109 forAll(regionsAddressing, regionI)
111 scalar oldTol = treeType::perturbTol();
112 treeType::perturbTol() = tolerance();
114 indirectRegionPatches_.set
122 regionsAddressing[regionI]
131 if (indirectRegionPatches_[regionI].size())
134 PatchTools::calcBounds
136 indirectRegionPatches_[regionI],
172 indirectRegionPatches_[regionI],
182 treeType::perturbTol() = oldTol;
186 return treeByRegion_;
198 if (regionIndices.
empty())
204 scalar oldTol = treeType::perturbTol();
205 treeType::perturbTol() = tolerance();
213 if (!regionIndices.
found(treeI))
218 const treeType& octree = octrees[treeI];
237 currentRegionHit.
hit()
249 info[i] = currentRegionHit;
254 treeType::perturbTol() = oldTol;
A List with indirect addressing.
void setSize(const label n)
Alias for resize()
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
bool hit() const noexcept
Is there a hit?
const point_type & hitPoint() const
Return hit point. Fatal if not hit.
A list of faces which address into the list of points.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
bool found(const T &val, label pos=0) const
True if the value if found in the list.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Non-pointer based hierarchical recursive searching.
Standard boundBox with extra functionality for use in octree.
treeBoundBox extend(Random &rndGen, const scalar s) const
Return slightly wider bounding box.
Encapsulation of data needed to search on PrimitivePatches.
Helper class to search on triSurface. Creates an octree for each region of the surface and only searc...
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, const labelList ®ionIndices, List< pointIndexHit > &info) const
Find the nearest point on the surface out of the regions.
~triSurfaceRegionSearch()
Destructor.
const PtrList< treeType > & treeByRegion() const
Demand driven construction of octree for each region.
void clearOut()
Clear storage.
Helper class to search on triSurface.
void clearOut()
Clear storage.
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, List< pointIndexHit > &info) const
Triangulated surface description with patch information.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.
scalarField samples(nIntervals, Zero)