Rectangle.h

Go to the documentation of this file.
00001 /* -*- mode: c++ -*- */
00002 
00014 #ifndef _RECTANGLE_H_
00015 #define _RECTANGLE_H_
00016 
00017 #include "Point.h"
00018 #include "Size.h"
00019 
00020 #include <vector>
00021 
00022 namespace hippodraw {
00023 
00034 class MDL_HIPPOPLOT_API Rect
00035 {
00036 
00037 private:
00038 
00040   Point m_origin;
00041 
00043   Size  m_size;
00044 
00046   const Point & getOrigin() const;
00047 
00049   const Size & getSize() const;
00050 
00051 public:
00052 
00055   Rect ();
00056 
00059   Rect ( double x, double y, double width, double height );
00060 
00063   Rect ( double x, double y, double z,
00064          double width, double height, double depth );
00065 
00067   void setRect ( double x, double y, double width, double height );
00068 
00070   void setRect ( double x, double y, double z,
00071                  double width, double height, double depth );
00072 
00075   void moveBy ( double x, double y );
00076 
00078   inline double getX() const;
00079 
00081   inline double getY() const;
00082   
00084   double getZ() const;
00085 
00087   void setZ ( double );
00088 
00090   double getWidth() const;
00091 
00093   double getHeight() const;
00094 
00096   double getDepth() const;
00097 
00098 
00101   void setDepth ( double );
00102 
00104   bool isInDepth ( double z1 ) const;
00105 
00109   bool isInBounds ( double x1, double y1 ) const;
00110 
00114   bool isInBounds  ( double x1, double y1, double z1 ) const;
00115 
00121   void makeInBounds ( double & x, double & y ) const;
00122 
00128   void makeInBounds ( double & x, double & y, double & z ) const;
00129 
00136   void makeInBounds ( std::vector< double > & x, 
00137                       std::vector< double > & y ) const;
00138 
00145   void makeInBounds ( std::vector< double > & x, 
00146                       std::vector< double > & y,
00147                       std::vector< double > & z ) const;
00148 
00149 };
00150 
00151 inline
00152 double
00153 Rect::
00154 getX() const
00155 {
00156   return m_origin.getX();
00157 }
00158 
00159 inline
00160 double
00161 Rect::
00162 getY() const
00163 {
00164   return m_origin.getY();
00165 }
00166 
00167 } // namespace hippodraw
00168 
00169 #endif // _RECTANGLE_H_

Generated for HippoDraw Class Library by doxygen