- resets min/max to be identical to the specified value,
which can be more convenient (and slightly more efficient) than doing
a full reset followed by add()
- additional MinMax intersects() query, which works like overlaps()
but with exclusive checks at the ends
- provide MinMax::operator&=() to replace (unused) intersect() method
ENH: single/double value reset method for boundBox
- boundBox::operator&=() to replace (rarely used) intersect() method.
Deprecate boundBox::intersect() to avoid confusion with various
intersects() method
COMP: provide triangleFwd.H
- construct boundBox from Pair<point> of min/max limits,
make sortable
- additional bounding box intersections (linePointRef), add noexcept
- templated access for boundBox hex-corners
(used to avoid temporary point field).
Eg, unrolled plane/bound-box intersection with early exit
- bounding box grow() to expand box by absolute amounts
Eg,
bb.grow(ROOTVSMALL); // Or: bb.grow(point::uniform(ROOTVSMALL));
vs
bb.min() -= point::uniform(ROOTVSMALL);
bb.max() += point::uniform(ROOTVSMALL);
- treeBoundBox bounding box extend with two or three parameters.
The three parameter version includes grow(...) for reduced writing.
Eg,
bb = bb.extend(rndGen, 1e-4, ROOTVSMALL);
vs
bb = bb.extend(rndGen, 1e-4);
bb.min() -= point::uniform(ROOTVSMALL);
bb.max() += point::uniform(ROOTVSMALL);
This also permits use as const variables or parameter passing.
Eg,
const treeBoundBox bb
(
treeBoundBox(some_points).extend(rndGen, 1e-4, ROOTVSMALL)
);
- change contiguous from a series of global functions to separate
templated traits classes:
- is_contiguous
- is_contiguous_label
- is_contiguous_scalar
The static constexpr 'value' and a constexpr conversion operator
allow use in template expressions. The change also makes it much
easier to define general traits and to inherit from them.
The is_contiguous_label and is_contiguous_scalar are special traits
for handling data of homogeneous components of the respective types.
- a valid() method (same as !empty() call) for consistency with other
containers and data types
- a centre() method (same as midpoint() method) for consistency with
other OpenFOAM geometric entities
- allows use with any container with begin(), end() and where the
"*iterator" dereference returns a label, which is used for indexing
into the list of points.
This container could be labelUList, bitSet, labelHashSet, etc
- signedDistance() method is like distance() but retains
the positive/negative sign for the side of the plane.
- the sign() method returns the sign as -1,0,+1 integer for
classification purposes where it is important to distinguish between
a zero value and a positive value (eg, for cutting). Optional
tolerance can be supplied to round for zero.
- refactor and inlined simple and frequently used methods.
- add boundBox faceCentre() method, which can be useful for creating
clipping planes from a bounding box.
Relocated treeBoundBox faceNormals to boundBox since they apply
equally there - the meaning of the faces (x-min, x-max, etc)
is the same, even if the point addressing for the faces differs.
- The code create a box with a (0,0,0) point.
The new definition is more logical and makes it very easy to grow
the bounding box to include new points. It also simplifies much of
the logic in the constructors.
- Use ROOTVGREAT instead of VGREAT for sizing greatBox and invertedBox.
Avoids some overflow issues reported by Mattijs (thus GREAT has been
used in treeBoundBox), but might still need further revision.
- Constructor for bounding box of a single point.
- add(boundBox), add(point) ...
-> Extend box to enclose the second box or point(s).
Eg,
bb.add(pt);
vs.
bb.min() = Foam::min(bb.min(), pt);
bb.max() = Foam::max(bb.max(), pt);
Also works with other bounding boxes.
Eg,
bb.add(bb2);
// OR
bb += bb2;
vs.
bb.min() = Foam::min(bb.min(), bb2.min());
bb.max() = Foam::max(bb.max(), bb2.max());
'+=' operator allows the reduction to be used in parallel
gather/scatter operations.
A global '+' operator is not currently needed.
Note: may be useful in the future to have a 'clear()' method
that resets to a zero-sized (inverted) box.
STYLE: make many bounding box constructors explicit
reduce()
- parallel reduction of min/max values.
Reduces coding for the callers.
Eg,
bb.reduce();
instead of the previous method:
reduce(bb.min(), minOp<point>());
reduce(bb.max(), maxOp<point>());
STYLE:
- use initializer list for creating static content
- use point::min/point::max when defining standard boxes
Conflicts:
applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C
applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/createShellMesh.C
applications/utilities/surface/surfaceCheck/surfaceCheck.C
src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C
src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C
src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C
NOTE: also needed to strip trailing space/lines in various files
Keeping both functions to ensure that the octant ordering specified in
treeBoundBox is obeyed at the octree level, irrespective of the implementation
of the basic boundBox.
- added boundBox(const tmp<pointField>&) constructor for use with
coordinate systems
- moved some methods from treeBoundBox to boundBox and use VectorSpace ops
- boundBox::invertedBox is useful for initializing our own calculations
- NOTE treeBoundBox::greatBox is still in place, since it uses GREAT
instead of VGREAT. If this is only historical, we can drop it.