]> git.saurik.com Git - wxWidgets.git/blob - utils/ogl/src/basic.h
ad433d4bcab44a812a279ac08171df94f12a0f7d
[wxWidgets.git] / utils / ogl / src / basic.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: basic.h
3 // Purpose: Basic OGL classes and definitions
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 12/07/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _OGL_BASIC_H_
13 #define _OGL_BASIC_H_
14
15 #ifdef __GNUG__
16 #pragma interface "basic.h"
17 #endif
18
19 #define OGL_VERSION 2.0
20
21 #ifndef DEFAULT_MOUSE_TOLERANCE
22 #define DEFAULT_MOUSE_TOLERANCE 3
23 #endif
24
25 // Edit these lines if you positively don't want PROLOGIO support
26 #ifndef PROLOGIO
27 #define PROLOGIO
28 #endif
29
30 // Key identifiers
31 #define KEY_SHIFT 1
32 #define KEY_CTRL 2
33
34 // Arrow styles
35
36 #define ARROW_NONE 0
37 #define ARROW_END 1
38 #define ARROW_BOTH 2
39 #define ARROW_MIDDLE 3
40 #define ARROW_START 4
41
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
47
48 // Line
49 #define CONTROL_POINT_ENDPOINT_TO 4
50 #define CONTROL_POINT_ENDPOINT_FROM 5
51 #define CONTROL_POINT_LINE 6
52
53 // Types of formatting: can be combined in a bit list
54 #define FORMAT_NONE 0
55 // Left justification
56 #define FORMAT_CENTRE_HORIZ 1
57 // Centre horizontally
58 #define FORMAT_CENTRE_VERT 2
59 // Centre vertically
60 #define FORMAT_SIZE_TO_CONTENTS 4
61 // Resize shape to contents
62
63 // Shadow mode
64 #define SHADOW_NONE 0
65 #define SHADOW_LEFT 1
66 #define SHADOW_RIGHT 2
67
68 /*
69 * Declare types
70 *
71 */
72
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
87
88 #define OBJECT_REGION wxTYPE_USER + 20
89
90 #define OP_CLICK_LEFT 1
91 #define OP_CLICK_RIGHT 2
92 #define OP_DRAG_LEFT 4
93 #define OP_DRAG_RIGHT 8
94
95 #define OP_ALL (OP_CLICK_LEFT | OP_CLICK_RIGHT | OP_DRAG_LEFT | OP_DRAG_RIGHT)
96
97 class wxShapeTextLine;
98 class wxShapeCanvas;
99 class wxLineShape;
100 class wxControlPoint;
101 class wxShapeRegion;
102 class wxShape;
103
104 #ifdef PROLOGIO
105 class wxExpr;
106 class wxDatabase;
107 #endif
108
109 class wxShapeEvtHandler: public wxObject
110 {
111 DECLARE_DYNAMIC_CLASS(wxShapeEvtHandler)
112
113 public:
114 wxShapeEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL);
115 virtual ~wxShapeEvtHandler();
116
117 inline void SetHandlerShape(wxShape *sh) { m_handlerShape = sh; }
118 inline wxShape *GetShape() const { return m_handlerShape; }
119
120 // This is called when the _shape_ is deleted.
121 virtual void OnDelete();
122 virtual void OnDraw(wxDC& dc);
123 virtual void OnDrawContents(wxDC& dc);
124 virtual void OnMoveLinks(wxDC& dc);
125 virtual void OnErase(wxDC& dc);
126 virtual void OnEraseContents(wxDC& dc);
127 virtual void OnHighlight(wxDC& dc);
128 virtual void OnLeftClick(float x, float y, int keys = 0, int attachment = 0);
129 virtual void OnRightClick(float x, float y, int keys = 0, int attachment = 0);
130 virtual void OnSize(float x, float y);
131 virtual bool OnMovePre(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
132 virtual void OnMovePost(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
133
134 virtual void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0); // Erase if draw false
135 virtual void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
136 virtual void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
137 virtual void OnDragRight(bool draw, float x, float y, int keys=0, int attachment = 0); // Erase if draw false
138 virtual void OnBeginDragRight(float x, float y, int keys=0, int attachment = 0);
139 virtual void OnEndDragRight(float x, float y, int keys=0, int attachment = 0);
140 virtual void OnDrawOutline(wxDC& dc, float x, float y, float w, float h);
141 virtual void OnDrawControlPoints(wxDC& dc);
142 virtual void OnEraseControlPoints(wxDC& dc);
143 virtual void OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE);
144
145 virtual void OnBeginSize(float WXUNUSED(w), float WXUNUSED(h)) { }
146 virtual void OnEndSize(float WXUNUSED(w), float WXUNUSED(h)) { }
147
148 private:
149 wxShapeEvtHandler* m_previousHandler;
150 wxShape* m_handlerShape;
151 };
152
153 class wxShape: public wxShapeEvtHandler
154 {
155 DECLARE_ABSTRACT_CLASS(wxShape)
156
157 public:
158
159 wxShape(wxShapeCanvas *can = NULL);
160 virtual ~wxShape();
161 virtual void GetBoundingBoxMax(float *width, float *height);
162 virtual void GetBoundingBoxMin(float *width, float *height) = 0;
163 virtual bool GetPerimeterPoint(float x1, float y1,
164 float x2, float y2,
165 float *x3, float *y3);
166 inline wxShapeCanvas *GetCanvas() { return m_canvas; }
167 void SetCanvas(wxShapeCanvas *the_canvas);
168 virtual void AddToCanvas(wxShapeCanvas *the_canvas, wxShape *addAfter = NULL);
169 virtual void InsertInCanvas(wxShapeCanvas *the_canvas);
170
171 virtual void RemoveFromCanvas(wxShapeCanvas *the_canvas);
172 inline float GetX() const { return m_xpos; }
173 inline float GetY() const { return m_ypos; }
174 inline void SetX(float x) { m_xpos = x; }
175 inline void SetY(float y) { m_ypos = y; }
176
177 inline wxShape *GetParent() const { return m_parent; }
178 inline void SetParent(wxShape *p) { m_parent = p; }
179 wxShape *GetTopAncestor();
180 inline wxList& GetChildren() { return m_children; }
181
182 virtual void OnDraw(wxDC& dc);
183 virtual void OnDrawContents(wxDC& dc);
184 virtual void OnMoveLinks(wxDC& dc);
185 virtual void Unlink() { };
186 void SetDrawHandles(bool drawH);
187 inline bool GetDrawHandles() { return m_drawHandles; }
188 virtual void OnErase(wxDC& dc);
189 virtual void OnEraseContents(wxDC& dc);
190 virtual void OnHighlight(wxDC& dc);
191 virtual void OnLeftClick(float x, float y, int keys = 0, int attachment = 0);
192 virtual void OnRightClick(float x, float y, int keys = 0, int attachment = 0);
193 virtual void OnSize(float x, float y);
194 virtual bool OnMovePre(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
195 virtual void OnMovePost(wxDC& dc, float x, float y, float old_x, float old_y, bool display = TRUE);
196
197 virtual void OnDragLeft(bool draw, float x, float y, int keys=0, int attachment = 0); // Erase if draw false
198 virtual void OnBeginDragLeft(float x, float y, int keys=0, int attachment = 0);
199 virtual void OnEndDragLeft(float x, float y, int keys=0, int attachment = 0);
200 virtual void OnDragRight(bool draw, float x, float y, int keys=0, int attachment = 0); // Erase if draw false
201 virtual void OnBeginDragRight(float x, float y, int keys=0, int attachment = 0);
202 virtual void OnEndDragRight(float x, float y, int keys=0, int attachment = 0);
203 virtual void OnDrawOutline(wxDC& dc, float x, float y, float w, float h);
204 virtual void OnDrawControlPoints(wxDC& dc);
205 virtual void OnEraseControlPoints(wxDC& dc);
206
207 virtual void OnBeginSize(float WXUNUSED(w), float WXUNUSED(h)) { }
208 virtual void OnEndSize(float WXUNUSED(w), float WXUNUSED(h)) { }
209
210 virtual void MakeControlPoints();
211 virtual void DeleteControlPoints(wxDC *dc = NULL);
212 virtual void ResetControlPoints();
213
214 inline wxShapeEvtHandler *GetEventHandler() { return m_eventHandler; }
215 inline void SetEventHandler(wxShapeEvtHandler *handler) { m_eventHandler = handler; }
216
217 // Mandatory control points, e.g. the divided line moving handles
218 // should appear even if a child of the 'selected' image
219 virtual void MakeMandatoryControlPoints();
220 virtual void ResetMandatoryControlPoints();
221
222 inline virtual bool Recompute() { return TRUE; };
223 // Calculate size recursively, if size changes. Size might depend on children.
224 inline virtual void CalculateSize() { };
225 virtual void Select(bool select = TRUE, wxDC* dc = NULL);
226 virtual void SetHighlight(bool hi = TRUE, bool recurse = FALSE);
227 inline virtual bool IsHighlighted() const { return m_highlighted; };
228 virtual bool Selected() const;
229 virtual bool AncestorSelected() const;
230 void SetSensitivityFilter(int sens = OP_ALL, bool recursive = FALSE);
231 int GetSensitivityFilter() const { return m_sensitivity; }
232 void SetDraggable(bool drag, bool recursive = FALSE);
233 inline void SetFixedSize(bool x, bool y) { m_fixedWidth = x; m_fixedHeight = y; };
234 inline void GetFixedSize(bool *x, bool *y) const { *x = m_fixedWidth; *y = m_fixedHeight; };
235 inline bool GetFixedWidth() const { return m_fixedWidth; }
236 inline bool GetFixedHeight() const { return m_fixedHeight; }
237 inline void SetSpaceAttachments(bool sp) { m_spaceAttachments = sp; };
238 inline bool GetSpaceAttachments() const { return m_spaceAttachments; };
239 void SetShadowMode(int mode, bool redraw = FALSE);
240 inline int GetShadowMode() const { return m_shadowMode; }
241 virtual bool HitTest(float x, float y, int *attachment, float *distance);
242 inline void SetCentreResize(bool cr) { m_centreResize = cr; }
243 inline bool GetCentreResize() const { return m_centreResize; }
244 inline wxList& GetLines() { return m_lines; }
245 inline void SetDisableLabel(bool flag) { m_disableLabel = flag; }
246 inline bool GetDisableLabel() const { return m_disableLabel; }
247 inline void SetAttachmentMode(bool flag) { m_attachmentMode = flag; }
248 inline bool GetAttachmentMode() const { return m_attachmentMode; }
249 inline void SetId(long i) { m_id = i; }
250 inline long GetId() const { return m_id; }
251
252 void SetPen(wxPen *pen);
253 void SetBrush(wxBrush *brush);
254 inline void SetClientData(wxObject *client_data) { m_clientData = client_data; };
255 inline wxObject *GetClientData() const { return m_clientData; };
256
257 virtual void Show(bool show);
258 virtual bool IsShown() const { return m_visible; }
259 virtual void Move(wxDC& dc, float x1, float y1, bool display = TRUE);
260 virtual void Erase(wxDC& dc);
261 virtual void EraseContents(wxDC& dc);
262 virtual void Draw(wxDC& dc);
263 virtual void Flash();
264 virtual void MoveLinks(wxDC& dc);
265 virtual void DrawContents(wxDC& dc); // E.g. for drawing text label
266 virtual void SetSize(float x, float y, bool recursive = TRUE);
267 virtual void SetAttachmentSize(float x, float y);
268 void Attach(wxShapeCanvas *can);
269 void Detach();
270
271 inline virtual bool Constrain() { return FALSE; } ;
272
273 void AddLine(wxLineShape *line, wxShape *other,
274 int attachFrom = 0, int attachTo = 0);
275 void AddText(const wxString& string);
276
277 inline wxPen *GetPen() const { return m_pen; }
278 inline wxBrush *GetBrush() const { return m_brush; }
279
280 /*
281 * Region-specific functions (defaults to the default region
282 * for simple objects
283 */
284
285 // Set the default, single region size to be consistent
286 // with the object size
287 void SetDefaultRegionSize();
288 virtual void FormatText(wxDC& dc, const wxString& s, int regionId = 0);
289 virtual void SetFormatMode(int mode, int regionId = 0);
290 virtual int GetFormatMode(int regionId = 0) const;
291 virtual void SetFont(wxFont *font, int regionId = 0);
292 virtual wxFont *GetFont(int regionId = 0) const;
293 virtual void SetTextColour(const wxString& colour, int regionId = 0);
294 virtual wxString GetTextColour(int regionId = 0) const;
295 virtual inline int GetNumberOfTextRegions() const { return m_regions.Number(); }
296 virtual void SetRegionName(const wxString& name, int regionId = 0);
297
298 // Get the name representing the region for this image alone.
299 // I.e. this image's region ids go from 0 to N-1.
300 // But the names might be "0.2.0", "0.2.1" etc. depending on position in composite.
301 // So the last digit represents the region Id, the others represent positions
302 // in composites.
303 virtual wxString GetRegionName(int regionId);
304
305 // Gets the region corresponding to the name, or -1 if not found.
306 virtual int GetRegionId(const wxString& name);
307
308 // Construct names for regions, unique even for children of a composite.
309 virtual void NameRegions(const wxString& parentName = "");
310
311 // Get list of regions
312 inline wxList& GetRegions() { return m_regions; }
313
314 virtual void AddRegion(wxShapeRegion *region);
315
316 virtual void ClearRegions();
317
318 // Assign new ids to this image and children (if composite)
319 void AssignNewIds();
320
321 // Returns actual image (same as 'this' if non-composite) and region id
322 // for given region name.
323 virtual wxShape *FindRegion(const wxString& regionName, int *regionId);
324
325 // Finds all region names for this image (composite or simple).
326 // Supply empty string list.
327 virtual void FindRegionNames(wxStringList& list);
328
329 virtual void ClearText(int regionId = 0);
330 void RemoveLine(wxLineShape *line);
331
332 #ifdef PROLOGIO
333 // Prolog database stuff
334 virtual char *GetFunctor();
335 virtual void WritePrologAttributes(wxExpr *clause);
336 virtual void ReadPrologAttributes(wxExpr *clause);
337
338 // In case the object has constraints it needs to read in in a different pass
339 inline virtual void ReadConstraints(wxExpr *WXUNUSED(clause), wxExprDatabase *WXUNUSED(database)) { };
340 virtual void WriteRegions(wxExpr *clause);
341 virtual void ReadRegions(wxExpr *clause);
342 #endif
343
344 // Does the WHOLE copy calling PrivateCopy - don't redefine.
345 // If canvas is non-null, set the canvas too.
346 wxShape *CreateNewCopy(wxShapeCanvas *theCanvas = NULL);
347
348 // Attachment code
349 virtual bool GetAttachmentPosition(int attachment, float *x, float *y,
350 int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
351 virtual int GetNumberOfAttachments();
352 virtual bool AttachmentIsValid(int attachment);
353
354 virtual void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
355 virtual void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
356
357 virtual void MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
358 float x, float y);
359
360 // Reorders the lines coming into the node image at this attachment
361 // position, in the order in which they appear in linesToSort.
362 virtual void SortLines(int attachment, wxList& linesToSort);
363
364 // This is really to distinguish between lines and other images.
365 // For lines, want to pass drag to canvas, since lines tend to prevent
366 // dragging on a canvas (they get in the way.)
367 virtual bool Draggable() const { return TRUE; }
368
369 // Returns TRUE if image is a descendant of this image
370 bool HasDescendant(wxShape *image);
371
372 // Does the copying for this object
373 void Copy(wxShape& copy);
374 // Returns a new instance, and does the copy for this class. Define for each class.
375 virtual wxShape *PrivateCopy() = 0;
376
377 // Rotate about the given axis by the given amount in radians
378 // (does nothing for most objects)
379 // But even non-rotating objects should record their notional
380 // rotation in case it's important (e.g. in dog-leg code).
381 virtual inline void Rotate(float WXUNUSED(x), float WXUNUSED(y), float theta) { m_rotation = theta; }
382 virtual inline float GetRotation() const { return m_rotation; }
383
384 void ClearAttachments();
385
386 // Recentres all the text regions for this object
387 void Recentre(wxDC& dc);
388
389 // Clears points from a list of wxRealPoints
390 void ClearPointList(wxList& list);
391
392 private:
393 wxObject* m_clientData;
394
395 protected:
396 wxShapeEvtHandler* m_eventHandler;
397 bool m_formatted;
398 float m_xpos, m_ypos;
399 wxPen* m_pen;
400 wxBrush* m_brush;
401 wxFont* m_font;
402 wxColour* m_textColour;
403 wxString m_textColourName;
404 wxShapeCanvas* m_canvas;
405 wxList m_lines;
406 wxList m_text;
407 wxList m_controlPoints;
408 wxList m_regions;
409 wxList m_attachmentPoints;
410 bool m_visible;
411 bool m_disableLabel;
412 long m_id;
413 bool m_selected;
414 bool m_highlighted; // Different from selected: user-defined highlighting,
415 // e.g. thick border.
416 float m_rotation;
417 int m_sensitivity;
418 bool m_draggable;
419 bool m_attachmentMode; // TRUE if using attachments, FALSE otherwise
420 bool m_spaceAttachments; // TRUE if lines at one side should be spaced
421 bool m_fixedWidth;
422 bool m_fixedHeight;
423 bool m_centreResize; // Default is to resize keeping the centre constant (TRUE)
424 bool m_drawHandles; // Don't draw handles if FALSE, usually TRUE
425 wxList m_children; // In case it's composite
426 wxShape* m_parent; // In case it's a child
427 int m_formatMode;
428 int m_shadowMode;
429 wxBrush* m_shadowBrush;
430 int m_shadowOffsetX;
431 int m_shadowOffsetY;
432 int m_textMarginX; // Gap between text and border
433 int m_textMarginY;
434 wxString m_regionName;
435 };
436
437 class wxPolygonShape: public wxShape
438 {
439 DECLARE_DYNAMIC_CLASS(wxPolygonShape)
440 public:
441 wxPolygonShape();
442 ~wxPolygonShape();
443
444 // Takes a list of wxRealPoints; each point is an OFFSET from the centre.
445 // Deletes user's points in destructor.
446 virtual void Create(wxList *points);
447
448 void GetBoundingBoxMin(float *w, float *h);
449 void CalculateBoundingBox();
450 bool GetPerimeterPoint(float x1, float y1,
451 float x2, float y2,
452 float *x3, float *y3);
453 bool HitTest(float x, float y, int *attachment, float *distance);
454 void SetSize(float x, float y, bool recursive = TRUE);
455 void OnDraw(wxDC& dc);
456 void OnDrawOutline(wxDC& dc, float x, float y, float w, float h);
457
458 // A polygon should have a control point at each vertex,
459 // with the option of moving the control points individually
460 // to change the shape.
461 void MakeControlPoints();
462 void ResetControlPoints();
463
464 // If we've changed the shape, must make the original
465 // points match the working points
466 void UpdateOriginalPoints();
467
468 // Add a control point after the given point
469 virtual void AddPolygonPoint(int pos = 0);
470
471 // Delete a control point
472 virtual void DeletePolygonPoint(int pos = 0);
473
474 // Recalculates the centre of the polygon
475 virtual void CalculatePolygonCentre();
476
477 #ifdef PROLOGIO
478 // Prolog database stuff
479 void WritePrologAttributes(wxExpr *clause);
480 void ReadPrologAttributes(wxExpr *clause);
481 #endif
482
483 int GetNumberOfAttachments();
484 bool GetAttachmentPosition(int attachment, float *x, float *y,
485 int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
486 bool AttachmentIsValid(int attachment);
487 // Does the copying for this object
488 void Copy(wxPolygonShape& copy);
489 wxShape *PrivateCopy();
490
491 inline wxList *GetPoints() { return m_points; }
492
493 private:
494 wxList* m_points;
495 wxList* m_originalPoints;
496 float m_boundWidth;
497 float m_boundHeight;
498 float m_originalWidth;
499 float m_originalHeight;
500 };
501
502 class wxRectangleShape: public wxShape
503 {
504 DECLARE_DYNAMIC_CLASS(wxRectangleShape)
505 public:
506 wxRectangleShape(float w = 0.0, float h = 0.0);
507 void GetBoundingBoxMin(float *w, float *h);
508 bool GetPerimeterPoint(float x1, float y1,
509 float x2, float y2,
510 float *x3, float *y3);
511 void OnDraw(wxDC& dc);
512 void SetSize(float x, float y, bool recursive = TRUE);
513 void SetCornerRadius(float rad); // If > 0, rounded corners
514
515 #ifdef PROLOGIO
516 // Prolog database stuff
517 void WritePrologAttributes(wxExpr *clause);
518 void ReadPrologAttributes(wxExpr *clause);
519 #endif
520
521 int GetNumberOfAttachments();
522 bool GetAttachmentPosition(int attachment, float *x, float *y,
523 int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
524 // Does the copying for this object
525 void Copy(wxRectangleShape& copy);
526 wxShape *PrivateCopy();
527
528 inline float GetWidth() const { return m_width; }
529 inline float GetHeight() const { return m_height; }
530
531 protected:
532 float m_width;
533 float m_height;
534 float m_cornerRadius;
535 };
536
537 class wxTextShape: public wxRectangleShape
538 {
539 DECLARE_DYNAMIC_CLASS(wxTextShape)
540 public:
541 wxTextShape(float width = 0.0, float height = 0.0);
542
543 void OnDraw(wxDC& dc);
544
545 #ifdef PROLOGIO
546 void WritePrologAttributes(wxExpr *clause);
547 #endif
548
549 // Does the copying for this object
550 void Copy(wxTextShape& copy);
551 wxShape *PrivateCopy();
552 };
553
554 class wxEllipseShape: public wxShape
555 {
556 DECLARE_DYNAMIC_CLASS(wxEllipseShape)
557 public:
558 wxEllipseShape(float w = 0.0, float h = 0.0);
559
560 void GetBoundingBoxMin(float *w, float *h);
561 bool GetPerimeterPoint(float x1, float y1,
562 float x2, float y2,
563 float *x3, float *y3);
564
565 void OnDraw(wxDC& dc);
566 void SetSize(float x, float y, bool recursive = TRUE);
567
568 #ifdef PROLOGIO
569 // Prolog database stuff
570 void WritePrologAttributes(wxExpr *clause);
571 void ReadPrologAttributes(wxExpr *clause);
572 #endif
573
574 int GetNumberOfAttachments();
575 bool GetAttachmentPosition(int attachment, float *x, float *y,
576 int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
577
578 // Does the copying for this object
579 void Copy(wxEllipseShape& copy);
580 wxShape *PrivateCopy();
581
582 inline float GetWidth() const { return m_width; }
583 inline float GetHeight() const { return m_height; }
584
585 protected:
586 float m_width;
587 float m_height;
588 };
589
590 class wxCircleShape: public wxEllipseShape
591 {
592 DECLARE_DYNAMIC_CLASS(wxCircleShape)
593 public:
594 wxCircleShape(float w = 0.0);
595
596 bool GetPerimeterPoint(float x1, float y1,
597 float x2, float y2,
598 float *x3, float *y3);
599 // Does the copying for this object
600 void Copy(wxCircleShape& copy);
601 wxShape *PrivateCopy();
602 };
603
604 #endif
605 // _OGL_BASIC_H_