00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _CEGUIRenderableElement_h_
00028 #define _CEGUIRenderableElement_h_
00029
00030 #include "CEGUIBase.h"
00031 #include "CEGUISystem.h"
00032 #include "CEGUIColourRect.h"
00033 #include "CEGUIVector.h"
00034 #include "CEGUIRenderCache.h"
00035
00036
00037 namespace CEGUI
00038 {
00043 class CEGUIEXPORT RenderableElement
00044 {
00045 public:
00046
00047
00048
00060 void draw(const Vector3& position, const Rect& clip_rect);
00061
00072 void draw(RenderCache& renderCache) const;
00073
00074
00075
00076
00084 RenderableElement* getNextElement(void) const {return d_next;}
00085
00086
00094 const ColourRect& getColours(void) const {return d_colours;}
00095
00096
00106 Point getPosition(void) const {return Point(d_area.d_left, d_area.d_top);}
00107
00108
00116 Size getSize(void) const {return Size(d_area.getWidth(), d_area.getHeight());}
00117
00118
00126 const Rect& getRect(void) const {return d_area;}
00127
00128
00138 bool isColourRectPerImage(bool setting) const {return d_useColoursPerImage;}
00139
00140
00141
00142
00143
00158 void setNextElement(RenderableElement* element) {d_next = element;}
00159
00160
00171 void setColours(const ColourRect& colours) {d_colours = colours;}
00172
00173
00193 void setColours(const colour& top_left_colour, const colour& top_right_colour, const colour& bottom_left_colour, const colour& bottom_right_colour);
00194
00195
00208 void setPosition(const Point& position) {d_area.setPosition(position);}
00209
00210
00218 void setSize(const Size& size) {d_area.setSize(size);}
00219
00220
00231 void setRect(const Rect& area) {d_area = area;}
00232
00233
00246 void setColourRectPerImage(bool setting) {d_useColoursPerImage = setting;}
00247
00248
00249
00250
00251
00256 RenderableElement(void);
00257
00258
00259
00264 virtual ~RenderableElement(void);
00265
00266
00267 protected:
00268
00269
00270
00284 virtual void draw_impl(const Vector3& position, const Rect& clip_rect) const = 0;
00285
00296 virtual void draw_impl(RenderCache& renderCache) const = 0;
00297
00298
00299
00300
00301
00302 RenderableElement* d_next;
00303 ColourRect d_colours;
00304 Rect d_area;
00305 bool d_useColoursPerImage;
00306 };
00307
00308 }
00309
00310
00311 #endif // end of guard _CEGUIRenderableElement_h_