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_(edgeLabels),
123 const edge& e = edges_[edgeLabels_[i]];
125 eMids[i] = e.
centre(points_);
150 const edge& e = edges_[edgeLabels_[index]];
153 const point& end = points_[e.
end()];
157 return cubeBb.
intersects(start, end, intersect);
166 const scalar radiusSqr
169 const edge& e = edges_[edgeLabels_[index]];
175 if (distSqr <= radiusSqr)
184 void Foam::treeDataEdge::findNearestOp::operator()
189 scalar& nearestDistSqr,
198 const label index = indices[i];
206 if (distSqr < nearestDistSqr)
208 nearestDistSqr = distSqr;
216 void Foam::treeDataEdge::findNearestOp::operator()
230 scalar nearestDistSqr =
magSqr(linePoint - nearestPoint);
234 const label index = indices[i];
242 scalar dist = e.
line(shape.
points()).nearestDist(ln, ePoint, lnPt);
243 scalar distSqr =
sqr(dist);
245 if (distSqr < nearestDistSqr)
247 nearestDistSqr = distSqr;
250 nearestPoint = ePoint;
254 minPt =
min(ln.start(), ln.end());
261 maxPt =
max(ln.start(), ln.end());
271 bool Foam::treeDataEdge::findIntersectOp::operator()
281 "treeDataEdge::intersects(const label, const point&," 282 "const point&, point&)" PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
const Point & rawPoint() const
Return point with no checking.
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,.
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
volumeType getVolumeType(const indexedOctree< treeDataEdge > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
vector point
Point is a vector.
findNearestOp(const indexedOctree< treeDataEdge > &tree)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
A simple container for copying or transferring objects of type <T>.
findIntersectOp(const indexedOctree< treeDataEdge > &tree)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Standard boundBox + extra functionality for use in octree.
const edgeList & edges() const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
linePointRef line(const pointField &) const
Return edge line.
const pointField & points() const
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Non-pointer based hierarchical recursive searching.
scalar distance() const
Return distance to hit.
Holds data for octree to work on an edges subset.
label end() const
Return end vertex label.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label start() const
Return start vertex label.
const labelList & edgeLabels() const
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
treeDataEdge(const bool cacheBb, const edgeList &edges, const pointField &points, const labelUList &edgeLabels)
Construct from selected edges. !Holds references to edges and points.
pointField shapePoints() const
Get representative point cloud for all shapes inside.
defineTypeNameAndDebug(combustionModel, 0)
point centre(const pointField &) const
Return centre (centroid)