53#if defined(__linux__) || defined(__FreeBSD__)
63 for( wxUniChar c : aValue )
104 std::vector<FP_3DMODEL>* aParentModelList ) :
152 wxSpinButton* spinButtonList[] =
159 for( wxSpinButton* button : spinButtonList )
160 button->SetRange(INT_MIN, INT_MAX );
164 rotCtrl->SetCustomEval(
174 scaleCtrl->SetCustomEval(
204#if defined(__linux__) || defined(__FreeBSD__)
211 catch(
const std::system_error& e )
213 wxLogTrace( wxT(
"KI_TRACE_NAVLIB" ), e.what() );
249 for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
285 wxCHECK_RET(
m_previewPane, wxT(
"Cannot load settings to null canvas" ) );
299 m_previewPane->SetAnimationEnabled( cfg->m_Camera.animation_enabled );
300 m_previewPane->SetMovingSpeedMultiplier( cfg->m_Camera.moving_speed_multiplier );
301 m_previewPane->SetProjectionMode( cfg->m_Camera.projection_mode );
308 return wxString::Format( wxT(
"%.4f" ),
319 return wxString::Format( wxT(
"%.2f%s" ),
331 aValue /= 25.4 / 1e3;
333 return wxString::Format( wxT(
"%.6f%s" ),
368 xscale->ChangeValue( wxEmptyString );
369 yscale->ChangeValue( wxEmptyString );
370 zscale->ChangeValue( wxEmptyString );
372 xrot->ChangeValue( wxEmptyString );
373 yrot->ChangeValue( wxEmptyString );
374 zrot->ChangeValue( wxEmptyString );
376 xoff->ChangeValue( wxEmptyString );
377 yoff->ChangeValue( wxEmptyString );
378 zoff->ChangeValue( wxEmptyString );
479 wxSpinButton* spinCtrl =
dynamic_cast<wxSpinButton*
>(
event.GetEventObject() );
481 wxCHECK( spinCtrl, );
483 wxTextCtrl * textCtrl =
xscale;
492 if( wxGetMouseState().ShiftDown( ) )
497 value += ( step * aSign );
507 wxSpinButton* spinCtrl =
dynamic_cast<wxSpinButton*
>( aEvent.GetEventObject() );
509 wxCHECK( spinCtrl, );
511 wxTextCtrl* textCtrl =
xrot;
520 if( wxGetMouseState().ShiftDown( ) )
525 value += ( step * aSign );
533 wxSpinButton* spinCtrl =
dynamic_cast<wxSpinButton*
>(
event.GetEventObject() );
535 wxCHECK( spinCtrl, );
537 wxTextCtrl * textCtrl =
xoff;
546 if( wxGetMouseState().ShiftDown( ) )
553 if( wxGetMouseState().ShiftDown( ) )
560 value_mm += ( step_mm * aSign );
570 wxTextCtrl* textCtrl =
dynamic_cast<wxTextCtrl*
>(
event.GetEventObject() );
572 wxCHECK( textCtrl, );
576 if( event.ShiftDown( ) )
579 if( event.GetWheelRotation() >= 0 )
594 wxTextCtrl* textCtrl =
dynamic_cast<wxTextCtrl*
>(
event.GetEventObject() );
596 wxCHECK( textCtrl, );
600 if( event.ShiftDown( ) )
603 if( event.GetWheelRotation() >= 0 )
616 wxTextCtrl* textCtrl =
dynamic_cast<wxTextCtrl*
>(
event.GetEventObject() );
618 wxCHECK( textCtrl, );
622 if( event.ShiftDown( ) )
629 if( event.ShiftDown( ) )
633 if( event.GetWheelRotation() >= 0 )
671 m_spaceMouse->SetFocus(
static_cast<bool>( aEvent.GetInt() ) );
688 if( aReloadRequired )
706 static_cast<DIALOG_SHIM*
>( kiwayHolder )->OnModify();
constexpr EDA_IU_SCALE pcbIUScale
constexpr EDA_IU_SCALE unityScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Container for design settings for a BOARD object.
void SetEnabledLayers(const LSET &aMask)
Change the bit-mask of enabled layers to aMask.
int GetBoardThickness() const
The full thickness of the board including copper and masks.
void SetBoardThickness(int aThickness)
Manage layers needed to make a physical board.
void RemoveAll()
Delete all items in list and clear the list.
void BuildDefaultStackupList(const BOARD_DESIGN_SETTINGS *aSettings, int aActiveCopperLayersCount=0)
Create a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Implement a canvas based on a wxGLCanvas.
Handle view actions for various 3D canvases.
VECTOR3D m_Offset
3D model offset (mm)
VECTOR3D m_Rotation
3D model rotation (degrees)
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
A mix in class which holds the location of a wxWindow's KIWAY.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
HOLDER_TYPE GetType() const
static const LSET & FrontMask()
Return a mask holding all technical layers and the external CU layer on front side.
static const LSET & BackMask()
Return a mask holding all technical layers and the external CU layer on back side.
bool Process(const wxString &aString)
static const wxGLAttributes GetAttributesList(ANTIALIASING_MODE aAntiAliasingMode, bool aAlpha=false)
Get a list of attributes to pass to wxGLCanvas.
wxSpinButton * m_spinYrot
wxSpinButton * m_spinZrot
STD_BITMAP_BUTTON * m_bpvFront
wxSpinButton * m_spinXscale
wxSpinButton * m_spinYscale
wxSpinButton * m_spinXrot
wxBoxSizer * m_SizerPanelView
wxSpinButton * m_spinZoffset
wxStaticText * m_previewLabel
STD_BITMAP_BUTTON * m_bpvLeft
wxSpinButton * m_spinXoffset
wxSpinButton * m_spinYoffset
STD_BITMAP_BUTTON * m_bpSettings
STD_BITMAP_BUTTON * m_bpvRight
STD_BITMAP_BUTTON * m_bpvBodyStyle
PANEL_PREVIEW_3D_MODEL_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)
STD_BITMAP_BUTTON * m_bpvBack
wxSpinButton * m_spinZscale
STD_BITMAP_BUTTON * m_bpUpdate
STD_BITMAP_BUTTON * m_bpvTop
STD_BITMAP_BUTTON * m_bpvISO
STD_BITMAP_BUTTON * m_bpvBottom
wxString formatOffsetValue(double aValue)
void onMouseWheelRot(wxMouseEvent &event) override
void View3DSettings(wxCommandEvent &event) override
void onOpacitySlider(wxCommandEvent &event) override
void setBodyStyleView(wxCommandEvent &event) override
void onMouseWheelScale(wxMouseEvent &event) override
EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS m_initialRender
The 3d viewer Render initial settings (must be saved and restored)
void UpdateDummyFootprint(bool aRelaodRequired=true)
Copy shapes from the current shape list which are flagged for preview to the copy of footprint that i...
~PANEL_PREVIEW_3D_MODEL()
wxString formatScaleValue(double aValue)
void doIncrementRotation(wxSpinEvent &aEvent, double aSign)
void loadSettings()
Load 3D relevant settings from the user configuration.
void OnMenuEvent(wxMenuEvent &aEvent)
The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't ...
void onUnitsChanged(wxCommandEvent &aEvent)
void doIncrementOffset(wxSpinEvent &aEvent, double aSign)
BOARD_ADAPTER m_boardAdapter
PANEL_PREVIEW_3D_MODEL(wxWindow *aParent, PCB_BASE_FRAME *aFrame, FOOTPRINT *aFootprint, std::vector< FP_3DMODEL > *aParentModelList)
PCB_BASE_FRAME * m_parentFrame
void SetEmbeddedFilesDelegate(EMBEDDED_FILES *aDelegate)
EDA_3D_CANVAS * m_previewPane
void doIncrementScale(wxSpinEvent &aEvent, double aSign)
void updateOrientation(wxCommandEvent &event) override
It will receive the events from editing the fields.
wxString formatRotationValue(double aValue)
void onMouseWheelOffset(wxMouseEvent &event) override
std::unique_ptr< NL_FOOTPRINT_PROPERTIES_PLUGIN > m_spaceMouse
FOOTPRINT * m_dummyFootprint
TRACK_BALL m_trackBallCamera
void onPanelShownEvent(wxCommandEvent &aEvent)
void SetSelectedModel(int idx)
Set the currently selected index in the model list so that the scale/rotation/offset controls can be ...
std::vector< FP_3DMODEL > * m_parentModelList
EDA_UNITS m_userUnits
Index into m_parentInfoList.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Return the BOARD_DESIGN_SETTINGS for the open project.
virtual COMMON_SETTINGS * GetCommonSettings() const
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
wxTextCtrl wrapper to handle math expression evaluation.
void SetValue(const wxString &aValue) override
Set a new value in evaluator buffer and display it in the wxTextCtrl.
EDA_UNITS GetUserUnits() const
A modified version of the wxInfoBar class that allows us to:
An extension of WX_TEXT_ENTRY_DIALOG that uses UNIT_BINDER to request a dimension (e....
int GetValue()
Return the value in internal units.
static constexpr EDA_ANGLE ANGLE_0
@ TOP_BOTTOM
Flip top to bottom (around the X axis)
KICOMMON_API double DoubleValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Convert aTextValue to a double.
KICOMMON_API wxString GetText(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
KICOMMON_API wxFont GetStatusFont(wxWindow *aWindow)
Declaration of the cogl_att_list class.
static double rotationFromString(const wxString &aValue)
Ensure -MAX_ROTATION <= rotation <= MAX_ROTATION.
static wxString evaluateTextCtrl(const wxString &aValue)
#define OFFSET_INCREMENT_MM_FINE
#define OFFSET_INCREMENT_MIL
#define ROTATION_INCREMENT_FINE
#define OFFSET_INCREMENT_MM
#define ROTATION_INCREMENT
#define OFFSET_INCREMENT_MIL_FINE
#define SCALE_INCREMENT_FINE
#define PANEL_PREVIEW_3D_MODEL_ID
PGM_BASE & Pgm()
The global program "get" accessor.
T * GetAppSettings(const char *aFilename)
bool preview_show_board_body