KiCad PCB EDA Suite
PANEL_PREV_3D Class Reference

#include <panel_prev_model.h>

Inheritance diagram for PANEL_PREV_3D:
PANEL_PREV_3D_BASE

Public Member Functions

 PANEL_PREV_3D (wxWindow *aParent, S3D_CACHE *aCacheManager, MODULE *aModuleCopy, COLORS_DESIGN_SETTINGS *aColors, std::vector< MODULE_3D_SETTINGS > *aParentInfoList=NULL)
 
 ~PANEL_PREV_3D ()
 
void SetModelDataIdx (int idx, bool aReloadPreviewModule=false)
 SetModelDataIdx - This will set the index of the INFO list that was set on the parent. More...
 
void ResetModelData (bool aReloadPreviewModule=false)
 ResetModelData - Clear the values and reload the preview board. More...
 
void UpdateModelName (wxString const &aModel)
 
bool ValidateWithMessage (wxString &aErrorMessage)
 verify X,Y and Z scale factors are acceptable (> 0.001 and < 1000.0) More...
 
bool Validate () override
 

Public Attributes

wxTextCtrl * yoff
 

Protected Attributes

wxStaticText * m_staticTextScale
 
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_staticTextRot
 
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_staticTextOffset
 
wxStaticText * m_staticText12
 
wxTextCtrl * xoff
 
wxSpinButton * m_spinXoffset
 
wxStaticText * m_staticText22
 
wxSpinButton * m_spinYoffset
 
wxStaticText * m_staticText32
 
wxTextCtrl * zoff
 
wxSpinButton * m_spinZoffset
 
wxBoxSizer * m_SizerPanelView
 
wxFlexGridSizer * m_fgSizerButtons
 
wxBitmapButton * m_bpvISO
 
wxBitmapButton * m_bpvLeft
 
wxBitmapButton * m_bpvFront
 
wxBitmapButton * m_bpvTop
 
wxBitmapButton * m_bpUpdate
 
wxBitmapButton * m_bpvRight
 
wxBitmapButton * m_bpvBack
 
wxBitmapButton * m_bpvBottom
 

Private Member Functions

void initPanel ()
 
void updateOrientation (wxCommandEvent &event) override
 updateOrientation - 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 getOrientationVars (SGPOINT &aScale, SGPOINT &aRotation, SGPOINT &aOffset)
 getOrientationVars - gets the transformation from entries and validate it More...
 
void updateListOnModelCopy ()
 updateListOnModelCopy - copy the current shape list to the copy of module that is on the preview dummy board More...
 
void onEnterPreviewCanvas (wxMouseEvent &event)
 
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

wxString currentModelFile
 Used to check if the model file was changed. More...
 
S3D_FILENAME_RESOLVERm_resolver
 Used to get the full path name. More...
 
EDA_3D_CANVASm_previewPane
 The 3D canvas. More...
 
BOARDm_dummyBoard
 A dummy board used to store the copy moduled. More...
 
CINFO3D_VISUm_settings3Dviewer
 The settings that will be used for this 3D viewer canvas. More...
 
MODULEm_copyModule
 A pointer to a new copy of the original module. More...
 
std::vector< MODULE_3D_SETTINGS > * m_parentInfoList
 A pointer to the parent MODULE_3D_SETTINGS list that we will use to copy to the preview module. More...
 
int m_currentSelectedIdx
 The current selected index of the MODULE_3D_SETTINGS list. More...
 
MODULE_3D_SETTINGS m_modelInfo
 Current MODULE_3D_SETTINGS that is being edited. More...
 

Detailed Description

Definition at line 72 of file panel_prev_model.h.

Constructor & Destructor Documentation

PANEL_PREV_3D::PANEL_PREV_3D ( wxWindow *  aParent,
S3D_CACHE aCacheManager,
MODULE aModuleCopy,
COLORS_DESIGN_SETTINGS aColors,
std::vector< MODULE_3D_SETTINGS > *  aParentInfoList = NULL 
)

Definition at line 45 of file panel_prev_model.cpp.

References BOARD::Add(), FRAME_PCB_DISPLAY3D, COGL_ATT_LIST::GetAttributesList(), S3D_CACHE::GetResolver(), initPanel(), m_copyModule, m_dummyBoard, m_parentInfoList, m_previewPane, m_resolver, m_settings3Dviewer, PANEL_PREV_3D_BASE::m_SizerPanelView, onEnterPreviewCanvas(), and BOARD::SetColorsSettings().

48  :
49  PANEL_PREV_3D_BASE( aParent, wxID_ANY )
50 {
51  initPanel();
52 
53  // Initialize the color settings to draw the board and the footprint
54  if( aColors )
55  m_dummyBoard->SetColorsSettings( aColors );
56  else
57  {
58  static COLORS_DESIGN_SETTINGS defaultColors( FRAME_PCB_DISPLAY3D );
59  m_dummyBoard->SetColorsSettings( &defaultColors );
60  }
61 
62  if( NULL != aCacheManager )
63  m_resolver = aCacheManager->GetResolver();
64 
65  m_parentInfoList = aParentInfoList;
66 
67  m_dummyBoard->Add( (MODULE*)aModuleCopy );
68  m_copyModule = aModuleCopy;
69 
70  // Set 3d viewer configuration for preview
72 
73  // Create the 3D canvas
74  m_previewPane = new EDA_3D_CANVAS( this,
78  aCacheManager );
79 
80  m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND );
81 
82  m_previewPane->Connect( wxEVT_ENTER_WINDOW,
83  wxMouseEventHandler( PANEL_PREV_3D::onEnterPreviewCanvas ),
84  NULL, this );
85 }
void SetColorsSettings(COLORS_DESIGN_SETTINGS *aColorsSettings)
Function SetColorsSettings.
Definition: class_board.h:569
std::vector< MODULE_3D_SETTINGS > * m_parentInfoList
A pointer to the parent MODULE_3D_SETTINGS list that we will use to copy to the preview module...
MODULE * m_copyModule
A pointer to a new copy of the original module.
PANEL_PREV_3D_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL)
CINFO3D_VISU * m_settings3Dviewer
The settings that will be used for this 3D viewer canvas.
static const int * GetAttributesList(bool aUseAntiAliasing)
Get a list of attributes to pass to wxGLCanvas.
Class EDA_3D_CANVAS Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:53
wxBoxSizer * m_SizerPanelView
S3D_FILENAME_RESOLVER * m_resolver
Used to get the full path name.
void onEnterPreviewCanvas(wxMouseEvent &event)
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_INSERT) override
Adds an item to the container.
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
Class CINFO3D_VISU Helper class to handle information needed to display 3D board. ...
Definition: cinfo3d_visu.h:70
S3D_FILENAME_RESOLVER * GetResolver(void)
Definition: 3d_cache.cpp:739
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
BOARD * m_dummyBoard
A dummy board used to store the copy moduled.
PANEL_PREV_3D::~PANEL_PREV_3D ( )

Definition at line 88 of file panel_prev_model.cpp.

References m_dummyBoard, m_previewPane, m_settings3Dviewer, and onEnterPreviewCanvas().

89 {
90  m_previewPane->Disconnect( wxEVT_ENTER_WINDOW,
91  wxMouseEventHandler( PANEL_PREV_3D::onEnterPreviewCanvas ),
92  NULL, this );
93 
94  delete m_settings3Dviewer;
95  delete m_dummyBoard;
96  delete m_previewPane;
97 }
CINFO3D_VISU * m_settings3Dviewer
The settings that will be used for this 3D viewer canvas.
void onEnterPreviewCanvas(wxMouseEvent &event)
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
BOARD * m_dummyBoard
A dummy board used to store the copy moduled.

Member Function Documentation

void PANEL_PREV_3D::getOrientationVars ( SGPOINT aScale,
SGPOINT aRotation,
SGPOINT aOffset 
)
private

getOrientationVars - gets the transformation from entries and validate it

Parameters
aScaleoutput scale var
aRotationoutput rotation var
aOffsetoutput offset var

Definition at line 573 of file panel_prev_model.cpp.

References checkRotation(), g_UserUnit, INCHES, MILLIMETRES, SGPOINT::x, PANEL_PREV_3D_BASE::xoff, PANEL_PREV_3D_BASE::xrot, PANEL_PREV_3D_BASE::xscale, SGPOINT::y, PANEL_PREV_3D_BASE::yoff, PANEL_PREV_3D_BASE::yrot, PANEL_PREV_3D_BASE::yscale, SGPOINT::z, PANEL_PREV_3D_BASE::zoff, PANEL_PREV_3D_BASE::zrot, and PANEL_PREV_3D_BASE::zscale.

Referenced by updateOrientation().

574 {
575  if( NULL == xscale || NULL == yscale || NULL == zscale
576  || NULL == xrot || NULL == yrot || NULL == zrot
577  || NULL == xoff || NULL == yoff || NULL == zoff )
578  {
579  return;
580  }
581 
582  xscale->GetValue().ToDouble( &aScale.x );
583  yscale->GetValue().ToDouble( &aScale.y );
584  zscale->GetValue().ToDouble( &aScale.z );
585 
586  xrot->GetValue().ToDouble( &aRotation.x );
587  yrot->GetValue().ToDouble( &aRotation.y );
588  zrot->GetValue().ToDouble( &aRotation.z );
589 
590  checkRotation( aRotation.x );
591  checkRotation( aRotation.y );
592  checkRotation( aRotation.z );
593 
594  xoff->GetValue().ToDouble( &aOffset.x );
595  yoff->GetValue().ToDouble( &aOffset.y );
596  zoff->GetValue().ToDouble( &aOffset.z );
597 
598  // Convert from user units to internal units (mm)
599 
600  double scaler = 1.0f;
601 
602  switch( g_UserUnit )
603  {
604  case MILLIMETRES:
605  scaler = 1.0f;
606  break;
607  case INCHES:
608  scaler = 25.4f;
609  break;
610  default:
611  wxASSERT( 0 );
612  }
613 
614  aOffset.x *= scaler;
615  aOffset.y *= scaler;
616  aOffset.z *= scaler;
617 
618  return;
619 }
double x
Definition: sg_base.h:70
double y
Definition: sg_base.h:71
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
double z
Definition: sg_base.h:72
static void checkRotation(double &aRotation)
checkRotation Ensure -MAX_ROTATION <= rotation <= MAX_ROTATION aRotation will be normalized between -...
void PANEL_PREV_3D::initPanel ( )
private

Definition at line 100 of file panel_prev_model.cpp.

References currentModelFile, Format(), g_UserUnit, INCHES, KiBitmap(), 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_currentSelectedIdx, m_dummyBoard, m_resolver, 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, PANEL_PREV_3D_BASE::m_staticTextOffset, and MILLIMETRES.

Referenced by PANEL_PREV_3D().

101 {
102  m_resolver = NULL;
103  currentModelFile.clear();
104  m_dummyBoard = new BOARD();
106 
107  // Set the bitmap of 3D view buttons:
108  m_bpvTop->SetBitmap( KiBitmap( axis3d_top_xpm ) );
109  m_bpvFront->SetBitmap( KiBitmap( axis3d_front_xpm ) );
110  m_bpvBack->SetBitmap( KiBitmap( axis3d_back_xpm ) );
111  m_bpvLeft->SetBitmap( KiBitmap( axis3d_left_xpm ) );
112  m_bpvRight->SetBitmap( KiBitmap( axis3d_right_xpm ) );
113  m_bpvBottom->SetBitmap( KiBitmap( axis3d_bottom_xpm ) );
114  m_bpvISO->SetBitmap( KiBitmap( ortho_xpm ) );
115  m_bpUpdate->SetBitmap( KiBitmap( reload_xpm ) );
116 
117  // Set the min and max values of spin buttons (mandatory on Linux)
118  // They are not used, so they are set to min and max 32 bits int values
119  // (the min and max values supported by a wxSpinButton)
120  // It avoids blocking the up or down arrows when reaching this limit after
121  // a few clicks.
122  wxSpinButton* spinButtonList[] =
123  {
127  };
128 
129  for( int ii = 0; ii < 9; ii++ )
130  {
131  spinButtonList[ii]->SetRange( INT_MIN, INT_MAX );
132  }
133 
134  wxString units;
135 
136  switch( g_UserUnit )
137  {
138  case INCHES:
139  units = _( "inches" );
140  break;
141  case MILLIMETRES:
142  units = _( "mm" );
143  break;
144  default:
145  break;
146  }
147 
148  if( !units.IsEmpty() )
149  {
150  units = wxString::Format( _( "Offset (%s)" ), units );
151  m_staticTextOffset->SetLabel( units );
152  }
153 }
wxBitmapButton * m_bpvTop
wxBitmapButton * m_bpvBottom
wxSpinButton * m_spinZoffset
wxSpinButton * m_spinYoffset
wxBitmapButton * m_bpvBack
wxBitmapButton * m_bpvLeft
wxBitmapButton * m_bpUpdate
int m_currentSelectedIdx
The current selected index of the MODULE_3D_SETTINGS list.
wxBitmapButton * m_bpvRight
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
wxStaticText * m_staticTextOffset
wxSpinButton * m_spinZrot
S3D_FILENAME_RESOLVER * m_resolver
Used to get the full path name.
wxSpinButton * m_spinXoffset
Definition: common.h:145
wxSpinButton * m_spinYrot
wxSpinButton * m_spinXrot
wxBitmapButton * m_bpvFront
wxSpinButton * m_spinZscale
wxSpinButton * m_spinXscale
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
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
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
wxBitmapButton * m_bpvISO
BOARD * m_dummyBoard
A dummy board used to store the copy moduled.
wxString currentModelFile
Used to check if the model file was changed.
wxSpinButton * m_spinYscale
void PANEL_PREV_3D::onDecrementOffset ( wxSpinEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 496 of file panel_prev_model.cpp.

References g_UserUnit, INCHES, incrementTextCtrl(), PANEL_PREV_3D_BASE::m_spinYoffset, PANEL_PREV_3D_BASE::m_spinZoffset, MAX_OFFSET, OFFSET_INCREMENT_MIL, OFFSET_INCREMENT_MM, PANEL_PREV_3D_BASE::xoff, PANEL_PREV_3D_BASE::yoff, and PANEL_PREV_3D_BASE::zoff.

497 {
498  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
499 
500  wxTextCtrl * textCtrl = xoff;
501 
502  if( spinCtrl == m_spinYoffset )
503  textCtrl = yoff;
504  else if( spinCtrl == m_spinZoffset )
505  textCtrl = zoff;
506 
507  double step = OFFSET_INCREMENT_MM;
508 
509  if( g_UserUnit == INCHES )
510  step = OFFSET_INCREMENT_MIL/1000.0;
511 
512  incrementTextCtrl( textCtrl, -step, -MAX_OFFSET, MAX_OFFSET );
513 }
wxSpinButton * m_spinZoffset
wxSpinButton * m_spinYoffset
#define OFFSET_INCREMENT_MM
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
#define OFFSET_INCREMENT_MIL
#define MAX_OFFSET
void PANEL_PREV_3D::onDecrementRot ( wxSpinEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 431 of file panel_prev_model.cpp.

References incrementTextCtrl(), 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.

432 {
433  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
434 
435  wxTextCtrl * textCtrl = xrot;
436 
437  if( spinCtrl == m_spinYrot )
438  textCtrl = yrot;
439  else if( spinCtrl == m_spinZrot )
440  textCtrl = zrot;
441 
443 }
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
#define ROTATION_INCREMENT
wxSpinButton * m_spinZrot
wxSpinButton * m_spinYrot
#define MAX_ROTATION
void PANEL_PREV_3D::onDecrementScale ( wxSpinEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 461 of file panel_prev_model.cpp.

References incrementTextCtrl(), PANEL_PREV_3D_BASE::m_spinYscale, PANEL_PREV_3D_BASE::m_spinZscale, MAX_SCALE, SCALE_INCREMENT, PANEL_PREV_3D_BASE::xscale, PANEL_PREV_3D_BASE::yscale, and PANEL_PREV_3D_BASE::zscale.

462 {
463  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
464 
465  wxTextCtrl * textCtrl = xscale;
466 
467  if( spinCtrl == m_spinYscale )
468  textCtrl = yscale;
469  else if( spinCtrl == m_spinZscale )
470  textCtrl = zscale;
471 
473 }
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
#define SCALE_INCREMENT
wxSpinButton * m_spinZscale
wxSpinButton * m_spinYscale
void PANEL_PREV_3D::onEnterPreviewCanvas ( wxMouseEvent &  event)
inlineprivate

Definition at line 143 of file panel_prev_model.h.

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

144  {
145  m_previewPane->SetFocus();
146  }
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
void PANEL_PREV_3D::onIncrementOffset ( wxSpinEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 476 of file panel_prev_model.cpp.

References g_UserUnit, INCHES, incrementTextCtrl(), PANEL_PREV_3D_BASE::m_spinYoffset, PANEL_PREV_3D_BASE::m_spinZoffset, MAX_OFFSET, OFFSET_INCREMENT_MIL, OFFSET_INCREMENT_MM, PANEL_PREV_3D_BASE::xoff, PANEL_PREV_3D_BASE::yoff, and PANEL_PREV_3D_BASE::zoff.

477 {
478  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
479 
480  wxTextCtrl * textCtrl = xoff;
481 
482  if( spinCtrl == m_spinYoffset )
483  textCtrl = yoff;
484  else if( spinCtrl == m_spinZoffset )
485  textCtrl = zoff;
486 
487  double step = OFFSET_INCREMENT_MM;
488 
489  if( g_UserUnit == INCHES )
490  step = OFFSET_INCREMENT_MIL/1000.0;
491 
492  incrementTextCtrl( textCtrl, step, -MAX_OFFSET, MAX_OFFSET );
493 }
wxSpinButton * m_spinZoffset
wxSpinButton * m_spinYoffset
#define OFFSET_INCREMENT_MM
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
#define OFFSET_INCREMENT_MIL
#define MAX_OFFSET
void PANEL_PREV_3D::onIncrementRot ( wxSpinEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 416 of file panel_prev_model.cpp.

References incrementTextCtrl(), 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.

417 {
418  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
419 
420  wxTextCtrl * textCtrl = xrot;
421 
422  if( spinCtrl == m_spinYrot )
423  textCtrl = yrot;
424  else if( spinCtrl == m_spinZrot )
425  textCtrl = zrot;
426 
428 }
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
#define ROTATION_INCREMENT
wxSpinButton * m_spinZrot
wxSpinButton * m_spinYrot
#define MAX_ROTATION
void PANEL_PREV_3D::onIncrementScale ( wxSpinEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 446 of file panel_prev_model.cpp.

References incrementTextCtrl(), PANEL_PREV_3D_BASE::m_spinYscale, PANEL_PREV_3D_BASE::m_spinZscale, MAX_SCALE, SCALE_INCREMENT, PANEL_PREV_3D_BASE::xscale, PANEL_PREV_3D_BASE::yscale, and PANEL_PREV_3D_BASE::zscale.

447 {
448  wxSpinButton* spinCtrl = (wxSpinButton*) event.GetEventObject();
449 
450  wxTextCtrl * textCtrl = xscale;
451 
452  if( spinCtrl == m_spinYscale )
453  textCtrl = yscale;
454  else if( spinCtrl == m_spinZscale )
455  textCtrl = zscale;
456 
458 }
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
#define SCALE_INCREMENT
wxSpinButton * m_spinZscale
wxSpinButton * m_spinYscale
void PANEL_PREV_3D::onMouseWheelOffset ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 550 of file panel_prev_model.cpp.

References g_UserUnit, INCHES, incrementTextCtrl(), MAX_OFFSET, OFFSET_INCREMENT_MIL, OFFSET_INCREMENT_MIL_FINE, OFFSET_INCREMENT_MM, and OFFSET_INCREMENT_MM_FINE.

551 {
552  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
553 
554  double step = OFFSET_INCREMENT_MM;
555 
556  if( event.ShiftDown( ) )
558 
559  if( g_UserUnit == INCHES )
560  {
561  step = OFFSET_INCREMENT_MIL/1000.0;
562  if( event.ShiftDown( ) )
563  step = OFFSET_INCREMENT_MIL_FINE/1000.0;
564  }
565 
566  if( event.GetWheelRotation() >= 0 )
567  step = -step;
568 
569  incrementTextCtrl( textCtrl, step, -MAX_OFFSET, MAX_OFFSET );
570 }
#define OFFSET_INCREMENT_MM_FINE
#define OFFSET_INCREMENT_MM
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
#define OFFSET_INCREMENT_MIL_FINE
#define OFFSET_INCREMENT_MIL
#define MAX_OFFSET
void PANEL_PREV_3D::onMouseWheelRot ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 532 of file panel_prev_model.cpp.

References incrementTextCtrl(), MAX_ROTATION, ROTATION_INCREMENT_WHEEL, and ROTATION_INCREMENT_WHEEL_FINE.

533 {
534  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
535 
536  wxKeyboardState kbdState;
537 
538  double step = ROTATION_INCREMENT_WHEEL;
539 
540  if( event.ShiftDown( ) )
542 
543  if( event.GetWheelRotation() >= 0 )
544  step = -step;
545 
546  incrementTextCtrl( textCtrl, step, -MAX_ROTATION, MAX_ROTATION );
547 }
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
#define ROTATION_INCREMENT_WHEEL_FINE
#define ROTATION_INCREMENT_WHEEL
#define MAX_ROTATION
void PANEL_PREV_3D::onMouseWheelScale ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 516 of file panel_prev_model.cpp.

References incrementTextCtrl(), MAX_SCALE, SCALE_INCREMENT, and SCALE_INCREMENT_FINE.

517 {
518  wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
519 
520  double step = SCALE_INCREMENT;
521 
522  if( event.ShiftDown( ) )
523  step = SCALE_INCREMENT_FINE;
524 
525  if( event.GetWheelRotation() >= 0 )
526  step = -step;
527 
528  incrementTextCtrl( textCtrl, step, 1/MAX_SCALE, MAX_SCALE );
529 }
#define SCALE_INCREMENT_FINE
static void incrementTextCtrl(wxTextCtrl *aTextCtrl, double aInc, double aMinval, double aMaxval)
#define SCALE_INCREMENT
void PANEL_PREV_3D::ResetModelData ( bool  aReloadPreviewModule = false)

ResetModelData - Clear the values and reload the preview board.

Parameters
aReloadPreviewModuleif need to update the preview module

Definition at line 285 of file panel_prev_model.cpp.

References m_currentSelectedIdx, m_previewPane, EDA_3D_CANVAS::ReloadRequest(), EDA_3D_CANVAS::Request_refresh(), updateListOnModelCopy(), PANEL_PREV_3D_BASE::xoff, PANEL_PREV_3D_BASE::xrot, PANEL_PREV_3D_BASE::xscale, PANEL_PREV_3D_BASE::yoff, PANEL_PREV_3D_BASE::yrot, PANEL_PREV_3D_BASE::yscale, PANEL_PREV_3D_BASE::zoff, PANEL_PREV_3D_BASE::zrot, and PANEL_PREV_3D_BASE::zscale.

Referenced by DIALOG_FOOTPRINT_FP_EDITOR::initModeditProperties(), DIALOG_FOOTPRINT_BOARD_EDITOR::InitModeditProperties(), DIALOG_FOOTPRINT_FP_EDITOR::On3DShapeNameSelected(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DShapeNameSelected(), DIALOG_FOOTPRINT_FP_EDITOR::Remove3DShape(), DIALOG_FOOTPRINT_BOARD_EDITOR::Remove3DShape(), and View3DBottom().

286 {
288 
289  xscale->SetValue( wxString::FromDouble( 1.0 ) );
290  yscale->SetValue( wxString::FromDouble( 1.0 ) );
291  zscale->SetValue( wxString::FromDouble( 1.0 ) );
292 
293  xrot->SetValue( wxString::FromDouble( 0.0 ) );
294  yrot->SetValue( wxString::FromDouble( 0.0 ) );
295  zrot->SetValue( wxString::FromDouble( 0.0 ) );
296 
297  xoff->SetValue( wxString::FromDouble( 0.0 ) );
298  yoff->SetValue( wxString::FromDouble( 0.0 ) );
299  zoff->SetValue( wxString::FromDouble( 0.0 ) );
300 
301  // This will update the model on the preview board with the current list of 3d shapes
302  if( aReloadPreviewModule )
303  {
305 
306  if( m_previewPane )
307  {
310  }
311  }
312 
313  if( m_previewPane )
314  m_previewPane->SetFocus();
315 }
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
void ReloadRequest(BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
int m_currentSelectedIdx
The current selected index of the MODULE_3D_SETTINGS list.
void updateListOnModelCopy()
updateListOnModelCopy - copy the current shape list to the copy of module that is on the preview dumm...
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
void PANEL_PREV_3D::SetModelDataIdx ( int  idx,
bool  aReloadPreviewModule = false 
)

SetModelDataIdx - This will set the index of the INFO list that was set on the parent.

So we will update our values to edit based on the index on that list.

Parameters
idx- The index that was selected
aReloadPreviewModuleif need to update the preview module

Definition at line 218 of file panel_prev_model.cpp.

References Format(), g_UserUnit, INCHES, m_currentSelectedIdx, MODULE_3D_SETTINGS::m_Filename, MODULE_3D_SETTINGS::m_Offset, m_parentInfoList, m_previewPane, MODULE_3D_SETTINGS::m_Rotation, MODULE_3D_SETTINGS::m_Scale, MILLIMETRES, EDA_3D_CANVAS::ReloadRequest(), EDA_3D_CANVAS::Request_refresh(), updateListOnModelCopy(), UpdateModelName(), MODULE_3D_SETTINGS::VECTOR3D::x, PANEL_PREV_3D_BASE::xoff, PANEL_PREV_3D_BASE::xrot, PANEL_PREV_3D_BASE::xscale, MODULE_3D_SETTINGS::VECTOR3D::y, PANEL_PREV_3D_BASE::yoff, PANEL_PREV_3D_BASE::yrot, PANEL_PREV_3D_BASE::yscale, MODULE_3D_SETTINGS::VECTOR3D::z, PANEL_PREV_3D_BASE::zoff, PANEL_PREV_3D_BASE::zrot, and PANEL_PREV_3D_BASE::zscale.

Referenced by DIALOG_FOOTPRINT_FP_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_FP_EDITOR::initModeditProperties(), DIALOG_FOOTPRINT_BOARD_EDITOR::InitModeditProperties(), DIALOG_FOOTPRINT_FP_EDITOR::On3DShapeNameSelected(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DShapeNameSelected(), DIALOG_FOOTPRINT_FP_EDITOR::Remove3DShape(), DIALOG_FOOTPRINT_BOARD_EDITOR::Remove3DShape(), and View3DBottom().

219 {
220  wxASSERT( m_parentInfoList != NULL );
221 
222  if( m_parentInfoList && (idx >= 0) )
223  {
224  wxASSERT( (unsigned int)idx < (*m_parentInfoList).size() );
225 
226  if( (unsigned int)idx < (*m_parentInfoList).size() )
227  {
228  m_currentSelectedIdx = -1; // In case that we receive events on the
229  // next updates, it will set first an
230  // invalid selection
231 
232  const MODULE_3D_SETTINGS *aModel = (const MODULE_3D_SETTINGS *)&((*m_parentInfoList)[idx]);
233 
234  xscale->SetValue( wxString::Format( "%.4f", aModel->m_Scale.x ) );
235  yscale->SetValue( wxString::Format( "%.4f", aModel->m_Scale.y ) );
236  zscale->SetValue( wxString::Format( "%.4f", aModel->m_Scale.z ) );
237 
238  xrot->SetValue( wxString::Format( "%.2f", aModel->m_Rotation.x ) );
239  yrot->SetValue( wxString::Format( "%.2f", aModel->m_Rotation.y ) );
240  zrot->SetValue( wxString::Format( "%.2f", aModel->m_Rotation.z ) );
241 
242  // Convert from internal units (mm) to user units
243 
244  double scaler = 1;
245 
246  switch( g_UserUnit )
247  {
248  case MILLIMETRES:
249  scaler = 1.0f;
250  break;
251  case INCHES:
252  scaler = 25.4f;
253  break;
254  default:
255  wxASSERT( 0 );
256  }
257 
258  xoff->SetValue( wxString::Format( "%.4f", aModel->m_Offset.x / scaler ) );
259  yoff->SetValue( wxString::Format( "%.4f", aModel->m_Offset.y / scaler ) );
260  zoff->SetValue( wxString::Format( "%.4f", aModel->m_Offset.z / scaler ) );
261 
262  UpdateModelName( aModel->m_Filename );
263 
264  if( aReloadPreviewModule && m_previewPane )
265  {
267 
270  }
271 
272  m_currentSelectedIdx = idx;
273  }
274  }
275 
276  if( m_previewPane )
277  {
278  m_previewPane->SetFocus();
279  }
280 
281  return;
282 }
std::vector< MODULE_3D_SETTINGS > * m_parentInfoList
A pointer to the parent MODULE_3D_SETTINGS list that we will use to copy to the preview module...
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
void ReloadRequest(BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
int m_currentSelectedIdx
The current selected index of the MODULE_3D_SETTINGS list.
VECTOR3D m_Offset
3D model offset (mm)
Definition: class_module.h:101
void updateListOnModelCopy()
updateListOnModelCopy - copy the current shape list to the copy of module that is on the preview dumm...
Definition: common.h:145
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:102
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
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
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: class_module.h:100
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: class_module.h:99
void UpdateModelName(wxString const &aModel)
void PANEL_PREV_3D::updateListOnModelCopy ( )
private

updateListOnModelCopy - copy the current shape list to the copy of module that is on the preview dummy board

Definition at line 688 of file panel_prev_model.cpp.

References m_copyModule, m_parentInfoList, and MODULE::Models().

Referenced by ResetModelData(), SetModelDataIdx(), UpdateModelName(), and updateOrientation().

689 {
690  auto draw3D = &m_copyModule->Models();
691  draw3D->clear();
692  draw3D->insert( draw3D->end(), m_parentInfoList->begin(), m_parentInfoList->end() );
693 }
std::vector< MODULE_3D_SETTINGS > * m_parentInfoList
A pointer to the parent MODULE_3D_SETTINGS list that we will use to copy to the preview module...
MODULE * m_copyModule
A pointer to a new copy of the original module.
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:177
void PANEL_PREV_3D::UpdateModelName ( wxString const &  aModel)

Definition at line 318 of file panel_prev_model.cpp.

References currentModelFile, MODULE_3D_SETTINGS::m_Filename, m_modelInfo, m_previewPane, m_resolver, EDA_3D_CANVAS::ReloadRequest(), S3D_FILENAME_RESOLVER::ResolvePath(), and updateListOnModelCopy().

Referenced by DIALOG_FOOTPRINT_FP_EDITOR::Edit3DShapeFileName(), DIALOG_FOOTPRINT_BOARD_EDITOR::Edit3DShapeFileName(), SetModelDataIdx(), and View3DBottom().

319 {
320  bool newModel = false;
321 
322  m_modelInfo.m_Filename = aModelName;
323 
324  // if the model name is a directory simply clear the current model
325  if( aModelName.empty() || wxFileName::DirExists( aModelName ) )
326  {
327  currentModelFile.clear();
328  m_modelInfo.m_Filename.clear();
329  }
330  else
331  {
332  wxString newModelFile;
333 
334  if( m_resolver )
335  newModelFile = m_resolver->ResolvePath( aModelName );
336 
337  if( !newModelFile.empty() && newModelFile.Cmp( currentModelFile ) )
338  newModel = true;
339 
340  currentModelFile = newModelFile;
341  }
342 
343  if( currentModelFile.empty() || newModel )
344  {
346 
347  if( m_previewPane )
348  {
350  m_previewPane->Refresh();
351  }
352 
353  if( currentModelFile.empty() )
354  return;
355  }
356  else
357  {
358  if( m_previewPane )
359  m_previewPane->Refresh();
360  }
361 
362  if( m_previewPane )
363  m_previewPane->SetFocus();
364 
365  return;
366 }
void ReloadRequest(BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
void updateListOnModelCopy()
updateListOnModelCopy - copy the current shape list to the copy of module that is on the preview dumm...
S3D_FILENAME_RESOLVER * m_resolver
Used to get the full path name.
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:102
wxString ResolvePath(const wxString &aFileName)
Function ResolvePath determines the full path of the given file name.
wxString currentModelFile
Used to check if the model file was changed.
MODULE_3D_SETTINGS m_modelInfo
Current MODULE_3D_SETTINGS that is being edited.
void PANEL_PREV_3D::updateOrientation ( wxCommandEvent &  event)
overrideprivatevirtual

updateOrientation - it will receive the events from editing the fields

Parameters
event

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 369 of file panel_prev_model.cpp.

References getOrientationVars(), m_currentSelectedIdx, m_modelInfo, MODULE_3D_SETTINGS::m_Offset, m_previewPane, MODULE_3D_SETTINGS::m_Rotation, MODULE_3D_SETTINGS::m_Scale, scale, updateListOnModelCopy(), SGPOINT::x, MODULE_3D_SETTINGS::VECTOR3D::x, SGPOINT::y, MODULE_3D_SETTINGS::VECTOR3D::y, SGPOINT::z, and MODULE_3D_SETTINGS::VECTOR3D::z.

370 {
371  wxTextCtrl *textCtrl = (wxTextCtrl *)event.GetEventObject();
372 
373  if( textCtrl == NULL )
374  return;
375 
376  if( textCtrl->GetLineLength(0) == 0 ) // This will skip the got and event with empty field
377  return;
378 
379  if( textCtrl->GetLineLength(0) == 1 )
380  if( (textCtrl->GetLineText(0).compare( "." ) == 0) ||
381  (textCtrl->GetLineText(0).compare( "," ) == 0) )
382  return;
383 
384  SGPOINT scale;
385  SGPOINT rotation;
386  SGPOINT offset;
387 
388  getOrientationVars( scale, rotation, offset );
389 
390  m_modelInfo.m_Scale.x = scale.x;
391  m_modelInfo.m_Scale.y = scale.y;
392  m_modelInfo.m_Scale.z = scale.z;
393  m_modelInfo.m_Offset.x = offset.x;
394  m_modelInfo.m_Offset.y = offset.y;
395  m_modelInfo.m_Offset.z = offset.z;
396  m_modelInfo.m_Rotation.x = rotation.x;
397  m_modelInfo.m_Rotation.y = rotation.y;
398  m_modelInfo.m_Rotation.z = rotation.z;
399 
400  if( m_currentSelectedIdx >= 0 )
401  {
402  // This will update the parent list with the new data
403  (*m_parentInfoList)[m_currentSelectedIdx] = m_modelInfo;
404 
405  // It will update the copy model in the preview board
407 
408  // Since the OpenGL render does not need to be reloaded to update the
409  // shapes position, we just request to redraw again the canvas
410  if( m_previewPane )
411  m_previewPane->Refresh();
412  }
413 }
double x
Definition: sg_base.h:70
void getOrientationVars(SGPOINT &aScale, SGPOINT &aRotation, SGPOINT &aOffset)
getOrientationVars - gets the transformation from entries and validate it
double y
Definition: sg_base.h:71
int m_currentSelectedIdx
The current selected index of the MODULE_3D_SETTINGS list.
VECTOR3D m_Offset
3D model offset (mm)
Definition: class_module.h:101
void updateListOnModelCopy()
updateListOnModelCopy - copy the current shape list to the copy of module that is on the preview dumm...
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
const int scale
VECTOR3D m_Rotation
3D model rotation (degrees)
Definition: class_module.h:100
double z
Definition: sg_base.h:72
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: class_module.h:99
MODULE_3D_SETTINGS m_modelInfo
Current MODULE_3D_SETTINGS that is being edited.
bool PANEL_PREV_3D::Validate ( )
inlineoverride

Definition at line 214 of file panel_prev_model.h.

References ValidateWithMessage().

215  {
216  wxString temp;
217  return ValidateWithMessage(temp);
218  }
bool ValidateWithMessage(wxString &aErrorMessage)
verify X,Y and Z scale factors are acceptable (> 0.001 and < 1000.0)
bool PANEL_PREV_3D::ValidateWithMessage ( wxString &  aErrorMessage)

verify X,Y and Z scale factors are acceptable (> 0.001 and < 1000.0)

Returns
false if one (or more) value is not acceptable.
Parameters
aErrorMessageis a wxString to store error messages, if any

Definition at line 622 of file panel_prev_model.cpp.

References Format(), MODULE_3D_SETTINGS::m_Filename, m_parentInfoList, MODULE_3D_SETTINGS::m_Scale, MAX_SCALE, scale, SGPOINT::x, MODULE_3D_SETTINGS::VECTOR3D::x, SGPOINT::y, MODULE_3D_SETTINGS::VECTOR3D::y, SGPOINT::z, and MODULE_3D_SETTINGS::VECTOR3D::z.

Referenced by DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow(), Validate(), and View3DBottom().

623 {
624  bool invalidScale = false;
625 
626  for( unsigned int idx = 0; idx < m_parentInfoList->size(); ++idx )
627  {
628  wxString msg;
629  bool addError = false;
630  MODULE_3D_SETTINGS& s3dshape = (*m_parentInfoList)[idx];
631 
632  SGPOINT scale;
633  scale.x = s3dshape.m_Scale.x;
634  scale.y = s3dshape.m_Scale.y;
635  scale.z = s3dshape.m_Scale.z;
636 
637  if( 1/MAX_SCALE > scale.x || MAX_SCALE < scale.x )
638  {
639  invalidScale = true;
640  addError = true;
641  msg += _( "Invalid X scale" );
642  }
643 
644  if( 1/MAX_SCALE > scale.y || MAX_SCALE < scale.y )
645  {
646  invalidScale = true;
647  addError = true;
648 
649  if( !msg.IsEmpty() )
650  msg += "\n";
651 
652  msg += _( "Invalid Y scale" );
653  }
654 
655  if( 1/MAX_SCALE > scale.z || MAX_SCALE < scale.z )
656  {
657  invalidScale = true;
658  addError = true;
659 
660  if( !msg.IsEmpty() )
661  msg += "\n";
662 
663  msg += _( "Invalid Z scale" );
664  }
665 
666  if( addError )
667  {
668  msg.Prepend( s3dshape.m_Filename + "\n" );
669 
670  if( !aErrorMessage.IsEmpty() )
671  aErrorMessage += "\n\n";
672 
673  aErrorMessage += msg;
674  }
675  }
676 
677  if( !aErrorMessage.IsEmpty() )
678  {
679  aErrorMessage += "\n\n";
680  aErrorMessage += wxString::Format( "Min value = %.4f and max value = %.4f",
681  1/MAX_SCALE, MAX_SCALE );
682  }
683 
684  return invalidScale == false;
685 }
std::vector< MODULE_3D_SETTINGS > * m_parentInfoList
A pointer to the parent MODULE_3D_SETTINGS list that we will use to copy to the preview module...
double x
Definition: sg_base.h:70
double y
Definition: sg_base.h:71
wxString m_Filename
The 3D shape filename in 3D library.
Definition: class_module.h:102
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
double z
Definition: sg_base.h:72
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
Definition: class_module.h:99
void PANEL_PREV_3D::View3DBack ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 180 of file panel_prev_model.h.

References EDA_3D_CANVAS::SetView3D().

181  {
182  m_previewPane->SetView3D( 'y' );
183  }
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
void SetView3D(int keycode)
SetView3D - Helper function to call view commands.
void PANEL_PREV_3D::View3DBottom ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 185 of file panel_prev_model.h.

References ResetModelData(), SetModelDataIdx(), EDA_3D_CANVAS::SetView3D(), UpdateModelName(), and ValidateWithMessage().

186  {
187  m_previewPane->SetView3D( 'Z' );
188  }
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
void SetView3D(int keycode)
SetView3D - Helper function to call view commands.
void PANEL_PREV_3D::View3DFront ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 159 of file panel_prev_model.h.

References EDA_3D_CANVAS::SetView3D().

160  {
161  m_previewPane->SetView3D( 'Y' );
162  }
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
void SetView3D(int keycode)
SetView3D - Helper function to call view commands.
void PANEL_PREV_3D::View3DISO ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 148 of file panel_prev_model.h.

References CINFO3D_VISU::CameraGet(), and CCAMERA::ToggleProjection().

149  {
151  m_previewPane->Refresh();
152  }
CINFO3D_VISU * m_settings3Dviewer
The settings that will be used for this 3D viewer canvas.
void ToggleProjection()
Definition: ccamera.cpp:417
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
CCAMERA & CameraGet() const
CameraGet - get current camera in use.
Definition: cinfo3d_visu.h:210
void PANEL_PREV_3D::View3DLeft ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 154 of file panel_prev_model.h.

References EDA_3D_CANVAS::SetView3D().

155  {
156  m_previewPane->SetView3D( 'X' );
157  }
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
void SetView3D(int keycode)
SetView3D - Helper function to call view commands.
void PANEL_PREV_3D::View3DRight ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 175 of file panel_prev_model.h.

References EDA_3D_CANVAS::SetView3D().

176  {
177  m_previewPane->SetView3D( 'x' );
178  }
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
void SetView3D(int keycode)
SetView3D - Helper function to call view commands.
void PANEL_PREV_3D::View3DTop ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 164 of file panel_prev_model.h.

References EDA_3D_CANVAS::SetView3D().

165  {
166  m_previewPane->SetView3D( 'z' );
167  }
EDA_3D_CANVAS * m_previewPane
The 3D canvas.
void SetView3D(int keycode)
SetView3D - Helper function to call view commands.
void PANEL_PREV_3D::View3DUpdate ( wxCommandEvent &  event)
inlineoverrideprivatevirtual

Reimplemented from PANEL_PREV_3D_BASE.

Definition at line 169 of file panel_prev_model.h.

References EDA_3D_CANVAS::ReloadRequest().

170  {
172  m_previewPane->Refresh();
173  }
void ReloadRequest(BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
EDA_3D_CANVAS * m_previewPane
The 3D canvas.

Member Data Documentation

wxString PANEL_PREV_3D::currentModelFile
private

Used to check if the model file was changed.

Definition at line 83 of file panel_prev_model.h.

Referenced by initPanel(), and UpdateModelName().

wxBitmapButton* PANEL_PREV_3D_BASE::m_bpUpdate
protectedinherited
wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvBack
protectedinherited
wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvBottom
protectedinherited
wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvFront
protectedinherited
wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvISO
protectedinherited
wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvLeft
protectedinherited
wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvRight
protectedinherited
wxBitmapButton* PANEL_PREV_3D_BASE::m_bpvTop
protectedinherited
MODULE* PANEL_PREV_3D::m_copyModule
private

A pointer to a new copy of the original module.

Definition at line 96 of file panel_prev_model.h.

Referenced by PANEL_PREV_3D(), and updateListOnModelCopy().

int PANEL_PREV_3D::m_currentSelectedIdx
private

The current selected index of the MODULE_3D_SETTINGS list.

Definition at line 102 of file panel_prev_model.h.

Referenced by initPanel(), ResetModelData(), SetModelDataIdx(), and updateOrientation().

BOARD* PANEL_PREV_3D::m_dummyBoard
private

A dummy board used to store the copy moduled.

Definition at line 90 of file panel_prev_model.h.

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

wxFlexGridSizer* PANEL_PREV_3D_BASE::m_fgSizerButtons
protectedinherited

Definition at line 71 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

MODULE_3D_SETTINGS PANEL_PREV_3D::m_modelInfo
private

Current MODULE_3D_SETTINGS that is being edited.

Definition at line 105 of file panel_prev_model.h.

Referenced by UpdateModelName(), and updateOrientation().

std::vector<MODULE_3D_SETTINGS>* PANEL_PREV_3D::m_parentInfoList
private

A pointer to the parent MODULE_3D_SETTINGS list that we will use to copy to the preview module.

Definition at line 99 of file panel_prev_model.h.

Referenced by PANEL_PREV_3D(), SetModelDataIdx(), updateListOnModelCopy(), and ValidateWithMessage().

EDA_3D_CANVAS* PANEL_PREV_3D::m_previewPane
private
S3D_FILENAME_RESOLVER* PANEL_PREV_3D::m_resolver
private

Used to get the full path name.

Definition at line 84 of file panel_prev_model.h.

Referenced by initPanel(), PANEL_PREV_3D(), and UpdateModelName().

CINFO3D_VISU* PANEL_PREV_3D::m_settings3Dviewer
private

The settings that will be used for this 3D viewer canvas.

Definition at line 93 of file panel_prev_model.h.

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

wxBoxSizer* PANEL_PREV_3D_BASE::m_SizerPanelView
protectedinherited

Definition at line 70 of file panel_prev_3d_base.h.

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

wxSpinButton* PANEL_PREV_3D_BASE::m_spinXoffset
protectedinherited
wxSpinButton* PANEL_PREV_3D_BASE::m_spinXrot
protectedinherited
wxSpinButton* PANEL_PREV_3D_BASE::m_spinXscale
protectedinherited
wxSpinButton* PANEL_PREV_3D_BASE::m_spinYoffset
protectedinherited
wxSpinButton* PANEL_PREV_3D_BASE::m_spinYrot
protectedinherited
wxSpinButton* PANEL_PREV_3D_BASE::m_spinYscale
protectedinherited
wxSpinButton* PANEL_PREV_3D_BASE::m_spinZoffset
protectedinherited
wxSpinButton* PANEL_PREV_3D_BASE::m_spinZrot
protectedinherited
wxSpinButton* PANEL_PREV_3D_BASE::m_spinZscale
protectedinherited
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().

wxStaticText* PANEL_PREV_3D_BASE::m_staticText11
protectedinherited

Definition at line 52 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

wxStaticText* PANEL_PREV_3D_BASE::m_staticText12
protectedinherited

Definition at line 62 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

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().

wxStaticText* PANEL_PREV_3D_BASE::m_staticText21
protectedinherited

Definition at line 55 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

wxStaticText* PANEL_PREV_3D_BASE::m_staticText22
protectedinherited

Definition at line 65 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

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().

wxStaticText* PANEL_PREV_3D_BASE::m_staticText31
protectedinherited

Definition at line 58 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

wxStaticText* PANEL_PREV_3D_BASE::m_staticText32
protectedinherited

Definition at line 67 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

wxStaticText* PANEL_PREV_3D_BASE::m_staticTextOffset
protectedinherited

Definition at line 61 of file panel_prev_3d_base.h.

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

wxStaticText* PANEL_PREV_3D_BASE::m_staticTextRot
protectedinherited

Definition at line 51 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().

wxStaticText* PANEL_PREV_3D_BASE::m_staticTextScale
protectedinherited

Definition at line 41 of file panel_prev_3d_base.h.

Referenced by PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE().


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