|
ActiveLib
|
#include <Box.h>

Public Types | |
| using | Unique = std::unique_ptr<Box> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<Box> |
| Shared pointer. | |
| using | Option = std::optional<Box> |
| Optional. | |
Public Member Functions | |
| Box () | |
| Box (const Point &origin, const Point &end) | |
| Box (double x1, double y1, double z1, double x2, double y2, double z2) | |
| Box (double width, double depth) | |
| ~Box () | |
| bool | operator== (const Box &ref) const |
| bool | operator!= (const Box &ref) const |
| Box & | operator= (const Box &source) |
| Box | operator+ (const Point &offset) const |
| Box & | operator+= (const Point &offset) |
| Box | operator- (const Point &offset) const |
| Box & | operator-= (const Point &offset) |
| Box | operator* (double scale) const |
| Box & | operator*= (double scale) |
| Box | operator/ (double scale) const |
| Box & | operator/= (double scale) |
| bool | isEqual2D (const Box &ref, double prec=math::eps) const |
| bool | isEqual3D (const Box &ref, double prec=math::eps) const |
| Point | getCentre () const |
| Point | getAnchor2D (Anchor2D anchor) const |
| double | getArea () const |
| double | getVolume () const |
| double | getWidth () const |
| double | getDepth () const |
| double | getHeight () const |
| double | getMaxLength () const |
| Position | positionOf2D (const Point &ref, double prec=math::eps) const |
| Position | positionOf3D (const Point &ref, double prec=math::eps) const |
| bool | encloses2D (const Box &ref, double prec=math::eps) const |
| bool | encloses3D (const Box &ref, double prec=math::eps) const |
| bool | overlaps2D (const Box &ref, double prec=math::eps) const |
| void | moveTo (const Point &position) |
| void | setCentre (const Point ¢re) |
| void | merge (const Point &ref) |
| void | merge (const Box &ref) |
| void | sort () |
| void | magnify (double scale) |
| void | resize (double len) |
| void | rotate (double angle) |
Public Attributes | |
| Point | origin |
| Box origin (for diagonally opposite points) | |
| Point | end |
| Box end. | |
Class to represent a box (rectilinear bounds in 3 dimensions described by 2 diagonally opposite points)
|
inline |
Constructor

Constructor
| origin | One corner of the box |
| end | The opposite corner of the box |
|
inline |
Constructor
| x1 | Bounding coordinates of the box |
|
inline |
Constructor
| width | The box width |
| depth | The box depth |
|
inline |
Destructor
Determine if the this encloses a specified box in 2D
| ref | The reference box |
| prec | The required precision |


Determine if the this encloses a specified box in 3D
| ref | The reference box |
| prec | The required precision |

Get the position of a specified 2D anchor
| anchor | The required anchor |


| double Box::getArea | ( | ) | const |
Get the box 2D area

|
inline |
Get the centre point of the box

|
inline |
Get the box depth

|
inline |
Get the box height

| double Box::getMaxLength | ( | ) | const |
Get the greatest length in any dimension

| double Box::getVolume | ( | ) | const |
Get the box volume

|
inline |
Get the box width

Determine if two boxes are equal in 2D
| ref | The box to compare with this |
| prec | The required precision |

Determine if two boxes are equal
| ref | The box to compare with this |
| prec | The required precision |


| void Box::magnify | ( | double | scale | ) |
Scale the box whilst maintaining a common centre
| scale | The ratio to scale the box by |

| void Box::merge | ( | const Box & | ref | ) |
Merge the specified box into the box bounds
| ref | The box to merge |

| void Box::merge | ( | const Point & | ref | ) |
Merge the specified point into the box bounds
| ref | The point to merge |


|
inline |
Move the origin to the specified location (retaining the overall bounds)
| position | The position to move to |

|
inline |
Inequality operator
| ref | The box to compare with this |

| Box Box::operator* | ( | double | scale | ) | const |
Multiplication operator
| scale | The amount to multiply the box by |

| Box & Box::operator*= | ( | double | scale | ) |
Multiplication with assignment operator
| scale | The amount to multiply the box by |
Addition operator
| offset | The amount to add to the box |

Addition with assignment operator
| offset | The amount to add to the box |
Subtraction operator
| offset | The amount to subtract from the box |

Subtraction with assignment operator
| offset | The amount to subtract from the box |
|
inline |
Division operator
| scale | The amount to divide the box bounds by |
|
inline |
Division with assignment operator
| scale | The amount to divide the box bounds by |
Assignment operator
| source | The object to copy |

|
inline |
Equality operator
| ref | The box to compare with this |

Determine if the this overlaps a another box in 2D
| ref | The reference box |
| prec | The required precision |
Determine the relationship of a point to the box in 2D
| ref | The point to test |
| prec | The required precision |


Determine the relationship of a point to the box
| ref | The point to test |
| prec | The required precision |

| void Box::resize | ( | double | len | ) |
Resize the box whilst maintaining a common centre
| len | The amount to adjust the box bounds by |

| void Box::rotate | ( | double | angle | ) |
Rotate the box (calculate a new bounding box from the rotated box)
| angle | The rotation angle |

|
inline |
Set the centre point of the box
| centre | The box centre point |


| void Box::sort | ( | ) |
Sort the box bounds in ascending order
