[Gcblue-commits] gcb_wx/src/common tcRect.cpp,NONE,1.1 simmath.cpp,1.18,1.19
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-14 22:52:31
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22147/src/common Modified Files: simmath.cpp Added Files: tcRect.cpp Log Message: Text message "message center" GUI screen --- NEW FILE: tcRect.cpp --- /** ** @file tcRect.cpp */ /* Copyright (C) 2003 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 */ #include "tcRect.h" /** * @return true if point (x, y) is within rectangle * left and bottom borders are inclusive */ bool tcRect::ContainsPoint(float x, float y) const { return (x >= left) && (x < right) && (y >= bottom) && (y < top); } /** * */ void tcRect::Expand(float dx, float dy) { left -= dx; right += dx; bottom -= dy; top += dy; } /** * */ void tcRect::Offset(float dx, float dy) { left += dx; right += dx; bottom += dy; top += dy; } /** * */ tcRect& tcRect::operator=(const tcRect& r) { left = r.left; right = r.right; bottom = r.bottom; top = r.top; return *this; } /** * */ tcRect::tcRect() : left(0), right(0), bottom(0), top(0) { } /** * */ tcRect::tcRect(float x1, float x2, float y1, float y2) : left(x1), right(x2), bottom(y1), top(y2) { } /** * */ tcRect::tcRect(const tcRect& r) : left(r.left), right(r.right), bottom(r.bottom), top(r.top) { } /** * */ tcRect::~tcRect() { } Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** simmath.cpp 6 Nov 2004 15:13:41 -0000 1.18 --- simmath.cpp 14 Nov 2004 22:52:20 -0000 1.19 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file simmath.cpp ! */ ! /* Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 102,109 **** } ! bool tcRect::ContainsPoint(float x, float y) ! { ! return (x >= left) && (x < right) && (y >= bottom) && (y < top); ! } /******************************* tcGeoRect ********************************/ --- 104,108 ---- } ! /******************************* tcGeoRect ********************************/ |