+//----------------------------------------------------------------------------
+// wxCanvasObjectGroup
+//----------------------------------------------------------------------------
+
+class wxCanvasObjectGroup
+{
+public:
+ wxCanvasObjectGroup();
+ virtual ~wxCanvasObjectGroup();
+
+ void SetOwner(wxCanvas* canvas);
+ wxCanvas *GetOwner() { return m_owner; }
+
+ virtual void Prepend( wxCanvasObject* obj );
+ virtual void Append( wxCanvasObject* obj );
+ virtual void Insert( size_t before, wxCanvasObject* obj );
+ virtual void Remove( wxCanvasObject* obj );
+
+ virtual void Recreate();
+ void DeleteContents( bool );
+ virtual void Render(int xabs, int yabs,int x, int y, int width, int height );
+ virtual void WriteSVG( wxTextOutputStream &stream );
+ virtual bool IsHit( int x, int y, int margin );
+ virtual wxCanvasObject* IsHitObject( int x, int y, int margin );
+
+ void ExtendArea(double x, double y);
+
+ inline double GetXMin() { return m_minx; }
+ inline double GetYMin() { return m_miny; }
+ inline double GetXMax() { return m_maxx; }
+ inline double GetYMax() { return m_maxy; }
+
+protected:
+ wxCanvas *m_owner;
+
+ //bounding box
+ double m_minx;
+ double m_miny;
+ double m_maxx;
+ double m_maxy;
+ bool m_validbounds;
+
+ wxList m_objects;
+
+ friend class wxCanvas;
+};
+
+//----------------------------------------------------------------------------
+// wxCanvasObjectGroupRef
+//----------------------------------------------------------------------------
+
+class wxCanvasObjectGroupRef: public wxCanvasObject
+{
+public:
+ wxCanvasObjectGroupRef(double x, double y,wxCanvasObjectGroup* group);
+
+ void SetOwner(wxCanvas* canvas);
+
+ virtual void Recreate();
+ virtual void Render(int xabs, int yabs,int x, int y, int width, int height );
+ virtual void WriteSVG( wxTextOutputStream &stream );
+ virtual bool IsHit( int x, int y, int margin );
+ void Move( int x, int y );
+
+ inline double GetPosX() { return m_x; }
+ inline double GetPosY() { return m_y; }
+
+ void ExtendArea(double x, double y);
+ virtual wxCanvasObject* IsHitObject( int x, int y, int margin );
+
+protected:
+ //position of the group
+ double m_x;
+ double m_y;
+
+ //reference to the group
+ wxCanvasObjectGroup* m_group;
+
+ //bounding box
+ double m_minx;
+ double m_miny;
+ double m_maxx;
+ double m_maxy;
+ bool m_validbounds;
+
+};
+
+//----------------------------------------------------------------------------
+// wxCanvasPolygon
+//----------------------------------------------------------------------------
+
+class wxCanvasPolygon: public wxCanvasObject
+{
+public:
+ wxCanvasPolygon( int n, wxPoint2DDouble points[] );
+ ~wxCanvasPolygon();
+ void SetBrush(wxBrush& brush) { m_brush = brush; };
+ void SetPen(wxPen& pen) { m_pen = pen; };
+
+ virtual void Recreate();
+
+ virtual void Render(int xabs, int yabs, int clip_x, int clip_y, int clip_width, int clip_height );
+ virtual void WriteSVG( wxTextOutputStream &stream );
+
+private:
+ void ExtendArea(double x, double y);
+
+ wxBrush m_brush;
+ wxPen m_pen;
+
+ int m_n;
+ wxPoint2DDouble* m_points;
+
+ //bounding box
+ double m_minx;
+ double m_miny;
+ double m_maxx;
+ double m_maxy;
+ bool m_validbounds;
+
+};
+
+//----------------------------------------------------------------------------
+// wxCanvasPolyline
+//----------------------------------------------------------------------------
+
+class wxCanvasPolyline: public wxCanvasObject
+{
+public:
+ wxCanvasPolyline(int n, wxPoint2DDouble points[]);
+ ~wxCanvasPolyline();
+ void SetPen(wxPen& pen) { m_pen = pen; };
+
+ virtual void Recreate();
+
+ virtual void Render(int xabs, int yabs, int clip_x, int clip_y, int clip_width, int clip_height );
+ virtual void WriteSVG( wxTextOutputStream &stream );
+
+private:
+ void ExtendArea(double x, double y);
+
+ wxPen m_pen;
+
+ int m_n;
+ wxPoint2DDouble* m_points;
+
+ //bounding box
+ double m_minx;
+ double m_miny;
+ double m_maxx;
+ double m_maxy;
+ bool m_validbounds;
+
+};
+
+
+