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
27#include "widgets/wx_grid.h"
28
29class DIALOG_SHIM;
33class wxBookCtrlEvent;
34
43
45{
46
47public:
49 DIALOG_SHIM* aDialogParent, PANEL_EMBEDDED_FILES* aFilesPanel,
50 wxWindow* aParent );
51
53
54 bool TransferDataToWindow() override;
55 bool TransferDataFromWindow() override;
56
57 bool Validate() override;
59
61
62 std::vector<FP_3DMODEL>& GetModelList() { return m_shapes3D_list; }
63
64private:
65 // virtual event functions
66 void On3DModelSelected( wxGridEvent& ) override;
67 void on3DModelCellChanging( wxGridEvent& aEvent );
68 void On3DModelCellChanged( wxGridEvent& aEvent ) override;
69 void OnRemove3DModel( wxCommandEvent& event ) override;
70 void OnAdd3DModel( wxCommandEvent& event ) override;
71 void OnAdd3DRow( wxCommandEvent& event ) override;
72 void Cfg3DPath( wxCommandEvent& event ) override;
73
74 void OnUpdateUI( wxUpdateUIEvent& event ) override;
75 void OnEnableExtrusion( wxCommandEvent& event ) override;
76 void OnExportExtrudedModel( wxCommandEvent& event ) override;
77 void onExtrusionControlChanged( wxCommandEvent& event );
78 void onExtrusionColorChanged( wxCommandEvent& event );
79 void onExtrusionMaterialChanged( wxCommandEvent& event );
80
83 bool readExtrusionHeights( const wxString& aTitle, double& aHeight, double& aStandoff );
84 void updateValidateStatus( int aRow );
85 void cleanupFilename( wxString* aFilename );
86 bool pick3DModel( const wxString& aCurrentValue, FP_3DMODEL& aModel );
87 void set3DModelRow( int aRow, const FP_3DMODEL& aModel );
89
90 MODEL_VALIDATE_ERRORS validateModelExists( const wxString& aFilename );
91
92 void select3DModel( int aModelIdx );
93
94 void onModify();
95
96 virtual void onDialogActivateEvent( wxActivateEvent& aEvent );
97 virtual void onShowEvent( wxShowEvent& aEvent );
98 void onSize( wxSizeEvent& aEvent );
99
107 void onNotebookPageChanged( wxBookCtrlEvent& aEvent );
108
109 // Wrapper on creating and posting custom event
110 void postCustomPanelShownEventWithPredicate( bool predicate );
111
112private:
116
117 std::vector<FP_3DMODEL> m_shapes3D_list;
118 bool m_sashPositioned = false;
121
124 std::vector<PCB_LAYER_ID> m_extrusionLayers;
125};
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition dialog_shim.h:80
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
bool pick3DModel(const wxString &aCurrentValue, FP_3DMODEL &aModel)
void onNotebookPageChanged(wxBookCtrlEvent &aEvent)
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
void setDefaultSashPosition()
Split the page so the model list shows its rows, never fewer than three and never more than a third o...
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)
bool readExtrusionHeights(const wxString &aTitle, double &aHeight, double &aStandoff)
void set3DModelRow(int aRow, const FP_3DMODEL &aModel)
void onExtrusionMaterialChanged(wxCommandEvent &event)
void On3DModelSelected(wxGridEvent &) override
Common, abstract interface for edit frames.