36 indirectRegionPatches_(),
48 indirectRegionPatches_(),
64 treeByRegion_.clear();
73 if (treeByRegion_.empty())
78 const label regionI = surface()[fI].region();
80 regionSizes(regionI)++;
85 indirectRegionPatches_.setSize(nRegions);
86 treeByRegion_.setSize(nRegions);
90 forAll(regionsAddressing, regionI)
92 regionsAddressing[regionI] =
labelList(regionSizes[regionI], -1);
99 const label regionI = surface()[fI].region();
101 regionsAddressing[regionI][nFacesInRegions[regionI]++] = fI;
104 forAll(regionsAddressing, regionI)
106 scalar oldTol = treeType::perturbTol();
107 treeType::perturbTol() = tolerance();
109 indirectRegionPatches_.set
117 regionsAddressing[regionI]
126 if (indirectRegionPatches_[regionI].size())
131 indirectRegionPatches_[regionI],
161 indirectRegionPatches_[regionI],
171 treeType::perturbTol() = oldTol;
175 return treeByRegion_;
187 if (regionIndices.
empty())
193 scalar oldTol = treeType::perturbTol();
194 treeType::perturbTol() = tolerance();
202 if (
findIndex(regionIndices, treeI) == -1)
207 const treeType& octree = octrees[treeI];
225 currentRegionHit.
hit()
237 info[i] = currentRegionHit;
242 treeType::perturbTol() = oldTol;
#define forAll(list, i)
Loop across all elements in list.
label size() const
Return number of elements in table.
A List with indirect addressing.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const Point & hitPoint() const
Return hit point.
bool hit() const
Is there a hit.
A list of faces which address into the list of points.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool empty() const
Return true if the UList is empty (ie, size() is zero)
A list of keyword definitions, which are a keyword followed by any number of values (e....
Non-pointer based hierarchical recursive searching.
Standard boundBox + extra functionality for use in octree.
treeBoundBox extend(const scalar s) const
Return asymmetrically extended bounding box, with guaranteed.
Encapsulation of data needed to search on PrimitivePatches.
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.
triSurfaceRegionSearch(const triSurface &)
Construct from surface. Holds reference to surface!
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.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
scalarField samples(nIntervals, 0)