All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Nimble::Frame4f Class Reference

Frame of four floats. More...

#include <Nimble/Frame4.hpp>

Inheritance diagram for Nimble::Frame4f:
Nimble::Vector4T< float >

Public Member Functions

float bottom () const
 Get the bottom frame. More...
 
 Frame4f (const Nimble::Vector4f &v=Nimble::Vector4f(0, 0, 0, 0))
 Construct a new frame. More...
 
 Frame4f (float t, float r, float b, float l)
 Construct a new frame. More...
 
float height () const
 Get the height of the frame (top() + bottom()) More...
 
float left () const
 Get the left frame. More...
 
Nimble::Vector2f leftTop () const
 Get the top-left corner of the frame. More...
 
float right () const
 Get the right frame. More...
 
Nimble::Vector2f rightBottom () const
 Get the bottom-right corner of the frame. More...
 
Nimble::SizeF size () const
 Get the size of the frame. More...
 
float top () const
 Get the top frame. More...
 
float width () const
 Get the width of the frame (left() + right()) More...
 
- Public Member Functions inherited from Nimble::Vector4T< float >
Nimble::Vector4T< S > cast () const
 Cast the vector to another type.
 
Vector4Tclamp (floatlow, floathigh)
 Clamps both components to the range [low, high].
 
Vector4TclampUnit (void)
 Clamps both components to the range [0,1].
 
void clear (void)
 Fills the vector with zeroes.
 
float * data ()
 Returns a pointer to the first component.
 
const float * data () const
 Returns a pointer to the first component.
 
Vector4Tdescale (const Vector4T &v)
 Divides the vector component-wise.
 
float & get (size_t i)
 Returns the ith component.
 
const float & get (size_t i) const
 Returns the ith component.
 
bool isOne (void) const
 Checks if all components are one.
 
bool isZero (void) const
 Checks if all components are zero.
 
Decltype< float, float >::mul length () const
 Returns the length of the vector.
 
Decltype< float, float >::mul lengthSqr () const
 Returns the squared length of the vector.
 
Nimble::Vector4T< float > & make (const Vector2T< float > &v, floatcz, floatcw)
 Sets the vector to given values.
 
Nimble::Vector4T< float > & make (const Vector3T< float > &v, floatcw)
 Sets the vector to given values.
 
Nimble::Vector4T< float > & make (floatcx, floatcy, floatcz, floatcw)
 Sets the vector to given values.
 
float maximum () const
 Returns the largest component.
 
float minimum () const
 Returns the smallest component.
 
Vector4Tnormalize (double len=1.0)
 Normalizes the vector to the given length. More...
 
Vector4T normalized (double len=1.0) const
 Get a vector normalized to given length. More...
 
bool operator!= (const Vector4T &src) const
 Compares if two vectors differ.
 
Vector4T operator* (floats) const
 Multiplies a vector with a scalar.
 
Vector4Toperator*= (floats)
 Multiplies a vector by scalar.
 
Vector4T operator+ (const Vector4T &v) const
 Adds two vectors.
 
Vector4Toperator+= (const Vector4T &v)
 Adds two vectors.
 
Vector4T operator- (const Vector4T &v) const
 Subtract two vectors.
 
Vector4T operator- () const
 Returns the negation of the vector.
 
Vector4Toperator-= (const Vector4T &v)
 Subtracts two vectors.
 
Vector4T operator/ (floats) const
 Divides a vector with a scalar.
 
Vector4Toperator/= (floats)
 Divides a vector by scalar.
 
bool operator== (const Vector4T &src) const
 Compares if two vectors are equal.
 
const float & operator[] (size_t i) const
 Returns the ith component.
 
float & operator[] (size_t i)
 Returns the ith component.
 
Vector4Tscale (const Vector4T &v)
 Multiplies the vector component-wise.
 
void set (size_t i, floatv)
 Sets the ith component.
 
Vector4T shuffle (int i1, int i2, int i3, int i4) const
 Returns a vector with components reordered.
 
float sum () const
 Sum of all components.
 
Vector2T< float > vector2 () const
 Returns a copy of the first two components as a Vector2. More...
 
Vector2T< float > vector2 (size_t i0, size_t i1) const
 Makes a new Nimble::Vector2f of two freely selected components of vector4. More...
 
Vector3T< float > vector3 () const
 Returns a copy of the first three components as a Vector3. More...
 
Vector3T< float > vector3 (size_t i0, size_t i1, size_t i2) const
 Makes a new vector3 of two freely selected components of vector4. More...
 
 Vector4T (const Vector2T< float > &v, floatcz, floatcw)
 Constructs a vector and initializes it with the given values.
 
 Vector4T (const Vector3T< float > &v, floatcw)
 Constructs a vector and initializes it with the given values.
 
 Vector4T (floatcx, floatcy, floatcz, floatcw)
 Constructs a vector and initializes it with the given values.
 

Additional Inherited Members

- Public Types inherited from Nimble::Vector4T< float >
enum  
 
typedef float type
 Data type of the vector.
 
- Static Public Member Functions inherited from Nimble::Vector4T< float >
static Vector4T< float > null ()
 Zero vector. More...
 
- Public Attributes inherited from Nimble::Vector4T< float >
float w
 The w-component.
 
float x
 The x-component.
 
float y
 The y-component.
 
float z
 The z-component.
 

Detailed Description

Frame of four floats.

This class provides variable thickness frame information for a rectangle. Each side can have a frame of different thickness. The frame thickness is encoded with x being the top, y right, z bottom, and w the left.

Constructor & Destructor Documentation

Nimble::Frame4f::Frame4f ( const Nimble::Vector4f v = Nimble::Vector4f(0, 0, 0, 0))
inline

Construct a new frame.

Parameters
vinitial values
Nimble::Frame4f::Frame4f ( float  t,
float  r,
float  b,
float  l 
)
inline

Construct a new frame.

Parameters
ttop frame
rright frame
bbottom frame
lleft frame

Member Function Documentation

float Nimble::Frame4f::bottom ( ) const
inline

Get the bottom frame.

Returns
thickness of the bottom frame
float Nimble::Frame4f::height ( ) const
inline

Get the height of the frame (top() + bottom())

Returns
height of the frame
float Nimble::Frame4f::left ( ) const
inline

Get the left frame.

Returns
thickness of the left frame
Nimble::Vector2f Nimble::Frame4f::leftTop ( ) const
inline

Get the top-left corner of the frame.

Returns
top-left corner
float Nimble::Frame4f::right ( ) const
inline

Get the right frame.

Returns
thickness of the right frame
Nimble::Vector2f Nimble::Frame4f::rightBottom ( ) const
inline

Get the bottom-right corner of the frame.

Returns
bottom-right corner
Nimble::SizeF Nimble::Frame4f::size ( ) const
inline

Get the size of the frame.

Returns
the size of the frame
float Nimble::Frame4f::top ( ) const
inline

Get the top frame.

Returns
thickness of the top frame
float Nimble::Frame4f::width ( ) const
inline

Get the width of the frame (left() + right())

Returns
width of the frame