2014-10-27 14:14:39 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-02-02 16:43:34 +00:00
|
|
|
* Copyright (C) 2010-2015 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-10-27 14:14:39 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2009-08-11 10:27:21 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_edit_module_for_BoardEditor_base.h>
|
2009-08-11 10:27:21 +00:00
|
|
|
|
|
|
|
class DIALOG_MODULE_BOARD_EDITOR: public DIALOG_MODULE_BOARD_EDITOR_BASE
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
PCB_EDIT_FRAME * m_Parent;
|
2009-08-11 10:27:21 +00:00
|
|
|
wxDC * m_DC;
|
|
|
|
MODULE* m_CurrentModule;
|
|
|
|
TEXTE_MODULE* m_ReferenceCopy;
|
|
|
|
TEXTE_MODULE* m_ValueCopy;
|
|
|
|
std::vector <S3D_MASTER*> m_Shapes3D_list;
|
|
|
|
int m_LastSelected3DShapeIndex;
|
2014-08-09 18:18:04 +00:00
|
|
|
S3DPOINT_VALUE_CTRL * m_3D_Scale;
|
|
|
|
S3DPOINT_VALUE_CTRL * m_3D_Offset;
|
|
|
|
S3DPOINT_VALUE_CTRL * m_3D_Rotation;
|
2015-02-02 16:43:34 +00:00
|
|
|
static size_t m_page; // remember the last open page during session
|
2009-08-11 10:27:21 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructor and destructor
|
2011-03-01 19:26:17 +00:00
|
|
|
DIALOG_MODULE_BOARD_EDITOR( PCB_EDIT_FRAME* aParent, MODULE* aModule, wxDC* aDC );
|
2009-08-11 10:27:21 +00:00
|
|
|
~DIALOG_MODULE_BOARD_EDITOR();
|
|
|
|
|
|
|
|
private:
|
2014-08-24 07:05:07 +00:00
|
|
|
void BrowseAndAdd3DShapeFile();
|
2009-08-11 10:27:21 +00:00
|
|
|
void InitBoardProperties();
|
|
|
|
void InitModeditProperties();
|
|
|
|
void Transfert3DValuesToDisplay( S3D_MASTER * aStruct3DSource );
|
|
|
|
void TransfertDisplayTo3DValues( int aIndexSelection );
|
2015-02-02 16:43:34 +00:00
|
|
|
void Edit3DShapeFileName();
|
2014-08-24 07:05:07 +00:00
|
|
|
|
|
|
|
// virtual event functions
|
2009-08-11 10:27:21 +00:00
|
|
|
void OnEditValue( wxCommandEvent& event );
|
|
|
|
void OnEditReference( wxCommandEvent& event );
|
|
|
|
void On3DShapeSelection( wxCommandEvent& event );
|
2012-01-23 04:33:36 +00:00
|
|
|
void On3DShapeNameSelected( wxCommandEvent& event );
|
2015-02-02 16:43:34 +00:00
|
|
|
void Edit3DShapeFilename( wxCommandEvent& event )
|
2014-08-24 07:05:07 +00:00
|
|
|
{
|
2015-02-02 16:43:34 +00:00
|
|
|
Edit3DShapeFileName();
|
2014-08-24 07:05:07 +00:00
|
|
|
}
|
2009-08-11 10:27:21 +00:00
|
|
|
void Remove3DShape( wxCommandEvent& event );
|
2015-03-06 08:58:32 +00:00
|
|
|
void Add3DShape( wxCommandEvent& event )
|
2015-02-02 16:43:34 +00:00
|
|
|
{
|
|
|
|
BrowseAndAdd3DShapeFile();
|
|
|
|
}
|
2009-08-11 10:27:21 +00:00
|
|
|
void OnCancelClick( wxCommandEvent& event );
|
|
|
|
void OnOkClick( wxCommandEvent& event );
|
|
|
|
void GotoModuleEditor( wxCommandEvent& event );
|
|
|
|
void ExchangeModule( wxCommandEvent& event );
|
|
|
|
void ModuleOrientEvent( wxCommandEvent& event );
|
|
|
|
};
|
|
|
|
|