preCICE v3.1.2
|
An axis-aligned bounding box around a (partition of a) mesh. More...
#include <BoundingBox.hpp>
Public Member Functions | |
BoundingBox (int dimension) | |
BoundingBox (std::vector< double > bounds) | |
BoundingBox (Eigen::VectorXd boundMin, Eigen::VectorXd boundMax) | |
Constructor accepting Eigen::VectorXd. | |
BoundingBox (const BoundingBox &)=default | |
Special Members. | |
BoundingBox (BoundingBox &&)=default | |
BoundingBox & | operator= (const BoundingBox &bb)=default |
BoundingBox & | operator= (BoundingBox &&bb)=default |
bool | operator== (const BoundingBox &otherBB) const |
Comparison Operator. | |
bool | empty () const |
Check if every dimension's length is equal to zero. | |
bool | isDefault () const |
void | expandBy (const BoundingBox &otherBB) |
Expand bounding box using another bounding box. | |
void | expandBy (const Vertex &vertices) |
Expand bounding box using vertices. | |
void | expandBy (double value) |
void | scaleBy (double safetyFactor) |
Increase the size of bounding box by safety margin. | |
bool | contains (const Vertex &vertex) const |
Checks if vertex in contained in _bb. | |
bool | overlapping (const BoundingBox &otherBB) const |
Checks whether two bounding boxes are overlapping. | |
Eigen::VectorXd | center () const |
Returns the Center Of Gravity of the mesh. | |
Eigen::VectorXd | minCorner () const |
the min corner of the bounding box | |
Eigen::VectorXd | maxCorner () const |
the max corner of the bounding box | |
double | getEdgeLength (int axis) const |
returns the edge length of a specific axis | |
double | longestEdgeLength () const |
returns the maximum length of the bounding box in any dimension | |
double | getArea (std::vector< bool > deadAxis) |
Calculate the area of bounding box. | |
const std::vector< double > | dataVector () const |
Return data as std::vector. | |
int | getDimension () const |
Getter dimension of the bounding box. | |
void | print (std::ostream &out) const |
Print bounds of bounding box, output operator overload. | |
Private Attributes | |
int | _dimensions |
Number of dimensions (2 or 3) | |
Eigen::VectorXd | _boundMin |
Eigen::VectorXd | _boundMax |
Static Private Attributes | |
static logging::Logger | _log {"mesh::BoundingBox"} |
An axis-aligned bounding box around a (partition of a) mesh.
Definition at line 18 of file BoundingBox.hpp.
|
explicit |
Definition at line 40 of file BoundingBox.cpp.
|
explicit |
|
explicit |
Constructor accepting Eigen::VectorXd.
boundMin | vertex at minCorner |
boundMax | vertex at maxCorner |
Definition at line 16 of file BoundingBox.cpp.
|
default |
Special Members.
|
default |
Eigen::VectorXd precice::mesh::BoundingBox::center | ( | ) | const |
Returns the Center Of Gravity of the mesh.
Returns a vector of doubles, size d, each dimension computed as cog = (max - min) / 2 + min
Definition at line 83 of file BoundingBox.cpp.
bool precice::mesh::BoundingBox::contains | ( | const Vertex & | vertex | ) | const |
Checks if vertex in contained in _bb.
Definition at line 70 of file BoundingBox.cpp.
const std::vector< double > precice::mesh::BoundingBox::dataVector | ( | ) | const |
Return data as std::vector.
Definition at line 128 of file BoundingBox.cpp.
bool precice::mesh::BoundingBox::empty | ( | ) | const |
Check if every dimension's length is equal to zero.
Definition at line 60 of file BoundingBox.cpp.
void precice::mesh::BoundingBox::expandBy | ( | const BoundingBox & | otherBB | ) |
Expand bounding box using another bounding box.
Definition at line 137 of file BoundingBox.cpp.
void precice::mesh::BoundingBox::expandBy | ( | const Vertex & | vertices | ) |
Expand bounding box using vertices.
Definition at line 145 of file BoundingBox.cpp.
void precice::mesh::BoundingBox::expandBy | ( | double | value | ) |
Expand bounding box using a double value in all dimensions Using this method, BoundingBox should not be in the default state; otherwise, it will make ReceivedPartitionTest fail because of incorrect connectionMapSize
Definition at line 154 of file BoundingBox.cpp.
double precice::mesh::BoundingBox::getArea | ( | std::vector< bool > | deadAxis | ) |
Calculate the area of bounding box.
Definition at line 112 of file BoundingBox.cpp.
int precice::mesh::BoundingBox::getDimension | ( | ) | const |
Getter dimension of the bounding box.
Definition at line 123 of file BoundingBox.cpp.
double precice::mesh::BoundingBox::getEdgeLength | ( | int | axis | ) | const |
returns the edge length of a specific axis
Definition at line 100 of file BoundingBox.cpp.
bool precice::mesh::BoundingBox::isDefault | ( | ) | const |
Check whether the bounding box is at default state or not all the values of _boundMin = std::numeric_limits<double>::max() all the values of _boundMax = std::numeric_limits<double>::lowest()
Definition at line 65 of file BoundingBox.cpp.
double precice::mesh::BoundingBox::longestEdgeLength | ( | ) | const |
returns the maximum length of the bounding box in any dimension
Definition at line 107 of file BoundingBox.cpp.
Eigen::VectorXd precice::mesh::BoundingBox::maxCorner | ( | ) | const |
the max corner of the bounding box
Definition at line 95 of file BoundingBox.cpp.
Eigen::VectorXd precice::mesh::BoundingBox::minCorner | ( | ) | const |
the min corner of the bounding box
Definition at line 90 of file BoundingBox.cpp.
|
default |
|
default |
bool precice::mesh::BoundingBox::operator== | ( | const BoundingBox & | otherBB | ) | const |
Comparison Operator.
Definition at line 53 of file BoundingBox.cpp.
bool precice::mesh::BoundingBox::overlapping | ( | const BoundingBox & | otherBB | ) | const |
Checks whether two bounding boxes are overlapping.
Definition at line 172 of file BoundingBox.cpp.
void precice::mesh::BoundingBox::print | ( | std::ostream & | out | ) | const |
Print bounds of bounding box, output operator overload.
Definition at line 183 of file BoundingBox.cpp.
void precice::mesh::BoundingBox::scaleBy | ( | double | safetyFactor | ) |
Increase the size of bounding box by safety margin.
Definition at line 162 of file BoundingBox.cpp.
|
private |
_boundMax defining the bounding box, with maximum coordinates in each direction (x_max, y_max) when _dimensions=2; (x_max, y_max, z_max) when _dimensions=3;
Definition at line 129 of file BoundingBox.hpp.
|
private |
_boundMin defining the bounding box, with minimum coordinates in each direction (x_min, y_min) when _dimensions=2; (x_min, y_min, z_min) when _dimensions=3;
Definition at line 124 of file BoundingBox.hpp.
|
private |
Number of dimensions (2 or 3)
Definition at line 119 of file BoundingBox.hpp.
|
staticprivate |
Definition at line 116 of file BoundingBox.hpp.