Loading...
Searching...
No Matches
triSurfaceRegionSearch Class Reference

Helper class to search on triSurface. Creates an octree for each region of the surface and only searches on the specified regions. More...

#include <triSurfaceRegionSearch.H>

Inheritance diagram for triSurfaceRegionSearch:
Collaboration diagram for triSurfaceRegionSearch:

Public Member Functions

 triSurfaceRegionSearch (const triSurface &)
 Construct from surface. Holds reference to surface!
 triSurfaceRegionSearch (const triSurface &, const dictionary &dict)
 Construct from surface and dictionary. Holds reference to surface!
 ~triSurfaceRegionSearch ()
 Destructor.
void clearOut ()
 Clear storage.
const PtrList< treeType > & treeByRegion () const
 Demand driven construction of octree for each region.
void findNearest (const pointField &samples, const scalarField &nearestDistSqr, const labelList &regionIndices, List< pointIndexHit > &info) const
 Find the nearest point on the surface out of the regions.
void flip ()
 Flip orientation.
Public Member Functions inherited from triSurfaceSearch
 triSurfaceSearch (const triSurface &surface)
 Construct from surface. Holds reference to surface!
 triSurfaceSearch (const triSurface &surface, const dictionary &dict)
 Construct from surface and dictionary.
 triSurfaceSearch (const triSurface &surface, const scalar tolerance, const label maxTreeDepth=10)
 Construct from components.
 ~triSurfaceSearch ()
 Destructor.
void clearOut ()
 Clear storage.
const indexedOctree< treeDataTriSurface > & tree () const
 Demand driven construction of the octree.
void flip ()
 Flip orientation (if cached on octree).
const triSurfacesurface () const
 Return reference to the surface.
scalar tolerance () const
 Return tolerance to use in searches.
label maxTreeDepth () const
 Return max tree depth of octree.
boolList calcInside (const pointField &searchPoints) const
 Calculate for each searchPoint inside/outside status.
void findNearest (const pointField &samples, const scalarField &nearestDistSqr, List< pointIndexHit > &info) const
pointIndexHit nearest (const point &pt, const vector &span) const
 Calculate nearest point on surface for single searchPoint. Returns.
void findLine (const pointField &start, const pointField &end, List< pointIndexHit > &info) const
void findLineAny (const pointField &start, const pointField &end, List< pointIndexHit > &info) const
void findLineAll (const pointField &start, const pointField &end, List< List< pointIndexHit > > &info) const
 Calculate all intersections from start to end.

Detailed Description

Helper class to search on triSurface. Creates an octree for each region of the surface and only searches on the specified regions.

Source files

Definition at line 54 of file triSurfaceRegionSearch.H.

Constructor & Destructor Documentation

◆ triSurfaceRegionSearch() [1/2]

triSurfaceRegionSearch ( const triSurface & surface)
explicit

Construct from surface. Holds reference to surface!

Definition at line 29 of file triSurfaceRegionSearch.C.

References triSurfaceSearch::surface().

Here is the call graph for this function:

◆ triSurfaceRegionSearch() [2/2]

triSurfaceRegionSearch ( const triSurface & surface,
const dictionary & dict )

Construct from surface and dictionary. Holds reference to surface!

Definition at line 37 of file triSurfaceRegionSearch.C.

References dict, and triSurfaceSearch::surface().

Here is the call graph for this function:

◆ ~triSurfaceRegionSearch()

~triSurfaceRegionSearch ( )

Destructor.

Definition at line 51 of file triSurfaceRegionSearch.C.

References clearOut().

Here is the call graph for this function:

Member Function Documentation

◆ clearOut()

void clearOut ( )

Clear storage.

Definition at line 57 of file triSurfaceRegionSearch.C.

References triSurfaceSearch::clearOut().

Referenced by triSurfaceMesh::clearOut(), triSurfaceMesh::movePoints(), and ~triSurfaceRegionSearch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ treeByRegion()

const Foam::PtrList< Foam::triSurfaceRegionSearch::treeType > & treeByRegion ( ) const

Demand driven construction of octree for each region.

Currently creates a tree for each region; could optimise by only constructing trees when they are in regionIndices

Definition at line 67 of file triSurfaceRegionSearch.C.

References PatchTools::calcBounds(), e, forAll, boundBox::inflate(), Foam::max(), triSurfaceSearch::maxTreeDepth(), nPoints, indexedOctreeBase::perturbTol(), points, rndGen, List< T >::setSize(), triSurfaceSearch::surface(), triSurfaceSearch::tolerance(), Foam::Zero, and VectorSpace< Form, Cmpt, Ncmpts >::zero.

Referenced by findNearest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findNearest()

void findNearest ( const pointField & samples,
const scalarField & nearestDistSqr,
const labelList & regionIndices,
List< pointIndexHit > & info ) const

Find the nearest point on the surface out of the regions.

supplied in the list regionIndices. Ignores regions that are not specified

Definition at line 179 of file triSurfaceRegionSearch.C.

References UList< T >::empty(), triSurfaceSearch::findNearest(), forAll, UList< T >::found(), PointIndexHit< PointType >::hit(), indexedOctreeBase::perturbTol(), PointIndexHit< PointType >::point(), samples(), List< T >::setSize(), triSurfaceSearch::tolerance(), and treeByRegion().

Referenced by triSurfaceMesh::findNearest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flip()

void flip ( )

Flip orientation.

Definition at line 247 of file triSurfaceRegionSearch.C.

References triSurfaceSearch::flip(), forAll, volumeType::INSIDE, volumeType::OUTSIDE, and triSurfaceSearch::tree().

Referenced by triSurfaceMesh::flip().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: