本文整理汇总了C++中kigfx::VIEW类的典型用法代码示例。如果您正苦于以下问题:C++ VIEW类的具体用法?C++ VIEW怎么用?C++ VIEW使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VIEW类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PanControl
int PCBNEW_CONTROL::PanControl( const TOOL_EVENT& aEvent )
{
long type = aEvent.Parameter<long>();
KIGFX::VIEW* view = getView();
GRID_HELPER gridHelper( m_frame );
VECTOR2D center = view->GetCenter();
VECTOR2I gridSize = gridHelper.GetGrid() * 10;
switch( type )
{
case COMMON_ACTIONS::CURSOR_UP:
center -= VECTOR2D( 0, gridSize.y );
break;
case COMMON_ACTIONS::CURSOR_DOWN:
center += VECTOR2D( 0, gridSize.y );
break;
case COMMON_ACTIONS::CURSOR_LEFT:
center -= VECTOR2D( gridSize.x, 0 );
break;
case COMMON_ACTIONS::CURSOR_RIGHT:
center += VECTOR2D( gridSize.x, 0 );
break;
default:
assert( false );
break;
}
view->SetCenter( center );
return 0;
}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:35,代码来源:pcbnew_control.cpp
示例2: ZoomFitScreen
int PCBNEW_CONTROL::ZoomFitScreen( const TOOL_EVENT& aEvent )
{
KIGFX::VIEW* view = getView();
EDA_DRAW_PANEL_GAL* galCanvas = m_frame->GetGalCanvas();
BOARD* board = getModel<BOARD>();
board->ComputeBoundingBox();
BOX2I boardBBox = board->ViewBBox();
VECTOR2D scrollbarSize = VECTOR2D( galCanvas->GetSize() - galCanvas->GetClientSize() );
VECTOR2D screenSize = view->ToWorld( galCanvas->GetClientSize(), false );
if( boardBBox.GetWidth() == 0 || boardBBox.GetHeight() == 0 )
{
// Empty view
view->SetScale( 17.0 ); // works fine for the standard worksheet frame
view->SetCenter( screenSize / 2.0 );
}
else
{
VECTOR2D vsize = boardBBox.GetSize();
double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
fabs( vsize.y / screenSize.y ) );
view->SetScale( scale );
view->SetCenter( boardBBox.Centre() );
}
// Take scrollbars into account
VECTOR2D worldScrollbarSize = view->ToWorld( scrollbarSize, false );
view->SetCenter( view->GetCenter() + worldScrollbarSize / 2.0 );
return 0;
}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:35,代码来源:pcbnew_control.cpp
示例3: ZoomPreset
int PCBNEW_CONTROL::ZoomPreset( const TOOL_EVENT& aEvent )
{
unsigned int idx = aEvent.Parameter<long>();
std::vector<double>& zoomList = m_frame->GetScreen()->m_ZoomList;
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL();
m_frame->SetPresetZoom( idx );
if( idx == 0 ) // Zoom Auto
{
return ZoomFitScreen( aEvent );
}
else if( idx >= zoomList.size() )
{
assert( false );
return 0;
}
double selectedZoom = zoomList[idx];
double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
view->SetScale( 1.0 / ( zoomFactor * selectedZoom ) );
return 0;
}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:25,代码来源:pcbnew_control.cpp
示例4: Process_Special_Functions
/* 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
示例5: TransferDataFromWindow
/*
* Update variables with new options
*/
bool PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow()
{
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) m_frame->GetDisplayOptions();
displ_opts->m_ShowTrackClearanceMode = UTIL::GetValFromConfig(
traceClearanceSelectMap, m_OptDisplayTracksClearance->GetSelection() );
displ_opts->m_DisplayPadIsol = m_OptDisplayPadClearence->GetValue();
displ_opts->m_DisplayPadNum = m_OptDisplayPadNumber->GetValue();
m_frame->SetElementVisibility( LAYER_NO_CONNECTS, m_OptDisplayPadNoConn->GetValue() );
displ_opts->m_DisplayNetNamesMode = m_ShowNetNamesOption->GetSelection();
displ_opts->m_DisplayRatsnestLinesCurved = m_OptDisplayCurvedRatsnestLines->GetValue();
m_galOptsPanel->TransferDataFromWindow();
// Apply changes to the GAL
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
settings->LoadDisplayOptions( displ_opts, m_frame->ShowPageLimits() );
view->RecacheAllItems();
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
m_frame->GetCanvas()->Refresh();
return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:33,代码来源:panel_pcbnew_display_options.cpp
示例6: ZoomCenter
int PCBNEW_CONTROL::ZoomCenter( const TOOL_EVENT& aEvent )
{
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
view->SetCenter( getViewControls()->GetCursorPosition() );
return 0;
}
开发者ID:hermixy,项目名称:kicad-source-mirror,代码行数:7,代码来源:pcbnew_control.cpp
示例7: InvokeDXFDialogBoardImport
bool InvokeDXFDialogBoardImport( PCB_BASE_FRAME* aCaller )
{
DIALOG_DXF_IMPORT dlg( aCaller );
bool success = ( dlg.ShowModal() == wxID_OK );
if( success )
{
const std::list<BOARD_ITEM*>& list = dlg.GetImportedItems();
PICKED_ITEMS_LIST picklist;
BOARD* board = aCaller->GetBoard();
KIGFX::VIEW* view = aCaller->GetGalCanvas()->GetView();
std::list<BOARD_ITEM*>::const_iterator it, itEnd;
for( it = list.begin(), itEnd = list.end(); it != itEnd; ++it )
{
BOARD_ITEM* item = *it;
board->Add( item );
ITEM_PICKER itemWrapper( item, UR_NEW );
picklist.PushItem( itemWrapper );
if( aCaller->IsGalCanvasActive() )
view->Add( item );
}
aCaller->SaveCopyInUndoList( picklist, UR_NEW, wxPoint( 0, 0 ) );
aCaller->OnModify();
}
return success;
}
开发者ID:Caerbannog,项目名称:kicad-git-bzr,代码行数:32,代码来源:dialog_dxf_import.cpp
示例8: OnRenderColorChange
void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
{
wxASSERT( aId > GAL_LAYER_ID_START && aId < GAL_LAYER_ID_END );
myframe->Settings().Colors().SetItemColor( static_cast<GAL_LAYER_ID>( aId ), aColor );
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
if( galCanvas && myframe->IsGalCanvasActive() )
{
if( aId == LAYER_GRID )
galCanvas->GetGAL()->SetGridColor( aColor );
KIGFX::VIEW* view = galCanvas->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); // useful to update rastnest
view->UpdateLayerColor( aId );
// plated-through-holes don't have their own color; they use the background color
if( aId == LAYER_PCB_BACKGROUND )
view->UpdateLayerColor( LAYER_PADS_PLATEDHOLES );
galCanvas->ForceRefresh();
}
myframe->ReCreateHToolbar();
myframe->GetCanvas()->Refresh();
}
开发者ID:johnbeard,项目名称:kicad,代码行数:29,代码来源:pcb_layer_widget.cpp
示例9: OnLayerColorChange
void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
{
// Avoid setting the alpha channel, when we are in legacy mode,
// because in legacy mode the alpha channel is not used, but changing it
// destroys the GAL color setup
if( !myframe->IsGalCanvasActive() )
{
COLOR4D oldColor = myframe->Settings().Colors().GetLayerColor( aLayer );
aColor.a = oldColor.a;
}
myframe->Settings().Colors().SetLayerColor( aLayer, aColor );
if( myframe->IsGalCanvasActive() )
{
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
view->UpdateLayerColor( aLayer );
view->UpdateLayerColor( GetNetnameLayer( aLayer ) );
}
myframe->ReCreateHToolbar();
myframe->GetCanvas()->Refresh();
if( aLayer == LAYER_PCB_BACKGROUND )
myframe->SetDrawBgColor( aColor );
}
开发者ID:johnbeard,项目名称:kicad,代码行数:28,代码来源:pcb_layer_widget.cpp
示例10: InvokeDXFDialogModuleImport
bool InvokeDXFDialogModuleImport( PCB_BASE_FRAME* aCaller, MODULE* aModule )
{
wxASSERT( aModule );
DIALOG_DXF_IMPORT dlg( aCaller );
bool success = ( dlg.ShowModal() == wxID_OK );
if( success )
{
const std::list<BOARD_ITEM*>& list = dlg.GetImportedItems();
KIGFX::VIEW* view = aCaller->GetGalCanvas()->GetView();
aCaller->SaveCopyInUndoList( aModule, UR_MODEDIT );
aCaller->OnModify();
std::list<BOARD_ITEM*>::const_iterator it, itEnd;
for( it = list.begin(), itEnd = list.end(); it != itEnd; ++it )
{
BOARD_ITEM* item = *it;
BOARD_ITEM* converted = NULL;
// Modules use different types for the same things,
// so we need to convert imported items to appropriate classes.
switch( item->Type() )
{
case PCB_LINE_T:
{
converted = new EDGE_MODULE( aModule );
*static_cast<DRAWSEGMENT*>( converted ) = *static_cast<DRAWSEGMENT*>( item );
aModule->Add( converted );
static_cast<EDGE_MODULE*>( converted )->SetLocalCoord();
delete item;
break;
}
case PCB_TEXT_T:
{
converted = new TEXTE_MODULE( aModule );
*static_cast<TEXTE_PCB*>( converted ) = *static_cast<TEXTE_PCB*>( item );
aModule->Add( converted );
static_cast<TEXTE_MODULE*>( converted )->SetLocalCoord();
delete item;
break;
}
default:
wxLogDebug( wxT( "type %d currently not handled" ), item->Type() );
break;
}
if( aCaller->IsGalCanvasActive() && converted )
view->Add( converted );
}
}
return success;
}
开发者ID:Caerbannog,项目名称:kicad-git-bzr,代码行数:57,代码来源:dialog_dxf_import.cpp
示例11: UseGalCanvas
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: OnLayerColorChange
void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, EDA_COLOR_T aColor )
{
myframe->GetBoard()->SetLayerColor( ToLAYER_ID( aLayer ), aColor );
if( myframe->IsGalCanvasActive() )
{
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->GetBoard()->GetColorsSettings() );
view->UpdateLayerColor( aLayer );
}
myframe->GetCanvas()->Refresh();
}
开发者ID:michaellis,项目名称:kicad-source-mirror,代码行数:13,代码来源:class_pcb_layer_widget.cpp
示例13: UseGalCanvas
void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
{
KIGFX::VIEW* view = GetGalCanvas()->GetView();
KIGFX::GAL* gal = GetGalCanvas()->GetGAL();
// Display the same view after canvas switching
if( aEnable )
{
// Switch to GAL renderer from legacy
if( !m_galCanvasActive )
{
// Set up viewport
double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
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( GetScreen()->GetGridSize() ) );
gal->SetGridOrigin( VECTOR2D( GetGridOrigin() ) );
// Transfer EDA_DRAW_PANEL settings
GetGalCanvas()->GetViewControls()->EnableCursorWarping( !m_canvas->GetEnableZoomNoCenter() );
GetGalCanvas()->GetViewControls()->EnableMousewheelPan( m_canvas->GetEnableMousewheelPan() );
GetGalCanvas()->GetViewControls()->EnableAutoPan( m_canvas->GetEnableAutoPan() );
}
else if( m_galCanvasActive )
{
// Switch to legacy renderer from GAL
double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
// TODO replace it with EDA_DRAW_PANEL_GAL::GetLegacyZoom
m_canvas->SetZoom( 1.0 / ( zoomFactor * view->GetScale() ) );
VECTOR2D center = view->GetCenter();
AdjustScrollBars( wxPoint( center.x, center.y ) );
}
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();
SetNoToolSelected();
m_galCanvasActive = aEnable;
}
开发者ID:cpavlina,项目名称:kicad,代码行数:51,代码来源:draw_frame.cpp
示例14: ZoomInOutCenter
int PCBNEW_CONTROL::ZoomInOutCenter( const TOOL_EVENT& aEvent )
{
KIGFX::VIEW* view = getView();
double zoomScale = 1.0;
if( aEvent.IsAction( &COMMON_ACTIONS::zoomInCenter ) )
zoomScale = 1.3;
else if( aEvent.IsAction( &COMMON_ACTIONS::zoomOutCenter ) )
zoomScale = 0.7;
view->SetScale( view->GetScale() * zoomScale );
return 0;
}
开发者ID:PatMart,项目名称:kicad-source-mirror,代码行数:14,代码来源:pcbnew_control.cpp
示例15: ZoomInOut
int PCBNEW_CONTROL::ZoomInOut( const TOOL_EVENT& aEvent )
{
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
double zoomScale = 1.0;
if( aEvent.IsAction( &COMMON_ACTIONS::zoomIn ) )
zoomScale = 1.3;
else if( aEvent.IsAction( &COMMON_ACTIONS::zoomOut ) )
zoomScale = 0.7;
view->SetScale( view->GetScale() * zoomScale, getViewControls()->GetCursorPosition() );
return 0;
}
开发者ID:hermixy,项目名称:kicad-source-mirror,代码行数:14,代码来源:pcbnew_control.cpp
示例16: OnLayerColorChange
void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
{
// NOTE: Active layer in GerbView is stored as 0-indexed, but layer color is
// stored according to the GERBER_DRAW_LAYER() offset.
myframe->SetLayerColor( GERBER_DRAW_LAYER( aLayer ), aColor );
myframe->m_SelLayerBox->ResyncBitmapOnly();
if( myframe->IsGalCanvasActive() )
{
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->m_colorsSettings );
view->UpdateLayerColor( GERBER_DRAW_LAYER( aLayer ) );
}
myframe->GetCanvas()->Refresh();
}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:17,代码来源:gerbview_layer_widget.cpp
示例17: syncLayerVisibilities
void PCB_EDIT_FRAME::syncLayerVisibilities()
{
m_Layers->SyncLayerVisibilities();
KIGFX::VIEW* view = GetGalCanvas()->GetView();
// Load layer & elements visibility settings
for( LAYER_NUM i = 0; i < NB_LAYERS; ++i )
{
view->SetLayerVisible( i, m_Pcb->IsLayerVisible( i ) );
// Synchronize netname layers as well
if( IsCopperLayer( i ) )
view->SetLayerVisible( GetNetnameLayer( i ), m_Pcb->IsLayerVisible( i ) );
}
for( LAYER_NUM i = 0; i < END_PCB_VISIBLE_LIST; ++i )
{
view->SetLayerVisible( ITEM_GAL_LAYER( i ), m_Pcb->IsElementVisible( i ) );
}
// Enable some layers that are GAL specific
view->SetLayerVisible( ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), true );
view->SetLayerVisible( ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), true );
view->SetLayerVisible( ITEM_GAL_LAYER( WORKSHEET ), true );
view->SetLayerVisible( ITEM_GAL_LAYER( GP_OVERLAY ), true );
}
开发者ID:jerkey,项目名称:kicad,代码行数:27,代码来源:pcbframe.cpp
示例18: RestoreCopyFromUndoList
void FOOTPRINT_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
{
if( UndoRedoBlocked() )
return;
if( GetScreen()->GetUndoCommandCount() <= 0 )
return;
// Inform tools that undo command was issued
TOOL_EVENT event( TC_MESSAGE, TA_UNDO_REDO, AS_GLOBAL );
m_toolManager->ProcessEvent( event );
if( UndoRedoBlocked() )
return;
// Save current module state in redo list
PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST();
MODULE* module = GetBoard()->m_Modules.PopFront();
ITEM_PICKER wrapper( module, UR_MODEDIT );
KIGFX::VIEW* view = GetGalCanvas()->GetView();
lastcmd->PushItem( wrapper );
GetScreen()->PushCommandToRedoList( lastcmd );
view->Remove( module );
module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) );
// Retrieve last module state from undo list
lastcmd = GetScreen()->PopCommandFromUndoList();
wrapper = lastcmd->PopItem();
module = (MODULE*) wrapper.GetItem();
delete lastcmd;
if( module )
{
GetBoard()->Add( module, ADD_APPEND );
view->Add( module );
module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) );
module->ViewUpdate();
}
SetCurItem( NULL );
OnModify();
m_canvas->Refresh();
}
开发者ID:RyuKojiro,项目名称:kicad-source-mirror,代码行数:45,代码来源:modedit_undo_redo.cpp
示例19: processChanges
void EDIT_TOOL::processChanges( const PICKED_ITEMS_LIST* aList )
{
KIGFX::VIEW* view = getView();
RN_DATA* ratsnest = getModel<BOARD>()->GetRatsnest();
for( unsigned int i = 0; i < aList->GetCount(); ++i )
{
UNDO_REDO_T operation = aList->GetPickedItemStatus( i );
BOARD_ITEM* updItem = static_cast<BOARD_ITEM*>( aList->GetPickedItem( i ) );
switch( operation )
{
case UR_CHANGED:
ratsnest->Update( updItem );
// fall through
case UR_MODEDIT:
updItem->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
break;
case UR_DELETED:
if( updItem->Type() == PCB_MODULE_T )
static_cast<MODULE*>( updItem )->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove,
view, _1 ) );
view->Remove( updItem );
//ratsnest->Remove( updItem ); // this is done in BOARD::Remove
break;
case UR_NEW:
if( updItem->Type() == PCB_MODULE_T )
static_cast<MODULE*>( updItem )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add,
view, _1 ) );
view->Add( updItem );
//ratsnest->Add( updItem ); // this is done in BOARD::Add
break;
default:
assert( false ); // Not handled
break;
}
}
}
开发者ID:morio,项目名称:kicad,代码行数:44,代码来源:edit_tool.cpp
示例20: setHighContrastLayer
void PCB_EDIT_FRAME::setHighContrastLayer( LAYER_NUM aLayer )
{
// Set display settings for high contrast mode
KIGFX::VIEW* view = GetGalCanvas()->GetView();
KIGFX::RENDER_SETTINGS* rSettings = view->GetPainter()->GetSettings();
setTopLayer( aLayer );
rSettings->ClearActiveLayers();
rSettings->SetActiveLayer( aLayer );
if( IsCopperLayer( aLayer ) )
{
// Bring some other layers to the front in case of copper layers and make them colored
// fixme do not like the idea of storing the list of layers here,
// should be done in some other way I guess..
LAYER_NUM layers[] = {
GetNetnameLayer( aLayer ), ITEM_GAL_LAYER( VIAS_VISIBLE ),
ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ),
ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), NETNAMES_GAL_LAYER( PADS_NETNAMES_VISIBLE ),
ITEM_GAL_LAYER( GP_OVERLAY ), ITEM_GAL_LAYER( RATSNEST_VISIBLE )
};
for( unsigned int i = 0; i < sizeof( layers ) / sizeof( LAYER_NUM ); ++i )
rSettings->SetActiveLayer( layers[i] );
// Pads should be shown too
if( aLayer == FIRST_COPPER_LAYER )
{
rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_BK_VISIBLE ) );
rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ) );
}
else if( aLayer == LAST_COPPER_LAYER )
{
rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_FR_VISIBLE ) );
rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ) );
}
}
view->UpdateAllLayersColor();
}
开发者ID:jerkey,项目名称:kicad,代码行数:41,代码来源:pcbframe.cpp
注:本文中的kigfx::VIEW类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论