Adaptagrams
Public Member Functions | List of all members
dialect::BoundingBox Struct Reference

A bounding box, given by the extreme coordinates. More...

#include <graphs.h>

Collaboration diagram for dialect::BoundingBox:
Collaboration graph

Public Member Functions

 BoundingBox (double x, double X, double y, double Y)
 Standard constructor. More...
 
 BoundingBox (void)
 Default constructor. More...
 
BoundingBoxoperator+= (const BoundingBox &rhs)
 Adding two bounding boxes returns the bounding box of their union.
 
std::string repr (void) const
 Write a simple representation of the bounding box.
 
double w (void) const
 Get the width of the box.
 
double h (void) const
 Get the height of the box.
 
interval getInterval (vpsc::Dim dim)
 Get the interval in a given dimension. More...
 
Avoid::Point centre (void) const
 Get the centre of the box.
 
LineSegment_SP buildSideSegment (CardinalDir side) const
 Build a LineSegment representing a side of the box.
 
double perimeter (void) const
 Compute the perimeter of the box.
 

Detailed Description

A bounding box, given by the extreme coordinates.

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

dialect::BoundingBox::BoundingBox ( double  x,
double  X,
double  y,
double  Y 
)
inline

Standard constructor.

Parameters
[in]xLower bound on x-coordinates of the box.
[in]XUpper bound on x-coordinates of the box.
[in]yLower bound on y-coordinates of the box.
[in]YUpper bound on y-coordinates of the box.

◆ BoundingBox() [2/2]

dialect::BoundingBox::BoundingBox ( void  )
inline

Default constructor.

Constructs a bounding box that serves as "zero" when adding boxes together. Can be thought of as the box whose interior consists solely of the point at infinity on the Riemann Sphere.

Member Function Documentation

◆ getInterval()

interval dialect::BoundingBox::getInterval ( vpsc::Dim  dim)
inline

Get the interval in a given dimension.

Parameters
[in]dimThe desired interval's variable dimension; thus, X if you want the box's horizontal interval, Y if you want its vertical interval.

References vpsc::XDIM.

Referenced by dialect::Side::closedInterval().

Here is the caller graph for this function:

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