00001 00002 // Copyright (C) 2004-2007 by The Allacrost Project 00003 // All Rights Reserved 00004 // 00005 // This code is licensed under the GNU GPL version 2. It is free software 00006 // and you may modify it and/or redistribute it under the terms of this license. 00007 // See http://www.gnu.org/copyleft/gpl.html for details. 00009 00016 #ifndef __COORD_SYS_HEADER__ 00017 #define __COORD_SYS_HEADER__ 00018 00019 #include "defs.h" 00020 #include "utils.h" 00021 00022 namespace hoa_video { 00023 00034 class CoordSys { 00035 public: 00036 CoordSys() 00037 {} 00038 00039 CoordSys(float left, float right, float bottom, float top) 00040 { 00041 _left = left; _right = right; _bottom = bottom; _top = top; 00042 if (_right > _left) _horizontal_direction = 1.0f; else _horizontal_direction = -1.0f; 00043 if (_top > _bottom) _vertical_direction = 1.0f; else _vertical_direction = -1.0f; 00044 } 00045 00047 00048 float GetVerticalDirection() const 00049 { return _vertical_direction; } 00050 00051 float GetHorizontalDirection() const 00052 { return _horizontal_direction; } 00053 00054 float GetLeft() const 00055 { return _left; } 00056 00057 float GetRight() const 00058 { return _right; } 00059 00060 float GetBottom() const 00061 { return _bottom; } 00062 00063 float GetTop() const 00064 { return _top; } 00066 00067 private: 00069 float _vertical_direction; 00070 00072 float _horizontal_direction; 00073 00075 float _left, _right, _bottom, _top; 00076 }; // class CoordSys 00077 00078 } // namespace hoa_video 00079 00080 #endif // __COORD_SYS_HEADER__
1.5.1