00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef neo_gui_area_h
00022 #define neo_gui_area_h
00023
00027 #include "../core/platform.h"
00028
00029 #if NEO_ENABLE_GUI
00030
00031 #include "../render/texture.h"
00032 #include "../render/primitive.h"
00033 #include "../render/color.h"
00034 #include "gui.h"
00035 #include "object.h"
00036 #include "font.h"
00037
00038 namespace neo {
00039 namespace gui {
00040
00056 class Area : public Object, public render::ParameterBinderNode
00057 {
00058 public:
00059
00061
00065 Area( unsigned int id = 0, const std::string& name = "", Object* p_parent = 0 );
00066
00068 virtual ~Area();
00069
00071
00081 void setLayout( const Point& numTiles = Point(), const Point& sizeTile = Point(), Tiling tiling = TILE, Orientation orientation = TOPLEFT, bool scroll = false );
00082
00084
00088 void setTileCoordinates( const math::Vector3& origin = math::Vector3( 0, 0, 0 ), const math::Vector3& size = math::Vector3( 1.0f, 1.0f, 1.0f ) );
00089
00091 inline const Point& getNumTiles() const;
00092
00094 inline const Point& getSizeTile() const;
00095
00097 inline Tiling getTiling() const;
00098
00100 inline Orientation getOrientation() const;
00101
00103 inline const math::Vector3& getTileUVWOrigin() const;
00104
00106 inline const math::Vector3& getTileUVWSize() const;
00107
00109
00110 virtual void setTechnique( const render::TechniquePtr& p_tech );
00111
00113
00114 inline const render::TechniquePtr& getTechnique() const;
00115
00117
00119 virtual void setColor( const render::Color& color );
00120
00122
00123 inline const render::Color& getColor() const;
00124
00126
00127 inline bool isScrolling() const;
00128
00129 virtual void render();
00130 virtual Area* clone() const;
00131
00132 virtual void getParameters( core::Array< render::Parameter* >* p_params );
00133
00134 protected:
00135
00136 virtual void doBind( const core::HashString& name, render::ParameterData* p_data, bool local );
00137 virtual void doUnbind( const core::HashString& name, bool local );
00138
00139 virtual void onMove();
00140 virtual void onResize();
00141 virtual void onVirtualChange();
00142 virtual void onDepthChange();
00143
00145 virtual void onLayout();
00146
00147 #if NEO_ENABLE_SCRIPTING
00148 virtual void getEvents( core::Array< std::string >* p_events );
00149 #endif
00150
00152 virtual void recalc();
00153
00155 void invalidate();
00156
00158
00160 void copyTo( Area& obj, bool cloneChildren = true ) const;
00161
00163 render::Primitive _primitive;
00164
00166 math::Matrix4 _transform;
00167
00168 private:
00169
00171 Tiling _tiling;
00172
00174 Orientation _orientation;
00175
00177 Point _numTiles;
00178
00180 Point _sizeTile;
00181
00183 math::Vector3 _originUVW;
00184
00186 math::Vector3 _sizeUVW;
00187
00189 render::Color _color;
00190
00192 bool _scroll;
00193
00195 render::ParameterCompiledBindings _bindingsCompiled;
00196 };
00197
00198 #include "area.inl"
00199
00200 }
00201 }
00202
00203 #endif
00204
00205 #endif