Box3d.h

00001 
00006 #ifndef BOX3D_H
00007 #define BOX3D_H
00008 
00009 /*
00010 ** ---------------------------------------------------------------
00011 ** Includes:
00012 */
00013 
00014 /*
00015 ** ---------------------------------------------------------------
00016 ** Definitions:
00017 */
00019 
00022 class Box3d {
00023 
00024 public:
00025 
00027         Box3d(const Vector3 &ll,const Vector3 &ur);
00028 
00030         Vector3 &ll();
00032         const Vector3 &ll() const;
00034         Vector3 &ur();
00036         const Vector3 &ur() const;      
00038         Boolean inside(const Vector3 &p);
00039 
00040 private :
00041 
00043         Vector3 &ll, &ur;
00044 
00045 
00046 };
00047 
00048 inline 
00049 Box3d::Box3d(const Vector3 &ll_,const Vector3 &ur_)
00050         ll(ll_),
00051         ur(ur_)
00052 {
00053 }
00054 
00055 inline  Vector3 &
00056 Box3d::ll()
00057 {
00058         return ll;
00059 }
00060 
00061 inline  const Vector3 &
00062 Box3d::ll() const
00063 {
00064         return ll;
00065 }
00066 
00067 inline  Vector3 &
00068 Box3d::ur()
00069 {
00070         return ur;
00071 }
00072 
00073 inline  const Vector3 &
00074 Box3d::ur() const
00075 {
00076         return ur;
00077 }
00078 
00079 
00080 
00081 inline Boolean
00082 Box3d::inside(const Vector3 &p)
00083 {
00084   return (   p.x > b.ll.x && p.x < b.ur.x
00085           && p.y > b.ll.y && p.y < b.ur.y
00086           && p.z > b.ll.z && p.z < b.ur.z );
00087 }
00088 
00089 #endif //BOX3D_H

Generated on Thu Jul 5 00:39:19 2007 for S3D by  doxygen 1.4.6