42 auto activeToolCondition =
70 bool do_reload_board =
true;
74 if(
frame()->Get3DViewerFrame() ==
nullptr )
75 do_reload_board =
false;
94template<
class T>
void Flip( T& aValue )
107 for(
PAD*
pad : fp->Pads() )
124 for(
PAD*
pad : fp->Pads() )
141 for(
BOARD_ITEM* item : fp->GraphicalItems() )
176 for(
BOARD_ITEM* item : fp->GraphicalItems() )
224 bool originSet =
false;
241 controls.SetAutoPan(
false );
242 controls.CaptureCursor(
false );
243 controls.ForceCursorPosition(
false );
249 controls.ShowCursor(
true );
250 controls.SetAutoPan(
false );
251 controls.CaptureCursor(
false );
252 controls.ForceCursorPosition(
false );
262 VECTOR2I cursorPos = evt->HasPosition() ? evt->Position() : controls.GetMousePosition();
263 cursorPos =
grid.BestSnapAnchor( cursorPos,
nullptr );
264 controls.ForceCursorPosition(
true, cursorPos );
266 if( evt->IsCancelInteractive() )
278 else if( evt->IsActivate() )
283 if( evt->IsMoveTool() )
295 else if( !originSet && ( evt->IsDrag(
BUT_LEFT ) || evt->IsClick(
BUT_LEFT ) ) )
298 twoPtMgr.
SetEnd( cursorPos );
300 controls.CaptureCursor(
true );
301 controls.SetAutoPan(
true );
306 else if( originSet && ( evt->IsClick(
BUT_LEFT ) || evt->IsMouseUp(
BUT_LEFT ) ) )
310 controls.SetAutoPan(
false );
311 controls.CaptureCursor(
false );
314 else if( originSet && ( evt->IsMotion() || evt->IsDrag(
BUT_LEFT ) ) )
325 twoPtMgr.
SetEnd( cursorPos );
353 ruler.
UpdateDir( invertXAxis, invertYAxis );
361 m_menu->ShowContextMenu();
373 controls.SetAutoPan(
false );
374 controls.CaptureCursor(
false );
375 controls.ForceCursorPosition(
false );
constexpr EDA_IU_SCALE pcbIUScale
static TOOL_ACTION cancelInteractive
static TOOL_ACTION show3DViewer
static TOOL_ACTION updatePreferences
static TOOL_ACTION updateUnits
static TOOL_ACTION measureTool
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
void AddStandardSubMenus(TOOL_MENU &aMenu)
Construct a "basic" menu for a tool, containing only items that apply to all tools (e....
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
bool GetGridSnapping() const
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
A drawn ruler item for showing the distance between two points.
void SwitchUnits(EDA_UNITS aUnits)
Switch the ruler units.
void UpdateDir(bool aFlipX, bool aFlipY)
Represent a very simple geometry manager for items that have a start and end point.
void SetOrigin(const VECTOR2I &aOrigin)
< Set the origin of the ruler (the fixed end)
void SetAngleSnap(bool aSnap)
void SetEnd(const VECTOR2I &aEnd)
Set the current end of the rectangle (the end that moves with the cursor.
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
static TOOL_ACTION toggleHV45Mode
static TOOL_ACTION padDisplayMode
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
static TOOL_ACTION textOutlines
Display texts as lines.
static TOOL_ACTION showPadNumbers
virtual PCB_VIEWERS_SETTINGS_BASE * GetViewerSettingsBase() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
EDA_3D_VIEWER_FRAME * CreateAndShow3D_Frame()
Shows the 3D view frame.
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay
virtual SETTINGS_MANAGER & GetSettingsManager() const
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
EDA_UNITS GetUserUnits() const
Declaration of the eda_3d_viewer class.
@ REPAINT
Item needs to be redrawn.
@ GEOMETRY
Position or shape has changed.
PGM_BASE & Pgm()
The global Program "get" accessor.
bool m_DisplayInvertYAxis
bool m_DisplayInvertXAxis
bool m_DisplayGraphicsFill
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type