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

A class that represents the location of the origin of a GUI rectangle coordinate system. More...

#include <omGraphicsGUIOrigin.h>

Public Types

enum  XOrigin {
  X_MIN = 1, X_CENTER = 2, X_MAX = 4, LEFT = X_MIN,
  HORIZONTAL_CENTER = X_CENTER, RIGHT = X_MAX
}
 An enum that specifies the different types of horizontal coordinate origins. More...
 
enum  YOrigin {
  Y_MIN = 1, Y_CENTER = 2, Y_MAX = 4, BOTTOM = Y_MIN,
  VERTICAL_CENTER = Y_CENTER, TOP = Y_MAX
}
 An enum that specifies the different types of vertical coordinate origins. More...
 
enum  ZOrigin {
  Z_MIN = 1, Z_CENTER = 2, Z_MAX = 4, BACK = Z_MIN,
  DEPTH_CENTER = Z_CENTER, FRONT = Z_MAX
}
 An enum that specifies the different types of depth coordinate origins. More...
 

Public Member Functions

 Origin ()
 Create a new default coordinate origin, the bottom-left corner. More...
 
 Origin (XOrigin newXOrigin, YOrigin newYOrigin)
 Create a new coordinate origin using the specified horizontal and vertical origin alignments. More...
 
 Origin (XOrigin newXOrigin, YOrigin newYOrigin, ZOrigin newZOrigin)
 Create a new coordinate origin using the specified horizontal and vertical origin alignments. More...
 
XOrigin getX () const
 Return an enum value indicating the alignment of the horizontal axis of the coordinate system. More...
 
void setX (XOrigin newXOrigin)
 Set an enum value indicating the alignment of the horizontal axis of the coordinate system. More...
 
YOrigin getY () const
 Return an enum value indicating the alignment of the vertical axis of the coordinate system. More...
 
void setY (YOrigin newYOrigin)
 Set an enum value indicating the alignment of the vertical axis of the coordinate system. More...
 
ZOrigin getZ () const
 Return an enum value indicating the alignment of the depth axis of the coordinate system. More...
 
void setZ (ZOrigin newZOrigin)
 Set an enum value indicating the alignment of the depth axis of the coordinate system. More...
 
Bool operator== (const Origin &other) const
 Return whether or not this coordinate origin object is the same as another. More...
 
Bool operator!= (const Origin &other) const
 Return whether or not this coordinate origin object is different than another. More...
 
Float getOffsetX (Float parentSize, Float childSize) const
 Return a scalar indicating the X-origin offset from the bottom left (minimum) coordinate of a parent bounding box. More...
 
Float getOffsetY (Float parentSize, Float childSize) const
 Return a scalar indicating the Y-origin offset from the bottom left (minimum) coordinate of a parent bounding box. More...
 
Float getOffsetZ (Float parentSize, Float childSize) const
 Return a scalar indicating the Z-origin offset from the bottom left (minimum) coordinate of a parent bounding box. More...
 
Float getOffset (Float parentSize, Float childSize, Index axis) const
 Return a scalar indicating the offset from the bottom left (minimum) coordinate of a parent bounding box. More...
 
Vector2f getOffset (const Vector2f &parentSize, const Vector2f &childSize) const
 Return a vector indicating the origin offset from the bottom left (minimum) coordinate of a parent bounding box. More...
 
Vector3f getOffset (const Vector3f &parentSize, const Vector3f &childSize) const
 Return a vector indicating the origin offset from the bottom left (minimum) coordinate of a parent bounding box. More...
 
String toString () const
 Return a string representation of the origin type. More...
 
 operator String () const
 Convert this origin type into a string representation. More...
 

Detailed Description

A class that represents the location of the origin of a GUI rectangle coordinate system.

Member Enumeration Documentation

An enum that specifies the different types of horizontal coordinate origins.

Enumerator
X_MIN 

An origin that is at the minimum X coordinate of a rectangular region.

X_CENTER 

An origin that is at the center X coordinate of a rectangular region.

X_MAX 

An origin that is at the maximum X coordinate of a rectangular region.

LEFT 

A coordinate origin that lies to the left of a rectangular region.

HORIZONTAL_CENTER 

A coordinate origin that is horizontally centered within a rectangular region.

RIGHT 

A coordinate origin that lies to the right of a rectangular region.

An enum that specifies the different types of vertical coordinate origins.

Enumerator
Y_MIN 

An origin that is at the minimum Y coordinate of a rectangular region.

Y_CENTER 

An origin that is at the center Y coordinate of a rectangular region.

Y_MAX 

An origin that is at the maximum Y coordinate of a rectangular region.

BOTTOM 

A coordinate origin that lies to the bottom of a rectangular region.

VERTICAL_CENTER 

A coordinate origin that is vertically centered within a rectangular region.

TOP 

A coordinate origin that lies to the top of a rectangular region.

An enum that specifies the different types of depth coordinate origins.

Enumerator
Z_MIN 

An origin that is at the minimum Z coordinate of a rectangular region.

Z_CENTER 

An origin that is at the center Z coordinate of a rectangular region.

Z_MAX 

An origin that is at the maximum Z coordinate of a rectangular region.

BACK 

A coordinate origin that lies to the back of a 3D rectangular region.

DEPTH_CENTER 

A coordinate origin that is depth centered within a rectangular region.

FRONT 

A coordinate origin that lies to the front of a 3D rectangular region.

Constructor & Destructor Documentation

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

Create a new default coordinate origin, the bottom-left corner.

om::graphics::gui::base::Origin::Origin ( XOrigin  newXOrigin,
YOrigin  newYOrigin 
)
inline

Create a new coordinate origin using the specified horizontal and vertical origin alignments.

om::graphics::gui::base::Origin::Origin ( XOrigin  newXOrigin,
YOrigin  newYOrigin,
ZOrigin  newZOrigin 
)
inline

Create a new coordinate origin using the specified horizontal and vertical origin alignments.

Member Function Documentation

XOrigin om::graphics::gui::base::Origin::getX ( ) const
inline

Return an enum value indicating the alignment of the horizontal axis of the coordinate system.

void om::graphics::gui::base::Origin::setX ( XOrigin  newXOrigin)
inline

Set an enum value indicating the alignment of the horizontal axis of the coordinate system.

YOrigin om::graphics::gui::base::Origin::getY ( ) const
inline

Return an enum value indicating the alignment of the vertical axis of the coordinate system.

void om::graphics::gui::base::Origin::setY ( YOrigin  newYOrigin)
inline

Set an enum value indicating the alignment of the vertical axis of the coordinate system.

ZOrigin om::graphics::gui::base::Origin::getZ ( ) const
inline

Return an enum value indicating the alignment of the depth axis of the coordinate system.

void om::graphics::gui::base::Origin::setZ ( ZOrigin  newZOrigin)
inline

Set an enum value indicating the alignment of the depth axis of the coordinate system.

Bool om::graphics::gui::base::Origin::operator== ( const Origin other) const
inline

Return whether or not this coordinate origin object is the same as another.

Bool om::graphics::gui::base::Origin::operator!= ( const Origin other) const
inline

Return whether or not this coordinate origin object is different than another.

Float om::graphics::gui::base::Origin::getOffsetX ( Float  parentSize,
Float  childSize 
) const

Return a scalar indicating the X-origin offset from the bottom left (minimum) coordinate of a parent bounding box.

The scalar indicates, relative to the minimum X-corner of the parent bounding box with the specified X-size, the direction and distance to this origin's position.

Float om::graphics::gui::base::Origin::getOffsetY ( Float  parentSize,
Float  childSize 
) const

Return a scalar indicating the Y-origin offset from the bottom left (minimum) coordinate of a parent bounding box.

The scalar indicates, relative to the minimum Y-corner of the parent bounding box with the specified Y-size, the direction and distance to this origin's position.

Float om::graphics::gui::base::Origin::getOffsetZ ( Float  parentSize,
Float  childSize 
) const

Return a scalar indicating the Z-origin offset from the bottom left (minimum) coordinate of a parent bounding box.

The scalar indicates, relative to the minimum Z-corner of the parent bounding box with the specified Z-size, the direction and distance to this origin's position.

Float om::graphics::gui::base::Origin::getOffset ( Float  parentSize,
Float  childSize,
Index  axis 
) const

Return a scalar indicating the offset from the bottom left (minimum) coordinate of a parent bounding box.

The scalar indicates, relative to the minimum of the parent bounding box along the specified axis index in [0,2], the direction and distance to this origin's position.

Vector2f om::graphics::gui::base::Origin::getOffset ( const Vector2f parentSize,
const Vector2f childSize 
) const

Return a vector indicating the origin offset from the bottom left (minimum) coordinate of a parent bounding box.

The 2D vector indicates, relative to the minimum corner of the parent bounding box with the specified 2D size, the direction and distance to this origin's position.

Vector3f om::graphics::gui::base::Origin::getOffset ( const Vector3f parentSize,
const Vector3f childSize 
) const

Return a vector indicating the origin offset from the bottom left (minimum) coordinate of a parent bounding box.

The 3D vector indicates, relative to the minimum corner of the parent bounding box with the specified 3D size, the direction and distance to this origin's position.

String om::graphics::gui::base::Origin::toString ( ) const

Return a string representation of the origin type.

om::graphics::gui::base::Origin::operator String ( ) const
inline

Convert this origin type into a string representation.


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