wxArt2D
candefs.h
Go to the documentation of this file.
1 /*! \file wx/canvas/candefs.h
2  \brief defenitions an no more
3  \author Klaas Holwerda
4 
5  Copyright: 2000-2004 (c) Klaas Holwerda
6 
7  Licence: wxWidgets Licence
8 
9  This is to be included in at first, mostly via canglob.h already
10 
11  RCS-ID: $Id: candefs.h,v 1.15 2008/09/05 19:01:10 titato Exp $
12 */
13 
14 #ifndef __WXCANDEFS_H__
15 #define __WXCANDEFS_H__
16 
17 
18 
19 #ifndef WX_PRECOMP
20 #include "wx/wx.h"
21 #endif
22 
23 #include "wx/geometry.h"
24 
25 #include <wx/module.h>
26 
27 #include "wx/general/gen.h"
28 #include <wx/artbase/drawer2d.h>
29 
30 #ifdef A2DCANVASMAKINGDLL
31 #define A2DCANVASDLLEXP WXEXPORT
32 #define A2DCANVASDLLEXP_DATA(type) WXEXPORT type
33 #define A2DCANVASDLLEXP_CTORFN
34 #elif defined(WXART2D_USINGDLL)
35 #define A2DCANVASDLLEXP WXIMPORT
36 #define A2DCANVASDLLEXP_DATA(type) WXIMPORT type
37 #define A2DCANVASDLLEXP_CTORFN
38 #else // not making nor using DLL
39 #define A2DCANVASDLLEXP
40 #define A2DCANVASDLLEXP_DATA(type) type
41 #define A2DCANVASDLLEXP_CTORFN
42 #endif
43 
44 #ifdef A2DEDITORMAKINGDLL
45 #define A2DEDITORDLLEXP WXEXPORT
46 #define A2DEDITORDLLEXP_DATA(type) WXEXPORT type
47 #define A2DEDITORDLLEXP_CTORFN
48 #elif defined(WXART2D_USINGDLL)
49 #define A2DEDITORDLLEXP WXIMPORT
50 #define A2DEDITORDLLEXP_DATA(type) WXIMPORT type
51 #define A2DEDITORDLLEXP_CTORFN
52 #else // not making nor using DLL
53 #define A2DEDITORDLLEXP
54 #define A2DEDITORDLLEXP_DATA(type) type
55 #define A2DEDITORDLLEXP_CTORFN
56 #endif
57 
58 //#define wxLAYER_DEFAULT 0 /*!< default layer for new objects. */
59 //#define wxLAYER_ALL wxINT16_MAX
60 
61 //! maximum number of layers allowed
62 #define wxDEFAULTMAXLAYER 500
63 //#define wxMAXLAYER 200
64 #define wxMAXLAYER a2dHabitat::m_maximumLayers
65 
66 //!reserved layers
67 /*!
68 \ingroup style
69 */
71 {
72  wxLAYER_DEFAULT = 0, /*!< default layer for new objects. */
73  wxLAYER_ALL = wxDEFAULTMAXLAYER //SHRT_MAX
74 };
75 
76 //! Define the manner in which a2dCanvasView draws the document to the device.
77 /*!
78 The render style tells how a a2dCanvasView should draw when it is updating parts from the document.
79 This might overrule of the style ( a2dFill a2dStroke ) set by a2dCanvasObjects.
80 More then one style can be set, all those styles will be rendered one after the other.
81 
82 \ingroup drawer
83 */
85 {
86  /*! normal drawing style, canvasobjects are filled and outlined according to the style ( a2dStroke a2dFill ) set */
87  RenderLAYERED = 0x00000001,
88  /*! only a wire frame of the drawn canvasobjects is drawn, as is set by the its a2dStroke */
89  RenderWIREFRAME = 0x00000002,
90  /*! only a zero width wire frame of the drawn canvasobjects is drawn, Color of the canvasobject a2dStroke, is used */
92  /*! as RenderWIREFRAME, but the outline is the inverted of what is on the device/buffer */
93  RenderWIREFRAME_INVERT = 0x00000008,
94  /*! as RenderINVERT_WIREFRAME but zero width outline */
96  /*! fixed stroke and fill are used */
97  RenderFIX_STYLE = 0x00000020,
98  /*! render rectangles for all direct child objects of ShowObject */
99  RenderRectangles = 0x00000040,
100  /*! Only a wire frame of the drawn primitive is drawn, with the style of the a2dDrawer::m_selectStroke */
102  /*! Only an inverted wire frame of the drawn canvasobjects is drawn, using the width of the wxLAYER_SELECTED a2dStroke */
104  /*! render tool object */
105  RenderTOOL_OBJECTS = 0x00001000,
106  /*! render tool objects, using style of object itself */
108  /*! render tool decoration objects, using style of object itself */
110  /*! render rectangles for all direct child objects of ShowObject Which are tool objects. */
112  /*! Only a wire frame of the drawn primitive is drawn, with the style of the RenderWIREFRAME_HighLight specific a2dStroke */
114  /*! Draw using layerseting but all at once and not in layer order. */
115  RenderLAYERED_All = 0x00020000,
116  /*! Only a wire frame of the drawn primitive is drawn, with the style of the a2dDrawer::m_select2Stroke */
118  //! what is normal
120 };
121 
122 class A2DCANVASDLLEXP a2dExtendedResult;
123 
124 class A2DCANVASDLLEXP a2dCanvas;
125 
126 class A2DCANVASDLLEXP a2dCanvasObject;
127 class A2DCANVASDLLEXP a2dCanvasObjectList;
128 
129 class A2DCANVASDLLEXP a2dLayers;
130 
131 class A2DCANVASDLLEXP a2dDrawing;
132 
133 class A2DCANVASDLLEXP a2dStyleProperty;
134 class A2DCANVASDLLEXP a2dShadowStyleProperty;
135 class A2DCANVASDLLEXP a2dCanvasObjectPtrProperty;
136 
137 class A2DCANVASDLLEXP a2dDrawingPart;
138 class A2DCANVASDLLEXP a2dBaseTool;
139 class A2DCANVASDLLEXP a2dToolContr;
140 
141 class A2DCANVASDLLEXP a2dIterC;
142 class A2DCANVASDLLEXP a2dBoudingBoxProperty;
143 
144 class A2DCANVASDLLEXP a2dComEvent;
145 class A2DCANVASDLLEXP a2dCanvasObjectEvent;
146 class A2DCANVASDLLEXP a2dCanvasObjectMouseEvent;
147 class A2DCANVASDLLEXP a2dHandleMouseEvent;
148 
149 class A2DCANVASDLLEXP a2dPin;
150 class A2DCANVASDLLEXP a2dText;
151 
152 class A2DCANVASDLLEXP a2dPolygonL;
153 
154 //! mask flags for a2dCanvasObject
155 /*!
156  \ingroup canvasobject
157 */
158 typedef wxUint64 a2dCanvasObjectFlagsMask;
159 
160 //! a2dCanvasObject flags as a structure \ingroup canvasobject
161 /*!
162  \ingroup canvasobject
163 */
164 class A2DCANVASDLLEXP a2dCanvasOFlags
165 {
166 
167 public:
168 
169  //! Flags for a2dCanvasObject
170  /*!
171  Those flags or used in mask for set flag inside a a2dCanvasObject or
172  to get the value of a flag.
173 
174  \sa a2dCanvasObject_FlagsS
175  \sa a2dCanvasObjectFlagsMask
176 
177  \ingroup canvasobject
178  */
179  static const a2dCanvasObjectFlagsMask NON ; /*!< No flags */
180  static const a2dCanvasObjectFlagsMask SELECTED ; /*!< object is selected */
181  static const a2dCanvasObjectFlagsMask SELECTED2 ; /*!< object is selected2 */
182  static const a2dCanvasObjectFlagsMask SELECTABLE ; /*!< can select object */
183  static const a2dCanvasObjectFlagsMask HasSelectedObjectsBelow ; /*!< selected objects detected below */
184  static const a2dCanvasObjectFlagsMask SubEdit ; /*!< allow subedit of children within this object */
185  static const a2dCanvasObjectFlagsMask SubEditAsChild ; /*!< allow subedit on this object when child of other object */
186  static const a2dCanvasObjectFlagsMask VISIBLE ; /*!< is the object visible (overruled by parent object in some cases during rendering */
187  static const a2dCanvasObjectFlagsMask DRAGGABLE ; /*!< can be dragged */
188  static const a2dCanvasObjectFlagsMask SHOWSHADOW ; /*!< show shadow object if true and shadow property is available */
189  static const a2dCanvasObjectFlagsMask FILLED ; /*!< use fill to fill if set */
190  static const a2dCanvasObjectFlagsMask A ; /*!< group A flag (e.g boolean operations) */
191  static const a2dCanvasObjectFlagsMask B ; /*!< group B flag (e.g boolean operations) */
192  static const a2dCanvasObjectFlagsMask BIN ; /*!< general flag ( used for temporarely marking object ) */
193  static const a2dCanvasObjectFlagsMask BIN2 ; /*!< general flag ( used for temporarely marking object ) */
194  static const a2dCanvasObjectFlagsMask PENDING ; /*!< set when a2dCanvasObject needs an update (redraw) */
195  static const a2dCanvasObjectFlagsMask SNAP ; /*!< snapping of editable object or when moving */
196  static const a2dCanvasObjectFlagsMask SNAP_TO ; /*!< snapping of other object to this when in place*/
197  static const a2dCanvasObjectFlagsMask PUSHIN ; /*!< push into allowed */
198  static const a2dCanvasObjectFlagsMask PRERENDERASCHILD ; /*!< as child this object will be rendered before the parent object itself when true (default) */
199  static const a2dCanvasObjectFlagsMask VISIBLECHILDS ; /*!< child objects are visible or not */
200  static const a2dCanvasObjectFlagsMask EDITABLE ; /*!< object can be edited */
201  static const a2dCanvasObjectFlagsMask ChildrenOnSameLayer; /*!< child objects are rendered when the object is rendered itself.
202  The effect is that the children will appear on the same layer as the object. */
203  static const a2dCanvasObjectFlagsMask DoConnect ; /*!< in case of pins on the object is it currely allowed for other object to connect to it? */
204  static const a2dCanvasObjectFlagsMask IsOnCorridorPath ; /*!< this object is on the corridor path to a captured object */
205  static const a2dCanvasObjectFlagsMask HasPins ; /*!< true if this object does have a2dPin's as children */
206  static const a2dCanvasObjectFlagsMask Editing ; /*!< true if the object is currently being edited */
207  static const a2dCanvasObjectFlagsMask EditingCopy ; /*!< true if the object needs is the editcopy of an object that is edited. */
208  static const a2dCanvasObjectFlagsMask IsProperty ; /*!< True if object is a property show object */
209  static const a2dCanvasObjectFlagsMask MouseInObject ; /*!< true is mouse is currently within object */
210  static const a2dCanvasObjectFlagsMask HighLight ; /*!< true is object is highlighted */
211  static const a2dCanvasObjectFlagsMask AlgoSkip ; /*!< skip object in walker algorithms */
212  static const a2dCanvasObjectFlagsMask ignoreSetpending ; /*!< ignore Setpending calls on a2dCanvasObject */
213  static const a2dCanvasObjectFlagsMask HasToolObjectsBelow ; /*!< special tool object detected below */
214  static const a2dCanvasObjectFlagsMask ChildOnlyTranslate ; /*!< do not tranfrom only translate. */
215  static const a2dCanvasObjectFlagsMask ignoreLayer ; /*!< ignore Layer id, just render always*/
216  static const a2dCanvasObjectFlagsMask generatePins ; /*!< generate Pins when asked for */
217  static const a2dCanvasObjectFlagsMask normalized ; /*!< normalized coordinates */
218  static const a2dCanvasObjectFlagsMask NoRenderCanvasObject ; /*!< do not render if no children */
219  static const a2dCanvasObjectFlagsMask FixedStyle ; /*!< style on object fixed */
220  static const a2dCanvasObjectFlagsMask ALL ; /*!< To set all flags at once */
221 
222  a2dCanvasOFlags( a2dCanvasObjectFlagsMask newmask = NON );
223 
224  void SetSpecificFlags( bool setOrClear, a2dCanvasObjectFlagsMask which );
225 
226  a2dCanvasObjectFlagsMask GetFlags() const;
227 
228  void SetFlags( a2dCanvasObjectFlagsMask which );
229 
230  bool GetFlag( a2dCanvasObjectFlagsMask which ) const;
231 
232  bool CheckMask( a2dCanvasObjectFlagsMask mask ) const;
233 
234  //!object is selected
235  bool m_selected: 1;
236 
237  //!object is selected2
238  bool m_selected2: 1;
239 
240  //!can select object
241  bool m_selectable: 1;
242 
243  //!allow subedit of children within this object
244  bool m_subEdit: 1;
245 
246  //!allow subedit on this object when child of other object
247  bool m_subEditAsChild: 1;
248 
249  //!is the object visible (overruled by paranet object in some cases during rendering
250  bool m_visible: 1;
251 
252  //!can be dragged
253  bool m_draggable: 1;
254 
255  //!show shadow object if true and shadow property is available
256  bool m_showshadow: 1;
257 
258  //!use fill to fill if set
259  bool m_filled: 1;
260 
261  //!group A flag (e.g boolean operations)
262  bool m_a: 1;
263 
264  //!group B flag (e.g boolean operations)
265  bool m_b: 1;
266 
267  //! generate pins if true
268  bool m_generatePins: 1;
269 
270  //!general flag ( used for temporarely marking object )
271  bool m_bin: 1;
272 
273  //!general flag ( used for temporarely marking object )
274  bool m_bin2: 1;
275 
276  //! set when a2dCanvasObject needs an update (redraw).
277  bool m_pending: 1;
278 
279  //!snapping of editable object or when moving
280  bool m_snap: 1;
281 
282  //!snapping of other objects to this when in place
283  bool m_snap_to: 1;
284 
285  //! is push into allowed
286  bool m_pushin;
287 
288  //!as child this object will be rendered before the parent object itself when true (default)
289  bool m_prerenderaschild: 1;
290 
291  //! child objects are visible or not
292  bool m_visiblechilds: 1;
293 
294  //! object can be edited
295  bool m_editable: 1;
296 
297  //! if set fixed style (stroke and fill )is assumed. Can be used in tools to detect if style should be changed or not.
298  bool m_fixedStyle: 1;
299 
300  //! true if the object is currently being edited
301  bool m_editing: 1;
302 
303  //! true if the object needs to be rendered in edit mode.
304  bool m_editingCopy: 1;
305 
306  //! ignore this object in a2dCanvasObject::SetPending()
307  bool m_ignoreSetpending: 1;
308 
309  //! child objects are rendered when the object is rendered itself.
310  //! The effect is that the children will appear on the same layer as the object.
311  bool m_childrenOnSameLayer: 1;
312 
313  //! in case of pins on the object is it currely allowed for other object to connect to it?
314  bool m_doConnect: 1;
315 
316  //! This object is on the corridor path to a captured object or to a corridored object.
317  /*!
318  When an object is captured, it and its parent, grandparent etc. objects get this flag set.
319  */
320  bool m_isOnCorridorPath: 1;
321 
322  //! true if this object does have a2dPin's as children
323  bool m_hasPins: 1;
324 
325  bool m_IsProperty: 1;
326 
327  bool m_MouseInObject: 1;
328 
329  bool m_HighLight: 1;
330 
331  bool m_AlgoSkip: 1;
332 
333  bool m_ChildOnlyTranslate: 1;
334 
335  //! when this is set DoRender() is called even if layer of the object is not the layer to be rendered.
336  bool m_ignoreLayer: 1;
337 
338  //! GDSII format flag
339  bool m_template: 1 ;
340 
341  //! GDSII format flag
342  bool m_external : 1 ;
343 
344  //! GDSII format flag
345  bool m_used : 1 ;
346 
347  //! special tool object detected below
348  bool m_HasToolObjectsBelow : 1 ;
349 
350  //! true is the object is a a2dCanvasObject (or derived ) without rendering something if there or now children.
351  bool m_NoRenderCanvasObject : 1 ;
352 
353  //! selected objects detected below
354  bool m_HasSelectedObjectsBelow : 1 ;
355 
356  //! when true, the wxEVT_CANVASOBJECT_RESIZE_EVENT is sent to this object, if the child box did change.
357  bool m_resizeToChilds : 1 ;
358 
359  //! true if the object is defined in normalized coordinates
360  bool m_normalized: 1;
361 
362 };
363 
364 
365 
366 #endif
static const a2dCanvasObjectFlagsMask SELECTED2
Definition: candefs.h:181
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
Definition: drawer.h:470
static const a2dCanvasObjectFlagsMask BIN
Definition: candefs.h:192
The a2dBaseTool is used to derive tools from that are controlled by.
Definition: tools.h:379
mouse event sent from a2dCanvasObject to itself
Definition: canglob.h:223
static const a2dCanvasObjectFlagsMask HasPins
Definition: candefs.h:205
#define wxDEFAULTMAXLAYER
maximum number of layers allowed
Definition: candefs.h:62
fundamental classes used by all other modules.
static const a2dCanvasObjectFlagsMask HasToolObjectsBelow
Definition: candefs.h:213
Creates a shadow behind a a2dCanvasObject when added as property.
Definition: canprop.h:157
static const a2dCanvasObjectFlagsMask BIN2
Definition: candefs.h:193
a2dPin is used in a2dCanvasObject to add pins to it.
Definition: canpin.h:233
polygon defined with list of points.
Definition: polygon.h:45
static const a2dCanvasObjectFlagsMask MouseInObject
Definition: candefs.h:209
static const a2dCanvasObjectFlagsMask PUSHIN
Definition: candefs.h:197
static const a2dCanvasObjectFlagsMask AlgoSkip
Definition: candefs.h:211
static const a2dCanvasObjectFlagsMask FILLED
Definition: candefs.h:189
static const a2dCanvasObjectFlagsMask FixedStyle
Definition: candefs.h:219
static const a2dCanvasObjectFlagsMask generatePins
Definition: candefs.h:216
a2dCanvasObject is the base class for Canvas Objects.
Definition: canobj.h:371
what is normal
Definition: candefs.h:119
static const a2dCanvasObjectFlagsMask A
Definition: candefs.h:190
wxUint64 a2dCanvasObjectFlagsMask
mask flags for a2dCanvasObject
Definition: candefs.h:152
static const a2dCanvasObjectFlagsMask ChildOnlyTranslate
Definition: candefs.h:214
static const a2dCanvasObjectFlagsMask PENDING
Definition: candefs.h:194
static const a2dCanvasObjectFlagsMask SubEditAsChild
Definition: candefs.h:185
static const a2dCanvasObjectFlagsMask normalized
Definition: candefs.h:217
a2dText is an abstract base class.
Definition: cantext.h:93
see a2dCanvasObjectMouseEvent
Definition: canglob.h:161
static const a2dCanvasObjectFlagsMask HighLight
Definition: candefs.h:210
static const a2dCanvasObjectFlagsMask IsProperty
Definition: candefs.h:208
static const a2dCanvasObjectFlagsMask SELECTABLE
Definition: candefs.h:182
general event sent from a2dHandle to its parent a2dCanvasObject
Definition: canglob.h:273
static const a2dCanvasObjectFlagsMask SELECTED
Definition: candefs.h:180
static const a2dCanvasObjectFlagsMask IsOnCorridorPath
Definition: candefs.h:204
Invisible Style property that can be added to Canvas Objects.
Definition: canprop.h:55
static const a2dCanvasObjectFlagsMask EditingCopy
Definition: candefs.h:207
a2dCanvasObject flags as a structure
Definition: candefs.h:164
static const a2dCanvasObjectFlagsMask Editing
Definition: candefs.h:206
static const a2dCanvasObjectFlagsMask B
Definition: candefs.h:191
static const a2dCanvasObjectFlagsMask DRAGGABLE
Definition: candefs.h:187
a2dCanvas is used to display one of the a2dCanvasObjects which are part of a a2dCanvasDocument object...
Definition: canvas.h:68
while iterating a a2dCanvasDocument, this holds the context.
Definition: canobj.h:3212
Contains graphical drawing context specific classes. a2dDrawer2D and derived classes are used for dra...
static const a2dCanvasObjectFlagsMask NON
Flags for a2dCanvasObject.
Definition: candefs.h:179
static const a2dCanvasObjectFlagsMask VISIBLE
Definition: candefs.h:186
static const a2dCanvasObjectFlagsMask SNAP_TO
Definition: candefs.h:196
static const a2dCanvasObjectFlagsMask ChildrenOnSameLayer
Definition: candefs.h:201
static const a2dCanvasObjectFlagsMask VISIBLECHILDS
Definition: candefs.h:199
static const a2dCanvasObjectFlagsMask NoRenderCanvasObject
Definition: candefs.h:218
property to hold a a2dCanvasObject pointer type variable to be associated with a canvasobject ...
Definition: canprop.h:202
static const a2dCanvasObjectFlagsMask DoConnect
Definition: candefs.h:203
see a2dComEvent
Definition: gen.h:371
static const a2dCanvasObjectFlagsMask ignoreSetpending
Definition: candefs.h:212
An object of this class represents the context of a query like a hit test.
Definition: canobj.h:238
static const a2dCanvasObjectFlagsMask SNAP
Definition: candefs.h:195
The a2dToolContr is the base class for Tool controller classes.
Definition: tools.h:87
property to hold a a2dBoundingBox type variable to be associated with a canvasobject ...
Definition: canprop.h:470
static const a2dCanvasObjectFlagsMask ALL
Definition: candefs.h:220
static const a2dCanvasObjectFlagsMask SHOWSHADOW
Definition: candefs.h:188
static const a2dCanvasObjectFlagsMask EDITABLE
Definition: candefs.h:200
a2dDocumentRenderStyle
Define the manner in which a2dCanvasView draws the document to the device.
Definition: candefs.h:84
static const a2dCanvasObjectFlagsMask HasSelectedObjectsBelow
Definition: candefs.h:183
static const a2dCanvasObjectFlagsMask ignoreLayer
Definition: candefs.h:215
wxLayerNames
reserved layers
Definition: candefs.h:70
Contain one drawing as hierarchical tree of a2dCanvasObject&#39;s.
Definition: drawing.h:434
bool m_pushin
is push into allowed
Definition: candefs.h:286
static const a2dCanvasObjectFlagsMask SubEdit
Definition: candefs.h:184
static const a2dCanvasObjectFlagsMask PRERENDERASCHILD
Definition: candefs.h:198
candefs.h Source File -- Sun Oct 12 2014 17:04:13 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation