00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00016 #ifndef RM3_INTERVAL_SET_H
00017 #define RM3_INTERVAL_SET_H
00018
00019 #if !defined(ROOT_INCL_ID)
00020 #define ROOT_INCL_ID 34015
00021 #endif
00022
00023 #include <GDT/gdtlist.h>
00024
00025
00033 class GDT_interval_set
00034 {
00035 private:
00036 GDT_interval_set(const GDT_interval_set& );
00037 GDT_interval_set& operator=(const GDT_interval_set& );
00038 private:
00039 struct _interval
00040 {
00041
00042 const double from;
00043 const double to;
00044
00045 const double z;
00046
00047 _interval(double f, double t, double zz):
00048 from(f),
00049 to(t),
00050 z(zz)
00051 {}
00052 };
00053 public:
00054 typedef _interval* interval;
00055
00056 private:
00057
00058 gdt::gdtlist< interval > the_set;
00059
00060
00061
00062
00063
00064
00065
00066
00067 interval ray_shooting_generic( double x, double z, bool up);
00068
00069 public:
00070 GDT_interval_set() {};
00071
00072 ~GDT_interval_set();
00073
00074
00075 public:
00076
00077
00078 double altitude(interval i) const
00079 { return i->z; }
00080
00081 double left(interval i) const
00082 { return i->from; }
00083
00084 double right(interval i) const
00085 { return i->to; }
00086
00087
00088
00089 interval new_interval( double f, double t, double z );
00090
00091 void del_interval( interval i );
00092
00093 interval ray_shooting_up( double x, double z)
00094 { return ray_shooting_generic( x, z, true ); }
00095
00096 interval ray_shooting_down( double x, double z)
00097 { return ray_shooting_generic( x, z, false ); }
00098
00099 void print(std::ostream& o) const;
00100 };
00101
00102
00103 std::ostream& operator<< (std::ostream& o, GDT_interval_set::interval i);
00104 std::ostream& operator<< (std::ostream& o, const GDT_interval_set& s);
00105
00106 #endif
00107