KiCad PCB EDA Suite
PANEL_PREV_3D Class Reference

#include <panel_prev_3d.h>

Inheritance diagram for PANEL_PREV_3D:
EDA_3D_BOARD_HOLDER TOOLS_HOLDER PANEL_PREV_3D_BASE

Public Member Functions

 PANEL_PREV_3D (wxWindow *aParent, PCB_BASE_FRAME *aFrame, FOOTPRINT *aFootprint, std::vector< FP_3DMODEL > *aParentModelList)
 
 ~PANEL_PREV_3D ()
 
void OnMenuEvent (wxMenuEvent &aEvent)
 The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't captured by the menus themselves. More...
 
wxWindow * GetToolCanvas () const override
 Canvas access. More...
 
BOARD_ADAPTERGetAdapter () override
 
CAMERAGetCurrentCamera () override
 
void SetSelectedModel (int idx)
 Set the currently selected index in the model list so that the scale/rotation/offset controls can be updated. More...
 
void UpdateDummyFootprint (bool aRelaodRequired=true)
 Copy shapes from the current shape list which are flagged for preview to the copy of footprint that is on the preview dummy board. More...
 
TOOL_MANAGERGetToolManager () const
 Return the MVC controller. More...
 
virtual void RegisterUIUpdateHandler (const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
 Register an action's update conditions with the UI layer to allow the UI to appropriately display the state of its controls. More...
 
virtual void RegisterUIUpdateHandler (int aID, const ACTION_CONDITIONS &aConditions)
 Register a UI update handler for the control with ID aID. More...
 
virtual void UnregisterUIUpdateHandler (const TOOL_ACTION &aAction)
 Unregister a UI handler for an action that was registered using RegisterUIUpdateHandler. More...
 
virtual void UnregisterUIUpdateHandler (int aID)
 Unregister a UI handler for a given ID that was registered using RegisterUIUpdateHandler. More...
 
virtual SELECTIONGetCurrentSelection ()
 Get the current selection from the canvas area. More...
 
virtual void PushTool (const std::string &actionName)
 NB: the definition of "tool" is different at the user level. More...
 
virtual void PopTool (const std::string &actionName)
 
bool ToolStackIsEmpty ()
 
std::string CurrentToolName () const
 
bool IsCurrentTool (const TOOL_ACTION &aAction) const
 
virtual void DisplayToolMsg (const wxString &msg)
 
bool GetDoImmediateActions () const
 Indicate that hotkeys should perform an immediate action even if another tool is currently active. More...
 
MOUSE_DRAG_ACTION GetDragAction () const
 Indicates whether a drag should draw a selection rectangle or drag selected (or unselected) objects. More...
 
bool GetMoveWarpsCursor () const
 Indicate that a move operation should warp the mouse pointer to the origin of the move object. More...
 
virtual void CommonSettingsChanged (bool aEnvVarsChanged, bool aTextVarsChanged)
 Notification event that some of the common (suite-wide) settings have changed. More...
 
virtual void RefreshCanvas ()
 
virtual wxString ConfigBaseName ()
 

Public Attributes

wxTextCtrl * yoff
 

Protected Attributes

TOOL_MANAGERm_toolManager
 
ACTIONSm_actions
 
TOOL_DISPATCHERm_toolDispatcher
 
SELECTION m_dummySelection
 
std::vector< std::string > m_toolStack
 
bool m_immediateActions
 
MOUSE_DRAG_ACTION m_dragAction
 
bool m_moveWarpsCursor
 
wxStaticText * m_staticText1
 
wxTextCtrl * xscale
 
wxSpinButton * m_spinXscale
 
wxStaticText * m_staticText2
 
wxTextCtrl * yscale
 
wxSpinButton * m_spinYscale
 
wxStaticText * m_staticText3
 
wxTextCtrl * zscale
 
wxSpinButton * m_spinZscale
 
wxStaticText * m_staticText11
 
wxTextCtrl * xrot
 
wxSpinButton * m_spinXrot
 
wxStaticText * m_staticText21
 
wxTextCtrl * yrot
 
wxSpinButton * m_spinYrot
 
wxStaticText * m_staticText31
 
wxTextCtrl * zrot
 
wxSpinButton * m_spinZrot
 
wxStaticText * m_staticText12
 
wxTextCtrl * xoff
 
wxSpinButton * m_spinXoffset
 
wxStaticText * m_staticText22
 
wxSpinButton * m_spinYoffset
 
wxStaticText * m_staticText32
 
wxTextCtrl * zoff
 
wxSpinButton * m_spinZoffset
 
wxSlider * m_opacity
 
wxBoxSizer * m_SizerPanelView
 
wxBitmapButton * m_bpvISO
 
wxBitmapButton * m_bpvLeft
 
wxBitmapButton * m_bpvRight
 
wxBitmapButton * m_bpvFront
 
wxBitmapButton * m_bpvBack
 
wxBitmapButton * m_bpvTop
 
wxBitmapButton * m_bpvBottom
 
wxBitmapButton * m_bpUpdate
 

Private Member Functions

void loadCommonSettings ()
 Load 3D relevant settings from the user configuration. More...
 
void updateOrientation (wxCommandEvent &event) override
 It will receive the events from editing the fields. More...
 
void onMouseWheelScale (wxMouseEvent &event) override
 
void onMouseWheelRot (wxMouseEvent &event) override
 
void onMouseWheelOffset (wxMouseEvent &event) override
 
void onIncrementRot (wxSpinEvent &event) override
 
void onDecrementRot (wxSpinEvent &event) override
 
void onIncrementScale (wxSpinEvent &event) override
 
void onDecrementScale (wxSpinEvent &event) override
 
void onIncrementOffset (wxSpinEvent &event) override
 
void onDecrementOffset (wxSpinEvent &event) override
 
void onOpacitySlider (wxCommandEvent &event) override
 
void doIncrementScale (wxSpinEvent &aEvent, double aSign)
 
void doIncrementRotation (wxSpinEvent &aEvent, double aSign)
 
void doIncrementOffset (wxSpinEvent &aEvent, double aSign)
 
wxString formatScaleValue (double aValue)
 
wxString formatRotationValue (double aValue)
 
wxString formatOffsetValue (double aValue)
 
void View3DISO (wxCommandEvent &event) override
 
void View3DLeft (wxCommandEvent &event) override
 
void View3DFront (wxCommandEvent &event) override
 
void View3DTop (wxCommandEvent &event) override
 
void View3DUpdate (wxCommandEvent &event) override
 
void View3DRight (wxCommandEvent &event) override
 
void View3DBack (wxCommandEvent &event) override
 
void View3DBottom (wxCommandEvent &event) override
 

Private Attributes

EDA_3D_CANVASm_previewPane
 
WX_INFOBARm_infobar
 
BOARD_ADAPTER m_boardAdapter
 
CAMERAm_currentCamera
 
TRACK_BALL m_trackBallCamera
 
BOARDm_dummyBoard
 
FOOTPRINTm_dummyFootprint
 
std::vector< FP_3DMODEL > * m_parentModelList
 
int m_selected
 
EDA_UNITS m_userUnits
 Index into m_parentInfoList. More...
 

Detailed Description

Definition at line 74 of file panel_prev_3d.h.

Constructor & Destructor Documentation

◆ PANEL_PREV_3D()

PANEL_PREV_3D::PANEL_PREV_3D ( wxWindow *  aParent,
PCB_BASE_FRAME aFrame,
FOOTPRINT aFootprint,
std::vector< FP_3DMODEL > *  aParentModelList 
)

Definition at line 44 of file panel_prev_3d.cpp.

45  :
46  PANEL_PREV_3D_BASE( aParent, wxID_ANY ),
47  m_previewPane( nullptr ),
48  m_infobar( nullptr ),
52 {
53  m_userUnits = aFrame->GetUserUnits();
54 
55  m_dummyBoard = new BOARD();
56 
57  // This board will only be used to hold a footprint for viewing
59 
60  m_selected = -1;
61 
62  // Set the bitmap of 3D view buttons:
63  m_bpvTop->SetBitmap( KiBitmap( BITMAPS::axis3d_top ) );
64  m_bpvFront->SetBitmap( KiBitmap( BITMAPS::axis3d_front ) );
65  m_bpvBack->SetBitmap( KiBitmap( BITMAPS::axis3d_back ) );
66  m_bpvLeft->SetBitmap( KiBitmap( BITMAPS::axis3d_left ) );
67  m_bpvRight->SetBitmap( KiBitmap( BITMAPS::axis3d_right ) );
69  m_bpvISO->SetBitmap( KiBitmap( BITMAPS::ortho ) );
70  m_bpUpdate->SetBitmap( KiBitmap( BITMAPS::reload ) );
71 
72  // Set the min and max values of spin buttons (mandatory on Linux)
73  // They are not used, so they are set to min and max 32 bits int values
74  // (the min and max values supported by a wxSpinButton)
75  // It avoids blocking the up or down arrows when reaching this limit after
76  // a few clicks.
77  wxSpinButton* spinButtonList[] =
78  {
82  };
83 
84  for( wxSpinButton* button : spinButtonList )
85  button->SetRange(INT_MIN, INT_MAX );
86 
87  m_parentModelList = aParentModelList;
88 
89  m_dummyFootprint = new FOOTPRINT( *aFootprint );
91 
92  // Create the 3D canvas
93  m_previewPane = new EDA_3D_CANVAS( this,
96  aFrame->Prj().Get3DCacheManager() );
97 
99 
101 
102  // Create the manager
104  m_toolManager->SetEnvironment( m_dummyBoard, nullptr, nullptr, nullptr, this );
105 
106  m_actions = new EDA_3D_ACTIONS();
109 
110  // Register tools
113 
114  // Run the viewer control tool, it is supposed to be always active
115  m_toolManager->InvokeTool( "3DViewer.Control" );
116 
117  m_infobar = new WX_INFOBAR( this );
119 
120  m_SizerPanelView->Add( m_infobar, 0, wxEXPAND, 0 );
121  m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
122 
123  for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
124  Connect( eventType, wxMenuEventHandler( PANEL_PREV_3D::OnMenuEvent ), NULL, this );
125 
126 #ifdef __WXOSX__
127  // Call layout once to get the proper button sizes after the bitmaps have been set
128  Layout();
129 
130  // The rounded-button style used has a small border on the left/right sides.
131  // This is automatically fixed in wx for buttons with a bitmap < 20, but not
132  // when the bitmap is set to be 26x26.
133  wxSize borderFix = wxSize( 4, 4 );
134 
135  m_bpvTop->SetMinSize( m_bpvTop->GetSize() + borderFix );
136  m_bpvFront->SetMinSize( m_bpvFront->GetSize() + borderFix );
137  m_bpvBack->SetMinSize( m_bpvBack->GetSize() + borderFix );
138  m_bpvLeft->SetMinSize( m_bpvLeft->GetSize() + borderFix );
139  m_bpvRight->SetMinSize( m_bpvRight->GetSize() + borderFix );
140  m_bpvBottom->SetMinSize( m_bpvBottom->GetSize() + borderFix );
141  m_bpvISO->SetMinSize( m_bpvISO->GetSize() + borderFix );
142  m_bpUpdate->SetMinSize( m_bpUpdate->GetSize() + borderFix );
143 #endif
144 }
wxBitmapButton * m_bpvTop
wxBitmapButton * m_bpvBottom
wxSpinButton * m_spinZoffset
wxSpinButton * m_spinYoffset
wxBitmapButton * m_bpvBack
wxBitmapButton * m_bpvLeft
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
Set the status of a flag.
EDA_3D_ACTIONS.
Definition: 3d_actions.h:41
WX_INFOBAR * m_infobar
wxBitmapButton * m_bpUpdate
EDA_UNITS m_userUnits
Index into m_parentInfoList.
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:48
wxBoxSizer * m_SizerPanelView
std::vector< FP_3DMODEL > * m_parentModelList
static const int * GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode)
Get a list of attributes to pass to wxGLCanvas.
bool InvokeTool(TOOL_ID aToolId)
Call a tool by sending a tool activation event to tool of given ID.
wxBitmapButton * m_bpvRight
FOOTPRINT * m_dummyFootprint
Master controller class:
Definition: tool_manager.h:52
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
Definition: board.cpp:563
wxSpinButton * m_spinZrot
void SetInfoBar(WX_INFOBAR *aInfoBar)
Definition: eda_3d_canvas.h:79
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
#define NULL
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
wxSpinButton * m_spinXoffset
void loadCommonSettings()
Load 3D relevant settings from the user configuration.
EDA_3D_CONTROLLER.
Definition: 3d_controller.h:39
void OnMenuEvent(wxMenuEvent &aEvent)
The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't ...
EDA_3D_CANVAS * m_previewPane
ACTIONS * m_actions
Definition: tools_holder.h:158
wxSpinButton * m_spinYrot
PANEL_PREV_3D_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxSpinButton * m_spinXrot
wxBitmapButton * m_bpvFront
wxSpinButton * m_spinZscale
wxSpinButton * m_spinXscale
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:159
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:71
TRACK_BALL m_trackBallCamera
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:157
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Set the work environment (model, view, view controls and the parent window).
wxBitmapButton * m_bpvISO
CAMERA & m_currentCamera
void InitTools()
Initializes all registered tools.
BOARD * m_dummyBoard
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: board_adapter.h:61
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
Definition: board.h:262
void RegisterTool(TOOL_BASE *aTool)
Add a tool to the manager set and sets it up.
BOARD_ADAPTER m_boardAdapter
wxSpinButton * m_spinYscale
wxBitmap KiBitmap(BITMAPS aBitmap)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104

References AA_8X, BOARD::Add(), axis3d_back, axis3d_bottom, axis3d_front, axis3d_left, axis3d_right, axis3d_top, FL_USE_SELECTION, FPHOLDER, OGL_ATT_LIST::GetAttributesList(), EDA_BASE_FRAME::GetUserUnits(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::InvokeTool(), KiBitmap(), loadCommonSettings(), TOOLS_HOLDER::m_actions, m_boardAdapter, PANEL_PREV_3D_BASE::m_bpUpdate, PANEL_PREV_3D_BASE::m_bpvBack, PANEL_PREV_3D_BASE::m_bpvBottom, PANEL_PREV_3D_BASE::m_bpvFront, PANEL_PREV_3D_BASE::m_bpvISO, PANEL_PREV_3D_BASE::m_bpvLeft, PANEL_PREV_3D_BASE::m_bpvRight, PANEL_PREV_3D_BASE::m_bpvTop, m_currentCamera, m_dummyBoard, m_dummyFootprint, m_infobar, m_parentModelList, m_previewPane, m_selected, PANEL_PREV_3D_BASE::m_SizerPanelView, PANEL_PREV_3D_BASE::m_spinXoffset, PANEL_PREV_3D_BASE::m_spinXrot, PANEL_PREV_3D_BASE::m_spinXscale, PANEL_PREV_3D_BASE::m_spinYoffset, PANEL_PREV_3D_BASE::m_spinYrot, PANEL_PREV_3D_BASE::m_spinYscale, PANEL_PREV_3D_BASE::m_spinZoffset, PANEL_PREV_3D_BASE::m_spinZrot, PANEL_PREV_3D_BASE::m_spinZscale, TOOLS_HOLDER::m_toolDispatcher, TOOLS_HOLDER::m_toolManager, m_userUnits, NULL, OnMenuEvent(), ortho, KIWAY_HOLDER::Prj(), TOOL_MANAGER::RegisterTool(), reload, BOARD::SetBoardUse(), TOOL_MANAGER::SetEnvironment(), EDA_3D_CANVAS::SetEventDispatcher(), BOARD_ADAPTER::SetFlag(), and EDA_3D_CANVAS::SetInfoBar().

◆ ~PANEL_PREV_3D()

PANEL_PREV_3D::~PANEL_PREV_3D ( )

Definition at line 147 of file panel_prev_3d.cpp.

148 {
149  delete m_dummyBoard;
150  delete m_previewPane;
151 }
EDA_3D_CANVAS * m_previewPane
BOARD * m_dummyBoard

References m_dummyBoard, and m_previewPane.

Member Function Documentation

◆ CommonSettingsChanged()

void TOOLS_HOLDER::CommonSettingsChanged ( bool  aEnvVarsChanged,
bool  aTextVarsChanged 
)
virtualinherited

Notification event that some of the common (suite-wide) settings have changed.

Update hotkeys, preferences, etc.

Reimplemented in SCH_EDIT_FRAME, PCB_EDIT_FRAME, EDA_BASE_FRAME, GERBVIEW_FRAME, PCB_BASE_FRAME, SYMBOL_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, SCH_BASE_FRAME, EDA_DRAW_FRAME, EDA_3D_VIEWER, PL_EDITOR_FRAME, FOOTPRINT_VIEWER_FRAME, KICAD_MANAGER_FRAME, and SYMBOL_VIEWER_FRAME.

Definition at line 117 of file tools_holder.cpp.

118 {
119  if( GetToolManager() )
121 
122  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
123 
125  m_dragAction = settings->m_Input.drag_left;
127 }
MOUSE_DRAG_ACTION drag_left
void UpdateHotKeys(bool aFullUpdate)
Optionally read the hotkey config files and then rebuilds the internal hotkey maps.
bool m_immediateActions
Definition: tools_holder.h:170
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
bool m_moveWarpsCursor
Definition: tools_holder.h:176
MOUSE_DRAG_ACTION m_dragAction
Definition: tools_holder.h:174
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:197
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55

References COMMON_SETTINGS::INPUT::drag_left, TOOL_MANAGER::GetActionManager(), TOOLS_HOLDER::GetToolManager(), COMMON_SETTINGS::INPUT::immediate_actions, TOOLS_HOLDER::m_dragAction, TOOLS_HOLDER::m_immediateActions, COMMON_SETTINGS::m_Input, TOOLS_HOLDER::m_moveWarpsCursor, Pgm(), ACTION_MANAGER::UpdateHotKeys(), and COMMON_SETTINGS::INPUT::warp_mouse_on_move.

Referenced by EDA_BASE_FRAME::CommonSettingsChanged(), and EDA_BASE_FRAME::LoadWindowSettings().

◆ ConfigBaseName()

virtual wxString TOOLS_HOLDER::ConfigBaseName ( )
inlinevirtualinherited

Reimplemented in EDA_BASE_FRAME.

Definition at line 154 of file tools_holder.h.

154 { return wxEmptyString; }

Referenced by ACTION_MANAGER::UpdateHotKeys().

◆ CurrentToolName()

std::string TOOLS_HOLDER::CurrentToolName ( ) const
inherited

Definition at line 99 of file tools_holder.cpp.

100 {
101  if( m_toolStack.empty() )
102  return ACTIONS::selectionTool.GetName();
103  else
104  return m_toolStack.back();
105 }
std::vector< std::string > m_toolStack
Definition: tools_holder.h:163
static TOOL_ACTION selectionTool
Definition: actions.h:156

References TOOLS_HOLDER::m_toolStack, and ACTIONS::selectionTool.

Referenced by TOOL_MANAGER::processEvent().

◆ DisplayToolMsg()

virtual void TOOLS_HOLDER::DisplayToolMsg ( const wxString &  msg)
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 122 of file tools_holder.h.

122 {};

Referenced by TOOLS_HOLDER::PopTool(), and TOOLS_HOLDER::PushTool().

◆ doIncrementOffset()

void PANEL_PREV_3D::doIncrementOffset ( wxSpinEvent &  aEvent,
double  aSign 
)
private

Definition at line 348 of file panel_prev_3d.cpp.

349 {
350  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
351 
352  wxTextCtrl * textCtrl = xoff;
353 
354  if( spinCtrl == m_spinYoffset )
355  textCtrl = yoff;
356  else if( spinCtrl == m_spinZoffset )
357  textCtrl = zoff;
358 
359  double step = OFFSET_INCREMENT_MM;
360 
362  step = OFFSET_INCREMENT_MIL/1000.0;
363 
364  double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
365 
366  curr_value += ( step * aSign );
367  curr_value = std::max( -MAX_OFFSET, curr_value );
368  curr_value = std::min( curr_value, MAX_OFFSET );
369 
370  textCtrl->SetValue( formatOffsetValue( curr_value ) );
371 }
wxSpinButton * m_spinZoffset
wxSpinButton * m_spinYoffset
static constexpr double IU_PER_MM
Mock up a conversion function.
EDA_UNITS m_userUnits
Index into m_parentInfoList.
wxString formatOffsetValue(double aValue)
#define OFFSET_INCREMENT_MIL
Definition: panel_prev_3d.h:62
#define MAX_OFFSET
Definition: panel_prev_3d.h:50
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:328
#define OFFSET_INCREMENT_MM
Definition: panel_prev_3d.h:59

References DoubleValueFromString(), formatOffsetValue(), INCHES, IU_PER_MM, PANEL_PREV_3D_BASE::m_spinYoffset, PANEL_PREV_3D_BASE::m_spinZoffset, m_userUnits, MAX_OFFSET, OFFSET_INCREMENT_MIL, OFFSET_INCREMENT_MM, PANEL_PREV_3D_BASE::xoff, PANEL_PREV_3D_BASE::yoff, and PANEL_PREV_3D_BASE::zoff.

Referenced by onDecrementOffset(), and onIncrementOffset().

◆ doIncrementRotation()

void PANEL_PREV_3D::doIncrementRotation ( wxSpinEvent &  aEvent,
double  aSign 
)
private

Definition at line 328 of file panel_prev_3d.cpp.

329 {
330  wxSpinButton* spinCtrl = (wxSpinButton*) aEvent.GetEventObject();
331  wxTextCtrl* textCtrl = xrot;
332 
333  if( spinCtrl == m_spinYrot )
334  textCtrl = yrot;
335  else if( spinCtrl == m_spinZrot )
336  textCtrl = zrot;
337 
338  double curr_value = DoubleValueFromString( EDA_UNITS::DEGREES, textCtrl->GetValue() ) / 10.0;
339 
340  curr_value += ( ROTATION_INCREMENT * aSign );
341  curr_value = std::max( -MAX_ROTATION, curr_value );
342  curr_value = std::min( curr_value, MAX_ROTATION );
343 
344  textCtrl->SetValue( formatRotationValue( curr_value ) );
345 }
wxString formatRotationValue(double aValue)
wxSpinButton * m_spinZrot
#define ROTATION_INCREMENT
Definition: panel_prev_3d.h:55
wxSpinButton * m_spinYrot
#define MAX_ROTATION
Definition: panel_prev_3d.h:49
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:328

References DEGREES, DoubleValueFromString(), formatRotationValue(), PANEL_PREV_3D_BASE::m_spinYrot, PANEL_PREV_3D_BASE::m_spinZrot, MAX_ROTATION, ROTATION_INCREMENT, PANEL_PREV_3D_BASE::xrot, PANEL_PREV_3D_BASE::yrot, and PANEL_PREV_3D_BASE::zrot.

Referenced by onDecrementRot(), and onIncrementRot().

◆ doIncrementScale()

void PANEL_PREV_3D::doIncrementScale ( wxSpinEvent &  aEvent,
double  aSign 
)
private

Definition at line 307 of file panel_prev_3d.cpp.

308 {
309  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
310 
311  wxTextCtrl * textCtrl = xscale;
312 
313  if( spinCtrl == m_spinYscale )
314  textCtrl = yscale;
315  else if( spinCtrl == m_spinZscale )
316  textCtrl = zscale;
317 
318  double curr_value = DoubleValueFromString( EDA_UNITS::UNSCALED, textCtrl->GetValue() );
319 
320  curr_value += ( SCALE_INCREMENT * aSign );
321  curr_value = std::max( 1/MAX_SCALE, curr_value );
322  curr_value = std::min( curr_value, MAX_SCALE );
323 
324  textCtrl->SetValue( formatScaleValue( curr_value ) );
325 }
#define MAX_SCALE
Definition: panel_prev_3d.h:48
wxString formatScaleValue(double aValue)
#define SCALE_INCREMENT
Definition: panel_prev_3d.h:53
wxSpinButton * m_spinZscale
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:328
wxSpinButton * m_spinYscale

References DoubleValueFromString(), formatScaleValue(), PANEL_PREV_3D_BASE::m_spinYscale, PANEL_PREV_3D_BASE::m_spinZscale, MAX_SCALE, SCALE_INCREMENT, UNSCALED, PANEL_PREV_3D_BASE::xscale, PANEL_PREV_3D_BASE::yscale, and PANEL_PREV_3D_BASE::zscale.

Referenced by onDecrementScale(), and onIncrementScale().

◆ formatOffsetValue()

wxString PANEL_PREV_3D::formatOffsetValue ( double  aValue)
private

Definition at line 213 of file panel_prev_3d.cpp.

214 {
215  // Convert from internal units (mm) to user units
217  aValue /= 25.4f;
218 
219  return wxString::Format( "%.4f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
220 }
EDA_UNITS m_userUnits
Index into m_parentInfoList.
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:458
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References Format(), GetAbbreviatedUnitsLabel(), INCHES, and m_userUnits.

Referenced by doIncrementOffset(), onMouseWheelOffset(), and SetSelectedModel().

◆ formatRotationValue()

wxString PANEL_PREV_3D::formatRotationValue ( double  aValue)
private

Definition at line 207 of file panel_prev_3d.cpp.

208 {
209  return wxString::Format( "%.2f %s", aValue, GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
210 }
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:458
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References DEGREES, Format(), and GetAbbreviatedUnitsLabel().

Referenced by doIncrementRotation(), onMouseWheelRot(), and SetSelectedModel().

◆ formatScaleValue()

wxString PANEL_PREV_3D::formatScaleValue ( double  aValue)
private

Definition at line 201 of file panel_prev_3d.cpp.

202 {
203  return wxString::Format( "%.4f", aValue );
204 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References Format().

Referenced by doIncrementScale(), onMouseWheelScale(), and SetSelectedModel().

◆ GetAdapter()

BOARD_ADAPTER& PANEL_PREV_3D::GetAdapter ( )
inlineoverridevirtual

Implements EDA_3D_BOARD_HOLDER.

Definition at line 90 of file panel_prev_3d.h.

90 { return m_boardAdapter; }
BOARD_ADAPTER m_boardAdapter

References m_boardAdapter.

◆ GetCurrentCamera()

CAMERA& PANEL_PREV_3D::GetCurrentCamera ( )
inlineoverridevirtual

Implements EDA_3D_BOARD_HOLDER.

Definition at line 91 of file panel_prev_3d.h.

91 { return m_currentCamera; }
CAMERA & m_currentCamera

References m_currentCamera.

◆ GetCurrentSelection()

virtual SELECTION& TOOLS_HOLDER::GetCurrentSelection ( )
inlinevirtualinherited

Get the current selection from the canvas area.

Returns
the current selection.

Reimplemented in PCB_EDIT_FRAME, GERBVIEW_FRAME, SYMBOL_VIEWER_FRAME, PL_EDITOR_FRAME, DISPLAY_FOOTPRINTS_FRAME, SCH_EDIT_FRAME, SYMBOL_EDIT_FRAME, FOOTPRINT_VIEWER_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 102 of file tools_holder.h.

103  {
104  return m_dummySelection;
105  }
SELECTION m_dummySelection
Definition: tools_holder.h:161

References TOOLS_HOLDER::m_dummySelection.

Referenced by EDA_BASE_FRAME::HandleUpdateUIEvent(), and ACTION_MANAGER::RunHotKey().

◆ GetDoImmediateActions()

bool TOOLS_HOLDER::GetDoImmediateActions ( ) const
inlineinherited

Indicate that hotkeys should perform an immediate action even if another tool is currently active.

If false, the first hotkey should select the relevant tool.

Definition at line 128 of file tools_holder.h.

128 { return m_immediateActions; }
bool m_immediateActions
Definition: tools_holder.h:170

References TOOLS_HOLDER::m_immediateActions.

◆ GetDragAction()

MOUSE_DRAG_ACTION TOOLS_HOLDER::GetDragAction ( ) const
inlineinherited

Indicates whether a drag should draw a selection rectangle or drag selected (or unselected) objects.

Definition at line 134 of file tools_holder.h.

134 { return m_dragAction; }
MOUSE_DRAG_ACTION m_dragAction
Definition: tools_holder.h:174

References TOOLS_HOLDER::m_dragAction.

Referenced by PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), and PCB_SELECTION_TOOL::Main().

◆ GetMoveWarpsCursor()

bool TOOLS_HOLDER::GetMoveWarpsCursor ( ) const
inlineinherited

Indicate that a move operation should warp the mouse pointer to the origin of the move object.

This improves snapping, but some users are allergic to mouse warping.

Definition at line 140 of file tools_holder.h.

140 { return m_moveWarpsCursor; }
bool m_moveWarpsCursor
Definition: tools_holder.h:176

References TOOLS_HOLDER::m_moveWarpsCursor.

Referenced by EDIT_TOOL::doMoveSelection(), ROUTER_TOOL::InlineDrag(), SYMBOL_EDITOR_MOVE_TOOL::Main(), and SCH_MOVE_TOOL::Main().

◆ GetToolCanvas()

wxWindow* PANEL_PREV_3D::GetToolCanvas ( ) const
inlineoverridevirtual

Canvas access.

Implements TOOLS_HOLDER.

Definition at line 88 of file panel_prev_3d.h.

88 { return m_previewPane; }
EDA_3D_CANVAS * m_previewPane

References m_previewPane.

◆ GetToolManager()

TOOL_MANAGER* TOOLS_HOLDER::GetToolManager ( ) const
inlineinherited

Return the MVC controller.

Definition at line 55 of file tools_holder.h.

55 { return m_toolManager; }
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:157

References TOOLS_HOLDER::m_toolManager.

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), BOARD_COMMIT::BOARD_COMMIT(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), TOOLS_HOLDER::CommonSettingsChanged(), DIALOG_FOOTPRINT_CHECKER::deleteAllMarkers(), DIALOG_ERC::deleteAllMarkers(), DIALOG_DRC::deleteAllMarkers(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), DIALOG_CLEANUP_GRAPHICS::doCleanup(), SIM_PLOT_FRAME::doCloseWindow(), DIALOG_GLOBAL_DELETION::doGlobalDeletions(), SCH_FIELD::DoHypertextMenu(), DRAWING_TOOL::DrawVia(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), GERBVIEW_FRAME::GERBVIEW_FRAME(), FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_NAVIGATE_TOOL::HypertextCommand(), ROUTER_TOOL::InlineBreakTrack(), KICAD_MANAGER_FRAME::InstallPreferences(), PL_EDITOR_FRAME::InstallPreferences(), FOOTPRINT_EDIT_FRAME::InstallPreferences(), SYMBOL_EDIT_FRAME::InstallPreferences(), GERBVIEW_FRAME::InstallPreferences(), PCB_EDIT_FRAME::InstallPreferences(), SCH_EDIT_FRAME::InstallPreferences(), SYMBOL_EDIT_FRAME::LoadPart(), PCB_EDIT_FRAME::LoadProjectSettings(), FOOTPRINT_EDIT_FRAME::LoadSettings(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_DRC::OnActivateDlg(), DIALOG_FOOTPRINT_CHECKER::OnCancelClick(), DIALOG_DRC::OnCancelClick(), DIALOG_INSPECTOR::onCellClicked(), DIALOG_ERC::OnCloseErcDialog(), SYMBOL_TREE_PANE::onComponentSelected(), DIALOG_FOOTPRINT_CHECKER::OnDeleteOneClick(), DIALOG_DRC::OnDeleteOneClick(), DIALOG_ERC::OnERCItemSelected(), DIALOG_CONSTRAINTS_REPORTER::OnErrorLinkClicked(), DIALOG_INSPECTION_REPORTER::OnErrorLinkClicked(), KICAD_MANAGER_FRAME::OnIdle(), FOOTPRINTS_LISTBOX::OnLeftDClick(), APPEARANCE_CONTROLS::onNetclassContextMenu(), APPEARANCE_CONTROLS::onNetContextMenu(), SIM_PLOT_FRAME::onProbe(), DIALOG_PLOT::onRunDRC(), DIALOG_DRC::OnRunDRCClick(), HIERARCHY_NAVIG_DLG::onSelectSheetPath(), SCH_EDIT_FRAME::onSize(), DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick(), SIM_PLOT_FRAME::onTune(), PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER(), DIALOG_PLOT::Plot(), TOOLS_HOLDER::PopTool(), SCH_EDIT_FRAME::PutDataInPreviousState(), PL_EDITOR_FRAME::RollbackFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_EDIT_FRAME::SaveSettings(), EDA_3D_VIEWER::SaveSettings(), DIALOG_FIND::search(), CVPCB_MAINFRAME::setupEventHandlers(), APPEARANCE_CONTROLS::showNetclass(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow(), DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataToWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow(), EDA_DRAW_FRAME::UpdateMsgPanel(), NET_GRID_TABLE::updateNetVisibility(), DIALOG_NETLIST::~DIALOG_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ IsCurrentTool()

bool TOOLS_HOLDER::IsCurrentTool ( const TOOL_ACTION aAction) const
inherited

Definition at line 108 of file tools_holder.cpp.

109 {
110  if( m_toolStack.empty() )
111  return &aAction == &ACTIONS::selectionTool;
112  else
113  return m_toolStack.back() == aAction.GetName();
114 }
std::vector< std::string > m_toolStack
Definition: tools_holder.h:163
static TOOL_ACTION selectionTool
Definition: actions.h:156
const std::string & GetName() const
Return name of the action.
Definition: tool_action.h:83

References TOOL_ACTION::GetName(), TOOLS_HOLDER::m_toolStack, and ACTIONS::selectionTool.

Referenced by BOARD_INSPECTION_TOOL::HighlightNetTool(), SCH_EDIT_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), and EDITOR_CONDITIONS::toolFunc().

◆ loadCommonSettings()

void PANEL_PREV_3D::loadCommonSettings ( )
private

Load 3D relevant settings from the user configuration.

Definition at line 163 of file panel_prev_3d.cpp.

164 {
165  wxCHECK_RET( m_previewPane, "Cannot load settings to null canvas" );
166 
167  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
168 
169  const DPI_SCALING dpi{ settings, this };
170  m_previewPane->SetScaleFactor( dpi.GetScaleFactor() );
171 
172  // TODO(JE) use all control options
174 }
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
Set the status of a flag.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
Definition: dpi_scaling.h:36
EDA_3D_CANVAS * m_previewPane
void SetScaleFactor(double aFactor)
Set the canvas scale factor, probably for a hi-DPI display.
BOARD_ADAPTER m_boardAdapter

References FL_MOUSEWHEEL_PANNING, m_boardAdapter, COMMON_SETTINGS::m_Input, m_previewPane, Pgm(), COMMON_SETTINGS::INPUT::scroll_modifier_zoom, BOARD_ADAPTER::SetFlag(), and HIDPI_GL_CANVAS::SetScaleFactor().

Referenced by PANEL_PREV_3D().

◆ onDecrementOffset()

void PANEL_PREV_3D::onDecrementOffset ( wxSpinEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 140 of file panel_prev_3d.h.

141  {
142  doIncrementOffset( event, -1.0 );
143  }
void doIncrementOffset(wxSpinEvent &aEvent, double aSign)

References doIncrementOffset().

◆ onDecrementRot()

void PANEL_PREV_3D::onDecrementRot ( wxSpinEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 124 of file panel_prev_3d.h.

125  {
126  doIncrementRotation( event, -1.0 );
127  }
void doIncrementRotation(wxSpinEvent &aEvent, double aSign)

References doIncrementRotation().

◆ onDecrementScale()

void PANEL_PREV_3D::onDecrementScale ( wxSpinEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 132 of file panel_prev_3d.h.

133  {
134  doIncrementScale( event, -1.0 );
135  }
void doIncrementScale(wxSpinEvent &aEvent, double aSign)

References doIncrementScale().

◆ onIncrementOffset()

void PANEL_PREV_3D::onIncrementOffset ( wxSpinEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 136 of file panel_prev_3d.h.

137  {
138  doIncrementOffset( event, 1.0 );
139  }
void doIncrementOffset(wxSpinEvent &aEvent, double aSign)

References doIncrementOffset().

◆ onIncrementRot()

void PANEL_PREV_3D::onIncrementRot ( wxSpinEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 120 of file panel_prev_3d.h.

121  {
122  doIncrementRotation( event, 1.0 );
123  }
void doIncrementRotation(wxSpinEvent &aEvent, double aSign)

References doIncrementRotation().

◆ onIncrementScale()

void PANEL_PREV_3D::onIncrementScale ( wxSpinEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 128 of file panel_prev_3d.h.

129  {
130  doIncrementScale( event, 1.0 );
131  }
void doIncrementScale(wxSpinEvent &aEvent, double aSign)

References doIncrementScale().

◆ OnMenuEvent()

void PANEL_PREV_3D::OnMenuEvent ( wxMenuEvent &  aEvent)

The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't captured by the menus themselves.

Definition at line 154 of file panel_prev_3d.cpp.

155 {
156  if( !m_toolDispatcher )
157  aEvent.Skip();
158  else
160 }
virtual void DispatchWxEvent(wxEvent &aEvent)
Process wxEvents (mostly UI events), translate them to TOOL_EVENTs, and make tools handle those.
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:159

References TOOL_DISPATCHER::DispatchWxEvent(), and TOOLS_HOLDER::m_toolDispatcher.

Referenced by PANEL_PREV_3D().

◆ onMouseWheelOffset()

void PANEL_PREV_3D::onMouseWheelOffset ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 418 of file panel_prev_3d.cpp.

419 {
420  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
421 
422  double step = OFFSET_INCREMENT_MM;
423 
424  if( event.ShiftDown( ) )
426 
428  {
429  step = OFFSET_INCREMENT_MIL/1000.0;
430 
431  if( event.ShiftDown( ) )
432  step = OFFSET_INCREMENT_MIL_FINE/1000.0;
433  }
434 
435  if( event.GetWheelRotation() >= 0 )
436  step = -step;
437 
438  double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
439 
440  curr_value += step;
441  curr_value = std::max( -MAX_OFFSET, curr_value );
442  curr_value = std::min( curr_value, MAX_OFFSET );
443 
444  textCtrl->SetValue( formatOffsetValue( curr_value ) );
445 }
static constexpr double IU_PER_MM
Mock up a conversion function.
EDA_UNITS m_userUnits
Index into m_parentInfoList.
wxString formatOffsetValue(double aValue)
#define OFFSET_INCREMENT_MM_FINE
Definition: panel_prev_3d.h:60
#define OFFSET_INCREMENT_MIL
Definition: panel_prev_3d.h:62
#define OFFSET_INCREMENT_MIL_FINE
Definition: panel_prev_3d.h:63
#define MAX_OFFSET
Definition: panel_prev_3d.h:50
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:328
#define OFFSET_INCREMENT_MM
Definition: panel_prev_3d.h:59

References DoubleValueFromString(), formatOffsetValue(), INCHES, IU_PER_MM, m_userUnits, MAX_OFFSET, OFFSET_INCREMENT_MIL, OFFSET_INCREMENT_MIL_FINE, OFFSET_INCREMENT_MM, and OFFSET_INCREMENT_MM_FINE.

◆ onMouseWheelRot()

void PANEL_PREV_3D::onMouseWheelRot ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 396 of file panel_prev_3d.cpp.

397 {
398  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
399 
400  double step = ROTATION_INCREMENT_WHEEL;
401 
402  if( event.ShiftDown( ) )
404 
405  if( event.GetWheelRotation() >= 0 )
406  step = -step;
407 
408  double curr_value = DoubleValueFromString( EDA_UNITS::DEGREES, textCtrl->GetValue() ) / 10.0;
409 
410  curr_value += step;
411  curr_value = std::max( -MAX_ROTATION, curr_value );
412  curr_value = std::min( curr_value, MAX_ROTATION );
413 
414  textCtrl->SetValue( formatRotationValue( curr_value ) );
415 }
wxString formatRotationValue(double aValue)
#define ROTATION_INCREMENT_WHEEL
Definition: panel_prev_3d.h:56
#define ROTATION_INCREMENT_WHEEL_FINE
Definition: panel_prev_3d.h:57
#define MAX_ROTATION
Definition: panel_prev_3d.h:49
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:328

References DEGREES, DoubleValueFromString(), formatRotationValue(), MAX_ROTATION, ROTATION_INCREMENT_WHEEL, and ROTATION_INCREMENT_WHEEL_FINE.

◆ onMouseWheelScale()

void PANEL_PREV_3D::onMouseWheelScale ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 374 of file panel_prev_3d.cpp.

375 {
376  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
377 
378  double step = SCALE_INCREMENT;
379 
380  if( event.ShiftDown( ) )
381  step = SCALE_INCREMENT_FINE;
382 
383  if( event.GetWheelRotation() >= 0 )
384  step = -step;
385 
386  double curr_value = DoubleValueFromString( EDA_UNITS::UNSCALED, textCtrl->GetValue() );
387 
388  curr_value += step;
389  curr_value = std::max( 1/MAX_SCALE, curr_value );
390  curr_value = std::min( curr_value, MAX_SCALE );
391 
392  textCtrl->SetValue( formatScaleValue( curr_value ) );
393 }
#define MAX_SCALE
Definition: panel_prev_3d.h:48
#define SCALE_INCREMENT_FINE
Definition: panel_prev_3d.h:52
wxString formatScaleValue(double aValue)
#define SCALE_INCREMENT
Definition: panel_prev_3d.h:53
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:328

References DoubleValueFromString(), formatScaleValue(), MAX_SCALE, SCALE_INCREMENT, SCALE_INCREMENT_FINE, and UNSCALED.

◆ onOpacitySlider()

void PANEL_PREV_3D::onOpacitySlider ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 292 of file panel_prev_3d.cpp.

293 {
294  if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
295  {
296  // Write settings back to the parent
297  FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
298 
299  modelInfo->m_Opacity = m_opacity->GetValue() / 100.0;
300 
301  // Update the dummy footprint for the preview
302  UpdateDummyFootprint( false );
303  }
304 }
std::vector< FP_3DMODEL > * m_parentModelList
void UpdateDummyFootprint(bool aRelaodRequired=true)
Copy shapes from the current shape list which are flagged for preview to the copy of footprint that i...
double m_Opacity
Definition: footprint.h:96

References PANEL_PREV_3D_BASE::m_opacity, FP_3DMODEL::m_Opacity, m_parentModelList, m_selected, and UpdateDummyFootprint().

◆ PopTool()

void TOOLS_HOLDER::PopTool ( const std::string &  actionName)
virtualinherited

Definition at line 60 of file tools_holder.cpp.

61 {
62  // Push/pop events can get out of order (such as when they're generated by the Simulator
63  // frame but not processed until the mouse is back in the Schematic frame), so make sure
64  // we're popping the right stack frame.
65 
66  for( int i = (int) m_toolStack.size() - 1; i >= 0; --i )
67  {
68  if( m_toolStack[ i ] == actionName )
69  {
70  m_toolStack.erase( m_toolStack.begin() + i );
71 
72  // If there's something underneath us, and it's now the top of the stack, then
73  // re-activate it
74  if( ( --i ) >= 0 && i == (int)m_toolStack.size() - 1 )
75  {
76  std::string back = m_toolStack[ i ];
78 
79  if( action )
80  {
81  // Pop the action as running it will push it back onto the stack
82  m_toolStack.pop_back();
83 
84  TOOL_EVENT evt = action->MakeEvent();
85  evt.SetHasPosition( false );
86  evt.SetReactivate( true );
87  GetToolManager()->PostEvent( evt );
88  }
89  }
90  else
92 
93  return;
94  }
95  }
96 }
virtual void DisplayToolMsg(const wxString &msg)
Definition: tools_holder.h:122
void SetReactivate(bool aReactivate=true)
Returns information about difference between current mouse cursor position and the place where draggi...
Definition: tool_event.h:274
TOOL_ACTION * FindAction(const std::string &aActionName) const
Find an action with a given name (if there is one available).
Generic, UI-independent tool event.
Definition: tool_event.h:173
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:157
std::vector< std::string > m_toolStack
Definition: tools_holder.h:163
Represent a single user action.
Definition: tool_action.h:49
TOOL_EVENT MakeEvent() const
Return the event associated with the action (i.e.
Definition: tool_action.h:123
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:197
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:267
static TOOL_ACTION selectionTool
Definition: actions.h:156
void SetHasPosition(bool aHasPosition)
Returns if the action associated with this event should be treated as immediate regardless of the cur...
Definition: tool_event.h:262

References TOOLS_HOLDER::DisplayToolMsg(), ACTION_MANAGER::FindAction(), TOOL_MANAGER::GetActionManager(), TOOLS_HOLDER::GetToolManager(), TOOLS_HOLDER::m_toolManager, TOOLS_HOLDER::m_toolStack, TOOL_ACTION::MakeEvent(), TOOL_MANAGER::PostEvent(), ACTIONS::selectionTool, TOOL_EVENT::SetHasPosition(), and TOOL_EVENT::SetReactivate().

Referenced by EDIT_TOOL::copyToClipboard(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), DRAWING_TOOL::InteractivePlaceWithPreview(), ZOOM_TOOL::Main(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ PushTool()

void TOOLS_HOLDER::PushTool ( const std::string &  actionName)
virtualinherited

NB: the definition of "tool" is different at the user level.

The implementation uses a single TOOL_BASE derived class to implement several user "tools", such as rectangle and circle, or wire and bus. So each user-level tool is actually a TOOL_ACTION.

Definition at line 43 of file tools_holder.cpp.

44 {
45  m_toolStack.push_back( actionName );
46 
47  // Human cognitive stacking is very shallow; deeper tool stacks just get annoying
48  if( m_toolStack.size() > 3 )
49  m_toolStack.erase( m_toolStack.begin() );
50 
51  TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
52 
53  if( action )
54  DisplayToolMsg( action->GetLabel() );
55  else
56  DisplayToolMsg( actionName );
57 }
virtual void DisplayToolMsg(const wxString &msg)
Definition: tools_holder.h:122
TOOL_ACTION * FindAction(const std::string &aActionName) const
Find an action with a given name (if there is one available).
wxString GetLabel() const
Definition: tool_action.cpp:70
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:157
std::vector< std::string > m_toolStack
Definition: tools_holder.h:163
Represent a single user action.
Definition: tool_action.h:49
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:197

References TOOLS_HOLDER::DisplayToolMsg(), ACTION_MANAGER::FindAction(), TOOL_MANAGER::GetActionManager(), TOOL_ACTION::GetLabel(), TOOLS_HOLDER::m_toolManager, and TOOLS_HOLDER::m_toolStack.

Referenced by EDIT_TOOL::copyToClipboard(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EnumeratePads(), DRAWING_TOOL::InteractivePlaceWithPreview(), ZOOM_TOOL::Main(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().

◆ RefreshCanvas()

virtual void TOOLS_HOLDER::RefreshCanvas ( )
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 152 of file tools_holder.h.

152 { }

Referenced by TOOL_MANAGER::ProcessEvent().

◆ RegisterUIUpdateHandler() [1/2]

virtual void TOOLS_HOLDER::RegisterUIUpdateHandler ( const TOOL_ACTION aAction,
const ACTION_CONDITIONS aConditions 
)
inlinevirtualinherited

Register an action's update conditions with the UI layer to allow the UI to appropriately display the state of its controls.

Parameters
aActionis the action to register.
aConditionsare the UI conditions to use for the control states.

Definition at line 64 of file tools_holder.h.

66  {
67  RegisterUIUpdateHandler( aAction.GetUIId(), aConditions );
68  }
int GetUIId() const
Definition: tool_action.h:112
virtual void RegisterUIUpdateHandler(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Register an action's update conditions with the UI layer to allow the UI to appropriately display the...
Definition: tools_holder.h:64

References TOOL_ACTION::GetUIId().

Referenced by ACTION_TOOLBAR::doSelectAction(), and ACTION_MANAGER::SetConditions().

◆ RegisterUIUpdateHandler() [2/2]

virtual void TOOLS_HOLDER::RegisterUIUpdateHandler ( int  aID,
const ACTION_CONDITIONS aConditions 
)
inlinevirtualinherited

Register a UI update handler for the control with ID aID.

Parameters
aIDis the control ID to register the handler for.
aConditionsare the UI conditions to use for the control states.

Reimplemented in EDA_BASE_FRAME.

Definition at line 76 of file tools_holder.h.

77  {}

◆ SetSelectedModel()

void PANEL_PREV_3D::SetSelectedModel ( int  idx)

Set the currently selected index in the model list so that the scale/rotation/offset controls can be updated.

Definition at line 223 of file panel_prev_3d.cpp.

224 {
225  if( m_parentModelList && idx >= 0 && idx < (int) m_parentModelList->size() )
226  {
227  m_selected = idx;
228  const FP_3DMODEL& modelInfo = m_parentModelList->at( (unsigned) m_selected );
229 
230  // Use ChangeValue() instead of SetValue(). It's not the user making the change, so we
231  // don't want to generate wxEVT_GRID_CELL_CHANGED events.
232  xscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.x ) );
233  yscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.y ) );
234  zscale->ChangeValue( formatScaleValue( modelInfo.m_Scale.z ) );
235 
236  xrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.x ) );
237  yrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.y ) );
238  zrot->ChangeValue( formatRotationValue( modelInfo.m_Rotation.z ) );
239 
240  xoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.x ) );
241  yoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.y ) );
242  zoff->ChangeValue( formatOffsetValue( modelInfo.m_Offset.z ) );
243 
244  m_opacity->SetValue( modelInfo.m_Opacity * 100.0 );
245  }
246  else
247  {
248  m_selected = -1;
249 
250  xscale->ChangeValue( wxEmptyString );
251  yscale->ChangeValue( wxEmptyString );
252  zscale->ChangeValue( wxEmptyString );
253 
254  xrot->ChangeValue( wxEmptyString );
255  yrot->ChangeValue( wxEmptyString );
256  zrot->ChangeValue( wxEmptyString );
257 
258  xoff->ChangeValue( wxEmptyString );
259  yoff->ChangeValue( wxEmptyString );
260  zoff->ChangeValue( wxEmptyString );
261 
262  m_opacity->SetValue( 100 );
263  }
264 }
wxString formatRotationValue(double aValue)
std::vector< FP_3DMODEL > * m_parentModelList
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:95
wxString formatScaleValue(double aValue)
wxString formatOffsetValue(double aValue)
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:93
double m_Opacity
Definition: footprint.h:96
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:94

References formatOffsetValue(), formatRotationValue(), formatScaleValue(), FP_3DMODEL::m_Offset, PANEL_PREV_3D_BASE::m_opacity, FP_3DMODEL::m_Opacity, m_parentModelList, FP_3DMODEL::m_Rotation, FP_3DMODEL::m_Scale, m_selected, FP_3DMODEL::VECTOR3D::x, PANEL_PREV_3D_BASE::xoff, PANEL_PREV_3D_BASE::xrot, PANEL_PREV_3D_BASE::xscale, FP_3DMODEL::VECTOR3D::y, PANEL_PREV_3D_BASE::yoff, PANEL_PREV_3D_BASE::yrot, PANEL_PREV_3D_BASE::yscale, FP_3DMODEL::VECTOR3D::z, PANEL_PREV_3D_BASE::zoff, PANEL_PREV_3D_BASE::zrot, and PANEL_PREV_3D_BASE::zscale.

Referenced by DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::select3DModel(), and DIALOG_FOOTPRINT_PROPERTIES::select3DModel().

◆ ToolStackIsEmpty()

◆ UnregisterUIUpdateHandler() [1/2]

virtual void TOOLS_HOLDER::UnregisterUIUpdateHandler ( const TOOL_ACTION aAction)
inlinevirtualinherited

Unregister a UI handler for an action that was registered using RegisterUIUpdateHandler.

Parameters
aActionis the action to unregister the handler for.

Definition at line 84 of file tools_holder.h.

85  {
87  }
int GetUIId() const
Definition: tool_action.h:112
virtual void UnregisterUIUpdateHandler(const TOOL_ACTION &aAction)
Unregister a UI handler for an action that was registered using RegisterUIUpdateHandler.
Definition: tools_holder.h:84

References TOOL_ACTION::GetUIId().

Referenced by ACTION_TOOLBAR::doSelectAction(), and ACTION_MANAGER::SetConditions().

◆ UnregisterUIUpdateHandler() [2/2]

virtual void TOOLS_HOLDER::UnregisterUIUpdateHandler ( int  aID)
inlinevirtualinherited

Unregister a UI handler for a given ID that was registered using RegisterUIUpdateHandler.

Parameters
aIDis the control ID to unregister the handler for.

Reimplemented in EDA_BASE_FRAME.

Definition at line 94 of file tools_holder.h.

95  {}

◆ UpdateDummyFootprint()

void PANEL_PREV_3D::UpdateDummyFootprint ( bool  aRelaodRequired = true)

Copy shapes from the current shape list which are flagged for preview to the copy of footprint that is on the preview dummy board.

Definition at line 448 of file panel_prev_3d.cpp.

449 {
450  m_dummyFootprint->Models().clear();
451 
452  for( FP_3DMODEL& model : *m_parentModelList )
453  {
454  if( model.m_Show )
455  m_dummyFootprint->Models().push_back( model );
456  }
457 
458  if( aReloadRequired )
460 
462 }
std::list< FP_3DMODEL > & Models()
Definition: footprint.h:178
std::vector< FP_3DMODEL > * m_parentModelList
void Request_refresh(bool aRedrawImmediately=true)
Schedule a refresh update of the canvas.
FOOTPRINT * m_dummyFootprint
EDA_3D_CANVAS * m_previewPane
void ReloadRequest(BOARD *aBoard=nullptr, S3D_CACHE *aCachePointer=nullptr)

References m_dummyFootprint, m_parentModelList, m_previewPane, FOOTPRINT::Models(), EDA_3D_CANVAS::ReloadRequest(), and EDA_3D_CANVAS::Request_refresh().

Referenced by DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_PROPERTIES::Cfg3DPath(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_PROPERTIES::On3DModelCellChanged(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_PROPERTIES::OnAdd3DModel(), onOpacitySlider(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnRemove3DModel(), DIALOG_FOOTPRINT_PROPERTIES::OnRemove3DModel(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), and updateOrientation().

◆ updateOrientation()

void PANEL_PREV_3D::updateOrientation ( wxCommandEvent &  event)
overrideprivatevirtual

It will receive the events from editing the fields.

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 267 of file panel_prev_3d.cpp.

268 {
269  if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() )
270  {
271  // Write settings back to the parent
272  FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected );
273 
274  modelInfo->m_Scale.x = DoubleValueFromString( EDA_UNITS::UNSCALED, xscale->GetValue() );
275  modelInfo->m_Scale.y = DoubleValueFromString( EDA_UNITS::UNSCALED, yscale->GetValue() );
276  modelInfo->m_Scale.z = DoubleValueFromString( EDA_UNITS::UNSCALED, zscale->GetValue() );
277 
278  modelInfo->m_Rotation.x = rotationFromString( xrot->GetValue() );
279  modelInfo->m_Rotation.y = rotationFromString( yrot->GetValue() );
280  modelInfo->m_Rotation.z = rotationFromString( zrot->GetValue() );
281 
282  modelInfo->m_Offset.x = DoubleValueFromString( m_userUnits, xoff->GetValue() ) / IU_PER_MM;
283  modelInfo->m_Offset.y = DoubleValueFromString( m_userUnits, yoff->GetValue() ) / IU_PER_MM;
284  modelInfo->m_Offset.z = DoubleValueFromString( m_userUnits, zoff->GetValue() ) / IU_PER_MM;
285 
286  // Update the dummy footprint for the preview
287  UpdateDummyFootprint( false );
288  }
289 }
static double rotationFromString(const wxString &aValue)
Ensure -MAX_ROTATION <= rotation <= MAX_ROTATION.
static constexpr double IU_PER_MM
Mock up a conversion function.
EDA_UNITS m_userUnits
Index into m_parentInfoList.
std::vector< FP_3DMODEL > * m_parentModelList
VECTOR3D m_Offset
3D model offset (mm)
Definition: footprint.h:95
void UpdateDummyFootprint(bool aRelaodRequired=true)
Copy shapes from the current shape list which are flagged for preview to the copy of footprint that i...
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: footprint.h:93
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: footprint.h:94
double DoubleValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function DoubleValueFromString converts aTextValue to a double.
Definition: base_units.cpp:328

References DoubleValueFromString(), IU_PER_MM, FP_3DMODEL::m_Offset, m_parentModelList, FP_3DMODEL::m_Rotation, FP_3DMODEL::m_Scale, m_selected, m_userUnits, rotationFromString(), UNSCALED, UpdateDummyFootprint(), FP_3DMODEL::VECTOR3D::x, PANEL_PREV_3D_BASE::xoff, PANEL_PREV_3D_BASE::xrot, PANEL_PREV_3D_BASE::xscale, FP_3DMODEL::VECTOR3D::y, PANEL_PREV_3D_BASE::yoff, PANEL_PREV_3D_BASE::yrot, PANEL_PREV_3D_BASE::yscale, FP_3DMODEL::VECTOR3D::z, PANEL_PREV_3D_BASE::zoff, PANEL_PREV_3D_BASE::zrot, and PANEL_PREV_3D_BASE::zscale.

◆ View3DBack()

void PANEL_PREV_3D::View3DBack ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 187 of file panel_prev_3d.h.

188  {
190  }
EDA_3D_CANVAS * m_previewPane
bool SetView3D(int aKeycode)
Helper function to call view commands.

References ID_VIEW3D_BACK, m_previewPane, and EDA_3D_CANVAS::SetView3D().

◆ View3DBottom()

void PANEL_PREV_3D::View3DBottom ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 192 of file panel_prev_3d.h.

193  {
195  }
EDA_3D_CANVAS * m_previewPane
bool SetView3D(int aKeycode)
Helper function to call view commands.

References ID_VIEW3D_BOTTOM, m_previewPane, and EDA_3D_CANVAS::SetView3D().

◆ View3DFront()

void PANEL_PREV_3D::View3DFront ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 166 of file panel_prev_3d.h.

167  {
169  }
EDA_3D_CANVAS * m_previewPane
bool SetView3D(int aKeycode)
Helper function to call view commands.

References ID_VIEW3D_FRONT, m_previewPane, and EDA_3D_CANVAS::SetView3D().

◆ View3DISO()

void PANEL_PREV_3D::View3DISO ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 155 of file panel_prev_3d.h.

156  {
158  m_previewPane->Refresh();
159  }
EDA_3D_CANVAS * m_previewPane
CAMERA & m_currentCamera
void ToggleProjection()
Definition: camera.cpp:424

References m_currentCamera, m_previewPane, and CAMERA::ToggleProjection().

◆ View3DLeft()

void PANEL_PREV_3D::View3DLeft ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 161 of file panel_prev_3d.h.

162  {
164  }
EDA_3D_CANVAS * m_previewPane
bool SetView3D(int aKeycode)
Helper function to call view commands.

References ID_VIEW3D_LEFT, m_previewPane, and EDA_3D_CANVAS::SetView3D().

◆ View3DRight()

void PANEL_PREV_3D::View3DRight ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 182 of file panel_prev_3d.h.

183  {
185  }
EDA_3D_CANVAS * m_previewPane
bool SetView3D(int aKeycode)
Helper function to call view commands.

References ID_VIEW3D_RIGHT, m_previewPane, and EDA_3D_CANVAS::SetView3D().

◆ View3DTop()

void PANEL_PREV_3D::View3DTop ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 171 of file panel_prev_3d.h.

172  {
174  }
EDA_3D_CANVAS * m_previewPane
bool SetView3D(int aKeycode)
Helper function to call view commands.

References ID_VIEW3D_TOP, m_previewPane, and EDA_3D_CANVAS::SetView3D().

◆ View3DUpdate()

void PANEL_PREV_3D::View3DUpdate ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 176 of file panel_prev_3d.h.

177  {
179  m_previewPane->Refresh();
180  }
EDA_3D_CANVAS * m_previewPane
void ReloadRequest(BOARD *aBoard=nullptr, S3D_CACHE *aCachePointer=nullptr)

References m_previewPane, and EDA_3D_CANVAS::ReloadRequest().

Member Data Documentation

◆ m_actions

◆ m_boardAdapter

BOARD_ADAPTER PANEL_PREV_3D::m_boardAdapter
private

Definition at line 200 of file panel_prev_3d.h.

Referenced by GetAdapter(), loadCommonSettings(), and PANEL_PREV_3D().

◆ m_bpUpdate

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpUpdate
protectedinherited

◆ m_bpvBack

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvBack
protectedinherited

◆ m_bpvBottom

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvBottom
protectedinherited

◆ m_bpvFront

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvFront
protectedinherited

◆ m_bpvISO

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvISO
protectedinherited

◆ m_bpvLeft

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvLeft
protectedinherited

◆ m_bpvRight

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvRight
protectedinherited

◆ m_bpvTop

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvTop
protectedinherited

◆ m_currentCamera

CAMERA& PANEL_PREV_3D::m_currentCamera
private

Definition at line 201 of file panel_prev_3d.h.

Referenced by GetCurrentCamera(), PANEL_PREV_3D(), and View3DISO().

◆ m_dragAction

MOUSE_DRAG_ACTION TOOLS_HOLDER::m_dragAction
protectedinherited

◆ m_dummyBoard

BOARD* PANEL_PREV_3D::m_dummyBoard
private

Definition at line 204 of file panel_prev_3d.h.

Referenced by PANEL_PREV_3D(), and ~PANEL_PREV_3D().

◆ m_dummyFootprint

FOOTPRINT* PANEL_PREV_3D::m_dummyFootprint
private

Definition at line 205 of file panel_prev_3d.h.

Referenced by PANEL_PREV_3D(), and UpdateDummyFootprint().

◆ m_dummySelection

SELECTION TOOLS_HOLDER::m_dummySelection
protectedinherited

Definition at line 161 of file tools_holder.h.

Referenced by TOOLS_HOLDER::GetCurrentSelection().

◆ m_immediateActions

bool TOOLS_HOLDER::m_immediateActions
protectedinherited

◆ m_infobar

WX_INFOBAR* PANEL_PREV_3D::m_infobar
private

Definition at line 199 of file panel_prev_3d.h.

Referenced by PANEL_PREV_3D().

◆ m_moveWarpsCursor

bool TOOLS_HOLDER::m_moveWarpsCursor
protectedinherited

◆ m_opacity

wxSlider* PANEL_PREV_3D_BASE::m_opacity
protectedinherited

◆ m_parentModelList

std::vector<FP_3DMODEL>* PANEL_PREV_3D::m_parentModelList
private

◆ m_previewPane

◆ m_selected

int PANEL_PREV_3D::m_selected
private

◆ m_SizerPanelView

wxBoxSizer* PANEL_PREV_3D_BASE::m_SizerPanelView
protectedinherited

Definition at line 69 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D(), and PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_spinXoffset

wxSpinButton* PANEL_PREV_3D_BASE::m_spinXoffset
protectedinherited

◆ m_spinXrot

wxSpinButton* PANEL_PREV_3D_BASE::m_spinXrot
protectedinherited

◆ m_spinXscale

wxSpinButton* PANEL_PREV_3D_BASE::m_spinXscale
protectedinherited

◆ m_spinYoffset

wxSpinButton* PANEL_PREV_3D_BASE::m_spinYoffset
protectedinherited

◆ m_spinYrot

wxSpinButton* PANEL_PREV_3D_BASE::m_spinYrot
protectedinherited

◆ m_spinYscale

wxSpinButton* PANEL_PREV_3D_BASE::m_spinYscale
protectedinherited

◆ m_spinZoffset

wxSpinButton* PANEL_PREV_3D_BASE::m_spinZoffset
protectedinherited

◆ m_spinZrot

wxSpinButton* PANEL_PREV_3D_BASE::m_spinZrot
protectedinherited

◆ m_spinZscale

wxSpinButton* PANEL_PREV_3D_BASE::m_spinZscale
protectedinherited

◆ m_staticText1

wxStaticText* PANEL_PREV_3D_BASE::m_staticText1
protectedinherited

Definition at line 42 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_staticText11

wxStaticText* PANEL_PREV_3D_BASE::m_staticText11
protectedinherited

Definition at line 51 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_staticText12

wxStaticText* PANEL_PREV_3D_BASE::m_staticText12
protectedinherited

Definition at line 60 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_staticText2

wxStaticText* PANEL_PREV_3D_BASE::m_staticText2
protectedinherited

Definition at line 45 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_staticText21

wxStaticText* PANEL_PREV_3D_BASE::m_staticText21
protectedinherited

Definition at line 54 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_staticText22

wxStaticText* PANEL_PREV_3D_BASE::m_staticText22
protectedinherited

Definition at line 63 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_staticText3

wxStaticText* PANEL_PREV_3D_BASE::m_staticText3
protectedinherited

Definition at line 48 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_staticText31

wxStaticText* PANEL_PREV_3D_BASE::m_staticText31
protectedinherited

Definition at line 57 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_staticText32

wxStaticText* PANEL_PREV_3D_BASE::m_staticText32
protectedinherited

Definition at line 65 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

◆ m_toolDispatcher

◆ m_toolManager

TOOL_MANAGER* TOOLS_HOLDER::m_toolManager
protectedinherited

Definition at line 157 of file tools_holder.h.

Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), PCB_BASE_FRAME::ActivateGalCanvas(), SCH_EDIT_FRAME::AddJunction(), EDA_BASE_FRAME::AddStandardHelpMenu(), EDA_DRAW_FRAME::AddStandardSubMenus(), SCH_EDIT_FRAME::canCloseWindow(), GERBVIEW_FRAME::Clear_DrawLayers(), SCH_EDIT_FRAME::ConvertPart(), EDA_3D_VIEWER::CreateMenuBar(), SYMBOL_EDIT_FRAME::CreateNewPart(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), SYMBOL_VIEWER_FRAME::DClickOnCmpList(), SCH_EDIT_FRAME::DeleteJunction(), SCH_EDIT_FRAME::DisplayCurrentSheet(), GERBVIEW_FRAME::doCloseWindow(), SCH_EDIT_FRAME::doCloseWindow(), SYMBOL_EDIT_FRAME::emptyScreen(), GERBVIEW_FRAME::Erase_Current_DrawLayer(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), FOOTPRINT_EDIT_FRAME::GetCurrentSelection(), FOOTPRINT_VIEWER_FRAME::GetCurrentSelection(), SYMBOL_EDIT_FRAME::GetCurrentSelection(), DISPLAY_FOOTPRINTS_FRAME::GetCurrentSelection(), SCH_EDIT_FRAME::GetCurrentSelection(), PL_EDITOR_FRAME::GetCurrentSelection(), SYMBOL_VIEWER_FRAME::GetCurrentSelection(), GERBVIEW_FRAME::GetCurrentSelection(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), TOOLS_HOLDER::GetToolManager(), EDA_DRAW_FRAME::GetUnitPair(), PL_EDITOR_FRAME::HardRedraw(), SYMBOL_EDIT_FRAME::HardRedraw(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::initScreenZoom(), PCB_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::KiwayMailIn(), SYMBOL_EDIT_FRAME::LoadOneLibraryPartAux(), SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib(), PCB_EDIT_FRAME::OnEditItemRequest(), SCH_EDIT_FRAME::OnFindDialogClose(), PL_EDITOR_FRAME::OnNewPageLayout(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), EDA_DRAW_FRAME::OnSelectGrid(), SYMBOL_EDIT_FRAME::OnSelectUnit(), EDA_DRAW_FRAME::OnSelectZoom(), SCH_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D(), TOOLS_HOLDER::PopTool(), TOOLS_HOLDER::PushTool(), SCH_EDIT_FRAME::PutDataInPreviousState(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SYMBOL_VIEWER_FRAME::ReCreateMenuBar(), SYMBOL_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar(), SCH_EDIT_FRAME::ReCreateOptToolbar(), SYMBOL_EDIT_FRAME::ReCreateOptToolbar(), PCB_EDIT_FRAME::ReCreateOptToolbar(), PCB_EDIT_FRAME::ReCreateVToolbar(), CVPCB_MAINFRAME::refreshAfterSymbolSearch(), SCH_BASE_FRAME::RefreshSelection(), FOOTPRINT_WIZARD_FRAME::ReloadFootprint(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SYMBOL_EDIT_FRAME::saveLibrary(), EDA_DRAW_FRAME::SaveSettings(), SCH_EDIT_FRAME::SaveSymbolToSchematic(), SCH_BASE_FRAME::SCH_BASE_FRAME(), SCH_EDIT_FRAME::SchematicCleanUp(), GERBVIEW_FRAME::SetActiveLayer(), PCB_BASE_EDIT_FRAME::SetBoard(), SYMBOL_EDIT_FRAME::SetCurPart(), SCH_EDIT_FRAME::SetScreen(), SYMBOL_VIEWER_FRAME::SetSelectedSymbol(), PL_EDITOR_FRAME::setupTools(), FOOTPRINT_EDIT_FRAME::setupTools(), SYMBOL_VIEWER_FRAME::setupTools(), KICAD_MANAGER_FRAME::setupTools(), SYMBOL_EDIT_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), GERBVIEW_FRAME::setupTools(), SCH_EDIT_FRAME::setupTools(), PL_EDITOR_FRAME::setupUIConditions(), CVPCB_MAINFRAME::setupUIConditions(), FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), SYMBOL_VIEWER_FRAME::setupUIConditions(), KICAD_MANAGER_FRAME::setupUIConditions(), SCH_EDIT_FRAME::setupUIConditions(), EDA_3D_VIEWER::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), GERBVIEW_FRAME::setupUIConditions(), EDA_DRAW_FRAME::setupUnits(), PCB_BASE_FRAME::ShowPadPropertiesDialog(), PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event(), EDA_DRAW_FRAME::unitsChangeRefresh(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), DISPLAY_FOOTPRINTS_FRAME::updateView(), FOOTPRINT_WIZARD_FRAME::updateView(), FOOTPRINT_VIEWER_FRAME::updateView(), FOOTPRINT_EDIT_FRAME::UpdateView(), EDA_DRAW_FRAME::Zoom_Automatique(), CVPCB_MAINFRAME::~CVPCB_MAINFRAME(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), EDA_DRAW_FRAME::~EDA_DRAW_FRAME(), FOOTPRINT_EDIT_FRAME::~FOOTPRINT_EDIT_FRAME(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME(), GERBVIEW_FRAME::~GERBVIEW_FRAME(), KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME(), PL_EDITOR_FRAME::~PL_EDITOR_FRAME(), SCH_EDIT_FRAME::~SCH_EDIT_FRAME(), SYMBOL_EDIT_FRAME::~SYMBOL_EDIT_FRAME(), and SYMBOL_VIEWER_FRAME::~SYMBOL_VIEWER_FRAME().

◆ m_toolStack

std::vector<std::string> TOOLS_HOLDER::m_toolStack
protectedinherited

◆ m_trackBallCamera

TRACK_BALL PANEL_PREV_3D::m_trackBallCamera
private

Definition at line 202 of file panel_prev_3d.h.

◆ m_userUnits

EDA_UNITS PANEL_PREV_3D::m_userUnits
private

Index into m_parentInfoList.

Definition at line 210 of file panel_prev_3d.h.

Referenced by doIncrementOffset(), formatOffsetValue(), onMouseWheelOffset(), PANEL_PREV_3D(), and updateOrientation().

◆ xoff

wxTextCtrl* PANEL_PREV_3D_BASE::xoff
protectedinherited

◆ xrot

wxTextCtrl* PANEL_PREV_3D_BASE::xrot
protectedinherited

◆ xscale

wxTextCtrl* PANEL_PREV_3D_BASE::xscale
protectedinherited

◆ yoff

◆ yrot

wxTextCtrl* PANEL_PREV_3D_BASE::yrot
protectedinherited

◆ yscale

wxTextCtrl* PANEL_PREV_3D_BASE::yscale
protectedinherited

◆ zoff

wxTextCtrl* PANEL_PREV_3D_BASE::zoff
protectedinherited

◆ zrot

wxTextCtrl* PANEL_PREV_3D_BASE::zrot
protectedinherited

◆ zscale

wxTextCtrl* PANEL_PREV_3D_BASE::zscale
protectedinherited

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