diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index 6cd84cd1e2..7281977fbb 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -646,7 +646,7 @@ void BOARD_ADAPTER::addShape( const PCB_SHAPE* aShape, CONTAINER_2D_BASE* aConta break; } - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( aShape->IsFilled() ) { SHAPE_POLY_SET polyList; diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index 1720c7e506..47eb3c126e 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -62,7 +62,7 @@ wxString EDA_SHAPE::ShowShape() const switch( m_shape ) { case SHAPE_T::SEGMENT: return _( "Line" ); - case SHAPE_T::RECT: return _( "Rect" ); + case SHAPE_T::RECTANGLE: return _( "Rect" ); case SHAPE_T::ARC: return _( "Arc" ); case SHAPE_T::CIRCLE: return _( "Circle" ); case SHAPE_T::BEZIER: return _( "Bezier Curve" ); @@ -76,14 +76,14 @@ wxString EDA_SHAPE::SHAPE_T_asString() const { switch( m_shape ) { - case SHAPE_T::SEGMENT: return wxS( "S_SEGMENT" ); - case SHAPE_T::RECT: return wxS( "S_RECT" ); - case SHAPE_T::ARC: return wxS( "S_ARC" ); - case SHAPE_T::CIRCLE: return wxS( "S_CIRCLE" ); - case SHAPE_T::POLY: return wxS( "S_POLYGON" ); - case SHAPE_T::BEZIER: return wxS( "S_CURVE" ); - case SHAPE_T::LAST: return wxS( "!S_LAST!" ); // Synthetic value, but if we come across it then - // we're going to want to know. + case SHAPE_T::SEGMENT: return wxS( "S_SEGMENT" ); + case SHAPE_T::RECTANGLE: return wxS( "S_RECT" ); + case SHAPE_T::ARC: return wxS( "S_ARC" ); + case SHAPE_T::CIRCLE: return wxS( "S_CIRCLE" ); + case SHAPE_T::POLY: return wxS( "S_POLYGON" ); + case SHAPE_T::BEZIER: return wxS( "S_CURVE" ); + // Synthetic value, but if we come across it then we're going to want to know. + case SHAPE_T::LAST: return wxS( "!S_LAST!" ); } return wxEmptyString; // Just to quiet GCC. @@ -143,7 +143,7 @@ bool EDA_SHAPE::IsClosed() const switch( m_shape ) { case SHAPE_T::CIRCLE: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: return true; case SHAPE_T::ARC: @@ -176,7 +176,7 @@ void EDA_SHAPE::move( const VECTOR2I& aMoveVector ) { case SHAPE_T::ARC: case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: m_start += aMoveVector; m_end += aMoveVector; @@ -217,7 +217,7 @@ void EDA_SHAPE::scale( double aScale ) { case SHAPE_T::ARC: case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: scalePt( m_start ); scalePt( m_end ); scalePt( m_arcCenter ); @@ -276,7 +276,7 @@ void EDA_SHAPE::rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) RotatePoint( m_arcCenter, aRotCentre, aAngle ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( aAngle.IsCardinal() ) { RotatePoint( m_start, aRotCentre, aAngle ); @@ -322,7 +322,7 @@ void EDA_SHAPE::flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) switch ( m_shape ) { case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( aFlipLeftRight ) { m_start.x = aCentre.x - ( m_start.x - aCentre.x ); @@ -456,7 +456,7 @@ VECTOR2I EDA_SHAPE::getCenter() const return ( m_start + m_end ) / 2; case SHAPE_T::POLY: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::BEZIER: return getBoundingBox().Centre(); @@ -616,7 +616,7 @@ wxString EDA_SHAPE::GetFriendlyName() const case SHAPE_T::ARC: return _( "Arc" ); case SHAPE_T::BEZIER: return _( "Curve" ); case SHAPE_T::POLY: return _( "Polygon" ); - case SHAPE_T::RECT: return IsAnnotationProxy() ? _( "Pad Number Box" ) : _( "Rectangle" ); + case SHAPE_T::RECTANGLE: return IsAnnotationProxy() ? _( "Pad Number Box" ) : _( "Rectangle" ); case SHAPE_T::SEGMENT: return _( "Segment" ); default: return _( "Unrecognized" ); } @@ -653,7 +653,7 @@ void EDA_SHAPE::ShapeGetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorMessageTextFromValue( std::abs( GetEnd().x - GetStart().x ) ) ); @@ -687,7 +687,7 @@ const BOX2I EDA_SHAPE::getBoundingBox() const switch( m_shape ) { - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: for( VECTOR2I& pt : GetRectCorners() ) bbox.Merge( pt ); @@ -815,7 +815,7 @@ bool EDA_SHAPE::hitTest( const VECTOR2I& aPosition, int aAccuracy ) const case SHAPE_T::SEGMENT: return TestSegmentHit( aPosition, GetStart(), GetEnd(), maxdist ); - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( IsAnnotationProxy() || IsFilled() ) // Filled rect hit-test { SHAPE_POLY_SET poly; @@ -898,7 +898,7 @@ bool EDA_SHAPE::hitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) co } } - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( aContained ) { return arect.Contains( bbox ); @@ -1107,7 +1107,7 @@ std::vector EDA_SHAPE::makeEffectiveShapes( bool aEdgeOnly, bool aLineCh effectiveShapes.emplace_back( new SHAPE_SEGMENT( m_start, m_end, width ) ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { std::vector pts = GetRectCorners(); @@ -1229,7 +1229,7 @@ void EDA_SHAPE::beginEdit( const VECTOR2I& aPosition ) { case SHAPE_T::SEGMENT: case SHAPE_T::CIRCLE: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: SetStart( aPosition ); SetEnd( aPosition ); break; @@ -1261,7 +1261,7 @@ bool EDA_SHAPE::continueEdit( const VECTOR2I& aPosition ) case SHAPE_T::ARC: case SHAPE_T::SEGMENT: case SHAPE_T::CIRCLE: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: return false; case SHAPE_T::POLY: @@ -1289,7 +1289,7 @@ void EDA_SHAPE::calcEdit( const VECTOR2I& aPosition ) { case SHAPE_T::SEGMENT: case SHAPE_T::CIRCLE: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: SetEnd( aPosition ); break; @@ -1418,7 +1418,7 @@ void EDA_SHAPE::endEdit( bool aClosed ) case SHAPE_T::ARC: case SHAPE_T::SEGMENT: case SHAPE_T::CIRCLE: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: break; case SHAPE_T::POLY: @@ -1528,7 +1528,7 @@ void EDA_SHAPE::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, int aClearance break; } - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { std::vector pts = GetRectCorners(); @@ -1624,12 +1624,12 @@ static struct EDA_SHAPE_DESC EDA_SHAPE_DESC() { ENUM_MAP::Instance() - .Map( SHAPE_T::SEGMENT, _HKI( "Segment" ) ) - .Map( SHAPE_T::RECT, _HKI( "Rectangle" ) ) - .Map( SHAPE_T::ARC, _HKI( "Arc" ) ) - .Map( SHAPE_T::CIRCLE, _HKI( "Circle" ) ) - .Map( SHAPE_T::POLY, _HKI( "Polygon" ) ) - .Map( SHAPE_T::BEZIER, _HKI( "Bezier" ) ); + .Map( SHAPE_T::SEGMENT, _HKI( "Segment" ) ) + .Map( SHAPE_T::RECTANGLE, _HKI( "Rectangle" ) ) + .Map( SHAPE_T::ARC, _HKI( "Arc" ) ) + .Map( SHAPE_T::CIRCLE, _HKI( "Circle" ) ) + .Map( SHAPE_T::POLY, _HKI( "Polygon" ) ) + .Map( SHAPE_T::BEZIER, _HKI( "Bezier" ) ); auto& plotDashTypeEnum = ENUM_MAP::Instance(); @@ -1709,7 +1709,7 @@ static struct EDA_SHAPE_DESC switch( itemShape ) { case SHAPE_T::POLY: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: return true; diff --git a/eeschema/lib_shape.cpp b/eeschema/lib_shape.cpp index 7fe13214cb..5ea53b39a9 100644 --- a/eeschema/lib_shape.cpp +++ b/eeschema/lib_shape.cpp @@ -92,7 +92,7 @@ void LIB_SHAPE::MoveTo( const VECTOR2I& aPosition ) void LIB_SHAPE::Normalize() { - if( GetShape() == SHAPE_T::RECT ) + if( GetShape() == SHAPE_T::RECTANGLE ) { VECTOR2I size = GetEnd() - GetPosition(); @@ -249,7 +249,7 @@ void LIB_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOffs aPlotter->Circle( center, GetRadius() * 2, fill, penWidth ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: aPlotter->Rect( start, end, fill, penWidth ); break; @@ -373,7 +373,7 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset GRFilledCircle( DC, pt1, GetRadius(), 0, fillColor, fillColor ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: GRFilledRect( DC, pt1, pt2, 0, fillColor, fillColor ); break; @@ -408,7 +408,7 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset GRCircle( DC, pt1, GetRadius(), penWidth, color ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: GRRect( DC, pt1, pt2, penWidth, color ); break; @@ -478,7 +478,7 @@ wxString LIB_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const return wxString::Format( _( "Circle with radius %s" ), aUnitsProvider->MessageTextFromValue( GetRadius() ) ); - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: return wxString::Format( _( "Rectangle with width %s height %s" ), aUnitsProvider->MessageTextFromValue( std::abs( m_start.x - m_end.x ) ), aUnitsProvider->MessageTextFromValue( std::abs( m_start.y - m_end.y ) ) ); @@ -505,7 +505,7 @@ BITMAPS LIB_SHAPE::GetMenuImage() const case SHAPE_T::SEGMENT: return BITMAPS::add_line; case SHAPE_T::ARC: return BITMAPS::add_arc; case SHAPE_T::CIRCLE: return BITMAPS::add_circle; - case SHAPE_T::RECT: return BITMAPS::add_rectangle; + case SHAPE_T::RECTANGLE: return BITMAPS::add_rectangle; case SHAPE_T::POLY: return BITMAPS::add_graphical_segments; default: diff --git a/eeschema/lib_textbox.cpp b/eeschema/lib_textbox.cpp index deb6143be7..e62bb0de34 100644 --- a/eeschema/lib_textbox.cpp +++ b/eeschema/lib_textbox.cpp @@ -44,7 +44,7 @@ using KIGFX::SCH_RENDER_SETTINGS; LIB_TEXTBOX::LIB_TEXTBOX( LIB_SYMBOL* aParent, int aLineWidth, FILL_T aFillType, const wxString& text ) : - LIB_SHAPE( aParent, SHAPE_T::RECT, aLineWidth, aFillType, LIB_TEXTBOX_T ), + LIB_SHAPE( aParent, SHAPE_T::RECTANGLE, aLineWidth, aFillType, LIB_TEXTBOX_T ), EDA_TEXT( schIUScale, text ) { SetTextSize( VECTOR2I( schIUScale.MilsToIU( DEFAULT_TEXT_SIZE ), diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 790ffdf54a..1518205d48 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -167,7 +167,7 @@ static LIB_SYMBOL* dummy() { symbol = new LIB_SYMBOL( wxEmptyString ); - LIB_SHAPE* square = new LIB_SHAPE( symbol, SHAPE_T::RECT ); + LIB_SHAPE* square = new LIB_SHAPE( symbol, SHAPE_T::RECTANGLE ); square->MoveTo( VECTOR2I( schIUScale.MilsToIU( -200 ), schIUScale.MilsToIU( 200 ) ) ); square->SetEnd( VECTOR2I( schIUScale.MilsToIU( 200 ), schIUScale.MilsToIU( -200 ) ) ); @@ -905,7 +905,7 @@ void SCH_PAINTER::draw( const LIB_SHAPE* aShape, int aLayer, bool aDimmed ) m_gal->DrawCircle( mapCoords( shape->GetPosition() ), shape->GetRadius() ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: m_gal->DrawRectangle( mapCoords( shape->GetPosition() ), mapCoords( shape->GetEnd() ) ); break; @@ -1979,7 +1979,7 @@ void SCH_PAINTER::draw( const SCH_SHAPE* aShape, int aLayer ) m_gal->DrawCircle( shape->GetPosition(), shape->GetRadius() ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: m_gal->DrawRectangle( shape->GetPosition(), shape->GetEnd() ); break; diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index c5ae132231..e6c2e67f67 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -1526,7 +1526,7 @@ void SCH_ALTIUM_PLUGIN::ParseRoundRectangle( const std::map& if( elem.OwnerPartID == ALTIUM_COMPONENT_NONE ) { // TODO: misses rounded edges - SCH_SHAPE* rect = new SCH_SHAPE( SHAPE_T::RECT ); + SCH_SHAPE* rect = new SCH_SHAPE( SHAPE_T::RECTANGLE ); rect->SetPosition( sheetTopRight ); rect->SetEnd( sheetBottomLeft ); @@ -1554,7 +1554,7 @@ void SCH_ALTIUM_PLUGIN::ParseRoundRectangle( const std::map& SCH_SYMBOL* symbol = m_symbols.at( libSymbolIt->first ); // TODO: misses rounded edges - LIB_SHAPE* rect = new LIB_SHAPE( libSymbolIt->second, SHAPE_T::RECT ); + LIB_SHAPE* rect = new LIB_SHAPE( libSymbolIt->second, SHAPE_T::RECTANGLE ); libSymbolIt->second->AddDrawItem( rect ); rect->SetUnit( elem.OwnerPartID ); @@ -1956,7 +1956,7 @@ void SCH_ALTIUM_PLUGIN::ParseRectangle( const std::map& aPro if( elem.OwnerPartID == ALTIUM_COMPONENT_NONE ) { - SCH_SHAPE* rect = new SCH_SHAPE( SHAPE_T::RECT ); + SCH_SHAPE* rect = new SCH_SHAPE( SHAPE_T::RECTANGLE ); rect->SetPosition( sheetTopRight ); rect->SetEnd( sheetBottomLeft ); @@ -1982,7 +1982,7 @@ void SCH_ALTIUM_PLUGIN::ParseRectangle( const std::map& aPro return; SCH_SYMBOL* symbol = m_symbols.at( libSymbolIt->first ); - LIB_SHAPE* rect = new LIB_SHAPE( libSymbolIt->second, SHAPE_T::RECT ); + LIB_SHAPE* rect = new LIB_SHAPE( libSymbolIt->second, SHAPE_T::RECTANGLE ); libSymbolIt->second->AddDrawItem( rect ); rect->SetUnit( elem.OwnerPartID ); diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index 16ca305e31..ed4e6d8a0a 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -1464,7 +1464,7 @@ SCH_SHAPE* SCH_EAGLE_PLUGIN::loadCircle( wxXmlNode* aCircleNode ) SCH_SHAPE* SCH_EAGLE_PLUGIN::loadRectangle( wxXmlNode* aRectNode ) { - std::unique_ptr rectangle = std::make_unique( SHAPE_T::RECT ); + std::unique_ptr rectangle = std::make_unique( SHAPE_T::RECTANGLE ); ERECT rect( aRectNode ); rectangle->SetLayer( kiCadLayer( rect.layer ) ); @@ -2163,7 +2163,7 @@ LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolRectangle( std::unique_ptr& a wxXmlNode* aRectNode, int aGateNumber ) { ERECT rect( aRectNode ); - LIB_SHAPE* rectangle = new LIB_SHAPE( aSymbol.get(), SHAPE_T::RECT ); + LIB_SHAPE* rectangle = new LIB_SHAPE( aSymbol.get(), SHAPE_T::RECTANGLE ); rectangle->SetPosition( VECTOR2I( rect.x1.ToSchUnits(), rect.y1.ToSchUnits() ) ); rectangle->SetEnd( VECTOR2I( rect.x2.ToSchUnits(), rect.y2.ToSchUnits() ) ); diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_lib_plugin_cache.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_lib_plugin_cache.cpp index 1655224370..0cbd65fa27 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_lib_plugin_cache.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_lib_plugin_cache.cpp @@ -343,7 +343,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem( LIB_ITEM* aItem, OUTPUTFORMATTE formatCircle( &aFormatter, aNestLevel, shape, isPrivate, stroke, fillMode, fillColor ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: formatRect( &aFormatter, aNestLevel, shape, isPrivate, stroke, fillMode, fillColor ); break; diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp index ce9c36eb7f..551f9c383b 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp @@ -1593,7 +1593,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseRectangle() T token; STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); FILL_PARAMS fill; - std::unique_ptr rectangle = std::make_unique( nullptr, SHAPE_T::RECT ); + std::unique_ptr rectangle = std::make_unique( nullptr, SHAPE_T::RECTANGLE ); rectangle->SetUnit( m_unit ); rectangle->SetConvert( m_convert ); @@ -3655,7 +3655,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchRectangle() T token; STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), PLOT_DASH_TYPE::DEFAULT ); FILL_PARAMS fill; - std::unique_ptr rectangle = std::make_unique( SHAPE_T::RECT ); + std::unique_ptr rectangle = std::make_unique( SHAPE_T::RECTANGLE ); for( token = NextTok(); token != T_RIGHT; token = NextTok() ) { diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index 2a9c4b3ef5..243bbf543f 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -1194,7 +1194,7 @@ void SCH_SEXPR_PLUGIN::saveShape( SCH_SHAPE* aShape, int aNestLevel ) aShape->GetFillColor(), aShape->m_Uuid ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: formatRect( m_out, aNestLevel, aShape, false, aShape->GetStroke(), aShape->GetFillMode(), aShape->GetFillColor(), aShape->m_Uuid ); break; diff --git a/eeschema/sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp b/eeschema/sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp index eb435fa236..2e0f547935 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp @@ -967,7 +967,7 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadRect( std::unique_ptr& aSymb wxCHECK_MSG( strCompare( "S", line, &line ), nullptr, "Invalid rectangle definition" ); - LIB_SHAPE* rectangle = new LIB_SHAPE( aSymbol.get(), SHAPE_T::RECT ); + LIB_SHAPE* rectangle = new LIB_SHAPE( aSymbol.get(), SHAPE_T::RECTANGLE ); VECTOR2I pos; @@ -1497,7 +1497,7 @@ void SCH_LEGACY_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& case SHAPE_T::BEZIER: saveBezier( &shape, aFormatter ); break; case SHAPE_T::CIRCLE: saveCircle( &shape, aFormatter ); break; case SHAPE_T::POLY: savePolyLine( &shape, aFormatter ); break; - case SHAPE_T::RECT: saveRectangle( &shape, aFormatter ); break; + case SHAPE_T::RECTANGLE: saveRectangle( &shape, aFormatter ); break; default: break; } } @@ -1708,7 +1708,7 @@ void SCH_LEGACY_PLUGIN_CACHE::savePolyLine( LIB_SHAPE* aPolyLine, OUTPUTFORMATTE void SCH_LEGACY_PLUGIN_CACHE::saveRectangle( LIB_SHAPE* aRectangle, OUTPUTFORMATTER& aFormatter ) { - wxCHECK_RET( aRectangle && aRectangle->GetShape() == SHAPE_T::RECT, "Invalid RECT object." ); + wxCHECK_RET( aRectangle && aRectangle->GetShape() == SHAPE_T::RECTANGLE, "Invalid RECT object." ); aFormatter.Print( 0, "S %d %d %d %d %d %d %d %c\n", schIUScale.IUToMils( aRectangle->GetPosition().x ), diff --git a/eeschema/sch_plugins/ltspice/ltspice_sch_parser.cpp b/eeschema/sch_plugins/ltspice/ltspice_sch_parser.cpp index d7a02b4164..dc160ec4a2 100644 --- a/eeschema/sch_plugins/ltspice/ltspice_sch_parser.cpp +++ b/eeschema/sch_plugins/ltspice/ltspice_sch_parser.cpp @@ -303,7 +303,7 @@ void LTSPICE_SCH_PARSER::CreateSymbol( LTSPICE_SCHEMATIC::LT_SYMBOL& aLtSymbol, for( int j = 0; j < (int) aLtSymbol.Rectangles.size(); j++ ) { - LIB_SHAPE* rectangle = new LIB_SHAPE( aLibSymbol, SHAPE_T::RECT ); + LIB_SHAPE* rectangle = new LIB_SHAPE( aLibSymbol, SHAPE_T::RECTANGLE ); CreateRect( aLtSymbol, j, rectangle ); aLibSymbol->AddDrawItem( rectangle ); @@ -650,7 +650,7 @@ void LTSPICE_SCH_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aI SCH_SHEET_PATH* aSheet ) { LTSPICE_SCHEMATIC::RECTANGLE& lt_rect = aAscfile.Rectangles[aIndex]; - SCH_SHAPE* rectangle = new SCH_SHAPE( SHAPE_T::RECT ); + SCH_SHAPE* rectangle = new SCH_SHAPE( SHAPE_T::RECTANGLE ); rectangle->SetPosition( ToKicadCoords( lt_rect.TopLeft ) ); rectangle->SetEnd( ToKicadCoords( lt_rect.BotRight ) ); @@ -737,7 +737,7 @@ void LTSPICE_SCH_PARSER::setTextJustification( EDA_TEXT* case LTSPICE_SCHEMATIC::JUSTIFICATION::CENTER: case LTSPICE_SCHEMATIC::JUSTIFICATION::RIGHT: case LTSPICE_SCHEMATIC::JUSTIFICATION::BOTTOM: - case LTSPICE_SCHEMATIC::JUSTIFICATION::TOP: + case LTSPICE_SCHEMATIC::JUSTIFICATION::TOP: aText->SetTextAngle( ANGLE_HORIZONTAL ); break; @@ -1187,7 +1187,7 @@ void LTSPICE_SCH_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, in SCH_SHEET_PATH* aSheet ) { LTSPICE_SCHEMATIC::RECTANGLE& lt_rect = aLTSymbol.Rectangles[aIndex]; - SCH_SHAPE* rectangle = new SCH_SHAPE( SHAPE_T::RECT ); + SCH_SHAPE* rectangle = new SCH_SHAPE( SHAPE_T::RECTANGLE ); rectangle->SetPosition( ToInvertedKicadCoords( lt_rect.BotRight ) ); rectangle->SetEnd( ToInvertedKicadCoords( lt_rect.TopLeft ) ); diff --git a/eeschema/sch_shape.cpp b/eeschema/sch_shape.cpp index 3bad221255..d2f41ef632 100644 --- a/eeschema/sch_shape.cpp +++ b/eeschema/sch_shape.cpp @@ -74,7 +74,7 @@ void SCH_SHAPE::Move( const VECTOR2I& aOffset ) void SCH_SHAPE::Normalize() { - if( GetShape() == SHAPE_T::RECT ) + if( GetShape() == SHAPE_T::RECTANGLE ) { VECTOR2I size = GetEnd() - GetPosition(); @@ -153,7 +153,7 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground ) const aPlotter->Circle( getCenter(), GetRadius() * 2, m_fill, 0 ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: aPlotter->Rect( GetStart(), GetEnd(), m_fill, 0 ); break; @@ -196,7 +196,7 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground ) const aPlotter->Circle( getCenter(), GetRadius() * 2, FILL_T::NO_FILL, pen_size ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { std::vector pts = GetRectCorners(); @@ -287,7 +287,7 @@ void SCH_SHAPE::PrintBackground( const RENDER_SETTINGS* aSettings, const VECTOR2 GRFilledCircle( DC, GetStart(), GetRadius(), 0, color, color ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: GRFilledRect( DC, GetStart(), GetEnd(), 0, color, color ); break; @@ -364,7 +364,7 @@ void SCH_SHAPE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset GRFilledCircle( DC, GetStart(), GetRadius(), 0, fillColor, fillColor ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: GRFilledRect( DC, GetStart(), GetEnd(), 0, fillColor, fillColor ); break; @@ -399,7 +399,7 @@ void SCH_SHAPE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset GRCircle( DC, GetStart(), GetRadius(), penWidth, color ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: GRRect( DC, GetStart(), GetEnd(), penWidth, color ); break; @@ -457,7 +457,7 @@ wxString SCH_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const return wxString::Format( _( "Circle, radius %s" ), aUnitsProvider->MessageTextFromValue( GetRadius() ) ); - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: return wxString::Format( _( "Rectangle, width %s height %s" ), aUnitsProvider->MessageTextFromValue( std::abs( m_start.x - m_end.x ) ), aUnitsProvider->MessageTextFromValue( std::abs( m_start.y - m_end.y ) ) ); @@ -484,7 +484,7 @@ BITMAPS SCH_SHAPE::GetMenuImage() const case SHAPE_T::SEGMENT: return BITMAPS::add_line; case SHAPE_T::ARC: return BITMAPS::add_arc; case SHAPE_T::CIRCLE: return BITMAPS::add_circle; - case SHAPE_T::RECT: return BITMAPS::add_rectangle; + case SHAPE_T::RECTANGLE: return BITMAPS::add_rectangle; case SHAPE_T::POLY: return BITMAPS::add_graphical_segments; default: diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 8785c994f2..78bd4d5876 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -79,7 +79,7 @@ static LIB_SYMBOL* dummy() { symbol = new LIB_SYMBOL( wxEmptyString ); - LIB_SHAPE* square = new LIB_SHAPE( symbol, SHAPE_T::RECT ); + LIB_SHAPE* square = new LIB_SHAPE( symbol, SHAPE_T::RECTANGLE ); square->MoveTo( VECTOR2I( schIUScale.MilsToIU( -200 ), schIUScale.MilsToIU( 200 ) ) ); square->SetEnd( VECTOR2I( schIUScale.MilsToIU( 200 ), schIUScale.MilsToIU( -200 ) ) ); diff --git a/eeschema/sch_textbox.cpp b/eeschema/sch_textbox.cpp index afa2e1108d..fdf70958fe 100644 --- a/eeschema/sch_textbox.cpp +++ b/eeschema/sch_textbox.cpp @@ -44,7 +44,7 @@ using KIGFX::SCH_RENDER_SETTINGS; SCH_TEXTBOX::SCH_TEXTBOX( int aLineWidth, FILL_T aFillType, const wxString& text ) : - SCH_SHAPE( SHAPE_T::RECT, aLineWidth, aFillType, SCH_TEXTBOX_T ), + SCH_SHAPE( SHAPE_T::RECTANGLE, aLineWidth, aFillType, SCH_TEXTBOX_T ), EDA_TEXT( schIUScale, text ) { m_layer = LAYER_NOTES; diff --git a/eeschema/tools/ee_actions.cpp b/eeschema/tools/ee_actions.cpp index edb0cd15ea..bc3142505f 100644 --- a/eeschema/tools/ee_actions.cpp +++ b/eeschema/tools/ee_actions.cpp @@ -429,7 +429,7 @@ TOOL_ACTION EE_ACTIONS::drawTextBox( TOOL_ACTION_ARGS() .Tooltip( _( "Draw text box items" ) ) .Icon( BITMAPS::add_textbox ) .Flags( AF_ACTIVATE ) - .Parameter( SHAPE_T::RECT ) ); + .Parameter( SHAPE_T::RECTANGLE ) ); TOOL_ACTION EE_ACTIONS::drawRectangle( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawRectangle" ) @@ -438,7 +438,7 @@ TOOL_ACTION EE_ACTIONS::drawRectangle( TOOL_ACTION_ARGS() .Tooltip( _( "Draw rectangles" ) ) .Icon( BITMAPS::add_rectangle ) .Flags( AF_ACTIVATE ) - .Parameter( SHAPE_T::RECT ) ); + .Parameter( SHAPE_T::RECTANGLE ) ); TOOL_ACTION EE_ACTIONS::drawCircle( TOOL_ACTION_ARGS() .Name( "eeschema.InteractiveDrawing.drawCircle" ) diff --git a/eeschema/tools/ee_point_editor.cpp b/eeschema/tools/ee_point_editor.cpp index d06b96d6d5..b73c1457ca 100644 --- a/eeschema/tools/ee_point_editor.cpp +++ b/eeschema/tools/ee_point_editor.cpp @@ -102,7 +102,7 @@ public: points->AddPoint( mapCoords( shape->GetEnd() ) ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { shape->Normalize(); @@ -186,7 +186,7 @@ public: points->AddPoint( shape->GetEnd() ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { shape->Normalize(); @@ -686,7 +686,7 @@ void EE_POINT_EDITOR::updateParentItem( bool aSnapToGrid ) const break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { EE_GRID_HELPER gridHelper( m_toolMgr ); VECTOR2I topLeft = m_editPoints->Point( RECT_TOPLEFT ).GetPosition(); @@ -840,7 +840,7 @@ void EE_POINT_EDITOR::updateParentItem( bool aSnapToGrid ) const break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { EE_GRID_HELPER gridHelper( m_toolMgr ); VECTOR2I topLeft = m_editPoints->Point( RECT_TOPLEFT ).GetPosition(); @@ -1142,7 +1142,7 @@ void EE_POINT_EDITOR::updatePoints() break; } - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { // point editor works only with rectangles having width and height > 0 // Some symbols can have rectangles with width or height < 0 @@ -1230,7 +1230,7 @@ void EE_POINT_EDITOR::updatePoints() break; } - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { // point editor works only with rectangles having width and height > 0 // Some symbols can have rectangles with width or height < 0 diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 79cef1eb37..71977e8fbf 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1929,7 +1929,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) switch( shape->GetShape() ) { - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: for( const VECTOR2I& pt : shape->GetRectCorners() ) processPt( pt ); diff --git a/include/eda_shape.h b/include/eda_shape.h index 8ea69e423e..2a4ca65073 100644 --- a/include/eda_shape.h +++ b/include/eda_shape.h @@ -41,12 +41,12 @@ using KIGFX::COLOR4D; enum class SHAPE_T : int { SEGMENT = 0, - RECT, + RECTANGLE, /// use RECTANGLE instead of RECT to avoid collision in a Windows header ARC, CIRCLE, POLY, BEZIER, - LAST ///< marker for list end + LAST ///< marker for list end }; diff --git a/pcbnew/convert_shape_list_to_polygon.cpp b/pcbnew/convert_shape_list_to_polygon.cpp index cfbd708d6e..eadc443be3 100644 --- a/pcbnew/convert_shape_list_to_polygon.cpp +++ b/pcbnew/convert_shape_list_to_polygon.cpp @@ -258,7 +258,7 @@ bool ConvertOutlineToPolygon( std::vector& aShapeList, SHAPE_POLY_SE if( !aAllowUseArcsInPolygons ) currContour.ClearArcs(); } - else if( graphic->GetShape() == SHAPE_T::RECT ) + else if( graphic->GetShape() == SHAPE_T::RECTANGLE ) { std::vector pts = graphic->GetRectCorners(); @@ -290,7 +290,7 @@ bool ConvertOutlineToPolygon( std::vector& aShapeList, SHAPE_POLY_SE { switch( graphic->GetShape() ) { - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: { // As a non-first item, closed shapes can't be anything but self-intersecting diff --git a/pcbnew/dialogs/dialog_graphic_item_properties.cpp b/pcbnew/dialogs/dialog_graphic_item_properties.cpp index c94e90239f..6eb3d30294 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties.cpp @@ -227,7 +227,7 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow() m_filledCtrl->Show( true ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: SetTitle( _( "Rectangle Properties" ) ); m_filledCtrl->Show( true ); @@ -444,7 +444,7 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::Validate() break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: // Check for null rect. if( m_startX.GetValue() == m_endX.GetValue() && m_startY.GetValue() == m_endY.GetValue() ) errors.Add( _( "Rectangle cannot be empty." ) ); diff --git a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp index 7afaf0c86c..eb0cd5285b 100644 --- a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp @@ -155,7 +155,7 @@ bool DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataToWindow() m_filledCtrl->Show( true ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( m_shape->IsAnnotationProxy() ) SetTitle( _( "Number Box" ) ); else @@ -209,7 +209,7 @@ bool DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataFromWindow() switch( m_shape->GetShape() ) { case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: m_shape->SetStart( VECTOR2I( m_startX.GetIntValue(), m_startY.GetIntValue() ) ); m_shape->SetEnd( VECTOR2I( m_endX.GetIntValue(), m_endY.GetIntValue() ) ); break; diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 45cb247462..2ab600401f 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -795,7 +795,7 @@ void DIALOG_PAD_PROPERTIES::displayPrimitivesList() primitive->GetPolyShape().Outline( 0 ).PointCount() ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( primitive->IsAnnotationProxy() ) bs_info[0] = _( "Number box" ); else @@ -2268,7 +2268,7 @@ void DIALOG_PAD_PROPERTIES::onAddPrimitive( wxCommandEvent& event ) return; SHAPE_T listtype[] = { SHAPE_T::SEGMENT, SHAPE_T::ARC, SHAPE_T::BEZIER, SHAPE_T::CIRCLE, - SHAPE_T::POLY, SHAPE_T::RECT }; + SHAPE_T::POLY, SHAPE_T::RECTANGLE }; PCB_SHAPE* primitive = new PCB_SHAPE(); primitive->SetShape( listtype[type] ); diff --git a/pcbnew/drc/drc_test_provider_edge_clearance.cpp b/pcbnew/drc/drc_test_provider_edge_clearance.cpp index d3834ae70c..1267d1d1f1 100644 --- a/pcbnew/drc/drc_test_provider_edge_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_edge_clearance.cpp @@ -184,7 +184,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run() if( item->IsOnLayer( Edge_Cuts ) ) stroke.SetWidth( 0 ); - if( shape->GetShape() == SHAPE_T::RECT && !shape->IsFilled() ) + if( shape->GetShape() == SHAPE_T::RECTANGLE && !shape->IsFilled() ) { // A single rectangle for the board would make the RTree useless, so convert // to 4 edges diff --git a/pcbnew/drc/drc_test_provider_library_parity.cpp b/pcbnew/drc/drc_test_provider_library_parity.cpp index e2d00a8da7..cbc154d10e 100644 --- a/pcbnew/drc/drc_test_provider_library_parity.cpp +++ b/pcbnew/drc/drc_test_provider_library_parity.cpp @@ -134,7 +134,7 @@ bool primitiveNeedsUpdate( const std::shared_ptr& a, switch( a->GetShape() ) { case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: TEST( a->GetStart(), b->GetStart(), "" ); TEST( a->GetEnd(), b->GetEnd(), "" ); @@ -274,7 +274,7 @@ bool shapeNeedsUpdate( const PCB_SHAPE* a, const PCB_SHAPE* b ) switch( a->GetShape() ) { - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { BOX2I aRect( a->GetStart(), a->GetEnd() - a->GetStart() ); BOX2I bRect( b->GetStart(), b->GetEnd() - b->GetStart() ); diff --git a/pcbnew/drc/drc_test_provider_physical_clearance.cpp b/pcbnew/drc/drc_test_provider_physical_clearance.cpp index fa85b2f2fe..b07accdf7e 100644 --- a/pcbnew/drc/drc_test_provider_physical_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_physical_clearance.cpp @@ -343,7 +343,7 @@ bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run() break; } - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { SHAPE_LINE_CHAIN asPoly; std::vector pts = shape->GetRectCorners(); diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 1a76fd1d6d..e2b4651b92 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -1238,7 +1238,7 @@ static void FootprintWriteShape( FILE* aFile, FOOTPRINT* aFootprint, const wxStr -end.y / SCALE_FACTOR ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: fprintf( aFile, "LINE %g %g %g %g\n", start.x / SCALE_FACTOR, -start.y / SCALE_FACTOR, diff --git a/pcbnew/exporters/export_idf.cpp b/pcbnew/exporters/export_idf.cpp index fb2a640719..330c7f4a69 100644 --- a/pcbnew/exporters/export_idf.cpp +++ b/pcbnew/exporters/export_idf.cpp @@ -98,7 +98,7 @@ static void idf_export_outline( BOARD* aPcb, IDF3_BOARD& aIDFBoard ) break; } - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { if( graphic->GetStart() == graphic->GetEnd() ) break; diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 5fd029bc04..1837b0fcb1 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -2151,7 +2151,7 @@ double FOOTPRINT::GetCoverageArea( const BOARD_ITEM* aItem, const GENERAL_COLLEC case SHAPE_T::BEZIER: return shape->GetWidth() * shape->GetWidth(); - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: case SHAPE_T::POLY: { diff --git a/pcbnew/graphics_cleaner.cpp b/pcbnew/graphics_cleaner.cpp index ffba7580d1..df7b3244df 100644 --- a/pcbnew/graphics_cleaner.cpp +++ b/pcbnew/graphics_cleaner.cpp @@ -87,7 +87,7 @@ bool GRAPHICS_CLEANER::isNullShape( PCB_SHAPE* aShape ) switch( aShape->GetShape() ) { case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::ARC: return equivalent( aShape->GetStart(), aShape->GetEnd(), m_epsilon ); @@ -126,7 +126,7 @@ bool GRAPHICS_CLEANER::areEquivalent( PCB_SHAPE* aShape1, PCB_SHAPE* aShape2 ) switch( aShape1->GetShape() ) { case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: return equivalent( aShape1->GetStart(), aShape2->GetStart(), m_epsilon ) && equivalent( aShape1->GetEnd(), aShape2->GetEnd(), m_epsilon ); @@ -321,7 +321,7 @@ void GRAPHICS_CLEANER::mergeRects() { PCB_SHAPE* rect = new PCB_SHAPE( m_parentFootprint ); - rect->SetShape( SHAPE_T::RECT ); + rect->SetShape( SHAPE_T::RECTANGLE ); rect->SetFilled( false ); rect->SetStart( top->start ); rect->SetEnd( bottom->end ); diff --git a/pcbnew/pad_custom_shape_functions.cpp b/pcbnew/pad_custom_shape_functions.cpp index 9a8083ce42..86ce5625b7 100644 --- a/pcbnew/pad_custom_shape_functions.cpp +++ b/pcbnew/pad_custom_shape_functions.cpp @@ -136,7 +136,7 @@ void PAD::AddPrimitiveCircle( const VECTOR2I& aCenter, int aRadius, int aThickne void PAD::AddPrimitiveRect( const VECTOR2I& aStart, const VECTOR2I& aEnd, int aThickness, bool aFilled) { - PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::RECT ); + PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::RECTANGLE ); item->SetFilled( aFilled ); item->SetStart( aStart ); item->SetEnd( aEnd ); @@ -149,7 +149,7 @@ void PAD::AddPrimitiveRect( const VECTOR2I& aStart, const VECTOR2I& aEnd, int aT void PAD::AddPrimitiveAnnotationBox( const VECTOR2I& aStart, const VECTOR2I& aEnd ) { - PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::RECT ); + PCB_SHAPE* item = new PCB_SHAPE( nullptr, SHAPE_T::RECTANGLE ); item->SetIsAnnotationProxy(); item->SetFilled( false ); item->SetStart( aStart ); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 20eeea1503..8fe67a5b71 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1706,7 +1706,7 @@ void PCB_PAINTER::draw( const PCB_SHAPE* aShape, int aLayer ) break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { std::vector pts = aShape->GetRectCorners(); diff --git a/pcbnew/pcb_shape.cpp b/pcbnew/pcb_shape.cpp index eb646f24ba..ab4334f167 100644 --- a/pcbnew/pcb_shape.cpp +++ b/pcbnew/pcb_shape.cpp @@ -70,7 +70,7 @@ bool PCB_SHAPE::IsType( const std::vector& aScanTypes ) const else if( scanType == PCB_SHAPE_LOCATE_CIRCLE_T ) sametype = m_shape == SHAPE_T::CIRCLE; else if( scanType == PCB_SHAPE_LOCATE_RECT_T ) - sametype = m_shape == SHAPE_T::RECT; + sametype = m_shape == SHAPE_T::RECTANGLE; else if( scanType == PCB_SHAPE_LOCATE_SEGMENT_T ) sametype = m_shape == SHAPE_T::SEGMENT; else if( scanType == PCB_SHAPE_LOCATE_POLY_T ) @@ -105,7 +105,7 @@ const VECTOR2I PCB_SHAPE::GetFocusPosition() const else return GetCenter(); - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( !IsFilled() ) return GetStart(); else @@ -138,7 +138,7 @@ std::vector PCB_SHAPE::GetCorners() const { std::vector pts; - if( GetShape() == SHAPE_T::RECT ) + if( GetShape() == SHAPE_T::RECTANGLE ) { pts = GetRectCorners(); } @@ -176,7 +176,7 @@ void PCB_SHAPE::Scale( double aScale ) void PCB_SHAPE::NormalizeRect() { - if( m_shape == SHAPE_T::RECT ) + if( m_shape == SHAPE_T::RECTANGLE ) { VECTOR2I start = GetStart(); VECTOR2I end = GetEnd(); @@ -211,7 +211,7 @@ void PCB_SHAPE::NormalizeRect() && horizontal( outline.Segment( 2 ) ) && vertical( outline.Segment( 3 ) ) ) { - m_shape = SHAPE_T::RECT; + m_shape = SHAPE_T::RECTANGLE; m_start.x = std::min( outline.Segment( 0 ).A.x, outline.Segment( 0 ).B.x ); m_start.y = std::min( outline.Segment( 1 ).A.y, outline.Segment( 1 ).B.y ); m_end.x = std::max( outline.Segment( 0 ).A.x, outline.Segment( 0 ).B.x ); @@ -222,7 +222,7 @@ void PCB_SHAPE::NormalizeRect() && vertical( outline.Segment( 2 ) ) && horizontal( outline.Segment( 3 ) ) ) { - m_shape = SHAPE_T::RECT; + m_shape = SHAPE_T::RECTANGLE; m_start.x = std::min( outline.Segment( 1 ).A.x, outline.Segment( 1 ).B.x ); m_start.y = std::min( outline.Segment( 0 ).A.y, outline.Segment( 0 ).B.y ); m_end.x = std::max( outline.Segment( 1 ).A.x, outline.Segment( 1 ).B.x ); @@ -256,7 +256,7 @@ void PCB_SHAPE::Mirror( const VECTOR2I& aCentre, bool aMirrorAroundXAxis ) { case SHAPE_T::ARC: case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: case SHAPE_T::BEZIER: if( aMirrorAroundXAxis ) diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index 2885a82ea5..1460c63a47 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -39,7 +39,7 @@ PCB_TEXTBOX::PCB_TEXTBOX( BOARD_ITEM* parent ) : - PCB_SHAPE( parent, PCB_TEXTBOX_T, SHAPE_T::RECT ), + PCB_SHAPE( parent, PCB_TEXTBOX_T, SHAPE_T::RECTANGLE ), EDA_TEXT( pcbIUScale ) { SetHorizJustify( GR_TEXT_H_ALIGN_LEFT ); @@ -330,13 +330,13 @@ void PCB_TEXTBOX::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) PCB_SHAPE::Rotate( aRotCentre, aAngle ); EDA_TEXT::SetTextAngle( ( GetTextAngle() + aAngle ).Normalized() ); - if( GetTextAngle().IsCardinal() && GetShape() != SHAPE_T::RECT ) + if( GetTextAngle().IsCardinal() && GetShape() != SHAPE_T::RECTANGLE ) { std::vector corners = GetCorners(); VECTOR2I diag = corners[2] - corners[0]; EDA_ANGLE angle = GetTextAngle(); - SetShape( SHAPE_T::RECT ); + SetShape( SHAPE_T::RECTANGLE ); SetStart( corners[0] ); angle.Normalize(); @@ -503,7 +503,7 @@ void PCB_TEXTBOX::TransformShapeToPolygon( SHAPE_POLY_SET& aBuffer, PCB_LAYER_ID int width = GetWidth() + ( 2 * aClearance ); - if( GetShape() == SHAPE_T::RECT ) + if( GetShape() == SHAPE_T::RECTANGLE ) { std::vector pts = GetRectCorners(); diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index d6efe1e50d..9fbf40bbfc 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -815,7 +815,7 @@ void BRDITEMS_PLOTTER::PlotShape( const PCB_SHAPE* aShape ) break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { std::vector pts = aShape->GetRectCorners(); diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index f85b17cc1f..96ca3b4335 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -3416,7 +3416,7 @@ void ALTIUM_PCB::ConvertFills6ToFootprintItem( FOOTPRINT* aFootprint, const AFIL || aElem.layer == ALTIUM_LAYER::KEEP_OUT_LAYER ) // TODO: what about plane layers? { // This is not the actual board item. We can use it to create the polygon for the region - PCB_SHAPE shape( nullptr, SHAPE_T::RECT ); + PCB_SHAPE shape( nullptr, SHAPE_T::RECTANGLE ); shape.SetStart( aElem.pos1 ); shape.SetEnd( aElem.pos2 ); shape.SetStroke( STROKE_PARAMS( 0, PLOT_DASH_TYPE::SOLID ) ); @@ -3491,7 +3491,7 @@ void ALTIUM_PCB::ConvertFills6ToBoardItemWithNet( const AFILL6& aElem ) void ALTIUM_PCB::ConvertFills6ToBoardItemOnLayer( const AFILL6& aElem, PCB_LAYER_ID aLayer ) { - PCB_SHAPE* fill = new PCB_SHAPE( m_board, SHAPE_T::RECT ); + PCB_SHAPE* fill = new PCB_SHAPE( m_board, SHAPE_T::RECTANGLE ); fill->SetFilled( true ); fill->SetLayer( aLayer ); @@ -3514,7 +3514,7 @@ void ALTIUM_PCB::ConvertFills6ToBoardItemOnLayer( const AFILL6& aElem, PCB_LAYER void ALTIUM_PCB::ConvertFills6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, const AFILL6& aElem, PCB_LAYER_ID aLayer ) { - PCB_SHAPE* fill = new PCB_SHAPE( aFootprint, SHAPE_T::RECT ); + PCB_SHAPE* fill = new PCB_SHAPE( aFootprint, SHAPE_T::RECTANGLE ); fill->SetFilled( true ); fill->SetLayer( aLayer ); diff --git a/pcbnew/plugins/fabmaster/import_fabmaster.cpp b/pcbnew/plugins/fabmaster/import_fabmaster.cpp index ca67ccc558..7935f7ea93 100644 --- a/pcbnew/plugins/fabmaster/import_fabmaster.cpp +++ b/pcbnew/plugins/fabmaster/import_fabmaster.cpp @@ -2168,7 +2168,7 @@ bool FABMASTER::loadFootprints( BOARD* aBoard ) const GRAPHIC_RECTANGLE *lsrc = static_cast( seg.get() ); - PCB_SHAPE* rect = new PCB_SHAPE( fp, SHAPE_T::RECT ); + PCB_SHAPE* rect = new PCB_SHAPE( fp, SHAPE_T::RECTANGLE ); if( src->mirror ) { @@ -2842,7 +2842,7 @@ bool FABMASTER::loadOutline( BOARD* aBoard, const std::unique_ptr( seg.get() ); - PCB_SHAPE* rect = new PCB_SHAPE( aBoard, SHAPE_T::RECT ); + PCB_SHAPE* rect = new PCB_SHAPE( aBoard, SHAPE_T::RECTANGLE ); rect->SetLayer( layer ); rect->SetStart( VECTOR2I( src->start_x, src->start_y ) ); rect->SetEnd( VECTOR2I( src->end_x, src->end_y ) ); @@ -2968,7 +2968,7 @@ bool FABMASTER::loadGraphics( BOARD* aBoard ) const GRAPHIC_RECTANGLE *src = static_cast( seg.get() ); - PCB_SHAPE* rect = new PCB_SHAPE( aBoard, SHAPE_T::RECT ); + PCB_SHAPE* rect = new PCB_SHAPE( aBoard, SHAPE_T::RECTANGLE ); rect->SetLayer( layer ); rect->SetStart( VECTOR2I( src->start_x, src->start_y ) ); rect->SetEnd( VECTOR2I( src->end_x, src->end_y ) ); diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index 58dae4cfcd..967f7a8a63 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -2655,7 +2655,7 @@ PCB_SHAPE* PCB_PARSER::parsePCB_SHAPE( BOARD_ITEM* aParent ) case T_gr_bbox: case T_gr_rect: case T_fp_rect: - shape->SetShape( SHAPE_T::RECT ); + shape->SetShape( SHAPE_T::RECTANGLE ); token = NextTok(); if( token == T_locked ) @@ -2861,7 +2861,7 @@ PCB_SHAPE* PCB_PARSER::parsePCB_SHAPE( BOARD_ITEM* aParent ) // Legacy versions didn't have a filled flag but allowed some shapes to indicate they // should be filled by specifying a 0 stroke-width. if( stroke.GetWidth() == 0 - && ( shape->GetShape() == SHAPE_T::RECT || shape->GetShape() == SHAPE_T::CIRCLE ) ) + && ( shape->GetShape() == SHAPE_T::RECTANGLE || shape->GetShape() == SHAPE_T::CIRCLE ) ) { shape->SetFilled( true ); } diff --git a/pcbnew/plugins/kicad/pcb_plugin.cpp b/pcbnew/plugins/kicad/pcb_plugin.cpp index 276cce3f76..9eabf3b363 100644 --- a/pcbnew/plugins/kicad/pcb_plugin.cpp +++ b/pcbnew/plugins/kicad/pcb_plugin.cpp @@ -915,7 +915,7 @@ void PCB_PLUGIN::format( const PCB_SHAPE* aShape, int aNestLevel ) const formatInternalUnits( aShape->GetEnd(), parentFP ).c_str() ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: m_out->Print( aNestLevel, "(%s_rect%s (start %s) (end %s)\n", prefix.c_str(), locked.c_str(), @@ -978,7 +978,7 @@ void PCB_PLUGIN::format( const PCB_SHAPE* aShape, int aNestLevel ) const // The filled flag represents if a solid fill is present on circles, rectangles and polygons if( ( aShape->GetShape() == SHAPE_T::POLY ) - || ( aShape->GetShape() == SHAPE_T::RECT ) + || ( aShape->GetShape() == SHAPE_T::RECTANGLE ) || ( aShape->GetShape() == SHAPE_T::CIRCLE ) ) { m_out->Print( 0, aShape->IsFilled() ? " (fill solid)" : " (fill none)" ); @@ -1675,7 +1675,7 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const formatInternalUnits( primitive->GetEnd() ).c_str() ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: if( primitive->IsAnnotationProxy() ) { m_out->Print( nested_level, "(gr_bbox (start %s) (end %s)", @@ -1734,7 +1734,7 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const // The filled flag represents if a solid fill is present on circles, // rectangles and polygons if( ( primitive->GetShape() == SHAPE_T::POLY ) - || ( primitive->GetShape() == SHAPE_T::RECT ) + || ( primitive->GetShape() == SHAPE_T::RECTANGLE ) || ( primitive->GetShape() == SHAPE_T::CIRCLE ) ) { m_out->Print( 0, primitive->IsFilled() ? " (fill yes)" : " (fill none)" ); @@ -1831,7 +1831,7 @@ void PCB_PLUGIN::format( const PCB_TEXTBOX* aTextBox, int aNestLevel ) const aTextBox->IsLocked() ? " locked" : "", m_out->Quotew( aTextBox->GetText() ).c_str() ); - if( aTextBox->GetShape() == SHAPE_T::RECT ) + if( aTextBox->GetShape() == SHAPE_T::RECTANGLE ) { m_out->Print( aNestLevel + 1, "(start %s) (end %s)\n", formatInternalUnits( aTextBox->GetStart(), parentFP ).c_str(), diff --git a/pcbnew/python/swig/pcb_shape.i b/pcbnew/python/swig/pcb_shape.i index 154507c126..cb3752748f 100644 --- a/pcbnew/python/swig/pcb_shape.i +++ b/pcbnew/python/swig/pcb_shape.i @@ -56,18 +56,20 @@ /* Only for compatibility with old python scripts: */ const int S_SEGMENT = (const int)SHAPE_T::SEGMENT; -const int S_RECT = (const int)SHAPE_T::RECT; +const int S_RECT = (const int)SHAPE_T::RECTANGLE; const int S_ARC = (const int)SHAPE_T::ARC; const int S_CIRCLE = (const int)SHAPE_T::CIRCLE; const int S_POLYGON = (const int)SHAPE_T::POLY; const int S_CURVE = (const int)SHAPE_T::BEZIER; +const int SHAPE_T_RECT = (const int)SHAPE_T::RECTANGLE; %{ /* for compatibility with old python scripts: */ const int S_SEGMENT = (const int)SHAPE_T::SEGMENT; -const int S_RECT = (const int)SHAPE_T::RECT; +const int S_RECT = (const int)SHAPE_T::RECTANGLE; const int S_ARC = (const int)SHAPE_T::ARC; const int S_CIRCLE = (const int)SHAPE_T::CIRCLE; const int S_POLYGON = (const int)SHAPE_T::POLY; const int S_CURVE = (const int)SHAPE_T::BEZIER; +const int SHAPE_T_RECT = (const int)SHAPE_T::RECTANGLE; %} diff --git a/pcbnew/specctra_import_export/specctra_export.cpp b/pcbnew/specctra_import_export/specctra_export.cpp index 34baa56ca7..4c457a61b9 100644 --- a/pcbnew/specctra_import_export/specctra_export.cpp +++ b/pcbnew/specctra_import_export/specctra_export.cpp @@ -748,7 +748,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, FOOTPRINT* aFootprint ) break; } - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { outline = new SHAPE( image, T_outline ); diff --git a/pcbnew/tools/convert_tool.cpp b/pcbnew/tools/convert_tool.cpp index efbaf31c99..608db98a0a 100644 --- a/pcbnew/tools/convert_tool.cpp +++ b/pcbnew/tools/convert_tool.cpp @@ -832,7 +832,7 @@ int CONVERT_TOOL::CreateLines( const TOOL_EVENT& aEvent ) case SHAPE_T::SEGMENT: case SHAPE_T::ARC: case SHAPE_T::POLY: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: break; default: @@ -872,7 +872,7 @@ int CONVERT_TOOL::CreateLines( const TOOL_EVENT& aEvent ) { set = graphic->GetPolyShape(); } - else if( graphic->GetShape() == SHAPE_T::RECT ) + else if( graphic->GetShape() == SHAPE_T::RECTANGLE ) { SHAPE_LINE_CHAIN outline; VECTOR2I start( graphic->GetStart() ); diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index c2e5780c39..c262a08993 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -380,7 +380,7 @@ int DRAWING_TOOL::DrawRectangle( const TOOL_EVENT& aEvent ) std::optional startingPoint; rect = isTextBox ? new PCB_TEXTBOX( parent ) : new PCB_SHAPE( parent ); - rect->SetShape( SHAPE_T::RECT ); + rect->SetShape( SHAPE_T::RECTANGLE ); rect->SetFilled( false ); rect->SetFlags( IS_NEW ); @@ -415,7 +415,7 @@ int DRAWING_TOOL::DrawRectangle( const TOOL_EVENT& aEvent ) } rect = isTextBox ? new PCB_TEXTBOX( parent ) : new PCB_SHAPE( parent ); - rect->SetShape( SHAPE_T::RECT ); + rect->SetShape( SHAPE_T::RECTANGLE ); rect->SetFilled( false ); rect->SetFlags( IS_NEW ); startingPoint = std::nullopt; @@ -1762,7 +1762,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, SHAPE_T shape = ( *aGraphic )->GetShape(); // Only three shapes are currently supported - wxASSERT( shape == SHAPE_T::SEGMENT || shape == SHAPE_T::CIRCLE || shape == SHAPE_T::RECT ); + wxASSERT( shape == SHAPE_T::SEGMENT || shape == SHAPE_T::CIRCLE || shape == SHAPE_T::RECTANGLE ); const BOARD_DESIGN_SETTINGS& bds = m_frame->GetDesignSettings(); EDA_UNITS userUnits = m_frame->GetUserUnits(); @@ -2027,7 +2027,7 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic, const VECTOR2I lineVector( clampedCursorPos - VECTOR2I( twoPointMgr.GetOrigin() ) ); // get a restricted 45/H/V line from the last fixed point to the cursor - VECTOR2I newEnd = GetVectorSnapped45( lineVector, ( shape == SHAPE_T::RECT ) ); + VECTOR2I newEnd = GetVectorSnapped45( lineVector, ( shape == SHAPE_T::RECTANGLE ) ); m_controls->ForceCursorPosition( true, VECTOR2I( twoPointMgr.GetEnd() ) ); twoPointMgr.SetEnd( twoPointMgr.GetOrigin() + newEnd ); twoPointMgr.SetAngleSnap( true ); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index e8b621804e..f059bbcb5b 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1141,7 +1141,7 @@ int EDIT_TOOL::ModifyLines( const TOOL_EVENT& aEvent ) PCB_LAYER_ID layer = graphic->GetLayer(); int width = graphic->GetWidth(); - if( graphic->GetShape() == SHAPE_T::RECT ) + if( graphic->GetShape() == SHAPE_T::RECTANGLE ) { items_to_remove.push_back( graphic ); VECTOR2I start( graphic->GetStart() ); diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index 3d915bda45..58fef68b35 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -725,7 +725,7 @@ PCB_LAYER_ID PAD_TOOL::explodePad( PAD* aPad ) switch( shape->GetShape() ) { case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: shape->SetStart( primitive->GetStart() ); shape->SetEnd( primitive->GetEnd() ); @@ -903,7 +903,7 @@ std::vector PAD_TOOL::RecombinePad( PAD* aPad, bool aIsDryRun, BOARD switch( primitive->GetShape() ) { case SHAPE_T::SEGMENT: - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: case SHAPE_T::CIRCLE: primitive->SetStart( fpShape->GetStart() ); primitive->SetEnd( fpShape->GetEnd() ); diff --git a/pcbnew/tools/pcb_grid_helper.cpp b/pcbnew/tools/pcb_grid_helper.cpp index c3d048cfd9..fb9dd230d6 100644 --- a/pcbnew/tools/pcb_grid_helper.cpp +++ b/pcbnew/tools/pcb_grid_helper.cpp @@ -550,7 +550,7 @@ void PCB_GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos addAnchor( shape->GetCenter(), ORIGIN | SNAPPABLE, shape ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { VECTOR2I point2( end.x, start.y ); VECTOR2I point3( start.x, end.y ); diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index 0137024630..c4535e72b5 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -185,7 +185,7 @@ std::shared_ptr PCB_POINT_EDITOR::makePoints( EDA_ITEM* aItem ) // We can't currently handle TEXTBOXes that have been turned into SHAPE_T::POLYs due // to non-cardinal rotations - if( shape->GetShape() != SHAPE_T::RECT ) + if( shape->GetShape() != SHAPE_T::RECTANGLE ) return points; } @@ -218,7 +218,7 @@ std::shared_ptr PCB_POINT_EDITOR::makePoints( EDA_ITEM* aItem ) points->AddPoint( shape->GetEnd() ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: points->AddPoint( shape->GetTopLeft() ); points->AddPoint( VECTOR2I( shape->GetBotRight().x, shape->GetTopLeft().y ) ); points->AddPoint( shape->GetBotRight() ); @@ -1122,7 +1122,7 @@ void PCB_POINT_EDITOR::updateItem() const break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: { VECTOR2I topLeft = m_editPoints->Point( RECT_TOP_LEFT ).GetPosition(); VECTOR2I topRight = m_editPoints->Point( RECT_TOP_RIGHT ).GetPosition(); @@ -1675,7 +1675,7 @@ void PCB_POINT_EDITOR::updatePoints() case PCB_TEXTBOX_T: { const PCB_SHAPE* shape = static_cast( item ); - int target = shape->GetShape() == SHAPE_T::RECT ? 4 : 0; + int target = shape->GetShape() == SHAPE_T::RECTANGLE ? 4 : 0; // Careful; textbox shape is mutable between cardinal and non-cardinal rotations... if( int( m_editPoints->PointsSize() ) != target ) @@ -1691,7 +1691,7 @@ void PCB_POINT_EDITOR::updatePoints() break; } - if( shape->GetShape() == SHAPE_T::RECT ) + if( shape->GetShape() == SHAPE_T::RECTANGLE ) { m_editPoints->Point( RECT_TOP_LEFT ).SetPosition( shape->GetTopLeft() ); m_editPoints->Point( RECT_TOP_RIGHT ).SetPosition( shape->GetBotRight().x, @@ -1719,7 +1719,7 @@ void PCB_POINT_EDITOR::updatePoints() m_editPoints->Point( SEG_END ).SetPosition( shape->GetEnd() ); break; - case SHAPE_T::RECT: + case SHAPE_T::RECTANGLE: m_editPoints->Point( RECT_TOP_LEFT ).SetPosition( shape->GetTopLeft() ); m_editPoints->Point( RECT_TOP_RIGHT ).SetPosition( shape->GetBotRight().x, shape->GetTopLeft().y );