From a43f3ab1fe46390718ac97d429c4e4e09d36793d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 20 Sep 2017 10:28:52 +0200 Subject: [PATCH] replace "BasicShape" by "Primitive" in code, a better name --- 3d-viewer/3d_canvas/create_layer_items.cpp | 2 +- 3d-viewer/3d_canvas/create_layer_poly.cpp | 2 +- ...board_items_to_polygon_shape_transform.cpp | 2 +- pcbnew/class_pad.cpp | 10 +- pcbnew/class_pad.h | 22 +-- pcbnew/class_pad_custom_shape_functions.cpp | 30 ++--- pcbnew/class_pad_draw_functions.cpp | 2 +- .../dialog_pad_basicshapes_properties.cpp | 42 +++--- pcbnew/dialogs/dialog_pad_properties.cpp | 96 ++++++------- pcbnew/dialogs/dialog_pad_properties.h | 30 ++--- pcbnew/dialogs/dialog_pad_properties_base.cpp | 126 +++++++++--------- pcbnew/dialogs/dialog_pad_properties_base.fbp | 44 +++--- pcbnew/dialogs/dialog_pad_properties_base.h | 50 +++---- pcbnew/drc_clearance_test_functions.cpp | 8 +- pcbnew/kicad_plugin.cpp | 4 +- pcbnew/microwave.cpp | 2 +- pcbnew/pad_edition_functions.cpp | 4 +- pcbnew/pcb_parser.cpp | 10 +- pcbnew/plot_brditems_plotter.cpp | 4 +- pcbnew/router/pns_kicad_iface.cpp | 4 +- ...nvert_brd_items_to_polygons_with_Boost.cpp | 4 +- 21 files changed, 249 insertions(+), 249 deletions(-) diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index 62ab3a6c37..063a428808 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -499,7 +499,7 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad, { SHAPE_POLY_SET polyList; // Will contain the pad outlines in board coordinates polyList.Append( aPad->GetCustomShapeAsPolygon() ); - aPad->BasicShapesAsPolygonToBoardPosition( &polyList, aPad->ShapePos(), aPad->GetOrientation() ); + aPad->CustomShapeAsPolygonToBoardPosition( &polyList, aPad->ShapePos(), aPad->GetOrientation() ); if( aClearanceValue ) polyList.Inflate( aClearanceValue, 32 ); diff --git a/3d-viewer/3d_canvas/create_layer_poly.cpp b/3d-viewer/3d_canvas/create_layer_poly.cpp index 13a67cfce3..3e1dd03fa9 100644 --- a/3d-viewer/3d_canvas/create_layer_poly.cpp +++ b/3d-viewer/3d_canvas/create_layer_poly.cpp @@ -79,7 +79,7 @@ void CINFO3D_VISU::buildPadShapePolygon( const D_PAD* aPad, { SHAPE_POLY_SET polyList; // Will contain the pad outlines in board coordinates polyList.Append( aPad->GetCustomShapeAsPolygon() ); - aPad->BasicShapesAsPolygonToBoardPosition( &polyList, aPad->ShapePos(), aPad->GetOrientation() ); + aPad->CustomShapeAsPolygonToBoardPosition( &polyList, aPad->ShapePos(), aPad->GetOrientation() ); aCornerBuffer.Append( polyList ); } break; diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 07a57cd443..81818bc226 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -711,7 +711,7 @@ void D_PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, SHAPE_POLY_SET outline; // Will contain the corners in board coordinates outline.Append( m_customShapeAsPolygon ); - BasicShapesAsPolygonToBoardPosition( &outline, GetPosition(), GetOrientation() ); + CustomShapeAsPolygonToBoardPosition( &outline, GetPosition(), GetOrientation() ); outline.Inflate( clearance, aCircleToSegmentsCount ); aCornerBuffer.Append( outline ); } diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 736329edaa..bd1f5f58a0 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -328,7 +328,7 @@ const EDA_RECT D_PAD::GetBoundingBox() const { SHAPE_POLY_SET polySet( m_customShapeAsPolygon ); // Move shape to actual position - BasicShapesAsPolygonToBoardPosition( &polySet, GetPosition(), GetOrientation() ); + CustomShapeAsPolygonToBoardPosition( &polySet, GetPosition(), GetOrientation() ); quadrant1 = m_Pos; quadrant2 = m_Pos; @@ -424,14 +424,14 @@ void D_PAD::Flip( const wxPoint& aCentre ) SetLayerSet( FlipLayerMask( m_layerMask ) ); // Flip the basic shapes, in custom pads - FlipBasicShapes(); + FlipPrimitives(); // m_boundingRadius = -1; the shape has not been changed } // Flip the basic shapes, in custom pads -void D_PAD::FlipBasicShapes() +void D_PAD::FlipPrimitives() { // Flip custom shapes for( unsigned ii = 0; ii < m_basicShapes.size(); ++ii ) @@ -1388,7 +1388,7 @@ void D_PAD::ImportSettingsFromMaster( const D_PAD& aMasterPad ) } // Add or remove custom pad shapes: - SetBasicShapes( aMasterPad.GetBasicShapes() ); + SetPrimitives( aMasterPad.GetPrimitives() ); SetAnchorPadShape( aMasterPad.GetAnchorPadShape() ); - MergeBasicShapesAsPolygon(); + MergePrimitivesAsPolygon(); } diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index 16f13d6eb0..b472c3ca73 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -271,10 +271,10 @@ public: * a filled circle or ring ( if thickness == 0, this is a filled circle, else a ring) * a arc */ - void AddBasicShape( std::vector& aPoly, int aThickness ); ///< add a polygonal basic shape - void AddBasicShape( wxPoint aStart, wxPoint aEnd, int aThickness ); ///< segment basic shape - void AddBasicShape( wxPoint aCenter, int aRadius, int aThickness ); ///< ring or circle basic shape - void AddBasicShape( wxPoint aCenter, wxPoint aStart, + void AddPrimitive( std::vector& aPoly, int aThickness ); ///< add a polygonal basic shape + void AddPrimitive( wxPoint aStart, wxPoint aEnd, int aThickness ); ///< segment basic shape + void AddPrimitive( wxPoint aCenter, int aRadius, int aThickness ); ///< ring or circle basic shape + void AddPrimitive( wxPoint aCenter, wxPoint aStart, int aArcAngle, int aThickness ); ///< arc basic shape @@ -289,18 +289,18 @@ public: * (default = 32) * Note: The corners coordinates are relative to the pad position, orientation 0, */ - bool MergeBasicShapesAsPolygon( SHAPE_POLY_SET * aMergedPolygon = NULL, + bool MergePrimitivesAsPolygon( SHAPE_POLY_SET * aMergedPolygon = NULL, int aCircleToSegmentsCount = 32 ); /** * clear the basic shapes list */ - void DeleteBasicShapesList(); + void DeletePrimitivesList(); /** * When created, the corners coordinates are relative to the pad position, orientation 0, * in m_customShapeAsPolygon - * BasicShapesAsPolygonToBoardPosition transform these coordinates to actual + * CustomShapeAsPolygonToBoardPosition transform these coordinates to actual * (board) coordinates * @param aMergedPolygon = the corners coordinates, relative to aPosition and * rotated by aRotation @@ -309,13 +309,13 @@ public: * @param aRotation = the rotation of the shape (usually the pad rotation, but * not always, in DRC) */ - void BasicShapesAsPolygonToBoardPosition( SHAPE_POLY_SET * aMergedPolygon, + void CustomShapeAsPolygonToBoardPosition( SHAPE_POLY_SET * aMergedPolygon, wxPoint aPosition, double aRotation ) const; /** * Accessor to the basic shape list */ - const std::vector& GetBasicShapes() const { return m_basicShapes; } + const std::vector& GetPrimitives() const { return m_basicShapes; } /** * Accessor to the custom shape as one polygon @@ -327,14 +327,14 @@ public: /** * Flip the basic shapes, in custom pads */ - void FlipBasicShapes(); + void FlipPrimitives(); /** * Import to the basic shape list * @return true if OK, false if issues * (more than one polygon to build the polygon shape list) */ - bool SetBasicShapes( const std::vector& aBasicShapesList ); + bool SetPrimitives( const std::vector& aPrimitivesList ); /** diff --git a/pcbnew/class_pad_custom_shape_functions.cpp b/pcbnew/class_pad_custom_shape_functions.cpp index 529aeacf1a..25a4a58457 100644 --- a/pcbnew/class_pad_custom_shape_functions.cpp +++ b/pcbnew/class_pad_custom_shape_functions.cpp @@ -66,18 +66,18 @@ void PAD_CS_PRIMITIVE::ExportTo( DRAWSEGMENT* aTarget ) * add a free shape to the shape list. * the shape is a polygon (can be with thick outline), segment, circle or arc */ -void D_PAD::AddBasicShape( std::vector& aPoly, int aThickness ) +void D_PAD::AddPrimitive( std::vector& aPoly, int aThickness ) { PAD_CS_PRIMITIVE shape( S_POLYGON ); shape.m_Poly = aPoly; shape.m_Thickness = aThickness; m_basicShapes.push_back( shape ); - MergeBasicShapesAsPolygon(); + MergePrimitivesAsPolygon(); } -void D_PAD::AddBasicShape( wxPoint aStart, wxPoint aEnd, int aThickness ) +void D_PAD::AddPrimitive( wxPoint aStart, wxPoint aEnd, int aThickness ) { PAD_CS_PRIMITIVE shape( S_SEGMENT ); shape.m_Start = aStart; @@ -85,11 +85,11 @@ void D_PAD::AddBasicShape( wxPoint aStart, wxPoint aEnd, int aThickness ) shape.m_Thickness = aThickness; m_basicShapes.push_back( shape ); - MergeBasicShapesAsPolygon(); + MergePrimitivesAsPolygon(); } -void D_PAD::AddBasicShape( wxPoint aCenter, wxPoint aStart, int aArcAngle, int aThickness ) +void D_PAD::AddPrimitive( wxPoint aCenter, wxPoint aStart, int aArcAngle, int aThickness ) { PAD_CS_PRIMITIVE shape( S_ARC ); shape.m_Start = aCenter; @@ -98,11 +98,11 @@ void D_PAD::AddBasicShape( wxPoint aCenter, wxPoint aStart, int aArcAngle, int a shape.m_Thickness = aThickness; m_basicShapes.push_back( shape ); - MergeBasicShapesAsPolygon(); + MergePrimitivesAsPolygon(); } -void D_PAD::AddBasicShape( wxPoint aCenter, int aRadius, int aThickness ) +void D_PAD::AddPrimitive( wxPoint aCenter, int aRadius, int aThickness ) { PAD_CS_PRIMITIVE shape( S_CIRCLE ); shape.m_Start = aCenter; @@ -110,25 +110,25 @@ void D_PAD::AddBasicShape( wxPoint aCenter, int aRadius, int aThickness ) shape.m_Thickness = aThickness; m_basicShapes.push_back( shape ); - MergeBasicShapesAsPolygon(); + MergePrimitivesAsPolygon(); } -bool D_PAD::SetBasicShapes( const std::vector& aBasicShapesList ) +bool D_PAD::SetPrimitives( const std::vector& aPrimitivesList ) { // clear old list m_basicShapes.clear(); // Import to the basic shape list - if( aBasicShapesList.size() ) - m_basicShapes = aBasicShapesList; + if( aPrimitivesList.size() ) + m_basicShapes = aPrimitivesList; // Only one polygon is expected (pad area = only one copper area) - return MergeBasicShapesAsPolygon(); + return MergePrimitivesAsPolygon(); } // clear the basic shapes list and associated data -void D_PAD::DeleteBasicShapesList() +void D_PAD::DeletePrimitivesList() { m_basicShapes.clear(); m_customShapeAsPolygon.RemoveAllContours(); @@ -139,7 +139,7 @@ void D_PAD::DeleteBasicShapesList() * return true if OK, false in there is more than one polygon * in aMergedPolygon */ -bool D_PAD::MergeBasicShapesAsPolygon( SHAPE_POLY_SET* aMergedPolygon, +bool D_PAD::MergePrimitivesAsPolygon( SHAPE_POLY_SET* aMergedPolygon, int aCircleToSegmentsCount ) { // if aMergedPolygon == NULL, use m_customShapeAsPolygon as target @@ -242,7 +242,7 @@ bool D_PAD::MergeBasicShapesAsPolygon( SHAPE_POLY_SET* aMergedPolygon, return aMergedPolygon->OutlineCount() <= 1; } -void D_PAD::BasicShapesAsPolygonToBoardPosition( SHAPE_POLY_SET * aMergedPolygon, +void D_PAD::CustomShapeAsPolygonToBoardPosition( SHAPE_POLY_SET * aMergedPolygon, wxPoint aPosition, double aRotation ) const { if( aMergedPolygon->OutlineCount() == 0 ) diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index ed0093788a..d13d462907 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -500,7 +500,7 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) SHAPE_POLY_SET outline; // Will contain the corners in board coordinates outline.Append( m_customShapeAsPolygon ); - BasicShapesAsPolygonToBoardPosition( &outline, pad_pos, GetOrientation() ); + CustomShapeAsPolygonToBoardPosition( &outline, pad_pos, GetOrientation() ); SHAPE_LINE_CHAIN* poly; const int segmentToCircleCount = 32; diff --git a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp index 87623df181..197b2388a2 100644 --- a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp @@ -44,9 +44,9 @@ #include -DIALOG_PAD_BASICSHAPES_PROPERTIES::DIALOG_PAD_BASICSHAPES_PROPERTIES( +DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES( wxWindow* aParent, PAD_CS_PRIMITIVE * aShape ) - : DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE( aParent ) + : DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE( aParent ) { m_shape = aShape; TransferDataToWindow(); @@ -55,7 +55,7 @@ DIALOG_PAD_BASICSHAPES_PROPERTIES::DIALOG_PAD_BASICSHAPES_PROPERTIES( GetSizer()->SetSizeHints( this ); } -bool DIALOG_PAD_BASICSHAPES_PROPERTIES::TransferDataToWindow() +bool DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataToWindow() { if( m_shape == NULL ) return false; @@ -139,7 +139,7 @@ bool DIALOG_PAD_BASICSHAPES_PROPERTIES::TransferDataToWindow() return true; } -bool DIALOG_PAD_BASICSHAPES_PROPERTIES::TransferDataFromWindow() +bool DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataFromWindow() { // Transfer data out of the GUI. m_shape->m_Thickness = ValueFromString( g_UserUnit, m_textCtrlThickness->GetValue() ); @@ -183,9 +183,9 @@ bool DIALOG_PAD_BASICSHAPES_PROPERTIES::TransferDataFromWindow() } -DIALOG_PAD_BASIC_SHP_POLY_PROPS::DIALOG_PAD_BASIC_SHP_POLY_PROPS( +DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS( wxWindow* aParent, PAD_CS_PRIMITIVE * aShape ) - : DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE( aParent ), + : DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE( aParent ), m_shape( aShape ), m_currshape( *m_shape ) { TransferDataToWindow(); @@ -195,18 +195,18 @@ DIALOG_PAD_BASIC_SHP_POLY_PROPS::DIALOG_PAD_BASIC_SHP_POLY_PROPS( // TODO: move wxEVT_GRID_CELL_CHANGING in wxFormbuilder, when it support it m_gridCornersList->Connect( wxEVT_GRID_CELL_CHANGING, - wxGridEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS::onCellChanging ), NULL, this ); + wxGridEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS::onCellChanging ), NULL, this ); } -DIALOG_PAD_BASIC_SHP_POLY_PROPS::~DIALOG_PAD_BASIC_SHP_POLY_PROPS() +DIALOG_PAD_PRIMITIVE_POLY_PROPS::~DIALOG_PAD_PRIMITIVE_POLY_PROPS() { m_gridCornersList->Disconnect( wxEVT_GRID_CELL_CHANGING, - wxGridEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS::onCellChanging ), NULL, this ); + wxGridEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS::onCellChanging ), NULL, this ); } -bool DIALOG_PAD_BASIC_SHP_POLY_PROPS::TransferDataToWindow() +bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataToWindow() { if( m_shape == NULL ) return false; @@ -256,7 +256,7 @@ bool DIALOG_PAD_BASIC_SHP_POLY_PROPS::TransferDataToWindow() return true; } -bool DIALOG_PAD_BASIC_SHP_POLY_PROPS::TransferDataFromWindow() +bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataFromWindow() { if( !Validate() ) return false; @@ -270,7 +270,7 @@ bool DIALOG_PAD_BASIC_SHP_POLY_PROPS::TransferDataFromWindow() // test for a valid polygon (a not self intersectiong polygon) -bool DIALOG_PAD_BASIC_SHP_POLY_PROPS::Validate() +bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::Validate() { if( m_currshape.m_Poly.size() < 3 ) { @@ -321,7 +321,7 @@ bool DIALOG_PAD_BASIC_SHP_POLY_PROPS::Validate() } -void DIALOG_PAD_BASIC_SHP_POLY_PROPS::onButtonAdd( wxCommandEvent& event ) +void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onButtonAdd( wxCommandEvent& event ) { // Insert a new corner after the currently selected: int row = -1; @@ -361,7 +361,7 @@ void DIALOG_PAD_BASIC_SHP_POLY_PROPS::onButtonAdd( wxCommandEvent& event ) m_panelPoly->Refresh(); } -void DIALOG_PAD_BASIC_SHP_POLY_PROPS::OnButtonDelete( wxCommandEvent& event ) +void DIALOG_PAD_PRIMITIVE_POLY_PROPS::OnButtonDelete( wxCommandEvent& event ) { wxArrayInt selections = m_gridCornersList->GetSelectedRows(); std::sort( selections.begin(), selections.end() ); @@ -380,7 +380,7 @@ void DIALOG_PAD_BASIC_SHP_POLY_PROPS::OnButtonDelete( wxCommandEvent& event ) m_panelPoly->Refresh(); } -void DIALOG_PAD_BASIC_SHP_POLY_PROPS::onPaintPolyPanel( wxPaintEvent& event ) +void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel( wxPaintEvent& event ) { wxPaintDC dc( m_panelPoly ); wxSize dc_size = dc.GetSize(); @@ -450,18 +450,18 @@ void DIALOG_PAD_BASIC_SHP_POLY_PROPS::onPaintPolyPanel( wxPaintEvent& event ) event.Skip(); } -void DIALOG_PAD_BASIC_SHP_POLY_PROPS::onPolyPanelResize( wxSizeEvent& event ) +void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPolyPanelResize( wxSizeEvent& event ) { m_panelPoly->Refresh(); event.Skip(); } -void DIALOG_PAD_BASIC_SHP_POLY_PROPS::onGridSelect( wxGridRangeSelectEvent& event ) +void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onGridSelect( wxGridRangeSelectEvent& event ) { m_panelPoly->Refresh(); } -void DIALOG_PAD_BASIC_SHP_POLY_PROPS::onCellChanging( wxGridEvent& event ) +void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onCellChanging( wxGridEvent& event ) { int row = event.GetRow(); int col = event.GetCol(); @@ -488,10 +488,10 @@ void DIALOG_PAD_BASIC_SHP_POLY_PROPS::onCellChanging( wxGridEvent& event ) // A dialog to apply geometry transforms to a shape or set of shapes // (move, rotate around origin, scaling factor, duplication). -DIALOG_PAD_BASICSHAPES_TRANSFORM::DIALOG_PAD_BASICSHAPES_TRANSFORM( +DIALOG_PAD_PRIMITIVES_TRANSFORM::DIALOG_PAD_PRIMITIVES_TRANSFORM( wxWindow* aParent, std::vector& aList, bool aShowDuplicate ) - :DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE( aParent ), m_list( aList ) + :DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE( aParent ), m_list( aList ) { wxString unit = GetAbbreviatedUnitsLabel(); m_staticTextMoveUnit->SetLabel( unit ); @@ -515,7 +515,7 @@ inline void geom_transf( wxPoint& aCoord, wxPoint& aMove, double aScale, double RotatePoint( &aCoord, aRotation ); } -void DIALOG_PAD_BASICSHAPES_TRANSFORM::Transform( std::vector* aList, int aDuplicateCount ) +void DIALOG_PAD_PRIMITIVES_TRANSFORM::Transform( std::vector* aList, int aDuplicateCount ) { // Get parameters from dlg: wxPoint moveVect; diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 11ce4583dc..ade833efdd 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -274,7 +274,7 @@ void DIALOG_PAD_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event ) // draw selected primitives: COLOR4D hcolor = CYAN; - long select = m_listCtrlShapes->GetFirstSelected(); + long select = m_listCtrlPrimitives->GetFirstSelected(); wxPoint start, end, center; while( select >= 0 ) @@ -325,7 +325,7 @@ void DIALOG_PAD_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event ) break; } - select = m_listCtrlShapes->GetNextSelected( select ); + select = m_listCtrlPrimitives->GetNextSelected( select ); } // Draw X and Y axis. This is particularly useful to show the @@ -457,10 +457,10 @@ void DIALOG_PAD_PROPERTIES::initValues() m_dummyPad->SetLayerSet( FlipLayerMask( m_dummyPad->GetLayerSet() ) ); // flip custom pad shapes - m_dummyPad->FlipBasicShapes(); + m_dummyPad->FlipPrimitives(); } - m_primitives = m_dummyPad->GetBasicShapes(); + m_primitives = m_dummyPad->GetPrimitives(); m_staticTextWarningPadFlipped->Show(m_isFlipped); @@ -664,7 +664,7 @@ void DIALOG_PAD_PROPERTIES::initValues() updateRoundRectCornerValues(); // Update basic shapes list - displayBasicShapesList(); + displayPrimitivesList(); } // A small helper function, to display coordinates: @@ -675,15 +675,15 @@ static wxString formatCoord( wxPoint aCoord ) CoordinateToString( aCoord.y, true ) ); } -void DIALOG_PAD_PROPERTIES::displayBasicShapesList() +void DIALOG_PAD_PROPERTIES::displayPrimitivesList() { - m_listCtrlShapes->ClearAll(); + m_listCtrlPrimitives->ClearAll(); wxListItem itemCol; itemCol.SetImage(-1); for( int ii = 0; ii < 5; ++ii ) - m_listCtrlShapes->InsertColumn(ii, itemCol); + m_listCtrlPrimitives->InsertColumn(ii, itemCol); wxString bs_info[5]; @@ -733,18 +733,18 @@ void DIALOG_PAD_PROPERTIES::displayBasicShapesList() break; } - long tmp = m_listCtrlShapes->InsertItem(ii, bs_info[0]); - m_listCtrlShapes->SetItemData(tmp, ii); + long tmp = m_listCtrlPrimitives->InsertItem(ii, bs_info[0]); + m_listCtrlPrimitives->SetItemData(tmp, ii); for( int jj = 0, col = 0; jj < 5; ++jj ) { - m_listCtrlShapes->SetItem(tmp, col++, bs_info[jj]); + m_listCtrlPrimitives->SetItem(tmp, col++, bs_info[jj]); } } // Now columns are filled, ensure correct width of columns for( unsigned ii = 0; ii < 5; ++ii ) - m_listCtrlShapes->SetColumnWidth( ii, wxLIST_AUTOSIZE ); + m_listCtrlPrimitives->SetColumnWidth( ii, wxLIST_AUTOSIZE ); } void DIALOG_PAD_PROPERTIES::OnResize( wxSizeEvent& event ) @@ -1073,7 +1073,7 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK() if( m_dummyPad->GetShape() == PAD_SHAPE_CUSTOM ) { - if( !m_dummyPad->MergeBasicShapesAsPolygon( ) ) + if( !m_dummyPad->MergePrimitivesAsPolygon( ) ) error_msgs.Add( _( "Incorrect pad shape: the shape must be equivalent to only one polygon" ) ); } @@ -1109,7 +1109,7 @@ void DIALOG_PAD_PROPERTIES::redraw() } // highlight selected primitives: - long select = m_listCtrlShapes->GetFirstSelected(); + long select = m_listCtrlPrimitives->GetFirstSelected(); while( select >= 0 ) { @@ -1163,7 +1163,7 @@ void DIALOG_PAD_PROPERTIES::redraw() m_highligth.push_back( dummySegment ); } - select = m_listCtrlShapes->GetNextSelected( select ); + select = m_listCtrlPrimitives->GetNextSelected( select ); } BOX2I bbox = m_dummyPad->ViewBBox(); @@ -1283,16 +1283,16 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() m_currentPad->SetPadToDieLength( m_padMaster->GetPadToDieLength() ); if( m_padMaster->GetShape() != PAD_SHAPE_CUSTOM ) - m_padMaster->DeleteBasicShapesList(); + m_padMaster->DeletePrimitivesList(); m_currentPad->SetAnchorPadShape( m_padMaster->GetAnchorPadShape() ); - m_currentPad->SetBasicShapes( m_padMaster->GetBasicShapes() ); + m_currentPad->SetPrimitives( m_padMaster->GetPrimitives() ); if( m_isFlipped ) { m_currentPad->SetLayerSet( FlipLayerMask( m_currentPad->GetLayerSet() ) ); - m_currentPad->FlipBasicShapes(); + m_currentPad->FlipPrimitives(); } if( m_currentPad->GetLayerSet() != m_padMaster->GetLayerSet() ) @@ -1386,7 +1386,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( D_PAD* aPad ) PAD_SHAPE_RECT : PAD_SHAPE_CIRCLE ); if( aPad->GetShape() == PAD_SHAPE_CUSTOM ) - aPad->SetBasicShapes( m_primitives ); + aPad->SetPrimitives( m_primitives ); // Read pad clearances values: aPad->SetLocalClearance( ValueFromTextCtrl( *m_NetClearanceValueCtrl ) ); @@ -1683,9 +1683,9 @@ void DIALOG_PAD_PROPERTIES::OnValuesChanged( wxCommandEvent& event ) } } -void DIALOG_PAD_PROPERTIES::editBasicShape() +void DIALOG_PAD_PROPERTIES::editPrimitive() { - long select = m_listCtrlShapes->GetFirstSelected(); + long select = m_listCtrlPrimitives->GetFirstSelected(); if( select < 0 ) { @@ -1697,7 +1697,7 @@ void DIALOG_PAD_PROPERTIES::editBasicShape() if( shape.m_Shape == S_POLYGON ) { - DIALOG_PAD_BASIC_SHP_POLY_PROPS dlg( this, &shape ); + DIALOG_PAD_PRIMITIVE_POLY_PROPS dlg( this, &shape ); if( dlg.ShowModal() != wxID_OK ) return; @@ -1707,7 +1707,7 @@ void DIALOG_PAD_PROPERTIES::editBasicShape() else { - DIALOG_PAD_BASICSHAPES_PROPERTIES dlg( this, &shape ); + DIALOG_PAD_PRIMITIVES_PROPERTIES dlg( this, &shape ); if( dlg.ShowModal() != wxID_OK ) return; @@ -1715,7 +1715,7 @@ void DIALOG_PAD_PROPERTIES::editBasicShape() dlg.TransferDataFromWindow(); } - displayBasicShapesList(); + displayPrimitivesList(); if( m_canUpdate ) { @@ -1734,22 +1734,22 @@ void DIALOG_PAD_PROPERTIES::OnPrimitiveSelection( wxListEvent& event ) /// Called on a double click on the basic shapes list -void DIALOG_PAD_PROPERTIES::onCustomShapeDClick( wxMouseEvent& event ) +void DIALOG_PAD_PROPERTIES::onPrimitiveDClick( wxMouseEvent& event ) { - editBasicShape(); + editPrimitive(); } // Called on a click on basic shapes list panel button -void DIALOG_PAD_PROPERTIES::onEditShape( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::onEditPrimitive( wxCommandEvent& event ) { - editBasicShape(); + editPrimitive(); } // Called on a click on basic shapes list panel button -void DIALOG_PAD_PROPERTIES::onDeleteShape( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::onDeletePrimitive( wxCommandEvent& event ) { - long select = m_listCtrlShapes->GetFirstSelected(); + long select = m_listCtrlPrimitives->GetFirstSelected(); if( select < 0 ) return; @@ -1758,14 +1758,14 @@ void DIALOG_PAD_PROPERTIES::onDeleteShape( wxCommandEvent& event ) std::vector indexes; indexes.push_back( select ); - while( ( select = m_listCtrlShapes->GetNextSelected( select ) ) >= 0 ) + while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 ) indexes.push_back( select ); // Erase all select shapes for( unsigned ii = indexes.size(); ii > 0; --ii ) m_primitives.erase( m_primitives.begin() + indexes[ii-1] ); - displayBasicShapesList(); + displayPrimitivesList(); if( m_canUpdate ) { @@ -1775,7 +1775,7 @@ void DIALOG_PAD_PROPERTIES::onDeleteShape( wxCommandEvent& event ) } -void DIALOG_PAD_PROPERTIES::onAddShape( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::onAddPrimitive( wxCommandEvent& event ) { // Ask user for shape type wxString shapelist[] = @@ -1791,26 +1791,26 @@ void DIALOG_PAD_PROPERTIES::onAddShape( wxCommandEvent& event ) S_SEGMENT, S_ARC, S_CIRCLE, S_POLYGON }; - PAD_CS_PRIMITIVE basicShape( listtype[type] ); + PAD_CS_PRIMITIVE primitive( listtype[type] ); if( listtype[type] == S_POLYGON ) { - DIALOG_PAD_BASIC_SHP_POLY_PROPS dlg( this, &basicShape ); + DIALOG_PAD_PRIMITIVE_POLY_PROPS dlg( this, &primitive ); if( dlg.ShowModal() != wxID_OK ) return; } else { - DIALOG_PAD_BASICSHAPES_PROPERTIES dlg( this, &basicShape ); + DIALOG_PAD_PRIMITIVES_PROPERTIES dlg( this, &primitive ); if( dlg.ShowModal() != wxID_OK ) return; } - m_primitives.push_back( basicShape ); + m_primitives.push_back( primitive ); - displayBasicShapesList(); + displayPrimitivesList(); if( m_canUpdate ) { @@ -1820,7 +1820,7 @@ void DIALOG_PAD_PROPERTIES::onAddShape( wxCommandEvent& event ) } -void DIALOG_PAD_PROPERTIES::onImportShape( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::onImportPrimitives( wxCommandEvent& event ) { wxMessageBox( "Not yet available" ); } @@ -1828,7 +1828,7 @@ void DIALOG_PAD_PROPERTIES::onImportShape( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::onGeometryTransform( wxCommandEvent& event ) { - long select = m_listCtrlShapes->GetFirstSelected(); + long select = m_listCtrlPrimitives->GetFirstSelected(); if( select < 0 ) { @@ -1843,13 +1843,13 @@ void DIALOG_PAD_PROPERTIES::onGeometryTransform( wxCommandEvent& event ) std::vector shapeList; shapeList.push_back( &m_primitives[select] ); - while( ( select = m_listCtrlShapes->GetNextSelected( select ) ) >= 0 ) + while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 ) { indexes.push_back( select ); shapeList.push_back( &m_primitives[select] ); } - DIALOG_PAD_BASICSHAPES_TRANSFORM dlg( this, shapeList ); + DIALOG_PAD_PRIMITIVES_TRANSFORM dlg( this, shapeList ); if( dlg.ShowModal() != wxID_OK ) return; @@ -1857,7 +1857,7 @@ void DIALOG_PAD_PROPERTIES::onGeometryTransform( wxCommandEvent& event ) // Transfert new settings: dlg.Transform(); - displayBasicShapesList(); + displayPrimitivesList(); if( m_canUpdate ) { @@ -1867,9 +1867,9 @@ void DIALOG_PAD_PROPERTIES::onGeometryTransform( wxCommandEvent& event ) } -void DIALOG_PAD_PROPERTIES::onDuplicateShape( wxCommandEvent& event ) +void DIALOG_PAD_PROPERTIES::onDuplicatePrimitive( wxCommandEvent& event ) { - long select = m_listCtrlShapes->GetFirstSelected(); + long select = m_listCtrlPrimitives->GetFirstSelected(); if( select < 0 ) { @@ -1884,13 +1884,13 @@ void DIALOG_PAD_PROPERTIES::onDuplicateShape( wxCommandEvent& event ) std::vector shapeList; shapeList.push_back( &m_primitives[select] ); - while( ( select = m_listCtrlShapes->GetNextSelected( select ) ) >= 0 ) + while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 ) { indexes.push_back( select ); shapeList.push_back( &m_primitives[select] ); } - DIALOG_PAD_BASICSHAPES_TRANSFORM dlg( this, shapeList, true ); + DIALOG_PAD_PRIMITIVES_TRANSFORM dlg( this, shapeList, true ); if( dlg.ShowModal() != wxID_OK ) return; @@ -1898,7 +1898,7 @@ void DIALOG_PAD_PROPERTIES::onDuplicateShape( wxCommandEvent& event ) // Transfert new settings: dlg.Transform( &m_primitives, dlg.GetDuplicateCount() ); - displayBasicShapesList(); + displayPrimitivesList(); if( m_canUpdate ) { diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index afe45116a7..71ba2a8194 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -93,10 +93,10 @@ private: private: void prepareCanvas(); // Initialize the canvases (legacy or gal) to display the pad void initValues(); - void displayBasicShapesList(); + void displayPrimitivesList(); bool padValuesOK(); ///< test if all values are acceptable for the pad void redraw(); - void editBasicShape(); + void editPrimitive(); void updateRoundRectCornerValues(); /** @@ -136,15 +136,15 @@ private: bool TransferDataToWindow() override; /// Event handlers of basic shapes list panel - void onDeleteShape( wxCommandEvent& event ) override; - void onEditShape( wxCommandEvent& event ) override; - void onAddShape( wxCommandEvent& event ) override; - void onImportShape( wxCommandEvent& event ) override; + void onDeletePrimitive( wxCommandEvent& event ) override; + void onEditPrimitive( wxCommandEvent& event ) override; + void onAddPrimitive( wxCommandEvent& event ) override; + void onImportPrimitives( wxCommandEvent& event ) override; void onGeometryTransform( wxCommandEvent& event ) override; - void onDuplicateShape( wxCommandEvent& event ) override; + void onDuplicatePrimitive( wxCommandEvent& event ) override; /// Called on a double click on the basic shapes list - void onCustomShapeDClick( wxMouseEvent& event ) override; + void onPrimitiveDClick( wxMouseEvent& event ) override; /// Called on selection/deselection of a basic shape void OnPrimitiveSelection( wxListEvent& event ) override; }; @@ -153,10 +153,10 @@ private: * a dialog to edit basics shapes parameters. * Polygonal shape is not handles by this dialog */ -class DIALOG_PAD_BASICSHAPES_PROPERTIES: public DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE +class DIALOG_PAD_PRIMITIVES_PROPERTIES: public DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE { public: - DIALOG_PAD_BASICSHAPES_PROPERTIES( wxWindow* aParent, PAD_CS_PRIMITIVE * aShape ); + DIALOG_PAD_PRIMITIVES_PROPERTIES( wxWindow* aParent, PAD_CS_PRIMITIVE * aShape ); /** * Function TransferDataFromWindow @@ -179,7 +179,7 @@ private: /** * a dialog to edit basic polygonal shape parameters */ -class DIALOG_PAD_BASIC_SHP_POLY_PROPS: public DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE +class DIALOG_PAD_PRIMITIVE_POLY_PROPS: public DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE { // The basic shape currently edited PAD_CS_PRIMITIVE * m_shape; @@ -188,8 +188,8 @@ class DIALOG_PAD_BASIC_SHP_POLY_PROPS: public DIALOG_PAD_BASIC_SHP_POLY_PROPS_BA PAD_CS_PRIMITIVE m_currshape; public: - DIALOG_PAD_BASIC_SHP_POLY_PROPS( wxWindow* aParent, PAD_CS_PRIMITIVE * aShape ); - ~DIALOG_PAD_BASIC_SHP_POLY_PROPS(); + DIALOG_PAD_PRIMITIVE_POLY_PROPS( wxWindow* aParent, PAD_CS_PRIMITIVE * aShape ); + ~DIALOG_PAD_PRIMITIVE_POLY_PROPS(); /** * Function TransferDataFromWindow @@ -231,10 +231,10 @@ private: * if aShowDuplicate == false, the parameter "Duplicate count" is disabled */ -class DIALOG_PAD_BASICSHAPES_TRANSFORM : public DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE +class DIALOG_PAD_PRIMITIVES_TRANSFORM : public DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE { public: - DIALOG_PAD_BASICSHAPES_TRANSFORM( wxWindow* aParent, + DIALOG_PAD_PRIMITIVES_TRANSFORM( wxWindow* aParent, std::vector& aList, bool aShowDuplicate = false ); /** diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index b4fac52213..b14cd1473a 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pad_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 4 2017) +// C++ code generated with wxFormBuilder (version Jul 2 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -66,7 +66,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind wxString m_PadShapeChoices[] = { _("Circular"), _("Oval"), _("Rectangular"), _("Trapezoidal"), _("Rounded Rectangle"), _("Custom Shape with Circular Anchor"), _("Custom Shape with Rectangular Anchor") }; int m_PadShapeNChoices = sizeof( m_PadShapeChoices ) / sizeof( wxString ); m_PadShape = new wxChoice( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PadShapeNChoices, m_PadShapeChoices, 0 ); - m_PadShape->SetSelection( 6 ); + m_PadShape->SetSelection( 0 ); fgSizerPadType->Add( m_PadShape, 0, wxALL|wxEXPAND, 5 ); @@ -562,23 +562,23 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_localSettingsPanel->Layout(); bSizerPanelClearance->Fit( m_localSettingsPanel ); m_notebook->AddPage( m_localSettingsPanel, _("Local Clearance and Settings"), false ); - m_panelCustomShape = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_bSizerPanelShapes = new wxBoxSizer( wxVERTICAL ); + m_panelCustomShapePrimitives = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_bSizerPanelPrimitives = new wxBoxSizer( wxVERTICAL ); - m_staticTextShapesList = new wxStaticText( m_panelCustomShape, wxID_ANY, _("Primitives list"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextShapesList->Wrap( -1 ); - m_staticTextShapesList->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + m_staticTextPrimitivesList = new wxStaticText( m_panelCustomShapePrimitives, wxID_ANY, _("Primitives list"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextPrimitivesList->Wrap( -1 ); + m_staticTextPrimitivesList->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_bSizerPanelShapes->Add( m_staticTextShapesList, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_bSizerPanelPrimitives->Add( m_staticTextPrimitivesList, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_staticTextShapesListWraning = new wxStaticText( m_panelCustomShape, wxID_ANY, _(" Coordinates are relative to anchor pad, orientation 0"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextShapesListWraning->Wrap( -1 ); - m_staticTextShapesListWraning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + m_staticTextPrimitiveListWarning = new wxStaticText( m_panelCustomShapePrimitives, wxID_ANY, _(" Coordinates are relative to anchor pad, orientation 0"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextPrimitiveListWarning->Wrap( -1 ); + m_staticTextPrimitiveListWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - m_bSizerPanelShapes->Add( m_staticTextShapesListWraning, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_bSizerPanelPrimitives->Add( m_staticTextPrimitiveListWarning, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_listCtrlShapes = new wxListView( m_panelCustomShape, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_NO_HEADER|wxLC_REPORT ); - m_bSizerPanelShapes->Add( m_listCtrlShapes, 1, wxALL|wxEXPAND, 5 ); + m_listCtrlPrimitives = new wxListView( m_panelCustomShapePrimitives, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_NO_HEADER|wxLC_REPORT ); + m_bSizerPanelPrimitives->Add( m_listCtrlPrimitives, 1, wxALL|wxEXPAND, 5 ); wxBoxSizer* bSizerButtons; bSizerButtons = new wxBoxSizer( wxVERTICAL ); @@ -586,16 +586,16 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind wxBoxSizer* bSizerButtonsUpper; bSizerButtonsUpper = new wxBoxSizer( wxHORIZONTAL ); - m_buttonDel = new wxButton( m_panelCustomShape, wxID_ANY, _("Delete Shape"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonDel = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Delete Primitive"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtonsUpper->Add( m_buttonDel, 0, wxALL, 5 ); - m_buttonEditShape = new wxButton( m_panelCustomShape, wxID_ANY, _("Edit Shape"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonEditShape = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Edit Primitive"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtonsUpper->Add( m_buttonEditShape, 0, wxALL, 5 ); - m_buttonAddShape = new wxButton( m_panelCustomShape, wxID_ANY, _("Add Shape"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonAddShape = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Add Primitive"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtonsUpper->Add( m_buttonAddShape, 0, wxALL, 5 ); - m_buttonDup = new wxButton( m_panelCustomShape, wxID_ANY, _("Duplicate Shape"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonDup = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Duplicate Primitive"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtonsUpper->Add( m_buttonDup, 0, wxALL, 5 ); @@ -604,23 +604,23 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind wxBoxSizer* bSizerButtonsLower; bSizerButtonsLower = new wxBoxSizer( wxHORIZONTAL ); - m_buttonGeometry = new wxButton( m_panelCustomShape, wxID_ANY, _("Geometry Transform"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonGeometry = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Geometry Transform"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtonsLower->Add( m_buttonGeometry, 0, wxALL, 5 ); - m_buttonImport = new wxButton( m_panelCustomShape, wxID_ANY, _("Import Shapes"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonImport = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Import Primitives"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtonsLower->Add( m_buttonImport, 0, wxALL, 5 ); bSizerButtons->Add( bSizerButtonsLower, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bSizerPanelShapes->Add( bSizerButtons, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + m_bSizerPanelPrimitives->Add( bSizerButtons, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - m_panelCustomShape->SetSizer( m_bSizerPanelShapes ); - m_panelCustomShape->Layout(); - m_bSizerPanelShapes->Fit( m_panelCustomShape ); - m_notebook->AddPage( m_panelCustomShape, _("Custom Shape"), false ); + m_panelCustomShapePrimitives->SetSizer( m_bSizerPanelPrimitives ); + m_panelCustomShapePrimitives->Layout(); + m_bSizerPanelPrimitives->Fit( m_panelCustomShapePrimitives ); + m_notebook->AddPage( m_panelCustomShapePrimitives, _("Custom Shape Primitives"), false ); bSizerUpper->Add( m_notebook, 0, wxALL|wxEXPAND, 5 ); @@ -694,15 +694,15 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_PadLayerECO1->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerECO2->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_NetClearanceValueCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); - m_listCtrlShapes->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCustomShapeDClick ), NULL, this ); - m_listCtrlShapes->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); - m_listCtrlShapes->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); - m_buttonDel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDeleteShape ), NULL, this ); - m_buttonEditShape->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onEditShape ), NULL, this ); - m_buttonAddShape->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onAddShape ), NULL, this ); - m_buttonDup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDuplicateShape ), NULL, this ); + m_listCtrlPrimitives->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_PAD_PROPERTIES_BASE::onPrimitiveDClick ), NULL, this ); + m_listCtrlPrimitives->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); + m_listCtrlPrimitives->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); + m_buttonDel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDeletePrimitive ), NULL, this ); + m_buttonEditShape->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onEditPrimitive ), NULL, this ); + m_buttonAddShape->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onAddPrimitive ), NULL, this ); + m_buttonDup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDuplicatePrimitive ), NULL, this ); m_buttonGeometry->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onGeometryTransform ), NULL, this ); - m_buttonImport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onImportShape ), NULL, this ); + m_buttonImport->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onImportPrimitives ), NULL, this ); m_panelShowPad->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPaintShowPanel ), NULL, this ); } @@ -739,20 +739,20 @@ DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE() m_PadLayerECO1->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerECO2->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_NetClearanceValueCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); - m_listCtrlShapes->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_PAD_PROPERTIES_BASE::onCustomShapeDClick ), NULL, this ); - m_listCtrlShapes->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); - m_listCtrlShapes->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); - m_buttonDel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDeleteShape ), NULL, this ); - m_buttonEditShape->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onEditShape ), NULL, this ); - m_buttonAddShape->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onAddShape ), NULL, this ); - m_buttonDup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDuplicateShape ), NULL, this ); + m_listCtrlPrimitives->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_PAD_PROPERTIES_BASE::onPrimitiveDClick ), NULL, this ); + m_listCtrlPrimitives->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); + m_listCtrlPrimitives->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this ); + m_buttonDel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDeletePrimitive ), NULL, this ); + m_buttonEditShape->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onEditPrimitive ), NULL, this ); + m_buttonAddShape->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onAddPrimitive ), NULL, this ); + m_buttonDup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDuplicatePrimitive ), NULL, this ); m_buttonGeometry->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onGeometryTransform ), NULL, this ); - m_buttonImport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onImportShape ), NULL, this ); + m_buttonImport->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onImportPrimitives ), NULL, this ); m_panelShowPad->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPaintShowPanel ), NULL, this ); } -DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE::DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE::DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); @@ -878,11 +878,11 @@ DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE::DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE( this->Centre( wxBOTH ); } -DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE::~DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE() +DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE::~DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE() { } -DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE::DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE::DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); @@ -998,22 +998,22 @@ DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE::DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE( wx this->Centre( wxBOTH ); } -DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE::~DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE() +DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE::~DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE() { } -DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxVERTICAL ); - m_staticTextShapesListWarning = new wxStaticText( this, wxID_ANY, _(" Coordinates are relative to anchor pad, orientation 0"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextShapesListWarning->Wrap( -1 ); - m_staticTextShapesListWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + m_staticTextCornerListWarning = new wxStaticText( this, wxID_ANY, _(" Coordinates are relative to anchor pad, orientation 0"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCornerListWarning->Wrap( -1 ); + m_staticTextCornerListWarning->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - bSizerMain->Add( m_staticTextShapesListWarning, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizerMain->Add( m_staticTextCornerListWarning, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_staticTextValidate = new wxStaticText( this, wxID_ANY, _("Incorrect polygon"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextValidate->Wrap( -1 ); @@ -1132,22 +1132,22 @@ DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE( wxWi this->Centre( wxBOTH ); // Connect Events - m_gridCornersList->Connect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onGridSelect ), NULL, this ); - m_gridCornersList->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onCellSelect ), NULL, this ); - m_buttonAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onButtonAdd ), NULL, this ); - m_buttonDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::OnButtonDelete ), NULL, this ); - m_panelPoly->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onPaintPolyPanel ), NULL, this ); - m_panelPoly->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onPolyPanelResize ), NULL, this ); + m_gridCornersList->Connect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onGridSelect ), NULL, this ); + m_gridCornersList->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onCellSelect ), NULL, this ); + m_buttonAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onButtonAdd ), NULL, this ); + m_buttonDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::OnButtonDelete ), NULL, this ); + m_panelPoly->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onPaintPolyPanel ), NULL, this ); + m_panelPoly->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onPolyPanelResize ), NULL, this ); } -DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::~DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE() +DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::~DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE() { // Disconnect Events - m_gridCornersList->Disconnect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onGridSelect ), NULL, this ); - m_gridCornersList->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onCellSelect ), NULL, this ); - m_buttonAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onButtonAdd ), NULL, this ); - m_buttonDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::OnButtonDelete ), NULL, this ); - m_panelPoly->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onPaintPolyPanel ), NULL, this ); - m_panelPoly->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE::onPolyPanelResize ), NULL, this ); + m_gridCornersList->Disconnect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onGridSelect ), NULL, this ); + m_gridCornersList->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onCellSelect ), NULL, this ); + m_buttonAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onButtonAdd ), NULL, this ); + m_buttonDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::OnButtonDelete ), NULL, this ); + m_panelPoly->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onPaintPolyPanel ), NULL, this ); + m_panelPoly->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onPolyPanelResize ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 20ad0e4bd0..5a29b374df 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -942,7 +942,7 @@ 1 Resizable - 6 + 0 1 @@ -9183,7 +9183,7 @@ - Custom Shape + Custom Shape Primitives 0 1 @@ -9220,7 +9220,7 @@ 0 1 - m_panelCustomShape + m_panelCustomShapePrimitives 1 @@ -9261,7 +9261,7 @@ - m_bSizerPanelShapes + m_bSizerPanelPrimitives wxVERTICAL protected @@ -9304,7 +9304,7 @@ 0 1 - m_staticTextShapesList + m_staticTextPrimitivesList 1 @@ -9387,7 +9387,7 @@ 0 1 - m_staticTextShapesListWraning + m_staticTextPrimitiveListWarning 1 @@ -9469,7 +9469,7 @@ 0 1 - m_listCtrlShapes + m_listCtrlPrimitives 1 @@ -9497,7 +9497,7 @@ - onCustomShapeDClick + onPrimitiveDClick @@ -9586,7 +9586,7 @@ 0 0 wxID_ANY - Delete Shape + Delete Primitive 0 @@ -9615,7 +9615,7 @@ - onDeleteShape + onDeletePrimitive @@ -9674,7 +9674,7 @@ 0 0 wxID_ANY - Edit Shape + Edit Primitive 0 @@ -9703,7 +9703,7 @@ - onEditShape + onEditPrimitive @@ -9762,7 +9762,7 @@ 0 0 wxID_ANY - Add Shape + Add Primitive 0 @@ -9791,7 +9791,7 @@ - onAddShape + onAddPrimitive @@ -9850,7 +9850,7 @@ 0 0 wxID_ANY - Duplicate Shape + Duplicate Primitive 0 @@ -9879,7 +9879,7 @@ - onDuplicateShape + onDuplicatePrimitive @@ -10037,7 +10037,7 @@ 0 0 wxID_ANY - Import Shapes + Import Primitives 0 @@ -10066,7 +10066,7 @@ - onImportShape + onImportPrimitives @@ -10406,7 +10406,7 @@ wxID_ANY - DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE + DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE 561,243 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER @@ -12285,7 +12285,7 @@ wxID_ANY - DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE + DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE 472,208 wxDEFAULT_DIALOG_STYLE @@ -13705,7 +13705,7 @@ wxID_ANY - DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE + DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE 503,396 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER @@ -13796,7 +13796,7 @@ 0 1 - m_staticTextShapesListWarning + m_staticTextCornerListWarning 1 diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index 74ff344786..f86e4fad4d 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_pad_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 4 2017) +// C++ code generated with wxFormBuilder (version Jul 2 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -161,11 +161,11 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_staticTextcps; wxChoice* m_ZoneCustomPadShape; wxStaticText* m_staticTextWarning; - wxPanel* m_panelCustomShape; - wxBoxSizer* m_bSizerPanelShapes; - wxStaticText* m_staticTextShapesList; - wxStaticText* m_staticTextShapesListWraning; - wxListView* m_listCtrlShapes; + wxPanel* m_panelCustomShapePrimitives; + wxBoxSizer* m_bSizerPanelPrimitives; + wxStaticText* m_staticTextPrimitivesList; + wxStaticText* m_staticTextPrimitiveListWarning; + wxListView* m_listCtrlPrimitives; wxButton* m_buttonDel; wxButton* m_buttonEditShape; wxButton* m_buttonAddShape; @@ -189,14 +189,14 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM virtual void OnSetLayers( wxCommandEvent& event ) { event.Skip(); } virtual void onCornerSizePercentChange( wxCommandEvent& event ) { event.Skip(); } virtual void OnDrillShapeSelected( wxCommandEvent& event ) { event.Skip(); } - virtual void onCustomShapeDClick( wxMouseEvent& event ) { event.Skip(); } + virtual void onPrimitiveDClick( wxMouseEvent& event ) { event.Skip(); } virtual void OnPrimitiveSelection( wxListEvent& event ) { event.Skip(); } - virtual void onDeleteShape( wxCommandEvent& event ) { event.Skip(); } - virtual void onEditShape( wxCommandEvent& event ) { event.Skip(); } - virtual void onAddShape( wxCommandEvent& event ) { event.Skip(); } - virtual void onDuplicateShape( wxCommandEvent& event ) { event.Skip(); } + virtual void onDeletePrimitive( wxCommandEvent& event ) { event.Skip(); } + virtual void onEditPrimitive( wxCommandEvent& event ) { event.Skip(); } + virtual void onAddPrimitive( wxCommandEvent& event ) { event.Skip(); } + virtual void onDuplicatePrimitive( wxCommandEvent& event ) { event.Skip(); } virtual void onGeometryTransform( wxCommandEvent& event ) { event.Skip(); } - virtual void onImportShape( wxCommandEvent& event ) { event.Skip(); } + virtual void onImportPrimitives( wxCommandEvent& event ) { event.Skip(); } virtual void OnPaintShowPanel( wxPaintEvent& event ) { event.Skip(); } @@ -208,9 +208,9 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM }; /////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE +/// Class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE : public DIALOG_SHIM +class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE : public DIALOG_SHIM { private: @@ -241,15 +241,15 @@ class DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE : public DIALOG_SHIM public: - DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 561,243 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_PAD_BASICSHAPES_PROPERTIES_BASE(); + DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 561,243 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE(); }; /////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE +/// Class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE : public DIALOG_SHIM +class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE : public DIALOG_SHIM { private: @@ -274,20 +274,20 @@ class DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE : public DIALOG_SHIM public: - DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad Custom Shape Geometry Transform"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 472,208 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~DIALOG_PAD_BASICSHAPES_TRANSFORM_BASE(); + DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad Custom Shape Geometry Transform"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 472,208 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE(); }; /////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE +/// Class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE : public DIALOG_SHIM +class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE : public DIALOG_SHIM { private: protected: - wxStaticText* m_staticTextShapesListWarning; + wxStaticText* m_staticTextCornerListWarning; wxStaticText* m_staticTextValidate; wxGrid* m_gridCornersList; wxButton* m_buttonAdd; @@ -313,8 +313,8 @@ class DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE : public DIALOG_SHIM public: - DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Basic Shape Polygon"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 503,396 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_PAD_BASIC_SHP_POLY_PROPS_BASE(); + DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Basic Shape Polygon"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 503,396 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE(); }; diff --git a/pcbnew/drc_clearance_test_functions.cpp b/pcbnew/drc_clearance_test_functions.cpp index 3e8e4960d8..d0756e177c 100644 --- a/pcbnew/drc_clearance_test_functions.cpp +++ b/pcbnew/drc_clearance_test_functions.cpp @@ -708,7 +708,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad ) // The reference pad can be rotated. calculate the rotated // coordiantes ( note, the ref pad position is the origin of // coordinates for this drc test) - aRefPad->BasicShapesAsPolygonToBoardPosition( &polysetref, + aRefPad->CustomShapeAsPolygonToBoardPosition( &polysetref, wxPoint( 0, 0 ), aRefPad->GetOrientation() ); } else @@ -738,7 +738,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad ) // The pad to compare can be rotated. calculate the rotated // coordinattes ( note, the pad to compare position // is the relativePadPos for this drc test - aPad->BasicShapesAsPolygonToBoardPosition( &polysetcompare, + aPad->CustomShapeAsPolygonToBoardPosition( &polysetcompare, relativePadPos, aPad->GetOrientation() ); } else @@ -1079,7 +1079,7 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi // relatives to the segment being tested // Note, the pad position relative to the segment origin // is m_padToTestPos - aPad->BasicShapesAsPolygonToBoardPosition( &polyset, + aPad->CustomShapeAsPolygonToBoardPosition( &polyset, m_padToTestPos, orient ); // Rotate all coordinates by m_segmAngle, because the segment orient @@ -1088,7 +1088,7 @@ bool DRC::checkClearanceSegmToPad( const D_PAD* aPad, int aSegmentWidth, int aMi // only the lenght and orientation+ of the segment // therefore all coordinates of the pad to test must be rotated by // m_segmAngle (they are already relative to the segment origin) - aPad->BasicShapesAsPolygonToBoardPosition( &polyset, + aPad->CustomShapeAsPolygonToBoardPosition( &polyset, wxPoint( 0, 0 ), m_segmAngle ); const SHAPE_LINE_CHAIN& refpoly = polyset.COutline( 0 ); diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index e3bb0575a8..20a98664db 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -1376,11 +1376,11 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const int nested_level = aNestLevel+2; // Output all basic shapes - for( unsigned icnt = 0; icnt < aPad->GetBasicShapes().size(); ++icnt ) + for( unsigned icnt = 0; icnt < aPad->GetPrimitives().size(); ++icnt ) { m_out->Print( 0, "\n"); - const PAD_CS_PRIMITIVE& primitive = aPad->GetBasicShapes()[icnt]; + const PAD_CS_PRIMITIVE& primitive = aPad->GetPrimitives()[icnt]; switch( primitive.m_Shape ) { diff --git a/pcbnew/microwave.cpp b/pcbnew/microwave.cpp index b857164b5a..ed5c1faee2 100644 --- a/pcbnew/microwave.cpp +++ b/pcbnew/microwave.cpp @@ -364,7 +364,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type ) // Close the polygon: polyPoints.push_back( polyPoints[0] ); - pad->AddBasicShape( polyPoints, 0 ); // add a polygonal basic shape + pad->AddPrimitive( polyPoints, 0 ); // add a polygonal basic shape } break; diff --git a/pcbnew/pad_edition_functions.cpp b/pcbnew/pad_edition_functions.cpp index c89c875897..137495ae68 100644 --- a/pcbnew/pad_edition_functions.cpp +++ b/pcbnew/pad_edition_functions.cpp @@ -73,9 +73,9 @@ void PCB_BASE_FRAME::Import_Pad_Settings( D_PAD* aPad, bool aDraw ) aPad->ImportSettingsFromMaster( mp ); - aPad->SetBasicShapes( mp.GetBasicShapes() ); + aPad->SetPrimitives( mp.GetPrimitives() ); aPad->SetAnchorPadShape( mp.GetAnchorPadShape() ); - aPad->MergeBasicShapesAsPolygon(); + aPad->MergePrimitivesAsPolygon(); if( aDraw ) m_canvas->RefreshDrawingRect( aPad->GetBoundingBox() ); diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index 206ab71d82..266198290d 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -2504,25 +2504,25 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent ) { case T_gr_arc: dummysegm = parseDRAWSEGMENT(); - pad->AddBasicShape( dummysegm->GetCenter(), dummysegm->GetArcStart(), + pad->AddPrimitive( dummysegm->GetCenter(), dummysegm->GetArcStart(), dummysegm->GetAngle(), dummysegm->GetWidth() ); break; case T_gr_line: dummysegm = parseDRAWSEGMENT(); - pad->AddBasicShape( dummysegm->GetStart(), dummysegm->GetEnd(), + pad->AddPrimitive( dummysegm->GetStart(), dummysegm->GetEnd(), dummysegm->GetWidth() ); break; case T_gr_circle: dummysegm = parseDRAWSEGMENT(); - pad->AddBasicShape( dummysegm->GetCenter(), dummysegm->GetRadius(), + pad->AddPrimitive( dummysegm->GetCenter(), dummysegm->GetRadius(), dummysegm->GetWidth() ); break; case T_gr_poly: dummysegm = parseDRAWSEGMENT(); - pad->AddBasicShape( dummysegm->GetPolyPoints(), dummysegm->GetWidth() ); + pad->AddPrimitive( dummysegm->GetPolyPoints(), dummysegm->GetWidth() ); break; default: @@ -2543,7 +2543,7 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent ) // Be sure the custom shape polygon is built: if( pad->GetShape() == PAD_SHAPE_CUSTOM ) - pad->MergeBasicShapesAsPolygon(); + pad->MergePrimitivesAsPolygon(); return pad.release(); } diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 9f1f4557fb..a4b73b15f6 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -185,12 +185,12 @@ void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPl case PAD_SHAPE_CUSTOM: { SHAPE_POLY_SET polygons; - aPad->MergeBasicShapesAsPolygon(&polygons, 64 ); + aPad->MergePrimitivesAsPolygon(&polygons, 64 ); if( polygons.OutlineCount() == 0 ) break; - aPad->BasicShapesAsPolygonToBoardPosition( &polygons, shape_pos, aPad->GetOrientation() ); + aPad->CustomShapeAsPolygonToBoardPosition( &polygons, shape_pos, aPad->GetOrientation() ); m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), &polygons, aPlotMode, &gbr_metadata ); } break; diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 5115d89b0d..e0be212190 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -630,7 +630,7 @@ std::unique_ptr PNS_KICAD_IFACE::syncPad( D_PAD* aPad ) { SHAPE_POLY_SET outline; outline.Append( aPad->GetCustomShapeAsPolygon() ); - aPad->BasicShapesAsPolygonToBoardPosition( &outline, wx_c, aPad->GetOrientation() ); + aPad->CustomShapeAsPolygonToBoardPosition( &outline, wx_c, aPad->GetOrientation() ); for( int jj = 0; jj < outline.OutlineCount(); ++jj ) { @@ -746,7 +746,7 @@ std::unique_ptr PNS_KICAD_IFACE::syncPad( D_PAD* aPad ) { SHAPE_POLY_SET outline; outline.Append( aPad->GetCustomShapeAsPolygon() ); - aPad->BasicShapesAsPolygonToBoardPosition( &outline, wx_c, aPad->GetOrientation() ); + aPad->CustomShapeAsPolygonToBoardPosition( &outline, wx_c, aPad->GetOrientation() ); for( int jj = 0; jj < outline.OutlineCount(); ++jj ) { diff --git a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp index d78c1562d7..91ee93bb57 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp @@ -204,7 +204,7 @@ void ZONE_CONTAINER::buildFeatureHoleList( BOARD* aPcb, SHAPE_POLY_SET& aFeature // the shape itself SHAPE_POLY_SET outline( pad->GetCustomShapeAsPolygon() ); outline.Inflate( KiROUND( clearance*correctionFactor) , segsPerCircle ); - pad->BasicShapesAsPolygonToBoardPosition( &outline, + pad->CustomShapeAsPolygonToBoardPosition( &outline, pad->GetPosition(), pad->GetOrientation() ); if( pad->GetCustomShapeInZoneOpt() == CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL ) @@ -252,7 +252,7 @@ void ZONE_CONTAINER::buildFeatureHoleList( BOARD* aPcb, SHAPE_POLY_SET& aFeature // the shape itself SHAPE_POLY_SET outline( pad->GetCustomShapeAsPolygon() ); outline.Inflate( KiROUND( gap*correctionFactor) , segsPerCircle ); - pad->BasicShapesAsPolygonToBoardPosition( &outline, + pad->CustomShapeAsPolygonToBoardPosition( &outline, pad->GetPosition(), pad->GetOrientation() ); std::vector convex_hull;