Replace SHAPE_T::RECT by SHAPE_T::RECTANGLE: RECT creates a collision name
issue with a Windows header on msys2.
Change very similar to the commit 9a47b344
about class PAD_SHAPE.
No actual code change
This commit is contained in:
parent
b8fc45b14d
commit
a16ab0aae1
|
@ -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;
|
||||
|
|
|
@ -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::vector<MSG_PA
|
|||
aList.emplace_back( _( "Points" ), msg );
|
||||
break;
|
||||
|
||||
case SHAPE_T::RECT:
|
||||
case SHAPE_T::RECTANGLE:
|
||||
aList.emplace_back( _( "Width" ),
|
||||
aFrame->MessageTextFromValue( 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<SHAPE*> 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<VECTOR2I> 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<VECTOR2I> pts = GetRectCorners();
|
||||
|
||||
|
@ -1624,12 +1624,12 @@ static struct EDA_SHAPE_DESC
|
|||
EDA_SHAPE_DESC()
|
||||
{
|
||||
ENUM_MAP<SHAPE_T>::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<PLOT_DASH_TYPE>::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;
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 ),
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -1526,7 +1526,7 @@ void SCH_ALTIUM_PLUGIN::ParseRoundRectangle( const std::map<wxString, wxString>&
|
|||
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<wxString, wxString>&
|
|||
|
||||
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<wxString, wxString>& 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<wxString, wxString>& 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 );
|
||||
|
|
|
@ -1464,7 +1464,7 @@ SCH_SHAPE* SCH_EAGLE_PLUGIN::loadCircle( wxXmlNode* aCircleNode )
|
|||
|
||||
SCH_SHAPE* SCH_EAGLE_PLUGIN::loadRectangle( wxXmlNode* aRectNode )
|
||||
{
|
||||
std::unique_ptr<SCH_SHAPE> rectangle = std::make_unique<SCH_SHAPE>( SHAPE_T::RECT );
|
||||
std::unique_ptr<SCH_SHAPE> rectangle = std::make_unique<SCH_SHAPE>( SHAPE_T::RECTANGLE );
|
||||
ERECT rect( aRectNode );
|
||||
|
||||
rectangle->SetLayer( kiCadLayer( rect.layer ) );
|
||||
|
@ -2163,7 +2163,7 @@ LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolRectangle( std::unique_ptr<LIB_SYMBOL>& 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() ) );
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<LIB_SHAPE> rectangle = std::make_unique<LIB_SHAPE>( nullptr, SHAPE_T::RECT );
|
||||
std::unique_ptr<LIB_SHAPE> rectangle = std::make_unique<LIB_SHAPE>( 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<SCH_SHAPE> rectangle = std::make_unique<SCH_SHAPE>( SHAPE_T::RECT );
|
||||
std::unique_ptr<SCH_SHAPE> rectangle = std::make_unique<SCH_SHAPE>( SHAPE_T::RECTANGLE );
|
||||
|
||||
for( token = NextTok(); token != T_RIGHT; token = NextTok() )
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -967,7 +967,7 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadRect( std::unique_ptr<LIB_SYMBOL>& 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 ),
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
|
@ -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<VECTOR2I> 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:
|
||||
|
|
|
@ -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 ) ) );
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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" )
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aShapeList, SHAPE_POLY_SE
|
|||
if( !aAllowUseArcsInPolygons )
|
||||
currContour.ClearArcs();
|
||||
}
|
||||
else if( graphic->GetShape() == SHAPE_T::RECT )
|
||||
else if( graphic->GetShape() == SHAPE_T::RECTANGLE )
|
||||
{
|
||||
std::vector<VECTOR2I> pts = graphic->GetRectCorners();
|
||||
|
||||
|
@ -290,7 +290,7 @@ bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& 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
|
||||
|
|
|
@ -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." ) );
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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] );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -134,7 +134,7 @@ bool primitiveNeedsUpdate( const std::shared_ptr<PCB_SHAPE>& 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() );
|
||||
|
|
|
@ -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<VECTOR2I> pts = shape->GetRectCorners();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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<VECTOR2I> pts = aShape->GetRectCorners();
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ bool PCB_SHAPE::IsType( const std::vector<KICAD_T>& 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<VECTOR2I> PCB_SHAPE::GetCorners() const
|
|||
{
|
||||
std::vector<VECTOR2I> 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 )
|
||||
|
|
|
@ -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<VECTOR2I> 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<VECTOR2I> pts = GetRectCorners();
|
||||
|
||||
|
|
|
@ -815,7 +815,7 @@ void BRDITEMS_PLOTTER::PlotShape( const PCB_SHAPE* aShape )
|
|||
|
||||
break;
|
||||
|
||||
case SHAPE_T::RECT:
|
||||
case SHAPE_T::RECTANGLE:
|
||||
{
|
||||
std::vector<VECTOR2I> pts = aShape->GetRectCorners();
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -2168,7 +2168,7 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
|
|||
const GRAPHIC_RECTANGLE *lsrc =
|
||||
static_cast<const GRAPHIC_RECTANGLE*>( 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<FABMASTER::TRA
|
|||
const GRAPHIC_RECTANGLE *src =
|
||||
static_cast<const GRAPHIC_RECTANGLE*>( 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<const GRAPHIC_RECTANGLE*>( 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 ) );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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;
|
||||
%}
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -380,7 +380,7 @@ int DRAWING_TOOL::DrawRectangle( const TOOL_EVENT& aEvent )
|
|||
std::optional<VECTOR2D> 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 );
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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<PCB_SHAPE*> 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() );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -185,7 +185,7 @@ std::shared_ptr<EDIT_POINTS> 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<EDIT_POINTS> 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<const PCB_SHAPE*>( 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 );
|
||||
|
|
Loading…
Reference in New Issue