29 #ifndef CDPL_VIS_RECTANGLE2D_HPP
30 #define CDPL_VIS_RECTANGLE2D_HPP
77 Rectangle2D(
double min_x,
double min_y,
double max_x,
double max_y);
210 void setBounds(
double min_x,
double min_y,
double max_x,
double max_y);
Definition of vector data types.
Definition of the preprocessor macro CDPL_VIS_API.
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Specifies an axis aligned rectangular area in 2D space.
Definition: Rectangle2D.hpp:51
bool isDefined() const
Tells if the rectangle is well defined.
double getWidth() const
Returns the width of the rectangle.
const Math::Vector2D & getMin() const
Returns the minimum point of the rectangle.
void addPoint(double x, double y)
Adds the point (x, y) to the current rectangle.
void setBounds(double min_x, double min_y, double max_x, double max_y)
Sets the minimum point of the rectangle to (min_x, min_y) and the maximum point to (max_x,...
void reset()
Resets the rectangle to an undefinded state.
virtual ~Rectangle2D()
Virtual destructor.
Definition: Rectangle2D.hpp:82
Math::Vector2D getCenter() const
Calculates the center of the rectangle.
void translate(const Math::Vector2D &vec)
Translates the minimum and maximum point of the rectangle by vec.
void setMin(const Math::Vector2D &pt)
Sets the minimum point of the rectangle to pt.
void scale(double factor)
Scales the minimum and maximum point of the rectangle by the specified factor.
bool intersectsRectangle(const Rectangle2D &rect) const
Tests if the interior of this rectangle intersects the rectangle rect.
void addRectangle(const Rectangle2D &rect)
Adds the rectangle rect to the current rectangle.
bool operator==(const Rectangle2D &rect) const
Equality comparison operator.
double getArea() const
Calculates the area of the rectangle.
void setMax(double x, double y)
Sets the maximum point of the rectangle to (x, y).
void addMargin(double width, double height)
Extends the rectangle by adding a margin with the specified width and height.
Rectangle2D(double min_x, double min_y, double max_x, double max_y)
Constructs a rectangle with the minimum point set to (min_x, min_y) and the maximum point set to (max...
void addPoint(const Math::Vector2D &pt)
Adds the point pt to the current rectangle.
void getCenter(Math::Vector2D &ctr) const
Calculates the center of the rectangle and stores the result in ctr.
bool operator!=(const Rectangle2D &rect) const
Inequality comparison operator.
void setBounds(const Math::Vector2D &min, const Math::Vector2D &max)
Sets the minimum point of the rectangle to min and the maximum point to max.
void setMin(double x, double y)
Sets the minimum point of the rectangle to (x, y).
bool containsPoint(double x, double y) const
Tests if the point (x, y) is within the boundary of the rectangle.
bool containsRectangle(const Rectangle2D &rect) const
Tests if the specified rectangle rect is within the boundary of this rectangle.
Rectangle2D(const Math::Vector2D &min, const Math::Vector2D &max)
Constructs a rectangle with the minimum point set to min and the maximum point set to max.
Rectangle2D()
Constructs an undefined rectangle.
bool containsPoint(const Math::Vector2D &pt) const
Tests if the point pt is within the boundary of the rectangle.
void setMax(const Math::Vector2D &pt)
Sets the maximum point of the rectangle to pt.
const Math::Vector2D & getMax() const
Returns the maximum point of the rectangle.
double getHeight() const
Returns the height of the rectangle.
QuaternionVectorAdapter< E > vec(QuaternionExpression< E > &e)
Definition: QuaternionAdapter.hpp:237
CVector< double, 2 > Vector2D
A bounded 2 element vector holding floating point values of type double.
Definition: Vector.hpp:1632
The namespace of the Chemical Data Processing Library.