00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _RECTANGLE_H_
00012 #define _RECTANGLE_H_
00013
00014 #include "Point.h"
00015 #include "Size.h"
00016
00017 #include <vector>
00018
00029 class MDL_HIPPOPLOT_API HippoRectangle
00030 {
00031
00032 private:
00033
00035 Point m_origin;
00036
00038 Size m_size;
00039
00041 const Point & getOrigin() const;
00042
00044 const Size & getSize() const;
00045
00046 public:
00047
00049 HippoRectangle();
00050
00052 HippoRectangle ( double x, double y, double width, double height );
00053
00055 HippoRectangle ( double x, double y, double z,
00056 double width, double height, double depth );
00057
00059 void setRect ( double x, double y, double width, double height );
00060
00062 void setRect ( double x, double y, double z,
00063 double width, double height, double depth );
00064
00067 void moveBy ( double x, double y );
00068
00070 inline double getX() const;
00071
00073 inline double getY() const;
00074
00076 double getZ() const;
00077
00079 void setZ ( double );
00080
00082 double getWidth() const;
00083
00085 double getHeight() const;
00086
00088 double getDepth() const;
00089
00091 void setDepth ( double );
00092
00094 bool isInDepth ( double z1 ) const;
00095
00098 bool isInBounds ( double x1, double y1 ) const;
00099
00102 bool isInBounds ( double x1, double y1, double z1 ) const;
00103
00108 void makeInBounds ( double & x, double & y ) const;
00109
00114 void makeInBounds ( double & x, double & y, double & z ) const;
00115
00120 void makeInBounds ( std::vector< double > & x,
00121 std::vector< double > & y ) const;
00122
00128 void makeInBounds ( std::vector< double > & x,
00129 std::vector< double > & y,
00130 std::vector< double > & z ) const;
00131
00132 friend std::ostream & operator << ( std::ostream &, const HippoRectangle & );
00133
00134 };
00135
00136 inline
00137 double
00138 HippoRectangle::
00139 getX() const
00140 {
00141 return m_origin.getX();
00142 }
00143
00144 inline
00145 double
00146 HippoRectangle::
00147 getY() const
00148 {
00149 return m_origin.getY();
00150 }
00151
00152 #endif // _RECTANGLE_H_