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]];
149 const point& start = points_[
e.start()];
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]];
167 const pointHit nearHit =
e.line(points_).nearestDist(centre);
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.
void size(const label)
Override size to be inconsistent with allocated storage.
scalar distance() const
Return distance to hit.
const Point & rawPoint() const
Return point with no checking.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Non-pointer based hierarchical recursive searching.
Standard boundBox + extra functionality for use in octree.
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,.
findIntersectOp(const indexedOctree< treeDataEdge > &tree)
findNearestOp(const indexedOctree< treeDataEdge > &tree)
Holds data for octree to work on an edges subset.
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
const labelList & edgeLabels() const
treeDataEdge(const bool cacheBb, const edgeList &edges, const pointField &points, const labelUList &edgeLabels)
Construct from selected edges. !Holds references to edges and points.
const edgeList & edges() const
volumeType getVolumeType(const indexedOctree< treeDataEdge > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
pointField shapePoints() const
Get representative point cloud for all shapes inside.
const pointField & points() const
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
vector point
Point is a vector.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.