KiCad PCB EDA Suite
sch_base_frame.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
5  * Copyright (C) 2015-2019 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <base_units.h>
26 #include <kiway.h>
27 #include <sch_draw_panel.h>
28 #include <sch_view.h>
29 #include <sch_painter.h>
31 #include <confirm.h>
33 #include <class_library.h>
34 #include <eeschema_id.h>
35 #include <lib_edit_frame.h>
36 #include <viewlib_frame.h>
37 #include <sch_base_frame.h>
38 #include <symbol_lib_table.h>
39 #include <tool/action_toolbar.h>
40 #include <tool/tool_manager.h>
41 #include <tool/tool_dispatcher.h>
42 #include <tools/ee_actions.h>
44 
45 
46 LIB_PART* SchGetLibPart( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable, PART_LIB* aCacheLib,
47  wxWindow* aParent, bool aShowErrorMsg )
48 {
49  // wxCHECK_MSG( aLibId.IsValid(), NULL, "LIB_ID is not valid." );
50  wxCHECK_MSG( aLibTable, NULL, "Invalid symbol library table." );
51 
52  LIB_PART* symbol = NULL;
53 
54  try
55  {
56  symbol = aLibTable->LoadSymbol( aLibId );
57 
58  if( !symbol && aCacheLib )
59  symbol = aCacheLib->FindPart( aLibId );
60  }
61  catch( const IO_ERROR& ioe )
62  {
63  if( aShowErrorMsg )
64  {
65  wxString msg = wxString::Format( _( "Error loading symbol '%s' from library '%s'." ),
66  aLibId.GetLibItemName().wx_str(),
67  aLibId.GetLibNickname().wx_str() );
68  DisplayErrorMessage( aParent, msg, ioe.What() );
69  }
70  }
71 
72  return symbol;
73 }
74 
75 
76 // Static members:
77 
78 SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aWindowType,
79  const wxString& aTitle, const wxPoint& aPosition,
80  const wxSize& aSize, long aStyle, const wxString& aFrameName ) :
81  EDA_DRAW_FRAME( aKiway, aParent, aWindowType, aTitle, aPosition, aSize, aStyle, aFrameName )
82 {
83  createCanvas();
84 
85  m_zoomLevelCoeff = 11.0; // Adjusted to roughly displays zoom level = 1
86  // when the screen shows a 1:1 image
87  // obviously depends on the monitor,
88  // but this is an acceptable value
92  m_repeatComponent = false;
93  m_useAllUnits = false;
94 }
95 
96 
98 {
99 }
100 
101 
103 {
105 }
106 
107 
109 {
110  EDA_DRAW_FRAME::SetScreen( aScreen );
111 
112  if( m_toolManager )
113  {
114  m_toolManager->SetEnvironment( aScreen, GetCanvas()->GetView(),
115  GetCanvas()->GetViewControls(), this );
116  }
117 }
118 
119 
121 {
123 }
124 
125 
126 void SCH_BASE_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
127 {
128  GetScreen()->SetPageSettings( aPageSettings );
129 }
130 
131 
133 {
134  return GetScreen()->GetPageSettings();
135 }
136 
137 
138 const wxSize SCH_BASE_FRAME::GetPageSizeIU() const
139 {
140  // GetSizeIU is compile time dependent:
141  return GetScreen()->GetPageSettings().GetSizeIU();
142 }
143 
144 
145 const wxPoint& SCH_BASE_FRAME::GetAuxOrigin() const
146 {
147  wxASSERT( GetScreen() );
148  return GetScreen()->GetAuxOrigin();
149 }
150 
151 
152 void SCH_BASE_FRAME::SetAuxOrigin( const wxPoint& aPosition )
153 {
154  wxASSERT( GetScreen() );
155  GetScreen()->SetAuxOrigin( aPosition );
156 }
157 
158 
160 {
161  wxASSERT( GetScreen() );
162  return GetScreen()->GetTitleBlock();
163 }
164 
165 
166 void SCH_BASE_FRAME::SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
167 {
168  wxASSERT( GetScreen() );
169  GetScreen()->SetTitleBlock( aTitleBlock );
170 }
171 
172 
174 {
175  wxString line;
176  BASE_SCREEN* screen = GetScreen();
177 
178  if( !screen )
179  return;
180 
182 
183  // Display absolute coordinates:
185  double dXpos = To_User_Unit( GetUserUnits(), cursorPos.x );
186  double dYpos = To_User_Unit( GetUserUnits(), cursorPos.y );
187 
188  if ( GetUserUnits() == MILLIMETRES )
189  {
190  dXpos = RoundTo0( dXpos, 100.0 );
191  dYpos = RoundTo0( dYpos, 100.0 );
192  }
193 
194  wxString absformatter;
195  wxString locformatter;
196 
197  switch( GetUserUnits() )
198  {
199  case INCHES:
200  absformatter = "X %.3f Y %.3f";
201  locformatter = "dx %.3f dy %.3f dist %.3f";
202  break;
203 
204  case MILLIMETRES:
205  absformatter = "X %.2f Y %.2f";
206  locformatter = "dx %.2f dy %.2f dist %.2f";
207  break;
208 
209  case UNSCALED_UNITS:
210  absformatter = "X %f Y %f";
211  locformatter = "dx %f dy %f dist %f";
212  break;
213 
214  default:
215  wxASSERT( false );
216  break;
217  }
218 
219  line.Printf( absformatter, dXpos, dYpos );
220  SetStatusText( line, 2 );
221 
222  // Display relative coordinates:
223  double dx = cursorPos.x - screen->m_LocalOrigin.x;
224  double dy = cursorPos.y - screen->m_LocalOrigin.y;
225 
226  dXpos = To_User_Unit( GetUserUnits(), dx );
227  dYpos = To_User_Unit( GetUserUnits(), dy );
228 
229  if( GetUserUnits() == MILLIMETRES )
230  {
231  dXpos = RoundTo0( dXpos, 100.0 );
232  dYpos = RoundTo0( dYpos, 100.0 );
233  }
234 
235  // We already decided the formatter above
236  line.Printf( locformatter, dXpos, dYpos, hypot( dXpos, dYpos ) );
237  SetStatusText( line, 3 );
238 
239  // refresh grid display
240  DisplayGridMsg();
241 
242  // refresh units display
243  DisplayUnitsMsg();
244 }
245 
246 
247 LIB_PART* SCH_BASE_FRAME::GetLibPart( const LIB_ID& aLibId, bool aUseCacheLib, bool aShowErrorMsg )
248 {
249  PART_LIB* cache = ( aUseCacheLib ) ? Prj().SchLibs()->GetCacheLibrary() : NULL;
250 
251  return SchGetLibPart( aLibId, Prj().SchSymbolLibTable(), cache, this, aShowErrorMsg );
252 }
253 
254 
255 bool SCH_BASE_FRAME::saveSymbolLibTables( bool aGlobal, bool aProject )
256 {
257  wxString msg;
258  bool success = true;
259 
260  if( aGlobal )
261  {
262  try
263  {
265  }
266  catch( const IO_ERROR& ioe )
267  {
268  success = false;
269  msg.Printf( _( "Error saving global symbol library table:\n%s" ), ioe.What() );
270  wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
271  }
272  }
273 
274  if( aProject && !Prj().GetProjectName().IsEmpty() )
275  {
276  wxFileName fn( Prj().GetProjectPath(), SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
277 
278  try
279  {
280  Prj().SchSymbolLibTable()->Save( fn.GetFullPath() );
281  }
282  catch( const IO_ERROR& ioe )
283  {
284  success = false;
285  msg.Printf( _( "Error saving project-specific symbol library table:\n%s" ), ioe.What() );
286  wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
287  }
288  }
289 
290  return success;
291 }
292 
293 
294 void SCH_BASE_FRAME::RedrawScreen( const wxPoint& aCenterPoint, bool aWarpPointer )
295 {
296  KIGFX::GAL* gal = GetCanvas()->GetGAL();
297 
298  double selectedZoom = GetScreen()->GetZoom();
299  double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
300  double scale = 1.0 / ( zoomFactor * selectedZoom );
301 
302  if( aCenterPoint != wxPoint( 0, 0 ) )
303  GetCanvas()->GetView()->SetScale( scale, aCenterPoint );
304  else
305  GetCanvas()->GetView()->SetScale( scale );
306 
307  GetCanvas()->GetView()->SetCenter( aCenterPoint );
308 
309  if( aWarpPointer )
311 
312  GetCanvas()->Refresh();
313 }
314 
315 
316 void SCH_BASE_FRAME::CenterScreen( const wxPoint& aCenterPoint, bool aWarpPointer )
317 {
318  GetCanvas()->GetView()->SetCenter( aCenterPoint );
319 
320  if( aWarpPointer )
321  GetCanvas()->GetViewControls()->WarpCursor( aCenterPoint, true );
322 
323  GetCanvas()->Refresh();
324 }
325 
326 
328 {
330  GetCanvas()->ForceRefresh();
331 }
332 
333 
335 {
336  return static_cast<SCH_DRAW_PANEL*>( EDA_DRAW_FRAME::GetCanvas() );
337 }
338 
339 
341 {
342  KIGFX::PAINTER* painter = GetCanvas()->GetView()->GetPainter();
343  return static_cast<KIGFX::SCH_RENDER_SETTINGS*>( painter->GetSettings() );
344 }
345 
346 
348 {
350 
351  // Allows only a CAIRO or OPENGL canvas:
354  {
356  }
357 
358  SetCanvas( new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize,
361 }
362 
363 
364 void SCH_BASE_FRAME::RefreshItem( EDA_ITEM* aItem, bool isAddOrDelete )
365 {
366  EDA_ITEM* parent = aItem->GetParent();
367 
368  if( aItem->Type() == SCH_SHEET_PIN_T )
369  {
370  // Sheet pins aren't in the view. Refresh their parent.
371  if( parent )
372  GetCanvas()->GetView()->Update( parent );
373  }
374  else
375  {
376  if( !isAddOrDelete )
377  GetCanvas()->GetView()->Update( aItem );
378 
379  // Component children are drawn from their parents. Mark them for re-paint.
380  if( parent && parent->Type() == SCH_COMPONENT_T )
381  GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT );
382  }
383 
384  GetCanvas()->Refresh();
385 }
386 
387 
389 {
390  if( m_toolManager )
391  {
393  SELECTION& selection = selectionTool->GetSelection();
394  KIGFX::SCH_VIEW* view = GetCanvas()->GetView();
395 
396  for( EDA_ITEM* item : selection )
397  {
398  EDA_ITEM* parent = item->GetParent();
399 
400  if( item->Type() == SCH_SHEET_PIN_T )
401  {
402  // Sheet pins aren't in the view. Refresh their parent.
403  if( parent )
404  GetCanvas()->GetView()->Update( parent );
405  }
406  else
407  {
408  view->Update( item, KIGFX::REPAINT );
409 
410  // Component children are drawn from their parents. Mark them for re-paint.
411  if( parent && parent->Type() == SCH_COMPONENT_T )
412  GetCanvas()->GetView()->Update( parent, KIGFX::REPAINT );
413  }
414  }
415  }
416 }
417 
418 
420 {
421  auto screen = aScreen;
422 
423  if( aScreen == nullptr )
424  screen = GetScreen();
425 
426  screen->Append( (SCH_ITEM*) aItem );
427 
428  if( screen == GetScreen() )
429  {
430  GetCanvas()->GetView()->Add( aItem );
431  RefreshItem( aItem, true ); // handle any additional parent semantics
432  }
433 }
434 
435 
437 {
438  auto screen = aScreen;
439 
440  if( aScreen == nullptr )
441  screen = GetScreen();
442 
443  if( screen == GetScreen() )
444  GetCanvas()->GetView()->Remove( aItem );
445 
446  screen->Remove( (SCH_ITEM*) aItem );
447 
448  if( screen == GetScreen() )
449  RefreshItem( aItem, true ); // handle any additional parent semantics
450 }
451 
452 
454 {
455  auto gs = GetScreen()->GetGridSize();
456  GetCanvas()->GetGAL()->SetGridSize( VECTOR2D( gs.x, gs.y ));
458 }
459 
460 
void SetScreen(BASE_SCREEN *aScreen) override
void RefreshSelection()
Mark selected items for refresh.
KIGFX::SCH_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
static const wxString & GetSymbolLibTableFileName()
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
Definition: base_screen.h:279
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
SCH_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aWindowType, const wxString &aTitle, const wxPoint &aPosition, const wxSize &aSize, long aStyle, const wxString &aFrameName)
static S3D_CACHE * cache
Definition: export_vrml.cpp:64
void ForceRefresh()
Function ForceRefresh() Forces a redraw.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
virtual void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:249
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
void AddToScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Add an item to the screen (and view) aScreen is the screen the item is located on,...
void HardRedraw() override
Rebuild the GAL and redraws the screen.
Implementation of conversion functions that require both schematic and board internal units.
This file is part of the common library.
double RoundTo0(double x, double precision)
Round to the nearest precision.
Definition: common.cpp:233
#define DEFAULT_REPEAT_LABEL_INC
the default value (overwritten by the eeschema config)
Definition: general.h:51
virtual void SetScreen(BASE_SCREEN *aScreen)
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
double GetZoom() const
Function GetZoom returns the current "zoom factor", which is a measure of "internal units per device ...
Definition: base_screen.h:240
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
The current canvas type.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void UpdateAllItems(int aUpdateFlags)
Updates all items in the view according to the given flags.
Definition: view.cpp:1444
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:376
wxPoint m_repeatStep
LIB_PART * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_PART having aName from the library given by aNickname.
EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting()
Returns the canvas type stored in the application settings.
const TITLE_BLOCK & GetTitleBlock() const
Definition: sch_screen.h:128
const wxPoint & GetAuxOrigin() const override
Return the origin of the axis used for plotting and various exports.
void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: sch_screen.h:119
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
LIB_PART * GetLibPart(const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowErrorMsg=false)
Load symbol from symbol library table.
void RemoveFromScreen(EDA_ITEM *aItem, SCH_SCREEN *aScreen=nullptr)
Remove an item from the screen (and view) aScreen is the screen the item is located on,...
void SetAuxOrigin(const wxPoint &aPosition)
Definition: sch_screen.h:126
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
Item needs to be redrawn.
Definition: view_item.h:61
The base class for create windows for drawing purpose.
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
Definition: title_block.h:40
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:118
const wxString GetZoomLevelIndicator() const override
Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level in...
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
void DisplayUnitsMsg()
Display current unit pane on the status bar.
EE_SELECTION & GetSelection()
Function GetSelection()
virtual void CenterOnCursor() const =0
Function CenterOnCursor() Sets the viewport center to the current cursor position and warps the curso...
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
Function WarpCursor() If enabled (.
Class PAINTER contains all the knowledge about how to draw graphical object onto any particular outpu...
Definition: painter.h:313
Item is being added to the view.
Definition: view_item.h:60
void SetCenter(const VECTOR2D &aCenter)
Function SetCenter() Sets the center point of the VIEW (i.e.
Definition: view.cpp:604
VECTOR2< double > VECTOR2D
Definition: vector2d.h:586
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
void SetAuxOrigin(const wxPoint &aPosition) override
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock) override
void SyncView()
Mark all items for refresh.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
double To_User_Unit(EDA_UNITS_T aUnit, double aValue, bool aUseMils)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:93
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:74
Definition: common.h:134
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Define a library symbol object.
virtual ~SCH_BASE_FRAME()
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:274
bool saveSymbolLibTables(bool aGlobal, bool aProject)
Saves Symbol Library Tables to disk.
EDA_ITEM * GetParent() const
Definition: base_struct.h:220
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
double GetZoomFactor() const
Get the zoom factor.
#define DEFAULT_REPEAT_OFFSET_Y
the default Y value (overwritten by the eeschema config)
Definition: general.h:49
virtual void ActivateGalCanvas()
Use to start up the GAL drawing canvas.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: sch_screen.h:130
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1540
bool m_showPinElectricalTypeName
#define _(s)
void SetPageSettings(const PAGE_INFO &aPageSettings) override
LIB_PART * FindPart(const wxString &aName) const
Find LIB_PART by aName.
void SetGridSize(const VECTOR2D &aGridSize)
Set the grid size.
void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 }) override
Function SetScale() Sets the scaling factor, zooming around a given anchor point.
Definition: sch_view.cpp:73
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
virtual const wxString GetZoomLevelIndicator() const
Return a human readable value which can be displayed as zoom level indicator in dialogs.
#define DEFAULT_REPEAT_OFFSET_X
the default X value (overwritten by the eeschema config)
Definition: general.h:48
const PAGE_INFO & GetPageSettings() const override
void UpdateStatusBar() override
Update the status bar information.
void SetCanvas(EDA_DRAW_PANEL_GAL *aPanel)
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
double m_zoomLevelCoeff
const int scale
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
EDA_UNITS_T GetUserUnits() const
Return the user units currently in use.
void RefreshItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
const TITLE_BLOCK & GetTitleBlock() const override
wxString wx_str() const
Definition: utf8.cpp:51
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, EDA_BASE_FRAME *aFrame)
Sets the work environment (model, view, view controls and the parent window).
Class SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:69
virtual void CenterScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
LIB_PART * SchGetLibPart(const LIB_ID &aLibId, SYMBOL_LIB_TABLE *aLibTable, PART_LIB *aCacheLib, wxWindow *aParent, bool aShowErrorMsg)
Load symbol from symbol library table.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:346
TOOL_MANAGER * m_toolManager
void UpdateStatusBar() override
Update the status bar information.
Definition for part library class.
void DisplayGridMsg()
Display current grid pane on the status bar.
double GetWorldScale() const
Get the world scale.
const wxPoint & GetAuxOrigin() const
Definition: sch_screen.h:125
Object used to load, save, search, and otherwise manipulate symbol library files.
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
static wxString GetGlobalTableFileName()
Fetch the global symbol library table file name.
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:114
KICAD_T Type() const
Function Type()
Definition: base_struct.h:210
Class GAL is the abstract interface for drawing on a 2D-surface.