1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     Basic OGL classes and definitions 
   4 // Author:      Julian Smart 
   8 // Copyright:   (c) Julian Smart 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  16 #pragma interface "basic.h" 
  19 #define OGL_VERSION     2.0 
  21 #ifndef DEFAULT_MOUSE_TOLERANCE 
  22 #define DEFAULT_MOUSE_TOLERANCE 3 
  25 // Edit these lines if you positively don't want PROLOGIO support 
  39 #define ARROW_MIDDLE       3 
  42 // Control point types 
  43 // Rectangle and most other shapes 
  44 #define CONTROL_POINT_VERTICAL   1 
  45 #define CONTROL_POINT_HORIZONTAL 2 
  46 #define CONTROL_POINT_DIAGONAL   3 
  49 #define CONTROL_POINT_ENDPOINT_TO 4 
  50 #define CONTROL_POINT_ENDPOINT_FROM 5 
  51 #define CONTROL_POINT_LINE       6 
  53 // Types of formatting: can be combined in a bit list 
  56 #define FORMAT_CENTRE_HORIZ   1 
  57                                 // Centre horizontally 
  58 #define FORMAT_CENTRE_VERT    2 
  60 #define FORMAT_SIZE_TO_CONTENTS 4 
  61                                 // Resize shape to contents 
  66 #define SHADOW_RIGHT          2 
  73 #define SHAPE_BASIC           wxTYPE_USER + 1 
  74 #define SHAPE_RECTANGLE       wxTYPE_USER + 2 
  75 #define SHAPE_ELLIPSE         wxTYPE_USER + 3 
  76 #define SHAPE_POLYGON         wxTYPE_USER + 4 
  77 #define SHAPE_CIRCLE          wxTYPE_USER + 5 
  78 #define SHAPE_LINE            wxTYPE_USER + 6 
  79 #define SHAPE_DIVIDED_RECTANGLE wxTYPE_USER + 8 
  80 #define SHAPE_COMPOSITE       wxTYPE_USER + 9 
  81 #define SHAPE_CONTROL_POINT   wxTYPE_USER + 10 
  82 #define SHAPE_DRAWN           wxTYPE_USER + 11 
  83 #define SHAPE_DIVISION        wxTYPE_USER + 12 
  84 #define SHAPE_LABEL_OBJECT    wxTYPE_USER + 13 
  85 #define SHAPE_BITMAP          wxTYPE_USER + 14 
  86 #define SHAPE_DIVIDED_OBJECT_CONTROL_POINT   wxTYPE_USER + 15 
  88 #define OBJECT_REGION         wxTYPE_USER + 20 
  90 #define OP_CLICK_LEFT  1 
  91 #define OP_CLICK_RIGHT 2 
  92 #define OP_DRAG_LEFT 4 
  93 #define OP_DRAG_RIGHT 8 
  95 #define OP_ALL (OP_CLICK_LEFT | OP_CLICK_RIGHT | OP_DRAG_LEFT | OP_DRAG_RIGHT) 
  97 class wxShapeTextLine
; 
 100 class wxControlPoint
; 
 105 class WXDLLEXPORT wxExpr
; 
 106 class WXDLLEXPORT wxExprDatabase
; 
 109 class wxShapeEvtHandler
: public wxObject
 
 111  DECLARE_DYNAMIC_CLASS(wxShapeEvtHandler
) 
 114   wxShapeEvtHandler(wxShapeEvtHandler 
*prev 
= NULL
, wxShape 
*shape 
= NULL
); 
 115   virtual ~wxShapeEvtHandler(); 
 117   inline void SetShape(wxShape 
*sh
) { m_handlerShape 
= sh
; } 
 118   inline wxShape 
*GetShape() const { return m_handlerShape
; } 
 120   inline void SetPreviousHandler(wxShapeEvtHandler
* handler
) { m_previousHandler 
= handler
; } 
 121   inline wxShapeEvtHandler
* GetPreviousHandler() const { return m_previousHandler
; } 
 123   // This is called when the _shape_ is deleted. 
 124   virtual void OnDelete(); 
 125   virtual void OnDraw(wxDC
& dc
); 
 126   virtual void OnDrawContents(wxDC
& dc
); 
 127   virtual void OnMoveLinks(wxDC
& dc
); 
 128   virtual void OnErase(wxDC
& dc
); 
 129   virtual void OnEraseContents(wxDC
& dc
); 
 130   virtual void OnHighlight(wxDC
& dc
); 
 131   virtual void OnLeftClick(float x
, float y
, int keys 
= 0, int attachment 
= 0); 
 132   virtual void OnRightClick(float x
, float y
, int keys 
= 0, int attachment 
= 0); 
 133   virtual void OnSize(float x
, float y
); 
 134   virtual bool OnMovePre(wxDC
& dc
, float x
, float y
, float old_x
, float old_y
, bool display 
= TRUE
); 
 135   virtual void OnMovePost(wxDC
& dc
, float x
, float y
, float old_x
, float old_y
, bool display 
= TRUE
); 
 137   virtual void OnDragLeft(bool draw
, float x
, float y
, int keys
=0, int attachment 
= 0); // Erase if draw false 
 138   virtual void OnBeginDragLeft(float x
, float y
, int keys
=0, int attachment 
= 0); 
 139   virtual void OnEndDragLeft(float x
, float y
, int keys
=0, int attachment 
= 0); 
 140   virtual void OnDragRight(bool draw
, float x
, float y
, int keys
=0, int attachment 
= 0); // Erase if draw false 
 141   virtual void OnBeginDragRight(float x
, float y
, int keys
=0, int attachment 
= 0); 
 142   virtual void OnEndDragRight(float x
, float y
, int keys
=0, int attachment 
= 0); 
 143   virtual void OnDrawOutline(wxDC
& dc
, float x
, float y
, float w
, float h
); 
 144   virtual void OnDrawControlPoints(wxDC
& dc
); 
 145   virtual void OnEraseControlPoints(wxDC
& dc
); 
 146   virtual void OnMoveLink(wxDC
& dc
, bool moveControlPoints 
= TRUE
); 
 148   // Control points ('handles') redirect control to the actual shape, to make it easier 
 149   // to override sizing behaviour. 
 150   virtual void OnSizingDragLeft(wxControlPoint
* pt
, bool draw
, float x
, float y
, int keys
=0, int attachment 
= 0); // Erase if draw false 
 151   virtual void OnSizingBeginDragLeft(wxControlPoint
* pt
, float x
, float y
, int keys
=0, int attachment 
= 0); 
 152   virtual void OnSizingEndDragLeft(wxControlPoint
* pt
, float x
, float y
, int keys
=0, int attachment 
= 0); 
 154   virtual void OnBeginSize(float WXUNUSED(w
), float WXUNUSED(h
)) { } 
 155   virtual void OnEndSize(float WXUNUSED(w
), float WXUNUSED(h
)) { } 
 157   // Creates a copy of this event handler. 
 158   wxShapeEvtHandler 
*CreateNewCopy(); 
 160   // Does the copy - override for new event handlers which might store 
 161   // app-specific data. 
 162   virtual void CopyData(wxShapeEvtHandler
& copy
) {}; 
 165   wxShapeEvtHandler
*    m_previousHandler
; 
 166   wxShape
*              m_handlerShape
; 
 169 class wxShape
: public wxShapeEvtHandler
 
 171  DECLARE_ABSTRACT_CLASS(wxShape
) 
 175   wxShape(wxShapeCanvas 
*can 
= NULL
); 
 177   virtual void GetBoundingBoxMax(float *width
, float *height
); 
 178   virtual void GetBoundingBoxMin(float *width
, float *height
) = 0; 
 179   virtual bool GetPerimeterPoint(float x1
, float y1
, 
 181                                  float *x3
, float *y3
); 
 182   inline wxShapeCanvas 
*GetCanvas() { return m_canvas
; } 
 183   void SetCanvas(wxShapeCanvas 
*the_canvas
); 
 184   virtual void AddToCanvas(wxShapeCanvas 
*the_canvas
, wxShape 
*addAfter 
= NULL
); 
 185   virtual void InsertInCanvas(wxShapeCanvas 
*the_canvas
); 
 187   virtual void RemoveFromCanvas(wxShapeCanvas 
*the_canvas
); 
 188   inline float GetX() const { return m_xpos
; } 
 189   inline float GetY() const { return m_ypos
; } 
 190   inline void SetX(float x
) { m_xpos 
= x
; } 
 191   inline void SetY(float y
) { m_ypos 
= y
; } 
 193   inline wxShape 
*GetParent() const { return m_parent
; } 
 194   inline void SetParent(wxShape 
*p
) { m_parent 
= p
; } 
 195   wxShape 
*GetTopAncestor(); 
 196   inline wxList
& GetChildren() { return m_children
; } 
 198   virtual void OnDraw(wxDC
& dc
); 
 199   virtual void OnDrawContents(wxDC
& dc
); 
 200   virtual void OnMoveLinks(wxDC
& dc
); 
 201   virtual void Unlink() { }; 
 202   void SetDrawHandles(bool drawH
); 
 203   inline bool GetDrawHandles() { return m_drawHandles
; } 
 204   virtual void OnErase(wxDC
& dc
); 
 205   virtual void OnEraseContents(wxDC
& dc
); 
 206   virtual void OnHighlight(wxDC
& dc
); 
 207   virtual void OnLeftClick(float x
, float y
, int keys 
= 0, int attachment 
= 0); 
 208   virtual void OnRightClick(float x
, float y
, int keys 
= 0, int attachment 
= 0); 
 209   virtual void OnSize(float x
, float y
); 
 210   virtual bool OnMovePre(wxDC
& dc
, float x
, float y
, float old_x
, float old_y
, bool display 
= TRUE
); 
 211   virtual void OnMovePost(wxDC
& dc
, float x
, float y
, float old_x
, float old_y
, bool display 
= TRUE
); 
 213   virtual void OnDragLeft(bool draw
, float x
, float y
, int keys
=0, int attachment 
= 0); // Erase if draw false 
 214   virtual void OnBeginDragLeft(float x
, float y
, int keys
=0, int attachment 
= 0); 
 215   virtual void OnEndDragLeft(float x
, float y
, int keys
=0, int attachment 
= 0); 
 216   virtual void OnDragRight(bool draw
, float x
, float y
, int keys
=0, int attachment 
= 0); // Erase if draw false 
 217   virtual void OnBeginDragRight(float x
, float y
, int keys
=0, int attachment 
= 0); 
 218   virtual void OnEndDragRight(float x
, float y
, int keys
=0, int attachment 
= 0); 
 219   virtual void OnDrawOutline(wxDC
& dc
, float x
, float y
, float w
, float h
); 
 220   virtual void OnDrawControlPoints(wxDC
& dc
); 
 221   virtual void OnEraseControlPoints(wxDC
& dc
); 
 223   virtual void OnBeginSize(float WXUNUSED(w
), float WXUNUSED(h
)) { } 
 224   virtual void OnEndSize(float WXUNUSED(w
), float WXUNUSED(h
)) { } 
 226   // Control points ('handles') redirect control to the actual shape, to make it easier 
 227   // to override sizing behaviour. 
 228   virtual void OnSizingDragLeft(wxControlPoint
* pt
, bool draw
, float x
, float y
, int keys
=0, int attachment 
= 0); // Erase if draw false 
 229   virtual void OnSizingBeginDragLeft(wxControlPoint
* pt
, float x
, float y
, int keys
=0, int attachment 
= 0); 
 230   virtual void OnSizingEndDragLeft(wxControlPoint
* pt
, float x
, float y
, int keys
=0, int attachment 
= 0); 
 232   virtual void MakeControlPoints(); 
 233   virtual void DeleteControlPoints(wxDC 
*dc 
= NULL
); 
 234   virtual void ResetControlPoints(); 
 236   inline wxShapeEvtHandler 
*GetEventHandler() { return m_eventHandler
; } 
 237   inline void SetEventHandler(wxShapeEvtHandler 
*handler
) { m_eventHandler 
= handler
; } 
 239   // Mandatory control points, e.g. the divided line moving handles 
 240   // should appear even if a child of the 'selected' image 
 241   virtual void MakeMandatoryControlPoints(); 
 242   virtual void ResetMandatoryControlPoints(); 
 244   inline virtual bool Recompute() { return TRUE
; }; 
 245   // Calculate size recursively, if size changes. Size might depend on children. 
 246   inline virtual void CalculateSize() { }; 
 247   virtual void Select(bool select 
= TRUE
, wxDC
* dc 
= NULL
); 
 248   virtual void SetHighlight(bool hi 
= TRUE
, bool recurse 
= FALSE
); 
 249   inline virtual bool IsHighlighted() const { return m_highlighted
; }; 
 250   virtual bool Selected() const; 
 251   virtual bool AncestorSelected() const; 
 252   void SetSensitivityFilter(int sens 
= OP_ALL
, bool recursive 
= FALSE
); 
 253   int GetSensitivityFilter() const { return m_sensitivity
; } 
 254   void SetDraggable(bool drag
, bool recursive 
= FALSE
); 
 255   inline  void SetFixedSize(bool x
, bool y
) { m_fixedWidth 
= x
; m_fixedHeight 
= y
; }; 
 256   inline  void GetFixedSize(bool *x
, bool *y
) const { *x 
= m_fixedWidth
; *y 
= m_fixedHeight
; }; 
 257   inline  bool GetFixedWidth() const { return m_fixedWidth
; } 
 258   inline  bool GetFixedHeight() const { return m_fixedHeight
; } 
 259   inline  void SetSpaceAttachments(bool sp
) { m_spaceAttachments 
= sp
; }; 
 260   inline  bool GetSpaceAttachments() const { return m_spaceAttachments
; }; 
 261   void SetShadowMode(int mode
, bool redraw 
= FALSE
); 
 262   inline int GetShadowMode() const { return m_shadowMode
; } 
 263   virtual bool HitTest(float x
, float y
, int *attachment
, float *distance
); 
 264   inline void SetCentreResize(bool cr
) { m_centreResize 
= cr
; } 
 265   inline bool GetCentreResize() const { return m_centreResize
; } 
 266   inline wxList
& GetLines() { return m_lines
; } 
 267   inline void SetDisableLabel(bool flag
) { m_disableLabel 
= flag
; } 
 268   inline bool GetDisableLabel() const { return m_disableLabel
; } 
 269   inline void SetAttachmentMode(bool flag
) { m_attachmentMode 
= flag
; } 
 270   inline bool GetAttachmentMode() const { return m_attachmentMode
; } 
 271   inline void SetId(long i
) { m_id 
= i
; } 
 272   inline long GetId() const { return m_id
; } 
 274   void SetPen(wxPen 
*pen
); 
 275   void SetBrush(wxBrush 
*brush
); 
 276   inline void SetClientData(wxObject 
*client_data
) { m_clientData 
= client_data
; }; 
 277   inline wxObject 
*GetClientData() const { return m_clientData
; }; 
 279   virtual void Show(bool show
); 
 280   virtual bool IsShown() const { return m_visible
; } 
 281   virtual void Move(wxDC
& dc
, float x1
, float y1
, bool display 
= TRUE
); 
 282   virtual void Erase(wxDC
& dc
); 
 283   virtual void EraseContents(wxDC
& dc
); 
 284   virtual void Draw(wxDC
& dc
); 
 285   virtual void Flash(); 
 286   virtual void MoveLinks(wxDC
& dc
); 
 287   virtual void DrawContents(wxDC
& dc
);  // E.g. for drawing text label 
 288   virtual void SetSize(float x
, float y
, bool recursive 
= TRUE
); 
 289   virtual void SetAttachmentSize(float x
, float y
); 
 290   void Attach(wxShapeCanvas 
*can
); 
 293   inline virtual bool Constrain() { return FALSE
; } ; 
 295   void AddLine(wxLineShape 
*line
, wxShape 
*other
, 
 296                int attachFrom 
= 0, int attachTo 
= 0); 
 297   void AddText(const wxString
& string
); 
 299   inline wxPen 
*GetPen() const { return m_pen
; } 
 300   inline wxBrush 
*GetBrush() const { return m_brush
; } 
 303    * Region-specific functions (defaults to the default region 
 307   // Set the default, single region size to be consistent 
 308   // with the object size 
 309   void SetDefaultRegionSize(); 
 310   virtual void FormatText(wxDC
& dc
, const wxString
& s
, int regionId 
= 0); 
 311   virtual void SetFormatMode(int mode
, int regionId 
= 0); 
 312   virtual int GetFormatMode(int regionId 
= 0) const; 
 313   virtual void SetFont(wxFont 
*font
, int regionId 
= 0); 
 314   virtual wxFont 
*GetFont(int regionId 
= 0) const; 
 315   virtual void SetTextColour(const wxString
& colour
, int regionId 
= 0); 
 316   virtual wxString 
GetTextColour(int regionId 
= 0) const; 
 317   virtual inline int GetNumberOfTextRegions() const { return m_regions
.Number(); } 
 318   virtual void SetRegionName(const wxString
& name
, int regionId 
= 0); 
 320   // Get the name representing the region for this image alone. 
 321   // I.e. this image's region ids go from 0 to N-1. 
 322   // But the names might be "0.2.0", "0.2.1" etc. depending on position in composite. 
 323   // So the last digit represents the region Id, the others represent positions 
 325   virtual wxString 
GetRegionName(int regionId
); 
 327   // Gets the region corresponding to the name, or -1 if not found. 
 328   virtual int GetRegionId(const wxString
& name
); 
 330   // Construct names for regions, unique even for children of a composite. 
 331   virtual void NameRegions(const wxString
& parentName 
= ""); 
 333   // Get list of regions 
 334   inline wxList
& GetRegions() const { return (wxList
&) m_regions
; } 
 336   virtual void AddRegion(wxShapeRegion 
*region
); 
 338   virtual void ClearRegions(); 
 340   // Assign new ids to this image and children (if composite) 
 343   // Returns actual image (same as 'this' if non-composite) and region id 
 344   // for given region name. 
 345   virtual wxShape 
*FindRegion(const wxString
& regionName
, int *regionId
); 
 347   // Finds all region names for this image (composite or simple). 
 348   // Supply empty string list. 
 349   virtual void FindRegionNames(wxStringList
& list
); 
 351   virtual void ClearText(int regionId 
= 0); 
 352   void RemoveLine(wxLineShape 
*line
); 
 355   // Prolog database stuff 
 356   virtual char *GetFunctor(); 
 357   virtual void WritePrologAttributes(wxExpr 
*clause
); 
 358   virtual void ReadPrologAttributes(wxExpr 
*clause
); 
 360   // In case the object has constraints it needs to read in in a different pass 
 361   inline virtual void ReadConstraints(wxExpr 
*WXUNUSED(clause
), wxExprDatabase 
*WXUNUSED(database
)) { }; 
 362   virtual void WriteRegions(wxExpr 
*clause
); 
 363   virtual void ReadRegions(wxExpr 
*clause
); 
 367   virtual bool GetAttachmentPosition(int attachment
, float *x
, float *y
, 
 368                                      int nth 
= 0, int no_arcs 
= 1, wxLineShape 
*line 
= NULL
); 
 369   virtual int GetNumberOfAttachments(); 
 370   virtual bool AttachmentIsValid(int attachment
); 
 372   virtual void EraseLinks(wxDC
& dc
, int attachment 
= -1, bool recurse 
= FALSE
); 
 373   virtual void DrawLinks(wxDC
& dc
, int attachment 
= -1, bool recurse 
= FALSE
); 
 375   virtual void MoveLineToNewAttachment(wxDC
& dc
, wxLineShape 
*to_move
, 
 378   // Reorders the lines coming into the node image at this attachment 
 379   // position, in the order in which they appear in linesToSort. 
 380   virtual void SortLines(int attachment
, wxList
& linesToSort
); 
 382   // This is really to distinguish between lines and other images. 
 383   // For lines, want to pass drag to canvas, since lines tend to prevent 
 384   // dragging on a canvas (they get in the way.) 
 385   virtual bool Draggable() const { return TRUE
; } 
 387   // Returns TRUE if image is a descendant of this image 
 388   bool HasDescendant(wxShape 
*image
); 
 390   // Creates a copy of this shape. 
 391   wxShape 
*CreateNewCopy(bool resetMapping 
= TRUE
, bool recompute 
= TRUE
); 
 393   // Does the copying for this object 
 394   virtual void Copy(wxShape
& copy
); 
 396   // Does the copying for this object, including copying event 
 397   // handler data if any. Calls the virtual Copy function. 
 398   void CopyWithHandler(wxShape
& copy
); 
 400   // Rotate about the given axis by the given amount in radians 
 401   // (does nothing for most objects) 
 402   // But even non-rotating objects should record their notional 
 403   // rotation in case it's important (e.g. in dog-leg code). 
 404   virtual inline void Rotate(float WXUNUSED(x
), float WXUNUSED(y
), float theta
) { m_rotation 
= theta
; } 
 405   virtual inline float GetRotation() const { return m_rotation
; } 
 407   void ClearAttachments(); 
 409   // Recentres all the text regions for this object 
 410   void Recentre(wxDC
& dc
); 
 412   // Clears points from a list of wxRealPoints 
 413   void ClearPointList(wxList
& list
); 
 416   wxObject
*             m_clientData
; 
 419   wxShapeEvtHandler
*    m_eventHandler
; 
 421   float                 m_xpos
, m_ypos
; 
 425   wxColour
*             m_textColour
; 
 426   wxString              m_textColourName
; 
 427   wxShapeCanvas
*        m_canvas
; 
 430   wxList                m_controlPoints
; 
 432   wxList                m_attachmentPoints
; 
 437   bool                  m_highlighted
;      // Different from selected: user-defined highlighting, 
 438                                             // e.g. thick border. 
 442   bool                  m_attachmentMode
;   // TRUE if using attachments, FALSE otherwise 
 443   bool                  m_spaceAttachments
; // TRUE if lines at one side should be spaced 
 446   bool                  m_centreResize
;    // Default is to resize keeping the centre constant (TRUE) 
 447   bool                  m_drawHandles
;     // Don't draw handles if FALSE, usually TRUE 
 448   wxList                m_children
;      // In case it's composite 
 449   wxShape
*              m_parent
;      // In case it's a child 
 452   wxBrush
*              m_shadowBrush
; 
 455   int                   m_textMarginX
;    // Gap between text and border 
 457   wxString              m_regionName
; 
 460 class wxPolygonShape
: public wxShape
 
 462  DECLARE_DYNAMIC_CLASS(wxPolygonShape
) 
 467   // Takes a list of wxRealPoints; each point is an OFFSET from the centre. 
 468   // Deletes user's points in destructor. 
 469   virtual void Create(wxList 
*points
); 
 471   void GetBoundingBoxMin(float *w
, float *h
); 
 472   void CalculateBoundingBox(); 
 473   bool GetPerimeterPoint(float x1
, float y1
, 
 475                                  float *x3
, float *y3
); 
 476   bool HitTest(float x
, float y
, int *attachment
, float *distance
); 
 477   void SetSize(float x
, float y
, bool recursive 
= TRUE
); 
 478   void OnDraw(wxDC
& dc
); 
 479   void OnDrawOutline(wxDC
& dc
, float x
, float y
, float w
, float h
); 
 481   // Control points ('handles') redirect control to the actual shape, to make it easier 
 482   // to override sizing behaviour. 
 483   virtual void OnSizingDragLeft(wxControlPoint
* pt
, bool draw
, float x
, float y
, int keys
=0, int attachment 
= 0); 
 484   virtual void OnSizingBeginDragLeft(wxControlPoint
* pt
, float x
, float y
, int keys
=0, int attachment 
= 0); 
 485   virtual void OnSizingEndDragLeft(wxControlPoint
* pt
, float x
, float y
, int keys
=0, int attachment 
= 0); 
 487   // A polygon should have a control point at each vertex, 
 488   // with the option of moving the control points individually 
 489   // to change the shape. 
 490   void MakeControlPoints(); 
 491   void ResetControlPoints(); 
 493   // If we've changed the shape, must make the original 
 494   // points match the working points 
 495   void UpdateOriginalPoints(); 
 497   // Add a control point after the given point 
 498   virtual void AddPolygonPoint(int pos 
= 0); 
 500   // Delete a control point 
 501   virtual void DeletePolygonPoint(int pos 
= 0); 
 503   // Recalculates the centre of the polygon 
 504   virtual void CalculatePolygonCentre(); 
 507   // Prolog database stuff 
 508   void WritePrologAttributes(wxExpr 
*clause
); 
 509   void ReadPrologAttributes(wxExpr 
*clause
); 
 512   int GetNumberOfAttachments(); 
 513   bool GetAttachmentPosition(int attachment
, float *x
, float *y
, 
 514                                      int nth 
= 0, int no_arcs 
= 1, wxLineShape 
*line 
= NULL
); 
 515   bool AttachmentIsValid(int attachment
); 
 516   // Does the copying for this object 
 517   void Copy(wxShape
& copy
); 
 519   inline wxList 
*GetPoints() { return m_points
; } 
 523   wxList
*       m_originalPoints
; 
 526   float         m_originalWidth
; 
 527   float         m_originalHeight
; 
 530 class wxRectangleShape
: public wxShape
 
 532  DECLARE_DYNAMIC_CLASS(wxRectangleShape
) 
 534   wxRectangleShape(float w 
= 0.0, float h 
= 0.0); 
 535   void GetBoundingBoxMin(float *w
, float *h
); 
 536   bool GetPerimeterPoint(float x1
, float y1
, 
 538                                  float *x3
, float *y3
); 
 539   void OnDraw(wxDC
& dc
); 
 540   void SetSize(float x
, float y
, bool recursive 
= TRUE
); 
 541   void SetCornerRadius(float rad
); // If > 0, rounded corners 
 544   // Prolog database stuff 
 545   void WritePrologAttributes(wxExpr 
*clause
); 
 546   void ReadPrologAttributes(wxExpr 
*clause
); 
 549   int GetNumberOfAttachments(); 
 550   bool GetAttachmentPosition(int attachment
, float *x
, float *y
, 
 551                                      int nth 
= 0, int no_arcs 
= 1, wxLineShape 
*line 
= NULL
); 
 552   // Does the copying for this object 
 553   void Copy(wxShape
& copy
); 
 555   inline float GetWidth() const { return m_width
; } 
 556   inline float GetHeight() const { return m_height
; } 
 561   float m_cornerRadius
; 
 564 class wxTextShape
: public wxRectangleShape
 
 566  DECLARE_DYNAMIC_CLASS(wxTextShape
) 
 568   wxTextShape(float width 
= 0.0, float height 
= 0.0); 
 570   void OnDraw(wxDC
& dc
); 
 573   void WritePrologAttributes(wxExpr 
*clause
); 
 576   // Does the copying for this object 
 577   void Copy(wxShape
& copy
); 
 580 class wxEllipseShape
: public wxShape
 
 582  DECLARE_DYNAMIC_CLASS(wxEllipseShape
) 
 584   wxEllipseShape(float w 
= 0.0, float h 
= 0.0); 
 586   void GetBoundingBoxMin(float *w
, float *h
); 
 587   bool GetPerimeterPoint(float x1
, float y1
, 
 589                                  float *x3
, float *y3
); 
 591   void OnDraw(wxDC
& dc
); 
 592   void SetSize(float x
, float y
, bool recursive 
= TRUE
); 
 595   // Prolog database stuff 
 596   void WritePrologAttributes(wxExpr 
*clause
); 
 597   void ReadPrologAttributes(wxExpr 
*clause
); 
 600   int GetNumberOfAttachments(); 
 601   bool GetAttachmentPosition(int attachment
, float *x
, float *y
, 
 602                                      int nth 
= 0, int no_arcs 
= 1, wxLineShape 
*line 
= NULL
); 
 604   // Does the copying for this object 
 605   void Copy(wxShape
& copy
); 
 607   inline float GetWidth() const { return m_width
; } 
 608   inline float GetHeight() const { return m_height
; } 
 615 class wxCircleShape
: public wxEllipseShape
 
 617  DECLARE_DYNAMIC_CLASS(wxCircleShape
) 
 619   wxCircleShape(float w 
= 0.0); 
 621   bool GetPerimeterPoint(float x1
, float y1
, 
 623                                  float *x3
, float *y3
); 
 624   // Does the copying for this object 
 625   void Copy(wxShape
& copy
);