33 #include <wx/wfstream.h>
52 DEFINE_EVENT_TYPE( wxEVT_CANVASOBJECT_MOUSE_EVENT )
53 DEFINE_EVENT_TYPE( wxEVT_CANVASOBJECT_ENTER_EVENT )
54 DEFINE_EVENT_TYPE( wxEVT_CANVASOBJECT_LEAVE_EVENT )
55 DEFINE_EVENT_TYPE( wxEVT_CANVASHANDLE_MOUSE_EVENT )
56 DEFINE_EVENT_TYPE( wxEVT_CANVASHANDLE_MOUSE_EVENT_ENTER )
57 DEFINE_EVENT_TYPE( wxEVT_CANVASHANDLE_MOUSE_EVENT_LEAVE )
58 DEFINE_EVENT_TYPE( wxEVT_CANVASOBJECT_RESIZE_EVENT )
59 DEFINE_EVENT_TYPE( wxEVT_CANVASOBJECT_POPUPMENU_EVENT )
67 bool hasLayer =
false;
70 wxUint16 layerOfGroup = *iter;
72 if ( wxLAYER_ALL == layerOfGroup )
77 if ( layer == layerOfGroup )
90 SetEventObject( ( wxObject* )
object );
97 : wxEvent( id, wxEVT_CANVASOBJECT_RESIZE_EVENT )
99 SetEventObject( ( wxObject* )
object );
120 m_mouseevent = event;
127 m_mouseevent = event;
134 m_mouseevent = other.m_mouseevent;
145 m_mouseevent = event;
151 m_mouseevent = other.m_mouseevent;
158 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_NONE =
wxGenNewId();
159 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_ARROW =
wxGenNewId();
160 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_RIGHT_ARROW =
wxGenNewId();
161 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_BULLSEYE =
wxGenNewId();
162 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_CHAR =
wxGenNewId();
163 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_CROSS =
wxGenNewId();
164 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_HAND =
wxGenNewId();
165 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_IBEAM =
wxGenNewId();
166 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_LEFT_BUTTON =
wxGenNewId();
167 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_MAGNIFIER =
wxGenNewId();
168 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_MIDDLE_BUTTON =
wxGenNewId();
169 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_NO_ENTRY =
wxGenNewId();
170 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_PAINT_BRUSH =
wxGenNewId();
171 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_PENCIL =
wxGenNewId();
172 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_POINT_LEFT =
wxGenNewId();
173 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_POINT_RIGHT =
wxGenNewId();
174 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_QUESTION_ARROW =
wxGenNewId();
175 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_RIGHT_BUTTON =
wxGenNewId();
176 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_SIZENESW =
wxGenNewId();
177 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_SIZENS =
wxGenNewId();
178 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_SIZENWSE =
wxGenNewId();
179 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_SIZEWE =
wxGenNewId();
180 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_SIZING =
wxGenNewId();
181 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_SPRAYCAN =
wxGenNewId();
182 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_WAIT =
wxGenNewId();
183 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_WATCH =
wxGenNewId();
184 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_BLANK =
wxGenNewId();
185 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_ARROWWAIT =
wxGenNewId();
187 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_Select =
wxGenNewId();
188 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_Select2 =
wxGenNewId();
189 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_Zoom =
wxGenNewId();
190 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_Drag =
wxGenNewId();
191 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_Move =
wxGenNewId();
192 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_Copy =
wxGenNewId();
193 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_DrawWire =
wxGenNewId();
194 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditWire =
wxGenNewId();
195 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditWireVertex =
wxGenNewId();
196 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditWireDeleteVertex =
wxGenNewId();
197 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditWireSegment =
wxGenNewId();
198 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditWireSegmentHorizontal =
wxGenNewId();
199 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditWireSegmentVertical =
wxGenNewId();
200 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_WireSegmentInsert =
wxGenNewId();
201 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_Edit =
wxGenNewId();
202 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditVertex =
wxGenNewId();
203 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditDeleteVertex =
wxGenNewId();
204 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditSegment =
wxGenNewId();
205 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditSegmentHorizontal =
wxGenNewId();
206 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_EditSegmentVertical =
wxGenNewId();
207 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_SegmentInsert =
wxGenNewId();
209 A2DCANVASDLLEXP
extern const a2dImageId a2dBitmap_EditRectangleFill =
wxGenNewId();
211 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_HandleLeftDown =
wxGenNewId();
212 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_HandleDrag =
wxGenNewId();
213 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_HandleMove =
wxGenNewId();
214 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_HandleEnter =
wxGenNewId();
215 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_HandleLeave =
wxGenNewId();
217 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_CanvasObjectHit =
wxGenNewId();
218 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_CanvasObjectEnter =
wxGenNewId();
219 A2DCANVASDLLEXP
extern const a2dCursorId a2dCURSOR_CanvasObjectLeave =
wxGenNewId();
222 a2dArtProvider::a2dArtProvider()
226 a2dArtProvider::~a2dArtProvider()
230 wxCursor LoadCursorFile(
const wxString& filename )
233 if ( im.LoadFile( filename ) )
235 im.LoadFile( filename );
236 im.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, 16 );
237 im.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, 16 );
238 return wxCursor( im );
243 error.Printf( _T(
"could not load cursor from file: %s" ), filename.c_str() );
244 wxMessageBox( error, _T(
"environment error" ), wxOK );
245 return wxCURSOR_ARROW;
249 wxCursor& a2dArtProvider::GetCursor( a2dCursorId
id )
251 if ( m_cursorsLoaded.find(
id ) != m_cursorsLoaded.end() )
252 return m_cursorsLoaded[
id];
254 static wxCursor cursor;
256 if (
id == a2dCURSOR_NONE )
257 cursor = wxCursor( wxCURSOR_NONE );
258 if (
id == a2dCURSOR_ARROW )
259 cursor = wxCursor( wxCURSOR_ARROW );
260 if (
id == a2dCURSOR_RIGHT_ARROW )
261 cursor = wxCursor( wxCURSOR_RIGHT_ARROW );
262 if (
id == a2dCURSOR_BULLSEYE )
263 cursor = wxCursor( wxCURSOR_BULLSEYE );
264 if (
id == a2dCURSOR_CHAR )
265 cursor = wxCursor( wxCURSOR_CHAR );
266 if (
id == a2dCURSOR_CROSS )
267 cursor = wxCursor( wxCURSOR_CROSS );
268 if (
id == a2dCURSOR_HAND )
269 cursor = wxCursor( wxCURSOR_HAND );
270 if (
id == a2dCURSOR_IBEAM )
271 cursor = wxCursor( wxCURSOR_IBEAM );
272 if (
id == a2dCURSOR_LEFT_BUTTON )
273 cursor = wxCursor( wxCURSOR_LEFT_BUTTON );
274 if (
id == a2dCURSOR_MAGNIFIER )
275 cursor = wxCursor( wxCURSOR_MAGNIFIER );
276 if (
id == a2dCURSOR_MIDDLE_BUTTON )
277 cursor = wxCursor( wxCURSOR_MIDDLE_BUTTON );
278 if (
id == a2dCURSOR_NO_ENTRY )
279 cursor = wxCursor( wxCURSOR_NO_ENTRY );
280 if (
id == a2dCURSOR_PAINT_BRUSH )
281 cursor = wxCursor( wxCURSOR_PAINT_BRUSH );
282 if (
id == a2dCURSOR_PENCIL )
283 cursor = wxCursor( wxCURSOR_PENCIL );
284 if (
id == a2dCURSOR_POINT_LEFT )
285 cursor = wxCursor( wxCURSOR_POINT_LEFT );
286 if (
id == a2dCURSOR_POINT_RIGHT )
287 cursor = wxCursor( wxCURSOR_POINT_RIGHT );
288 if (
id == a2dCURSOR_QUESTION_ARROW )
289 cursor = wxCursor( wxCURSOR_QUESTION_ARROW );
290 if (
id == a2dCURSOR_RIGHT_BUTTON )
291 cursor = wxCursor( wxCURSOR_RIGHT_BUTTON );
292 if (
id == a2dCURSOR_SIZENESW )
293 cursor = wxCursor( wxCURSOR_SIZENESW );
294 if (
id == a2dCURSOR_SIZENS )
295 cursor = wxCursor( wxCURSOR_SIZENS );
296 if (
id == a2dCURSOR_SIZENWSE )
297 cursor = wxCursor( wxCURSOR_SIZENWSE );
298 if (
id == a2dCURSOR_SIZEWE )
299 cursor = wxCursor( wxCURSOR_SIZEWE );
300 if (
id == a2dCURSOR_SIZING )
301 cursor = wxCursor( wxCURSOR_SIZING );
302 if (
id == a2dCURSOR_SPRAYCAN )
303 cursor = wxCursor( wxCURSOR_SPRAYCAN );
304 if (
id == a2dCURSOR_WAIT )
305 cursor = wxCursor( wxCURSOR_WAIT );
306 if (
id == a2dCURSOR_WATCH )
307 cursor = wxCursor( wxCURSOR_WATCH );
308 if (
id == a2dCURSOR_BLANK )
309 cursor = wxCursor( wxCURSOR_BLANK );
310 if (
id == a2dCURSOR_ARROWWAIT )
311 cursor = wxCursor( wxCURSOR_ARROWWAIT );
313 if (
id == a2dCURSOR_Select )
314 cursor = wxCursor( wxCURSOR_CROSS );
315 if (
id == a2dCURSOR_Select2 )
316 cursor = wxCursor( wxCURSOR_CROSS );
317 if (
id == a2dCURSOR_Zoom )
318 cursor = wxCursor( wxCURSOR_MAGNIFIER );
319 if (
id == a2dCURSOR_Drag )
320 cursor = wxCursor( wxCURSOR_HAND );
321 if (
id == a2dCURSOR_Move )
322 cursor = wxCursor( wxCURSOR_HAND );
323 if (
id == a2dCURSOR_Copy )
324 cursor = wxCursor( wxCURSOR_HAND );
325 if (
id == a2dCURSOR_DrawWire )
326 cursor = wxCursor( wxCURSOR_PENCIL );
327 if (
id == a2dCURSOR_EditWire )
328 cursor = wxCursor( wxCURSOR_HAND );
329 if (
id == a2dCURSOR_EditWireVertex )
330 cursor = wxCursor( wxCURSOR_HAND );
331 if (
id == a2dCURSOR_EditWireDeleteVertex )
332 cursor = wxCursor( wxCURSOR_HAND );
333 if (
id == a2dCURSOR_EditWireSegment )
334 cursor = wxCursor( wxCURSOR_HAND );
335 if (
id == a2dCURSOR_EditWireSegmentHorizontal )
336 cursor = wxCursor( wxCURSOR_SIZENS );
337 if (
id == a2dCURSOR_EditWireSegmentVertical )
338 cursor = wxCursor( wxCURSOR_SIZEWE );
339 if (
id == a2dCURSOR_WireSegmentInsert )
340 cursor = wxCursor( wxCURSOR_CROSS );
341 if (
id == a2dCURSOR_Edit )
342 cursor = wxCursor( wxCURSOR_SIZEWE );
343 if (
id == a2dCURSOR_EditVertex )
344 cursor = wxCursor( wxCURSOR_HAND );
345 if (
id == a2dCURSOR_EditSegment )
346 cursor = wxCursor( wxCURSOR_SIZENS );
347 if (
id == a2dCURSOR_EditSegmentHorizontal )
348 cursor = wxCursor( wxCURSOR_HAND );
349 if (
id == a2dCURSOR_EditSegmentVertical )
350 cursor = wxCursor( wxCURSOR_HAND );
351 if (
id == a2dCURSOR_SegmentInsert )
352 cursor = wxCursor( wxCURSOR_HAND );
355 if ( artroot.IsEmpty() )
358 artroot += wxT(
"cursors/" );
360 if (
id == a2dCURSOR_Select )
361 cursor = wxCursor( wxCURSOR_CROSS );
362 if (
id == a2dCURSOR_Select2 )
363 cursor = wxCursor( wxCURSOR_CROSS );
364 if (
id == a2dCURSOR_Zoom )
365 cursor = wxCursor( wxCURSOR_MAGNIFIER );
366 if (
id == a2dCURSOR_Drag )
367 cursor = LoadCursorFile( artroot + wxT(
"drag_cur.cur" ) );
368 if (
id == a2dCURSOR_Move )
369 cursor = LoadCursorFile( artroot + wxT(
"move_cur.cur" ) );
370 if (
id == a2dCURSOR_Copy )
371 cursor = LoadCursorFile( artroot + wxT(
"copy_cur.cur" ) );
372 if (
id == a2dCURSOR_DrawWire )
373 cursor = LoadCursorFile( artroot + wxT(
"start_wire.cur" ) );
374 if (
id == a2dCURSOR_EditWire )
375 cursor = wxCursor( wxCURSOR_HAND );
376 if (
id == a2dCURSOR_EditWireDeleteVertex )
377 cursor = LoadCursorFile( artroot + wxT(
"delete_vertex.cur" ) );
378 if (
id == a2dCURSOR_EditWireVertex )
379 cursor = LoadCursorFile( artroot + wxT(
"drag_vertex.cur" ) );
380 if (
id == a2dCURSOR_EditWireSegment )
381 cursor = LoadCursorFile( artroot + wxT(
"drag_seg.cur" ) );
382 if (
id == a2dCURSOR_EditWireSegmentHorizontal )
383 cursor = LoadCursorFile( artroot + wxT(
"drag_seg_horz.cur" ) );
384 if (
id == a2dCURSOR_EditWireSegmentVertical )
385 cursor = LoadCursorFile( artroot + wxT(
"drag_seg_vert.cur" ) );
386 if (
id == a2dCURSOR_WireSegmentInsert )
387 cursor = LoadCursorFile( artroot + wxT(
"insert_seg.cur" ) );
388 if (
id == a2dCURSOR_Edit )
389 cursor = LoadCursorFile( artroot + wxT(
"edit_cur.cur" ) );
390 if (
id == a2dCURSOR_EditDeleteVertex )
391 cursor = LoadCursorFile( artroot + wxT(
"delete_vertex.cur" ) );
392 if (
id == a2dCURSOR_EditVertex )
393 cursor = LoadCursorFile( artroot + wxT(
"edit_cur.cur" ) );
394 if (
id == a2dCURSOR_EditSegment )
395 cursor = wxCursor( wxCURSOR_SIZENS );
396 if (
id == a2dCURSOR_EditSegmentHorizontal )
397 cursor = wxCursor( wxCURSOR_HAND );
398 if (
id == a2dCURSOR_EditSegmentVertical )
399 cursor = wxCursor( wxCURSOR_HAND );
400 if (
id == a2dCURSOR_SegmentInsert )
401 cursor = wxCursor( wxCURSOR_HAND );
403 if (
id == a2dCURSOR_HandleLeftDown )
404 cursor = wxCursor( wxCURSOR_CROSS );
405 if (
id == a2dCURSOR_HandleDrag )
406 cursor = wxCursor( wxCURSOR_CROSS );
407 if (
id == a2dCURSOR_HandleMove )
408 cursor = wxCursor( wxCURSOR_CROSS );
410 if (
id == a2dCURSOR_HandleEnter )
411 cursor = wxCursor( wxCURSOR_CROSS );
412 if (
id == a2dCURSOR_HandleLeave )
413 cursor = wxCursor( wxCURSOR_ARROW );
416 if (
id == a2dCURSOR_CanvasObjectHit )
417 cursor = wxCursor( wxCURSOR_HAND );
419 if (
id == a2dCURSOR_CanvasObjectEnter )
420 cursor = LoadCursorFile( artroot + wxT(
"edit_cur.cur" ) );
421 if (
id == a2dCURSOR_CanvasObjectLeave )
422 cursor = wxCursor( wxCURSOR_ARROW );
463 m_cursorsLoaded[id] = cursor;
467 wxBitmap& a2dArtProvider::GetImage( a2dImageId
id )
469 if ( m_imageLoaded.find(
id ) != m_imageLoaded.end() )
470 return m_imageLoaded[
id];
472 static wxBitmap bitmap;
474 if (
id == a2dBitmap_EditRectangleFill )
476 static const char* bits[] =
493 bitmap = wxBitmap( bits );
494 static const char mask_bits[] =
496 0x13, 0x00, 0x15, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x80,
499 wxBitmap mask_bitmap( mask_bits, 8, 8, 1 );
500 bitmap.SetMask(
new wxMask( mask_bitmap ) );
504 m_imageLoaded[id] = bitmap;
512 const a2dSignal a2dHabitat::sig_changedStroke = wxNewId();
513 const a2dSignal a2dHabitat::sig_changedFont = wxNewId();
514 const a2dSignal a2dHabitat::sig_changedLayer = wxNewId();
515 const a2dSignal a2dHabitat::sig_changedTarget = wxNewId();
516 const a2dSignal a2dHabitat::sig_SetPathType = wxNewId();
517 const a2dSignal a2dHabitat::sig_SetContourWidth = wxNewId();
518 const a2dSignal a2dHabitat::sig_changedTextFill = wxNewId();
519 const a2dSignal a2dHabitat::sig_changedTextStroke = wxNewId();
520 const a2dSignal a2dHabitat::sig_changedTextFont = wxNewId();
522 a2dHabitat::a2dHabitat( wxUint16 maximumLayers )
524 m_maximumLayers = maximumLayers;
528 a2dHabitat::~a2dHabitat()
531 void a2dHabitat::Init(
a2dLayers* layers )
533 m_default_acc = 1e-6;
535 m_propertytext = (
a2dText* ) NULL;
547 for ( wxUint16 i = 1; i < m_maximumLayers; i++ )
550 buf.Printf( wxT(
"layer %d" ), i );
611 m_displayaberration = 1;
614 m_poly2arcMax = 1000;
628 m_textOwnStyle =
true;
646 m_keySaveTextAsPolygon =
false;
647 m_gdsiiSaveTextAsPolygon =
false;
648 m_keySaveFromView =
false;
649 m_gdsiiSaveFromView =
false;
656 m_defaultUnitsScale = 1;
658 m_drawingTemplate =
new a2dDrawing(
"",
this );
659 m_drawingTemplateSymbol = m_drawingTemplate;
660 m_drawingTemplateDiagram = m_drawingTemplate;
661 m_drawingTemplateBuildIn = m_drawingTemplate;
662 m_drawingTemplateGui = m_drawingTemplate;
667 wxString foundfile = filename;
677 if ( foundfile.IsEmpty() )
698 m_defPin->
SetStroke( wxColour( 66, 159, 235 ), 1 );
705 m_defCannotConnectPin = newpin;
710 if ( !m_defCannotConnectPin )
712 m_defCannotConnectPin =
new a2dPin( NULL, wxT(
"global" ),
a2dPinClass::Standard, 0, 0, 0, m_defPinSize / 2 + 1, m_defPinSize / 2 + 1 );
713 m_defCannotConnectPin->
SetFill( wxColour( 255, 128, 128 ) );
714 m_defCannotConnectPin->
SetStroke( *wxRED, 1 );
716 return m_defCannotConnectPin;
721 m_defCanConnectPin = newpin;
726 if ( !m_defCanConnectPin )
728 m_defCanConnectPin =
new a2dPin( NULL, wxT(
"global" ),
a2dPinClass::Standard, 0, 0, 0, 2 * m_defPinSize + 1, 2 * m_defPinSize + 1 );
729 m_defCanConnectPin->
SetFill( wxColour( 128, 255, 128 ) );
730 m_defCanConnectPin->
SetStroke( *wxGREEN, 1 );
732 return m_defCanConnectPin;
737 m_defHandle = newhandle;
745 m_defHandle =
new a2dHandle( NULL, 0, 0, wxT(
"global" ), m_defHandleSize, m_defHandleSize );
746 m_defHandle->
SetFill( *wxCYAN );
747 m_defHandle->
SetStroke( wxColour( 66, 159, 235 ), 1 );
754 if ( !m_propertytext )
756 m_propertytext =
new a2dText( wxT(
"dummy" ), 0, 0,
a2dFont( 80.0, wxSWISS ) );
757 m_propertytext->
SetFill( *wxCYAN );
758 m_propertytext->
SetStroke( wxColour( 66, 159, 235 ), 0.0 );
760 return m_propertytext;
766 m_userunits = userunit;
771 m_physicalunits = physicalunit;
781 return m_physicalunits;
787 return m_default_acc;
790 double a2dHabitat::ACCUR()
792 return m_default_acc / 10000;
795 double a2dHabitat::ARCTOPOLYABER()
797 return m_arc2polyaber / m_physicalunits;
800 double a2dHabitat::POLYTOARCRMIN()
802 return m_poly2arcMin / m_physicalunits;
805 double a2dHabitat::POLYTOARCRMAX()
807 return m_poly2arcMax / m_physicalunits;
810 double a2dHabitat::POLYTOARCABER()
812 return m_poly2arcAber / m_physicalunits;
832 bool a2dHabitat::GdsIoSaveTextAsPolygon(
bool onOff )
834 m_gdsiiSaveTextAsPolygon = onOff;
838 bool a2dHabitat::KeyIoSaveTextAsPolygon(
bool onOff )
840 m_keySaveTextAsPolygon = onOff;
844 bool a2dHabitat::GetGdsIoSaveTextAsPolygon()
const
846 return m_gdsiiSaveTextAsPolygon;
849 bool a2dHabitat::GetKeyIoSaveTextAsPolygon()
const
851 return m_keySaveTextAsPolygon;
949 col.
SetColour( wxColour( red, green, blue ) );
965 col.
SetColour( wxColour( red, green, blue ) );
981 if ( m_textOwnStyle )
984 a2dComEvent changed(
this, sig_changedTextStroke );
996 if ( m_textOwnStyle )
1011 if ( m_textOwnStyle )
1014 a2dComEvent changed(
this, m_textOwnStyle ? sig_changedTextFont : sig_changedTextFont );
1027 if ( m_textOwnStyle )
1034 if ( m_textOwnStyle )
1041 if ( m_textOwnStyle )
1079 if ( setStyleOfLayer )
1105 void a2dHabitat::SetDrawingTemplate(
a2dDrawing* drawingTemplate) { m_drawingTemplate = drawingTemplate; }
1107 a2dDrawing* a2dHabitat::GetDrawingTemplate()
const {
return m_drawingTemplate; }
1109 void a2dHabitat::SetSymbolDrawingTemplate(
a2dDrawing* drawingTemplate) { m_drawingTemplateSymbol = drawingTemplate; }
1111 a2dDrawing* a2dHabitat::GetSymbolDrawingTemplate()
const {
return m_drawingTemplateSymbol; }
1113 void a2dHabitat::SetBuildInDrawingTemplate(
a2dDrawing* drawingTemplate) { m_drawingTemplateBuildIn = drawingTemplate; }
1115 a2dDrawing* a2dHabitat::GetBuildInDrawingTemplate()
const {
return m_drawingTemplateBuildIn; }
1117 void a2dHabitat::SetDiagramDrawingTemplate(
a2dDrawing* drawingTemplate) { m_drawingTemplateDiagram = drawingTemplate; }
1119 a2dDrawing* a2dHabitat::GetDiagramDrawingTemplate()
const {
return m_drawingTemplateDiagram; }
1121 void a2dHabitat::SetGuiDrawingTemplate(
a2dDrawing* drawingTemplate) { m_drawingTemplateGui = drawingTemplate; }
1123 a2dDrawing* a2dHabitat::GetGuiDrawingTemplate()
const {
return m_drawingTemplateGui; }
1136 a2dCanvasGlobal::a2dCanvasGlobal()
1141 m_layersPath.Add( wxT(
"." ) );
1142 m_layersPath.Add( wxT(
".." ) );
1143 m_layersPath.Add( wxT(
"./config" ) );
1145 m_initialDocChildFramePos = wxPoint( 20, 20 );
1146 m_initialDocChildFrameSize = wxSize( 600, 300 );
1147 m_initialDocChildFrameStyle = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE;
1150 m_initialWorldCanvasStyle = wxHSCROLL | wxVSCROLL;
1152 m_popBeforePush =
true;
1153 m_oneShotTools =
false;
1154 m_editAtEndTools =
true;
1156 m_activeDrawingPart = NULL;
1160 void a2dCanvasGlobal::SetArtProvider(
a2dArtProvider* artProvider )
1162 delete m_artProvider;
1163 m_artProvider = artProvider;
1215 a2dCanvasGlobal::~a2dCanvasGlobal()
1217 delete m_artProvider;
1222 bool changed = m_activeDrawingPart != part;
1223 m_activeDrawingPart = part;
1228 ProcessEvent( changedActiveDrawing );
1240 a2dFont* a2dCanvasModule::m_FontMedBold;
1241 a2dFont* a2dCanvasModule::m_FontMed;
1242 a2dFont* a2dCanvasModule::m_FontSmall;
1243 a2dFont* a2dCanvasModule::m_FontMini;
1254 bool a2dCanvasModule::OnInit()
1256 #if wxUSE_PRINTING_ARCHITECTURE
1257 if( wxThePrintPaperDatabase == NULL )
1259 wxThePrintPaperDatabase =
new wxPrintPaperDatabase;
1260 wxThePrintPaperDatabase->CreateDatabase();
1261 m_wxThePrintPaperDatabase = wxThePrintPaperDatabase;
1272 a2dCanvasGlobals->SetHabitat(
new a2dHabitat() );
1277 wxNullLayerInfo =
new a2dLayerInfo( 0, wxT(
"not defined" ) );
1281 m_FontMedBold =
new a2dFont( 1, wxSWISS, wxNORMAL, wxBOLD);
1282 m_FontMed =
new a2dFont( 1, wxSWISS);
1283 m_FontSmall =
new a2dFont( 0.8, wxSWISS);
1284 m_FontMini =
new a2dFont( 0.5, wxSWISS);
1289 void a2dCanvasModule::OnExit()
1291 #if wxUSE_PRINTING_ARCHITECTURE
1292 if( m_wxThePrintPaperDatabase && m_wxThePrintPaperDatabase != wxThePrintPaperDatabase )
1293 delete m_wxThePrintPaperDatabase;
1294 m_wxThePrintPaperDatabase = NULL;
1306 a2dCanvasGlobals = NULL;
1308 delete m_FontMedBold;
1364 if ( which == a2dCanvasOFlags::ALL )
1393 m_IsProperty = setOrClear;
1395 m_HighLight = setOrClear;
1396 m_AlgoSkip = setOrClear;
1404 else if( which == a2dCanvasOFlags::PENDING )
1408 if ( 0 < ( which & a2dCanvasOFlags::SELECTABLE ) )
m_selectable = setOrClear;
1409 if ( 0 < ( which & a2dCanvasOFlags::SELECTED ) )
m_selected = setOrClear;
1410 if ( 0 < ( which & a2dCanvasOFlags::SELECTED2 ) )
m_selected2 = setOrClear;
1412 if ( 0 < ( which & a2dCanvasOFlags::SubEdit ) )
m_subEdit = setOrClear;
1413 if ( 0 < ( which & a2dCanvasOFlags::SubEditAsChild ) )
m_subEditAsChild = setOrClear;
1414 if ( 0 < ( which & a2dCanvasOFlags::VISIBLE ) )
m_visible = setOrClear;
1415 if ( 0 < ( which & a2dCanvasOFlags::DRAGGABLE ) )
m_draggable = setOrClear;
1416 if ( 0 < ( which & a2dCanvasOFlags::SHOWSHADOW ) )
m_showshadow = setOrClear;
1417 if ( 0 < ( which & a2dCanvasOFlags::FILLED ) )
m_filled = setOrClear;
1418 if ( 0 < ( which & a2dCanvasOFlags::A ) )
m_a = setOrClear;
1419 if ( 0 < ( which & a2dCanvasOFlags::B ) )
m_b = setOrClear;
1420 if ( 0 < ( which & a2dCanvasOFlags::generatePins ) )
m_generatePins = setOrClear;
1421 if ( 0 < ( which & a2dCanvasOFlags::BIN ) )
m_bin = setOrClear;
1422 if ( 0 < ( which & a2dCanvasOFlags::BIN2 ) )
m_bin2 = setOrClear;
1423 if ( 0 < ( which & a2dCanvasOFlags::PENDING ) )
m_pending = setOrClear;
1424 if ( 0 < ( which & a2dCanvasOFlags::SNAP ) )
m_snap = setOrClear;
1425 if ( 0 < ( which & a2dCanvasOFlags::SNAP_TO ) )
m_snap_to = setOrClear;
1426 if ( 0 < ( which & a2dCanvasOFlags::PUSHIN ) )
m_pushin = setOrClear;
1427 if ( 0 < ( which & a2dCanvasOFlags::PRERENDERASCHILD ) )
m_prerenderaschild = setOrClear;
1428 if ( 0 < ( which & a2dCanvasOFlags::VISIBLECHILDS ) )
m_visiblechilds = setOrClear;
1429 if ( 0 < ( which & a2dCanvasOFlags::EDITABLE ) )
m_editable = setOrClear;
1430 if ( 0 < ( which & a2dCanvasOFlags::FixedStyle ) )
m_fixedStyle = setOrClear;
1432 if ( 0 < ( which & a2dCanvasOFlags::DoConnect ) )
m_doConnect = setOrClear;
1433 if ( 0 < ( which & a2dCanvasOFlags::IsOnCorridorPath ) )
m_isOnCorridorPath = setOrClear;
1434 if ( 0 < ( which & a2dCanvasOFlags::HasPins ) )
m_hasPins = setOrClear;
1435 if ( 0 < ( which & a2dCanvasOFlags::Editing ) )
m_editing = setOrClear;
1436 if ( 0 < ( which & a2dCanvasOFlags::EditingCopy ) )
m_editingCopy = setOrClear;
1437 if ( 0 < ( which & a2dCanvasOFlags::IsProperty ) ) m_IsProperty = setOrClear;
1438 if ( 0 < ( which & a2dCanvasOFlags::MouseInObject ) ) m_MouseInObject = setOrClear;
1439 if ( 0 < ( which & a2dCanvasOFlags::HighLight ) ) m_HighLight = setOrClear;
1440 if ( 0 < ( which & a2dCanvasOFlags::AlgoSkip ) ) m_AlgoSkip = setOrClear;
1441 if ( 0 < ( which & a2dCanvasOFlags::ignoreSetpending ) )
m_ignoreSetpending = setOrClear;
1442 if ( 0 < ( which & a2dCanvasOFlags::normalized ) )
m_normalized = setOrClear;
1448 if ( which == a2dCanvasOFlags::ALL )
1479 m_IsProperty =
true;
1480 m_MouseInObject =
true;
1537 case a2dCanvasOFlags::SELECTED:
return m_selected;
1538 case a2dCanvasOFlags::SELECTED2:
return m_selected2;
1541 case a2dCanvasOFlags::SubEdit:
return m_subEdit;
1543 case a2dCanvasOFlags::VISIBLE:
return m_visible;
1544 case a2dCanvasOFlags::DRAGGABLE:
return m_draggable;
1546 case a2dCanvasOFlags::FILLED:
return m_filled;
1547 case a2dCanvasOFlags::A:
return m_a;
1548 case a2dCanvasOFlags::B:
return m_b;
1550 case a2dCanvasOFlags::BIN:
return m_bin;
1551 case a2dCanvasOFlags::BIN2:
return m_bin2;
1552 case a2dCanvasOFlags::PENDING:
return m_pending;
1553 case a2dCanvasOFlags::SNAP:
return m_snap;
1554 case a2dCanvasOFlags::SNAP_TO:
return m_snap_to;
1555 case a2dCanvasOFlags::PUSHIN:
return m_pushin;
1558 case a2dCanvasOFlags::EDITABLE:
return m_editable;
1561 case a2dCanvasOFlags::DoConnect:
return m_doConnect;
1563 case a2dCanvasOFlags::HasPins:
return m_hasPins;
1564 case a2dCanvasOFlags::Editing:
return m_editing;
1566 case a2dCanvasOFlags::IsProperty:
return m_IsProperty;
1567 case a2dCanvasOFlags::MouseInObject:
return m_MouseInObject;
1568 case a2dCanvasOFlags::HighLight:
return m_HighLight;
1569 case a2dCanvasOFlags::AlgoSkip:
return m_AlgoSkip;
1574 wxFAIL_MSG( wxT(
"This Flag not implemented" ) );
1628 if ( mask == a2dCanvasOFlags::NON )
1630 if ( mask == a2dCanvasOFlags::ALL )
1633 if ( mask == a2dCanvasOFlags::VISIBLE &&
m_visible )
return true;
1636 if ( 0 < ( mask & a2dCanvasOFlags::VISIBLE ) && !
m_visible )
return false;
1637 if ( 0 < ( mask & a2dCanvasOFlags::SELECTABLE ) && !
m_selectable )
return false;
1638 if ( 0 < ( mask & a2dCanvasOFlags::SELECTED ) && !
m_selected )
return false;
1639 if ( 0 < ( mask & a2dCanvasOFlags::SELECTED2 ) && !
m_selected2 )
return false;
1641 if ( 0 < ( mask & a2dCanvasOFlags::SubEdit ) && !
m_subEdit )
return false;
1642 if ( 0 < ( mask & a2dCanvasOFlags::SubEditAsChild ) && !
m_subEditAsChild )
return false;
1643 if ( 0 < ( mask & a2dCanvasOFlags::DRAGGABLE ) && !
m_draggable )
return false;
1644 if ( 0 < ( mask & a2dCanvasOFlags::SHOWSHADOW ) && !
m_showshadow )
return false;
1645 if ( 0 < ( mask & a2dCanvasOFlags::FILLED ) && !
m_filled )
return false;
1646 if ( 0 < ( mask & a2dCanvasOFlags::A ) && !
m_a )
return false;
1647 if ( 0 < ( mask & a2dCanvasOFlags::B ) && !
m_b )
return false;
1648 if ( 0 < ( mask & a2dCanvasOFlags::generatePins ) && !
m_generatePins )
return false;
1649 if ( 0 < ( mask & a2dCanvasOFlags::BIN ) && !
m_bin )
return false;
1650 if ( 0 < ( mask & a2dCanvasOFlags::BIN2 ) && !
m_bin2 )
return false;
1651 if ( 0 < ( mask & a2dCanvasOFlags::PENDING ) && !
m_pending )
return false;
1652 if ( 0 < ( mask & a2dCanvasOFlags::SNAP ) && !
m_snap )
return false;
1653 if ( 0 < ( mask & a2dCanvasOFlags::SNAP_TO ) && !
m_snap_to )
return false;
1654 if ( 0 < ( mask & a2dCanvasOFlags::PUSHIN ) && !
m_pushin )
return false;
1655 if ( 0 < ( mask & a2dCanvasOFlags::PRERENDERASCHILD ) && !
m_prerenderaschild )
return false;
1656 if ( 0 < ( mask & a2dCanvasOFlags::VISIBLECHILDS ) && !
m_visiblechilds )
return false;
1657 if ( 0 < ( mask & a2dCanvasOFlags::EDITABLE ) && !
m_editable )
return false;
1658 if ( 0 < ( mask & a2dCanvasOFlags::FixedStyle ) && !
m_fixedStyle )
return false;
1660 if ( 0 < ( mask & a2dCanvasOFlags::DoConnect ) && !
m_doConnect )
return false;
1661 if ( 0 < ( mask & a2dCanvasOFlags::IsOnCorridorPath ) && !
m_isOnCorridorPath )
return false;
1662 if ( 0 < ( mask & a2dCanvasOFlags::HasPins ) && !
m_hasPins )
return false;
1663 if ( 0 < ( mask & a2dCanvasOFlags::Editing ) && !
m_editing )
return false;
1664 if ( 0 < ( mask & a2dCanvasOFlags::EditingCopy ) && !
m_editingCopy )
return false;
1665 if ( 0 < ( mask & a2dCanvasOFlags::IsProperty ) && !m_IsProperty )
return false;
1666 if ( 0 < ( mask & a2dCanvasOFlags::MouseInObject ) && !m_MouseInObject )
return false;
1667 if ( 0 < ( mask & a2dCanvasOFlags::HighLight ) && !m_HighLight )
return false;
1668 if ( 0 < ( mask & a2dCanvasOFlags::AlgoSkip ) && !m_AlgoSkip )
return false;
1669 if ( 0 < ( mask & a2dCanvasOFlags::ignoreSetpending ) && !
m_ignoreSetpending )
return false;
1670 if ( 0 < ( mask & a2dCanvasOFlags::normalized ) && !
m_normalized )
return false;
static const a2dCanvasObjectFlagsMask SELECTED2
a2dStroke GetTextStroke() const
get the current text stroke
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
double PHYSUNITS()
how many meters is 1 unit in the database
void SetContourWidth(const a2dDoMu ¤tContourWidth)
set the Contour width of shapes
a2dDoMu m_currentContourWidth
current contour width e.g for polyline with width.
void SetConnectionGenerator(a2dConnectionGenerator *connectionGenerator)
Set class for generating new connection objects between object and pins.
a2dPATH_END_TYPE
defines the way a polyline with a contour width is ended.
static const a2dCanvasObjectFlagsMask BIN
a2dDoMu m_AberPolyToArc
Polygon/polyline to Arc Maximum abberation.
A2DGENERALDLLEXP long wxGenNewId()
This function is like wxNewId, but it has its own ID set.
#define PINWIDTH
default a2dPin width in pixels
all basic primitives derived from a2dCanvasObject
#define HANDLEWIDTH
default a2dHandle width in pixels
Base class for all types of strokes, understood by a2dDrawer2D classes.
void SetSelect2Fill(const a2dFill &fill)
Set Fill to use for Selected2 a2dCanvasObject's.
double m_coordinateepsilon
a2dPin * GetPin()
get default pin for graph like structure
void SetHandle(a2dHandle *newhandle)
set default handle for editing
a2dDoMu m_CORRECTIONABER
boolean operation setting
static const a2dSignal sig_changedFill
when active drawing is set, this signal is send to the drawing.
double m_hitmargin_world
hit marging in world units.
a2dHandle is used inside editing versions of a certain objects.
mouse event sent from a2dCanvasObject to itself
a2dCanvasObjectPtr m_currentEnd
current endobject for lines and polylines
void SetTextStroke(const a2dStroke &stroke)
used for new text objects etc. to set the stroke
static const a2dCanvasObjectFlagsMask HasPins
static void SetAberPolyToArc(double aber)
conversion from polygon/polyline into arc in database units
#define wxDEFAULTMAXLAYER
maximum number of layers allowed
void SetTextFill(const a2dFill &fill)
used for new text objects etc. to set the fill
void SetLayer(wxUint16 layer, bool setStyleOfLayer=false)
bool m_selected2
object is selected2
bool m_LinkHoles
boolean operation setting
wxString FindValidPath(const wxString &filename, bool reportError=true)
Find the first full path for which the file exists.
bool m_editing
true if the object is currently being edited
a2dDoMu m_SMOOTHABER
boolean operation setting
static const a2dCanvasObjectFlagsMask HasToolObjectsBelow
void SetDefaultStroke(const a2dStroke &stroke)
Set Stroke to use for non layered a2dCanvasObject's.
a2dStroke m_SelectStroke
Stroke to use for selected a2dCanvasObject's.
bool m_WINDINGRULE
boolean operation setting
static const a2dCanvasObjectFlagsMask BIN2
void SetAnyPinClass(a2dPinClass *pinClass)
see GetAnyPinClass()
a2dFill m_SelectFill
Fill to use for selected a2dCanvasObject's.
a2dPin is used in a2dCanvasObject to add pins to it.
a2dFill m_HighLightFill
Fill to use for Highlighted a2dCanvasObject's.
static void InitializeStockPinClasses()
called to initialize static stockobjects
double m_ROUNDFACTOR
boolean operation setting
void SetPin(a2dPin *newpin)
set default pin for graph like structure
bool m_normalized
true if the object is defined in normalized coordinates
a2dCanvasObjectPtr m_currentBegin
current beginobject for lines and polylines
a2dObject * Clone(CloneOptions options, a2dRefMap *refs=NULL) const
create an exact copy of this property
bool m_pending
set when a2dCanvasObject needs an update (redraw).
contains global settings for the a2dCanvas library
static const a2dCanvasObjectFlagsMask MouseInObject
static const a2dCanvasObjectFlagsMask PUSHIN
double m_lastX
holds last mouse X position in world coordinates, as set by tools.
wxUint16 m_hitmargin_device
hit marging in pixels.
void SetGridX(const a2dDoMu &gridX)
grid setting X
a2dFill & GetHighLightFill()
Get Fill to use for Highlighted a2dCanvasObject's.
static const a2dCanvasObjectFlagsMask AlgoSkip
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
a2dDoMu m_AberArcToPoly
Arc to Polygon/polyline Maximum abberation.
void SetHighLightStroke(const a2dStroke &stroke)
Set Stroke to use for Highlighted a2dCanvasObject's.
void SetStroke(const a2dStroke &stroke)
used for new objects etc. to set the stroke
bool m_visiblechilds
child objects are visible or not
a2dGlobal * a2dGlobals
global a2dCanvasGlobal to have easy access to global settings
a2dSmrtPtr< a2dText > m_textTemplateObject
object to clone to use as start
double m_DGRID
boolean operation setting
a2dDoMu m_radiusMax
Polygon/polyline to Arc Maximum radius to test.
a2dDoMu m_CORRECTIONFACTOR
boolean operation setting
static const a2dCanvasObjectFlagsMask FILLED
a2dDoMu m_MAXLINEMERGE
boolean operation setting
bool m_hasPins
true if this object does have a2dPin's as children
static const a2dCanvasObjectFlagsMask FixedStyle
The base class for all drawable objects in a a2dCanvasDocument.
a2dDoMu m_small
detect samll objects
static const a2dCanvasObjectFlagsMask generatePins
a2dFont GetTextFont() const
get current font active text font ( like used in text tool ).
void SetPinCannotConnect(a2dPin *newpin)
double m_objectGridSize
used for objects which depend in size on this grid
a2dPATH_END_TYPE m_pathtype
when m_contourwidth != 0 what is the end of the line/polyline.
a2dCanvasObject is the base class for Canvas Objects.
wxUint16 m_target
target layer in operations
a2dFill m_DefaultFill
Fill to use for non layered a2dCanvasObject's.
a2dStroke & GetSelect2Stroke()
Get Stroke to use for Selected2 a2dCanvasObject's.
double m_currentYscale
end point scaling
static const a2dCanvasObjectFlagsMask A
bool m_snap_to
snapping of other objects to this when in place
void SetFill(const a2dFill &fill)
used for new objects etc. to set the fill
a2dText * GetPropertyText()
default text for displaying properties.
initiation module for the wxArt2D library
store and convert number to number with unit and visa versa. e.g. 1.23e-6 => 1.23 * 1e-6 ...
double m_copymindistance
the minimum distance in world units of a copied object from the original
bool m_external
GDSII format flag.
bool m_selected
object is selected
a2dDocumentRenderStyle m_SelectDrawStyle
draw style to be used for selected object
a2dDoMu m_radiusMin
Polygon/polyline to Arc Minimum radius to test.
bool m_oneLine
used in routing wires to be straight or manhatten
a2dFont GetFont() const
get font for text
double m_RelativeStartY
The RelativeStart start is used when mesuring using a tool, or from the commandline.
void SetContourWidthInDataBaseUnits(double width)
set the Contour width of shapes defined in database units
wxUint64 a2dCanvasObjectFlagsMask
mask flags for a2dCanvasObject
bool m_generatePins
generate pins if true
static const a2dCanvasObjectFlagsMask ChildOnlyTranslate
void SetTextFont(const a2dFont &font)
used for new text objects etc. to set the font
double m_currentXscale
begin point scaling
wxUint16 m_layer
layer to be set for new objects
static const a2dCanvasObjectFlagsMask PENDING
bool m_b
group B flag (e.g boolean operations)
void SetSelectFill(const a2dFill &fill)
Set Fill to use for Selected a2dCanvasObject's.
void SetHighLightFill(const a2dFill &fill)
Set Fill to use for Highlighted a2dCanvasObject's.
bool m_draggable
can be dragged
bool m_clearTarget
clear target layer before adding results of an operation
a2dRestrictionEnginePtr m_restrictionEngine
restriction engine to be used usually (if zero don't restrict)
static const a2dCanvasObjectFlagsMask SubEditAsChild
static const a2dCanvasObjectFlagsMask normalized
a2dDoMu m_SmoothAber
boolean operation setting
a2dText is an abstract base class.
a2dCanvasObjectList * wxNullCanvasObjectList
define a NON a2dCanvasObjectList
see a2dCanvasObjectMouseEvent
bool m_isOnCorridorPath
This object is on the corridor path to a captured object or to a corridored object.
a2dCanvasObjectEvent(a2dIterC *ic, wxEventType type, a2dCanvasObject *object, double x, double y, int id=0)
constructor
static const a2dCanvasObjectFlagsMask HighLight
static const a2dCanvasObjectFlagsMask IsProperty
bool m_selectable
can select object
void SetColour(const wxColour &col)
set colour used for gradient and wxSTROKE_MASK_OPAQUE filling.
void SetFont(const a2dFont &font, double lineSpaceFactor=0.1)
set font for text
bool m_visible
is the object visible (overruled by paranet object in some cases during rendering ...
#define forEachIn(listtype, list)
easy iteration for a2dlist
static const a2dSignal sig_changedActiveDrawing
when active drawing is set, this signal is send to the drawing.
const a2dStroke & GetStroke() const
get the current stroke
bool m_NoRenderCanvasObject
true is the object is a a2dCanvasObject (or derived ) without rendering something if there or now chi...
static void SetAberArcToPoly(double aber)
conversion from arc into lines in database units
a2dHandle * GetHandle()
get default handle for editing
static const a2dCanvasObjectFlagsMask SELECTABLE
void SetPinCanConnect(a2dPin *newpin)
layer settings for a a2dCanvasDocument Holds layers settings classes
bool m_bin2
general flag ( used for temporarely marking object )
bool m_editable
object can be edited
void SetPending(bool pending)
next to base sets m_indexed false
bool m_spline
spline polygons
void SetActiveDrawingPart(a2dDrawingPart *part)
get the drawing part that has the focus/is active in a window.
A2DGENERALDLLEXP a2dSmrtPtr< a2dGeneralGlobal > a2dGeneralGlobals
a global pointer to get to global instance of important classes.
void SetTarget(wxUint16 target)
set target layer in operation
general event sent from a2dHandle to its parent a2dCanvasObject
a2dFont m_font
current font set
Restriction engine for editing restrictions like snapping.
bool m_childrenOnSameLayer
void SetColour(const wxColour &col)
set colour used for gradient and wxSTIPPLE_MASK_OPAQUE filling.
contains the layer properties for one layer,
static const a2dCanvasObjectFlagsMask SELECTED
static const a2dCanvasObjectFlagsMask IsOnCorridorPath
static const a2dCanvasObjectFlagsMask EditingCopy
a2dFill & GetDefaultFill()
Get Fill to use for non layered a2dCanvasObject's.
void SetInMapping(wxUint16 layer)
read this layer from the given layer in input files
a2dFill m_Select2Fill
Fill to use for selected2 a2dCanvasObject's.
bool m_subEditAsChild
allow subedit on this object when child of other object
bool m_ignoreLayer
when this is set DoRender() is called even if layer of the object is not the layer to be rendered...
a2dPin * GetPinCannotConnect()
represnts the pin styles for pins that cannot connect right now
a2dFill & GetSelect2Fill()
Get Fill to use for Selected2 a2dCanvasObject's.
void SetSelectStroke(const a2dStroke &stroke)
Set Stroke to use for Selected a2dCanvasObject's.
const a2dFill * a2dNullFILL
global a2dFill stock object for defining NO filling
static const a2dCanvasObjectFlagsMask Editing
Contains a2dDrawing Class to hold a drawing.
static const a2dCanvasObjectFlagsMask B
bool m_selectedOnlyB
operations on m_groupB but only selected objects
bool m_resizeToChilds
when true, the wxEVT_CANVASOBJECT_RESIZE_EVENT is sent to this object, if the child box did change...
bool LoadLayers(const wxString &filename)
a2dFill GetTextFill() const
get the current text fill
properties specific for a2dCanvasOject
initiation module for the wxArt2D library
bool m_snap
snapping of editable object or when moving
defines common settinsg for a habitat for a set of a2dCameleons.
bool LoadLayers(const wxString &filename)
save layers to a file
a2dStroke & GetDefaultStroke()
Get Stroke to use for non layered a2dCanvasObject's.
const a2dStroke * a2dNullSTROKE
global a2dStroke stock object for NO stroking
a2dDoMu m_gridY
canvas default grid in Y
static const a2dCanvasObjectFlagsMask DRAGGABLE
void SetPathType(a2dPATH_END_TYPE pathtype)
Set when m_contourwidth != 0 what is the end of the line should be.
a2dStroke m_HighLightStroke
Stroke to use for Highlighted a2dCanvasObject's.
a2dPin * GetPinCanConnect()
represents the pin styles for pins that can connect right now
static void DeleteStockPinClasses()
called to delete all pin class objects
bool m_selectedOnlyA
operations on m_groupA but only selected objects
while iterating a a2dCanvasDocument, this holds the context.
Contains graphical drawing context specific classes. a2dDrawer2D and derived classes are used for dra...
struct for how a single object on one layer was hit
static const a2dCanvasObjectFlagsMask NON
Flags for a2dCanvasObject.
void SetSelect2Stroke(const a2dStroke &stroke)
Set Stroke to use for Selected2 a2dCanvasObject's.
bool ReleaseChildObjects(a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
removes and release only from the childobjects the objects with the given mask
double m_RelativeStartX
The RelativeStart start is used when mesuring using a tool, or from the commandline.
const a2dFill & GetFill() const
get the current fill
const a2dFont * a2dDEFAULT_CANVASFONT
global a2dFont stock object for default font
a2dConnectionGenerator * GetConnectionGenerator() const
Get class for generating new connection objects between object and pins.
a2dStroke & GetSelectStroke()
Get Stroke to use for Selected a2dCanvasObject's.
bool m_doConnect
in case of pins on the object is it currely allowed for other object to connect to it...
void SetStroke(const wxColour &strokecolor, double width=0, a2dStrokeStyle style=a2dSTROKE_SOLID)
Set a stroke for the object which will be used instead of the layer stroke.
void SetOutMapping(wxUint16 layer)
write this layer from the given layer to output files
a2dHandleMouseEvent(a2dIterC *ic, a2dHandle *handle, double x, double y, const wxMouseEvent &event, wxEventType type=wxEVT_CANVASHANDLE_MOUSE_EVENT)
constructor
bool m_subEdit
allow subedit of children within this object
static const a2dCanvasObjectFlagsMask VISIBLE
a2dRestrictionEngine * GetRestrictionEngine()
Get restriction engine (grid snapping)
a2dConnectionGeneratorPtr m_connectionGenerator
generator for new connections
a2dStroke & GetHighLightStroke()
Get Stroke to use for Highlighted a2dCanvasObject's.
static const a2dCanvasObjectFlagsMask SNAP_TO
void SetAberPolyToArc(const a2dDoMu &aber)
Polygon/polyline to Arc Maximum abberation.
bool m_reverse_order
draw document in reverse order if set, used as default value for a2dCanvasDocument.
static const a2dCanvasObjectFlagsMask ChildrenOnSameLayer
a2dDocumentRenderStyle m_documentDrawStyle
draw style to be used for drawing with e.g. a2dDrawingPart.
wire classes for connecting objects.
bool m_HasSelectedObjectsBelow
selected objects detected below
const a2dFont & GetFont() const
get current font active font.
void SetOrder(wxUint16 order)
set drawing order for layer
static a2dPinClass * Standard
Pins of this class can only connect to pins of the same class.
a2dStroke m_Select2Stroke
Stroke to use for selected2 a2dCanvasObject's.
static const a2dCanvasObjectFlagsMask VISIBLECHILDS
static const a2dCanvasObjectFlagsMask NoRenderCanvasObject
void SetFont(const a2dFont &font)
used for to set the font for non Text objects
a2dPathList & GetLayersPathList() const
Path for Icons and small bitmaps.
void SetSmall(const a2dDoMu &smallest)
detection of small object, smaller than this
bool m_editingCopy
true if the object needs to be rendered in edit mode.
bool m_template
GDSII format flag.
holds a list of layers numbers
static const a2dCanvasObjectFlagsMask DoConnect
const a2dError a2dError_NotSpecified
long m_GRID
boolean operation setting
void SetLayerSetup(a2dLayers *layersetup)
set the layersettings for the canvas library.
bool m_a
group A flag (e.g boolean operations)
double GetContourWidthInDataBaseUnits() const
get the Contour width of shapes in the document its units
static const a2dCanvasObjectFlagsMask ignoreSetpending
a2dStroke m_currentstroke
stroke to be set for new objects
initiates Freetype library
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
a2dCanvasObjectMouseEvent(a2dIterC *ic, a2dCanvasObject *object, a2dHit &how, double x, double y, const wxMouseEvent &event)
constructor
wxString GetAsString()
Get all search paths as one string.
double USERUNITS()
how accurate is the drawing
double ENTRYUNITS()
entry of data
void SetGridY(const a2dDoMu &gridY)
grid setting Y
the a2dDrawingPart is a a2dView specially designed for displaying parts of a a2dDrawing. It uses a a2dDrawer2D to actually redraw things from the document, by giving that a2dDrawer2D as drawing context to the document, and telling the document to redraw a certain rectangular area. At that last is what this class is for. It optimizes the areas to be redrawn after object in the document were changed. To do that it combines redraw areas to a minimal set of redrawing areas. All the administration for this and the way things will be redrawn is from this view.
static a2dPinClass * Any
used to ask for a new default pin on an object.
bool m_bin
general flag ( used for temporarely marking object )
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
static const a2dCanvasObjectFlagsMask SNAP
bool m_prerenderaschild
as child this object will be rendered before the parent object itself when true (default) ...
void SetDefaultFill(const a2dFill &fill)
Set Fill to use for non layered a2dCanvasObject's.
a2dFill m_currentfill
fill to be set for new objects
This template class is for property ids with a known data type.
initializes the general module
a2dDoMu m_gridX
canvas default grid in X
static const a2dCanvasObjectFlagsMask ALL
static const a2dCanvasObjectFlagsMask SHOWSHADOW
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
a2dFill & GetSelectFill()
Get Fill to use for Selected a2dCanvasObject's.
static const a2dCanvasObjectFlagsMask EDITABLE
double m_lastY
holds last mouse Y position in world coordinates, as set by tools.
a2dStroke m_DefaultStroke
Stroke to use for non layered a2dCanvasObject's.
static const a2dCanvasObjectFlagsMask HasSelectedObjectsBelow
a2dDoMu m_MARGE
boolean operation setting
static const a2dCanvasObjectFlagsMask ignoreLayer
bool m_ignoreSetpending
ignore this object in a2dCanvasObject::SetPending()
when a new wire or other connection object needs to be created,
Contain one drawing as hierarchical tree of a2dCanvasObject's.
bool m_pushin
is push into allowed
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
bool m_filled
use fill to fill if set
a2dSmrtPtr< a2dLayers > m_layersetup
default setup for layers in a2dCanvasDocument's
static const a2dCanvasObjectFlagsMask SubEdit
const a2dFill * a2dTRANSPARENT_FILL
global a2dFill stock object for TRANSPARENT filling
void SetAberArcToPoly(const a2dDoMu &aber)
Arc to Polygon/polyline Maximum abberation.
static const a2dCanvasObjectFlagsMask PRERENDERASCHILD
general canvas module declarations and classes
bool m_fixedStyle
if set fixed style (stroke and fill )is assumed. Can be used in tools to detect if style should be ch...
class for storing paths and settings, which are used within the artbase module.
bool m_showshadow
show shadow object if true and shadow property is available