vytools_tpl.hpp

VyTools is a C and C++ library which makes often used tasks easier.
The vytools_tpl.hpp is for the template classes of the C++ part. All declarations are in the vyt namespace.
It contains data class for arrays, vectors, rectangles and affine transforms.

Contents

ArrayData Data class for reference-counted arrays
Array Reference counted array
Vec2 2-dimensional vector
Rect Rectangle
Trans2 2-dimensional affine transformation
IVec2 2-dimensional vector of Int
UVec2 2-dimensional vector of Uint
URect Rectangle of Uint
FTrans2 2-dimensional affine transformation of Float

Details

class ArrayData: public RefData
Data class for reference-counted arrays
size Current size of array
values The stored values
ArrayData()
Basic constructor
ArrayData( const ArrayData & a )
Copy constructor
ArrayData( Uint n )
Constructor with size
n Array size
~ArrayData()
Destructor
void Throws exception if index is out of bounds
i Index
void resize( Uint n )
Resize array data
n New size
void set( Uint at, const T * ts, Uint n )
Set values at an index
at Index
ts Pointer to values
n Number of values at ts
operator T *()
Pointer to values
return Pointer
operator Constant pointer to values
return Pointer
Uint Current size of array
return Size
class Array: public RefCount
Reference counted array
ArrayData * vref()
Pointer to the array data
return Pointer
operator T*()
Cast to pointer
class Vec2
2-dimensional vector
x X coordinate
y Y coordinate
Vec2( T x, T y )
Constructor
x X coordinate
y Y coordinate
class Rect
Rectangle
top Top cooridnate
left Left coordinate
width Width of rectangle
height Height of rectangle
Rect( T top, T left, T width, T height )
Constructor
top Top cooridnate
left Left coordinate
width Width of rectangle
height Height of rectangle
class Trans2
2-dimensional affine transformation
sx X coordinate scale
rx X coordinate rotate
ry Y coordinate rotate
sy Y coordinate scale
dx X coordinate shift
dy Y coordinate shift
Trans2( T sx, T rx, T ry, T sy, T dx, T dy )
Constructor
sx X coordinate scale
rx X coordinate rotate
ry Y coordinate rotate
sy Y coordinate scale
dx X coordinate shift
dy Y coordinate shift
IVec2
2-dimensional vector of Int
UVec2
2-dimensional vector of Uint
URect
Rectangle of Uint
FTrans2
2-dimensional affine transformation of Float