本文整理汇总了C++中GetGalCanvas函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGalCanvas函数的具体用法?C++ GetGalCanvas怎么用?C++ GetGalCanvas使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetGalCanvas函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SaveFootprint
void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
if( GetScreen()->IsModify() && GetBoard()->m_Modules )
{
if( !HandleUnsavedChanges( this, _( "Save changes to footprint before closing?" ),
[&]()->bool { return SaveFootprint( GetBoard()->m_Modules ); } ) )
{
Event.Veto();
return;
}
}
GetGalCanvas()->SetEventDispatcher( NULL );
GetGalCanvas()->StopDrawing();
// Do not show the layer manager during closing to avoid flicker
// on some platforms (Windows) that generate useless redraw of items in
// the Layer Manger
m_auimgr.GetPane( "LayersManager" ).Show( false );
Clear_Pcb( false );
//close the editor
Destroy();
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:25,代码来源:footprint_edit_frame.cpp
示例2: GetGalCanvas
void PCB_BASE_FRAME::UseGalCanvas( bool aEnable )
{
EDA_DRAW_FRAME::UseGalCanvas( aEnable );
EDA_DRAW_PANEL_GAL* galCanvas = GetGalCanvas();
if( m_toolManager )
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
if( aEnable )
{
SetBoard( m_Pcb );
if( m_toolManager )
m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );
galCanvas->GetView()->RecacheAllItems();
galCanvas->SetEventDispatcher( m_toolDispatcher );
galCanvas->StartDrawing();
}
else
{
if( m_toolManager )
m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );
// Redirect all events to the legacy canvas
galCanvas->SetEventDispatcher( NULL );
}
}
开发者ID:ejs-ejs,项目名称:kicad-source-mirror,代码行数:30,代码来源:basepcbframe.cpp
示例3: GetGalCanvas
void EDA_DRAW_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
{
GetGalCanvas()->SwitchBackend( aCanvasType );
m_canvasType = GetGalCanvas()->GetBackend();
UseGalCanvas();
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:7,代码来源:eda_draw_frame.cpp
示例4: GetGalCanvas
void PCB_BASE_FRAME::UseGalCanvas()
{
EDA_DRAW_FRAME::UseGalCanvas();
EDA_DRAW_PANEL_GAL* galCanvas = GetGalCanvas();
if( m_toolManager )
{
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
}
SetBoard( m_Pcb );
if( m_toolManager )
m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );
// Transfer latest current display options from legacy to GAL canvas:
auto painter = static_cast<KIGFX::PCB_PAINTER*>( galCanvas->GetView()->GetPainter() );
auto settings = painter->GetSettings();
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
settings->LoadDisplayOptions( displ_opts, ShowPageLimits() );
galCanvas->GetView()->RecacheAllItems();
galCanvas->SetEventDispatcher( m_toolDispatcher );
galCanvas->StartDrawing();
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:27,代码来源:pcb_base_frame.cpp
示例5: GetGalCanvas
void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard )
{
bool new_board = ( aBoard != m_Pcb );
// The active tool might store a reference to the BOARD that is about to be deleted.
if( m_toolManager )
m_toolManager->DeactivateTool();
// It has to be done before the previous board is destroyed by SetBoard()
if( new_board )
GetGalCanvas()->GetView()->Clear();
PCB_BASE_FRAME::SetBoard( aBoard );
GetGalCanvas()->GetGAL()->SetGridOrigin( VECTOR2D( aBoard->GetGridOrigin() ) );
// update the tool manager with the new board and its view.
if( m_toolManager )
{
PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
drawPanel->DisplayBoard( aBoard );
m_toolManager->SetEnvironment( aBoard, drawPanel->GetView(),
drawPanel->GetViewControls(), this );
if( new_board )
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
}
}
开发者ID:nikgul,项目名称:kicad-source-mirror,代码行数:29,代码来源:pcb_base_edit_frame.cpp
示例6: GetGalCanvas
void PL_EDITOR_FRAME::setupTools()
{
// Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( nullptr, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
m_actions = new PL_ACTIONS();
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
GetGalCanvas()->SetEventDispatcher( m_toolDispatcher );
// Register tools
m_toolManager->RegisterTool( new COMMON_TOOLS );
m_toolManager->RegisterTool( new ZOOM_TOOL );
m_toolManager->RegisterTool( new PL_SELECTION_TOOL );
m_toolManager->RegisterTool( new PL_EDITOR_CONTROL );
m_toolManager->RegisterTool( new PL_DRAWING_TOOLS );
m_toolManager->RegisterTool( new PL_EDIT_TOOL );
m_toolManager->RegisterTool( new PL_POINT_EDITOR );
m_toolManager->RegisterTool( new PL_PICKER_TOOL );
m_toolManager->InitTools();
// Run the selection tool, it is supposed to be always active
m_toolManager->InvokeTool( "plEditor.InteractiveSelection" );
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:25,代码来源:pl_editor_frame.cpp
示例7: switch
void PCB_BASE_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
{
bool use_gal = false;
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
switch( aEvent.GetId() )
{
case ID_MENU_CANVAS_LEGACY:
break;
case ID_MENU_CANVAS_CAIRO:
use_gal = GetGalCanvas()->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO );
if( use_gal )
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
break;
case ID_MENU_CANVAS_OPENGL:
use_gal = GetGalCanvas()->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
if( use_gal )
canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
break;
}
SaveCanvasTypeSetting( canvasType );
UseGalCanvas( use_gal );
}
开发者ID:ejs-ejs,项目名称:kicad-source-mirror,代码行数:28,代码来源:basepcbframe.cpp
示例8: GetGalCanvas
void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
{
EDA_DRAW_FRAME::UseGalCanvas( aEnable );
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
ViewReloadBoard( m_Pcb );
}
开发者ID:jerkey,项目名称:kicad,代码行数:9,代码来源:pcbframe.cpp
示例9: SetGridVisibility
void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent )
{
SetGridVisibility( !IsGridVisible() );
if( IsGalCanvasActive() )
{
GetGalCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
GetGalCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
}
m_canvas->Refresh();
}
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:12,代码来源:draw_frame.cpp
示例10: GetGalCanvas
void FOOTPRINT_EDIT_FRAME::SetActiveLayer( LAYER_ID aLayer )
{
PCB_BASE_FRAME::SetActiveLayer( aLayer );
GetGalCanvas()->SetHighContrastLayer( aLayer );
m_Layers->SelectLayer( GetActiveLayer() );
m_Layers->OnLayerSelected();
if( IsGalCanvasActive() )
GetGalCanvas()->Refresh();
}
开发者ID:JOE-JOE-NGIGI,项目名称:kicad,代码行数:12,代码来源:modedit.cpp
示例11: GetGalCanvas
void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
{
KIGFX::VIEW* view = GetGalCanvas()->GetView();
KIGFX::GAL* gal = GetGalCanvas()->GetGAL();
double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
// Display the same view after canvas switching
if( aEnable )
{
BASE_SCREEN* screen = GetScreen();
// Switch to GAL rendering
if( !IsGalCanvasActive() )
{
// Set up viewport
double zoom = 1.0 / ( zoomFactor * m_canvas->GetZoom() );
view->SetScale( zoom );
view->SetCenter( VECTOR2D( m_canvas->GetScreenCenterLogicalPosition() ) );
}
// Set up grid settings
gal->SetGridVisibility( IsGridVisible() );
gal->SetGridSize( VECTOR2D( screen->GetGridSize().x, screen->GetGridSize().y ) );
gal->SetGridOrigin( VECTOR2D( GetGridOrigin() ) );
}
else
{
// Switch to standard rendering
if( IsGalCanvasActive() )
{
// Change view settings only if GAL was active previously
double zoom = 1.0 / ( zoomFactor * view->GetScale() );
m_canvas->SetZoom( zoom );
VECTOR2D center = view->GetCenter();
RedrawScreen( wxPoint( center.x, center.y ), false );
}
}
m_canvas->SetEvtHandlerEnabled( !aEnable );
GetGalCanvas()->SetEvtHandlerEnabled( aEnable );
// Switch panes
m_auimgr.GetPane( wxT( "DrawFrame" ) ).Show( !aEnable );
m_auimgr.GetPane( wxT( "DrawFrameGal" ) ).Show( aEnable );
m_auimgr.Update();
// Reset current tool on switch();
SetToolID( ID_NO_TOOL_SELECTED, wxCURSOR_DEFAULT, wxEmptyString );
m_galCanvasActive = aEnable;
}
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:53,代码来源:draw_frame.cpp
示例12: ViewReloadBoard
void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
{
PCB_BASE_FRAME::SetBoard( aBoard );
if( GetGalCanvas() )
{
ViewReloadBoard( aBoard );
// update the tool manager with the new board and its view.
if( m_toolManager )
m_toolManager->SetEnvironment( aBoard, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );
}
}
开发者ID:jerkey,项目名称:kicad,代码行数:14,代码来源:pcbframe.cpp
示例13: GetGalCanvas
void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
{
m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill;
// Apply new display options to the GAL canvas
KIGFX::PCB_PAINTER* painter =
static_cast<KIGFX::PCB_PAINTER*> ( GetGalCanvas()->GetView()->GetPainter() );
KIGFX::PCB_RENDER_SETTINGS* settings =
static_cast<KIGFX::PCB_RENDER_SETTINGS*> ( painter->GetSettings() );
settings->LoadDisplayOptions( DisplayOpt );
GetGalCanvas()->GetView()->RecacheAllItems( true );
m_canvas->Refresh();
}
开发者ID:jerkey,项目名称:kicad,代码行数:14,代码来源:basepcbframe.cpp
示例14: GetGalCanvas
void PCB_EDIT_FRAME::SetActiveLayer( LAYER_ID aLayer )
{
PCB_BASE_FRAME::SetActiveLayer( aLayer );
GetGalCanvas()->SetHighContrastLayer( aLayer );
syncLayerWidgetLayer();
if( IsGalCanvasActive() )
{
m_toolManager->RunAction( COMMON_ACTIONS::layerChanged ); // notify other tools
GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
GetGalCanvas()->Refresh();
}
}
开发者ID:khaterahmohammadi,项目名称:kicad-source-mirror,代码行数:15,代码来源:pcbframe.cpp
示例15: EDA_DRAW_FRAME
PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* aParent, ID_DRAWFRAME_TYPE aFrameType,
const wxString& aTitle,
const wxPoint& aPos, const wxSize& aSize,
long aStyle, const wxString & aFrameName) :
EDA_DRAW_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName )
{
m_Pcb = NULL;
m_toolManager = NULL;
m_toolDispatcher = NULL;
m_DisplayPadFill = true; // How to draw pads
m_DisplayViaFill = true; // How to draw vias
m_DisplayPadNum = true; // show pads number
m_DisplayModEdge = FILLED; // How to display module drawings (line/ filled / sketch)
m_DisplayModText = FILLED; // How to display module texts (line/ filled / sketch)
m_DisplayPcbTrackFill = true; // false = sketch , true = filled
m_Draw3DFrame = NULL; // Display Window in 3D mode (OpenGL)
m_UserGridSize = wxRealPoint( 100.0, 100.0 );
m_UserGridUnit = INCHES;
m_Collector = new GENERAL_COLLECTOR();
m_FastGrid1 = 0;
m_FastGrid2 = 0;
SetGalCanvas( new EDA_DRAW_PANEL_GAL(
this, -1, wxPoint( 0, 0 ), m_FrameSize,
EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ) );
// Hide by default, it has to be explicitly shown
GetGalCanvas()->Hide();
m_auxiliaryToolBar = NULL;
}
开发者ID:jerkey,项目名称:kicad,代码行数:35,代码来源:basepcbframe.cpp
示例16: _
void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
m_canvas->SetAbortRequest( true );
if( GetScreen()->IsModify() )
{
wxString msg = wxString::Format( _(
"Save the changes in\n"
"'%s'\n"
"before closing?" ),
GetChars( GetBoard()->GetFileName() )
);
int ii = DisplayExitDialog( this, msg );
switch( ii )
{
case wxID_CANCEL:
Event.Veto();
return;
case wxID_NO:
break;
case wxID_YES:
// save the board. if the board has no name,
// the ID_SAVE_BOARD_AS will actually made
Files_io_from_id( ID_SAVE_BOARD );
break;
}
}
GetGalCanvas()->StopDrawing();
// Delete the auto save file if it exists.
wxFileName fn = GetBoard()->GetFileName();
// Auto save file name is the normal file name prefixed with a '$'.
fn.SetName( wxT( "$" ) + fn.GetName() );
// Remove the auto save file on a normal close of Pcbnew.
if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) )
{
wxString msg = wxString::Format( _(
"The auto save file '%s' could not be removed!" ),
GetChars( fn.GetFullPath() )
);
wxMessageBox( msg, Pgm().App().GetAppName(), wxOK | wxICON_ERROR, this );
}
// Delete board structs and undo/redo lists, to avoid crash on exit
// when deleting some structs (mainly in undo/redo lists) too late
Clear_Pcb( false );
// do not show the window because ScreenPcb will be deleted and we do not
// want any paint event
Show( false );
Destroy();
}
开发者ID:khaterahmohammadi,项目名称:kicad-source-mirror,代码行数:60,代码来源:pcbframe.cpp
示例17: Clear_DrawLayers
bool GERBVIEW_FRAME::Clear_DrawLayers( bool query )
{
if( GetGerberLayout() == NULL )
return false;
if( query && GetScreen()->IsModify() )
{
if( !IsOK( this, _( "Current data will be lost?" ) ) )
return false;
}
if( auto canvas = GetGalCanvas() )
{
canvas->GetView()->Clear();
}
GetImagesList()->DeleteAllImages();
GetGerberLayout()->SetBoundingBox( EDA_RECT() );
SetActiveLayer( 0 );
ReFillLayerWidget();
syncLayerBox();
return true;
}
开发者ID:cpavlina,项目名称:kicad,代码行数:25,代码来源:clear_gbr_drawlayers.cpp
示例18: switch
WS_DATA_ITEM* PL_EDITOR_FRAME::AddPageLayoutItem( int aType )
{
WS_DATA_ITEM * item = NULL;
switch( aType )
{
case WS_DATA_ITEM::WS_TEXT:
item = new WS_DATA_ITEM_TEXT( wxT( "Text") );
break;
case WS_DATA_ITEM::WS_SEGMENT:
item = new WS_DATA_ITEM( WS_DATA_ITEM::WS_SEGMENT );
break;
case WS_DATA_ITEM::WS_RECT:
item = new WS_DATA_ITEM( WS_DATA_ITEM::WS_RECT );
break;
case WS_DATA_ITEM::WS_POLYPOLYGON:
item = new WS_DATA_ITEM_POLYGONS();
break;
case WS_DATA_ITEM::WS_BITMAP:
{
wxFileDialog fileDlg( this, _( "Choose Image" ), wxEmptyString, wxEmptyString,
_( "Image Files " ) + wxImage::GetImageExtWildcard(), wxFD_OPEN );
if( fileDlg.ShowModal() != wxID_OK )
return NULL;
wxString fullFilename = fileDlg.GetPath();
if( !wxFileExists( fullFilename ) )
{
wxMessageBox( _( "Couldn't load image from \"%s\"" ), fullFilename );
break;
}
BITMAP_BASE* image = new BITMAP_BASE();
if( !image->ReadImageFile( fullFilename ) )
{
wxMessageBox( _( "Couldn't load image from \"%s\"" ), fullFilename );
delete image;
break;
}
item = new WS_DATA_ITEM_BITMAP( image );
}
break;
}
if( item == NULL )
return NULL;
WS_DATA_MODEL::GetTheInstance().Append( item );
item->SyncDrawItems( nullptr, GetGalCanvas()->GetView() );
return item;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:60,代码来源:pl_editor_frame.cpp
示例19: cmd
/* Handles the selection of tools, menu, and popup menu commands.
*/
void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this );
switch( event.GetId() )
{
case wxID_PREFERENCES:
ShowPreferences( PlEditorHotkeysDescr, PlEditorHotkeysDescr, wxT( "pl_editor" ) );
break;
case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
DisplayHotkeyList( this, PlEditorHotkeysDescr );
break;
case ID_SELECT_PAGE_NUMBER:
{
KIGFX::VIEW* view = GetGalCanvas()->GetView();
view->SetLayerVisible( LAYER_WORKSHEET_PAGE1, m_pageSelectBox->GetSelection() == 0 );
view->SetLayerVisible( LAYER_WORKSHEET_PAGEn, m_pageSelectBox->GetSelection() == 1 );
m_canvas->Refresh();
}
break;
default:
wxMessageBox( wxT( "PL_EDITOR_FRAME::Process_Special_Functions error" ) );
break;
}
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:31,代码来源:pl_editor_frame.cpp
示例20: GetGalCanvas
void FOOTPRINT_EDIT_FRAME::setupTools()
{
PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
// Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetBoard(), drawPanel->GetView(),
drawPanel->GetViewControls(), this );
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
drawPanel->SetEventDispatcher( m_toolDispatcher );
m_toolManager->RegisterTool( new SELECTION_TOOL );
m_toolManager->RegisterTool( new EDIT_TOOL );
m_toolManager->RegisterTool( new DRAWING_TOOL );
m_toolManager->RegisterTool( new POINT_EDITOR );
m_toolManager->RegisterTool( new PCBNEW_CONTROL );
m_toolManager->RegisterTool( new MODULE_TOOLS );
m_toolManager->RegisterTool( new PLACEMENT_TOOL );
m_toolManager->RegisterTool( new PICKER_TOOL );
m_toolManager->GetTool<SELECTION_TOOL>()->EditModules( true );
m_toolManager->GetTool<EDIT_TOOL>()->EditModules( true );
m_toolManager->GetTool<DRAWING_TOOL>()->EditModules( true );
m_toolManager->ResetTools( TOOL_BASE::RUN );
m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
}
开发者ID:flighta-zeng,项目名称:kicad-source-mirror,代码行数:29,代码来源:moduleframe.cpp
注:本文中的GetGalCanvas函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论