KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The 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, see <https://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <footprint.h>
25#include <vector>
26
27class DIALOG_SHIM;
31
40
42{
43
44public:
46 DIALOG_SHIM* aDialogParent, PANEL_EMBEDDED_FILES* aFilesPanel,
47 wxWindow* aParent );
48
50
51 bool TransferDataToWindow() override;
52 bool TransferDataFromWindow() override;
53
55
56 std::vector<FP_3DMODEL>& GetModelList() { return m_shapes3D_list; }
57
58private:
59 // virtual event functions
60 void On3DModelSelected( wxGridEvent& ) override;
61 void on3DModelCellChanging( wxGridEvent& aEvent );
62 void On3DModelCellChanged( wxGridEvent& aEvent ) override;
63 void OnRemove3DModel( wxCommandEvent& event ) override;
64 void OnAdd3DModel( wxCommandEvent& event ) override;
65 void OnAdd3DRow( wxCommandEvent& event ) override;
66 void Cfg3DPath( wxCommandEvent& event ) override;
67
68 void OnUpdateUI( wxUpdateUIEvent& event ) override;
69 void OnEnableExtrusion( wxCommandEvent& event ) override;
70 void OnExportExtrudedModel( wxCommandEvent& event ) override;
71 void onExtrusionControlChanged( wxCommandEvent& event );
72 void onExtrusionColorChanged( wxCommandEvent& event );
73 void onExtrusionMaterialChanged( wxCommandEvent& event );
74
77 void updateValidateStatus( int aRow );
78 void cleanupFilename( wxString* aFilename );
79
80 MODEL_VALIDATE_ERRORS validateModelExists( const wxString& aFilename );
81
82 void select3DModel( int aModelIdx );
83
84 void onModify();
85
86 virtual void onDialogActivateEvent( wxActivateEvent& aEvent );
87 virtual void onShowEvent( wxShowEvent& aEvent );
88
89 // Wrapper on creating and posting custom event
90 void postCustomPanelShownEventWithPredicate( bool predicate );
91
92private:
96
97 std::vector<FP_3DMODEL> m_shapes3D_list;
100
103 std::vector<PCB_LAYER_ID> m_extrusionLayers;
104};
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition dialog_shim.h:65
PANEL_FP_PROPERTIES_3D_MODEL_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(778, 420), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
void on3DModelCellChanging(wxGridEvent &aEvent)
void OnUpdateUI(wxUpdateUIEvent &event) override
void Cfg3DPath(wxCommandEvent &event) override
void OnEnableExtrusion(wxCommandEvent &event) override
void OnRemove3DModel(wxCommandEvent &event) override
std::vector< FP_3DMODEL > & GetModelList()
virtual void onShowEvent(wxShowEvent &aEvent)
void On3DModelCellChanged(wxGridEvent &aEvent) override
virtual void onDialogActivateEvent(wxActivateEvent &aEvent)
std::vector< PCB_LAYER_ID > m_extrusionLayers
PANEL_FP_PROPERTIES_3D_MODEL(PCB_BASE_EDIT_FRAME *aFrame, FOOTPRINT *aFootprint, DIALOG_SHIM *aDialogParent, PANEL_EMBEDDED_FILES *aFilesPanel, wxWindow *aParent)
void postCustomPanelShownEventWithPredicate(bool predicate)
void OnExportExtrudedModel(wxCommandEvent &event) override
MODEL_VALIDATE_ERRORS validateModelExists(const wxString &aFilename)
void OnAdd3DModel(wxCommandEvent &event) override
void OnAdd3DRow(wxCommandEvent &event) override
void onExtrusionColorChanged(wxCommandEvent &event)
void onExtrusionControlChanged(wxCommandEvent &event)
std::vector< FP_3DMODEL > m_shapes3D_list
void onExtrusionMaterialChanged(wxCommandEvent &event)
void On3DModelSelected(wxGridEvent &) override
Common, abstract interface for edit frames.