KiCad PCB EDA Suite
panel_fp_properties_3d_model.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2010-2015 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
5  * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef PANEL_FP_PROPERTIES_3D_MODEL_H_
26 #define PANEL_FP_PROPERTIES_3D_MODEL_H_
27 
28 #include <footprint.h>
30 #include <vector>
31 
32 class DIALOG_SHIM;
35 
37 {
40  OPEN_FAIL,
43 };
44 
46 {
47 
48 public:
49 
51  DIALOG_SHIM* aDialogParent, wxWindow* aParent,
52  wxWindowID aId = wxID_ANY,
53  const wxPoint& aPos = wxDefaultPosition,
54  const wxSize& aSize = wxDefaultSize,
55  long aStyle = wxTAB_TRAVERSAL,
56  const wxString& aName = wxEmptyString );
57 
59 
60  bool TransferDataToWindow() override;
61  bool TransferDataFromWindow() override;
62 
64 
65  void AdjustGridColumnWidths( int aWidth );
66 
67  std::vector<FP_3DMODEL>& GetModelList()
68  {
69  return m_shapes3D_list;
70  }
71 
72 private:
73  // virtual event functions
74  void On3DModelSelected( wxGridEvent& ) override;
75  void On3DModelCellChanged( wxGridEvent& aEvent ) override;
76  void OnRemove3DModel( wxCommandEvent& event ) override;
77  void OnAdd3DModel( wxCommandEvent& event ) override;
78  void OnAdd3DRow( wxCommandEvent& event ) override;
79  void Cfg3DPath( wxCommandEvent& event ) override;
80 
81  void OnUpdateUI( wxUpdateUIEvent& event ) override;
82 
83  void updateValidateStatus( int aRow );
84 
85  MODEL_VALIDATE_ERRORS validateModelExists( const wxString& aFilename );
86 
87  void select3DModel( int aModelIdx );
88 
89 private:
93 
94  std::vector<FP_3DMODEL> m_shapes3D_list;
96 
97  bool m_inSelect;
98 };
99 
100 #endif // PANEL_FP_PROPERTIES_3D_MODEL_H_
void On3DModelSelected(wxGridEvent &) override
void OnUpdateUI(wxUpdateUIEvent &event) override
MODEL_VALIDATE_ERRORS validateModelExists(const wxString &aFilename)
std::vector< FP_3DMODEL > & GetModelList()
std::vector< FP_3DMODEL > m_shapes3D_list
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:82
void OnAdd3DModel(wxCommandEvent &event) override
void On3DModelCellChanged(wxGridEvent &aEvent) override
void OnAdd3DRow(wxCommandEvent &event) override
void OnRemove3DModel(wxCommandEvent &event) override
void Cfg3DPath(wxCommandEvent &event) override
Common, abstract interface for edit frames.
Class PANEL_FP_PROPERTIES_3D_MODEL_BASE.
PANEL_FP_PROPERTIES_3D_MODEL(PCB_BASE_EDIT_FRAME *aFrame, FOOTPRINT *aFootprint, DIALOG_SHIM *aDialogParent, wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=wxTAB_TRAVERSAL, const wxString &aName=wxEmptyString)