treeDataEdge Class Reference

Holds data for octree to work on an edges subset. More...

Classes

class  findIntersectOp
 Forward to treeDataEdge findIntersect operations. More...
 
class  findNearestOp
 Forward to treeDataEdge findNearest operations. More...
 

Public Member Functions

 ClassNameNoDebug ("treeDataEdge")
 
 treeDataEdge (const bool cacheBb, const edgeList &edges, const pointField &points)
 Construct from all edges. More...
 
 treeDataEdge (const bool cacheBb, const edgeList &edges, const pointField &points, const labelRange &range)
 Construct from range of edges. More...
 
 treeDataEdge (const bool cacheBb, const edgeList &edges, const pointField &points, const labelUList &edgeLabels)
 Construct from selected edges. More...
 
 treeDataEdge (const bool cacheBb, const edgeList &edges, const pointField &points, labelList &&edgeLabels)
 Construct from selected edges, transferring contents. More...
 
 treeDataEdge (const edgeList &edges, const pointField &points)
 Construct from all edges. More...
 
 treeDataEdge (const edgeList &edges, const pointField &points, const labelRange &range)
 Construct from range of edges. More...
 
 treeDataEdge (const edgeList &edges, const pointField &points, const labelUList &edgeLabels)
 Construct from selected edges. More...
 
 treeDataEdge (const edgeList &edges, const pointField &points, labelList &&edgeLabels)
 Construct from selected edges, transferring contents. More...
 
int nDim () const noexcept
 Object dimension == 1 (line element) More...
 
treeBoundBox bounds (const labelUList &indices) const
 Return bounding box for the specified edge indices. More...
 
const pointFieldpoints () const noexcept
 The reference point field. More...
 
const edgeListedges () const noexcept
 The original list of edges. More...
 
const labelListedgeLabels () const noexcept
 The subset of edge ids to use. More...
 
bool useSubset () const noexcept
 Use a subset of edges. More...
 
bool empty () const noexcept
 Is the effective edge selection empty? More...
 
label size () const noexcept
 The size of edge selection. More...
 
label objectIndex (const label index) const
 Map from shape index to original (non-subset) edge label. More...
 
const edgeoperator[] (const label index) const
 Edge at specified shape index. More...
 
const linePointRef line (const label index) const
 Geometric line for edge at specified shape index. Frequently used. More...
 
point centre (const label index) const
 Representative point (edge centre) at shape index. More...
 
tmp< pointFieldcentres () const
 Representative point cloud for contained shapes. One point per shape, corresponding to the edge centres. More...
 
volumeType getVolumeType (const indexedOctree< treeDataEdge > &, const point &) const
 Get type (inside,outside,mixed,unknown) of point w.r.t. surface. More...
 
bool overlaps (const label index, const treeBoundBox &searchBox) const
 Does (bb of) shape at index searchBox. More...
 
bool overlaps (const label index, const point &centre, const scalar radiusSqr) const
 Does (bb of) shape at index overlap bb. More...
 
void findNearest (const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
 Calculates nearest (to sample) point in shape. More...
 

Static Public Member Functions

static treeBoundBoxList boxes (const edgeList &edges, const pointField &points)
 Calculate and return bounding boxes for all edges. More...
 
static treeBoundBoxList boxes (const edgeList &edges, const pointField &points, const labelRange &range)
 Calculate and return bounding boxes for specified range of edges. More...
 
static treeBoundBoxList boxes (const edgeList &edges, const pointField &points, const labelUList &edgeIds)
 Calculate and return bounding boxes for specified edges. More...
 
static treeBoundBox bounds (const edgeList &edges, const pointField &points)
 Return bounding box of all edges. More...
 
static treeBoundBox bounds (const edgeList &edges, const pointField &points, const labelRange &range)
 Return bounding box of specified range of edges. More...
 
static treeBoundBox bounds (const edgeList &edges, const pointField &points, const labelUList &edgeIds)
 Return bounding box of specified edges. More...
 

Detailed Description

Holds data for octree to work on an edges subset.

Source files

Definition at line 53 of file treeDataEdge.H.

Constructor & Destructor Documentation

◆ treeDataEdge() [1/8]

treeDataEdge ( const bool  cacheBb,
const edgeList edges,
const pointField points 
)

Construct from all edges.

Note
Holds references to edges and points!

◆ treeDataEdge() [2/8]

treeDataEdge ( const bool  cacheBb,
const edgeList edges,
const pointField points,
const labelRange range 
)

Construct from range of edges.

Note
Holds references to edges and points!

◆ treeDataEdge() [3/8]

treeDataEdge ( const bool  cacheBb,
const edgeList edges,
const pointField points,
const labelUList edgeLabels 
)

Construct from selected edges.

Note
Holds references to edges and points!

◆ treeDataEdge() [4/8]

treeDataEdge ( const bool  cacheBb,
const edgeList edges,
const pointField points,
labelList &&  edgeLabels 
)

Construct from selected edges, transferring contents.

Note
Holds references to edges and points!

◆ treeDataEdge() [5/8]

treeDataEdge ( const edgeList edges,
const pointField points 
)
inline

Construct from all edges.

Note
Holds references to edges and points!

Definition at line 222 of file treeDataEdge.H.

◆ treeDataEdge() [6/8]

treeDataEdge ( const edgeList edges,
const pointField points,
const labelRange range 
)
inline

Construct from range of edges.

Note
Holds references to edges and points!

Definition at line 233 of file treeDataEdge.H.

◆ treeDataEdge() [7/8]

treeDataEdge ( const edgeList edges,
const pointField points,
const labelUList edgeLabels 
)
inline

Construct from selected edges.

Note
Holds references to edges and points!

Definition at line 248 of file treeDataEdge.H.

◆ treeDataEdge() [8/8]

treeDataEdge ( const edgeList edges,
const pointField points,
labelList &&  edgeLabels 
)
inline

Construct from selected edges, transferring contents.

Note
Holds references to edges and points!

Definition at line 263 of file treeDataEdge.H.

Member Function Documentation

◆ ClassNameNoDebug()

ClassNameNoDebug ( "treeDataEdge"  )

◆ boxes() [1/3]

static treeBoundBoxList boxes ( const edgeList edges,
const pointField points 
)
static

Calculate and return bounding boxes for all edges.

◆ boxes() [2/3]

static treeBoundBoxList boxes ( const edgeList edges,
const pointField points,
const labelRange range 
)
static

Calculate and return bounding boxes for specified range of edges.

◆ boxes() [3/3]

static treeBoundBoxList boxes ( const edgeList edges,
const pointField points,
const labelUList edgeIds 
)
static

Calculate and return bounding boxes for specified edges.

◆ bounds() [1/4]

static treeBoundBox bounds ( const edgeList edges,
const pointField points 
)
static

Return bounding box of all edges.

Referenced by treeDataEdge::bounds().

Here is the caller graph for this function:

◆ bounds() [2/4]

static treeBoundBox bounds ( const edgeList edges,
const pointField points,
const labelRange range 
)
static

Return bounding box of specified range of edges.

◆ bounds() [3/4]

static treeBoundBox bounds ( const edgeList edges,
const pointField points,
const labelUList edgeIds 
)
static

Return bounding box of specified edges.

◆ nDim()

int nDim ( ) const
inlinenoexcept

Object dimension == 1 (line element)

Definition at line 339 of file treeDataEdge.H.

◆ bounds() [4/4]

Foam::treeBoundBox bounds ( const labelUList indices) const

Return bounding box for the specified edge indices.

Definition at line 270 of file treeDataEdge.C.

References boundBox::add(), treeDataEdge::bounds(), and Foam::constant::electromagnetic::e.

Here is the call graph for this function:

◆ points()

const pointField& points ( ) const
inlinenoexcept

The reference point field.

Definition at line 352 of file treeDataEdge.H.

◆ edges()

const edgeList& edges ( ) const
inlinenoexcept

The original list of edges.

Definition at line 357 of file treeDataEdge.H.

◆ edgeLabels()

const labelList& edgeLabels ( ) const
inlinenoexcept

The subset of edge ids to use.

Definition at line 362 of file treeDataEdge.H.

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

Use a subset of edges.

Definition at line 367 of file treeDataEdge.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

Is the effective edge selection empty?

Definition at line 372 of file treeDataEdge.H.

References UList< T >::empty().

Referenced by refinementFeatures::findNearestEdge().

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

◆ size()

label size ( ) const
inlinenoexcept

The size of edge selection.

Definition at line 380 of file treeDataEdge.H.

References UList< T >::size().

Here is the call graph for this function:

◆ objectIndex()

label objectIndex ( const label  index) const
inline

Map from shape index to original (non-subset) edge label.

Definition at line 388 of file treeDataEdge.H.

Referenced by treeDataEdge::centre(), refinementFeatures::findNearestEdge(), refinementFeatures::findNearestRegionEdge(), treeDataEdge::line(), surfaceFeatures::nearestEdges(), and treeDataEdge::operator[]().

Here is the caller graph for this function:

◆ operator[]()

const edge& operator[] ( const label  index) const
inline

Edge at specified shape index.

Definition at line 396 of file treeDataEdge.H.

References treeDataEdge::objectIndex().

Here is the call graph for this function:

◆ line()

const linePointRef line ( const label  index) const
inline

Geometric line for edge at specified shape index. Frequently used.

Definition at line 404 of file treeDataEdge.H.

References treeDataEdge::objectIndex().

Referenced by refinementFeatures::findNearestEdge(), refinementFeatures::findNearestRegionEdge(), and treeDataEdge::findNearestOp::operator()().

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

◆ centre()

point centre ( const label  index) const
inline

Representative point (edge centre) at shape index.

Definition at line 412 of file treeDataEdge.H.

References treeDataEdge::objectIndex().

Here is the call graph for this function:

◆ centres()

Foam::tmp< Foam::pointField > centres ( ) const

Representative point cloud for contained shapes. One point per shape, corresponding to the edge centres.

Definition at line 290 of file treeDataEdge.C.

References UList< T >::begin(), Foam::constant::electromagnetic::e, tmp< T >::New(), tmp< T >::ref(), and Foam::transform().

Here is the call graph for this function:

◆ getVolumeType()

Foam::volumeType getVolumeType ( const indexedOctree< treeDataEdge > &  oc,
const point sample 
) const

Get type (inside,outside,mixed,unknown) of point w.r.t. surface.

Only makes sense for closed surfaces.

Definition at line 324 of file treeDataEdge.C.

References volumeType::UNKNOWN.

◆ overlaps() [1/2]

bool overlaps ( const label  index,
const treeBoundBox searchBox 
) const

Does (bb of) shape at index searchBox.

Definition at line 334 of file treeDataEdge.C.

References treeBoundBox::intersects().

Here is the call graph for this function:

◆ overlaps() [2/2]

bool overlaps ( const label  index,
const point centre,
const scalar  radiusSqr 
) const

Does (bb of) shape at index overlap bb.

Definition at line 345 of file treeDataEdge.C.

References PointHit< PointType >::distance(), line< Point, PointRef >::nearestDist(), and Foam::sqr().

Here is the call graph for this function:

◆ findNearest()

void findNearest ( const labelUList indices,
const point sample,
scalar &  nearestDistSqr,
label &  nearestIndex,
point nearestPoint 
) const

Calculates nearest (to sample) point in shape.

Returns actual point and distance (squared)

Definition at line 376 of file treeDataEdge.C.

References PointHit< PointType >::distance(), line< Point, PointRef >::nearestDist(), PointHit< PointType >::point(), and Foam::sqr().

Here is the call graph for this function:

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