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

A class that represents a 4-sided margin for a rectangular GUI object. More...

#include <omGraphicsGUIMargin.h>

Public Member Functions

 Margin ()
 Create a new default margin object that has a width on all sides of 0. More...
 
 Margin (Float newMargin)
 Create a new margin object using the specified margin size for all sides. More...
 
 Margin (Float newLeft, Float newRight, Float newBottom, Float newTop)
 Create a new margin object using the specified sizes for each rectangular side. More...
 
void setSize (Float newSize)
 Set all of the sides for this margin to have the specified size. More...
 
AABB2f getInnerBounds (const AABB2f &bounds) const
 Return the bounding box for the specified area if this margin is applied inwardly. More...
 
Vector2f getInnerSize (const Vector2f &outerSize) const
 Return the size of the inner bounding box for the specified outer box size if this margin is applied inwardly. More...
 
AABB2f getOuterBounds (const AABB2f &bounds) const
 Return the bounding box for the specified area if this margin is applied externally. More...
 
Vector2f getOuterSize (const Vector2f &innerSize) const
 Return the size of the outside bounding box for the specified inner box size if this margin is applied externally. More...
 
Margin operator* (Float scale) const
 Scale this margin on all sides by the specified value and return the result. More...
 
Margin operator* (const Vector2f &scale) const
 Scale this margin on all sides by the specified vector scaling and return the result. More...
 
Marginoperator*= (Float scale)
 Scale this margin on all sides by the specified value and store the result. More...
 
Marginoperator*= (const Vector2f &scale)
 Scale this margin on all sides by the specified vector scaling and store the result. More...
 

Public Attributes

Float left
 The size of the left-side margin. More...
 
Float right
 The size of the right-side margin. More...
 
Float bottom
 The size of the bottom-side margin. More...
 
Float top
 The size of the top-side margin. More...
 

Detailed Description

A class that represents a 4-sided margin for a rectangular GUI object.

Each side of the rectangle can have a different margin width.

Constructor & Destructor Documentation

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

Create a new default margin object that has a width on all sides of 0.

om::graphics::gui::base::Margin::Margin ( Float  newMargin)
inline

Create a new margin object using the specified margin size for all sides.

om::graphics::gui::base::Margin::Margin ( Float  newLeft,
Float  newRight,
Float  newBottom,
Float  newTop 
)
inline

Create a new margin object using the specified sizes for each rectangular side.

Member Function Documentation

void om::graphics::gui::base::Margin::setSize ( Float  newSize)
inline

Set all of the sides for this margin to have the specified size.

AABB2f om::graphics::gui::base::Margin::getInnerBounds ( const AABB2f bounds) const
inline

Return the bounding box for the specified area if this margin is applied inwardly.

This method shrinks the specified bounding box by the margin and returns the resulting bounding box.

Vector2f om::graphics::gui::base::Margin::getInnerSize ( const Vector2f outerSize) const
inline

Return the size of the inner bounding box for the specified outer box size if this margin is applied inwardly.

This method shrinks the specified box size by the margin and returns the resulting box size .

AABB2f om::graphics::gui::base::Margin::getOuterBounds ( const AABB2f bounds) const
inline

Return the bounding box for the specified area if this margin is applied externally.

This method grows the specified bounding box by the margin and returns the resulting bounding box.

Vector2f om::graphics::gui::base::Margin::getOuterSize ( const Vector2f innerSize) const
inline

Return the size of the outside bounding box for the specified inner box size if this margin is applied externally.

This method grows the specified box size by the margin and returns the resulting box size .

Margin om::graphics::gui::base::Margin::operator* ( Float  scale) const
inline

Scale this margin on all sides by the specified value and return the result.

Margin om::graphics::gui::base::Margin::operator* ( const Vector2f scale) const
inline

Scale this margin on all sides by the specified vector scaling and return the result.

Margin& om::graphics::gui::base::Margin::operator*= ( Float  scale)
inline

Scale this margin on all sides by the specified value and store the result.

Margin& om::graphics::gui::base::Margin::operator*= ( const Vector2f scale)
inline

Scale this margin on all sides by the specified vector scaling and store the result.

Member Data Documentation

Float om::graphics::gui::base::Margin::left

The size of the left-side margin.

Float om::graphics::gui::base::Margin::right

The size of the right-side margin.

Float om::graphics::gui::base::Margin::bottom

The size of the bottom-side margin.

Float om::graphics::gui::base::Margin::top

The size of the top-side margin.


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