38 #ifndef Foam_treeDataEdge_H 39 #define Foam_treeDataEdge_H 52 template<
class Type>
class indexedOctree;
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,
void size(const label n)
Older name for setAddressableSize.
bool empty() const noexcept
Is the effective edge selection empty?
static treeBoundBoxList boxes(const edgeList &edges, const pointField &points)
Calculate and return bounding boxes for all edges.
const edgeList & edges() const noexcept
The original list of edges.
bool useSubset() const noexcept
Use a subset of edges.
treeDataEdge(const bool cacheBb, const edgeList &edges, const pointField &points)
Construct from all edges.
A range or interval of labels defined by a start and a size.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
Holds data for octree to work on an edges subset.
An enumeration wrapper for classification of a location as being inside/outside of a volume...
label objectIndex(const label index) const
Map from shape index to original (non-subset) edge label.
UList< label > labelUList
A UList of labels.
findNearestOp(const indexedOctree< treeDataEdge > &tree)
label size() const noexcept
The size of edge selection.
static treeBoundBox bounds(const edgeList &edges, const pointField &points)
Return bounding box of all edges.
tmp< pointField > centres() const
Representative point cloud for contained shapes. One point per shape, corresponding to the edge centr...
vectorField pointField
pointField is a vectorField.
line< point, const point & > linePointRef
A line using referred points.
point centre(const label index) const
Representative point (edge centre) at shape index.
List< edge > edgeList
A List of edges.
findIntersectOp(const indexedOctree< treeDataEdge > &tree)
Tree tree(triangles.begin(), triangles.end())
Forward to treeDataEdge findNearest operations.
ClassNameNoDebug("treeDataEdge")
bool overlaps(const label index, const treeBoundBox &searchBox) const
Does (bb of) shape at index searchBox.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Forward to treeDataEdge findIntersect operations.
treeDataEdge(const edgeList &edges, const pointField &points)
Construct from all edges.
int nDim() const noexcept
Object dimension == 1 (line element)
vector point
Point is a vector.
Non-pointer based hierarchical recursive searching.
const labelList & edgeLabels() const noexcept
The subset of edge ids to use.
Standard boundBox with extra functionality for use in octree.
const pointField & points() const noexcept
The reference point field.
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.
List< label > labelList
A List of labels.
A class for managing temporary objects.
void findNearest(const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
volumeType getVolumeType(const indexedOctree< treeDataEdge > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.