46 template<
class ElementIds>
51 const ElementIds& elemIds
72 template<
class ElementIds>
77 const ElementIds& elemIds
82 for (
const label edgei : elemIds)
84 const edge&
e = edges[edgei];
111 [&](
const edge&
e) {
return treeBoundBox(
e.box(
points)); }
123 const labelRange&
range 151 for (
const edge&
e : edges)
165 const labelRange&
range 186 void Foam::treeDataEdge::update()
226 const labelRange&
range 249 edgeLabels_(edgeLabels),
267 edgeLabels_(
std::move(edgeLabels)),
283 for (
const label index : indices)
285 const edge&
e = edges_[edgeLabels_[index]];
287 bb.
add(points_[
e.first()], points_[
e.second()]);
299 tmp<pointField> tpts;
307 edgeLabels_.cbegin(),
310 [&](label edgei) {
return edges_[edgei].centre(points_); }
322 [&](
const edge&
e) {
return e.centre(points_); }
332 const indexedOctree<treeDataEdge>& oc,
355 const scalar radiusSqr
387 scalar& nearestDistSqr,
392 for (
const label index : indices)
398 if (distSqr < nearestDistSqr)
400 nearestDistSqr = distSqr;
408 void Foam::treeDataEdge::findNearestOp::operator()
413 scalar& nearestDistSqr,
418 tree_.shapes().findNearest
429 void Foam::treeDataEdge::findNearestOp::operator()
445 scalar nearestDistSqr = linePoint.distSqr(nearestPoint);
447 for (
const label index : indices)
455 const scalar distSqr =
sqr(dist);
457 if (distSqr < nearestDistSqr)
459 nearestDistSqr = distSqr;
462 nearestPoint = ePoint;
471 bool Foam::treeDataEdge::findIntersectOp::operator()
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant UList.
static treeBoundBox boundsImpl(const primitiveMesh &mesh, const ElementIds &elemIds)
void size(const label n)
Older name for setAddressableSize.
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.
List< edge > edgeList
List of edge.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
treeDataEdge(const bool cacheBb, const edgeList &edges, const pointField &points)
Construct from all edges.
Holds data for octree to work on an edges subset.
List< treeBoundBox > treeBoundBoxList
A List of treeBoundBox.
An enumeration wrapper for classification of a location as being inside/outside of a volume...
static treeBoundBoxList boxesImpl(const primitiveMesh &mesh, const ElementIds &elemIds)
UList< label > labelUList
A UList of labels.
findNearestOp(const indexedOctree< treeDataEdge > &tree)
static treeBoundBox bounds(const edgeList &edges, const pointField &points)
Return bounding box of all edges.
defineTypeName(manifoldCellsMeshObject)
tmp< pointField > centres() const
Representative point cloud for contained shapes. One point per shape, corresponding to the edge centr...
void add(const boundBox &bb)
Extend to include the second box.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
bool intersects(const point &overallStart, const vector &overallVec, const point &start, const point &end, point &pt, direction &ptBits) const
Intersects segment; set point to intersection position and face,.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
findIntersectOp(const indexedOctree< treeDataEdge > &tree)
Tree tree(triangles.begin(), triangles.end())
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
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.
vector point
Point is a vector.
Non-pointer based hierarchical recursive searching.
scalar distance() const noexcept
Return distance to hit.
const point_type & point() const noexcept
Return the point, no checks.
Standard boundBox with extra functionality for use in octree.
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant UList.
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.
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.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
volumeType getVolumeType(const indexedOctree< treeDataEdge > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.