PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T

Also updated footprint text and zone types for consistencey.
This commit is contained in:
Jeff Young 2020-10-04 15:19:33 +01:00
parent 00bfd8782c
commit 7a4900b8dc
74 changed files with 466 additions and 536 deletions

View File

@ -197,7 +197,7 @@ void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMo
{
switch( item->Type() )
{
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
@ -207,7 +207,7 @@ void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMo
break;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
{
outline = (EDGE_MODULE*) item;
@ -751,7 +751,7 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSe
default:
wxFAIL_MSG( "BOARD_ADAPTER::AddShapeWithClearanceToContainer no implementation for "
+ STROKE_T_asString( aDrawSegment->GetShape() ) );
+ PCB_SHAPE_TYPE_T_asString( aDrawSegment->GetShape()) );
break;
}
}

View File

@ -634,7 +634,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
{
AddShapeWithClearanceToContainer( (DRAWSEGMENT*)item,
layerContainer,
@ -687,7 +687,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( *layerPoly,
cur_layer_id, 0 );
break;
@ -932,7 +932,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
AddShapeWithClearanceToContainer( (DRAWSEGMENT*)item,
layerContainer,
curr_layer_id,
@ -970,7 +970,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( *layerPoly,
curr_layer_id, 0 );
break;

View File

@ -65,7 +65,7 @@ void BOARD_ADAPTER::transformGraphicModuleEdgeToPolygonSet( const MODULE *aModul
{
for( BOARD_ITEM* item : aModule->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_EDGE_T )
if( item->Type() == PCB_FP_SHAPE_T )
{
EDGE_MODULE* outline = (EDGE_MODULE*) item;

View File

@ -781,10 +781,10 @@ static struct EDA_ITEM_DESC
.Map( PCB_MODULE_T, _( "Footprint" ) )
.Map( PCB_PAD_T, _( "Pad" ) )
.Map( PCB_LINE_T, _( "Line" ) )
.Map( PCB_SHAPE_T, _( "Graphic Shape" ) )
.Map( PCB_TEXT_T, _( "Board Text" ) )
.Map( PCB_MODULE_TEXT_T, _( "Footprint Text" ) )
.Map( PCB_MODULE_EDGE_T, _( "Footprint Graphics" ) )
.Map( PCB_FP_TEXT_T, _( "Footprint Text" ) )
.Map( PCB_FP_SHAPE_T, _( "Graphic Shape" ) )
.Map( PCB_TRACE_T, _( "Track" ) )
.Map( PCB_VIA_T, _( "Via" ) )
.Map( PCB_MARKER_T, _( "Board Marker" ) )

View File

@ -103,7 +103,7 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
}
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
const TEXTE_MODULE* text = static_cast<const TEXTE_MODULE*>( aItem );
@ -136,7 +136,7 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
}
break;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
{
const EDGE_MODULE* segment = static_cast<const EDGE_MODULE*>( aItem );
ret = hash_board_item( segment, aFlags );

View File

@ -46,11 +46,11 @@ class SHAPE;
class PCB_GROUP;
/**
* Enum STROKE_T
* is the set of shapes for segments (graphic segments and tracks) which are often
* Enum PCB_SHAPE_TYPE_T
* is the set of shapes for PCB graphics and tracks and footprint graphics
* in the .m_Shape member
*/
enum STROKE_T
enum PCB_SHAPE_TYPE_T
{
S_SEGMENT = 0, ///< usual segment : line with rounded ends
S_RECT, ///< segment with non rounded ends
@ -61,7 +61,7 @@ enum STROKE_T
S_LAST ///< last value for this list
};
static inline wxString STROKE_T_asString( STROKE_T a )
static inline wxString PCB_SHAPE_TYPE_T_asString( PCB_SHAPE_TYPE_T a )
{
switch( a )
{
@ -281,9 +281,9 @@ public:
/**
* Function ShowShape
* converts the enum STROKE_T integer value to a wxString.
* converts the enum PCB_SHAPE_TYPE_T integer value to a wxString.
*/
static wxString ShowShape( STROKE_T aShape );
static wxString ShowShape( PCB_SHAPE_TYPE_T aShape );
// Some geometric transforms, that must be rewritten for derived classes
/**

View File

@ -88,11 +88,11 @@ enum KICAD_T
// Items in pcb
PCB_MODULE_T, ///< class MODULE, a footprint
PCB_PAD_T, ///< class D_PAD, a pad in a footprint
PCB_LINE_T, ///< class DRAWSEGMENT, a segment not on copper layers
PCB_SHAPE_T, ///< class DRAWSEGMENT, a segment not on copper layers
PCB_TEXT_T, ///< class TEXTE_PCB, text on a layer
PCB_MODULE_TEXT_T, ///< class TEXTE_MODULE, text in a footprint
PCB_MODULE_EDGE_T, ///< class EDGE_MODULE, a footprint edge
PCB_MODULE_ZONE_AREA_T, ///< class ZONE_CONTAINER, managed by a footprint
PCB_FP_TEXT_T, ///< class TEXTE_MODULE, text in a footprint
PCB_FP_SHAPE_T, ///< class EDGE_MODULE, a footprint edge
PCB_FP_ZONE_AREA_T, ///< class ZONE_CONTAINER, managed by a footprint
PCB_TRACE_T, ///< class TRACK, a track segment (segment on a copper layer)
PCB_VIA_T, ///< class VIA, a via (like a track segment on a copper layer)
PCB_ARC_T, ///< class ARC, an arc track segment on a copper layer

View File

@ -33,7 +33,7 @@ namespace KIGFX
namespace PREVIEW
{
// TODO: required until STROKE_T is either moved into commons or a better approach is found
// TODO: required until PCB_SHAPE_TYPE_T is moved into commons or a better approach is found
enum class GEOM_SHAPE
{
SEGMENT = 0,

View File

@ -108,7 +108,7 @@ void ARRAY_CREATOR::Invoke()
{
case PCB_MODULE_T:
case PCB_TEXT_T:
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_TRACE_T:
case PCB_VIA_T:
case PCB_ZONE_AREA_T:

View File

@ -133,7 +133,7 @@ int AR_AUTOPLACER::genPlacementRoutingMatrix()
{
switch( drawing->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
if( drawing->GetLayer() != Edge_Cuts )
{
m_matrix.TraceSegmentPcb( (DRAWSEGMENT*)drawing, CELL_IS_HOLE | CELL_IS_EDGE,

View File

@ -148,9 +148,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
if( !( changeFlags & CHT_DONE ) )
board->Modules().front()->Add( boardItem );
}
else if( boardItem->Type() == PCB_MODULE_TEXT_T ||
boardItem->Type() == PCB_MODULE_EDGE_T ||
boardItem->Type() == PCB_MODULE_ZONE_AREA_T )
else if( boardItem->Type() == PCB_FP_TEXT_T ||
boardItem->Type() == PCB_FP_SHAPE_T ||
boardItem->Type() == PCB_FP_ZONE_AREA_T )
{
wxASSERT( boardItem->GetParent() &&
boardItem->GetParent()->Type() == PCB_MODULE_T );
@ -185,13 +185,13 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
{
// Module items
case PCB_PAD_T:
case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_SHAPE_T:
case PCB_FP_TEXT_T:
case PCB_FP_ZONE_AREA_T:
// This level can only handle module items when editing modules
wxASSERT( m_editModules );
if( boardItem->Type() == PCB_MODULE_TEXT_T )
if( boardItem->Type() == PCB_FP_TEXT_T )
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( boardItem );
@ -212,7 +212,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
break;
// Board items
case PCB_LINE_T: // a segment not on copper layers
case PCB_SHAPE_T: // a shape (normally not on copper layers)
case PCB_TEXT_T: // a text on a layer
case PCB_TRACE_T: // a track segment (segment on a copper layer)
case PCB_ARC_T: // an arced track segment (segment on a copper layer)
@ -348,9 +348,9 @@ EDA_ITEM* BOARD_COMMIT::parentObject( EDA_ITEM* aItem ) const
switch( aItem->Type() )
{
case PCB_PAD_T:
case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_SHAPE_T:
case PCB_FP_TEXT_T:
case PCB_FP_ZONE_AREA_T:
return aItem->GetParent();
case PCB_ZONE_AREA_T:

View File

@ -97,7 +97,7 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( aOutlines, aLayer, 0 );
break;
@ -220,7 +220,7 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLaye
for( auto item : GraphicalItems() )
{
if( item->Type() == PCB_MODULE_TEXT_T && aIncludeText )
if( item->Type() == PCB_FP_TEXT_T && aIncludeText )
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
@ -228,7 +228,7 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLaye
texts.push_back( text );
}
if( item->Type() == PCB_MODULE_EDGE_T && aIncludeEdges )
if( item->Type() == PCB_FP_SHAPE_T && aIncludeEdges )
{
EDGE_MODULE* outline = (EDGE_MODULE*) item;
@ -495,7 +495,7 @@ void DRAWSEGMENT::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerB
default:
wxFAIL_MSG( "DRAWSEGMENT::TransformShapeWithClearanceToPolygon no implementation for "
+ STROKE_T_asString( m_Shape ) );
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}
}

View File

@ -245,7 +245,7 @@ void BOARD::Move( const wxPoint& aMoveVector ) // overload
static const KICAD_T top_level_board_stuff[] = {
PCB_MARKER_T,
PCB_TEXT_T,
PCB_LINE_T,
PCB_SHAPE_T,
PCB_DIM_ALIGNED_T,
PCB_DIM_LEADER_T,
PCB_TARGET_T,
@ -253,7 +253,7 @@ void BOARD::Move( const wxPoint& aMoveVector ) // overload
PCB_TRACE_T,
PCB_ARC_T,
// PCB_PAD_T, Can't be at board level
// PCB_MODULE_TEXT_T, Can't be at board level
// PCB_FP_TEXT_T, Can't be at board level
PCB_MODULE_T,
PCB_ZONE_AREA_T,
EOT
@ -609,7 +609,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_TEXT_T:
case PCB_TARGET_T:
if( aMode == ADD_MODE::APPEND )
@ -699,7 +699,7 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem )
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_TEXT_T:
case PCB_TARGET_T:
m_drawings.erase( std::remove_if( m_drawings.begin(), m_drawings.end(),
@ -1119,9 +1119,9 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
case PCB_MODULE_T:
case PCB_PAD_T:
case PCB_MODULE_TEXT_T:
case PCB_MODULE_EDGE_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_TEXT_T:
case PCB_FP_SHAPE_T:
case PCB_FP_ZONE_AREA_T:
// this calls MODULE::Visit() on each module.
result = IterateForward<MODULE*>( m_modules, inspector, testData, p );
@ -1133,9 +1133,9 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
{
case PCB_MODULE_T:
case PCB_PAD_T:
case PCB_MODULE_TEXT_T:
case PCB_MODULE_EDGE_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_TEXT_T:
case PCB_FP_SHAPE_T:
case PCB_FP_ZONE_AREA_T:
continue;
default:
@ -1147,7 +1147,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
break;
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_TEXT_T:
case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T:
@ -1161,7 +1161,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
{
switch( stype = *++p )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_TEXT_T:
case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T:

View File

@ -29,7 +29,7 @@
#include <class_board.h>
#include <string>
wxString BOARD_ITEM::ShowShape( STROKE_T aShape )
wxString BOARD_ITEM::ShowShape( PCB_SHAPE_TYPE_T aShape )
{
switch( aShape )
{

View File

@ -237,7 +237,8 @@ void DRAWSEGMENT::Rotate( const wxPoint& aRotCentre, double aAngle )
break;
default:
wxFAIL_MSG( "DRAWSEGMENT::Rotate not implemented for " + STROKE_T_asString( m_Shape ) );
wxFAIL_MSG( "DRAWSEGMENT::Rotate not implemented for "
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}
}
@ -292,7 +293,8 @@ void DRAWSEGMENT::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
break;
default:
wxFAIL_MSG( "DRAWSEGMENT::Flip not implemented for " + STROKE_T_asString( m_Shape ) );
wxFAIL_MSG( "DRAWSEGMENT::Flip not implemented for "
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}
@ -351,7 +353,8 @@ wxPoint DRAWSEGMENT::GetCenter() const
break;
default:
wxFAIL_MSG( "DRAWSEGMENT::GetCentre not implemented for " + STROKE_T_asString( m_Shape ) );
wxFAIL_MSG( "DRAWSEGMENT::GetCentre not implemented for "
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}
@ -614,7 +617,7 @@ const EDA_RECT DRAWSEGMENT::GetBoundingBox() const
default:
wxFAIL_MSG( "DRAWSEGMENT::GetBoundingBox not implemented for "
+ STROKE_T_asString( m_Shape ) );
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}
@ -746,7 +749,7 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition, int aAccuracy ) const
default:
wxFAIL_MSG( "DRAWSEGMENT::HitTest (point) not implemented for "
+ STROKE_T_asString( m_Shape ) );
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}
@ -903,7 +906,7 @@ bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy
default:
wxFAIL_MSG( "DRAWSEGMENT::HitTest (rect) not implemented for "
+ STROKE_T_asString( m_Shape ) );
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}
@ -1156,7 +1159,7 @@ std::vector<SHAPE*> DRAWSEGMENT::MakeEffectiveShapes() const
default:
wxFAIL_MSG( "DRAWSEGMENT::MakeEffectiveShapes unsupported DRAWSEGMENT shape: "
+ STROKE_T_asString( m_Shape ) );
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}
@ -1242,7 +1245,7 @@ bool DRAWSEGMENT::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOAR
if( aFirst->GetLayer() != aSecond->GetLayer() )
return aFirst->GetLayer() < aSecond->GetLayer();
if( aFirst->Type() == PCB_LINE_T )
if( aFirst->Type() == PCB_SHAPE_T )
{
const DRAWSEGMENT* dwgA = static_cast<const DRAWSEGMENT*>( aFirst );
const DRAWSEGMENT* dwgB = static_cast<const DRAWSEGMENT*>( aSecond );

View File

@ -48,19 +48,19 @@ class MSG_PANEL_ITEM;
class DRAWSEGMENT : public BOARD_ITEM
{
protected:
int m_Width; ///< thickness of lines ...
wxPoint m_Start; ///< Line start point or Circle and Arc center
wxPoint m_End; ///< Line end point or circle and arc start point
wxPoint m_ThirdPoint; ///< Used only for Arcs: arc end point
int m_Width; // thickness of lines ...
wxPoint m_Start; // Line start point or Circle and Arc center
wxPoint m_End; // Line end point or circle and arc start point
wxPoint m_ThirdPoint; // Used only for Arcs: arc end point
STROKE_T m_Shape; ///< Shape: line, Circle, Arc
int m_Type; ///< Used in complex associations ( Dimensions.. )
double m_Angle; ///< Used only for Arcs: Arc angle in 1/10 deg
wxPoint m_BezierC1; ///< Bezier Control Point 1
wxPoint m_BezierC2; ///< Bezier Control Point 2
PCB_SHAPE_TYPE_T m_Shape; // Shape: line, Circle, Arc
int m_Type; // Used in complex associations ( Dimensions.. )
double m_Angle; // Used only for Arcs: Arc angle in 1/10 deg
wxPoint m_BezierC1; // Bezier Control Point 1
wxPoint m_BezierC2; // Bezier Control Point 2
std::vector<wxPoint> m_BezierPoints;
SHAPE_POLY_SET m_Poly; ///< Stores the S_POLYGON shape
SHAPE_POLY_SET m_Poly; // Stores the S_POLYGON shape
// Computes the bounding box for an arc
void computeArcBBox( EDA_RECT& aBBox ) const;
@ -68,7 +68,7 @@ protected:
const std::vector<wxPoint> buildBezierToSegmentsPointsList( int aMinSegLen ) const;
public:
DRAWSEGMENT( BOARD_ITEM* aParent = NULL, KICAD_T idtype = PCB_LINE_T );
DRAWSEGMENT( BOARD_ITEM* aParent = NULL, KICAD_T idtype = PCB_SHAPE_T );
// Do not create a copy constructor & operator=.
// The ones generated by the compiler are adequate.
@ -77,7 +77,7 @@ public:
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_LINE_T == aItem->Type();
return aItem && PCB_SHAPE_T == aItem->Type();
}
bool IsType( const KICAD_T aScanTypes[] ) const override
@ -115,8 +115,8 @@ public:
void SetType( int aType ) { m_Type = aType; }
int GetType() const { return m_Type; }
void SetShape( STROKE_T aShape ) { m_Shape = aShape; }
STROKE_T GetShape() const { return m_Shape; }
void SetShape( PCB_SHAPE_TYPE_T aShape ) { m_Shape = aShape; }
PCB_SHAPE_TYPE_T GetShape() const { return m_Shape; }
void SetBezControl1( const wxPoint& aPoint ) { m_BezierC1 = aPoint; }
const wxPoint& GetBezControl1() const { return m_BezierC1; }

View File

@ -35,8 +35,8 @@
#include <view/view.h>
EDGE_MODULE::EDGE_MODULE( MODULE* parent, STROKE_T aShape ) :
DRAWSEGMENT( parent, PCB_MODULE_EDGE_T )
EDGE_MODULE::EDGE_MODULE( MODULE* parent, PCB_SHAPE_TYPE_T aShape ) :
DRAWSEGMENT( parent, PCB_FP_SHAPE_T )
{
m_Shape = aShape;
m_Angle = 0;

View File

@ -44,7 +44,7 @@ class MSG_PANEL_ITEM;
class EDGE_MODULE : public DRAWSEGMENT
{
public:
EDGE_MODULE( MODULE* parent, STROKE_T aShape = S_SEGMENT );
EDGE_MODULE( MODULE* parent, PCB_SHAPE_TYPE_T aShape = S_SEGMENT );
// Do not create a copy constructor & operator=.
// The ones generated by the compiler are adequate.
@ -53,7 +53,7 @@ public:
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_MODULE_EDGE_T == aItem->Type();
return aItem && PCB_FP_SHAPE_T == aItem->Type();
}
bool IsType( const KICAD_T aScanTypes[] ) const override

View File

@ -431,12 +431,12 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
{
switch( aBoardItem->Type() )
{
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
// Only user text can be added this way.
assert( static_cast<TEXTE_MODULE*>( aBoardItem )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS );
KI_FALLTHROUGH;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
if( aMode == ADD_MODE::APPEND )
m_drawings.push_back( aBoardItem );
else
@ -450,7 +450,7 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
m_pads.push_front( static_cast<D_PAD*>( aBoardItem ) );
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
if( aMode == ADD_MODE::APPEND )
m_fp_zones.push_back( static_cast<MODULE_ZONE_CONTAINER*>( aBoardItem ) );
else
@ -484,14 +484,14 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem )
{
switch( aBoardItem->Type() )
{
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
// Only user text can be removed this way.
wxCHECK_RET(
static_cast<TEXTE_MODULE*>( aBoardItem )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS,
"Please report this bug: Invalid remove operation on required text" );
KI_FALLTHROUGH;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
for( auto it = m_drawings.begin(); it != m_drawings.end(); ++it )
{
if( *it == aBoardItem )
@ -515,7 +515,7 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem )
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
for( auto it = m_fp_zones.begin(); it != m_fp_zones.end(); ++it )
{
if( *it == static_cast<MODULE_ZONE_CONTAINER*>( aBoardItem ) )
@ -574,7 +574,7 @@ EDA_RECT MODULE::GetFootprintRect() const
for( BOARD_ITEM* item : m_drawings )
{
if( item->Type() == PCB_MODULE_EDGE_T )
if( item->Type() == PCB_FP_SHAPE_T )
area.Merge( item->GetBoundingBox() );
}
@ -625,7 +625,7 @@ const EDA_RECT MODULE::GetBoundingBox( bool aIncludeInvisibleText ) const
// Add in items not collected by GetFootprintRect():
for( BOARD_ITEM* item : m_drawings )
{
if( item->Type() != PCB_MODULE_EDGE_T )
if( item->Type() != PCB_FP_SHAPE_T )
area.Merge( item->GetBoundingBox() );
}
@ -971,12 +971,12 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T
++p;
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
result = IterateForward<MODULE_ZONE_CONTAINER*>( m_fp_zones, inspector, testData, p );
++p;
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
result = inspector( m_Reference, testData );
if( result == SEARCH_RESULT::QUIT )
@ -990,7 +990,7 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T
// Intentionally fall through since m_Drawings can hold TYPETEXTMODULE also
KI_FALLTHROUGH;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
result = IterateForward<BOARD_ITEM*>( m_drawings, inspector, testData, p );
// skip over any types handled in the above call.
@ -998,8 +998,8 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T
{
switch( stype = *++p )
{
case PCB_MODULE_TEXT_T:
case PCB_MODULE_EDGE_T:
case PCB_FP_TEXT_T:
case PCB_FP_SHAPE_T:
continue;
default:
@ -1235,7 +1235,7 @@ void MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
for( BOARD_ITEM* item : m_drawings )
{
if( item->Type() == PCB_MODULE_TEXT_T )
if( item->Type() == PCB_FP_TEXT_T )
static_cast<TEXTE_MODULE*>( item )->KeepUpright( orientation, newOrientation );
}
}
@ -1285,11 +1285,11 @@ void MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
static_cast<EDGE_MODULE*>( item )->Flip( m_Pos, false );
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
static_cast<TEXTE_MODULE*>( item )->Flip( m_Pos, false );
break;
@ -1328,14 +1328,14 @@ void MODULE::SetPosition( const wxPoint& aPos )
{
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
{
EDGE_MODULE* pt_edgmod = (EDGE_MODULE*) item;
pt_edgmod->SetDrawCoord();
break;
}
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
text->EDA_TEXT::Offset( delta );
@ -1385,14 +1385,14 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
{
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
{
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
edge->Move( moveVector );
}
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
text->SetPos0( text->GetPos0() + moveVector );
@ -1435,11 +1435,11 @@ void MODULE::SetOrientation( double aNewAngle )
// Displace contours and text of the footprint.
for( BOARD_ITEM* item : m_drawings )
{
if( item->Type() == PCB_MODULE_EDGE_T )
if( item->Type() == PCB_FP_SHAPE_T )
{
static_cast<EDGE_MODULE*>( item )->SetDrawCoord();
}
else if( item->Type() == PCB_MODULE_TEXT_T )
else if( item->Type() == PCB_FP_TEXT_T )
{
static_cast<TEXTE_MODULE*>( item )->SetDrawCoord();
}
@ -1480,7 +1480,7 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule )
break;
}
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
{
new_zone = new MODULE_ZONE_CONTAINER( *static_cast<const MODULE_ZONE_CONTAINER*>( aItem ) );
const_cast<KIID&>( new_zone->m_Uuid ) = KIID();
@ -1492,7 +1492,7 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule )
break;
}
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* new_text = new TEXTE_MODULE( *static_cast<const TEXTE_MODULE*>( aItem ) );
const_cast<KIID&>( new_text->m_Uuid ) = KIID();
@ -1516,7 +1516,7 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule )
break;
}
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
{
EDGE_MODULE* new_edge = new EDGE_MODULE( *static_cast<const EDGE_MODULE*>( aItem ) );
const_cast<KIID&>( new_edge->m_Uuid ) = KIID();
@ -1622,7 +1622,7 @@ double MODULE::CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const
switch( item->Type() )
{
case PCB_TEXT_T:
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
case PCB_TRACE_T:
case PCB_ARC_T:
case PCB_VIA_T:
@ -1673,17 +1673,17 @@ bool MODULE::BuildPolyCourtyard()
m_poly_courtyard_front.RemoveAllContours();
m_poly_courtyard_back.RemoveAllContours();
// Build the courtyard area from graphic items on the courtyard.
// Only PCB_MODULE_EDGE_T have meaning, graphic texts are ignored.
// Only PCB_FP_SHAPE_T have meaning, graphic texts are ignored.
// Collect items:
std::vector< DRAWSEGMENT* > list_front;
std::vector< DRAWSEGMENT* > list_back;
for( BOARD_ITEM* item : GraphicalItems() )
{
if( item->GetLayer() == B_CrtYd && item->Type() == PCB_MODULE_EDGE_T )
if( item->GetLayer() == B_CrtYd && item->Type() == PCB_FP_SHAPE_T )
list_back.push_back( static_cast< DRAWSEGMENT* > ( item ) );
if( item->GetLayer() == F_CrtYd && item->Type() == PCB_MODULE_EDGE_T )
if( item->GetLayer() == F_CrtYd && item->Type() == PCB_FP_SHAPE_T )
list_front.push_back( static_cast< DRAWSEGMENT* > ( item ) );
}
@ -1746,7 +1746,7 @@ bool MODULE::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOARD_ITE
if( aFirst->GetLayer() != aSecond->GetLayer() )
return aFirst->GetLayer() < aSecond->GetLayer();
if( aFirst->Type() == PCB_MODULE_EDGE_T )
if( aFirst->Type() == PCB_FP_SHAPE_T )
{
const EDGE_MODULE* dwgA = static_cast<const EDGE_MODULE*>( aFirst );
const EDGE_MODULE* dwgB = static_cast<const EDGE_MODULE*>( aSecond );

View File

@ -31,7 +31,7 @@
#include <settings/settings_manager.h>
TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type ) :
BOARD_ITEM( parent, PCB_MODULE_TEXT_T ),
BOARD_ITEM( parent, PCB_FP_TEXT_T ),
EDA_TEXT()
{
MODULE* module = static_cast<MODULE*>( m_Parent );

View File

@ -71,7 +71,7 @@ public:
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_MODULE_TEXT_T == aItem->Type();
return aItem && aItem->Type() == PCB_FP_TEXT_T;
}
bool IsType( const KICAD_T aScanTypes[] ) const override

View File

@ -37,7 +37,7 @@
#include <settings/settings_manager.h>
ZONE_CONTAINER::ZONE_CONTAINER( BOARD_ITEM_CONTAINER* aParent, bool aInModule )
: BOARD_CONNECTED_ITEM( aParent, aInModule ? PCB_MODULE_ZONE_AREA_T : PCB_ZONE_AREA_T ),
: BOARD_CONNECTED_ITEM( aParent, aInModule ? PCB_FP_ZONE_AREA_T : PCB_ZONE_AREA_T ),
m_area( 0.0 )
{
m_CornerSelection = nullptr; // no corner is selected

View File

@ -68,7 +68,7 @@ public:
* if aInModule is true, a MODULE_ZONE_CONTAINER is actually built
* (same item, but with a specific type id:
* The type is PCB_ZONE_AREA_T for a ZONE_CONTAINER
* The type is PCB_MODULE_ZONE_AREA_T for a MODULE_ZONE_CONTAINER
* The type is PCB_FP_ZONE_AREA_T for a MODULE_ZONE_CONTAINER
*/
ZONE_CONTAINER( BOARD_ITEM_CONTAINER* parent, bool aInModule = false );

View File

@ -48,7 +48,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
// *** all items in a same list (shown here) must be contiguous ****
PCB_MARKER_T, // in m_markers
PCB_TEXT_T, // in m_drawings
PCB_LINE_T, // in m_drawings
PCB_SHAPE_T, // in m_drawings
PCB_DIM_ALIGNED_T, // in m_drawings
PCB_DIM_CENTER_T, // in m_drawings
PCB_DIM_ORTHOGONAL_T, // in m_drawings
@ -58,7 +58,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
PCB_TRACE_T, // in m_tracks
PCB_ARC_T, // in m_tracks
PCB_PAD_T, // in modules
PCB_MODULE_TEXT_T, // in modules
PCB_FP_TEXT_T, // in modules
PCB_MODULE_T, // in m_modules
PCB_GROUP_T, // in m_groups
PCB_ZONE_AREA_T, // in m_zones
@ -69,7 +69,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
const KICAD_T GENERAL_COLLECTOR::BoardLevelItems[] = {
PCB_MARKER_T,
PCB_TEXT_T,
PCB_LINE_T,
PCB_SHAPE_T,
PCB_DIM_ALIGNED_T,
PCB_DIM_ORTHOGONAL_T,
PCB_DIM_CENTER_T,
@ -88,7 +88,7 @@ const KICAD_T GENERAL_COLLECTOR::BoardLevelItems[] = {
const KICAD_T GENERAL_COLLECTOR::AllButZones[] = {
PCB_MARKER_T,
PCB_TEXT_T,
PCB_LINE_T,
PCB_SHAPE_T,
PCB_DIM_ALIGNED_T,
PCB_DIM_ORTHOGONAL_T,
PCB_DIM_CENTER_T,
@ -98,7 +98,7 @@ const KICAD_T GENERAL_COLLECTOR::AllButZones[] = {
PCB_TRACE_T,
PCB_ARC_T,
PCB_PAD_T,
PCB_MODULE_TEXT_T,
PCB_FP_TEXT_T,
PCB_MODULE_T,
PCB_GROUP_T,
PCB_ZONE_AREA_T, // if it is visible on screen, it should be selectable
@ -130,20 +130,20 @@ const KICAD_T GENERAL_COLLECTOR::PadsOrTracks[] = {
const KICAD_T GENERAL_COLLECTOR::ModulesAndTheirItems[] = {
PCB_MODULE_T,
PCB_MODULE_TEXT_T,
PCB_MODULE_EDGE_T,
PCB_FP_TEXT_T,
PCB_FP_SHAPE_T,
PCB_PAD_T,
PCB_MODULE_ZONE_AREA_T,
PCB_FP_ZONE_AREA_T,
PCB_GROUP_T,
EOT
};
const KICAD_T GENERAL_COLLECTOR::ModuleItems[] = {
PCB_MODULE_TEXT_T,
PCB_MODULE_EDGE_T,
PCB_FP_TEXT_T,
PCB_FP_SHAPE_T,
PCB_PAD_T,
PCB_MODULE_ZONE_AREA_T,
PCB_FP_ZONE_AREA_T,
PCB_GROUP_T,
EOT
};
@ -169,7 +169,7 @@ const KICAD_T GENERAL_COLLECTOR::LockableItems[] = {
const KICAD_T GENERAL_COLLECTOR::Zones[] = {
PCB_ZONE_AREA_T,
PCB_MODULE_ZONE_AREA_T,
PCB_FP_ZONE_AREA_T,
EOT
};
@ -226,7 +226,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
breakhere++;
break;
case PCB_LINE_T:
case PCB_SHAPE_T:
breakhere++;
break;
@ -234,7 +234,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
breakhere++;
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
@ -303,7 +303,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
goto exit;
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
module = static_cast<MODULE*>( item->GetParent() );
// Fallthrough to get the zone as well
@ -316,7 +316,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
case PCB_TEXT_T:
break;
case PCB_LINE_T:
case PCB_SHAPE_T:
drawSegment = static_cast<DRAWSEGMENT*>( item );
break;
@ -329,7 +329,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
case PCB_TARGET_T:
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE *text = static_cast<TEXTE_MODULE*>( item );
if( m_Guide->IgnoreMTextsMarkedNoShow() && !text->IsVisible() )
@ -371,7 +371,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
}
break;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
drawSegment = static_cast<EDGE_MODULE*>( item );
break;
@ -393,7 +393,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
// common tests:
if( module ) // true from case PCB_PAD_T, PCB_MODULE_TEXT_T, or PCB_MODULE_T
if( module ) // true from case PCB_PAD_T, PCB_FP_TEXT_T, or PCB_MODULE_T
{
if( m_Guide->IgnoreModulesOnBack() && (module->GetLayer() == B_Cu) )
goto exit;

View File

@ -783,7 +783,7 @@ bool BuildBoardPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, wxStri
// Get all the DRAWSEGMENTS and module graphics into 'items',
// then keep only those on layer == Edge_Cuts.
static const KICAD_T scan_graphics[] = { PCB_LINE_T, PCB_MODULE_EDGE_T, EOT };
static const KICAD_T scan_graphics[] = { PCB_SHAPE_T, PCB_FP_SHAPE_T, EOT };
items.Collect( aBoard, scan_graphics );
// Make a working copy of aSegList, because the list is modified during calculations
@ -1004,7 +1004,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines,
// Get all the DRAWSEGMENTS and module graphics into 'items',
// then keep only those on layer == Edge_Cuts.
static const KICAD_T scan_graphics[] = { PCB_LINE_T, PCB_MODULE_EDGE_T, EOT };
static const KICAD_T scan_graphics[] = { PCB_SHAPE_T, PCB_FP_SHAPE_T, EOT };
items.Collect( aBoard, scan_graphics );
// Make a working copy of aSegList, because the list is modified during calculations

View File

@ -419,7 +419,7 @@ std::string FormatProbeItem( BOARD_ITEM* aItem )
TO_UTF8( pad ) );
}
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
module = static_cast<MODULE*>( aItem->GetParent() );

View File

@ -161,7 +161,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete()
LAYER_NUM layer = dwg->GetLayer();
if( delAll
|| ( type == PCB_LINE_T && delDrawings && masque_layer[layer] )
|| ( type == PCB_SHAPE_T && delDrawings && masque_layer[layer] )
|| ( type == PCB_TEXT_T && delTexts && del_text_layers[layer] ) )
{
commit.Remove( dwg );

View File

@ -375,7 +375,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
// Go through all other module items
for( BOARD_ITEM* boardItem : module->GraphicalItems() )
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
if( boardItem->Type() == PCB_FP_TEXT_T )
{
// We are guaranteed to always get an EDA_TEXT in this statement, but we must
// use the dynamic_cast to move through the type tree anyway.
@ -388,7 +388,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
else if( m_otherFields->GetValue() )
visitItem( commit, boardItem );
}
else if( boardItem->Type() == PCB_MODULE_EDGE_T )
else if( boardItem->Type() == PCB_FP_SHAPE_T )
{
if( m_footprintGraphics->GetValue() )
visitItem( commit, boardItem );
@ -404,7 +404,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
if( m_boardText->GetValue() )
visitItem( commit, boardItem );
}
else if( boardItem->Type() == PCB_LINE_T )
else if( boardItem->Type() == PCB_SHAPE_T )
{
if( m_boardGraphics->GetValue() )
visitItem( commit, boardItem );

View File

@ -2033,7 +2033,7 @@ void DIALOG_PAD_PROPERTIES::onAddPrimitive( wxCommandEvent& event )
if( type == -1 )
return;
STROKE_T listtype[] = { S_SEGMENT, S_ARC, S_CURVE, S_CIRCLE, S_POLYGON };
PCB_SHAPE_TYPE_T listtype[] = { S_SEGMENT, S_ARC, S_CURVE, S_CIRCLE, S_POLYGON };
DRAWSEGMENT* primitive = new DRAWSEGMENT();
primitive->SetShape( listtype[type] );

View File

@ -65,7 +65,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO
m_MultiLineText->SetScrollWidth( 1 );
m_MultiLineText->SetScrollWidthTracking( true );
if( m_item->Type() == PCB_MODULE_TEXT_T )
if( m_item->Type() == PCB_FP_TEXT_T )
{
title = _( "Footprint Text Properties" );
@ -248,7 +248,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
m_MultiLineText->SetSelection( -1, -1 );
}
if( m_item->Type() == PCB_MODULE_TEXT_T && m_modText )
if( m_item->Type() == PCB_FP_TEXT_T && m_modText )
{
MODULE* module = dynamic_cast<MODULE*>( m_modText->GetParent() );
wxString msg;

View File

@ -170,7 +170,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
n++;
}
else if( typeMask[ PCB_LINE_T ] && item->Type() == PCB_LINE_T )
else if( typeMask[ PCB_SHAPE_T ] && item->Type() == PCB_SHAPE_T )
{
if( !aFunc( item ) )
return n;
@ -210,7 +210,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
for( MODULE* mod : brd->Modules() )
{
if( typeMask[ PCB_MODULE_TEXT_T ] )
if( typeMask[ PCB_FP_TEXT_T ] )
{
if( (mod->Reference().GetLayerSet() & aLayers).any() )
{
@ -247,14 +247,14 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
{
if( (dwg->GetLayerSet() & aLayers).any() )
{
if( typeMask[ PCB_MODULE_TEXT_T ] && dwg->Type() == PCB_MODULE_TEXT_T )
if( typeMask[ PCB_FP_TEXT_T ] && dwg->Type() == PCB_FP_TEXT_T )
{
if( !aFunc( dwg ) )
return n;
n++;
}
else if( typeMask[ PCB_MODULE_EDGE_T ] && dwg->Type() == PCB_MODULE_EDGE_T )
else if( typeMask[ PCB_FP_SHAPE_T ] && dwg->Type() == PCB_FP_SHAPE_T )
{
if( !aFunc( dwg ) )
return n;
@ -268,7 +268,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
{
if( (zone->GetLayerSet() & aLayers).any() )
{
if( typeMask[ PCB_MODULE_ZONE_AREA_T ] && zone->Type() == PCB_MODULE_ZONE_AREA_T )
if( typeMask[ PCB_FP_ZONE_AREA_T ] && zone->Type() == PCB_FP_ZONE_AREA_T )
{
if( ! aFunc( zone ) )
return n;

View File

@ -176,9 +176,9 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperTextAndGraphics()
{
if( IsCopperLayer( item->GetLayer() ) )
{
if( item->Type() == PCB_MODULE_TEXT_T && ( (TEXTE_MODULE*) item )->IsVisible() )
if( item->Type() == PCB_FP_TEXT_T && ( (TEXTE_MODULE*) item )->IsVisible() )
testCopperDrawItem( item );
else if( item->Type() == PCB_MODULE_EDGE_T )
else if( item->Type() == PCB_FP_SHAPE_T )
testCopperDrawItem( item );
}
}
@ -254,7 +254,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperDrawItem( BOARD_ITEM* aItem )
continue;
// Graphic items are allowed to act as net-ties within their own footprint
if( aItem->Type() == PCB_MODULE_EDGE_T && pad->GetParent() == aItem->GetParent() )
if( aItem->Type() == PCB_FP_SHAPE_T && pad->GetParent() == aItem->GetParent() )
continue;
// Fast test to detect a pad candidate inside the text bounding box

View File

@ -110,7 +110,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
return true;
};
forEachGeometryItem( { PCB_LINE_T }, LSET( Edge_Cuts ), queryBoardOutlineItems );
forEachGeometryItem( { PCB_SHAPE_T }, LSET( Edge_Cuts ), queryBoardOutlineItems );
forEachGeometryItem( {}, LSET::AllCuMask(), queryBoardGeometryItems );
wxString val;

View File

@ -151,7 +151,7 @@ void DRC_TEST_PROVIDER_MISC::testTextVars()
return true;
};
forEachGeometryItem( { PCB_MODULE_TEXT_T, PCB_TEXT_T }, LSET::AllLayersMask(),
forEachGeometryItem( { PCB_FP_TEXT_T, PCB_TEXT_T }, LSET::AllLayersMask(),
checkUnresolvedTextVar );
KIGFX::WS_PROXY_VIEW_ITEM* worksheet = m_drcEngine->GetWorksheet();

View File

@ -156,16 +156,16 @@ bool test::DRC_TEST_PROVIDER_SILK_TO_MASK::Run()
};
int numPads = forEachGeometryItem( { PCB_PAD_T,
PCB_LINE_T,
PCB_MODULE_EDGE_T,
PCB_SHAPE_T,
PCB_FP_SHAPE_T,
PCB_TEXT_T,
PCB_MODULE_TEXT_T },
PCB_FP_TEXT_T },
LSET( 2, F_Mask, B_Mask ), addMaskToTree );
int numSilk = forEachGeometryItem( { PCB_LINE_T,
PCB_MODULE_EDGE_T,
int numSilk = forEachGeometryItem( { PCB_SHAPE_T,
PCB_FP_SHAPE_T,
PCB_TEXT_T,
PCB_MODULE_TEXT_T },
PCB_FP_TEXT_T },
LSET( 2, F_SilkS, B_SilkS ), addSilkToTree );
reportAux( _("Testing %d exposed copper against %d silkscreen features."), numPads, numSilk );

View File

@ -136,12 +136,12 @@ bool DRC_TEST_PROVIDER_SILK_TO_SILK::Run()
if ( isInvisibleText( aTestItem->parent ) )
return true;
if( typeRef == PCB_MODULE_EDGE_T || typeRef == PCB_MODULE_TEXT_T )
if( typeRef == PCB_FP_SHAPE_T || typeRef == PCB_FP_TEXT_T )
{
parentModRef = static_cast<MODULE*> ( aRefItem->parent->GetParent() );
}
if( typeTest == PCB_MODULE_EDGE_T || typeTest == PCB_MODULE_TEXT_T )
if( typeTest == PCB_FP_SHAPE_T || typeTest == PCB_FP_TEXT_T )
{
parentModTest = static_cast<MODULE*> ( aTestItem->parent->GetParent() );
}
@ -151,13 +151,13 @@ bool DRC_TEST_PROVIDER_SILK_TO_SILK::Run()
if( parentModRef && parentModRef == parentModTest )
{
if( typeRef == PCB_MODULE_EDGE_T && typeTest == PCB_MODULE_EDGE_T )
if( typeRef == PCB_FP_SHAPE_T && typeTest == PCB_FP_SHAPE_T )
return true;
}
if( !parentModRef && !parentModTest )
{
if( typeRef == PCB_LINE_T && typeTest == PCB_LINE_T )
if( typeRef == PCB_SHAPE_T && typeTest == PCB_SHAPE_T )
return true;
}
@ -187,7 +187,7 @@ bool DRC_TEST_PROVIDER_SILK_TO_SILK::Run()
return true;
};
int numSilk = forEachGeometryItem( { PCB_LINE_T, PCB_MODULE_EDGE_T, PCB_TEXT_T, PCB_MODULE_TEXT_T },
int numSilk = forEachGeometryItem( { PCB_SHAPE_T, PCB_FP_SHAPE_T, PCB_TEXT_T, PCB_FP_TEXT_T },
LSET( 2, F_SilkS, B_SilkS ), addToTree );
reportAux( _("Testing %d silkscreen features."), numSilk );

View File

@ -148,11 +148,11 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
ShowDimensionPropertyDialog( static_cast<DIMENSION*>( aItem ) );
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
InstallTextOptionsFrame( aItem );
break;
case PCB_LINE_T:
case PCB_SHAPE_T:
InstallGraphicItemPropertiesDialog( aItem );
break;

View File

@ -1088,7 +1088,7 @@ static void CreateBoardSection( FILE* aFile, BOARD* aPcb )
// Extract the board edges
for( BOARD_ITEM* drawing : aPcb->Drawings() )
{
if( drawing->Type() == PCB_LINE_T )
if( drawing->Type() == PCB_SHAPE_T )
{
DRAWSEGMENT* drawseg = static_cast<DRAWSEGMENT*>( drawing );
@ -1160,12 +1160,12 @@ static void FootprintWriteShape( FILE* aFile, MODULE* module, const wxString& aS
{
switch( PtStruct->Type() )
{
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
// If we wanted to export text, this is not the correct section
break;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
PtEdge = (EDGE_MODULE*) PtStruct;
if( PtEdge->GetLayer() == F_SilkS || PtEdge->GetLayer() == B_SilkS )
{

View File

@ -77,7 +77,7 @@ static void idf_export_outline( BOARD* aPcb, IDF3_BOARD& aIDFBoard )
// Retrieve segments and arcs from the board
for( auto item : aPcb->Drawings() )
{
if( item->Type() != PCB_LINE_T || item->GetLayer() != Edge_Cuts )
if( item->Type() != PCB_SHAPE_T || item->GetLayer() != Edge_Cuts )
continue;
graphic = (DRAWSEGMENT*) item;
@ -294,7 +294,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
// TODO: If module cutouts are supported we must add code here
// for( EDA_ITEM* item = aModule->GraphicalItems(); item != NULL; item = item->Next() )
// {
// if( ( item->Type() != PCB_MODULE_EDGE_T )
// if( ( item->Type() != PCB_FP_SHAPE_T )
// || (item->GetLayer() != Edge_Cuts ) ) continue;
// code to export cutouts
// }

View File

@ -809,7 +809,7 @@ static void export_vrml_drawings( MODEL_VRML& aModel, BOARD* pcb )
switch( drawing->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
export_vrml_drawsegment( aModel, (DRAWSEGMENT*) drawing );
break;
@ -1380,11 +1380,11 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb,
{
switch( item->Type() )
{
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
export_vrml_text_module( static_cast<TEXTE_MODULE*>( item ) );
break;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
export_vrml_edge_module( aModel, static_cast<EDGE_MODULE*>( item ), aModule );
break;

View File

@ -191,7 +191,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
{
switch( PtStruct->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
itemplotter.PlotDrawSegment( (DRAWSEGMENT*) PtStruct );
break;

View File

@ -298,9 +298,9 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
// Draw footprint other graphic items:
for( MODULE* footprint : fp_list )
{
for( auto item : footprint->GraphicalItems() )
for( BOARD_ITEM* item : footprint->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_EDGE_T && item->GetLayer() == Edge_Cuts )
if( item->Type() == PCB_FP_SHAPE_T && item->GetLayer() == Edge_Cuts )
brd_plotter.PlotFootprintGraphicItem((EDGE_MODULE*) item );
}
}

View File

@ -476,7 +476,7 @@ int PCB_EDIT_FRAME::inferLegacyEdgeClearance( BOARD* aBoard )
for( int i = 0; i < collector.GetCount(); i++ )
{
if( collector[i]->Type() == PCB_LINE_T )
if( collector[i]->Type() == PCB_SHAPE_T )
{
int itemWidth = static_cast<DRAWSEGMENT*>( collector[i] )->GetWidth();

View File

@ -520,7 +520,7 @@ const BOX2I FOOTPRINT_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible )
{
for( const BOARD_ITEM* item : module->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_TEXT_T )
if( item->Type() == PCB_FP_TEXT_T )
continue;
hasGraphicalItem = true;

View File

@ -371,15 +371,15 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
GetCanvas()->Refresh();
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
InstallTextOptionsFrame( aItem );
break;
case PCB_MODULE_EDGE_T :
case PCB_FP_SHAPE_T :
InstallGraphicItemPropertiesDialog( aItem );
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
{
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( aItem );
bool success = false;

View File

@ -1073,7 +1073,7 @@ MODULE* PCB_BASE_FRAME::CreateNewModule( const wxString& aModuleName )
module->RunOnChildren(
[&] ( BOARD_ITEM* aChild )
{
if( aChild->Type() == PCB_MODULE_TEXT_T )
if( aChild->Type() == PCB_FP_TEXT_T )
{
TEXTE_MODULE* textItem = static_cast<TEXTE_MODULE*>( aChild );
PCB_LAYER_ID layer = textItem->GetLayer();

View File

@ -88,7 +88,7 @@ bool GRAPHICS_CLEANER::isNullSegment( DRAWSEGMENT* aSegment )
default:
wxFAIL_MSG( "GRAPHICS_CLEANER::isNullSegment unsupported DRAWSEGMENT shape: "
+ STROKE_T_asString( aSegment->GetShape() ) );
+ PCB_SHAPE_TYPE_T_asString( aSegment->GetShape()) );
return false;
}
}
@ -127,7 +127,7 @@ bool GRAPHICS_CLEANER::areEquivalent( DRAWSEGMENT* aSegment1, DRAWSEGMENT* aSegm
default:
wxFAIL_MSG( "GRAPHICS_CLEANER::areEquivalent unsupported DRAWSEGMENT shape: "
+ STROKE_T_asString( aSegment1->GetShape() ) );
+ PCB_SHAPE_TYPE_T_asString( aSegment1->GetShape()) );
return false;
}
}

View File

@ -68,7 +68,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddLine( const VECTOR2D& aOrigin, const VECTOR2D&
line->SetStart( MapCoordinate( aOrigin ) );
line->SetEnd( MapCoordinate( aEnd ) );
if( line->Type() == PCB_MODULE_EDGE_T )
if( line->Type() == PCB_FP_SHAPE_T )
static_cast<EDGE_MODULE*>( line.get() )->SetLocalCoord();
addItem( std::move( line ) );
@ -84,7 +84,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddCircle( const VECTOR2D& aCenter, double aRadiu
circle->SetCenter( MapCoordinate( aCenter ) );
circle->SetArcStart( MapCoordinate( VECTOR2D( aCenter.x + aRadius, aCenter.y ) ) );
if( circle->Type() == PCB_MODULE_EDGE_T )
if( circle->Type() == PCB_FP_SHAPE_T )
static_cast<EDGE_MODULE*>( circle.get() )->SetLocalCoord();
addItem( std::move( circle ) );
@ -102,7 +102,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddArc( const VECTOR2D& aCenter, const VECTOR2D&
arc->SetArcStart( MapCoordinate( aStart ) );
arc->SetAngle( aAngle * 10.0 ); // Pcbnew uses the decidegree
if( arc->Type() == PCB_MODULE_EDGE_T )
if( arc->Type() == PCB_FP_SHAPE_T )
static_cast<EDGE_MODULE*>( arc.get() )->SetLocalCoord();
addItem( std::move( arc ) );
@ -122,7 +122,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddPolygon( const std::vector< VECTOR2D >& aVerti
polygon->SetLayer( GetLayer() );
polygon->SetPolyPoints( convertedPoints );
if( polygon->Type() == PCB_MODULE_EDGE_T )
if( polygon->Type() == PCB_FP_SHAPE_T )
static_cast<EDGE_MODULE*>( polygon.get() )->SetLocalCoord();
polygon->SetWidth( MapLineWidth( aWidth ) );
@ -147,7 +147,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddText( const VECTOR2D& aOrigin, const wxString&
textItem->SetHorizJustify( aHJustify );
textItem->SetText( aText );
if( boardItem->Type() == PCB_MODULE_TEXT_T )
if( boardItem->Type() == PCB_FP_TEXT_T )
static_cast<TEXTE_MODULE*>( boardItem.get() )->SetLocalCoord();
addItem( std::move( boardItem ) );
@ -167,7 +167,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddSpline( const VECTOR2D& aStart, const VECTOR2D
spline->SetEnd( MapCoordinate( aEnd ) );
spline->RebuildBezierToSegmentsPointsList( aWidth );
if( spline->Type() == PCB_MODULE_EDGE_T )
if( spline->Type() == PCB_FP_SHAPE_T )
static_cast<EDGE_MODULE*>( spline.get() )->SetLocalCoord();
addItem( std::move( spline ) );

View File

@ -148,13 +148,13 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( i );
BOARD_ITEM* copy = nullptr;
if( item->Type() == PCB_MODULE_EDGE_T )
if( item->Type() == PCB_FP_SHAPE_T )
{
// Convert to PCB_LINE_T
// Convert to PCB_SHAPE_T
copy = (BOARD_ITEM*) reinterpret_cast<DRAWSEGMENT*>( item )->Clone();
copy->SetLayer( item->GetLayer() );
}
else if( item->Type() == PCB_MODULE_TEXT_T )
else if( item->Type() == PCB_FP_TEXT_T )
{
// Convert to PCB_TEXT_T
MODULE* mod = static_cast<MODULE*>( item->GetParent() );
@ -183,7 +183,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE
mod->Add( pad );
copy = mod;
}
else if( item->Type() == PCB_MODULE_ZONE_AREA_T )
else if( item->Type() == PCB_FP_ZONE_AREA_T )
{
// Convert to PCB_ZONE_AREA_T
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board );

View File

@ -399,11 +399,11 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const
format( static_cast<DIMENSION*>( aItem ), aNestLevel );
break;
case PCB_LINE_T:
case PCB_SHAPE_T:
format( static_cast<DRAWSEGMENT*>( aItem ), aNestLevel );
break;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
format( static_cast<EDGE_MODULE*>( aItem ), aNestLevel );
break;
@ -423,7 +423,7 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const
format( static_cast<TEXTE_PCB*>( aItem ), aNestLevel );
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
format( static_cast<TEXTE_MODULE*>( aItem ), aNestLevel );
break;
@ -437,7 +437,7 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const
format( static_cast<TRACK*>( aItem ), aNestLevel );
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
case PCB_ZONE_AREA_T:
format( static_cast<ZONE_CONTAINER*>( aItem ), aNestLevel );
break;
@ -832,7 +832,7 @@ void PCB_IO::format( DRAWSEGMENT* aSegment, int aNestLevel ) const
default:
wxFAIL_MSG( "PCB_IO::format cannot format unknown DRAWSEGMENT shape:"
+ STROKE_T_asString( aSegment->GetShape() ) );
+ PCB_SHAPE_TYPE_T_asString( aSegment->GetShape()) );
return;
};
@ -917,7 +917,7 @@ void PCB_IO::format( EDGE_MODULE* aModuleDrawing, int aNestLevel ) const
default:
wxFAIL_MSG( "PCB_IO::format cannot format unknown EDGE_MODULE shape:"
+ STROKE_T_asString( aModuleDrawing->GetShape() ) );
+ PCB_SHAPE_TYPE_T_asString( aModuleDrawing->GetShape()) );
return;
};

View File

@ -1637,7 +1637,7 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
void LEGACY_PLUGIN::loadMODULE_EDGE( MODULE* aModule )
{
STROKE_T shape;
PCB_SHAPE_TYPE_T shape;
char* line = m_reader->Line(); // obtain current (old) line
switch( line[1] )
@ -1942,7 +1942,7 @@ void LEGACY_PLUGIN::loadPCB_LINE()
if( width < 0 )
width = 0;
dseg->SetShape( STROKE_T( shape ) );
dseg->SetShape( PCB_SHAPE_TYPE_T( shape ) );
dseg->SetWidth( width );
dseg->SetStart( wxPoint( start_x, start_y ) );
dseg->SetEnd( wxPoint( end_x, end_y ) );

View File

@ -342,7 +342,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
color.a *= m_viaOpacity;
else if( item->Type() == PCB_PAD_T )
color.a *= m_padOpacity;
else if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T )
else if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T )
color.a *= m_zoneOpacity;
// No special modificators enabled
@ -412,8 +412,8 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
draw( static_cast<const D_PAD*>( item ), aLayer );
break;
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
draw( static_cast<const DRAWSEGMENT*>( item ), aLayer );
break;
@ -421,7 +421,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
draw( static_cast<const TEXTE_PCB*>( item ), aLayer );
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
draw( static_cast<const TEXTE_MODULE*>( item ), aLayer );
break;
@ -437,7 +437,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
draw( static_cast<const ZONE_CONTAINER*>( item ), aLayer );
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
draw( static_cast<const ZONE_CONTAINER*>( item ), aLayer );
break;

View File

@ -782,7 +782,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
{
itemplotter.PlotFootprintTextItems( module );
if( item->Type() == PCB_MODULE_EDGE_T && item->GetLayer() == layer )
if( item->Type() == PCB_FP_SHAPE_T && item->GetLayer() == layer )
itemplotter.PlotFootprintGraphicItem((EDGE_MODULE*) item );
}
}

View File

@ -330,17 +330,16 @@ void BRDITEMS_PLOTTER::PlotBoardGraphicItems()
{
switch( item->Type() )
{
case PCB_LINE_T: PlotDrawSegment( (DRAWSEGMENT*) item); break;
case PCB_SHAPE_T: PlotDrawSegment( (DRAWSEGMENT*) item); break;
case PCB_TEXT_T: PlotTextePcb( (TEXTE_PCB*) item ); break;
case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T:
PlotDimension( (DIMENSION*) item );
break;
case PCB_DIM_LEADER_T: PlotDimension( (DIMENSION*) item ); break;
case PCB_TARGET_T: PlotPcbTarget( (PCB_TARGET*) item ); break;
default: break;
}
}
@ -504,7 +503,7 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItems( MODULE* aModule )
//* Plot a graphic item (outline) relative to a footprint
void BRDITEMS_PLOTTER::PlotFootprintGraphicItem( EDGE_MODULE* aEdge )
{
if( aEdge->Type() != PCB_MODULE_EDGE_T )
if( aEdge->Type() != PCB_FP_SHAPE_T )
return;
m_plotter->SetColor( getColor( aEdge->GetLayer() ) );

View File

@ -149,181 +149,97 @@ PCB_LAYER_ID ALTIUM_PCB::GetKicadLayer( ALTIUM_LAYER aAltiumLayer ) const
switch( aAltiumLayer )
{
case ALTIUM_LAYER::UNKNOWN:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::UNKNOWN: return UNDEFINED_LAYER;
case ALTIUM_LAYER::TOP_LAYER:
return F_Cu;
case ALTIUM_LAYER::MID_LAYER_1:
return In1_Cu; // TODO: stackup same as in KiCad?
case ALTIUM_LAYER::MID_LAYER_2:
return In2_Cu;
case ALTIUM_LAYER::MID_LAYER_3:
return In3_Cu;
case ALTIUM_LAYER::MID_LAYER_4:
return In4_Cu;
case ALTIUM_LAYER::MID_LAYER_5:
return In5_Cu;
case ALTIUM_LAYER::MID_LAYER_6:
return In6_Cu;
case ALTIUM_LAYER::MID_LAYER_7:
return In7_Cu;
case ALTIUM_LAYER::MID_LAYER_8:
return In8_Cu;
case ALTIUM_LAYER::MID_LAYER_9:
return In9_Cu;
case ALTIUM_LAYER::MID_LAYER_10:
return In10_Cu;
case ALTIUM_LAYER::MID_LAYER_11:
return In11_Cu;
case ALTIUM_LAYER::MID_LAYER_12:
return In12_Cu;
case ALTIUM_LAYER::MID_LAYER_13:
return In13_Cu;
case ALTIUM_LAYER::MID_LAYER_14:
return In14_Cu;
case ALTIUM_LAYER::MID_LAYER_15:
return In15_Cu;
case ALTIUM_LAYER::MID_LAYER_16:
return In16_Cu;
case ALTIUM_LAYER::MID_LAYER_17:
return In17_Cu;
case ALTIUM_LAYER::MID_LAYER_18:
return In18_Cu;
case ALTIUM_LAYER::MID_LAYER_19:
return In19_Cu;
case ALTIUM_LAYER::MID_LAYER_20:
return In20_Cu;
case ALTIUM_LAYER::MID_LAYER_21:
return In21_Cu;
case ALTIUM_LAYER::MID_LAYER_22:
return In22_Cu;
case ALTIUM_LAYER::MID_LAYER_23:
return In23_Cu;
case ALTIUM_LAYER::MID_LAYER_24:
return In24_Cu;
case ALTIUM_LAYER::MID_LAYER_25:
return In25_Cu;
case ALTIUM_LAYER::MID_LAYER_26:
return In26_Cu;
case ALTIUM_LAYER::MID_LAYER_27:
return In27_Cu;
case ALTIUM_LAYER::MID_LAYER_28:
return In28_Cu;
case ALTIUM_LAYER::MID_LAYER_29:
return In29_Cu;
case ALTIUM_LAYER::MID_LAYER_30:
return In30_Cu;
case ALTIUM_LAYER::BOTTOM_LAYER:
return B_Cu;
case ALTIUM_LAYER::TOP_LAYER: return F_Cu;
case ALTIUM_LAYER::MID_LAYER_1: return In1_Cu; // TODO: stackup same as in KiCad?
case ALTIUM_LAYER::MID_LAYER_2: return In2_Cu;
case ALTIUM_LAYER::MID_LAYER_3: return In3_Cu;
case ALTIUM_LAYER::MID_LAYER_4: return In4_Cu;
case ALTIUM_LAYER::MID_LAYER_5: return In5_Cu;
case ALTIUM_LAYER::MID_LAYER_6: return In6_Cu;
case ALTIUM_LAYER::MID_LAYER_7: return In7_Cu;
case ALTIUM_LAYER::MID_LAYER_8: return In8_Cu;
case ALTIUM_LAYER::MID_LAYER_9: return In9_Cu;
case ALTIUM_LAYER::MID_LAYER_10: return In10_Cu;
case ALTIUM_LAYER::MID_LAYER_11: return In11_Cu;
case ALTIUM_LAYER::MID_LAYER_12: return In12_Cu;
case ALTIUM_LAYER::MID_LAYER_13: return In13_Cu;
case ALTIUM_LAYER::MID_LAYER_14: return In14_Cu;
case ALTIUM_LAYER::MID_LAYER_15: return In15_Cu;
case ALTIUM_LAYER::MID_LAYER_16: return In16_Cu;
case ALTIUM_LAYER::MID_LAYER_17: return In17_Cu;
case ALTIUM_LAYER::MID_LAYER_18: return In18_Cu;
case ALTIUM_LAYER::MID_LAYER_19: return In19_Cu;
case ALTIUM_LAYER::MID_LAYER_20: return In20_Cu;
case ALTIUM_LAYER::MID_LAYER_21: return In21_Cu;
case ALTIUM_LAYER::MID_LAYER_22: return In22_Cu;
case ALTIUM_LAYER::MID_LAYER_23: return In23_Cu;
case ALTIUM_LAYER::MID_LAYER_24: return In24_Cu;
case ALTIUM_LAYER::MID_LAYER_25: return In25_Cu;
case ALTIUM_LAYER::MID_LAYER_26: return In26_Cu;
case ALTIUM_LAYER::MID_LAYER_27: return In27_Cu;
case ALTIUM_LAYER::MID_LAYER_28: return In28_Cu;
case ALTIUM_LAYER::MID_LAYER_29: return In29_Cu;
case ALTIUM_LAYER::MID_LAYER_30: return In30_Cu;
case ALTIUM_LAYER::BOTTOM_LAYER: return B_Cu;
case ALTIUM_LAYER::TOP_OVERLAY:
return F_SilkS;
case ALTIUM_LAYER::BOTTOM_OVERLAY:
return B_SilkS;
case ALTIUM_LAYER::TOP_PASTE:
return F_Paste;
case ALTIUM_LAYER::BOTTOM_PASTE:
return B_Paste;
case ALTIUM_LAYER::TOP_SOLDER:
return F_Mask;
case ALTIUM_LAYER::BOTTOM_SOLDER:
return B_Mask;
case ALTIUM_LAYER::TOP_OVERLAY: return F_SilkS;
case ALTIUM_LAYER::BOTTOM_OVERLAY: return B_SilkS;
case ALTIUM_LAYER::TOP_PASTE: return F_Paste;
case ALTIUM_LAYER::BOTTOM_PASTE: return B_Paste;
case ALTIUM_LAYER::TOP_SOLDER: return F_Mask;
case ALTIUM_LAYER::BOTTOM_SOLDER: return B_Mask;
case ALTIUM_LAYER::INTERNAL_PLANE_1:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_2:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_3:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_4:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_5:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_6:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_7:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_8:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_9:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_10:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_11:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_12:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_13:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_14:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_15:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_16:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_1: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_2: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_3: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_4: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_5: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_6: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_7: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_8: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_9: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_10: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_11: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_12: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_13: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_14: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_15: return UNDEFINED_LAYER;
case ALTIUM_LAYER::INTERNAL_PLANE_16: return UNDEFINED_LAYER;
case ALTIUM_LAYER::DRILL_GUIDE:
return Dwgs_User;
case ALTIUM_LAYER::KEEP_OUT_LAYER:
return Margin;
case ALTIUM_LAYER::DRILL_GUIDE: return Dwgs_User;
case ALTIUM_LAYER::KEEP_OUT_LAYER: return Margin;
case ALTIUM_LAYER::MECHANICAL_1:
return Dwgs_User; //Edge_Cuts;
case ALTIUM_LAYER::MECHANICAL_2:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_3:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_4:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_5:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_6:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_7:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_8:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_9:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_10:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_11:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_12:
return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_13:
return F_Fab;
case ALTIUM_LAYER::MECHANICAL_14:
return B_Fab;
case ALTIUM_LAYER::MECHANICAL_15:
return F_CrtYd;
case ALTIUM_LAYER::MECHANICAL_16:
return B_CrtYd;
case ALTIUM_LAYER::MECHANICAL_1: return Dwgs_User; //Edge_Cuts;
case ALTIUM_LAYER::MECHANICAL_2: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_3: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_4: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_5: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_6: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_7: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_8: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_9: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_10: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_11: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_12: return Dwgs_User;
case ALTIUM_LAYER::MECHANICAL_13: return F_Fab;
case ALTIUM_LAYER::MECHANICAL_14: return B_Fab;
case ALTIUM_LAYER::MECHANICAL_15: return F_CrtYd;
case ALTIUM_LAYER::MECHANICAL_16: return B_CrtYd;
case ALTIUM_LAYER::DRILL_DRAWING:
return Dwgs_User;
case ALTIUM_LAYER::MULTI_LAYER:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::CONNECTIONS:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::BACKGROUND:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::DRC_ERROR_MARKERS:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::SELECTIONS:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::VISIBLE_GRID_1:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::VISIBLE_GRID_2:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::PAD_HOLES:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::VIA_HOLES:
return UNDEFINED_LAYER;
case ALTIUM_LAYER::DRILL_DRAWING: return Dwgs_User;
case ALTIUM_LAYER::MULTI_LAYER: return UNDEFINED_LAYER;
case ALTIUM_LAYER::CONNECTIONS: return UNDEFINED_LAYER;
case ALTIUM_LAYER::BACKGROUND: return UNDEFINED_LAYER;
case ALTIUM_LAYER::DRC_ERROR_MARKERS: return UNDEFINED_LAYER;
case ALTIUM_LAYER::SELECTIONS: return UNDEFINED_LAYER;
case ALTIUM_LAYER::VISIBLE_GRID_1: return UNDEFINED_LAYER;
case ALTIUM_LAYER::VISIBLE_GRID_2: return UNDEFINED_LAYER;
case ALTIUM_LAYER::PAD_HOLES: return UNDEFINED_LAYER;
case ALTIUM_LAYER::VIA_HOLES: return UNDEFINED_LAYER;
default:
return UNDEFINED_LAYER;
default: return UNDEFINED_LAYER;
}
}
@ -693,13 +609,13 @@ void ALTIUM_PCB::HelperCreateBoardOutline( const std::vector<ALTIUM_VERTICE>& aV
if( !last->isRound && !cur->isRound )
{
ds->SetShape( STROKE_T::S_SEGMENT );
ds->SetShape( S_SEGMENT );
ds->SetStart( last->position );
ds->SetEnd( cur->position );
}
else if( cur->isRound )
{
ds->SetShape( STROKE_T::S_ARC );
ds->SetShape( S_ARC );
ds->SetAngle( -NormalizeAngleDegreesPos( cur->endangle - cur->startangle ) * 10. );
double startradiant = DEG2RAD( cur->startangle );
@ -717,7 +633,7 @@ void ALTIUM_PCB::HelperCreateBoardOutline( const std::vector<ALTIUM_VERTICE>& aV
wxPoint arcEnd = cur->center + arcEndOffset;
DRAWSEGMENT* ds2 = new DRAWSEGMENT( m_board );
ds2->SetShape( STROKE_T::S_SEGMENT );
ds2->SetShape( S_SEGMENT );
m_board->Add( ds2, ADD_MODE::APPEND );
ds2->SetWidth( m_board->GetDesignSettings().GetLineThickness( Edge_Cuts ) );
ds2->SetLayer( Edge_Cuts );
@ -997,7 +913,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem )
{
DRAWSEGMENT* ds = new DRAWSEGMENT( m_board );
m_board->Add( ds, ADD_MODE::APPEND );
ds->SetShape( STROKE_T::S_SEGMENT );
ds->SetShape( S_SEGMENT );
ds->SetLayer( klayer );
ds->SetWidth( aElem.linewidth );
ds->SetStart( last );
@ -1018,7 +934,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem )
DRAWSEGMENT* ds1 = new DRAWSEGMENT( m_board );
m_board->Add( ds1, ADD_MODE::APPEND );
ds1->SetShape( STROKE_T::S_SEGMENT );
ds1->SetShape( S_SEGMENT );
ds1->SetLayer( klayer );
ds1->SetWidth( aElem.linewidth );
ds1->SetStart( referencePoint0 );
@ -1028,7 +944,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem )
DRAWSEGMENT* ds2 = new DRAWSEGMENT( m_board );
m_board->Add( ds2, ADD_MODE::APPEND );
ds2->SetShape( STROKE_T::S_SEGMENT );
ds2->SetShape( S_SEGMENT );
ds2->SetLayer( klayer );
ds2->SetWidth( aElem.linewidth );
ds2->SetStart( referencePoint0 );
@ -1069,7 +985,7 @@ void ALTIUM_PCB::HelperParseDimensions6Datum( const ADIMENSION6& aElem )
{
DRAWSEGMENT* ds1 = new DRAWSEGMENT( m_board );
m_board->Add( ds1, ADD_MODE::APPEND );
ds1->SetShape( STROKE_T::S_SEGMENT );
ds1->SetShape( S_SEGMENT );
ds1->SetLayer( klayer );
ds1->SetWidth( aElem.linewidth );
ds1->SetStart( aElem.referencePoint.at( i ) );
@ -1090,7 +1006,7 @@ void ALTIUM_PCB::HelperParseDimensions6Center( const ADIMENSION6& aElem )
DRAWSEGMENT* ds1 = new DRAWSEGMENT( m_board );
m_board->Add( ds1, ADD_MODE::APPEND );
ds1->SetShape( STROKE_T::S_SEGMENT );
ds1->SetShape( S_SEGMENT );
ds1->SetLayer( klayer );
ds1->SetWidth( aElem.linewidth );
@ -1101,7 +1017,7 @@ void ALTIUM_PCB::HelperParseDimensions6Center( const ADIMENSION6& aElem )
DRAWSEGMENT* ds2 = new DRAWSEGMENT( m_board );
m_board->Add( ds2, ADD_MODE::APPEND );
ds2->SetShape( STROKE_T::S_SEGMENT );
ds2->SetShape( S_SEGMENT );
ds2->SetLayer( klayer );
ds2->SetWidth( aElem.linewidth );
@ -1475,7 +1391,7 @@ void ALTIUM_PCB::ParseShapeBasedRegions6Data(
DRAWSEGMENT* ds = new DRAWSEGMENT( m_board );
m_board->Add( ds, ADD_MODE::APPEND );
ds->SetShape( STROKE_T::S_POLYGON );
ds->SetShape( S_POLYGON );
ds->SetLayer( klayer );
ds->SetWidth( 0 );
@ -1595,12 +1511,12 @@ void ALTIUM_PCB::ParseArcs6Data(
ds.SetCenter( elem.center );
if( elem.startangle == 0. && elem.endangle == 360. )
{ // TODO: other variants to define circle?
ds.SetShape( STROKE_T::S_CIRCLE );
ds.SetShape( S_CIRCLE );
ds.SetArcStart( elem.center - wxPoint( 0, elem.radius ) );
}
else
{
ds.SetShape( STROKE_T::S_ARC );
ds.SetShape( S_ARC );
ds.SetAngle( -NormalizeAngleDegreesPos( elem.endangle - elem.startangle ) * 10. );
double startradiant = DEG2RAD( elem.startangle );
@ -1653,12 +1569,12 @@ void ALTIUM_PCB::ParseArcs6Data(
if( elem.startangle == 0. && elem.endangle == 360. )
{ // TODO: other variants to define circle?
ds->SetShape( STROKE_T::S_CIRCLE );
ds->SetShape( S_CIRCLE );
ds->SetArcStart( elem.center - wxPoint( 0, elem.radius ) );
}
else
{
ds->SetShape( STROKE_T::S_ARC );
ds->SetShape( S_ARC );
ds->SetAngle( -NormalizeAngleDegreesPos( elem.endangle - elem.startangle ) * 10. );
double startradiant = DEG2RAD( elem.startangle );
@ -1926,7 +1842,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem )
{
// filled rect
DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( aElem.component );
ds->SetShape( STROKE_T::S_POLYGON );
ds->SetShape( S_POLYGON );
ds->SetLayer( klayer );
ds->SetWidth( 0 );
@ -1965,13 +1881,13 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem )
wxPoint p22 = aElem.position + wxPoint( -offsetX, -offsetY );
wxPoint p21 = aElem.position + wxPoint( -offsetX, offsetY );
ds->SetShape( STROKE_T::S_POLYGON );
ds->SetShape( S_POLYGON );
ds->SetPolyPoints( { p11, p12, p22, p21 } );
}
else if( aElem.topsize.x == aElem.topsize.y )
{
// circle
ds->SetShape( STROKE_T::S_CIRCLE );
ds->SetShape( S_CIRCLE );
ds->SetCenter( aElem.position );
ds->SetWidth( aElem.topsize.x / 2 );
ds->SetArcStart( aElem.position - wxPoint( 0, aElem.topsize.x / 4 ) );
@ -1979,7 +1895,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem )
else if( aElem.topsize.x < aElem.topsize.y )
{
// short vertical line
ds->SetShape( STROKE_T::S_SEGMENT );
ds->SetShape( S_SEGMENT );
wxPoint pointOffset( 0, ( aElem.topsize.y - aElem.topsize.x ) / 2 );
ds->SetStart( aElem.position + pointOffset );
ds->SetEnd( aElem.position - pointOffset );
@ -1987,7 +1903,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem )
else
{
// short horizontal line
ds->SetShape( STROKE_T::S_SEGMENT );
ds->SetShape( S_SEGMENT );
wxPoint pointOffset( ( aElem.topsize.x - aElem.topsize.y ) / 2, 0 );
ds->SetStart( aElem.position + pointOffset );
ds->SetEnd( aElem.position - pointOffset );
@ -2004,7 +1920,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem )
{
// filled circle
DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( aElem.component );
ds->SetShape( STROKE_T::S_CIRCLE );
ds->SetShape( S_CIRCLE );
ds->SetLayer( klayer );
ds->SetCenter( aElem.position );
ds->SetWidth( aElem.topsize.x / 2 );
@ -2015,7 +1931,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem )
{
// short line
DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( aElem.component );
ds->SetShape( STROKE_T::S_SEGMENT );
ds->SetShape( S_SEGMENT );
ds->SetLayer( klayer );
ds->SetWidth( std::min( aElem.topsize.x, aElem.topsize.y ) );
if( aElem.topsize.x < aElem.topsize.y )
@ -2041,7 +1957,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem )
{
// filled octagon
DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( aElem.component );
ds->SetShape( STROKE_T::S_POLYGON );
ds->SetShape( S_POLYGON );
ds->SetLayer( klayer );
ds->SetWidth( 0 );
@ -2160,7 +2076,7 @@ void ALTIUM_PCB::ParseTracks6Data(
if( elem.is_keepout || IsAltiumLayerAPlane( elem.layer ) )
{
DRAWSEGMENT ds( nullptr ); // just a helper to get the graphic
ds.SetShape( STROKE_T::S_SEGMENT );
ds.SetShape( S_SEGMENT );
ds.SetStart( elem.start );
ds.SetEnd( elem.end );
ds.SetWidth( elem.width );
@ -2197,7 +2113,7 @@ void ALTIUM_PCB::ParseTracks6Data(
else
{
DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( elem.component );
ds->SetShape( STROKE_T::S_SEGMENT );
ds->SetShape( S_SEGMENT );
ds->SetStart( elem.start );
ds->SetEnd( elem.end );
ds->SetWidth( elem.width );
@ -2455,7 +2371,7 @@ void ALTIUM_PCB::ParseFills6Data(
DRAWSEGMENT* ds = new DRAWSEGMENT( m_board );
m_board->Add( ds, ADD_MODE::APPEND );
ds->SetShape( STROKE_T::S_POLYGON );
ds->SetShape( S_POLYGON );
ds->SetLayer( klayer );
ds->SetWidth( 0 );

View File

@ -1703,11 +1703,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarShape( const SHAPE& aCadstarShape,
DRAWSEGMENT* ds;
if( isModule( aContainer ) )
ds = new EDGE_MODULE( (MODULE*) aContainer, STROKE_T::S_POLYGON );
ds = new EDGE_MODULE( (MODULE*) aContainer, S_POLYGON );
else
{
ds = new DRAWSEGMENT( aContainer );
ds->SetShape( STROKE_T::S_POLYGON );
ds->SetShape( S_POLYGON );
}
ds->SetPolyShape( getPolySetFromCadstarShape( aCadstarShape, -1, aContainer, aMoveVector,
@ -1812,12 +1812,12 @@ DRAWSEGMENT* CADSTAR_PCB_ARCHIVE_LOADER::getDrawSegmentFromVertex( const POINT&
if( isModule( aContainer ) )
{
ds = new EDGE_MODULE( static_cast<MODULE*>( aContainer ), STROKE_T::S_SEGMENT );
ds = new EDGE_MODULE( static_cast<MODULE*>( aContainer ), S_SEGMENT );
}
else
{
ds = new DRAWSEGMENT( aContainer );
ds->SetShape( STROKE_T::S_SEGMENT );
ds->SetShape( S_SEGMENT );
}
ds->SetStart( startPoint );
@ -1834,12 +1834,12 @@ DRAWSEGMENT* CADSTAR_PCB_ARCHIVE_LOADER::getDrawSegmentFromVertex( const POINT&
if( isModule( aContainer ) )
{
ds = new EDGE_MODULE( (MODULE*) aContainer, STROKE_T::S_ARC );
ds = new EDGE_MODULE( (MODULE*) aContainer, S_ARC );
}
else
{
ds = new DRAWSEGMENT( aContainer );
ds->SetShape( STROKE_T::S_ARC );
ds->SetShape( S_ARC );
}
ds->SetArcStart( startPoint );
@ -1981,7 +1981,7 @@ SHAPE_LINE_CHAIN CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromDrawsegments(
{
switch( ds->GetShape() )
{
case STROKE_T::S_ARC:
case S_ARC:
{
if( ds->GetClass() == wxT( "MGRAPHIC" ) )
{
@ -1996,7 +1996,7 @@ SHAPE_LINE_CHAIN CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromDrawsegments(
}
}
break;
case STROKE_T::S_SEGMENT:
case S_SEGMENT:
if( ds->GetClass() == wxT( "MGRAPHIC" ) )
{
EDGE_MODULE* em = (EDGE_MODULE*) ds;
@ -2024,8 +2024,10 @@ SHAPE_LINE_CHAIN CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromDrawsegments(
std::vector<TRACK*> CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromDrawsegments(
const std::vector<DRAWSEGMENT*> aDrawsegments, BOARD_ITEM_CONTAINER* aParentContainer,
NETINFO_ITEM* aNet, const PCB_LAYER_ID& aLayerOverride, int aWidthOverride )
const std::vector<DRAWSEGMENT*> aDrawsegments,
BOARD_ITEM_CONTAINER* aParentContainer,
NETINFO_ITEM* aNet, PCB_LAYER_ID aLayerOverride,
int aWidthOverride )
{
std::vector<TRACK*> tracks;
@ -2035,7 +2037,7 @@ std::vector<TRACK*> CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromDrawsegments(
switch( ds->GetShape() )
{
case STROKE_T::S_ARC:
case S_ARC:
if( ds->GetClass() == wxT( "MGRAPHIC" ) )
{
EDGE_MODULE* em = (EDGE_MODULE*) ds;
@ -2048,7 +2050,7 @@ std::vector<TRACK*> CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromDrawsegments(
track = new ARC( aParentContainer, &arc );
}
break;
case STROKE_T::S_SEGMENT:
case S_SEGMENT:
if( ds->GetClass() == wxT( "MGRAPHIC" ) )
{
EDGE_MODULE* em = (EDGE_MODULE*) ds;

View File

@ -307,8 +307,7 @@ private:
*/
std::vector<TRACK*> makeTracksFromDrawsegments( const std::vector<DRAWSEGMENT*> aDrawsegments,
BOARD_ITEM_CONTAINER* aParentContainer, NETINFO_ITEM* aNet = nullptr,
const PCB_LAYER_ID& aLayerOverride = PCB_LAYER_ID::UNDEFINED_LAYER,
int aWidthOverride = -1 );
PCB_LAYER_ID aLayerOverride = PCB_LAYER_ID::UNDEFINED_LAYER, int aWidthOverride = -1 );
/**
* @brief Adds a CADSTAR Attribute to a KiCad module

View File

@ -983,9 +983,9 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld )
return;
}
for( auto gitem : m_board->Drawings() )
for( BOARD_ITEM* gitem : m_board->Drawings() )
{
if ( gitem->Type() == PCB_LINE_T )
if ( gitem->Type() == PCB_SHAPE_T )
{
syncGraphicalItem( aWorld, static_cast<DRAWSEGMENT*>( gitem ) );
}
@ -995,12 +995,12 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld )
}
}
for( auto zone : m_board->Zones() )
for( ZONE_CONTAINER* zone : m_board->Zones() )
{
syncZone( aWorld, zone );
}
for( auto module : m_board->Modules() )
for( MODULE* module : m_board->Modules() )
{
for( auto pad : module->Pads() )
{
@ -1019,20 +1019,20 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld )
if( module->IsNetTie() )
continue;
for( auto mgitem : module->GraphicalItems() )
for( BOARD_ITEM* mgitem : module->GraphicalItems() )
{
if( mgitem->Type() == PCB_MODULE_EDGE_T )
if( mgitem->Type() == PCB_FP_SHAPE_T )
{
syncGraphicalItem( aWorld, static_cast<DRAWSEGMENT*>( mgitem ) );
}
else if( mgitem->Type() == PCB_MODULE_TEXT_T )
else if( mgitem->Type() == PCB_FP_TEXT_T )
{
syncTextItem( aWorld, static_cast<TEXTE_MODULE*>( mgitem ), mgitem->GetLayer() );
}
}
}
for( auto t : m_board->Tracks() )
for( TRACK* t : m_board->Tracks() )
{
KICAD_T type = t->Type();

View File

@ -1443,7 +1443,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
{
previewItem = static_cast<BOARD_ITEM*>( drawing->Clone() );
if( drawing->Type() == PCB_MODULE_EDGE_T )
if( drawing->Type() == PCB_FP_SHAPE_T )
{
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( previewItem );
edge->DRAWSEGMENT::Move( (wxPoint) offset );

View File

@ -696,7 +696,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
}
#if 1 // enable image (outline) scopes.
static const KICAD_T scanEDGEs[] = { PCB_MODULE_EDGE_T, EOT };
static const KICAD_T scanEDGEs[] = { PCB_FP_SHAPE_T, EOT };
// get all the MODULE's EDGE_MODULEs and convert those to DSN outlines.
moduleItems.Collect( aModule, scanEDGEs );

View File

@ -69,7 +69,7 @@ bool CONVERT_TOOL::Init()
m_menu->SetTitle( _( "Convert..." ) );
static KICAD_T convertableTracks[] = { PCB_TRACE_T, PCB_ARC_T, EOT };
static KICAD_T convertableZones[] = { PCB_ZONE_AREA_T, PCB_MODULE_ZONE_AREA_T, EOT };
static KICAD_T convertableZones[] = { PCB_ZONE_AREA_T, PCB_FP_ZONE_AREA_T, EOT };
auto graphicLines = P_S_C::OnlyGraphicShapeTypes( { S_SEGMENT, S_RECT } ) && P_S_C::SameLayer();
@ -122,8 +122,8 @@ int CONVERT_TOOL::LinesToPoly( const TOOL_EVENT& aEvent )
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
switch( static_cast<DRAWSEGMENT*>( item )->GetShape() )
{
case S_SEGMENT:
@ -327,7 +327,7 @@ SHAPE_POLY_SET CONVERT_TOOL::makePolysFromRects( const std::deque<EDA_ITEM*>& aI
for( EDA_ITEM* item : aItems )
{
if( item->Type() != PCB_LINE_T && item->Type() != PCB_MODULE_EDGE_T )
if( item->Type() != PCB_SHAPE_T && item->Type() != PCB_FP_SHAPE_T )
continue;
DRAWSEGMENT* graphic = static_cast<DRAWSEGMENT*>( item );
@ -366,8 +366,8 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent )
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
switch( static_cast<DRAWSEGMENT*>( item )->GetShape() )
{
case S_POLYGON:
@ -383,7 +383,7 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent )
break;
case PCB_ZONE_AREA_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
break;
default:
@ -403,12 +403,12 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent )
switch( aItem->Type() )
{
case PCB_ZONE_AREA_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
set = *static_cast<ZONE_CONTAINER*>( aItem )->Outline();
break;
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
{
DRAWSEGMENT* graphic = static_cast<DRAWSEGMENT*>( aItem );
@ -524,9 +524,9 @@ int CONVERT_TOOL::SegmentToArc( const TOOL_EVENT& aEvent )
{
BOARD_ITEM* item = aCollector[i];
if( !( item->Type() == PCB_LINE_T ||
if( !( item->Type() == PCB_SHAPE_T ||
item->Type() == PCB_TRACE_T ||
item->Type() == PCB_MODULE_EDGE_T ) )
item->Type() == PCB_FP_SHAPE_T ) )
aCollector.Remove( item );
}
} );
@ -561,7 +561,7 @@ int CONVERT_TOOL::SegmentToArc( const TOOL_EVENT& aEvent )
BOARD_COMMIT commit( m_frame );
if( source->Type() == PCB_LINE_T || source->Type() == PCB_MODULE_EDGE_T )
if( source->Type() == PCB_SHAPE_T || source->Type() == PCB_FP_SHAPE_T )
{
DRAWSEGMENT* line = static_cast<DRAWSEGMENT*>( source );
DRAWSEGMENT* arc = new DRAWSEGMENT( parent );
@ -604,8 +604,8 @@ OPT<SEG> CONVERT_TOOL::getStartEndPoints( EDA_ITEM* aItem )
{
switch( aItem->Type() )
{
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
{
DRAWSEGMENT* line = static_cast<DRAWSEGMENT*>( aItem );
return boost::make_optional<SEG>( { VECTOR2I( line->GetStart() ),

View File

@ -942,7 +942,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
if( !m_frame->GetModel() )
return 0;
// Note: PlaceImportedGraphics() will convert PCB_LINE_T and PCB_TEXT_T to module graphic
// Note: PlaceImportedGraphics() will convert PCB_SHAPE_T and PCB_TEXT_T to footprint
// items if needed
DIALOG_IMPORT_GFX dlg( m_frame, m_editModules );
int dlgResult = dlg.ShowModal();
@ -975,9 +975,9 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
EDA_ITEM* item = ptr.get();
if( m_editModules )
wxASSERT( item->Type() == PCB_MODULE_EDGE_T || item->Type() == PCB_MODULE_TEXT_T );
wxASSERT( item->Type() == PCB_FP_SHAPE_T || item->Type() == PCB_FP_TEXT_T );
else
wxASSERT( item->Type() == PCB_LINE_T || item->Type() == PCB_TEXT_T );
wxASSERT( item->Type() == PCB_SHAPE_T || item->Type() == PCB_TEXT_T );
if( grp )
grp->AddItem( static_cast<BOARD_ITEM*>( item ) );
@ -1188,7 +1188,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, DRAWSEGMEN
KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER twoPointManager;
// drawing assistant overlay
// TODO: workaround because STROKE_T is not visible from commons.
// TODO: workaround because PCB_SHAPE_TYPE_T is not visible from commons.
KIGFX::PREVIEW::GEOM_SHAPE geomShape( static_cast<KIGFX::PREVIEW::GEOM_SHAPE>( aShape ) );
KIGFX::PREVIEW::TWO_POINT_ASSISTANT twoPointAsst(
twoPointManager, m_frame->GetUserUnits(), geomShape );
@ -1310,7 +1310,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, DRAWSEGMEN
m_lineWidth = getSegmentWidth( m_frame->GetActiveLayer() );
// Init the new item attributes
graphic->SetShape( (STROKE_T) aShape );
graphic->SetShape( (PCB_SHAPE_TYPE_T) aShape );
graphic->SetWidth( m_lineWidth );
graphic->SetLayer( m_frame->GetActiveLayer() );
grid.SetSkipPoint( cursorPos );

View File

@ -167,7 +167,7 @@ private:
/**
* Starts drawing a selected shape (i.e. DRAWSEGMENT).
* @param aShape is the type of created shape (@see STROKE_T).
* @param aShape is the type of created shape (@see PCB_SHAPE_TYPE_T).
* @param aGraphic is an object that is going to be used by the tool for drawing. Must be
* already created. The tool deletes the object if it is not added to a BOARD.
* @param aStartingPoint is a starting point for this new DRAWSEGMENT. If it exists the new

View File

@ -72,7 +72,7 @@ void EditToolSelectionFilter( GENERAL_COLLECTOR& aCollector, int aFlags,
{
aCollector.Remove( item );
}
else if( item->Type() == PCB_MODULE_ZONE_AREA_T )
else if( item->Type() == PCB_FP_ZONE_AREA_T )
{
MODULE* mod = static_cast<MODULE*>( item->GetParent() );
@ -914,9 +914,9 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
// only modify items we can mirror
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_SHAPE_T:
case PCB_FP_TEXT_T:
case PCB_FP_ZONE_AREA_T:
case PCB_PAD_T:
// Only create undo entry for items on the board
if( !item->IsNew() && !EditingModules() )
@ -930,21 +930,21 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
// modify each object as necessary
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
{
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
edge->Mirror( mirrorPoint, false );
break;
}
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
{
MODULE_ZONE_CONTAINER* zone = static_cast<MODULE_ZONE_CONTAINER*>( item );
zone->Mirror( mirrorPoint, false );
break;
}
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* modText = static_cast<TEXTE_MODULE*>( item );
modText->Mirror( mirrorPoint, false );
@ -1125,7 +1125,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
switch( item->Type() )
{
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
MODULE* parent = static_cast<MODULE*>( item->GetParent() );
@ -1150,7 +1150,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
}
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
{
MODULE_ZONE_CONTAINER* zone = static_cast<MODULE_ZONE_CONTAINER*>( item );
MODULE* parent = static_cast<MODULE*>( item->GetParent() );
@ -1427,7 +1427,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
{
case PCB_MODULE_T:
case PCB_TEXT_T:
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_TRACE_T:
case PCB_VIA_T:
case PCB_ZONE_AREA_T:

View File

@ -547,8 +547,8 @@ void GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos, bo
break;
}
case PCB_MODULE_EDGE_T:
case PCB_LINE_T:
case PCB_FP_SHAPE_T:
case PCB_SHAPE_T:
{
if( !m_magneticSettings->graphics )
break;
@ -714,7 +714,7 @@ void GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos, bo
break;
}
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
case PCB_TEXT_T:
addAnchor( aItem->GetPosition(), ORIGIN, aItem );
break;

View File

@ -62,7 +62,7 @@ S_C PCB_SELECTION_CONDITIONS::SameLayer()
}
S_C PCB_SELECTION_CONDITIONS::OnlyGraphicShapeTypes( const std::set<STROKE_T> aTypes )
S_C PCB_SELECTION_CONDITIONS::OnlyGraphicShapeTypes( const std::set<PCB_SHAPE_TYPE_T> aTypes )
{
return std::bind( &PCB_SELECTION_CONDITIONS::onlyGraphicShapeTypesFunc, _1, aTypes );
}
@ -137,17 +137,17 @@ bool PCB_SELECTION_CONDITIONS::sameLayerFunc( const SELECTION& aSelection )
bool PCB_SELECTION_CONDITIONS::onlyGraphicShapeTypesFunc( const SELECTION& aSelection,
const std::set<STROKE_T> aTypes )
const std::set<PCB_SHAPE_TYPE_T> aTypes )
{
if( aSelection.Empty() )
return false;
for( const EDA_ITEM* item : aSelection )
{
if( item->Type() != PCB_LINE_T && item->Type() != PCB_MODULE_EDGE_T )
if( item->Type() != PCB_SHAPE_T && item->Type() != PCB_FP_SHAPE_T )
return false;
STROKE_T shape = static_cast<const DRAWSEGMENT*>( item )->GetShape();
PCB_SHAPE_TYPE_T shape = static_cast<const DRAWSEGMENT*>( item )->GetShape();
if( !aTypes.count( shape ) )
return false;

View File

@ -62,11 +62,11 @@ public:
/**
* Creates a functor that tests if the selection contains DRAWSEGMENT* items of certain shapes
* This implicitly includes an OnlyType( PCB_LINE_T ) as part of the test
* @param aTypes is a list of allowed DRAWSEGMENT shapes (@see STROKE_T)
* This implicitly includes an OnlyType( PCB_SHAPE_T ) as part of the test
* @param aTypes is a list of allowed DRAWSEGMENT shapes (@see PCB_SHAPE_TYPE_T)
* @return functor testing if selected items match the given list of allowed shapes
*/
static SELECTION_CONDITION OnlyGraphicShapeTypes( const std::set<STROKE_T> aTypes );
static SELECTION_CONDITION OnlyGraphicShapeTypes( const std::set<PCB_SHAPE_TYPE_T> aTypes );
private:
@ -78,7 +78,7 @@ private:
///> Helper function used by OnlyGraphicShapeTypes()
static bool onlyGraphicShapeTypesFunc( const SELECTION& aSelection,
const std::set<STROKE_T> aTypes );
const std::set<PCB_SHAPE_TYPE_T> aTypes );
};
#endif /* PCB_SELECTION_CONDITIONS_H_ */

View File

@ -140,7 +140,7 @@ int PCB_VIEWER_TOOLS::GraphicOutlines( const TOOL_EVENT& aEvent )
{
for( BOARD_ITEM* item : module->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_EDGE_T )
if( item->Type() == PCB_FP_SHAPE_T )
view()->Update( item, KIGFX::GEOMETRY );
}
}
@ -149,7 +149,7 @@ int PCB_VIEWER_TOOLS::GraphicOutlines( const TOOL_EVENT& aEvent )
{
KICAD_T t = item->Type();
if( t == PCB_LINE_T || BaseType( t ) == PCB_DIMENSION_T || t == PCB_TARGET_T )
if( t == PCB_SHAPE_T || BaseType( t ) == PCB_DIMENSION_T || t == PCB_TARGET_T )
view()->Update( item, KIGFX::GEOMETRY );
}
@ -173,7 +173,7 @@ int PCB_VIEWER_TOOLS::TextOutlines( const TOOL_EVENT& aEvent )
for( BOARD_ITEM* item : module->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_TEXT_T )
if( item->Type() == PCB_FP_TEXT_T )
view()->Update( item, KIGFX::GEOMETRY );
}
}

View File

@ -551,14 +551,14 @@ void pasteModuleItemsToModEdit( MODULE* aClipModule, BOARD* aBoard,
for( BOARD_ITEM* item : aClipModule->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_EDGE_T )
if( item->Type() == PCB_FP_SHAPE_T )
{
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
edge->SetParent( nullptr );
edge->SetLocalCoord();
}
else if( item->Type() == PCB_MODULE_TEXT_T )
else if( item->Type() == PCB_FP_TEXT_T )
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
@ -655,11 +655,11 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent )
for( BOARD_ITEM* clipDrawItem : clipBoard->Drawings() )
{
if( clipDrawItem->Type() == PCB_LINE_T )
if( clipDrawItem->Type() == PCB_SHAPE_T )
{
DRAWSEGMENT* clipDrawSeg = static_cast<DRAWSEGMENT*>( clipDrawItem );
// Convert to PCB_MODULE_EDGE_T
// Convert to PCB_FP_SHAPE_T
EDGE_MODULE* pastedDrawSeg = new EDGE_MODULE( editModule );
static_cast<DRAWSEGMENT*>( pastedDrawSeg )->SwapData( clipDrawSeg );
pastedDrawSeg->SetLocalCoord();
@ -672,7 +672,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent )
{
TEXTE_PCB* clipTextItem = static_cast<TEXTE_PCB*>( clipDrawItem );
// Convert to PCB_MODULE_TEXT_T
// Convert to PCB_FP_TEXT_T
TEXTE_MODULE* pastedTextItem = new TEXTE_MODULE( editModule );
static_cast<EDA_TEXT*>( pastedTextItem )->SwapText( *clipTextItem );
static_cast<EDA_TEXT*>( pastedTextItem )->SwapEffects( *clipTextItem );

View File

@ -137,8 +137,8 @@ public:
// Generate list of edit points basing on the item type
switch( aItem->Type() )
{
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
{
const DRAWSEGMENT* segment = static_cast<const DRAWSEGMENT*>( aItem );
@ -237,7 +237,7 @@ public:
}
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
case PCB_ZONE_AREA_T:
{
auto zone = static_cast<const ZONE_CONTAINER*>( aItem );
@ -1039,8 +1039,8 @@ void POINT_EDITOR::updateItem() const
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
{
DRAWSEGMENT* segment = static_cast<DRAWSEGMENT*>( item );
@ -1294,7 +1294,7 @@ void POINT_EDITOR::updateItem() const
}
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
case PCB_ZONE_AREA_T:
{
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( item );
@ -1480,7 +1480,7 @@ void POINT_EDITOR::finishItem()
if( !item )
return;
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T )
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T )
{
auto zone = static_cast<ZONE_CONTAINER*>( item );
@ -1524,8 +1524,8 @@ void POINT_EDITOR::updatePoints()
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
{
const DRAWSEGMENT* segment = static_cast<const DRAWSEGMENT*>( item );
@ -1660,7 +1660,7 @@ void POINT_EDITOR::updatePoints()
}
break;
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
case PCB_ZONE_AREA_T:
{
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( item );
@ -1752,11 +1752,13 @@ void POINT_EDITOR::setAltConstraint( bool aEnabled )
bool isPoly = false;
if( m_editPoints->GetParent()->Type() == PCB_ZONE_AREA_T
|| m_editPoints->GetParent()->Type() == PCB_MODULE_ZONE_AREA_T )
|| m_editPoints->GetParent()->Type() == PCB_FP_ZONE_AREA_T )
{
isPoly = true;
}
else if( m_editPoints->GetParent()->Type() == PCB_LINE_T
|| m_editPoints->GetParent()->Type() == PCB_MODULE_EDGE_T )
else if( m_editPoints->GetParent()->Type() == PCB_SHAPE_T
|| m_editPoints->GetParent()->Type() == PCB_FP_SHAPE_T )
{
DRAWSEGMENT* seg = static_cast<DRAWSEGMENT*>( m_editPoints->GetParent() );
isPoly = seg->GetShape() == S_POLYGON;
@ -1786,8 +1788,8 @@ EDIT_POINT POINT_EDITOR::get45DegConstrainer() const
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_MODULE_EDGE_T:
case PCB_SHAPE_T:
case PCB_FP_SHAPE_T:
{
const DRAWSEGMENT* segment = static_cast<const DRAWSEGMENT*>( item );
{
@ -1845,10 +1847,16 @@ bool POINT_EDITOR::canAddCorner( const EDA_ITEM& aItem )
const auto type = aItem.Type();
// Works only for zones and line segments
return type == PCB_ZONE_AREA_T || type == PCB_MODULE_ZONE_AREA_T ||
( ( type == PCB_LINE_T || type == PCB_MODULE_EDGE_T ) &&
( static_cast<const DRAWSEGMENT&>( aItem ).GetShape() == S_SEGMENT ||
static_cast<const DRAWSEGMENT&>( aItem ).GetShape() == S_POLYGON ) );
if( type == PCB_ZONE_AREA_T || type == PCB_FP_ZONE_AREA_T )
return true;
if( type == PCB_SHAPE_T || type == PCB_FP_SHAPE_T )
{
const DRAWSEGMENT& shape = static_cast<const DRAWSEGMENT&>( aItem );
return shape.GetShape() == S_SEGMENT || shape.GetShape() == S_POLYGON;
}
return false;
}
@ -1886,14 +1894,17 @@ bool POINT_EDITOR::removeCornerCondition( const SELECTION& )
EDA_ITEM* item = m_editPoints->GetParent();
if( !item || !( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ||
( ( item->Type() == PCB_MODULE_EDGE_T || item->Type() == PCB_LINE_T ) &&
if( !item )
return false;
if( !( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T
|| ( ( item->Type() == PCB_FP_SHAPE_T || item->Type() == PCB_SHAPE_T ) &&
static_cast<DRAWSEGMENT*>( item )->GetShape() == S_POLYGON ) ) )
return false;
SHAPE_POLY_SET *polyset;
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T )
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T )
polyset = static_cast<ZONE_CONTAINER*>( item )->Outline();
else
polyset = &static_cast<DRAWSEGMENT*>( item )->GetPolyShape();
@ -1936,7 +1947,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
DRAWSEGMENT* graphicItem = dynamic_cast<DRAWSEGMENT*>( item );
BOARD_COMMIT commit( frame );
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ||
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ||
( graphicItem && graphicItem->GetShape() == S_POLYGON ) )
{
unsigned int nearestIdx = 0;
@ -1945,7 +1956,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
unsigned int firstPointInContour = 0;
SHAPE_POLY_SET* zoneOutline;
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T )
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T )
{
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( item );
zoneOutline = zone->Outline();
@ -2001,7 +2012,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
zoneOutline->InsertVertex( nextNearestIdx, nearestPoint );
// We re-hatch the filled zones but not polygons
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T )
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T )
static_cast<ZONE_CONTAINER*>( item )->HatchBorder();
@ -2018,13 +2029,13 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
// Move the end of the line to the break point..
graphicItem->SetEnd( wxPoint( nearestPoint.x, nearestPoint.y ) );
if( graphicItem->Type() == PCB_MODULE_EDGE_T )
if( graphicItem->Type() == PCB_FP_SHAPE_T )
static_cast<EDGE_MODULE*>( graphicItem )->SetLocalCoord();
// and add another one starting from the break point
DRAWSEGMENT* newSegment;
if( item->Type() == PCB_MODULE_EDGE_T )
if( item->Type() == PCB_FP_SHAPE_T )
{
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( graphicItem );
assert( edge->GetParent()->Type() == PCB_MODULE_T );
@ -2039,7 +2050,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
newSegment->SetStart( wxPoint( nearestPoint.x, nearestPoint.y ) );
newSegment->SetEnd( wxPoint( seg.B.x, seg.B.y ) );
if( newSegment->Type() == PCB_MODULE_EDGE_T )
if( newSegment->Type() == PCB_FP_SHAPE_T )
static_cast<EDGE_MODULE*>( newSegment )->SetLocalCoord();
commit.Add( newSegment );
@ -2063,13 +2074,13 @@ int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
SHAPE_POLY_SET* polygon = nullptr;
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T )
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T )
{
auto zone = static_cast<ZONE_CONTAINER*>( item );
polygon = zone->Outline();
zone->SetNeedRefill( true );
}
else if( (item->Type() == PCB_MODULE_EDGE_T ) || ( item->Type() == PCB_LINE_T ) )
else if( item->Type() == PCB_FP_SHAPE_T || item->Type() == PCB_SHAPE_T )
{
auto ds = static_cast<DRAWSEGMENT*>( item );
@ -2117,7 +2128,7 @@ int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent )
commit.Push( _( "Remove a zone/polygon corner" ) );
// Refresh zone hatching
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T )
if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T )
static_cast<ZONE_CONTAINER*>( item )->HatchBorder();
updatePoints();

View File

@ -754,9 +754,9 @@ SELECTION_LOCK_FLAGS SELECTION_TOOL::CheckLock()
containsLocked = true;
break;
case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_SHAPE_T:
case PCB_FP_TEXT_T:
case PCB_FP_ZONE_AREA_T:
if( static_cast<MODULE*>( item->GetParent() )->IsLocked() )
containsLocked = true;
break;
@ -1394,7 +1394,7 @@ static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, const BOARD& aBoard
include = aFilterOptions.includeZones;
break;
}
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_TARGET_T:
case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T:
@ -1522,14 +1522,14 @@ bool SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem )
break;
}
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_TARGET_T:
if( !m_filter.graphics )
return false;
break;
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
case PCB_TEXT_T:
if( !m_filter.text )
return false;
@ -1815,7 +1815,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn
switch( aItem->Type() )
{
case PCB_ZONE_AREA_T:
case PCB_MODULE_ZONE_AREA_T:
case PCB_FP_ZONE_AREA_T:
{
const ZONE_CONTAINER* zone = static_cast<const ZONE_CONTAINER*>( aItem );
@ -1879,7 +1879,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn
return false;
}
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
// Multiple selection is only allowed in modedit mode. In pcbnew, you have to select
// module subparts one by one, rather than with a drag selection. This is so you can
// pick up items under an (unlocked) module without also moving the module's sub-parts.
@ -1894,7 +1894,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn
break;
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
// Module edge selections are only allowed in modedit mode.
if( !m_editModules && !checkVisibilityOnly )
return false;
@ -2258,7 +2258,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector,
BOARD_ITEM* item = aCollector[i];
KICAD_T type = item->Type();
if( ( type == PCB_MODULE_TEXT_T || type == PCB_TEXT_T || type == PCB_LINE_T )
if( ( type == PCB_FP_TEXT_T || type == PCB_TEXT_T || type == PCB_SHAPE_T )
&& silkLayers[item->GetLayer()] )
{
preferred.insert( item );
@ -2301,7 +2301,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector,
}
}
if( aCollector.CountType( PCB_MODULE_TEXT_T ) > 0 )
if( aCollector.CountType( PCB_FP_TEXT_T ) > 0 )
{
for( int i = 0; i < aCollector.GetCount(); ++i )
{
@ -2334,7 +2334,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector,
case PCB_TRACE_T:
case PCB_ARC_T:
case PCB_PAD_T:
case PCB_LINE_T:
case PCB_SHAPE_T:
case PCB_VIA_T:
case PCB_MODULE_T:
if( areaRatio > textToFeatureMinRatio && txtCommonRatio < commonAreaRatio )
@ -2348,7 +2348,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector,
}
}
if( aCollector.CountType( PCB_MODULE_EDGE_T ) + aCollector.CountType( PCB_LINE_T ) > 1 )
if( aCollector.CountType( PCB_FP_SHAPE_T ) + aCollector.CountType( PCB_SHAPE_T ) > 1 )
{
// Prefer exact hits to sloppy ones
int accuracy = KiROUND( 5 * aCollector.GetGuide()->OnePixelInIU() );

View File

@ -609,7 +609,7 @@ void ZONE_FILLER::addKnockout( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, int aGap,
{
switch( aItem->Type() )
{
case PCB_LINE_T:
case PCB_SHAPE_T:
{
DRAWSEGMENT* seg = (DRAWSEGMENT*) aItem;
seg->TransformShapeWithClearanceToPolygon( aHoles, aLayer, aGap, m_maxError,
@ -622,14 +622,14 @@ void ZONE_FILLER::addKnockout( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, int aGap,
text->TransformBoundingBoxWithClearanceToPolygon( &aHoles, aGap );
break;
}
case PCB_MODULE_EDGE_T:
case PCB_FP_SHAPE_T:
{
EDGE_MODULE* edge = (EDGE_MODULE*) aItem;
edge->TransformShapeWithClearanceToPolygon( aHoles, aLayer, aGap, m_maxError,
aIgnoreLineWidth );
break;
}
case PCB_MODULE_TEXT_T:
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* text = (TEXTE_MODULE*) aItem;

View File

@ -113,7 +113,7 @@ bool test::DRC_TEST_PROVIDER_SILK_TO_PAD::Run()
boardItems.push_back( item );
};
forEachGeometryItem( { PCB_LINE_T }, LSET( Edge_Cuts ), queryBoardOutlineItems );
forEachGeometryItem( { PCB_SHAPE_T }, LSET( Edge_Cuts ), queryBoardOutlineItems );
forEachGeometryItem( {}, LSET::AllTechMask() | LSET::AllCuMask(), queryBoardGeometryItems );

View File

@ -34,7 +34,7 @@ namespace KI_TEST
void DrawSegment( MODULE& aMod, const SEG& aSeg, int aWidth, PCB_LAYER_ID aLayer )
{
auto seg = std::make_unique<EDGE_MODULE>( &aMod, STROKE_T::S_SEGMENT );
auto seg = std::make_unique<EDGE_MODULE>( &aMod, S_SEGMENT );
seg->SetStart0( (wxPoint) aSeg.A );
seg->SetEnd0( (wxPoint) aSeg.B );
@ -59,7 +59,7 @@ void DrawPolyline(
void DrawArc( MODULE& aMod, const VECTOR2I& aCentre, const VECTOR2I& aStart, double aAngle,
int aWidth, PCB_LAYER_ID aLayer )
{
auto seg = std::make_unique<EDGE_MODULE>( &aMod, STROKE_T::S_ARC );
auto seg = std::make_unique<EDGE_MODULE>( &aMod, S_ARC );
seg->SetStart0( (wxPoint) aCentre );
seg->SetEnd0( (wxPoint) aStart );