Box.h
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
00028 #ifndef ROCKETCOREBOX_H
00029 #define ROCKETCOREBOX_H
00030
00031
00032
00033 #include <Rocket/Core/Types.h>
00034
00035 namespace Rocket {
00036 namespace Core {
00037
00045 class ROCKETCORE_API Box
00046 {
00047 public:
00048 enum Area
00049 {
00050 MARGIN = 0,
00051 BORDER = 1,
00052 PADDING = 2,
00053 CONTENT = 3,
00054 NUM_AREAS = 3,
00055 };
00056
00057 enum Edge
00058 {
00059 TOP = 0,
00060 RIGHT = 1,
00061 BOTTOM = 2,
00062 LEFT = 3,
00063 NUM_EDGES = 4
00064 };
00065
00067 Box();
00069 Box(const Vector2f& content);
00070 ~Box();
00071
00074 const Vector2f& GetOffset() const;
00079 Vector2f GetPosition(Area area = Box::CONTENT) const;
00083 Vector2f GetSize(Area area = Box::CONTENT) const;
00084
00088 void SetOffset(const Vector2f& offset);
00091 void SetContent(const Vector2f& content);
00096 void SetEdge(Area area, Edge edge, float size);
00097
00102 float GetEdge(Area area, Edge edge) const;
00107 float GetCumulativeEdge(Area area, Edge edge) const;
00108
00111 bool operator==(const Box& rhs) const;
00114 bool operator!=(const Box& rhs) const;
00115
00116 private:
00117 Vector2f content;
00118 float area_edges[NUM_AREAS][NUM_EDGES];
00119
00120 Vector2f offset;
00121 };
00122
00123 }
00124 }
00125
00126 #endif