KiCad PCB EDA Suite
dialog_pad_primitives_properties.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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2008-2013 Wayne Stambaugh <[email protected]>
6 * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#ifndef _DIALOG_PAD_PRIMITIVES_PROPERTIES_
27#define _DIALOG_PAD_PRIMITIVES_PROPERTIES_
28
29#include <pcb_base_frame.h>
30#include <wx/valnum.h>
31#include <board.h>
32#include <footprint.h>
33#include <pad_shapes.h>
34#include <pcb_shape.h>
35#include <origin_viewitem.h>
38#include <pcb_draw_panel_gal.h>
39#include <widgets/unit_binder.h>
40
41
48{
49public:
50 DIALOG_PAD_PRIMITIVES_PROPERTIES( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
51 PCB_SHAPE* aShape );
52
56 bool TransferDataFromWindow() override;
57
58private:
63 bool TransferDataToWindow() override;
64
65 // The basic shape currently edited
67
78};
79
80
85{
86public:
87 DIALOG_PAD_PRIMITIVE_POLY_PROPS( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
88 PCB_SHAPE* aShape );
90
94 bool TransferDataFromWindow() override;
95
96private:
100 bool TransferDataToWindow() override;
101
105 bool Validate() override;
106
107 // Events handlers:
108 void OnButtonAdd( wxCommandEvent& event ) override;
109 void OnButtonDelete( wxCommandEvent& event ) override;
110 void onPaintPolyPanel( wxPaintEvent& event ) override;
111 void onPolyPanelResize( wxSizeEvent& event ) override;
112 void onGridSelect( wxGridRangeSelectEvent& event ) override;
113 void onCellChanging( wxGridEvent& event );
114 void onCellSelect( wxGridEvent& event ) override
115 {
116 event.Skip();
117 }
118
119 bool doValidate( bool aRemoveRedundantCorners );
120
121private:
123
124 std::vector<VECTOR2I> m_currPoints; // The working copy of the data being edited
126};
127
128
137{
138public:
139 DIALOG_PAD_PRIMITIVES_TRANSFORM( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
140 std::vector<std::shared_ptr<PCB_SHAPE>>& aList,
141 bool aShowDuplicate );
142
150 void Transform( std::vector<std::shared_ptr<PCB_SHAPE>>* aList = nullptr,
151 int aDuplicateCount = 0 );
152
156 int GetDuplicateCount() { return m_spinCtrlDuplicateCount->GetValue(); }
157
158private:
159 std::vector<std::shared_ptr<PCB_SHAPE>>& m_list;
160
164};
165
166#endif // #ifndef _DIALOG_PAD_PRIMITIVES_PROPERTIES_
Class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE.
A dialog to edit basic shape parameters.
DIALOG_PAD_PRIMITIVES_PROPERTIES(wxWindow *aParent, PCB_BASE_FRAME *aFrame, PCB_SHAPE *aShape)
bool TransferDataToWindow() override
Function TransferDataToWindow Transfer data into the GUI.
bool TransferDataFromWindow() override
Transfer data out of the GUI.
Class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE.
A dialog to apply geometry transforms to a shape or set of shapes (move, rotate around origin,...
DIALOG_PAD_PRIMITIVES_TRANSFORM(wxWindow *aParent, PCB_BASE_FRAME *aFrame, std::vector< std::shared_ptr< PCB_SHAPE > > &aList, bool aShowDuplicate)
void Transform(std::vector< std::shared_ptr< PCB_SHAPE > > *aList=nullptr, int aDuplicateCount=0)
Apply geometric transform (rotation, move, scale) defined in dialog aDuplicate = 1 .
std::vector< std::shared_ptr< PCB_SHAPE > > & m_list
Class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE.
A dialog to edit basic polygonal shape parameters.
void onPolyPanelResize(wxSizeEvent &event) override
bool TransferDataFromWindow() override
Transfer data out of the GUI.
bool Validate() override
Test for a valid polygon (a not self intersectiong polygon).
void onCellSelect(wxGridEvent &event) override
void onGridSelect(wxGridRangeSelectEvent &event) override
void OnButtonAdd(wxCommandEvent &event) override
void onPaintPolyPanel(wxPaintEvent &event) override
void OnButtonDelete(wxCommandEvent &event) override
bool TransferDataToWindow() override
Transfer data into the GUI.
DIALOG_PAD_PRIMITIVE_POLY_PROPS(wxWindow *aParent, PCB_BASE_FRAME *aFrame, PCB_SHAPE *aShape)
bool doValidate(bool aRemoveRedundantCorners)
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.