Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __HIPPRECTANGLE_H__
00022 #define __HIPPRECTANGLE_H__
00023
00024 #include <wx/docview.h>
00025 #include "HippShape.h"
00026 #include <xercesc/util/XMLString.hpp>
00027 #include <iostream>
00028
00029 using namespace xercesc;
00030 using namespace std;
00031 namespace hipp {
00032
00048 class HippRectangle: public HippShape {
00049 public:
00050 HippRectangle(void);
00051 HippRectangle(int x, int y, int width, int height);
00052 ~HippRectangle(void);
00053
00054 void LoadObject(const xercesc::Attributes& attrs, const XMLCh* const localname=XMLString::transcode("rect"));
00055 ostream& SaveObject(ostream& stream);
00056
00057 ShapeType getShapeType(){
00058 return Rectangle;
00059 }
00060
00061 const wxRect& getBounds() const;
00062 bool containsPoint(wxPoint p) const;
00063 void OnDraw(Cairo::RefPtr<Cairo::Context> context, bool isHaptic = true) const;
00064 virtual HippRectangle* clone() const;
00065 void move(int diffX, int diffY);
00066 void zoom(double scaleX, double scaleY);
00067
00068 wxPoint getTopLeft() const;
00069 int getWidth() const;
00070 int getHeight() const;
00071
00072 private:
00073 wxRect boundingBox;
00074 int x;
00075 int y;
00076 int width;
00077 int height;
00078 };
00079 }
00080 #endif