Regions

 

 

 

class          SLICEO_DB Region_2D {

public:

          unsigned char          type ;

          float          min_x, min_y ;

          float          max_x, max_y ;

 

public:

          // --------------- Constructors -------------------------------

          Region_2D() ;

          Region_2D(unsigned char type) ;

          Region_2D(Point_2D min, Point_2D max) ;

          Region_2D(unsigned char type, int x0,   int y0,   int x1,   int y1) ;

          Region_2D(unsigned char type, float x0, float y0, float x1, float y1) ;

 

          inline          void           Clear(void) ;

          inline          void           Set(unsigned char type) ;

          inline          void           Set(Point_2D min, Point_2D max) ;

          inline          void           Set(int x0, int y0, int x1, int y1) ;

          inline          void           Set(unsigned char type, int x0, int y0, int x1, int y1) ;

          inline          void           Set(float x0, float y0, float x1, float y1) ;

          inline          void           Set(unsigned char type, float x0, float y0, float x1, float y1) ;

          inline          Point_2D Get_Min(void) ;

          inline          Point_2D Get_Max(void) ;

          inline          float           Get_Dim_X(void) ;

          inline          float           Get_Dim_Y(void) ;

          inline          void           Add(int x, int y) ;

          inline          void           Add(float x, float y) ;

          inline          void           Add(Point_2D  pt) ;

          inline          void           Add(Region_2D reg) ;

          inline          void           Add(Region_2D *reg) ;

          inline          void           Border(float val) ;

          inline          void           Clip(Point_2D pt) ;

          inline          int           Cull(Region_2D reg) ;

          inline          int           Inside(Point_2D pt) ;

          inline          int           Inside(Point_2D *pt) ;

          inline          int           Inside(Region_2D reg) ;

          inline          int           Inside(Region_2D *reg) ;

 

          // --------------- Overloads -------------------------------

 

          inline          int          operator==          (Region_2D& V) ;

          inline          int          operator!=          (Region_2D& V) ;

//          inline          Region_2D&   operator= (int val) ;

//          inline          Region_2D&   operator= (float val) ;

          inline          Region_2D&   operator= (Region_2D& V) ;

          inline          Region_2D&   operator+ (Region_2D& V) ;

          inline          float&          operator[] (const int i) ;

} ;

 

 

 

 

class          SLICEO_DB Region_3D {

public:

          unsigned char          type ;

          float          min_x, min_y, min_z ;

          float          max_x, max_y, max_z ;

 

public:

          // --------------- Constructors -------------------------------

          Region_3D() ;

          Region_3D(unsigned char type) ;

          Region_3D(Point_3D min, Point_3D max) ;

          Region_3D(unsigned char type, int x0, int y0, int z0,  int x1, int y1, int z1) ;

          Region_3D(unsigned char type, float x0, float y0, float z0, float x1, float y1, float z1) ;

 

          inline          void           Clear(void) ;

          inline          void           Set(unsigned char type) ;

          inline          void           Set(Point_3D min, Point_3D max) ;

          inline          void           Set(int x0, int y0, int z0,  int x1, int y1, int z1) ;

          inline          void           Set(unsigned char type, int x0, int y0, int z0 , int x1, int y1, int z1) ;

          inline          void           Set(float x0, float y0, float z0, float x1, float y1, float z1) ;

          inline          void           Set(unsigned char type, float x0, float y0, float z0 , float x1, float y1, float z1) ;

          inline          Point_3D Get_Min(void) ;

          inline          Point_3D Get_Max(void) ;

          inline          float           Get_Dim_X(void) ;

          inline          float           Get_Dim_Y(void) ;

          inline          float           Get_Dim_Z(void) ;

          inline          void           Add(int x, int y, int z=0) ;

          inline          void           Add(float x, float y, float z=0) ;

          inline          void           Add(Point_3D  pt) ;

          inline          void           Add(Vect  pt) ;

          inline          void           Add(Region_3D reg) ;

          inline          void           Add(Region_3D *reg) ;

          inline          void           Border(float val) ;

          inline          void           Clip(Point_3D pt) ;

          inline          int           Cull(Region_3D reg) ;

          inline          int           Inside(Point_3D pt) ;

          inline          int           Inside(Point_3D *pt) ;

          inline          int           Inside(Region_3D reg) ;

          inline          int           Inside(Region_3D *reg) ;

 

          // --------------- Overloads -------------------------------

 

          inline          int          operator==          (Region_3D& V) ;

          inline          int          operator!=          (Region_3D& V) ;

 

          inline          Region_3D&          operator*= (const Matrix& M) ;

 

//          inline          Region_2D&   operator= (int val) ;

//          inline          Region_2D&   operator= (float val) ;

          inline          Region_3D&   operator= (Region_3D& V) ;

          inline          Region_3D&   operator+ (Region_3D& V) ;

          inline          float&          operator[] (const int i) ;

} ;

 

 

 

 

class          SLICEO_DB Region_4D {

public:

          unsigned char          type ;

          float          min_x, min_y, min_z, min_t ;

          float          max_x, max_y, max_z, max_t ;

 

public:

          // --------------- Constructors -------------------------------

          Region_4D() ;

          Region_4D(unsigned char type) ;

          Region_4D(Point_4D min, Point_4D max) ;

          Region_4D(unsigned char type, int x0, int y0, int z0, int t0,  int x1, int y1, int z1, int t1) ;

          Region_4D(unsigned char type, float x0, float y0, float z0, float t0, float x1, float y1, float z1, float t1) ;

 

          inline          void           Clear(void) ;

          inline          void           Set(unsigned char type) ;

          inline          void           Set(Point_4D min, Point_4D max) ;

          inline          void           Set(int x0, int y0, int z0, int t0,  int x1, int y1, int z1, int t1) ;

          inline          void           Set(unsigned char type, int x0, int y0, int z0, int t0,  int x1, int y1, int z1, int t1) ;

          inline          void           Set(float x0, float y0, float z0, float t0, float x1, float y1, float z1, float t1) ;

          inline          void           Set(unsigned char type, float x0, float y0, float z0, float t0, float x1, float y1, float z1, float t1) ;

          inline          Point_4D Get_Min(void) ;

          inline          Point_4D Get_Max(void) ;

//          inline          float           Get_Dim_X(void) ;

//          inline          float           Get_Dim_Y(void) ;

//          inline          float           Get_Dim_Z(void) ;

          inline          void           Add(int x, int y, int z=0, int t=0) ;

          inline          void           Add(float x, float y, float z=0, float t=0) ;

          inline          void           Add(Point_3D  pt) ;

          inline          void           Add(Point_4D  pt) ;

          inline          void           Add(Vect  pt) ;

          inline          void           Add(Region_4D reg) ;

          inline          void           Add(Region_4D *reg) ;

          inline          void           Border(float val) ;

          inline          void           Clip(Point_4D pt) ;

          inline          int           Cull(Region_4D reg) ;

          inline          int           Inside(Point_4D pt) ;

          inline          int           Inside(Point_4D *pt) ;

          inline          int           Inside(Region_4D reg) ;

          inline          int           Inside(Region_4D *reg) ;

 

          // --------------- Overloads -------------------------------

 

          inline          int          operator==          (Region_4D& V) ;

          inline          int          operator!=          (Region_4D& V) ;

 

          inline          Region_4D&          operator*= (const Matrix& M) ;

 

//          inline          Region_2D&   operator= (int val) ;

//          inline          Region_2D&   operator= (float val) ;

          inline          Region_4D&   operator= (Region_4D& V) ;

          inline          Region_4D&   operator+ (Region_4D& V) ;

//          inline          float&          operator[] (const int i) ;

} ;