1
#ifndef ANIMATION_GRID_H
2
#define ANIMATION_GRID_H
5
virtual public Animation
10
friend class GridAnim;
13
GridModel (CompWindow *w,
14
WindowEvent curWindowEvent,
19
int decorBottomHeight);
22
void move (float tx, float ty);
26
friend class GridAnim;
27
friend class GridZoomAnim;
28
friend class GridTransformAnim;
32
void setGridPosition (Point &gridPosition);
33
inline Point3d &position () { return mPosition; }
34
inline Point &gridPosition () { return mGridPosition; }
36
inline Point &offsetTexCoordForQuadBefore ()
37
{ return mOffsetTexCoordForQuadBefore; }
39
inline Point &offsetTexCoordForQuadAfter ()
40
{ return mOffsetTexCoordForQuadAfter; }
43
Point3d mPosition; ///< Position on screen
44
Point mGridPosition; ///< Position on window in [0,1] range
46
Point mOffsetTexCoordForQuadBefore;
47
Point mOffsetTexCoordForQuadAfter;
48
///< Texture x, y coordinates will be offset by given amounts
49
///< for quads that fall after and before this object in x and y directions.
50
///< Currently only y offset can be used.
53
inline GridObject *objects () { return mObjects; }
54
inline unsigned int numObjects () { return mNumObjects; }
55
inline Point &scale () { return mScale; }
58
GridObject *mObjects; // TODO: convert to vector
59
unsigned int mNumObjects;
64
void initObjects (WindowEvent curWindowEvent,
66
int gridWidth, int gridHeight,
67
int decorTopHeight, int decorBottomHeight);
73
int mGridWidth; ///< Number of cells along grid width
74
int mGridHeight; ///< Number of cells along grid height
76
/// true if effect needs Q texture coordinates.
77
/// Q texture coordinates are used to avoid jagged-looking quads
78
/// ( http://www.r3.nu/~cass/qcoord/ )
81
GLWindow::Geometry mGeometry; ///< geometry for grid mesh
83
virtual bool using3D () { return false; }
85
virtual void initGrid (); ///< Initializes grid width/height.
86
///< Default grid size is 2x2.
87
///< Override for custom grid size.
90
GridAnim (CompWindow *w,
91
WindowEvent curWindowEvent,
93
const AnimEffect info,
94
const CompRect &icon);
97
void updateBB (CompOutput &output);
98
bool updateBBUsed () { return true; }
99
void addGeometry (const GLTexture::MatrixList &matrix,
100
const CompRegion ®ion,
101
const CompRegion &clip,
102
unsigned int maxGridWidth,
103
unsigned int maxGridHeight);
104
void drawGeometry ();