KiCad PCB EDA Suite
PCBNEW_CONTROL Class Reference

Class PCBNEW_CONTROL. More...

#include <pcbnew_control.h>

Inheritance diagram for PCBNEW_CONTROL:
TOOL_INTERACTIVE TOOL_BASE

Public Types

enum  RESET_REASON { RUN, MODEL_RELOAD, GAL_SWITCH }
 

Determines the reason of reset for a tool

More...
 

Public Member Functions

 PCBNEW_CONTROL ()
 
 ~PCBNEW_CONTROL ()
 
void Reset (RESET_REASON aReason) override
 Function Reset() Brings the tool to a known, initial state. More...
 
int TrackDisplayMode (const TOOL_EVENT &aEvent)
 
int PadDisplayMode (const TOOL_EVENT &aEvent)
 
int ViaDisplayMode (const TOOL_EVENT &aEvent)
 
int ZoneDisplayMode (const TOOL_EVENT &aEvent)
 
int HighContrastMode (const TOOL_EVENT &aEvent)
 
int HighContrastInc (const TOOL_EVENT &aEvent)
 
int HighContrastDec (const TOOL_EVENT &aEvent)
 
int LayerSwitch (const TOOL_EVENT &aEvent)
 
int LayerNext (const TOOL_EVENT &aEvent)
 
int LayerPrev (const TOOL_EVENT &aEvent)
 
int LayerToggle (const TOOL_EVENT &aEvent)
 
int LayerAlphaInc (const TOOL_EVENT &aEvent)
 
int LayerAlphaDec (const TOOL_EVENT &aEvent)
 
int CursorControl (const TOOL_EVENT &aEvent)
 
int PanControl (const TOOL_EVENT &aEvent)
 
int GridFast1 (const TOOL_EVENT &aEvent)
 
int GridFast2 (const TOOL_EVENT &aEvent)
 
int GridSetOrigin (const TOOL_EVENT &aEvent)
 
int GridResetOrigin (const TOOL_EVENT &aEvent)
 
int ResetCoords (const TOOL_EVENT &aEvent)
 
int SwitchCursor (const TOOL_EVENT &aEvent)
 
int SwitchUnits (const TOOL_EVENT &aEvent)
 
int DeleteItemCursor (const TOOL_EVENT &aEvent)
 
int AppendBoard (const TOOL_EVENT &aEvent)
 
int ShowHelp (const TOOL_EVENT &aEvent)
 
int ToBeDone (const TOOL_EVENT &aEvent)
 
void SetTransitions () override
 

Sets up handlers for various events.

More...
 
void Activate ()
 Function Activate() Runs the tool. More...
 
void SetContextMenu (CONTEXT_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
 Function SetContextMenu() More...
 
void RunMainStack (std::function< void()> aFunc)
 Function RunMainStack() More...
 
template<class T >
void Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Go() More...
 
OPT_TOOL_EVENT Wait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
 Function Wait() More...
 
virtual bool Init ()
 Function Init() Init() is called once upon a registration of the tool. More...
 
TOOL_TYPE GetType () const
 Function GetType() Returns the type of the tool. More...
 
TOOL_ID GetId () const
 Function GetId() Returns the unique identifier of the tool. More...
 
const std::string & GetName () const
 Function GetName() Returns the name of the tool. More...
 
TOOL_MANAGERGetManager () const
 Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool. More...
 
TOOL_SETTINGSGetSettings ()
 

Protected Member Functions

const TOOL_EVENT evActivate (std::string aToolName="")
 functions below are not yet implemented - their interface may change More...
 
const TOOL_EVENT evCommand (int aCommandId=-1)
 
const TOOL_EVENT evCommand (std::string aCommandStr="")
 
const TOOL_EVENT evMotion ()
 
const TOOL_EVENT evClick (int aButton=BUT_ANY)
 
const TOOL_EVENT evDrag (int aButton=BUT_ANY)
 
const TOOL_EVENT evButtonUp (int aButton=BUT_ANY)
 
const TOOL_EVENT evButtonDown (int aButton=BUT_ANY)
 
void attachManager (TOOL_MANAGER *aManager)
 Function attachManager() More...
 
KIGFX::VIEWgetView () const
 Function getView() More...
 
KIGFX::VIEW_CONTROLSgetViewControls () const
 Function getViewControls() More...
 
template<typename T >
T * getEditFrame () const
 Function getEditFrame() More...
 
template<typename T >
T * getModel () const
 Function getModel() More...
 

Protected Attributes

TOOL_TYPE m_type
 

Stores the type of the tool.

More...
 
TOOL_ID m_toolId
 

Unique identifier for the tool, assigned by a TOOL_MANAGER instance.

More...
 
std::string m_toolName
 

Name of the tool.

More...
 
TOOL_MANAGERm_toolMgr
 
TOOL_SETTINGS m_toolSettings
 

Private Member Functions

void updateGrid ()
 

Applies the legacy canvas grid settings for GAL.

More...
 

Private Attributes

PCB_BASE_FRAMEm_frame
 

Pointer to the currently used edit frame.

More...
 
std::unique_ptr< KIGFX::ORIGIN_VIEWITEMm_gridOrigin
 

Grid origin marker.

More...
 

Detailed Description

Class PCBNEW_CONTROL.

Handles actions that are shared between different frames in pcbnew.

Definition at line 42 of file pcbnew_control.h.

Member Enumeration Documentation

enum TOOL_BASE::RESET_REASON
inherited

Determines the reason of reset for a tool

Enumerator
RUN 

Tool is invoked after being inactive.

MODEL_RELOAD 

Model changes (required full reload)

GAL_SWITCH 

Rendering engine changes.

Definition at line 80 of file tool_base.h.

81  {
82  RUN,
83  MODEL_RELOAD,
84  GAL_SWITCH
85  };
Model changes (required full reload)
Definition: tool_base.h:83
Tool is invoked after being inactive.
Definition: tool_base.h:82
Rendering engine changes.
Definition: tool_base.h:84

Constructor & Destructor Documentation

PCBNEW_CONTROL::PCBNEW_CONTROL ( )

Definition at line 229 of file pcbnew_control.cpp.

References m_gridOrigin.

229  :
230  TOOL_INTERACTIVE( "pcbnew.Control" ), m_frame( NULL )
231 {
232  m_gridOrigin.reset( new KIGFX::ORIGIN_VIEWITEM() );
233 }
TOOL_INTERACTIVE(TOOL_ID aId, const std::string &aName)
Constructor.
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_gridOrigin
Grid origin marker.
PCBNEW_CONTROL::~PCBNEW_CONTROL ( )

Definition at line 236 of file pcbnew_control.cpp.

237 {
238 }

Member Function Documentation

void TOOL_INTERACTIVE::Activate ( )
inherited

Function Activate() Runs the tool.

After activation, the tool starts receiving events until it is finished.

Definition at line 49 of file tool_interactive.cpp.

References TOOL_MANAGER::InvokeTool(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.

Referenced by MODULE_EDITOR_TOOLS::CopyItems(), DeleteItemCursor(), PCB_TOOL::doInteractiveItemPlacement(), ROUTER_TOOL::DpDimensionsDialog(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), GridSetOrigin(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), MODULE_EDITOR_TOOLS::PasteItems(), DRAWING_TOOL::PlaceDXF(), PCB_EDITOR_CONTROL::PlaceModule(), MODULE_EDITOR_TOOLS::PlacePad(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), and ROUTER_TOOL::SettingsDialog().

50 {
52 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:215
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID...
int PCBNEW_CONTROL::AppendBoard ( const TOOL_EVENT aEvent)

Definition at line 780 of file pcbnew_control.cpp.

References AskLoadBoardFileName(), BOARD::BuildListOfNets(), NETCLASSES::Clear(), DisplayError(), FLAG0, Format(), BOARD::GetArea(), BOARD::GetAreaCount(), GetChars(), BOARD::GetCopperLayerCount(), PCB_BASE_FRAME::GetDesignSettings(), BOARD::GetEnabledLayers(), EDA_DRAW_FRAME::GetGalCanvas(), DLIST< T >::GetLast(), PCB_BASE_FRAME::GetPageSizeIU(), BOARD::GetRatsnest(), SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), TOOL_BASE::getViewControls(), TOOL_MANAGER::InvokeTool(), PLUGIN::Load(), BOARD::m_Drawings, m_frame, BOARD::m_Modules, BOARD_DESIGN_SETTINGS::m_NetClasses, TOOL_BASE::m_toolMgr, BOARD::m_Track, TRACK::Next(), MODULE::Next(), BOARD_ITEM::Next(), plugin_type(), IO_MGR::PluginFind(), RN_DATA::ProcessBoard(), PCB_EDIT_FRAME::ReCreateLayerBox(), PCB_EDIT_FRAME::ReFillLayerWidget(), TOOL_MANAGER::RunAction(), PCB_ACTIONS::selectionClear, PCB_ACTIONS::selectItem, BOARD::SetCopperLayerCount(), BOARD::SetEnabledLayers(), BOARD::SetVisibleLayers(), BOARD::SynchronizeNetsAndNetClasses(), KIGFX::VIEW_CONTROLS::WarpCursor(), and IO_ERROR::What().

Referenced by SetTransitions().

781 {
782  int open_ctl;
783  wxString fileName;
784 
785  PCB_EDIT_FRAME* editFrame = dynamic_cast<PCB_EDIT_FRAME*>( m_frame );
786 
787  if( !editFrame )
788  return 0;
789 
790  BOARD* board = getModel<BOARD>();
791  BOARD_COMMIT commit( editFrame );
792 
793  // Pick a file to append
794  if( !AskLoadBoardFileName( editFrame, &open_ctl, &fileName, true ) )
795  return 0;
796 
797  IO_MGR::PCB_FILE_T pluginType = plugin_type( fileName, open_ctl );
798  PLUGIN::RELEASER pi( IO_MGR::PluginFind( pluginType ) );
799 
800  // keep track of existing items, in order to know what are the new items
801  // (for undo command for instance)
802 
803  // Tracks are inserted, not appended, so mark the existing tracks to know what are the new tracks
804  // TODO legacy
805  for( TRACK* track = board->m_Track; track; track = track->Next() )
806  track->SetFlags( FLAG0 );
807 
808  // Other items are appended to the item list, so keep trace to the last existing item is enough
809  MODULE* module = board->m_Modules.GetLast();
810  BOARD_ITEM* drawing = board->m_Drawings.GetLast();
811  int zonescount = board->GetAreaCount();
812 
813  // Keep also the count of copper layers, to adjust if necessary
814  int initialCopperLayerCount = board->GetCopperLayerCount();
815  LSET initialEnabledLayers = board->GetEnabledLayers();
816 
817  // Load the data
818  try
819  {
820  PROPERTIES props;
821  char xbuf[30];
822  char ybuf[30];
823 
824  // EAGLE_PLUGIN can use this info to center the BOARD, but it does not yet.
825  sprintf( xbuf, "%d", editFrame->GetPageSizeIU().x );
826  sprintf( ybuf, "%d", editFrame->GetPageSizeIU().y );
827 
828  props["page_width"] = xbuf;
829  props["page_height"] = ybuf;
830 
831  editFrame->GetDesignSettings().m_NetClasses.Clear();
832  pi->Load( fileName, board, &props );
833  }
834  catch( const IO_ERROR& ioe )
835  {
836  wxString msg = wxString::Format( _( "Error loading board.\n%s" ), GetChars( ioe.What() ));
837  DisplayError( editFrame, msg );
838 
839  return 0;
840  }
841 
843 
844  // Process the new items
845  for( TRACK* track = board->m_Track; track; track = track->Next() )
846  {
847  if( track->GetFlags() & FLAG0 )
848  {
849  track->ClearFlags( FLAG0 );
850  continue;
851  }
852 
853  commit.Added( track );
855  }
856 
857  module = module ? module->Next() : board->m_Modules;
858 
859  for( ; module; module = module->Next() )
860  {
861  commit.Added( module );
862  m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, module );
863  }
864 
865  drawing = drawing ? drawing->Next() : board->m_Drawings;
866 
867  for( ; drawing; drawing = drawing->Next() )
868  {
869  commit.Added( drawing );
870  m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, drawing );
871  }
872 
873  for( ZONE_CONTAINER* zone = board->GetArea( zonescount ); zone;
874  zone = board->GetArea( zonescount ) )
875  {
876  ++zonescount;
877  commit.Added( zone );
879  }
880 
881  if( commit.Empty() )
882  return 0;
883 
884  commit.Push( _( "Append a board" ) );
885 
886  // Synchronize layers
887  // we should not ask PLUGINs to do these items:
888  int copperLayerCount = board->GetCopperLayerCount();
889 
890  if( copperLayerCount > initialCopperLayerCount )
891  board->SetCopperLayerCount( copperLayerCount );
892 
893  // Enable all used layers, and make them visible:
894  LSET enabledLayers = board->GetEnabledLayers();
895  enabledLayers |= initialEnabledLayers;
896  board->SetEnabledLayers( enabledLayers );
897  board->SetVisibleLayers( enabledLayers );
898  editFrame->ReCreateLayerBox();
899  editFrame->ReFillLayerWidget();
900  static_cast<PCB_DRAW_PANEL_GAL*>( editFrame->GetGalCanvas() )->SyncLayersVisibility( board );
901 
902  // Ratsnest
903  board->BuildListOfNets();
905  board->GetRatsnest()->ProcessBoard();
906 
907  // Start dragging the appended board
908  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
909  const SELECTION& selection = selectionTool->GetSelection();
910  VECTOR2D v( static_cast<BOARD_ITEM*>( selection.Front() )->GetPosition() );
911  getViewControls()->WarpCursor( v, true, true );
912  m_toolMgr->InvokeTool( "pcbnew.InteractiveEdit" );
913 
914  return 0;
915 }
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:53
void BuildListOfNets()
Definition: class_board.h:764
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:78
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
Class SELECTION_TOOL.
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
MODULE * Next() const
Definition: class_module.h:99
int GetCopperLayerCount() const
Function GetCopperLayerCount.
void SetCopperLayerCount(int aCount)
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
void ReCreateLayerBox(bool aForceResizeToolbar=true)
Re create the layer Box by clearing the old list, and building le new one, from the new layers names ...
Definition: tool_pcb.cpp:709
Class PROPERTIES is a name/value tuple with unique names and optional values.
Definition: properties.h:34
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID...
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
BOARD_ITEM * Next() const
Class RELEASER releases a PLUGIN in the context of a potential thrown exception, through its destruct...
Definition: io_mgr.h:476
void SynchronizeNetsAndNetClasses()
Function SynchronizeNetsAndNetClasses copies NETCLASS info to each NET, based on NET membership in a ...
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false) const =0
Function WarpCursor() If enabled (.
Class LSET is a set of LAYER_IDs.
T * GetLast() const
Function GetLast returns the last T* in the list without removing it, or NULL if the list is empty...
Definition: dlist.h:170
void SetVisibleLayers(LSET aLayerMask)
Function SetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
void ProcessBoard()
Function ProcessBoard() Prepares data for computing (computes a list of current nodes and connections...
SELECTION & GetSelection()
Function GetSelection()
DLIST< BOARD_ITEM > m_Drawings
Definition: class_board.h:242
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1051
#define FLAG0
Pcbnew: flag used in local computations.
Definition: base_struct.h:131
RN_DATA * GetRatsnest() const
Function GetRatsnest() returns list of missing connections between components/tracks.
Definition: class_board.h:287
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:36
bool AskLoadBoardFileName(wxWindow *aParent, int *aCtl, wxString *aFileName, bool aKicadFilesOnly=false)
Function AskLoadBoardFileName puts up a wxFileDialog asking for a BOARD filename to open...
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
TRACK * Next() const
Definition: class_track.h:97
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Clear()
Function Clear destroys any contained NETCLASS instances except the Default one.
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:1022
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
IO_MGR::PCB_FILE_T plugin_type(const wxString &aFileName, int aCtl)
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
DLIST< MODULE > m_Modules
Definition: class_board.h:243
static PLUGIN * PluginFind(PCB_FILE_T aFileType)
Function PluginFind returns a PLUGIN which the caller can use to import, export, save, or load design documents.
Definition: io_mgr.cpp:58
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
Definition: pcb_actions.h:56
const wxSize GetPageSizeIU() const override
Function GetPageSizeIU works off of GetPageSettings() to return the size of the paper page in the int...
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
DLIST< TRACK > m_Track
Definition: class_board.h:244
void ReFillLayerWidget()
Function ReFillLayerWidget changes out all the layers in m_Layers and may be called upon loading a ne...
Definition: pcbframe.cpp:581
PCB_FILE_T
Enum PCB_FILE_T is a set of file types that the IO_MGR knows about, and for which there has been a pl...
Definition: io_mgr.h:51
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
void SetEnabledLayers(LSET aLayerMask)
Function SetEnabledLayers is a proxy function that calls the correspondent function in m_BoardSetting...
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
void TOOL_BASE::attachManager ( TOOL_MANAGER aManager)
protectedinherited

Function attachManager()

Sets the TOOL_MANAGER the tool will belong to. Called by TOOL_MANAGER::RegisterTool()

Definition at line 54 of file tool_base.cpp.

References TOOL_BASE::m_toolMgr, TOOL_BASE::m_toolSettings, and TOOL_BASE::TOOL_SETTINGS.

Referenced by TOOL_MANAGER::RegisterTool().

55 {
56  m_toolMgr = aManager;
57  m_toolSettings = TOOL_SETTINGS( this );
58 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:221
friend class TOOL_SETTINGS
Definition: tool_base.h:160
int PCBNEW_CONTROL::CursorControl ( const TOOL_EVENT aEvent)

Definition at line 485 of file pcbnew_control.cpp.

References GRID_HELPER::Align(), BUT_LEFT, BOX2< Vec >::Contains(), ACTIONS::CURSOR_CLICK, ACTIONS::CURSOR_DBL_CLICK, ACTIONS::CURSOR_DOWN, ACTIONS::CURSOR_FAST_MOVE, ACTIONS::CURSOR_LEFT, ACTIONS::CURSOR_RIGHT, ACTIONS::CURSOR_UP, delta, BOX2< Vec >::GetBottom(), KIGFX::VIEW::GetCenter(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), KIGFX::VIEW::GetGAL(), EDA_DRAW_FRAME::GetGalCanvas(), GRID_HELPER::GetGrid(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), KIGFX::GAL::GetScreenPixelSize(), BOX2< Vec >::GetTop(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), KIGFX::VIEW::IsMirroredX(), KiROUND(), m_frame, TOOL_BASE::m_toolMgr, MD_ALT, MD_CTRL, MD_SHIFT, TOOL_EVENT::Parameter(), TOOL_MANAGER::ProcessEvent(), KIGFX::VIEW::SetCenter(), TOOL_EVENT::SetMousePosition(), TA_MOUSE_CLICK, TA_MOUSE_DBLCLICK, TA_NONE, TC_MOUSE, KIGFX::VIEW::ToScreen(), KIGFX::VIEW::ToWorld(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SetTransitions().

486 {
487  long type = aEvent.Parameter<intptr_t>();
488  bool fastMove = type & PCB_ACTIONS::CURSOR_FAST_MOVE;
489  type &= ~PCB_ACTIONS::CURSOR_FAST_MOVE;
490  bool mirroredX = getView()->IsMirroredX();
491 
492  GRID_HELPER gridHelper( m_frame );
494  VECTOR2I gridSize = gridHelper.GetGrid();
495  VECTOR2D newCursor = gridHelper.Align( cursor );
496 
497  if( fastMove )
498  gridSize = gridSize * 10;
499 
500  switch( type )
501  {
503  newCursor -= VECTOR2D( 0, gridSize.y );
504  break;
505 
507  newCursor += VECTOR2D( 0, gridSize.y );
508  break;
509 
511  newCursor -= VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
512  break;
513 
515  newCursor += VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
516  break;
517 
518  case PCB_ACTIONS::CURSOR_CLICK: // fall through
520  {
521  TOOL_ACTIONS action = TA_NONE;
522  int modifiers = 0;
523 
524  modifiers |= wxGetKeyState( WXK_SHIFT ) ? MD_SHIFT : 0;
525  modifiers |= wxGetKeyState( WXK_CONTROL ) ? MD_CTRL : 0;
526  modifiers |= wxGetKeyState( WXK_ALT ) ? MD_ALT : 0;
527 
528  if( type == PCB_ACTIONS::CURSOR_CLICK )
529  action = TA_MOUSE_CLICK;
530  else if( type == PCB_ACTIONS::CURSOR_DBL_CLICK )
531  action = TA_MOUSE_DBLCLICK;
532  else
533  assert( false );
534 
535  TOOL_EVENT evt( TC_MOUSE, action, BUT_LEFT | modifiers );
536  evt.SetMousePosition( getViewControls()->GetCursorPosition() );
537  m_toolMgr->ProcessEvent( evt );
538 
539  return 0;
540  }
541  break;
542  }
543 
544  // Handler cursor movement
545  KIGFX::VIEW* view = getView();
546  newCursor = view->ToScreen( newCursor );
547  newCursor.x = KiROUND( newCursor.x );
548  newCursor.y = KiROUND( newCursor.y );
549 
550  // Pan the screen if required
551  const VECTOR2I& screenSize = view->GetGAL()->GetScreenPixelSize();
552  BOX2I screenBox( VECTOR2I( 0, 0 ), screenSize );
553 
554  if( !screenBox.Contains( newCursor ) )
555  {
556  VECTOR2D delta( 0, 0 );
557 
558  if( newCursor.x < screenBox.GetLeft() )
559  {
560  delta.x = newCursor.x - screenBox.GetLeft();
561  newCursor.x = screenBox.GetLeft();
562  }
563  else if( newCursor.x > screenBox.GetRight() )
564  {
565  delta.x = newCursor.x - screenBox.GetRight();
566  // -1 is to keep the cursor within the drawing area,
567  // so the cursor coordinates are still updated
568  newCursor.x = screenBox.GetRight() - 1;
569  }
570 
571  if( newCursor.y < screenBox.GetTop() )
572  {
573  delta.y = newCursor.y - screenBox.GetTop();
574  newCursor.y = screenBox.GetTop();
575  }
576  else if( newCursor.y > screenBox.GetBottom() )
577  {
578  delta.y = newCursor.y - screenBox.GetBottom();
579  // -1 is to keep the cursor within the drawing area,
580  // so the cursor coordinates are still updated
581  newCursor.y = screenBox.GetBottom() - 1;
582  }
583 
584  view->SetCenter( view->GetCenter() + view->ToWorld( delta, false ) );
585  }
586 
587  m_frame->GetGalCanvas()->WarpPointer( newCursor.x, newCursor.y );
588 
589  return 0;
590 }
const VECTOR2D & GetCenter() const
Function GetCenter() Returns the center point of this VIEW (in world space coordinates) ...
Definition: view.h:316
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
bool IsMirroredX() const
Function IsMirroredX() Returns true if view is flipped across the X axis.
Definition: view.h:227
TOOL_ACTIONS
Definition: tool_event.h:55
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToWorld() Converts a screen space point/vector to a point/vector in world space coordinates...
Definition: view.cpp:439
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590
static const int delta[8][2]
Definition: solve.cpp:112
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:563
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
virtual VECTOR2D GetCursorPosition() const =0
Function GetCursorPosition() Returns the current cursor position in world coordinates.
GAL * GetGAL() const
Function GetGAL() Returns the GAL this view is using to draw graphical primitives.
Definition: view.h:177
Class TOOL_EVENT.
Definition: tool_event.h:162
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:36
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
const VECTOR2I & GetScreenPixelSize() const
Returns GAL canvas size in pixels.
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:373
Class PCB_ACTIONS.
Definition: pcb_actions.h:42
VECTOR2D ToScreen(const VECTOR2D &aCoord, bool aAbsolute=true) const
Function ToScreen() Converts a world space point/vector to a point/vector in screen space coordinates...
Definition: view.cpp:458
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
void ProcessEvent(const TOOL_EVENT &aEvent)
Propagates an event to tools that requested events of matching type(s).
Class VIEW.
Definition: view.h:58
int PCBNEW_CONTROL::DeleteItemCursor ( const TOOL_EVENT aEvent)

Definition at line 762 of file pcbnew_control.cpp.

References TOOL_INTERACTIVE::Activate(), deleteItem(), TOOL_MANAGER::GetTool(), ID_PCB_DELETE_ITEM_BUTT, m_frame, TOOL_BASE::m_toolMgr, PICKER_TOOL::SetClickHandler(), PICKER_TOOL::SetSnapping(), PCB_BASE_FRAME::SetToolID(), and TOOL_INTERACTIVE::Wait().

Referenced by SetTransitions().

763 {
764  Activate();
765 
767  assert( picker );
768 
769  // TODO it will not check the toolbar button in the module editor, as it uses a different ID..
770  m_frame->SetToolID( ID_PCB_DELETE_ITEM_BUTT, wxCURSOR_PENCIL, _( "Delete item" ) );
771  picker->SetSnapping( false );
772  picker->SetClickHandler( std::bind( deleteItem, m_toolMgr, _1 ) );
773  picker->Activate();
774  Wait();
775 
776  return 0;
777 }
void SetSnapping(bool aEnable)
Function SetSnapping() Sets cursor snapping to grid for the period when the tool is active...
Definition: picker_tool.h:54
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg) override
Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor.
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.
Definition: picker_tool.h:95
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
OPT_TOOL_EVENT Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
Generic tool for picking a point.
Definition: picker_tool.h:35
static bool deleteItem(TOOL_MANAGER *aToolMgr, const VECTOR2D &aPosition)
void Activate()
Function Activate() Runs the tool.
const TOOL_EVENT TOOL_INTERACTIVE::evActivate ( std::string  aToolName = "")
protectedinherited

functions below are not yet implemented - their interface may change

const TOOL_EVENT TOOL_INTERACTIVE::evButtonDown ( int  aButton = BUT_ANY)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evButtonUp ( int  aButton = BUT_ANY)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evClick ( int  aButton = BUT_ANY)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evCommand ( int  aCommandId = -1)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evCommand ( std::string  aCommandStr = "")
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evDrag ( int  aButton = BUT_ANY)
protectedinherited
const TOOL_EVENT TOOL_INTERACTIVE::evMotion ( )
protectedinherited
template<typename T >
T* TOOL_BASE::getEditFrame ( ) const
inlineprotectedinherited

Function getEditFrame()

Returns the application window object, casted to requested user type.

Definition at line 193 of file tool_base.h.

References TOOL_BASE::getEditFrameInt().

Referenced by ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), and TOOL_SETTINGS::getConfigBase().

194  {
195  return static_cast<T*>( getEditFrameInt() );
196  }
T
enum T contains all this lexer's tokens.
wxWindow * getEditFrameInt() const
Definition: tool_base.cpp:42
TOOL_ID TOOL_BASE::GetId ( ) const
inlineinherited

Function GetId() Returns the unique identifier of the tool.

The identifier is set by an instance of TOOL_MANAGER.

Returns
Identifier of the tool.

Definition at line 122 of file tool_base.h.

References TOOL_BASE::m_toolId.

Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::isActive(), TOOL_MANAGER::RegisterTool(), ACTION_MANAGER::RunHotKey(), and TOOL_MANAGER::runTool().

123  {
124  return m_toolId;
125  }
TOOL_ID m_toolId
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:215
TOOL_MANAGER* TOOL_BASE::GetManager ( ) const
inlineinherited

Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.

Returns
Instance of the TOOL_MANAGER. If there is no TOOL_MANAGER associated, it returns NULL.

Definition at line 144 of file tool_base.h.

References TOOL_BASE::m_toolMgr.

Referenced by BOARD_COMMIT::BOARD_COMMIT(), PCB_TOOL::doInteractiveItemPlacement(), CONTEXT_MENU::getToolManager(), EDIT_TOOL::MeasureTool(), CONTEXT_MENU::onMenuEvent(), and ZONE_CREATE_HELPER::performZoneCutout().

145  {
146  return m_toolMgr;
147  }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
template<typename T >
T* TOOL_BASE::getModel ( ) const
inlineprotectedinherited

Function getModel()

Returns the model object if it matches the requested type.

Definition at line 204 of file tool_base.h.

References TOOL_BASE::getModelInt().

Referenced by ZONE_CREATE_HELPER::createNewZone(), ZONE_CREATE_HELPER::createZoneFromExisting(), and ZONE_CREATE_HELPER::performZoneCutout().

205  {
206  EDA_ITEM* m = getModelInt();
207 
208  return static_cast<T*>( m );
209  }
T
enum T contains all this lexer's tokens.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
EDA_ITEM * getModelInt() const
Definition: tool_base.cpp:48
const std::string& TOOL_BASE::GetName ( void  ) const
inlineinherited

Function GetName() Returns the name of the tool.

Tool names are expected to obey the format: application.ToolName (eg. pcbnew.InteractiveSelection).

Returns
The name of the tool.

Definition at line 133 of file tool_base.h.

References TOOL_BASE::m_toolName.

Referenced by TOOL_SETTINGS::getKeyName(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::invokeTool(), and TOOL_MANAGER::RegisterTool().

134  {
135  return m_toolName;
136  }
std::string m_toolName
Name of the tool.
Definition: tool_base.h:219
TOOL_SETTINGS & TOOL_BASE::GetSettings ( )
inherited

Definition at line 72 of file tool_base.cpp.

References TOOL_BASE::m_toolSettings.

Referenced by ROUTER_TOOL::Init(), SELECTION_TOOL::selectable(), and ROUTER_TOOL::~ROUTER_TOOL().

73 {
74  return m_toolSettings;
75 }
TOOL_SETTINGS m_toolSettings
Definition: tool_base.h:221
TOOL_TYPE TOOL_BASE::GetType ( ) const
inlineinherited

Function GetType() Returns the type of the tool.

Returns
The type of the tool.

Definition at line 111 of file tool_base.h.

References TOOL_BASE::m_type.

Referenced by TOOL_MANAGER::InvokeTool(), and TOOL_MANAGER::runTool().

112  {
113  return m_type;
114  }
TOOL_TYPE m_type
Stores the type of the tool.
Definition: tool_base.h:212
KIGFX::VIEW * TOOL_BASE::getView ( ) const
protectedinherited

Function getView()

Returns the instance of VIEW object used in the application. It allows tools to draw.

Returns
The instance of VIEW.

Definition at line 30 of file tool_base.cpp.

References TOOL_MANAGER::GetView(), and TOOL_BASE::m_toolMgr.

Referenced by PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), CursorControl(), SELECTION_TOOL::disambiguationMenu(), PCB_TOOL::doInteractiveItemPlacement(), MICROWAVE_TOOL::drawMicrowaveInductor(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), SELECTION_TOOL::findCallback(), ROUTER_TOOL::getStartLayer(), GridSetOrigin(), HighContrastMode(), PNS::TOOL_BASE::highlightNet(), PCB_EDITOR_CONTROL::HighlightNet(), LayerAlphaDec(), LayerAlphaInc(), EDIT_TOOL::Main(), EDIT_TOOL::MeasureTool(), MODULE_EDITOR_TOOLS::ModuleEdgeOutlines(), MODULE_EDITOR_TOOLS::ModuleTextOutlines(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), PadDisplayMode(), PanControl(), PNS::TOOL_BASE::pickSingleItem(), PCB_EDITOR_CONTROL::PlaceModule(), PCB_EDITOR_CONTROL::PlaceTarget(), PCB_EDITOR_CONTROL::Reset(), Reset(), MODULE_EDITOR_TOOLS::Reset(), PNS::TOOL_BASE::Reset(), DRAWING_TOOL::Reset(), SELECTION_TOOL::Reset(), SELECTION_TOOL::selectable(), SELECTION_TOOL::selectionContains(), SELECTION_TOOL::selectMultiple(), ZOOM_TOOL::selectRegion(), TrackDisplayMode(), POINT_EDITOR::updateEditedPoint(), PNS::TOOL_BASE::updateEndItem(), COMMON_TOOLS::updateGrid(), updateGrid(), POINT_EDITOR::updatePoints(), PNS::TOOL_BASE::updateStartItem(), ViaDisplayMode(), PCB_TOOL::view(), ZoneDisplayMode(), PCB_EDITOR_CONTROL::ZoneFill(), PCB_EDITOR_CONTROL::ZoneFillAll(), PCB_EDITOR_CONTROL::ZoneUnfill(), PCB_EDITOR_CONTROL::ZoneUnfillAll(), COMMON_TOOLS::ZoomFitScreen(), SELECTION_TOOL::zoomFitSelection(), COMMON_TOOLS::ZoomInOutCenter(), and SELECTION_TOOL::~SELECTION_TOOL().

31 {
32  return m_toolMgr->GetView();
33 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:243
KIGFX::VIEW_CONTROLS * TOOL_BASE::getViewControls ( ) const
protectedinherited
template<class T >
void TOOL_INTERACTIVE::Go ( int(T::*)(const TOOL_EVENT &)  aStateFunc,
const TOOL_EVENT_LIST aConditions = TOOL_EVENTTC_ANYTA_ANY ) 
)
inherited

Function Go()

Defines which state (aStateFunc) to go when a certain event arrives (aConditions). No conditions means any event.

Definition at line 122 of file tool_interactive.h.

References TOOL_INTERACTIVE::goInternal().

Referenced by LENGTH_TUNER_TOOL::Reset(), ZOOM_TOOL::SetTransitions(), LENGTH_TUNER_TOOL::SetTransitions(), ROUTER_TOOL::SetTransitions(), PAD_TOOL::SetTransitions(), MICROWAVE_TOOL::SetTransitions(), POINT_EDITOR::SetTransitions(), COMMON_TOOLS::SetTransitions(), PLACEMENT_TOOL::SetTransitions(), SetTransitions(), MODULE_EDITOR_TOOLS::SetTransitions(), PICKER_TOOL::SetTransitions(), PCB_EDITOR_CONTROL::SetTransitions(), SELECTION_TOOL::SetTransitions(), EDIT_TOOL::SetTransitions(), and DRAWING_TOOL::SetTransitions().

124 {
125  TOOL_STATE_FUNC sptr = std::bind( aStateFunc, static_cast<T*>( this ), std::placeholders::_1 );
126 
127  goInternal( sptr, aConditions );
128 }
std::function< int(const TOOL_EVENT &)> TOOL_STATE_FUNC
Definition: tool_base.h:59
void goInternal(TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions)
int PCBNEW_CONTROL::GridFast1 ( const TOOL_EVENT aEvent)

Definition at line 632 of file pcbnew_control.cpp.

References m_frame, PCB_BASE_FRAME::SetFastGrid1(), and updateGrid().

Referenced by SetTransitions().

633 {
635  updateGrid();
636 
637  return 0;
638 }
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
void SetFastGrid1()
Function SetFastGrid1()
void updateGrid()
Applies the legacy canvas grid settings for GAL.
int PCBNEW_CONTROL::GridFast2 ( const TOOL_EVENT aEvent)

Definition at line 641 of file pcbnew_control.cpp.

References m_frame, PCB_BASE_FRAME::SetFastGrid2(), and updateGrid().

Referenced by SetTransitions().

642 {
644  updateGrid();
645 
646  return 0;
647 }
void SetFastGrid2()
Function SetFastGrid2()
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
void updateGrid()
Applies the legacy canvas grid settings for GAL.
int PCBNEW_CONTROL::GridResetOrigin ( const TOOL_EVENT aEvent)

Definition at line 689 of file pcbnew_control.cpp.

References m_gridOrigin.

Referenced by SetTransitions().

690 {
691  getModel<BOARD>()->SetGridOrigin( wxPoint( 0, 0 ) );
692  m_gridOrigin->SetPosition( VECTOR2D( 0, 0 ) );
693 
694  return 0;
695 }
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_gridOrigin
Grid origin marker.
int PCBNEW_CONTROL::GridSetOrigin ( const TOOL_EVENT aEvent)

Definition at line 662 of file pcbnew_control.cpp.

References TOOL_INTERACTIVE::Activate(), TOOL_MANAGER::GetTool(), TOOL_BASE::getView(), ID_PCB_PLACE_GRID_COORD_BUTT, m_frame, m_gridOrigin, TOOL_BASE::m_toolMgr, TOOL_EVENT::Parameter(), PICKER_TOOL::SetClickHandler(), setOrigin(), PCB_BASE_FRAME::SetToolID(), and TOOL_INTERACTIVE::Wait().

Referenced by SetTransitions().

663 {
664  VECTOR2D* origin = aEvent.Parameter<VECTOR2D*>();
665 
666  if( origin )
667  {
668  setOrigin( getView(), m_frame, m_gridOrigin.get(), *origin );
669  delete origin;
670  }
671  else
672  {
673  Activate();
674 
676  assert( picker );
677 
678  // TODO it will not check the toolbar button in module editor, as it uses a different ID..
679  m_frame->SetToolID( ID_PCB_PLACE_GRID_COORD_BUTT, wxCURSOR_PENCIL, _( "Adjust grid origin" ) );
680  picker->SetClickHandler( std::bind( setOrigin, getView(), m_frame, m_gridOrigin.get(), _1 ) );
681  picker->Activate();
682  Wait();
683  }
684 
685  return 0;
686 }
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg) override
Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor.
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.
Definition: picker_tool.h:95
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
OPT_TOOL_EVENT Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
static bool setOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, KIGFX::ORIGIN_VIEWITEM *aItem, const VECTOR2D &aPoint)
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
Generic tool for picking a point.
Definition: picker_tool.h:35
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_gridOrigin
Grid origin marker.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:373
void Activate()
Function Activate() Runs the tool.
int PCBNEW_CONTROL::HighContrastDec ( const TOOL_EVENT aEvent)

Definition at line 369 of file pcbnew_control.cpp.

Referenced by SetTransitions().

370 {
371  return 0;
372 }
int PCBNEW_CONTROL::HighContrastInc ( const TOOL_EVENT aEvent)

Definition at line 363 of file pcbnew_control.cpp.

Referenced by SetTransitions().

364 {
365  return 0;
366 }
int PCBNEW_CONTROL::HighContrastMode ( const TOOL_EVENT aEvent)

Definition at line 349 of file pcbnew_control.cpp.

References PCB_BASE_FRAME::GetActiveLayer(), PCB_BASE_FRAME::GetDisplayOptions(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), TOOL_BASE::getView(), DISPLAY_OPTIONS::m_ContrastModeDisplay, m_frame, and EDA_DRAW_PANEL_GAL::SetHighContrastLayer().

Referenced by SetTransitions().

350 {
351  auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
352  auto settings = painter->GetSettings();
354 
355  displ_opts->m_ContrastModeDisplay = !displ_opts->m_ContrastModeDisplay;
356  settings->LoadDisplayOptions( displ_opts );
358 
359  return 0;
360 }
virtual void SetHighContrastLayer(int aLayer)
Function SetHighContrastLayer Takes care of display settings for the given layer to be displayed in h...
virtual LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:163
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
Definition: pcb_painter.h:175
bool m_ContrastModeDisplay
Definition: pcbstruct.h:85
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
virtual bool TOOL_BASE::Init ( )
inlinevirtualinherited

Function Init() Init() is called once upon a registration of the tool.

Returns
True if the initialization went fine, false - otherwise.

Reimplemented in SELECTION_TOOL, DRAWING_TOOL, EDIT_TOOL, PCB_EDITOR_CONTROL, POINT_EDITOR, MICROWAVE_TOOL, PAD_TOOL, PLACEMENT_TOOL, and ROUTER_TOOL.

Definition at line 93 of file tool_base.h.

Referenced by TOOL_MANAGER::InitTools().

94  {
95  return true;
96  }
int PCBNEW_CONTROL::LayerAlphaDec ( const TOOL_EVENT aEvent)

Definition at line 465 of file pcbnew_control.cpp.

References KIGFX::COLOR4D::a, PCB_BASE_FRAME::GetActiveLayer(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), EDA_DRAW_PANEL_GAL::GetView(), TOOL_BASE::getView(), m_frame, and KIGFX::VIEW::UpdateLayerColor().

Referenced by SetTransitions().

466 {
467  auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
468  auto settings = painter->GetSettings();
469 
470  LAYER_NUM currentLayer = m_frame->GetActiveLayer();
471  KIGFX::COLOR4D currentColor = settings->GetLayerColor( currentLayer );
472 
473  if( currentColor.a >= 0.05 )
474  {
475  currentColor.a -= 0.05;
476  settings->SetLayerColor( currentLayer, currentColor );
477  m_frame->GetGalCanvas()->GetView()->UpdateLayerColor( currentLayer );
478  }
479 
480  return 0;
481 }
virtual LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:163
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
double a
Alpha component.
Definition: color4d.h:284
virtual PCB_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
Definition: pcb_painter.h:175
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
void UpdateLayerColor(int aLayer)
Function UpdateLayerColor() Applies the new coloring scheme held by RENDER_SETTINGS in case that it h...
Definition: view.cpp:655
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
int PCBNEW_CONTROL::LayerAlphaInc ( const TOOL_EVENT aEvent)

Definition at line 446 of file pcbnew_control.cpp.

References KIGFX::COLOR4D::a, PCB_BASE_FRAME::GetActiveLayer(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), EDA_DRAW_PANEL_GAL::GetView(), TOOL_BASE::getView(), m_frame, and KIGFX::VIEW::UpdateLayerColor().

Referenced by SetTransitions().

447 {
448  auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
449  auto settings = painter->GetSettings();
450 
451  LAYER_NUM currentLayer = m_frame->GetActiveLayer();
452  KIGFX::COLOR4D currentColor = settings->GetLayerColor( currentLayer );
453 
454  if( currentColor.a <= 0.95 )
455  {
456  currentColor.a += 0.05;
457  settings->SetLayerColor( currentLayer, currentColor );
458  m_frame->GetGalCanvas()->GetView()->UpdateLayerColor( currentLayer );
459  }
460 
461  return 0;
462 }
virtual LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:163
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
double a
Alpha component.
Definition: color4d.h:284
virtual PCB_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
Definition: pcb_painter.h:175
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
void UpdateLayerColor(int aLayer)
Function UpdateLayerColor() Applies the new coloring scheme held by RENDER_SETTINGS in case that it h...
Definition: view.cpp:655
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
int PCBNEW_CONTROL::LayerNext ( const TOOL_EVENT aEvent)

Definition at line 384 of file pcbnew_control.cpp.

References B_Cu, F_Cu, PCB_BASE_FRAME::GetActiveLayer(), IsCopperLayer(), m_frame, PCB_BASE_FRAME::SwitchLayer(), and ToLAYER_ID().

Referenced by SetTransitions().

385 {
386  PCB_BASE_FRAME* editFrame = m_frame;
387  LAYER_NUM layer = editFrame->GetActiveLayer();
388 
389  if( layer < F_Cu || layer > B_Cu )
390  return 0;
391 
392  int layerCount = getModel<BOARD>()->GetCopperLayerCount();
393 
394  if( layer == layerCount - 2 || layerCount < 2 )
395  layer = B_Cu;
396  else if( layer == B_Cu )
397  layer = F_Cu;
398  else
399  ++layer;
400 
401  assert( IsCopperLayer( layer ) );
402  editFrame->SwitchLayer( NULL, ToLAYER_ID( layer ) );
403 
404  return 0;
405 }
virtual LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual void SwitchLayer(wxDC *DC, LAYER_ID layer)
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:766
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
int PCBNEW_CONTROL::LayerPrev ( const TOOL_EVENT aEvent)

Definition at line 408 of file pcbnew_control.cpp.

References B_Cu, F_Cu, PCB_BASE_FRAME::GetActiveLayer(), IsCopperLayer(), m_frame, PCB_BASE_FRAME::SwitchLayer(), and ToLAYER_ID().

Referenced by SetTransitions().

409 {
410  PCB_BASE_FRAME* editFrame = m_frame;
411  LAYER_NUM layer = editFrame->GetActiveLayer();
412 
413  if( layer < F_Cu || layer > B_Cu )
414  return 0;
415 
416  int layerCount = getModel<BOARD>()->GetCopperLayerCount();
417 
418  if( layer == F_Cu || layerCount < 2 )
419  layer = B_Cu;
420  else if( layer == B_Cu )
421  layer = layerCount - 2;
422  else
423  --layer;
424 
425  assert( IsCopperLayer( layer ) );
426  editFrame->SwitchLayer( NULL, ToLAYER_ID( layer ) );
427 
428  return 0;
429 }
virtual LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual void SwitchLayer(wxDC *DC, LAYER_ID layer)
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:766
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
int PCBNEW_CONTROL::LayerSwitch ( const TOOL_EVENT aEvent)

Definition at line 376 of file pcbnew_control.cpp.

References m_frame, TOOL_EVENT::Parameter(), and PCB_BASE_FRAME::SwitchLayer().

Referenced by SetTransitions().

377 {
378  m_frame->SwitchLayer( NULL, (LAYER_ID) aEvent.Parameter<intptr_t>() );
379 
380  return 0;
381 }
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual void SwitchLayer(wxDC *DC, LAYER_ID layer)
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:373
LAYER_ID
Enum LAYER_ID is the set of PCB layers.
int PCBNEW_CONTROL::LayerToggle ( const TOOL_EVENT aEvent)

Definition at line 432 of file pcbnew_control.cpp.

References PCB_BASE_FRAME::GetActiveLayer(), PCB_BASE_FRAME::GetScreen(), m_frame, PCB_SCREEN::m_Route_Layer_BOTTOM, PCB_SCREEN::m_Route_Layer_TOP, and PCB_BASE_FRAME::SwitchLayer().

Referenced by SetTransitions().

433 {
434  LAYER_NUM currentLayer = m_frame->GetActiveLayer();
435  PCB_SCREEN* screen = m_frame->GetScreen();
436 
437  if( currentLayer == screen->m_Route_Layer_TOP )
438  m_frame->SwitchLayer( NULL, screen->m_Route_Layer_BOTTOM );
439  else
440  m_frame->SwitchLayer( NULL, screen->m_Route_Layer_TOP );
441 
442  return 0;
443 }
virtual LAYER_ID GetActiveLayer() const
Function GetActiveLayer returns the active layer.
LAYER_ID m_Route_Layer_BOTTOM
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual void SwitchLayer(wxDC *DC, LAYER_ID layer)
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
LAYER_ID m_Route_Layer_TOP
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
int PCBNEW_CONTROL::PadDisplayMode ( const TOOL_EVENT aEvent)

Definition at line 276 of file pcbnew_control.cpp.

References KIGFX::GEOMETRY, PCB_BASE_FRAME::GetDisplayOptions(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), TOOL_BASE::getView(), DISPLAY_OPTIONS::m_DisplayPadFill, m_frame, MODULE::Next(), D_PAD::Next(), EDA_DRAW_PANEL_GAL::Refresh(), and KIGFX::VIEW::Update().

Referenced by SetTransitions().

277 {
278  auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
279  auto settings = painter->GetSettings();
280 
282 
283  // Apply new display options to the GAL canvas
284  displ_opts->m_DisplayPadFill = !displ_opts->m_DisplayPadFill;
285  settings->LoadDisplayOptions( displ_opts );
286 
287  for( MODULE* module = getModel<BOARD>()->m_Modules; module; module = module->Next() )
288  {
289  for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
290  getView()->Update( pad, KIGFX::GEOMETRY );
291  }
292 
294 
295  return 0;
296 }
MODULE * Next() const
Definition: class_module.h:99
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:163
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
Definition: pcb_painter.h:175
D_PAD * Next() const
Definition: class_pad.h:106
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
void Update(VIEW_ITEM *aItem)
Function Update() For dynamic VIEWs, informs the associated VIEW that the graphical representation of...
Definition: view.cpp:1378
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
bool m_DisplayPadFill
Definition: pcbstruct.h:65
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
Color has changed.
Definition: view_item.h:57
int PCBNEW_CONTROL::PanControl ( const TOOL_EVENT aEvent)

Definition at line 593 of file pcbnew_control.cpp.

References ACTIONS::CURSOR_DOWN, ACTIONS::CURSOR_LEFT, ACTIONS::CURSOR_RIGHT, ACTIONS::CURSOR_UP, GRID_HELPER::GetGrid(), TOOL_BASE::getView(), m_frame, TOOL_EVENT::Parameter(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SetTransitions().

594 {
595  long type = aEvent.Parameter<intptr_t>();
596  KIGFX::VIEW* view = getView();
597  GRID_HELPER gridHelper( m_frame );
598  VECTOR2D center = view->GetCenter();
599  VECTOR2I gridSize = gridHelper.GetGrid() * 10;
600  bool mirroredX = view->IsMirroredX();
601 
602  switch( type )
603  {
605  center -= VECTOR2D( 0, gridSize.y );
606  break;
607 
609  center += VECTOR2D( 0, gridSize.y );
610  break;
611 
613  center -= VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
614  break;
615 
617  center += VECTOR2D( mirroredX ? -gridSize.x : gridSize.x, 0 );
618  break;
619 
620  default:
621  assert( false );
622  break;
623  }
624 
625  view->SetCenter( center );
626 
627  return 0;
628 }
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:373
Class VIEW.
Definition: view.h:58
void PCBNEW_CONTROL::Reset ( RESET_REASON  aReason)
overridevirtual

Function Reset() Brings the tool to a known, initial state.

If the tool claimed anything from the model or the view, it must release it when its reset.

Parameters
aReasoncontains information about the reason of tool reset.

Implements TOOL_BASE.

Definition at line 241 of file pcbnew_control.cpp.

References KIGFX::VIEW::Add(), TOOL_BASE::GAL_SWITCH, TOOL_BASE::getView(), m_frame, m_gridOrigin, TOOL_BASE::MODEL_RELOAD, and KIGFX::VIEW::Remove().

242 {
243  m_frame = getEditFrame<PCB_BASE_FRAME>();
244 
245  if( aReason == MODEL_RELOAD || aReason == GAL_SWITCH )
246  {
247  m_gridOrigin->SetPosition( getModel<BOARD>()->GetGridOrigin() );
248  getView()->Remove( m_gridOrigin.get() );
249  getView()->Add( m_gridOrigin.get() );
250  }
251 }
Model changes (required full reload)
Definition: tool_base.h:83
void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:340
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_gridOrigin
Grid origin marker.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:310
Rendering engine changes.
Definition: tool_base.h:84
int PCBNEW_CONTROL::ResetCoords ( const TOOL_EVENT aEvent)

Definition at line 699 of file pcbnew_control.cpp.

References KIGFX::VIEW_CONTROLS::GetCursorPosition(), PCB_BASE_FRAME::GetScreen(), TOOL_BASE::getViewControls(), m_frame, BASE_SCREEN::m_O_Curseur, PCB_BASE_FRAME::UpdateStatusBar(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SetTransitions().

700 {
701  VECTOR2I cursorPos = getViewControls()->GetCursorPosition();
702 
703  m_frame->GetScreen()->m_O_Curseur = wxPoint( cursorPos.x, cursorPos.y );
705 
706  return 0;
707 }
wxPoint m_O_Curseur
Relative Screen cursor coordinate (on grid) in user units.
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual VECTOR2D GetCursorPosition() const =0
Function GetCursorPosition() Returns the current cursor position in world coordinates.
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:36
virtual void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
void TOOL_INTERACTIVE::RunMainStack ( std::function< void()>  aFunc)
inherited

Function RunMainStack()

Calls a function using the main stack.

Parameters
aFuncis the function to be calls.

Definition at line 78 of file tool_interactive.cpp.

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::RunMainStack().

Referenced by DRAWING_TOOL::PlaceText().

79 {
80  m_toolMgr->RunMainStack( this, std::move( aFunc ) );
81 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
void RunMainStack(TOOL_BASE *aTool, std::function< void()> aFunc)
void TOOL_INTERACTIVE::SetContextMenu ( CONTEXT_MENU aMenu,
CONTEXT_MENU_TRIGGER  aTrigger = CMENU_BUTTON 
)
inherited

Function SetContextMenu()

Assigns a context menu and tells when it should be activated.

Parameters
aMenuis the menu to be assigned.
aTriggerdetermines conditions upon which the context menu is activated.

Definition at line 67 of file tool_interactive.cpp.

References CMENU_OFF, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ScheduleContextMenu(), and CONTEXT_MENU::SetTool().

Referenced by SELECTION_TOOL::disambiguationMenu(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), and TOOL_MENU::ShowContextMenu().

68 {
69  if( aMenu )
70  aMenu->SetTool( this );
71  else
72  aTrigger = CMENU_OFF;
73 
74  m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger );
75 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
void ScheduleContextMenu(TOOL_BASE *aTool, CONTEXT_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger)
Sets behaviour of the tool's context popup menu.
void SetTool(TOOL_INTERACTIVE *aTool)
Function SetTool() Sets a tool that is the creator of the menu.
void PCBNEW_CONTROL::SetTransitions ( )
overridevirtual

Sets up handlers for various events.

Reimplemented from TOOL_BASE.

Definition at line 934 of file pcbnew_control.cpp.

References AppendBoard(), PCB_ACTIONS::appendBoard, PCB_ACTIONS::cursorClick, CursorControl(), PCB_ACTIONS::cursorDblClick, PCB_ACTIONS::cursorDown, PCB_ACTIONS::cursorDownFast, PCB_ACTIONS::cursorLeft, PCB_ACTIONS::cursorLeftFast, PCB_ACTIONS::cursorRight, PCB_ACTIONS::cursorRightFast, PCB_ACTIONS::cursorUp, PCB_ACTIONS::cursorUpFast, DeleteItemCursor(), PCB_ACTIONS::deleteItemCursor, TOOL_INTERACTIVE::Go(), ACTIONS::gridFast1, GridFast1(), ACTIONS::gridFast2, GridFast2(), ACTIONS::gridResetOrigin, GridResetOrigin(), ACTIONS::gridSetOrigin, GridSetOrigin(), HighContrastDec(), PCB_ACTIONS::highContrastDec, HighContrastInc(), PCB_ACTIONS::highContrastInc, HighContrastMode(), PCB_ACTIONS::highContrastMode, LayerAlphaDec(), PCB_ACTIONS::layerAlphaDec, LayerAlphaInc(), PCB_ACTIONS::layerAlphaInc, PCB_ACTIONS::layerBottom, PCB_ACTIONS::layerInner1, PCB_ACTIONS::layerInner2, PCB_ACTIONS::layerInner3, PCB_ACTIONS::layerInner4, PCB_ACTIONS::layerInner5, PCB_ACTIONS::layerInner6, LayerNext(), PCB_ACTIONS::layerNext, LayerPrev(), PCB_ACTIONS::layerPrev, LayerSwitch(), LayerToggle(), PCB_ACTIONS::layerToggle, PCB_ACTIONS::layerTop, PadDisplayMode(), PCB_ACTIONS::padDisplayMode, PanControl(), PCB_ACTIONS::panDown, PCB_ACTIONS::panLeft, PCB_ACTIONS::panRight, PCB_ACTIONS::panUp, ResetCoords(), PCB_ACTIONS::resetCoords, ShowHelp(), PCB_ACTIONS::showHelp, SwitchCursor(), PCB_ACTIONS::switchCursor, SwitchUnits(), PCB_ACTIONS::switchUnits, ToBeDone(), PCB_ACTIONS::toBeDone, TrackDisplayMode(), PCB_ACTIONS::trackDisplayMode, ViaDisplayMode(), PCB_ACTIONS::viaDisplayMode, PCB_ACTIONS::zoneDisplayDisable, PCB_ACTIONS::zoneDisplayEnable, ZoneDisplayMode(), and PCB_ACTIONS::zoneDisplayOutlines.

935 {
936  // Display modes
946 
947  // Layer control
961 
962  // Cursor control
973 
974  // Pan control
979 
980  // Grid control
985 
986  // Miscellaneous
994 }
static TOOL_ACTION layerBottom
Definition: pcb_actions.h:238
int SwitchCursor(const TOOL_EVENT &aEvent)
int PanControl(const TOOL_EVENT &aEvent)
int PadDisplayMode(const TOOL_EVENT &aEvent)
static TOOL_ACTION cursorUpFast
Definition: pcb_actions.h:314
static TOOL_ACTION layerNext
Definition: pcb_actions.h:239
int HighContrastInc(const TOOL_EVENT &aEvent)
static TOOL_ACTION layerInner2
Definition: pcb_actions.h:233
static TOOL_ACTION cursorDblClick
Definition: pcb_actions.h:320
static TOOL_ACTION layerInner5
Definition: pcb_actions.h:236
static TOOL_ACTION layerInner6
Definition: pcb_actions.h:237
static TOOL_ACTION showHelp
Definition: pcb_actions.h:347
static TOOL_ACTION layerAlphaDec
Definition: pcb_actions.h:242
static TOOL_ACTION gridResetOrigin
Definition: actions.h:65
int LayerAlphaInc(const TOOL_EVENT &aEvent)
static TOOL_ACTION zoneDisplayOutlines
Definition: pcb_actions.h:225
static TOOL_ACTION layerAlphaInc
Definition: pcb_actions.h:241
static TOOL_ACTION zoneDisplayDisable
Definition: pcb_actions.h:224
int HighContrastMode(const TOOL_EVENT &aEvent)
int LayerPrev(const TOOL_EVENT &aEvent)
static TOOL_ACTION gridFast1
Definition: actions.h:60
int GridSetOrigin(const TOOL_EVENT &aEvent)
static TOOL_ACTION cursorUp
Cursor control with keyboard.
Definition: pcb_actions.h:309
static TOOL_ACTION switchUnits
Definition: pcb_actions.h:340
static TOOL_ACTION layerInner3
Definition: pcb_actions.h:234
int LayerNext(const TOOL_EVENT &aEvent)
static TOOL_ACTION deleteItemCursor
Definition: pcb_actions.h:341
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
static TOOL_ACTION resetCoords
Definition: pcb_actions.h:337
static TOOL_ACTION layerTop
Definition: pcb_actions.h:231
static TOOL_ACTION highContrastMode
Definition: pcb_actions.h:226
static TOOL_ACTION appendBoard
Definition: pcb_actions.h:346
static TOOL_ACTION gridFast2
Definition: actions.h:61
static TOOL_ACTION cursorRightFast
Definition: pcb_actions.h:317
static TOOL_ACTION layerPrev
Definition: pcb_actions.h:240
static TOOL_ACTION toBeDone
Definition: pcb_actions.h:348
int GridResetOrigin(const TOOL_EVENT &aEvent)
static TOOL_ACTION panRight
Definition: pcb_actions.h:326
static TOOL_ACTION cursorClick
Definition: pcb_actions.h:319
int LayerToggle(const TOOL_EVENT &aEvent)
static TOOL_ACTION panUp
Definition: pcb_actions.h:323
int ZoneDisplayMode(const TOOL_EVENT &aEvent)
int GridFast1(const TOOL_EVENT &aEvent)
static TOOL_ACTION cursorRight
Definition: pcb_actions.h:312
static TOOL_ACTION panLeft
Definition: pcb_actions.h:325
int AppendBoard(const TOOL_EVENT &aEvent)
int ResetCoords(const TOOL_EVENT &aEvent)
static TOOL_ACTION padDisplayMode
Definition: pcb_actions.h:221
static TOOL_ACTION viaDisplayMode
Definition: pcb_actions.h:222
int ShowHelp(const TOOL_EVENT &aEvent)
static TOOL_ACTION cursorLeft
Definition: pcb_actions.h:311
int LayerAlphaDec(const TOOL_EVENT &aEvent)
static TOOL_ACTION highContrastInc
Definition: pcb_actions.h:227
static TOOL_ACTION switchCursor
Definition: pcb_actions.h:339
int ViaDisplayMode(const TOOL_EVENT &aEvent)
int TrackDisplayMode(const TOOL_EVENT &aEvent)
int SwitchUnits(const TOOL_EVENT &aEvent)
int DeleteItemCursor(const TOOL_EVENT &aEvent)
int CursorControl(const TOOL_EVENT &aEvent)
static TOOL_ACTION layerInner4
Definition: pcb_actions.h:235
int GridFast2(const TOOL_EVENT &aEvent)
static TOOL_ACTION cursorDown
Definition: pcb_actions.h:310
static TOOL_ACTION gridSetOrigin
Definition: actions.h:64
static TOOL_ACTION cursorLeftFast
Definition: pcb_actions.h:316
int ToBeDone(const TOOL_EVENT &aEvent)
int LayerSwitch(const TOOL_EVENT &aEvent)
static TOOL_ACTION layerInner1
Definition: pcb_actions.h:232
static TOOL_ACTION panDown
Definition: pcb_actions.h:324
static TOOL_ACTION highContrastDec
Definition: pcb_actions.h:228
static TOOL_ACTION trackDisplayMode
Definition: pcb_actions.h:220
static TOOL_ACTION layerToggle
Definition: pcb_actions.h:243
static TOOL_ACTION zoneDisplayEnable
Definition: pcb_actions.h:223
int HighContrastDec(const TOOL_EVENT &aEvent)
static TOOL_ACTION cursorDownFast
Definition: pcb_actions.h:315
int PCBNEW_CONTROL::ShowHelp ( const TOOL_EVENT aEvent)

Definition at line 918 of file pcbnew_control.cpp.

References DisplayHotkeyList(), EDA_DRAW_FRAME::GetHotkeyConfig(), and m_frame.

Referenced by SetTransitions().

919 {
921 
922  return 0;
923 }
EDA_HOTKEY_CONFIG * GetHotkeyConfig() const
Function GetHotkeyConfig() Returns a structure containing currently used hotkey mapping.
Definition: draw_frame.h:345
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
void DisplayHotkeyList(EDA_BASE_FRAME *aFrame, struct EDA_HOTKEY_CONFIG *aDescList)
Function DisplayHotkeyList Displays the current hotkey list.
int PCBNEW_CONTROL::SwitchCursor ( const TOOL_EVENT aEvent)

Definition at line 710 of file pcbnew_control.cpp.

References EDA_DRAW_FRAME::GetGalDisplayOptions(), m_frame, and KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor.

Referenced by SetTransitions().

711 {
712  auto& galOpts = m_frame->GetGalDisplayOptions();
713 
714  galOpts.m_fullscreenCursor = !galOpts.m_fullscreenCursor;
715  galOpts.NotifyChanged();
716 
717  return 0;
718 }
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Function GetGalDisplayOptions Returns a reference to the gal rendering options used by GAL for render...
Definition: draw_frame.h:824
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
bool m_fullscreenCursor
Fullscreen crosshair or small cross
int PCBNEW_CONTROL::SwitchUnits ( const TOOL_EVENT aEvent)

Definition at line 721 of file pcbnew_control.cpp.

References g_UserUnit, ID_TB_OPTIONS_SELECT_UNIT_INCH, ID_TB_OPTIONS_SELECT_UNIT_MM, INCHES, m_frame, and EDA_BASE_FRAME::ProcessEvent().

Referenced by SetTransitions().

722 {
723  // TODO should not it be refactored to pcb_frame member function?
724  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
725 
726  if( g_UserUnit == INCHES )
727  evt.SetId( ID_TB_OPTIONS_SELECT_UNIT_MM );
728  else
729  evt.SetId( ID_TB_OPTIONS_SELECT_UNIT_INCH );
730 
731  m_frame->ProcessEvent( evt );
732 
733  return 0;
734 }
EDA_DRAW_FRAME::OnSelectGrid ID_TB_OPTIONS_SELECT_UNIT_INCH
Definition: draw_frame.cpp:121
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
bool ProcessEvent(wxEvent &aEvent) override
Function ProcessEvent overrides the default process event handler to implement the auto save feature...
Definition: basicframe.cpp:166
int PCBNEW_CONTROL::ToBeDone ( const TOOL_EVENT aEvent)

Definition at line 926 of file pcbnew_control.cpp.

References DisplayInfoMessage(), and m_frame.

Referenced by SetTransitions().

927 {
928  DisplayInfoMessage( m_frame, _( "Not available in OpenGL/Cairo canvases." ) );
929 
930  return 0;
931 }
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
void DisplayInfoMessage(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:89
int PCBNEW_CONTROL::TrackDisplayMode ( const TOOL_EVENT aEvent)

Definition at line 254 of file pcbnew_control.cpp.

References KIGFX::GEOMETRY, PCB_BASE_FRAME::GetDisplayOptions(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), TOOL_BASE::getView(), DISPLAY_OPTIONS::m_DisplayPcbTrackFill, m_frame, TRACK::Next(), PCB_TRACE_T, EDA_DRAW_PANEL_GAL::Refresh(), and KIGFX::VIEW::Update().

Referenced by SetTransitions().

255 {
256  auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
257  auto settings = painter->GetSettings();
258 
259  // Apply new display options to the GAL canvas
261  displ_opts->m_DisplayPcbTrackFill = !displ_opts->m_DisplayPcbTrackFill;
262  settings->LoadDisplayOptions( displ_opts );
263 
264  for( TRACK* track = getModel<BOARD>()->m_Track; track; track = track->Next() )
265  {
266  if( track->Type() == PCB_TRACE_T )
267  getView()->Update( track, KIGFX::GEOMETRY );
268  }
269 
271 
272  return 0;
273 }
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:163
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
bool m_DisplayPcbTrackFill
Definition: pcbstruct.h:71
virtual PCB_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
Definition: pcb_painter.h:175
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
void Update(VIEW_ITEM *aItem)
Function Update() For dynamic VIEWs, informs the associated VIEW that the graphical representation of...
Definition: view.cpp:1378
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
TRACK * Next() const
Definition: class_track.h:97
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
Color has changed.
Definition: view_item.h:57
void PCBNEW_CONTROL::updateGrid ( )
private

Applies the legacy canvas grid settings for GAL.

Definition at line 997 of file pcbnew_control.cpp.

References KIGFX::VIEW::GetGAL(), BASE_SCREEN::GetGridSize(), PCB_BASE_FRAME::GetScreen(), TOOL_BASE::getView(), m_frame, KIGFX::VIEW::MarkTargetDirty(), KIGFX::GAL::SetGridSize(), and KIGFX::TARGET_NONCACHED.

Referenced by GridFast1(), and GridFast2().

998 {
999  BASE_SCREEN* screen = m_frame->GetScreen();
1000  //GRID_TYPE grid = screen->GetGrid( idx );
1001  getView()->GetGAL()->SetGridSize( VECTOR2D( screen->GetGridSize() ) );
1003 }
Auxiliary rendering target (noncached)
Definition: definitions.h:42
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
GAL * GetGAL() const
Function GetGAL() Returns the GAL this view is using to draw graphical primitives.
Definition: view.h:177
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:575
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
void SetGridSize(const VECTOR2D &aGridSize)
Set the grid size.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
PCB_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
int PCBNEW_CONTROL::ViaDisplayMode ( const TOOL_EVENT aEvent)

Definition at line 299 of file pcbnew_control.cpp.

References KIGFX::GEOMETRY, PCB_BASE_FRAME::GetDisplayOptions(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), TOOL_BASE::getView(), DISPLAY_OPTIONS::m_DisplayViaFill, m_frame, TRACK::Next(), PCB_TRACE_T, PCB_VIA_T, EDA_DRAW_PANEL_GAL::Refresh(), and KIGFX::VIEW::Update().

Referenced by SetTransitions().

300 {
301  auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
302  auto settings = painter->GetSettings();
304 
305  // Apply new display options to the GAL canvas
306  displ_opts->m_DisplayViaFill = !displ_opts->m_DisplayViaFill;
307  settings->LoadDisplayOptions( displ_opts );
308 
309  for( TRACK* track = getModel<BOARD>()->m_Track; track; track = track->Next() )
310  {
311  if( track->Type() == PCB_TRACE_T || track->Type() == PCB_VIA_T )
312  getView()->Update( track, KIGFX::GEOMETRY );
313  }
314 
316 
317  return 0;
318 }
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:163
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:107
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
Definition: pcb_painter.h:175
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
void Update(VIEW_ITEM *aItem)
Function Update() For dynamic VIEWs, informs the associated VIEW that the graphical representation of...
Definition: view.cpp:1378
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
TRACK * Next() const
Definition: class_track.h:97
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:108
bool m_DisplayViaFill
Definition: pcbstruct.h:66
Color has changed.
Definition: view_item.h:57
OPT_TOOL_EVENT TOOL_INTERACTIVE::Wait ( const TOOL_EVENT_LIST aEventList = TOOL_EVENTTC_ANYTA_ANY ))
inherited

Function Wait()

Suspends execution of the tool until an event specified in aEventList arrives. No parameters means waiting for any event.

Definition at line 55 of file tool_interactive.cpp.

References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::ScheduleWait().

Referenced by MODULE_EDITOR_TOOLS::CopyItems(), DeleteItemCursor(), SELECTION_TOOL::disambiguationMenu(), PCB_TOOL::doInteractiveItemPlacement(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), PCB_EDITOR_CONTROL::DrillOrigin(), MODULE_EDITOR_TOOLS::EnumeratePads(), GridSetOrigin(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineDrag(), ZOOM_TOOL::Main(), PICKER_TOOL::Main(), EDIT_TOOL::Main(), SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), EDIT_TOOL::MeasureTool(), POINT_EDITOR::OnSelectionChange(), MODULE_EDITOR_TOOLS::PasteItems(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), DRAWING_TOOL::PlaceDXF(), PCB_EDITOR_CONTROL::PlaceModule(), MODULE_EDITOR_TOOLS::PlacePad(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::runPolygonEventLoop(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectPoint(), ZOOM_TOOL::selectRegion(), and DRAWING_TOOL::SetAnchor().

56 {
57  return m_toolMgr->ScheduleWait( this, aEventList );
58 }
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:220
boost::optional< TOOL_EVENT > ScheduleWait(TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions)
Pauses execution of a given tool until one or more events matching aConditions arrives.
int PCBNEW_CONTROL::ZoneDisplayMode ( const TOOL_EVENT aEvent)

Definition at line 321 of file pcbnew_control.cpp.

References KIGFX::GEOMETRY, BOARD::GetArea(), BOARD::GetAreaCount(), PCB_BASE_FRAME::GetDisplayOptions(), EDA_DRAW_FRAME::GetGalCanvas(), KIGFX::VIEW::GetPainter(), KIGFX::PCB_PAINTER::GetSettings(), TOOL_BASE::getView(), TOOL_EVENT::IsAction(), DISPLAY_OPTIONS::m_DisplayZonesMode, m_frame, EDA_DRAW_PANEL_GAL::Refresh(), KIGFX::VIEW::Update(), PCB_ACTIONS::zoneDisplayDisable, PCB_ACTIONS::zoneDisplayEnable, and PCB_ACTIONS::zoneDisplayOutlines.

Referenced by SetTransitions().

322 {
323  auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
324  auto settings = painter->GetSettings();
326 
327  // Apply new display options to the GAL canvas
329  displ_opts->m_DisplayZonesMode = 0;
330  else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayDisable ) )
331  displ_opts->m_DisplayZonesMode = 1;
332  else if( aEvent.IsAction( &PCB_ACTIONS::zoneDisplayOutlines ) )
333  displ_opts->m_DisplayZonesMode = 2;
334  else
335  assert( false );
336 
337  settings->LoadDisplayOptions( displ_opts );
338 
339  BOARD* board = getModel<BOARD>();
340  for( int i = 0; i < board->GetAreaCount(); ++i )
341  getView()->Update( board->GetArea( i ), KIGFX::GEOMETRY );
342 
344 
345  return 0;
346 }
static TOOL_ACTION zoneDisplayOutlines
Definition: pcb_actions.h:225
static TOOL_ACTION zoneDisplayDisable
Definition: pcb_actions.h:224
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:54
Class PCB_PAINTER Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:163
void * GetDisplayOptions() override
Function GetDisplayOptions returns the display options current in use Display options are relative to...
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
Definition: pcb_painter.h:175
int m_DisplayZonesMode
Definition: pcbstruct.h:77
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1051
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:196
void Update(VIEW_ITEM *aItem)
Function Update() For dynamic VIEWs, informs the associated VIEW that the graphical representation of...
Definition: view.cpp:1378
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Class DISPLAY_OPTIONS handles display options like enable/disable some optional drawings.
Definition: pcbstruct.h:62
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:30
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:1022
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:803
Color has changed.
Definition: view_item.h:57
static TOOL_ACTION zoneDisplayEnable
Definition: pcb_actions.h:223

Member Data Documentation

std::unique_ptr<KIGFX::ORIGIN_VIEWITEM> PCBNEW_CONTROL::m_gridOrigin
private

Grid origin marker.

Definition at line 94 of file pcbnew_control.h.

Referenced by GridResetOrigin(), GridSetOrigin(), PCBNEW_CONTROL(), and Reset().

TOOL_ID TOOL_BASE::m_toolId
protectedinherited

Unique identifier for the tool, assigned by a TOOL_MANAGER instance.

Definition at line 215 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), TOOL_BASE::GetId(), and EDIT_TOOL::getModificationPoint().

TOOL_MANAGER* TOOL_BASE::m_toolMgr
protectedinherited

Definition at line 220 of file tool_base.h.

Referenced by TOOL_INTERACTIVE::Activate(), AppendBoard(), PAD_TOOL::applyPadSettings(), TOOL_BASE::attachManager(), SELECTION_TOOL::clearSelection(), MODULE_EDITOR_TOOLS::CopyItems(), PAD_TOOL::copyPadSettings(), PCB_EDITOR_CONTROL::CrossProbePcbToSch(), PCB_EDITOR_CONTROL::CrossProbeSchToPcb(), CursorControl(), ROUTER_TOOL::CustomTrackWidthDialog(), DeleteItemCursor(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::drawZone(), PCB_EDITOR_CONTROL::DrillOrigin(), EDIT_TOOL::Duplicate(), EDIT_TOOL::editFootprintInFpEditor(), MODULE_EDITOR_TOOLS::EnumeratePads(), EDIT_TOOL::ExchangeFootprints(), SELECTION_TOOL::findCallback(), SELECTION_TOOL::findMove(), EDIT_TOOL::Flip(), TOOL_BASE::getEditFrameInt(), TOOL_BASE::GetManager(), TOOL_BASE::getModelInt(), EDIT_TOOL::getModificationPoint(), DRAWING_TOOL::getSourceZoneForAction(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), TOOL_INTERACTIVE::goInternal(), GridSetOrigin(), PCB_EDITOR_CONTROL::HighlightNet(), PCB_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::Init(), PLACEMENT_TOOL::Init(), PAD_TOOL::Init(), POINT_EDITOR::Init(), PCB_EDITOR_CONTROL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), ZOOM_TOOL::Main(), PICKER_TOOL::Main(), EDIT_TOOL::Main(), SELECTION_TOOL::Main(), LENGTH_TUNER_TOOL::mainLoop(), ROUTER_TOOL::mainLoop(), EDIT_TOOL::Mirror(), PCB_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), POINT_EDITOR::OnSelectionChange(), MODULE_EDITOR_TOOLS::PasteItems(), DRAWING_TOOL::PlaceDXF(), PCB_EDITOR_CONTROL::PlaceModule(), MODULE_EDITOR_TOOLS::PlacePad(), PCB_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EDIT_TOOL::Remove(), SELECTION_TOOL::RequestSelection(), EDIT_TOOL::Rotate(), TOOL_INTERACTIVE::RunMainStack(), SELECTION_TOOL::SanitizeSelection(), SELECTION_TOOL::selectConnection(), SELECTION_TOOL::selectCopper(), SELECTION_TOOL::SelectItem(), SELECTION_TOOL::selectMultiple(), SELECTION_TOOL::selectNet(), SELECTION_TOOL::selectOnSheetFromEeschema(), SELECTION_TOOL::selectSameSheet(), TOOL_INTERACTIVE::SetContextMenu(), SELECTION_TOOL::toggleSelection(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), SELECTION_TOOL::UnselectItem(), PCB_EDITOR_CONTROL::ViaSizeDec(), PCB_EDITOR_CONTROL::ViaSizeInc(), TOOL_INTERACTIVE::Wait(), PCB_EDITOR_CONTROL::ZoneDuplicate(), PCB_EDITOR_CONTROL::ZoneFill(), PCB_EDITOR_CONTROL::ZoneMerge(), and PCB_EDITOR_CONTROL::ZoneUnfill().

std::string TOOL_BASE::m_toolName
protectedinherited

Name of the tool.

Names are expected to obey the format application.ToolName

(eg. pcbnew.InteractiveSelection).

Definition at line 219 of file tool_base.h.

Referenced by TOOL_BASE::GetName().

TOOL_SETTINGS TOOL_BASE::m_toolSettings
protectedinherited

Definition at line 221 of file tool_base.h.

Referenced by TOOL_BASE::attachManager(), and TOOL_BASE::GetSettings().

TOOL_TYPE TOOL_BASE::m_type
protectedinherited

Stores the type of the tool.

Definition at line 212 of file tool_base.h.

Referenced by TOOL_BASE::GetType().


The documentation for this class was generated from the following files: