23 #if defined(__WXMSW__) && defined(__MEMDEBUG__)
24 #include <wx/msw/msvcrt.h>
33 #include "wx/canvas/canorderdlg.h"
34 #include "wx/editor/cancom.h"
38 #include <wx/numdlg.h>
71 const
a2dCommandId a2dCommand_KeyIoSaveTextAsPolygon::Id( wxT( "KeyIoSaveTextAsPolygon" ) );
73 const
a2dCommandId a2dCommand_ViewAsImage::Id( wxT( "ViewAsImage" ) );
74 const
a2dCommandId a2dCommand_ViewAsSvg::Id( wxT( "ViewAsSvg" ) );
76 const
a2dCommandId a2dCommand_GdsIoSaveFromView::Id( wxT( "GdsIoSaveFromView" ) );
77 const
a2dCommandId a2dCommand_KeyIoSaveFromView::Id( wxT( "KeyIoSaveFromView" ) );
90 DEFINE_MENU_ITEMID_KIND( CmdMenu_GdsIoSaveTextAsPolygon, wxTRANSLATE("Gdsii Save text as Polgyon"), wxTRANSLATE("When possible/implemented, save text as polygon in GdsII format") , wxITEM_CHECK )
91 DEFINE_MENU_ITEMID_KIND( CmdMenu_KeyIoSaveTextAsPolygon, wxTRANSLATE("Key Save text as Polgyon"), wxTRANSLATE("When possible/implemented, save text as polygon in KEY format") , wxITEM_CHECK )
92 DEFINE_MENU_ITEMID_KIND( CmdMenu_SetGdsIoSaveFromView, wxTRANSLATE("Gdsii Save from View down"), wxTRANSLATE("Structure visible and all down will be saved") , wxITEM_CHECK )
93 DEFINE_MENU_ITEMID_KIND( CmdMenu_SetKeyIoSaveFromView, wxTRANSLATE("Key Save from View down"), wxTRANSLATE("Structure visible and all down will be saved") , wxITEM_CHECK )
95 DEFINE_MENU_ITEMID( CmdMenu_SaveLayers, wxTRANSLATE("SaveLayers"), wxTRANSLATE("Save layers to a layer file") )
96 DEFINE_MENU_ITEMID( CmdMenu_SaveLayersHome, wxTRANSLATE("SaveLayers Home"), wxTRANSLATE("Save layers to a layer file") )
97 DEFINE_MENU_ITEMID( CmdMenu_SaveLayersLastDir, wxTRANSLATE("SaveLayers LastDir"), wxTRANSLATE("Save layers to a layer file") )
98 DEFINE_MENU_ITEMID( CmdMenu_SaveLayersCurrentDir, wxTRANSLATE("SaveLayers Current Dir"), wxTRANSLATE("Save layers to a layer file") )
100 DEFINE_MENU_ITEMID( CmdMenu_LoadLayers, wxTRANSLATE("LoadLayers"), wxTRANSLATE("Load layers to a layer file") )
101 DEFINE_MENU_ITEMID( CmdMenu_LoadLayersHome, wxTRANSLATE("LoadLayers Home"), wxTRANSLATE("Load layers to a layer file") )
102 DEFINE_MENU_ITEMID( CmdMenu_LoadLayersLastDir, wxTRANSLATE("LoadLayers LastDir"), wxTRANSLATE("Load layers to a layer file") )
103 DEFINE_MENU_ITEMID( CmdMenu_LoadLayersCurrentDir, wxTRANSLATE("LoadLayers Current Dir"), wxTRANSLATE("Load layers to a layer file") )
105 DEFINE_MENU_ITEMID_KIND( CmdMenu_GdsIoSaveFromView, wxTRANSLATE("Gdsii Save from View down"), wxTRANSLATE("Structure visible and all down will be saved") , wxITEM_CHECK )
106 DEFINE_MENU_ITEMID_KIND( CmdMenu_KeyIoSaveFromView, wxTRANSLATE("Key Save from View down"), wxTRANSLATE("Structure visible and all down will be saved") , wxITEM_CHECK )
107 DEFINE_MENU_ITEMID( CmdMenu_SetLayersProperty, wxTRANSLATE("Set layer property"), wxTRANSLATE("Set property like colour on a layer") )
109 DEFINE_MENU_ITEMID_KIND( CmdMenu_ShowDlgLayers, wxTRANSLATE("&Init Layers Document"), wxTRANSLATE("layer dialog initialized for editing layers document") , wxITEM_CHECK )
110 DEFINE_MENU_ITEMID_KIND( CmdMenu_ShowDlgLayersDocument, wxTRANSLATE("&Init Layers Document"), wxTRANSLATE("layer dialog initialized for editing layers document") , wxITEM_CHECK )
111 DEFINE_MENU_ITEMID_KIND( CmdMenu_ShowDlgLayerOrderDocument, wxTRANSLATE("&Order Layers Document"), wxTRANSLATE("order layer dialog initialized for layers document") , wxITEM_CHECK )
113 DEFINE_MENU_ITEMID_KIND( CmdMenu_ShowDlgStructureDocument, wxTRANSLATE("&Structure Dialog"), wxTRANSLATE("shows structure dialog") , wxITEM_CHECK )
114 DEFINE_MENU_ITEMID_KIND( CmdMenu_ShowDlgStructureDocumentModal, wxTRANSLATE("&Structure Dialog"), wxTRANSLATE("shows structure dialog modal") , wxITEM_CHECK )
116 DEFINE_MENU_ITEMID( CmdMenu_ViewAsImage, wxTRANSLATE("n"), wxTRANSLATE("n") )
117 DEFINE_MENU_ITEMID( CmdMenu_ViewAsImage_Png, wxTRANSLATE("PNG bitmap"), wxTRANSLATE("Save as PNG bitmap file") )
118 DEFINE_MENU_ITEMID( CmdMenu_ViewAsImage_Bmp, wxTRANSLATE("BMP bitmap"), wxTRANSLATE("Save as BMP bitmap file") )
119 DEFINE_MENU_ITEMID( CmdMenu_DocumentAsImage_Png, wxTRANSLATE("Document PNG bitmap"), wxTRANSLATE("Save as PNG bitmap file") )
120 DEFINE_MENU_ITEMID( CmdMenu_DocumentAsImage_Bmp, wxTRANSLATE("Document BMP bitmap"), wxTRANSLATE("Save as BMP bitmap file") )
121 DEFINE_MENU_ITEMID( CmdMenu_DocumentAsOdbXml, wxTRANSLATE("Document As OdbXml"), wxTRANSLATE("Save Document As Odb Xml") )
122 DEFINE_MENU_ITEMID( CmdMenu_ViewAsSvg, wxTRANSLATE("SVG file"), wxTRANSLATE("Save view as SVG file") )
124 DEFINE_MENU_ITEMID( CmdMenu_PushTool_Link, wxTRANSLATE("Insert Link"), wxTRANSLATE("insert
a2dText in dragged rectangle having a link to a file") )
125 DEFINE_MENU_ITEMID( CmdMenu_PushTool_Link_OneShot, wxTRANSLATE("Insert Link"), wxTRANSLATE("insert
a2dText in dragged rectangle having a link to a file") )
126 DEFINE_MENU_ITEMID( CmdMenu_PushTool_FollowLinkDocDrawCam, wxTRANSLATE("Follow Link"), wxTRANSLATE("follow link to a file or drawing or
a2dCameleon") )
127 DEFINE_MENU_ITEMID_KIND( CmdMenu_PushTool_Master3Link, wxTRANSLATE("Edit Master tool and link"), wxTRANSLATE("Edit Master tool and link"), wxITEM_CHECK )
194 EVT_BEGINBUSY( a2dCentralCanvasCommandProcessor::OnBusyBegin )
195 EVT_ENDBUSY( a2dCentralCanvasCommandProcessor::OnBusyEnd )
198 EVT_MENU( CmdMenu_ChangeCentralStyle().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
200 EVT_MENU( CmdMenu_GdsIoSaveTextAsPolygon().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
201 EVT_MENU( CmdMenu_KeyIoSaveTextAsPolygon().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
202 EVT_MENU( CmdMenu_SetGdsIoSaveFromView().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
203 EVT_MENU( CmdMenu_SetKeyIoSaveFromView().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
205 EVT_MENU( CmdMenu_SaveLayers().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
206 EVT_MENU( CmdMenu_SaveLayersHome().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
207 EVT_MENU( CmdMenu_SaveLayersLastDir().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
208 EVT_MENU( CmdMenu_SaveLayersCurrentDir().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
209 EVT_MENU( CmdMenu_LoadLayers().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
210 EVT_MENU( CmdMenu_LoadLayersHome().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
211 EVT_MENU( CmdMenu_LoadLayersLastDir().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
212 EVT_MENU( CmdMenu_LoadLayersCurrentDir().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
214 EVT_MENU( CmdMenu_GdsIoSaveFromView().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
215 EVT_MENU( CmdMenu_KeyIoSaveFromView().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
216 EVT_MENU( CmdMenu_SetLayersProperty().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
218 EVT_UPDATE_UI( CmdMenu_GdsIoSaveTextAsPolygon().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
219 EVT_UPDATE_UI( CmdMenu_KeyIoSaveTextAsPolygon().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
220 EVT_UPDATE_UI( CmdMenu_SetGdsIoSaveFromView().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
221 EVT_UPDATE_UI( CmdMenu_SetKeyIoSaveFromView().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
223 EVT_UPDATE_UI( wxID_UNDO, a2dCentralCanvasCommandProcessor::OnUpdateUndo )
224 EVT_UPDATE_UI( wxID_REDO, a2dCentralCanvasCommandProcessor::OnUpdateRedo )
226 EVT_MENU( CmdMenu_PushTool_RenderImageZoom().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
228 EVT_MENU( CmdMenu_ShowDlgLayers().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
229 EVT_MENU( CmdMenu_ShowDlgLayersDocument().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
230 EVT_MENU( CmdMenu_ShowDlgLayersGlobal().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
231 EVT_MENU( CmdMenu_ShowDlgLayerOrderDocument().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
232 EVT_MENU( CmdMenu_ShowDlgLayerOrderGlobal().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
235 EVT_MENU( CmdMenu_ShowDlgStructureDocument().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
236 EVT_MENU( CmdMenu_ShowDlgStructureDocumentModal().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
237 EVT_UPDATE_UI( CmdMenu_ShowDlgStructureDocument().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
238 EVT_UPDATE_UI( CmdMenu_ShowDlgStructureDocumentModal().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
240 EVT_MENU( CmdMenu_SetFont().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
242 EVT_UPDATE_UI( CmdMenu_ShowDlgLayers().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
243 EVT_UPDATE_UI( CmdMenu_ShowDlgLayersDocument().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
244 EVT_UPDATE_UI( CmdMenu_ShowDlgLayersGlobal().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
245 EVT_UPDATE_UI( CmdMenu_ShowDlgLayerOrderDocument().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
246 EVT_UPDATE_UI( CmdMenu_ShowDlgLayerOrderGlobal().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
249 EVT_UPDATE_UI( CmdMenu_SetLayerDlgModeless().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
251 EVT_MENU( CmdMenu_ViewAsImage().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
252 EVT_MENU( CmdMenu_ViewAsImage_Png().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
253 EVT_MENU( CmdMenu_ViewAsImage_Bmp().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
254 EVT_MENU( CmdMenu_DocumentAsImage_Png().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
255 EVT_MENU( CmdMenu_DocumentAsImage_Bmp().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
256 EVT_MENU( CmdMenu_DocumentAsOdbXml().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
257 EVT_MENU( CmdMenu_ViewAsSvg().GetId(), a2dCentralCanvasCommandProcessor::OnMenu )
259 EVT_MENU( CmdMenu_PushTool_Link_OneShot().GetId() , a2dCentralCanvasCommandProcessor::OnMenu )
260 EVT_MENU( CmdMenu_PushTool_Link().GetId() , a2dCentralCanvasCommandProcessor::OnMenu )
261 EVT_MENU( CmdMenu_PushTool_FollowLinkDocDrawCam().GetId() , a2dCentralCanvasCommandProcessor::OnMenu )
262 EVT_MENU( CmdMenu_PushTool_Master3Link().GetId() , a2dCentralCanvasCommandProcessor::OnMenu )
267 EVT_UPDATE_UI( CmdMenu_ViewAsImage_Png().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
268 EVT_UPDATE_UI( CmdMenu_ViewAsImage_Bmp().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
269 EVT_UPDATE_UI( CmdMenu_DocumentAsImage_Png().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
270 EVT_UPDATE_UI( CmdMenu_DocumentAsImage_Bmp().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
271 EVT_UPDATE_UI( CmdMenu_ViewAsSvg().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
272 EVT_UPDATE_UI( CmdMenu_FileExport().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
273 EVT_UPDATE_UI( CmdMenu_FileImport().GetId(), a2dCentralCanvasCommandProcessor::OnUpdateMenu )
277 a2dCentralCanvasCommandProcessor::a2dCentralCanvasCommandProcessor(
long flags ,
bool initialize,
int maxCommands )
279 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
280 , m_initCurrentSmartPointerOwner(
this )
284 m_layerOrderDlg = NULL;
285 m_structDlgDoc = NULL;
290 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
291 , m_initCurrentSmartPointerOwner( this )
295 m_layerOrderDlg = NULL;
296 m_structDlgDoc = NULL;
304 void a2dCentralCanvasCommandProcessor::UpdateAllViews()
306 a2dDocumentList::iterator iter =
m_docs.begin();
307 while( iter !=
m_docs.end() )
309 a2dDECLARE_LOCAL_ITEM( a2dDocumentList::value_type, doc, *iter );
319 if ( event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED )
326 else if ( event.GetEventType() == wxEVT_UPDATE_UI
332 a2dCanvasCommandProcessor::StaticProcessEvent( (wxUpdateUIEvent&) event );
342 void a2dCentralCanvasCommandProcessor::OnUpdateUndo( wxUpdateUIEvent& event )
361 void a2dCentralCanvasCommandProcessor::OnUpdateRedo( wxUpdateUIEvent& event )
381 void a2dCentralCanvasCommandProcessor::OnPushToolUpdateMenu( wxUpdateUIEvent& event )
393 void a2dCentralCanvasCommandProcessor::OnUpdateMenu( wxUpdateUIEvent& event )
395 if ( event.GetId() == CmdMenu_InsertGroupRef().GetId() )
398 else if ( event.GetId() == CmdMenu_GdsIoSaveTextAsPolygon().GetId() )
400 else if ( event.GetId() == CmdMenu_KeyIoSaveTextAsPolygon().GetId() )
402 else if ( event.GetId() == CmdMenu_SetGdsIoSaveFromView().GetId() )
404 else if ( event.GetId() == CmdMenu_SetKeyIoSaveFromView().GetId() )
406 else if ( event.GetId() == CmdMenu_ShowDlgStructureDocumentModal().GetId() )
408 event.Check( IsShownStructureDlg() );
410 else if ( event.GetId() == CmdMenu_ShowDlgStructure().GetId() )
414 event.GetId() == CmdMenu_FileExport().GetId() ||
415 event.GetId() == CmdMenu_FileImport().GetId() ||
417 event.GetId() == CmdMenu_ViewAsImage_Png().GetId() ||
418 event.GetId() == CmdMenu_ViewAsImage_Bmp().GetId() ||
419 event.GetId() == CmdMenu_DocumentAsImage_Png().GetId() ||
420 #if wxART2D_USE_SVGIO
421 event.GetId() == CmdMenu_ViewAsSvg().GetId() ||
422 #endif // wxART2D_USE_SVGIO
423 event.GetId() == CmdMenu_DocumentAsImage_Bmp().GetId()
426 event.Enable(
false );
435 event.Enable(
true );
447 long style = wxDEFAULT_DIALOG_STYLE;
449 style |= wxSTAY_ON_TOP;
459 if ( !drawer->GetDrawingPart()->
GetDrawing() )
466 if ( event.GetId() == CmdMenu_ChangeCentralStyle().GetId() )
470 else if ( event.GetId() == CmdMenu_SetLayer().GetId() )
473 long w = wxGetNumberFromUser( _(
"Give layer number:" ), _(
"Layer:" ), _(
"layer number" ),
a2dCanvasGlobals->GetHabitat()->
m_layer, 0, wxMAXLAYER );
477 if ( w >= 0 && w < (
long ) wxMAXLAYER )
482 (
void )wxMessageBox( _(
"Layer is not available" ), _(
"Layers" ), wxICON_INFORMATION | wxOK );
485 else if ( event.GetId() == CmdMenu_SetTarget().GetId() )
488 long w = wxGetNumberFromUser( _(
"Give layer number:" ), _(
"Layer:" ), _(
"Set Target Layer" ),
a2dCanvasGlobals->GetHabitat()->
m_target, 0, wxMAXLAYER );
492 if ( w >= 0 && w < (
long ) wxMAXLAYER )
497 (
void )wxMessageBox( _(
"Layer is not available" ), _(
"Layers" ), wxICON_INFORMATION | wxOK );
500 else if ( event.GetId() == CmdMenu_SetNormalizeFactor().GetId() )
506 double norm =
wxGetDoubleNumberFromUser( _(
"Give normalize factor:" ), _(
"Normalize" ), _(
"Normalize factor" ), 1, 0, 10000 );
508 if ( norm != DBL_MAX )
510 if ( norm >= 0 && norm < 10000 )
516 (
void )wxMessageBox( _(
"Normlaize factor must be > 0" ), _(
"Normalize" ), wxICON_INFORMATION | wxOK );
519 else if ( event.GetId() == CmdMenu_GdsIoSaveTextAsPolygon().GetId() )
525 a2dDocumentTemplateList::value_type temp = *iter;
526 if ( temp->IsVisible() && wxT(
"GDS-II" ) == temp->GetDescription() )
528 #if wxART2D_USE_GDSIO
530 #endif //wxART2D_USE_GDSIO
534 else if ( event.GetId() == CmdMenu_KeyIoSaveTextAsPolygon().GetId() )
540 a2dDocumentTemplateList::value_type temp = *iter;
541 if ( temp->IsVisible() && wxT(
"KEY" ) == temp->GetDescription() )
543 #if wxART2D_USE_KEYIO
545 #endif //wxART2D_USE_KEYIO
549 else if ( event.GetId() == CmdMenu_SetGdsIoSaveFromView().GetId() )
556 else if ( event.GetId() == CmdMenu_SetKeyIoSaveFromView().GetId() )
566 else if ( event.GetId() == CmdMenu_SaveLayers().GetId() )
569 wxString file =
AskFile( _(
"Give Name of output Layer file" ),
570 _T(
"@{layerFileApplication}" ),
574 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
575 SaveLayers( wxFileName( file ) );
577 else if ( event.GetId() == CmdMenu_SaveLayersLastDir().GetId() )
580 wxString file =
AskFile( _(
"Give Name of output Layer file" ),
581 _T(
"@{lastLayerFileSavePath}" ),
585 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
586 SaveLayers( wxFileName( file ) );
588 else if ( event.GetId() == CmdMenu_SaveLayersHome().GetId() )
591 wxString file =
AskFile( _(
"Give Name of output Layer file" ),
592 _T(
"@{layerFileSavePath}" ),
596 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
597 SaveLayers( wxFileName( file ) );
599 else if ( event.GetId() == CmdMenu_SaveLayersCurrentDir().GetId() )
602 wxString file =
AskFile( _(
"Give Name of output Layer file" ),
607 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
608 SaveLayers( wxFileName( file ) );
610 else if ( event.GetId() == CmdMenu_LoadLayers().GetId() )
613 wxString file =
AskFile( _(
"Give Name of input Layer file" ),
614 _T(
"@{layerFileApplication}" ),
618 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
619 LoadLayers( wxFileName( file ) );
621 else if ( event.GetId() == CmdMenu_LoadLayersHome().GetId() )
624 wxString file =
AskFile( _(
"Give Name of input Layer file" ),
625 _T(
"@{layerFileSavePath}" ),
629 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
630 LoadLayers( wxFileName( file ) );
632 else if ( event.GetId() == CmdMenu_LoadLayersLastDir().GetId() )
635 wxString file =
AskFile( _(
"Give Name of input Layer file" ),
636 _T(
"@{lastLayerFileSavePath}" ),
640 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
641 LoadLayers( wxFileName( file ) );
643 else if ( event.GetId() == CmdMenu_LoadLayersCurrentDir().GetId() )
646 wxString file =
AskFile( _(
"Give Name of input Layer file" ),
651 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
652 LoadLayers( wxFileName( file ) );
654 else if ( event.GetId() == CmdMenu_SetCursor().GetId() )
658 else if ( event.GetId() == CmdMenu_GdsIoSaveFromView().GetId() )
665 else if ( event.GetId() == CmdMenu_KeyIoSaveFromView().GetId() )
672 else if ( event.GetId() == CmdMenu_SetLayersProperty().GetId() )
680 else if ( event.GetId() == CmdMenu_ShowDlgLayers().GetId() ||
681 event.GetId() == CmdMenu_ShowDlgLayersDrawing().GetId() ||
682 event.GetId() == CmdMenu_ShowDlgLayersDocument().GetId() ||
683 event.GetId() == CmdMenu_ShowDlgLayersGlobal().GetId()
694 if ( !m_layersdlg->IsShown() )
696 m_layersdlg->Show(
true );
697 if ( event.GetId() == CmdMenu_ShowDlgLayersDocument().GetId() )
705 else if ( event.GetId() == CmdMenu_ShowDlgLayersDrawing().GetId() ||
event.GetId() == CmdMenu_ShowDlgLayers().GetId() )
718 m_layersdlg->Show(
false );
721 else if ( event.GetId() == CmdMenu_ShowDlgLayerOrderDocument().GetId() ||
722 event.GetId() == CmdMenu_ShowDlgLayerOrderGlobal().GetId() )
727 if ( !m_layerOrderDlg )
729 m_layerOrderDlg =
new a2dLayerOrderDialog( NULL, NULL, _(
"Layer of Document" ), style | wxRESIZE_BORDER );
732 if ( !m_layerOrderDlg->IsShown() )
734 if ( event.GetId() == CmdMenu_ShowDlgLayerOrderDocument().GetId() )
744 m_layerOrderDlg->Show(
true );
748 m_layerOrderDlg->Show(
false );
751 else if ( event.GetId() == CmdMenu_ViewAsImage_Png().GetId() )
763 wxString file =
AskFile( _(
"Give Name of output PNG file" ),
772 else if ( event.GetId() == CmdMenu_ViewAsImage_Bmp().GetId() )
784 wxString file =
AskFile( _(
"Give Name of output BMP file" ),
793 else if ( event.GetId() == CmdMenu_DocumentAsImage_Png().GetId() )
801 wxString file =
AskFile( _(
"Give Name of output PNG file" ),
810 else if ( event.GetId() == CmdMenu_DocumentAsImage_Bmp().GetId() )
813 wxString file =
AskFile( _(
"Give Name of output BMP file" ),
826 #if wxART2D_USE_SVGIO
827 else if ( event.GetId() == CmdMenu_ViewAsSvg().GetId() )
830 wxString file =
AskFile( _(
"Give Name of output SVG file" ),
838 file( wxFileName( file ) ) );
841 #endif //wxART2D_USE_SVGIO
842 else if ( event.GetId() == CmdMenu_DocumentAsOdbXml().GetId() )
845 wxString file =
AskFile( _(
"Give Name of output ODB file" ),
859 else if ( event.GetId() == CmdMenu_LineBegin().GetId() )
864 if ( !m_librarypoints )
866 wxMessageBox( _(
"point library not loaded" ), _(
"Points" ), wxICON_INFORMATION | wxOK );
872 if ( objects.ShowModal() == wxID_OK )
879 else if ( event.GetId() == CmdMenu_LineEnd().GetId() )
884 if ( !m_librarypoints )
886 wxMessageBox( _(
"point library not loaded" ), _(
"Points" ), wxICON_INFORMATION | wxOK );
892 if ( objects.ShowModal() == wxID_OK )
899 else if ( event.GetId() == CmdMenu_ShowDlgStructureDocument().GetId() )
908 if ( !m_structDlgDoc )
910 m_structDlgDoc =
new a2dCanvasObjectsDocDialog( NULL, doc,
true,
false, ( wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP | wxRESIZE_BORDER ) );
912 if ( m_structDlgDoc->IsShown() )
914 m_structDlgDoc->Show(
false );
918 m_structDlgDoc->Show(
true );
919 m_structDlgDoc->
Init( doc );
922 else if ( event.GetId() == CmdMenu_ShowDlgStructureDocumentModal().GetId() )
930 if ( groups.ShowModal() == wxID_OK )
933 a2dGetCmdh()->
Submit( command );
936 else if ( event.GetId() == CmdMenu_PushTool_Link().GetId() )
947 else if ( event.GetId() == CmdMenu_PushTool_Link_OneShot().GetId() )
959 else if ( event.GetId() == CmdMenu_PushTool_FollowLinkDocDrawCam().GetId() )
970 else if ( event.GetId() == CmdMenu_PushTool_DrawRectangleFast_OneShot().GetId() )
979 else if ( event.GetId() == CmdMenu_PushTool_Master3Link().GetId() )
1031 path.Add( wxT(
"." ) );
1032 wxString fileexp = file;
1033 if ( !path.ExpandPath( fileexp ) )
1038 if ( fileexp.IsEmpty() )
1057 #if wxUSE_STD_IOSTREAM
1058 a2dDocumentFileOutputStream store( fileexp.mb_str(), wxSTD ios_base::out | wxSTD ios_base::binary );
1059 if ( store.fail() || store.bad() )
1065 wxFileOutputStream storeUnbuf( fileName );
1066 if ( storeUnbuf.GetLastError() != wxSTREAM_NO_ERROR )
1071 wxBufferedOutputStream store( storeUnbuf );
1074 if ( ! doc->
SaveObject( store, &imagehout ) )
1082 void a2dCentralCanvasCommandProcessor::FillLibraryPoints()
1084 #if wxART2D_USE_CANEXTOBJ
1091 cire->
SetStroke( wxColour( 1, 3, 205 ), 3.0 );
1095 libobject->
SetStroke( wxColour( 229, 5, 64 ), 0 );
1101 arrow->
SetFill( wxColour( 219, 215, 6 ) );
1102 arrow->
SetStroke( wxColour( 1, 3, 205 ), 1 );
1106 libobject->
SetStroke( wxColour( 229, 5, 64 ), 0 );
1112 arrow2->
SetFill( wxColour( 219, 2, 6 ) );
1113 arrow2->
SetStroke( wxColour( 255, 3, 205 ), 1.0 );
1117 libobject->
SetStroke( wxColour( 229, 5, 64 ), 0 );
1123 arrow3->
SetFill( wxColour( 2, 233, 6 ) );
1124 arrow3->
SetStroke( wxColour( 255, 3, 25 ), 1 );
1128 libobject->
SetStroke( wxColour( 229, 5, 64 ), 0 );
1134 arrow3->
SetFill( wxColour( 2, 233, 6 ) );
1135 arrow3->
SetStroke( wxColour( 255, 3, 25 ), 1 );
1139 libobject->
SetStroke( wxColour( 229, 5, 64 ), 0 );
1155 rec3->
SetFill( wxColour( 0, 120, 240 ) );
1156 rec3->
SetStroke( wxColour( 252, 54, 252 ), 3.0 );
1160 libobject->
SetStroke( wxColour( 229, 5, 64 ), 0 );
1183 void a2dCentralCanvasCommandProcessor::OnChangedDocument(
a2dCommandEvent& event )
1204 bool a2dCentralCanvasCommandProcessor::SaveLayers(
const wxFileName& fileName )
1211 path.Add( wxT(
"." ) );
1212 wxString foundfile = fileName.GetFullPath();
1213 if ( !path.ExpandPath( foundfile ) )
1218 if ( foundfile.IsEmpty() )
1232 bool a2dCentralCanvasCommandProcessor::LoadLayers(
const wxFileName& fileName )
1239 path.Add( wxT(
"." ) );
1240 wxString foundfile = fileName.GetFullPath();
1241 if ( !path.ExpandPath( foundfile ) )
1246 if ( foundfile.IsEmpty() )
1252 #if wxUSE_STD_IOSTREAM
1253 a2dDocumentFileInputStream store( foundfile.mb_str() );
1254 if ( store.fail() || store.bad() )
1260 wxFileInputStream storeUnbuf( foundfile );
1261 if ( !storeUnbuf.Ok() )
1266 wxBufferedInputStream store( storeUnbuf );
1269 #if wxART2D_USE_CVGIO
1277 wxFAIL_MSG( wxT(
"wxART2D_USE_CVGIO is needed to load object from a file CVG file" ) );
1278 #endif //wxART2D_USE_CVGIO
1331 // Submit(new a2dCommand_SetCanvasProperty( canobj, a2dCanvasObject::PROPID_Stroke, GetDrawingCmdProcessor()->GetStroke()->Clone( clone_flat ) ), m_withUndo );
1335 void a2dCentralCanvasCommandProcessor::SetContourWidthInDataBaseUnits( double width )
1337 a2dCanvasDocument* doc = CheckCanvasDocument();
1339 m_currentContourWidth = 0.0;
1340 m_currentContourWidth = width * doc->GetUnitsScale();
1344 double a2dCentralCanvasCommandProcessor::GetContourWidthInDataBaseUnits() const
1346 a2dCanvasDocument* doc = CheckCanvasDocument();
1349 return m_currentContourWidth / doc->GetUnitsScale();
1352 void a2dCentralCanvasCommandProcessor::SetContourWidth( const a2dDoMu& currentContourWidth )
1354 m_currentContourWidth = currentContourWidth;
1394 bool a2dCentralCanvasCommandProcessor::CvgString(
const wxString& cvgString )
1399 wxString cvgStringtoExecute = cvgString;
1401 #if wxART2D_USE_CVGIO
1402 if ( cvgString.Contains( _T(
"<?xml" ) ) && cvgString.Contains( _T(
"<cvg" ) ) && cvgString.Contains( _T(
"</cvg>" ) ) )
1409 cvgStringtoExecute = _T(
"<?xml version=\"1.0\" standalone=\"yes\"?> <cvg classname=\"a2dCanvasDocument\"> " ) + cvgString + _T(
" </cvg>" );
1412 #if wxUSE_STD_IOSTREAM
1417 #endif // wxUSE_UNICODE
1427 #endif //wxART2D_USE_CVGIO
1434 if ( objectname == _T(
"a2dBaseTool" ) )
1446 else if ( objectname == _T(
"a2dToolContr" ) )
1460 else if ( objectname == _T(
"a2dCanvasView" ) )
1474 else if ( objectname == _T(
"a2dCanvasCommandProcessor" ) )
1481 else if ( objectname == _T(
"a2dCentralCanvasCommandProcessor" ) )
1498 if ( objectname == _T(
"a2dBaseTool" ) )
1510 else if ( objectname == _T(
"a2dToolContr" ) )
1524 else if ( objectname == _T(
"a2dCanvasView" ) )
1538 else if ( objectname == _T(
"a2dCanvasCommandProcessor" ) )
1545 else if ( objectname == _T(
"a2dCentralCanvasCommandProcessor" ) )
1556 const wxString& propertyname,
1557 const wxString& value
1747 bool a2dCentralCanvasCommandProcessor::IsShownStructureDlg() {
return m_structDlgDoc != NULL && m_structDlgDoc->IsShown(); }
1749 void a2dCentralCanvasCommandProcessor::DeleteDlgs()
1752 m_layersdlg->Destroy();
1754 if ( m_layerOrderDlg )
1755 m_layerOrderDlg->Destroy();
1757 if ( m_structDlgDoc )
1758 m_structDlgDoc->Destroy();
1761 m_layerOrderDlg = NULL;
1762 m_structDlgDoc = NULL;
1771 bool a2dCentralCanvasCommandProcessor::ShowDlg(
const a2dCommandId* comID,
bool modal,
bool onTop )
1792 void a2dCentralCanvasCommandProcessor::SetBooleanEngineSmoothAber(
const a2dDoMu& aber )
1794 void a2dCentralCanvasCommandProcessor::SetBooleanEngineLinkHoles(
bool doLinkHoles )
1795 {
a2dCanvasGlobals->GetHabitat()->SetBooleanEngineLinkHoles( doLinkHoles ); }
1807 bool a2dCentralCanvasCommandProcessor::GdsIoSaveTextAsPolygon(
bool onOff )
1808 {
return a2dCanvasGlobals->GetHabitat()->GdsIoSaveTextAsPolygon( onOff ); }
1809 bool a2dCentralCanvasCommandProcessor::KeyIoSaveTextAsPolygon(
bool onOff )
1810 {
return a2dCanvasGlobals->GetHabitat()->KeyIoSaveTextAsPolygon( onOff ); }
void SetAllowDoubleClickModifier(bool AllowDoubleClickModifier)
set if double click can be used to switch editingmode using shift key
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
a2dBaseTool * GetActiveTool()
returns the current active tool in the current active view
a2dBoundingBox GetVisibleBbox() const
get visible area as a boundingbox in world coordinates
a2dCircle at x,y, and with radius
wxString AskFile(const wxString &message, const wxString &default_path="", const wxString &default_filename="", const wxString &default_extension="", const wxString &wildcard="*.*", int flags=0, int x=-1, int y=-1)
ask for a file using a file selector.
(In) Visible property that can be added to Docview Objects.
bool GetBooleanEngineLinkHoles() const
boolean engine setting
a2dDoMu m_AberPolyToArc
Polygon/polyline to Arc Maximum abberation.
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
#define EVT_CHANGED_DOCUMENT(func)
event sent to a2dDocumentCommandProcessor when the current document has changed in the a2dDocumentCom...
virtual bool CanUndo() const
Are there commands to undo and can they be undone ?
static void SetAberPolyToArc(double aber)
conversion from polygon/polyline into arc in database units
void SetLayer(wxUint16 layer, bool setStyleOfLayer=false)
a2dCanvasCommandProcessor * GetDrawingCmdProcessor()
get commandprocessor of document
void SetLineEnd(a2dCanvasObject *end)
set current line end object for line and polyline.
bool Zoom(double x1, double y1, double x2, double y2, bool upp)
zoom into this area
View on a a2dCanvasDocument.
a2dCanvasObject * GetCanvasObject()
Pointer to object selected.
const a2dDoMu & GetRadiusMin() const
Polygon/polyline to Arc Minimum radius to test.
void SetBooleanEngineGrid(long grid)
boolean engine setting
const a2dError a2dError_CouldNotEvaluatePath
virtual void SetCurrentView(a2dView *view)
To set the curent view.
a2dCanvasObject * GetRootObject() const
get the root object, which holds the objects in the document
bool Zoom(double x1, double y1, double x2, double y2, bool upp)
Zoom to this rectangle, or Upp at x1, y1.
void OnMenu(wxCommandEvent &event)
All menu's a2dMenuIdItem using can be intercepted here.
bool GetBooleanEngineWindingRule() const
boolean engine setting
void SetBooleanEngineCorrectionFactor(const a2dDoMu &aber)
boolean engine setting
void SetBooleanEngineCorrectionFactor(const a2dDoMu &aber)
boolean engine setting
double wxGetDoubleNumberFromUser(const wxString &message, const wxString &prompt, const wxString &caption, double value=0, double min=0, double max=100, wxWindow *parent=(wxWindow *) NULL, const wxPoint &pos=wxDefaultPosition)
get Double from user
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
void ConnectEvent(wxEventType type, wxEvtHandler *eventSink)
double GetUnitsScale()
this is the number that defines the physical dimension in meters / inch/ etc.
const a2dError a2dError_FileCouldNotOpen
const a2dDoMu & GetBooleanEngineMaxlinemerge() const
boolean engine setting
bool SetPropertyToObject(const wxString &objectname, const wxString &propertyname, const wxString &value=wxT(""))
To set a property by to a certain object.
a2dDoMu m_AberArcToPoly
Arc to Polygon/polyline Maximum abberation.
a command processor specially designed to work with a a2dCanvasDocument
void SetBooleanEngineMaxlinemerge(const a2dDoMu &maxline)
boolean engine setting
bool GetYaxis() const
get y axis orientation
const a2dError a2dError_NoTool
a2dGlobal * a2dGlobals
global a2dCanvasGlobal to have easy access to global settings
a2dDrawing * GetDrawing() const
get the root object, which holds the objects in the document.
bool ProcessEvent(wxEvent &event)
reroutes events to the current active drawingPart when not handled here.
void SetSmall(const a2dDoMu &smallest)
detection of small object, smaller than this
static const a2dCommandId COMID_PushTool_DrawRectangleFast
push this tool on the tools stack
const a2dDocumentTemplateList & GetDocTemplates()
returns a reference to the a2dDocumentTemplateList, which contains all a2dDocumentTemplate's.
void SetBorder(wxUint16 border, bool percentual=true)
leafs a border of this amount of pixels around the drawing
object to show several appearance views on what it contains
a2dCanvasObject is the base class for Canvas Objects.
std::vector< a2dLayerInfoPtr > & GetLayerIndex()
return array index on Layer
a2dCanvasView * CheckDrawer() const
is a view with a2dCanvasView active
a2dCanvasObject * GetCanvasObject()
Pointer to object selected.
wxUint16 m_target
target layer in operations
a2dLayers * GetLayerSetup()
Get the layersettings for the canvas.
a2dLayers * GetLayerSetup()
Get the layersettings for the canvas.
void OnBusyBegin(a2dCommandProcessorEvent &event)
do this at command start
bool SaveLayers(const wxString &filename)
save layer object to CVG file
const a2dDoMu & GetSmall() const
detection of small object, smaller than this
~a2dCentralCanvasCommandProcessor()
destructor
double GetBooleanEngineRoundfactor() const
boolean engine setting
store and convert number to number with unit and visa versa. e.g. 1.23e-6 => 1.23 * 1e-6 ...
a2dDocumentOutputStream & SaveObject(a2dDocumentOutputStream &stream, a2dIOHandlerStrOut *handler)
save as the a2dCanvas specific XML called CVG format
a2dDrawingPart * GetActiveDrawingPart()
return the currently/last active drawing part.
void SetGridY(const a2dDoMu &gridY)
grid setting Y
const a2dError a2dError_CanceledFileDialog
const a2dDoMu & GetRadiusMin() const
Polygon/polyline to Arc Minimum radius to test.
virtual void Update(unsigned int hint=0, wxObject *hintObject=NULL)
force a2dDocumentEvent ::wxEVT_UPDATE_VIEWS event
void SetBooleanEngineDGrid(double dgrid)
boolean engine setting
void SetAberArcToPoly(const a2dDoMu &aber)
Arc to Polygon/polyline Maximum abberation.
bool IsClosed()
A closed flag is set when a view is closed.
const a2dDoMu & GetRadiusMax() const
Polygon/polyline to Arc Maximum radius to test.
const a2dDoMu & GetAberArcToPoly() const
Arc to Polygon/polyline Maximum abberation.
Holds a view on a a2dDocument.
const a2dDoMu & GetBooleanEngineCorrectionAber() const
boolean engine setting
void SetGridX(double gridx)
Set grid distance in X.
wxUint16 m_layer
layer to be set for new objects
void SetBooleanEngineCorrectionAber(const a2dDoMu &aber)
boolean engine setting
void SetBooleanEngineMarge(const a2dDoMu &marge)
boolean engine setting
static const a2dCanvasObjectFlagsMask normalized
a2dText is an abstract base class.
#define EVT_BEGINBUSY(func)
event sent from a2DocumentCommandProcessor when a command submit/execute is starting ...
a2dCanvasDocument * GetCanvasDocument()
return current document in the command processor
void SetYaxis(bool up)
set if the Yaxis goes up or down
Export view as ViewAsSvg.
const a2dError a2dError_SaveFile
void SetRadiusMax(const a2dDoMu &radiusMax)
Polygon/polyline to Arc Maximum radius to test.
double GetUnitsScaleOfDocument()
Get UnitScale of current document if set else returns 1.
virtual void ReportError(const a2dError &error, const wxString &errorstr=wxEmptyString)
concatenate to the the error report the given error.
a2dCanvasDocument * CheckCanvasDocument() const
is a view with a2dCanvasView active and does it have a document
virtual bool ProcessEvent(wxEvent &event)
static void SetAberArcToPoly(double aber)
conversion from arc into lines in database units
void OnBusyEnd(a2dCommandProcessorEvent &event)
do this at command end
One object of this class may be created in an application, to manage all the templates and documents...
void SetCurrentView(a2dView *view)
besides calling the base class, its connect to Current view (active or not) for some events ...
bool SubmitToDrawing(a2dCommand *command, bool storeIt=true)
Submit a command to the active drawing.
virtual bool CanRedo() const
Are there commands to redo and can they be redone ?
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
Drawing context abstraction.
a2dCanvasObject * GetShowObject() const
return pointer of then currently shown object on the drawer.
void SetSpecificFlags(bool setOrClear, a2dCanvasObjectFlagsMask which)
set all bit flags in object that or true in mask to true or false
void SetDlgOrEditModal(bool dlgOrEditModal)
set style dlg as modal
a2dDocument * GetCurrentDocument() const
Get the current Document, which is the document that was last accessed from a view.
void SetActiveDrawingPart(a2dDrawingPart *part)
get the drawing part that has the focus/is active in a window.
void SetTarget(wxUint16 target)
set target layer in operation
wxStringInputStream a2dDocumentStringInputStream
string input stream based wxStreams
bool Load(a2dDocumentStringInputStream &stream, a2dDrawing *doc, a2dCanvasObject *parent)
reading a CVG document and add the contents as children to a given a2dCanvasObject parent...
a2dCentralCanvasCommandProcessor(long flags=a2dDEFAULT_DOCUMENT_FLAGS, bool initialize=true, int maxCommands=-1)
Input and output handler for a2dCanvasDocument to/from a wxImage.
a2dBaseTool * PopTool()
pop a tool from the tool stack of the current active a2dCanvasView
a2dDrawer2D * GetDrawer2D()
get the internal m_drawer2D that is used for rendering the document
void SetBooleanEngineDGrid(double dgrid)
boolean engine setting
contains the layer properties for one layer,
void SetBooleanEngineMaxlinemerge(const a2dDoMu &maxline)
boolean engine setting
void SetNormalizeScale(double scale)
see GetNormalizeScale()
void SetBooleanEngineRoundfactor(double roundfac)
boolean engine setting
bool LoadLayers(a2dDocumentInputStream &stream, a2dLayers *layers)
load a layer definition from a CVG file.
void SetShowObject(a2dCanvasObject *showObject)
document will be rendered as seen from this object, if NULL, the root of the document will be used...
a2dArrow is used for having line begin and ends on specific objects.
void SetAberPolyToArc(const a2dDoMu &aber)
Polygon/polyline to Arc Maximum abberation.
void Refresh()
refresh what is documents and shown on views
Each a2dCommand is given a command id at construction.
void SetBooleanEngineRoundfactor(double roundfac)
boolean engine setting
bool GetBooleanEngineWindingRule() const
boolean engine setting
virtual bool Submit(a2dCommand *command, bool storeIt=true)
next to the base class submit, it sets a2DocumentCommandProcessor for a2dCommand
Master tool for objects graphics slecting and dragging.
a2dView * m_currentView
the current view (active or inactive)
a2dView * GetCurrentView() const
return the one that is active right now (e.g. has focus in case of a wxWindow), or NULL ...
const a2dDoMu & GetBooleanEngineCorrectionAber() const
boolean engine setting
a2dDoMu m_gridY
canvas default grid in Y
bool SetLayerProperty(long layer, const wxString &propertyname, const wxString &value)
set a layer property via command "setlayerproperty"
bool SetShowObject(int index)
set show object using index of child
const a2dDoMu & GetBooleanEngineSmoothAber() const
boolean engine setting
Dialog for displaying/editing layers and properties of layers.
a2dDocumentList m_docs
list of all that are open
a2dWalker based algorithms
a2dCanvasObject * AddCurrent(a2dCanvasObject *objectToAdd, bool withUndo=false, a2dPropertyIdList *setStyles=NULL, a2dCanvasObject *parentObject=NULL)
add the current canvas object to parent as child
All updates of these modes force an update (e.g. update non-pending valid bounding boxes) ...
a2dCommandProcessor * GetCommandProcessor() const
Returns a pointer to the command processor associated with this document.
bool Update()
force an update of information on the currently active view
void SetRadiusMin(const a2dDoMu &radiusMin)
Polygon/polyline to Arc Minimum radius to test.
a2dDocviewGlobal * a2dDocviewGlobals
a global pointer to get to global instance of important classes.
Output driver for KEY files.
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.
const a2dDoMu & GetBooleanEngineCorrectionFactor() const
boolean engine setting
void SetGridY(double gridy)
Set grid distance in Y.
void SetBooleanEngineGrid(long grid)
boolean engine setting
const a2dDoMu & GetAberPolyToArc() const
Polygon/polyline to Arc Maximum abberation.
const a2dDoMu & GetSmall() const
detection of small object, smaller than this
const a2dDoMu & GetBooleanEngineMarge() const
boolean engine setting
bool FileExport(const wxFileName &file=wxFileName(wxT("")), const wxString &description=wxT(""), a2dDocumentFlagMask flags=a2dREFDOC_NON)
Calls a2dDocument::Export for the current document.
void Init(a2dLayers *layersetup)
initialize with this layer setup
const a2dError a2dError_NoView
virtual bool SetOrAddPropertyToObject(a2dObject *propRefObject, const wxString &name, const wxString &value=wxT(""), bool withUndo=true)
set a named property to the given object
a2dCanvasObject * AddCurrent(a2dCanvasObject *objectToAdd, bool withUndo=false, a2dPropertyIdList *setStyles=NULL, a2dCanvasObject *parentObject=NULL)
add the current canvas object to parent as child
void SetBooleanEngineCorrectionAber(const a2dDoMu &aber)
boolean engine setting
void SetBooleanEngineWindingRule(bool rule)
boolean engine setting
a2dLayers * GetLayerSetup()
Get the central layersettings for the canvas library.
Each a2dCanvasView needs to have a a2dCanvasDocument set in order to render data. ...
bool SaveViewAsImage(a2dCanvasDocument *doc, const wxString &file, wxBitmapType type, a2dCanvasObject *from)
Save current view as an image of the given type.
virtual void OnExit()
cleaup modeless dialogs created from here
double GetBooleanEngineDGrid() const
boolean engine setting
void SetAberPolyToArc(const a2dDoMu &aber)
Polygon/polyline to Arc Maximum abberation.
a2dCanvasCommandProcessor * GetCanvasCommandProcessor()
get a pointer to the command processor
void SetBooleanEngineMarge(const a2dDoMu &marge)
boolean engine setting
long GetBooleanEngineGrid() const
boolean engine setting
Output driver for GDSII files.
a2dCanvasObject * SetShowObject(const wxString &name)
set object available in the a2dDrawing to be shown on the drawer
void SetDlgOrEdit(bool dlgOrEdit)
set dlg at Double Left Down if dlgOrEdit == true
const a2dDoMu & GetBooleanEngineCorrectionFactor() const
boolean engine setting
void SetPosXY(double x, double y, bool restrict=false)
set position to x,y
virtual void ReportErrorF(const a2dError &error, const wxChar *Format,...)
concatenate to the the error report the given error.
#define EVT_ENDBUSY(func)
event sent from a2DocumentCommandProcessor when a command submit/execute is ending ...
void SetLineBegin(a2dCanvasObject *begin)
set current line begin object for line and polyline.
const a2dDoMu & GetBooleanEngineSmoothAber() const
boolean engine setting
const a2dDoMu & GetRadiusMax() const
Polygon/polyline to Arc Maximum radius to test.
void SetSmall(const a2dDoMu &smallest)
detection of small object, smaller than this
Event sent to a2dCommandProcessor.
bool m_withUndo
if set, for commands which can undo, will be submitted like that.
const a2dError a2dError_NotSpecified
a2dDocumentCommandProcessor * GetDocviewCommandProcessor() const
Gets a2dDocumentCommandProcessor pointer.
const a2dDoMu & GetBooleanEngineMarge() const
boolean engine setting
void SendToLogTarget()
all stored errors and warning are sent to log target using wxLogError()
void Init(a2dCanvasObjectList *objects)
take over object to show from objects
all polygon and polyline a2dCanvasObject are here.
a2dDrawing * GetDrawing() const
get drawing via top object
wxString GetAsString()
Get all search paths as one string.
#define const_forEachIn(listtype, list)
easy const iteration for a2dlist
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.
Input handler for the CVG format.
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
a2dLibraryReference is a symbol object, it holds a reference
bool GetBooleanEngineLinkHoles() const
boolean engine setting
a command wrapper specially designed to work with wxArt2D docview classes and rest.
double GetBooleanEngineRoundfactor() const
boolean engine setting
long GetBooleanEngineGrid() const
boolean engine setting
virtual void ResetErrors()
reset the error report to empty.
a2dDoMu m_gridX
canvas default grid in X
all headers in the editor module
static const a2dCanvasObjectFlagsMask ALL
void SetBooleanEngineWindingRule(bool rule)
boolean engine setting
const a2dDoMu & GetAberPolyToArc() const
Polygon/polyline to Arc Maximum abberation.
a2dCanvasObject * Find(const wxString &objectname, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *propid=NULL, const wxString &valueAsString=wxT(""), wxUint32 id=0) const
return the object which fits the filter.
int CollectObjects(a2dCanvasObjectList *total, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *id=0, const a2dBoundingBox &bbox=wxNonValidBbox) const
Copy objects with the right conditions to the total list.
const a2dError a2dError_NoController
static void SetCameleonRoot(a2dCanvasObject *cameleonRoot)
set the root where all a2dCameleon's are stored
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
void SetRadiusMin(const a2dDoMu &radiusMin)
Polygon/polyline to Arc Minimum radius to test.
const a2dDoMu & GetAberArcToPoly() const
Arc to Polygon/polyline Maximum abberation.
const a2dDoMu & GetBooleanEngineMaxlinemerge() const
boolean engine setting
double GetBooleanEngineDGrid() const
boolean engine setting
bool DisconnectEvent(wxEventType type, wxEvtHandler *eventSink)
void SetRadiusMax(const a2dDoMu &radiusMax)
Polygon/polyline to Arc Maximum radius to test.
Contain one drawing as hierarchical tree of a2dCanvasObject's.
a2dDocument * m_currentDocument
the current active document
void SetFill(const a2dFill &fill)
Set a fill for the object which will be used instead of the layer fill.
void SetLayerSetup(a2dLayers *layersetup)
set the layersettings for the canvas.
void SetGridX(const a2dDoMu &gridX)
grid setting X
void SetAberArcToPoly(const a2dDoMu &aber)
Arc to Polygon/polyline Maximum abberation.
general canvas module declarations and classes
void SetViewRectangle(double minx, double miny, double maxx, double maxy)
Give the virtual size to be rendered to an image.
a base command for the a2dCommandProcessor