38#ifndef Foam_treeDataEdge_H
39#define Foam_treeDataEdge_H
72 const bool useSubset_;
104 scalar& nearestDistSqr,
308 return useSubset_ ? edgeLabels_.empty() : edges_.empty();
314 return useSubset_ ? edgeLabels_.size() : edges_.size();
320 return useSubset_ && index >= 0 ? edgeLabels_[index] : index;
324 const edge&
operator[](
const label index)
const
368 const scalar radiusSqr
378 scalar& nearestDistSqr,
Minimal example by using system/controlDict.functions:
const Vector< Cmpt > & centre(const Foam::UList< Vector< Cmpt > > &) const noexcept
Return this (for point which is a typedef to Vector<scalar>).
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
Non-pointer based hierarchical recursive searching.
A range or interval of labels defined by a start and a size.
line(const Point &from, const Point &to)
Construct from two points.
A class for managing temporary objects.
Standard boundBox with extra functionality for use in octree.
Forward to treeDataEdge findIntersect operations.
findIntersectOp(const indexedOctree< treeDataEdge > &tree)
Forward to treeDataEdge findNearest operations.
findNearestOp(const indexedOctree< treeDataEdge > &tree)
Holds data for octree to work on an edges subset.
bool useSubset() const noexcept
Use a subset of edges.
point centre(const label index) const
Representative point (edge centre) at shape index.
static treeBoundBoxList boxes(const edgeList &edges, const pointField &points)
Calculate and return bounding boxes for all edges.
ClassNameNoDebug("treeDataEdge")
tmp< pointField > centres() const
Representative point cloud for contained shapes. One point per shape, corresponding to the edge centr...
treeDataEdge(const bool cacheBb, const edgeList &edges, const pointField &points)
Construct from all edges.
treeDataEdge(const edgeList &edges, const pointField &points, labelList &&edgeLabels)
Construct from selected edges, transferring contents.
static treeBoundBox bounds(const edgeList &edges, const pointField &points)
Return bounding box of all edges.
void findNearest(const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
bool empty() const noexcept
Is the effective edge selection empty?
int nDim() const noexcept
Object dimension == 1 (line element).
const labelList & edgeLabels() const noexcept
The subset of edge ids to use.
const edgeList & edges() const noexcept
The original list of edges.
const linePointRef line(const label index) const
Geometric line for edge at specified shape index. Frequently used.
const edge & operator[](const label index) const
Edge at specified shape index.
label objectIndex(const label index) const
Map from shape index to original (non-subset) edge label.
treeDataEdge(const edgeList &edges, const pointField &points, const labelRange &range)
Construct from range of edges.
const pointField & points() const noexcept
The reference point field.
label size() const noexcept
The size of edge selection.
treeDataEdge(const edgeList &edges, const pointField &points)
Construct from all edges.
volumeType getVolumeType(const indexedOctree< treeDataEdge > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
bool overlaps(const label index, const treeBoundBox &searchBox) const
Does (bb of) shape at index searchBox.
treeDataEdge(const edgeList &edges, const pointField &points, const labelUList &edgeLabels)
Construct from selected edges.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
#define ClassNameNoDebug(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Namespace for bounding specifications. At the moment, mostly for tables.
List< edge > edgeList
List of edge.
List< label > labelList
A List of labels.
List< treeBoundBox > treeBoundBoxList
A List of treeBoundBox.
line< point, const point & > linePointRef
A line using referred points.
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
Tree tree(triangles.begin(), triangles.end())