preCICE v3.1.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
precice::mesh::BoundingBox Class Reference

An axis-aligned bounding box around a (partition of a) mesh. More...

#include <BoundingBox.hpp>

Collaboration diagram for precice::mesh::BoundingBox:
[legend]

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
 
BoundingBoxoperator= (const BoundingBox &bb)=default
 
BoundingBoxoperator= (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"}
 

Detailed Description

An axis-aligned bounding box around a (partition of a) mesh.

Definition at line 18 of file BoundingBox.hpp.

Constructor & Destructor Documentation

◆ BoundingBox() [1/5]

precice::mesh::BoundingBox::BoundingBox ( int dimension)
explicit

Definition at line 40 of file BoundingBox.cpp.

◆ BoundingBox() [2/5]

precice::mesh::BoundingBox::BoundingBox ( std::vector< double > bounds)
explicit

Definition at line 27 of file BoundingBox.cpp.

Here is the call graph for this function:

◆ BoundingBox() [3/5]

precice::mesh::BoundingBox::BoundingBox ( Eigen::VectorXd boundMin,
Eigen::VectorXd boundMax )
explicit

Constructor accepting Eigen::VectorXd.

Parameters
boundMinvertex at minCorner
boundMaxvertex at maxCorner

Definition at line 16 of file BoundingBox.cpp.

◆ BoundingBox() [4/5]

precice::mesh::BoundingBox::BoundingBox ( const BoundingBox & )
default

Special Members.

◆ BoundingBox() [5/5]

precice::mesh::BoundingBox::BoundingBox ( BoundingBox && )
default

Member Function Documentation

◆ center()

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.

Here is the call graph for this function:

◆ contains()

bool precice::mesh::BoundingBox::contains ( const Vertex & vertex) const

Checks if vertex in contained in _bb.

Definition at line 70 of file BoundingBox.cpp.

Here is the call graph for this function:

◆ dataVector()

const std::vector< double > precice::mesh::BoundingBox::dataVector ( ) const

Return data as std::vector.

Definition at line 128 of file BoundingBox.cpp.

Here is the call graph for this function:

◆ empty()

bool precice::mesh::BoundingBox::empty ( ) const

Check if every dimension's length is equal to zero.

Definition at line 60 of file BoundingBox.cpp.

Here is the call graph for this function:

◆ expandBy() [1/3]

void precice::mesh::BoundingBox::expandBy ( const BoundingBox & otherBB)

Expand bounding box using another bounding box.

Definition at line 137 of file BoundingBox.cpp.

Here is the call graph for this function:

◆ expandBy() [2/3]

void precice::mesh::BoundingBox::expandBy ( const Vertex & vertices)

Expand bounding box using vertices.

Definition at line 145 of file BoundingBox.cpp.

Here is the call graph for this function:

◆ expandBy() [3/3]

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.

Here is the call graph for this function:

◆ getArea()

double precice::mesh::BoundingBox::getArea ( std::vector< bool > deadAxis)

Calculate the area of bounding box.

Definition at line 112 of file BoundingBox.cpp.

Here is the call graph for this function:

◆ getDimension()

int precice::mesh::BoundingBox::getDimension ( ) const

Getter dimension of the bounding box.

Definition at line 123 of file BoundingBox.cpp.

◆ getEdgeLength()

double precice::mesh::BoundingBox::getEdgeLength ( int axis) const

returns the edge length of a specific axis

Definition at line 100 of file BoundingBox.cpp.

◆ isDefault()

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.

◆ longestEdgeLength()

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.

◆ maxCorner()

Eigen::VectorXd precice::mesh::BoundingBox::maxCorner ( ) const

the max corner of the bounding box

Definition at line 95 of file BoundingBox.cpp.

◆ minCorner()

Eigen::VectorXd precice::mesh::BoundingBox::minCorner ( ) const

the min corner of the bounding box

Definition at line 90 of file BoundingBox.cpp.

◆ operator=() [1/2]

BoundingBox & precice::mesh::BoundingBox::operator= ( BoundingBox && bb)
default

◆ operator=() [2/2]

BoundingBox & precice::mesh::BoundingBox::operator= ( const BoundingBox & bb)
default

◆ operator==()

bool precice::mesh::BoundingBox::operator== ( const BoundingBox & otherBB) const

Comparison Operator.

Definition at line 53 of file BoundingBox.cpp.

◆ overlapping()

bool precice::mesh::BoundingBox::overlapping ( const BoundingBox & otherBB) const

Checks whether two bounding boxes are overlapping.

Definition at line 172 of file BoundingBox.cpp.

◆ print()

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.

◆ scaleBy()

void precice::mesh::BoundingBox::scaleBy ( double safetyFactor)

Increase the size of bounding box by safety margin.

Definition at line 162 of file BoundingBox.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _boundMax

Eigen::VectorXd precice::mesh::BoundingBox::_boundMax
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.

◆ _boundMin

Eigen::VectorXd precice::mesh::BoundingBox::_boundMin
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.

◆ _dimensions

int precice::mesh::BoundingBox::_dimensions
private

Number of dimensions (2 or 3)

Definition at line 119 of file BoundingBox.hpp.

◆ _log

logging::Logger precice::mesh::BoundingBox::_log {"mesh::BoundingBox"}
staticprivate

Definition at line 116 of file BoundingBox.hpp.


The documentation for this class was generated from the following files: