Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Public Attributes | List of all members
om::graphics::gui::base::Rectangle Class Reference

A class that represents a rectangle positioned relative to a parent bounding box origin. More...

#include <omGraphicsGUIRectangle.h>

Public Member Functions

 Rectangle ()
 Create a new rectangle that is position at the bottom left origin with 0 width and height. More...
 
 Rectangle (const Vector2f &newSize, const Vector2f &newPosition=Vector2f(), const Origin &newPositionOrigin=Origin())
 Create a new rectangle which has the specified size, position, and origin. More...
 
 Rectangle (const Vector3f &newSize, const Vector3f &newPosition=Vector3f(), const Origin &newPositionOrigin=Origin())
 Create a new rectangle which has the specified size, position, and origin. More...
 
Vector2f transformToLocal (const Vector2f &point, const AABB2f &parentBounds) const
 Transform a 2D point in the parent coordinate system into this rectangles's coordinate system. More...
 
Vector3f transformToLocal (const Vector3f &point, const AABB3f &parentBounds) const
 Transform a 3D point in the parent coordinate system into this rectangles's coordinate system. More...
 
Vector2f transformFromLocal (const Vector2f &point, const AABB2f &parentBounds) const
 Transform a 2D point in this rectangle's local coordinate system into its parent's coordinate system. More...
 
Vector3f transformFromLocal (const Vector3f &point, const AABB3f &parentBounds) const
 Transform a 3D point in this rectangle's local coordinate system into its parent's coordinate system. More...
 
Vector2f transformVectorToLocal (const Vector2f &vector) const
 Transform a 2D vector in the parent coordinate system into this rectangles's coordinate system. More...
 
Vector3f transformVectorToLocal (const Vector3f &vector) const
 Transform a 3D vector in the parent coordinate system into this rectangles's coordinate system. More...
 
Vector2f transformVectorFromLocal (const Vector2f &vector) const
 Transform a 2D vector in this rectangle's local coordinate system into its parent's coordinate system. More...
 
Vector3f transformVectorFromLocal (const Vector3f &vector) const
 Transform a 3D vector in this rectangle's local coordinate system into its parent's coordinate system. More...
 
Vector3f getSizeInParent () const
 Return the 3D size of this rectangle's bounding box in its parent coordinate frame. More...
 
AABB2f getBoundsInParent (const AABB2f &parentBounds) const
 Return the 2D bounding box of this rectangle in the coordinate frame of the specified parent bounding box. More...
 
AABB3f getBoundsInParent (const AABB3f &parentBounds) const
 Return the 3D bounding box of this rectangle in the coordinate frame of the specified parent bounding box. More...
 
Bool containsLocalPoint (const Vector2f &point) const
 Return whether or not the specified local point is contained within this rectangle. More...
 
Bool containsLocalPoint (const Vector3f &point) const
 Return whether or not the specified local point is contained within this rectangle. More...
 
Matrix4f getTransformMatrix (const AABB3f &parentBounds) const
 Return the rectangle-to-parent homogeneous transformation matrix. More...
 

Public Attributes

Vector3f size
 A 3D vector indicating the width, height, and depth of this rectangle before scaling. More...
 
Transform3f transform
 A 3D transformation from rectangle-space to the rectangle's parent coordinate frame. More...
 
Origin origin
 An object representing the alignment of the coordinate origin for this rectangle. More...
 

Detailed Description

A class that represents a rectangle positioned relative to a parent bounding box origin.

Constructor & Destructor Documentation

om::graphics::gui::base::Rectangle::Rectangle ( )
inline

Create a new rectangle that is position at the bottom left origin with 0 width and height.

om::graphics::gui::base::Rectangle::Rectangle ( const Vector2f newSize,
const Vector2f newPosition = Vector2f(),
const Origin newPositionOrigin = Origin() 
)
inline

Create a new rectangle which has the specified size, position, and origin.

om::graphics::gui::base::Rectangle::Rectangle ( const Vector3f newSize,
const Vector3f newPosition = Vector3f(),
const Origin newPositionOrigin = Origin() 
)
inline

Create a new rectangle which has the specified size, position, and origin.

Member Function Documentation

Vector2f om::graphics::gui::base::Rectangle::transformToLocal ( const Vector2f point,
const AABB2f parentBounds 
) const

Transform a 2D point in the parent coordinate system into this rectangles's coordinate system.

Vector3f om::graphics::gui::base::Rectangle::transformToLocal ( const Vector3f point,
const AABB3f parentBounds 
) const

Transform a 3D point in the parent coordinate system into this rectangles's coordinate system.

Vector2f om::graphics::gui::base::Rectangle::transformFromLocal ( const Vector2f point,
const AABB2f parentBounds 
) const

Transform a 2D point in this rectangle's local coordinate system into its parent's coordinate system.

Vector3f om::graphics::gui::base::Rectangle::transformFromLocal ( const Vector3f point,
const AABB3f parentBounds 
) const

Transform a 3D point in this rectangle's local coordinate system into its parent's coordinate system.

Vector2f om::graphics::gui::base::Rectangle::transformVectorToLocal ( const Vector2f vector) const

Transform a 2D vector in the parent coordinate system into this rectangles's coordinate system.

Vector3f om::graphics::gui::base::Rectangle::transformVectorToLocal ( const Vector3f vector) const

Transform a 3D vector in the parent coordinate system into this rectangles's coordinate system.

Vector2f om::graphics::gui::base::Rectangle::transformVectorFromLocal ( const Vector2f vector) const

Transform a 2D vector in this rectangle's local coordinate system into its parent's coordinate system.

Vector3f om::graphics::gui::base::Rectangle::transformVectorFromLocal ( const Vector3f vector) const

Transform a 3D vector in this rectangle's local coordinate system into its parent's coordinate system.

Vector3f om::graphics::gui::base::Rectangle::getSizeInParent ( ) const
inline

Return the 3D size of this rectangle's bounding box in its parent coordinate frame.

The method computes the projected size of this rectangle along its parent's coordinate axes.

AABB2f om::graphics::gui::base::Rectangle::getBoundsInParent ( const AABB2f parentBounds) const
inline

Return the 2D bounding box of this rectangle in the coordinate frame of the specified parent bounding box.

AABB3f om::graphics::gui::base::Rectangle::getBoundsInParent ( const AABB3f parentBounds) const
inline

Return the 3D bounding box of this rectangle in the coordinate frame of the specified parent bounding box.

Bool om::graphics::gui::base::Rectangle::containsLocalPoint ( const Vector2f point) const
inline

Return whether or not the specified local point is contained within this rectangle.

Bool om::graphics::gui::base::Rectangle::containsLocalPoint ( const Vector3f point) const
inline

Return whether or not the specified local point is contained within this rectangle.

Matrix4f om::graphics::gui::base::Rectangle::getTransformMatrix ( const AABB3f parentBounds) const

Return the rectangle-to-parent homogeneous transformation matrix.

Member Data Documentation

Vector3f om::graphics::gui::base::Rectangle::size

A 3D vector indicating the width, height, and depth of this rectangle before scaling.

Transform3f om::graphics::gui::base::Rectangle::transform

A 3D transformation from rectangle-space to the rectangle's parent coordinate frame.

Origin om::graphics::gui::base::Rectangle::origin

An object representing the alignment of the coordinate origin for this rectangle.

This includes the position of the parent coordinate system's origin, but also the location of the reference point on the rectangle. For instance, the default coordinate system (bottom left) places the origin for the parent system at the bottom left of the parent's bounds, and calculates all translation relative to the bottom left corner of this rectangle's bounding box.


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