[Gcblue-commits] gcb_wx/include/common tcRect.h,NONE,1.1 simmath.h,1.24,1.25
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:53:00
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/include/common Modified Files: simmath.h Added Files: tcRect.h Log Message: Text message "message center" GUI screen --- NEW FILE: tcRect.h --- /** ** @file tcRect.h */ /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TCRECT_H_ #define _TCRECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class tcRect { public: float left; float right; float top; float bottom; virtual bool ContainsPoint(float x, float y) const; virtual void Expand(float dx, float dy); virtual float GetLeft() const {return left;} virtual float GetRight() const {return right;} virtual float GetTop() const {return top;} virtual float GetBottom() const {return bottom;} virtual float Width() const {return right-left;} virtual float Height() const {return top-bottom;} virtual float XCenter() const {return 0.5f*(right+left);} virtual float YCenter() const {return 0.5f*(top+bottom);} virtual void Offset(float dx, float dy); virtual void Set(float x1,float x2,float y1,float y2) {left=x1;right=x2;bottom=y1;top=y2;} tcRect& operator=(const tcRect& r); tcRect(); tcRect(float x1, float x2, float y1, float y2); tcRect(const tcRect& r); virtual ~tcRect(); }; #endif Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** simmath.h 6 Nov 2004 15:13:39 -0000 1.24 --- simmath.h 14 Nov 2004 22:52:19 -0000 1.25 *************** *** 1,4 **** --- 1,6 ---- /** ** @file simmath.h + ** This file (and simmath.cpp) needs to be broken up into separate + ** file for better modularity. */ /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) *************** *** 32,35 **** --- 34,38 ---- #include <string> #include "tcFile.h" + #include "tcRect.h" #include "tcString.h" #include "gctypes.h" *************** *** 55,75 **** - class tcRect - { - public: - float left,right,top,bottom; - - virtual bool ContainsPoint(float x, float y); - virtual float GetLeft() const {return left;} - virtual float GetRight() const {return right;} - virtual float GetTop() const {return top;} - virtual float GetBottom() const {return bottom;} - virtual float Width() const {return right-left;} - virtual float Height() const {return top-bottom;} - virtual float XCenter() const {return 0.5f*(right+left);} - virtual float YCenter() const {return 0.5f*(top+bottom);} - virtual void Offset(float dx, float dy) {left+=dx;right+=dx;bottom+=dy;top+=dy;} - virtual void Set(float x1,float x2,float y1,float y2) {left=x1;right=x2;bottom=y1;top=y2;} - }; /** tcRect with [-pi,pi) and [-pi/2,pi/2) range for longitude and latitude */ --- 58,61 ---- |