All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::ClipQuad Class Reference

Clipping quad. More...

#include <kanzi/node/clip_quad.hpp>

Public Member Functions

 ClipQuad ()
 Empty constructor. More...
 
 ClipQuad (float offsetX, float offsetY, float sizeX, float sizeY)
 Constructor for coordinates only, individual values. More...
 
 ClipQuad (Vector2 offset, Vector2 size)
 Constructor for coordinates only. More...
 
 ClipQuad (float offsetX, float offsetY, float sizeX, float sizeY, float texOffsetX, float texOffsetY, float tesxSizeX, float texSizeY)
 Constructor with individual values. More...
 
 ClipQuad (Vector2 offset, Vector2 size, Vector2 texOffset, Vector2 texSize)
 Constructor for coordinates only. More...
 
void set (float offsetX, float offsetY, float sizeX, float sizeY)
 Set content. More...
 
void set (Vector2 offset, Vector2 size)
 Set content. More...
 
void set (float offsetX, float offsetY, float sizeX, float sizeY, float texOffsetX, float texOffsetY, float tesxSizeX, float texSizeY)
 Set content. More...
 
void set (Vector2 offset, Vector2 size, Vector2 texOffset, Vector2 texSize)
 Set content. More...
 
unsigned int clipBottom (float border)
 Clip from bottom side. More...
 
unsigned int clipLeft (float border)
 Clip from left side. More...
 
unsigned int clipRight (float border)
 Clip from right side. More...
 
unsigned int clipTop (float border)
 Clip from top side. More...
 
void refresh ()
 Recalculate data buffer for sending this brush to the GPU. More...
 
void substract (const ClipQuad &other, unsigned int mask)
 Intersect with another clip quad. More...
 
void tile (Vector2 tiling)
 Tile the quad. More...
 
Vector2 getOffset () const
 Get quad offset. More...
 
Vector2 getSize () const
 Get quad size. More...
 
Vector2 getTextureOffset () const
 Get texture size. More...
 
Vector2 getTextureSize () const
 Get texture size. More...
 
const float * getVertexData () const
 Get vertex data. More...
 
const float * getTexcoordData () const
 Get texcoord data. More...
 
size_t getVertexCount () const
 Get vertex count. More...
 

Protected Member Functions

void assignVertex (size_t index, float x, float y, float s, float t)
 Assign a vertex. More...
 

Detailed Description

Clipping quad.

Constructor & Destructor Documentation

kanzi::ClipQuad::ClipQuad ( )
inline

Empty constructor.

kanzi::ClipQuad::ClipQuad ( float  offsetX,
float  offsetY,
float  sizeX,
float  sizeY 
)
inline

Constructor for coordinates only, individual values.

Parameters
offsetXX offset.
offsetYY offset.
sizeXX size.
sizeYY size.
kanzi::ClipQuad::ClipQuad ( Vector2  offset,
Vector2  size 
)
inline

Constructor for coordinates only.

Parameters
offsetOffset.
sizeSize.
kanzi::ClipQuad::ClipQuad ( float  offsetX,
float  offsetY,
float  sizeX,
float  sizeY,
float  texOffsetX,
float  texOffsetY,
float  tesxSizeX,
float  texSizeY 
)
inline

Constructor with individual values.

Parameters
offsetXX offset.
offsetYY offset.
sizeXX size.
sizeYY size.
texOffsetXX offset.
texOffsetYY offset.
texSizeXX size.
texSizeYY size.
kanzi::ClipQuad::ClipQuad ( Vector2  offset,
Vector2  size,
Vector2  texOffset,
Vector2  texSize 
)
inline

Constructor for coordinates only.

Parameters
offsetOffset.
sizeSize.
texOffsetTexture offset.
texSizeTexture size.

Member Function Documentation

void kanzi::ClipQuad::set ( float  offsetX,
float  offsetY,
float  sizeX,
float  sizeY 
)
inline

Set content.

Parameters
offsetXX offset.
offsetYY offset.
sizeXX size.
sizeYY size.
void kanzi::ClipQuad::set ( Vector2  offset,
Vector2  size 
)
inline

Set content.

Parameters
offsetOffset.
sizeSize.
void kanzi::ClipQuad::set ( float  offsetX,
float  offsetY,
float  sizeX,
float  sizeY,
float  texOffsetX,
float  texOffsetY,
float  tesxSizeX,
float  texSizeY 
)
inline

Set content.

Parameters
offsetXX offset.
offsetYY offset.
sizeXX size.
sizeYY size.
texOffsetXX offset.
texOffsetYY offset.
texSizeXX size.
texSizeYY size.
void kanzi::ClipQuad::set ( Vector2  offset,
Vector2  size,
Vector2  texOffset,
Vector2  texSize 
)
inline

Set content.

Parameters
offsetOffset.
sizeSize.
texOffsetTexture offset.
texSizeTexture size.
unsigned int kanzi::ClipQuad::clipBottom ( float  border)

Clip from bottom side.

Parameters
borderBorder to clip to.
Returns
Clip mask of areas remaining.
unsigned int kanzi::ClipQuad::clipLeft ( float  border)

Clip from left side.

Parameters
borderBorder to clip to.
Returns
Clip mask of areas remaining.
unsigned int kanzi::ClipQuad::clipRight ( float  border)

Clip from right side.

Parameters
borderBorder to clip to.
Returns
Clip mask of areas remaining.
unsigned int kanzi::ClipQuad::clipTop ( float  border)

Clip from top side.

Parameters
borderBorder to clip to.
Returns
Clip mask of areas remaining.
void kanzi::ClipQuad::refresh ( )

Recalculate data buffer for sending this brush to the GPU.

void kanzi::ClipQuad::substract ( const ClipQuad other,
unsigned int  mask 
)

Intersect with another clip quad.

The other quad must be smaller or equal in size to this quad, i.e. it must have gone through the same clipping process. Otherwise results are undefined. Will write the coordinate buffer as a triangle strip and prepare the buffer as side effect.

Parameters
otherOther quad to intersect with.
maskMask signifying areas in this quad that exist in regard to the other quad.
void kanzi::ClipQuad::tile ( Vector2  tiling)

Tile the quad.

Will alter texture coordinates to accomodate tiling.

Parameters
tilingTiling vector.
Vector2 kanzi::ClipQuad::getOffset ( ) const
inline

Get quad offset.

Returns
Quad offset vector.
Vector2 kanzi::ClipQuad::getSize ( ) const
inline

Get quad size.

Returns
Quad size vector.
Vector2 kanzi::ClipQuad::getTextureOffset ( ) const
inline

Get texture size.

Returns
Texture offset vector.
Vector2 kanzi::ClipQuad::getTextureSize ( ) const
inline

Get texture size.

Returns
Texture size vector.
const float* kanzi::ClipQuad::getVertexData ( ) const
inline

Get vertex data.

Returns
Pointer to vertex data.
const float* kanzi::ClipQuad::getTexcoordData ( ) const
inline

Get texcoord data.

Returns
Pointer to vertex data.
size_t kanzi::ClipQuad::getVertexCount ( ) const
inline

Get vertex count.

Returns
Number of vertices.
void kanzi::ClipQuad::assignVertex ( size_t  index,
float  x,
float  y,
float  s,
float  t 
)
inlineprotected

Assign a vertex.

To be used internally in functions that write vertices into the vertex buffer.

Parameters
countTotal number of elements at end.
indexCurrent index.
xX coordinate.
yY coordinate.
sS texture coordinate.
tT texture coordinate.

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