41 const edge& e = edges_[edgeI];
42 const point& p0 = points_[e[0]];
43 const point& p1 = points_[e[1]];
45 return treeBoundBox(
min(p0, p1),
max(p0, p1));
49 void Foam::treeDataEdge::update()
53 bbs_.setSize(edgeLabels_.size());
57 bbs_[i] = calcBb(edgeLabels_[i]);
75 edgeLabels_(edgeLabels),
92 edgeLabels_(move(edgeLabels)),
123 const edge& e = edges_[edgeLabels_[i]];
125 eMids[i] = e.
centre(points_);
147 const edge& e = edges_[edgeLabels_[index]];
150 const point& end = points_[e.
end()];
154 return cubeBb.
intersects(start, end, intersect);
162 const scalar radiusSqr
165 const edge& e = edges_[edgeLabels_[index]];
171 if (distSqr <= radiusSqr)
180 void Foam::treeDataEdge::findNearestOp::operator()
185 scalar& nearestDistSqr,
194 const label index = indices[i];
202 if (distSqr < nearestDistSqr)
204 nearestDistSqr = distSqr;
212 void Foam::treeDataEdge::findNearestOp::operator()
226 scalar nearestDistSqr =
magSqr(linePoint - nearestPoint);
230 const label index = indices[i];
238 scalar dist = e.
line(shape.
points()).nearestDist(ln, ePoint, lnPt);
239 scalar distSqr =
sqr(dist);
241 if (distSqr < nearestDistSqr)
243 nearestDistSqr = distSqr;
246 nearestPoint = ePoint;
250 minPt =
min(ln.start(), ln.end());
257 maxPt =
max(ln.start(), ln.end());
267 bool Foam::treeDataEdge::findIntersectOp::operator()
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const pointField & points() const
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Holds data for octree to work on an edges subset.
point centre(const pointField &) const
Return centre (centroid)
findNearestOp(const indexedOctree< treeDataEdge > &tree)
linePointRef line(const pointField &) const
Return edge line.
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 point labels. The functionality it provides supports the discretisation on a...
findIntersectOp(const indexedOctree< treeDataEdge > &tree)
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const Point & rawPoint() const
Return point with no checking.
treeDataEdge(const bool cacheBb, const edgeList &edges, const pointField &points, const labelUList &edgeLabels)
Construct from selected edges. !Holds references to edges and points.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const edgeList & edges() const
vector point
Point is a vector.
Non-pointer based hierarchical recursive searching.
pointField shapePoints() const
Get representative point cloud for all shapes inside.
label end() const
Return end vertex label.
Standard boundBox + extra functionality for use in octree.
scalar distance() const
Return distance to hit.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
const labelList & edgeLabels() const
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
label start() const
Return start vertex label.
volumeType getVolumeType(const indexedOctree< treeDataEdge > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.