[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src/px geom.hh,1.4,1.5
From: |
Daniel Heck <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src/px geom.hh,1.4,1.5 |
Date: |
Sat, 15 Nov 2003 12:32:45 +0000 |
Update of /cvsroot/enigma/enigma/src/px
In directory subversions:/tmp/cvs-serv10184/src/px
Modified Files:
geom.hh
Log Message:
Cleanup
Index: geom.hh
===================================================================
RCS file: /cvsroot/enigma/enigma/src/px/geom.hh,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** geom.hh 3 Apr 2003 11:00:52 -0000 1.4
--- geom.hh 15 Nov 2003 12:32:42 -0000 1.5
***************
*** 25,51 ****
#include "tools.hh"
- //----------------------------------------
- // Point2 / Point3
- //----------------------------------------
namespace px
{
- class Point {
- public:
- int x, y;
- Point(int xx, int yy) : x(xx),y(yy) {}
- };
! class Size {
! public:
! int w, h;
! Size(int ww, int hh) : w(ww), h(hh) {}
! };
! }
- //----------------------------------------
- // Rect
- //----------------------------------------
- namespace px
- {
template <class T>
class TRect {
--- 25,33 ----
#include "tools.hh"
namespace px
{
! /* -------------------- Generic rectangles -------------------- */
template <class T>
class TRect {
***************
*** 73,77 ****
}
-
bool contains(T xx, T yy) const {
return (xx >= x && xx < x+w && yy >= y && yy<y+h);
--- 55,58 ----
***************
*** 94,101 ****
};
! typedef TRect<int> Rect;
! typedef TRect<double> DRect;
! /* Center one rectangle inside another. */
template <class T>
TRect<T> center(const TRect<T> &outer, const TRect<T> &inner)
--- 75,81 ----
};
! /* -------------------- Helper routines -------------------- */
! /*! Center one rectangle inside another. */
template <class T>
TRect<T> center(const TRect<T> &outer, const TRect<T> &inner)
***************
*** 106,110 ****
}
! /* Construct the bounding box for two rectangles */
template <class T>
TRect<T> boundingbox(const TRect<T> & r1, const TRect<T>& r2)
--- 86,90 ----
}
! /*! Construct the bounding box for two rectangles */
template <class T>
TRect<T> boundingbox(const TRect<T> & r1, const TRect<T>& r2)
***************
*** 117,121 ****
}
! /* Intersect two rectangles */
template <class T>
TRect<T> intersect(const TRect<T> & r1, const TRect<T>& r2)
--- 97,101 ----
}
! /*! Intersect two rectangles */
template <class T>
TRect<T> intersect(const TRect<T> & r1, const TRect<T>& r2)
***************
*** 136,149 ****
}
std::ostream& operator<<(std::ostream& os, const Rect& r);
- }
! //----------------------------------------
! // RectList
! //----------------------------------------
! namespace px
! {
class RectList {
public:
typedef Rect value_type;
typedef value_type &reference;
--- 116,130 ----
}
+ /* -------------------- Integer rectangles -------------------- */
+
+ typedef TRect<int> Rect;
+
std::ostream& operator<<(std::ostream& os, const Rect& r);
! /* -------------------- Rectangle list -------------------- */
!
class RectList {
public:
+
typedef Rect value_type;
typedef value_type &reference;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src/px geom.hh,1.4,1.5,
Daniel Heck <address@hidden> <=