7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 10:20:11 +00:00

Class renaming.

DRAWSEGMENT  -> PCB_SHAPE
EDGE_MODULE  -> FP_SHAPE
TEXTE_PCB    -> PCB_TEXT
TEXTE_MODULE -> FP_TEXT
This commit is contained in:
Jeff Young 2020-10-05 00:34:59 +01:00
parent a28a0e14ba
commit 37906511f5
142 changed files with 1763 additions and 1870 deletions
3d-viewer/3d_canvas
Documentation/development
common
include
pcbnew
CMakeLists.txt
autorouter
board_commit.cppboard_items_to_polygon_shape_transform.cppclass_board.cppclass_dimension.cppclass_dimension.hclass_module.cppclass_module.hclass_pad.cppclass_pad.hcollectors.cppconvert_drawsegment_list_to_polygon.cppcross-probing.cpp
dialogs
drc
eagle_plugin.cppeagle_plugin.h
exporters
files.cppfootprint_edit_frame.hfootprint_editor_utils.cppfootprint_libraries_utils.cppfp_shape.cppfp_shape.hfp_text.cppfp_text.hgpcb_plugin.cppgraphics_cleaner.cppgraphics_cleaner.h
import_gfx
kicad_clipboard.cppkicad_plugin.cppkicad_plugin.hlegacy_plugin.cpplegacy_plugin.h
microwave
pad_custom_shape_functions.cpp
pcad2kicadpcb_plugin
pcb_base_frame.cpppcb_edit_frame.hpcb_painter.cpppcb_painter.hpcb_parser.cpppcb_parser.hpcb_shape.cpppcb_shape.hpcb_text.cpppcb_text.hpcbplot.hplot_board_layers.cppplot_brditems_plotter.cpp
plugins
python/plugins
router
specctra_import_export
swig
text_mod_grid_table.cpptext_mod_grid_table.h
tools
undo_redo.cppzone_filler.cpp
qa

View File

@ -40,8 +40,8 @@
#include <class_track.h>
#include <wx/gdicmn.h>
#include <pcb_base_frame.h>
#include <class_pcb_text.h>
#include <class_drawsegment.h>
#include <pcb_text.h>
#include <pcb_shape.h>
#include <class_dimension.h>
#include <class_zone.h>
#include <class_module.h>
@ -560,12 +560,12 @@ class BOARD_ADAPTER
PCB_LAYER_ID aLayerId,
int aInflateValue );
void AddShapeWithClearanceToContainer( const TEXTE_PCB *aTextPCB,
void AddShapeWithClearanceToContainer( const PCB_TEXT *aText,
CGENERICCONTAINER2D *aDstContainer,
PCB_LAYER_ID aLayerId,
int aClearanceValue );
void AddShapeWithClearanceToContainer( const DRAWSEGMENT *aDrawSegment,
void AddShapeWithClearanceToContainer( const PCB_SHAPE *aShape,
CGENERICCONTAINER2D *aDstContainer,
PCB_LAYER_ID aLayerId,
int aClearanceValue );

View File

@ -38,10 +38,10 @@
#include <class_board.h>
#include <class_module.h>
#include <class_pad.h>
#include <class_pcb_text.h>
#include <class_edge_mod.h>
#include <pcb_text.h>
#include <fp_shape.h>
#include <class_zone.h>
#include <class_text_mod.h>
#include <fp_text.h>
#include <convert_basic_shapes_to_polygon.h>
#include <trigo.h>
#include <geometry/shape_segment.h>
@ -81,9 +81,9 @@ void addTextSegmToContainer( int x0, int y0, int xf, int yf, void* aData )
// Based on
// void TEXTE_PCB::TransformShapeWithClearanceToPolygon
// void PCB_TEXT::TransformShapeWithClearanceToPolygon
// board_items_to_polygon_shape_transform.cpp
void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const TEXTE_PCB* aText,
void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const PCB_TEXT* aText,
CGENERICCONTAINER2D *aDstContainer,
PCB_LAYER_ID aLayerId,
int aClearanceValue )
@ -190,16 +190,16 @@ void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMo
PCB_LAYER_ID aLayerId,
int aInflateValue )
{
std::vector<TEXTE_MODULE *> texts; // List of TEXTE_MODULE to convert
EDGE_MODULE* outline;
std::vector<FP_TEXT*> texts; // List of FP_TEXT to convert
FP_SHAPE* outline;
for( auto item : aModule->GraphicalItems() )
for( BOARD_ITEM* item : aModule->GraphicalItems() )
{
switch( item->Type() )
{
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
FP_TEXT* text = static_cast<FP_TEXT*>( item );
if( text->GetLayer() == aLayerId && text->IsVisible() )
texts.push_back( text );
@ -209,13 +209,12 @@ void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMo
case PCB_FP_SHAPE_T:
{
outline = (EDGE_MODULE*) item;
outline = (FP_SHAPE*) item;
if( outline->GetLayer() != aLayerId )
break;
AddShapeWithClearanceToContainer( (const DRAWSEGMENT *)outline,
aDstContainer,
AddShapeWithClearanceToContainer( (const PCB_SHAPE*) outline, aDstContainer,
aLayerId, 0 );
}
break;
@ -236,7 +235,7 @@ void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMo
s_dstcontainer = aDstContainer;
s_biuTo3Dunits = m_biuTo3Dunits;
for( TEXTE_MODULE* text : texts )
for( FP_TEXT* text : texts )
{
s_textWidth = text->GetEffectiveTextPenWidth() + ( 2 * aInflateValue );
wxSize size = text->GetTextSize();
@ -626,7 +625,7 @@ void BOARD_ADAPTER::TransformArcToSegments( const wxPoint &aCentre,
// Based on
// TransformShapeWithClearanceToPolygon
// board_items_to_polygon_shape_transform.cpp#L431
void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSegment,
void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const PCB_SHAPE* aDrawSegment,
CGENERICCONTAINER2D *aDstContainer,
PCB_LAYER_ID aLayerId,
int aClearanceValue )

View File

@ -38,8 +38,8 @@
#include <class_board.h>
#include <class_module.h>
#include <class_pad.h>
#include <class_pcb_text.h>
#include <class_edge_mod.h>
#include <pcb_text.h>
#include <fp_shape.h>
#include <class_zone.h>
#include <convert_basic_shapes_to_polygon.h>
#include <trigo.h>
@ -636,7 +636,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{
case PCB_SHAPE_T:
{
AddShapeWithClearanceToContainer( (DRAWSEGMENT*)item,
AddShapeWithClearanceToContainer( (PCB_SHAPE*)item,
layerContainer,
curr_layer_id,
0 );
@ -644,7 +644,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
break;
case PCB_TEXT_T:
AddShapeWithClearanceToContainer( (TEXTE_PCB*) item,
AddShapeWithClearanceToContainer( (PCB_TEXT*) item,
layerContainer,
curr_layer_id,
0 );
@ -688,12 +688,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_SHAPE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( *layerPoly,
cur_layer_id, 0 );
( (PCB_SHAPE*) item )->TransformShapeWithClearanceToPolygon( *layerPoly,
cur_layer_id, 0 );
break;
case PCB_TEXT_T:
( (TEXTE_PCB*) item )->TransformShapeWithClearanceToPolygonSet( *layerPoly, 0 );
( (PCB_TEXT*) item )->TransformShapeWithClearanceToPolygonSet( *layerPoly, 0 );
break;
default:
@ -933,14 +933,14 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_SHAPE_T:
AddShapeWithClearanceToContainer( (DRAWSEGMENT*)item,
AddShapeWithClearanceToContainer( (PCB_SHAPE*) item,
layerContainer,
curr_layer_id,
0 );
break;
case PCB_TEXT_T:
AddShapeWithClearanceToContainer( (TEXTE_PCB*) item,
AddShapeWithClearanceToContainer( (PCB_TEXT*) item,
layerContainer,
curr_layer_id,
0 );
@ -971,12 +971,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
switch( item->Type() )
{
case PCB_SHAPE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( *layerPoly,
curr_layer_id, 0 );
( (PCB_SHAPE*) item )->TransformShapeWithClearanceToPolygon( *layerPoly,
curr_layer_id, 0 );
break;
case PCB_TEXT_T:
( (TEXTE_PCB*) item )->TransformShapeWithClearanceToPolygonSet( *layerPoly, 0 );
( (PCB_TEXT*) item )->TransformShapeWithClearanceToPolygonSet( *layerPoly, 0 );
break;
default:

View File

@ -30,7 +30,7 @@
#include "board_adapter.h"
#include <convert_basic_shapes_to_polygon.h>
#include <class_edge_mod.h>
#include <fp_shape.h>
#include <class_module.h>
@ -67,7 +67,7 @@ void BOARD_ADAPTER::transformGraphicModuleEdgeToPolygonSet( const MODULE *aModul
{
if( item->Type() == PCB_FP_SHAPE_T )
{
EDGE_MODULE* outline = (EDGE_MODULE*) item;
FP_SHAPE* outline = (FP_SHAPE*) item;
if( outline->GetLayer() == aLayer )
outline->TransformShapeWithClearanceToPolygon( aCornerBuffer, aLayer, 0 );

View File

@ -235,7 +235,7 @@ As an example:
modifiedItem->Move( x, y );
// create a new item
DRAWSEGMENT* newItem = new DRAWSEGMENT;
PCB_SHAPE* newItem = new PCB_SHAPE;
// ... set up item here
@ -516,7 +516,7 @@ Below you will find the contents of useless_tool.cpp:
int USELESS_TOOL::fixedCircle( const TOOL_EVENT& aEvent )
{
// new circle to add (ideally use a smart pointer)
DRAWSEGMENT* circle = new DRAWSEGMENT;
PCB_SHAPE* circle = new PCB_SHAPE;
// Set the circle attributes
circle->SetShape( S_CIRCLE );

View File

@ -492,8 +492,8 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/class_board.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_board_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_dimension.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_drawsegment.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_edge_mod.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
${CMAKE_SOURCE_DIR}/pcbnew/fp_shape.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_pcb_group.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_marker_pcb.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_module.cpp
@ -501,9 +501,9 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_pad.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_pcb_target.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_pcb_text.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_text.cpp
${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/class_board_stackup.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_text_mod.cpp
${CMAKE_SOURCE_DIR}/pcbnew/fp_text.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_track.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_zone.cpp
${CMAKE_SOURCE_DIR}/pcbnew/collectors.cpp

View File

@ -497,8 +497,6 @@ EATTR::EATTR( wxXmlNode* aTree )
y = parseOptionalAttribute<ECOORD>( aTree, "y" );
size = parseOptionalAttribute<ECOORD>( aTree, "size" );
// KiCad cannot currently put a TEXTE_MODULE on a different layer than the MODULE
// Eagle can it seems.
layer = parseOptionalAttribute<int>( aTree, "layer" );
ratio = parseOptionalAttribute<double>( aTree, "ratio" );
rot = parseOptionalAttribute<EROT>( aTree, "rot" );

View File

@ -26,8 +26,8 @@
#include <hash_eda.h>
#include <class_module.h>
#include <class_text_mod.h>
#include <class_edge_mod.h>
#include <fp_text.h>
#include <fp_shape.h>
#include <class_pad.h>
#include <functional>
@ -105,12 +105,12 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
case PCB_FP_TEXT_T:
{
const TEXTE_MODULE* text = static_cast<const TEXTE_MODULE*>( aItem );
const FP_TEXT* text = static_cast<const FP_TEXT*>( aItem );
if( !( aFlags & HASH_REF ) && text->GetType() == TEXTE_MODULE::TEXT_is_REFERENCE )
if( !( aFlags & HASH_REF ) && text->GetType() == FP_TEXT::TEXT_is_REFERENCE )
break;
if( !( aFlags & HASH_VALUE ) && text->GetType() == TEXTE_MODULE::TEXT_is_VALUE )
if( !( aFlags & HASH_VALUE ) && text->GetType() == FP_TEXT::TEXT_is_VALUE )
break;
ret = hash_board_item( text, aFlags );
@ -138,7 +138,7 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
case PCB_FP_SHAPE_T:
{
const EDGE_MODULE* segment = static_cast<const EDGE_MODULE*>( aItem );
const FP_SHAPE* segment = static_cast<const FP_SHAPE*>( aItem );
ret = hash_board_item( segment, aFlags );
hash_combine( ret, segment->GetType() );
hash_combine( ret, segment->GetShape() );

View File

@ -88,10 +88,10 @@ 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_SHAPE_T, ///< class DRAWSEGMENT, a segment not on copper layers
PCB_TEXT_T, ///< class TEXTE_PCB, text on a layer
PCB_FP_TEXT_T, ///< class TEXTE_MODULE, text in a footprint
PCB_FP_SHAPE_T, ///< class EDGE_MODULE, a footprint edge
PCB_SHAPE_T, ///< class PCB_SHAPE, a segment not on copper layers
PCB_TEXT_T, ///< class PCB_TEXT, text on a layer
PCB_FP_TEXT_T, ///< class FP_TEXT, text in a footprint
PCB_FP_SHAPE_T, ///< class FP_SHAPE, 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)

View File

@ -53,7 +53,6 @@ class COLOR_SETTINGS;
class MODULE;
class TRACK;
class D_PAD;
class TEXTE_MODULE;
class EDA_3D_VIEWER;
class GENERAL_COLLECTOR;
class GENERAL_COLLECTORS_GUIDE;

View File

@ -474,8 +474,8 @@ if( KICAD_SCRIPTING ) # Generate pcbnew.py and pcbnew_wrap.cxx using swig
DEPENDS swig/board_item_container.i
DEPENDS swig/connectivity.i
DEPENDS swig/dimension.i
DEPENDS swig/drawsegment.i
DEPENDS swig/edge_mod.i
DEPENDS swig/pcb_shape.i
DEPENDS swig/fp_shape.i
DEPENDS swig/marker_pcb.i
DEPENDS swig/pcb_target.i
DEPENDS swig/pcb_plot_params.i
@ -484,7 +484,7 @@ if( KICAD_SCRIPTING ) # Generate pcbnew.py and pcbnew_wrap.cxx using swig
DEPENDS swig/pad.i
DEPENDS swig/pcb_text.i
DEPENDS swig/plugins.i
DEPENDS swig/text_mod.i
DEPENDS swig/fp_text.i
DEPENDS swig/track.i
DEPENDS swig/units.i
DEPENDS swig/typeinfo.i

View File

@ -32,7 +32,7 @@
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <class_drawsegment.h>
#include <pcb_shape.h>
#include <class_pad.h>
#include <board_commit.h>
#include <connectivity/connectivity_data.h>
@ -136,7 +136,7 @@ int AR_AUTOPLACER::genPlacementRoutingMatrix()
case PCB_SHAPE_T:
if( drawing->GetLayer() != Edge_Cuts )
{
m_matrix.TraceSegmentPcb( (DRAWSEGMENT*)drawing, CELL_IS_HOLE | CELL_IS_EDGE,
m_matrix.TraceSegmentPcb( (PCB_SHAPE*) drawing, CELL_IS_HOLE | CELL_IS_EDGE,
m_matrix.m_GridRouting, AR_MATRIX::WRITE_CELL );
}
break;

View File

@ -30,7 +30,7 @@
#include <math_for_graphics.h>
#include <trigo.h>
#include <class_drawsegment.h>
#include <pcb_shape.h>
#include <class_pad.h>
AR_MATRIX::AR_MATRIX()
@ -762,8 +762,8 @@ void AR_MATRIX::TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, LSET a
}
void AR_MATRIX::TraceSegmentPcb(
DRAWSEGMENT* pt_segm, int color, int marge, AR_MATRIX::CELL_OP op_logic )
void AR_MATRIX::TraceSegmentPcb( PCB_SHAPE* pt_segm, int color, int marge,
AR_MATRIX::CELL_OP op_logic )
{
int half_width = ( pt_segm->GetWidth() / 2 ) + marge;

View File

@ -32,7 +32,7 @@
#include <eda_rect.h>
#include <layers_id_colors_and_visibility.h>
class DRAWSEGMENT;
class PCB_SHAPE;
class TRACK;
class D_PAD;
class MODULE;
@ -130,7 +130,7 @@ public:
DIST_CELL GetDist( int aRow, int aCol, int aSide );
void SetDist( int aRow, int aCol, int aSide, DIST_CELL );
void TraceSegmentPcb( DRAWSEGMENT* pt_segm, int color, int marge, AR_MATRIX::CELL_OP op_logic );
void TraceSegmentPcb( PCB_SHAPE* pt_segm, int color, int marge, AR_MATRIX::CELL_OP op_logic );
void CreateKeepOutRectangle(
int ux0, int uy0, int ux1, int uy1, int marge, int aKeepOut, LSET aLayerMask );
void PlacePad( D_PAD* aPad, int color, int marge, AR_MATRIX::CELL_OP op_logic );

View File

@ -193,10 +193,10 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
if( boardItem->Type() == PCB_FP_TEXT_T )
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( boardItem );
FP_TEXT* text = static_cast<FP_TEXT*>( boardItem );
// don't allow deletion of Reference or Value
if( text->GetType() != TEXTE_MODULE::TEXT_is_DIVERS )
if( text->GetType() != FP_TEXT::TEXT_is_DIVERS )
break;
}

View File

@ -31,11 +31,11 @@
#include <class_board.h>
#include <class_pad.h>
#include <class_track.h>
#include <class_drawsegment.h>
#include <class_pcb_text.h>
#include <pcb_shape.h>
#include <pcb_text.h>
#include <class_zone.h>
#include <class_module.h>
#include <class_edge_mod.h>
#include <fp_shape.h>
#include <convert_basic_shapes_to_polygon.h>
#include <geometry/geometry_utils.h>
#include <geometry/shape_segment.h>
@ -98,11 +98,11 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_
switch( item->Type() )
{
case PCB_SHAPE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( aOutlines, aLayer, 0 );
( (PCB_SHAPE*) item )->TransformShapeWithClearanceToPolygon( aOutlines, aLayer, 0 );
break;
case PCB_TEXT_T:
( (TEXTE_PCB*) item )->TransformShapeWithClearanceToPolygonSet( aOutlines, 0 );
( (PCB_TEXT*) item )->TransformShapeWithClearanceToPolygonSet( aOutlines, 0 );
break;
default:
@ -216,13 +216,13 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLaye
bool aIncludeText,
bool aIncludeEdges ) const
{
std::vector<TEXTE_MODULE *> texts; // List of TEXTE_MODULE to convert
std::vector<FP_TEXT*> texts; // List of FP_TEXT to convert
for( auto item : GraphicalItems() )
{
if( item->Type() == PCB_FP_TEXT_T && aIncludeText )
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
FP_TEXT* text = static_cast<FP_TEXT*>( item );
if( aLayer != UNDEFINED_LAYER && text->GetLayer() == aLayer && text->IsVisible() )
texts.push_back( text );
@ -230,7 +230,7 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLaye
if( item->Type() == PCB_FP_SHAPE_T && aIncludeEdges )
{
EDGE_MODULE* outline = (EDGE_MODULE*) item;
FP_SHAPE* outline = static_cast<FP_SHAPE*>( item );
if( aLayer != UNDEFINED_LAYER && outline->GetLayer() == aLayer )
outline->TransformShapeWithClearanceToPolygon( aCornerBuffer, aLayer, 0, aError );
@ -248,7 +248,7 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLaye
prms.m_cornerBuffer = &aCornerBuffer;
for( TEXTE_MODULE* textmod : texts )
for( FP_TEXT* textmod : texts )
{
bool forceBold = true;
int penWidth = 0; // force max width for bold text
@ -338,8 +338,8 @@ void EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon( SHAPE_POLY_SET* aCorn
* @aClearanceValue = the clearance around the text
* @aError = the maximum error to allow when approximating curves
*/
void TEXTE_PCB::TransformShapeWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue, int aError ) const
void PCB_TEXT::TransformShapeWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue, int aError ) const
{
wxSize size = GetTextSize();
@ -377,10 +377,10 @@ void TEXTE_PCB::TransformShapeWithClearanceToPolygonSet( SHAPE_POLY_SET& aCorner
}
void DRAWSEGMENT::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
PCB_LAYER_ID aLayer,
int aClearanceValue, int aError,
bool ignoreLineWidth ) const
void PCB_SHAPE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
PCB_LAYER_ID aLayer,
int aClearanceValue, int aError,
bool ignoreLineWidth ) const
{
int width = ignoreLineWidth ? 0 : m_Width;
@ -494,7 +494,7 @@ void DRAWSEGMENT::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerB
break;
default:
wxFAIL_MSG( "DRAWSEGMENT::TransformShapeWithClearanceToPolygon no implementation for "
wxFAIL_MSG( "PCB_SHAPE::TransformShapeWithClearanceToPolygon no implementation for "
+ PCB_SHAPE_TYPE_T_asString( m_Shape ) );
break;
}

View File

@ -36,7 +36,6 @@
#include <class_track.h>
#include <class_zone.h>
#include <class_marker_pcb.h>
#include <class_drawsegment.h>
#include <class_pcb_target.h>
#include <connectivity/connectivity_data.h>
#include <pgm_base.h>

View File

@ -29,7 +29,7 @@
#include <base_units.h>
#include <class_board.h>
#include <class_dimension.h>
#include <class_pcb_text.h>
#include <pcb_text.h>
#include <geometry/shape_circle.h>
#include <geometry/shape_rect.h>
#include <geometry/shape_segment.h>
@ -312,10 +312,10 @@ void DIMENSION::SetEnd( const wxPoint& aEnd )
void DIMENSION::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
// for now, display only the text within the DIMENSION using class TEXTE_PCB.
// for now, display only the text within the DIMENSION using class PCB_TEXT.
wxString msg;
wxCHECK_RET( m_Parent != NULL, wxT( "TEXTE_PCB::GetMsgPanelInfo() m_Parent is NULL." ) );
wxCHECK_RET( m_Parent != NULL, wxT( "PCB_TEXT::GetMsgPanelInfo() m_Parent is NULL." ) );
aList.emplace_back( _( "Dimension" ), m_text.GetShownText(), DARKGREEN );

View File

@ -32,12 +32,11 @@
#include <class_board_item.h>
#include <class_pcb_text.h>
#include <pcb_text.h>
#include <geometry/shape.h>
class LINE_READER;
class TEXTE_PCB;
class MSG_PANEL_ITEM;
@ -217,8 +216,8 @@ public:
*/
const wxString GetText() const;
TEXTE_PCB& Text() { return m_text; }
TEXTE_PCB& Text() const { return *( const_cast<TEXTE_PCB*> ( &m_text ) ); }
PCB_TEXT& Text() { return m_text; }
PCB_TEXT& Text() const { return *( const_cast<PCB_TEXT*> ( &m_text ) ); }
/**
* @return a list of line segments that make up this dimension (for drawing, plotting, etc)
@ -305,7 +304,7 @@ protected:
bool m_keepTextAligned; ///< Calculate text orientation to match dimension
// Internal
TEXTE_PCB m_text; ///< The actual text object
PCB_TEXT m_text; ///< The actual text object
int m_measuredValue; ///< value of PCB dimensions
wxPoint m_start;
wxPoint m_end;

View File

@ -30,7 +30,7 @@
#include <unordered_set>
#include <pcb_edit_frame.h>
#include <class_board.h>
#include <class_edge_mod.h>
#include <fp_shape.h>
#include <class_module.h>
#include <view/view.h>
#include <geometry/shape_null.h>
@ -56,8 +56,8 @@ MODULE::MODULE( BOARD* parent ) :
m_ThermalGap = 0; // Use zone setting by default
// These are special and mandatory text fields
m_Reference = new TEXTE_MODULE( this, TEXTE_MODULE::TEXT_is_REFERENCE );
m_Value = new TEXTE_MODULE( this, TEXTE_MODULE::TEXT_is_VALUE );
m_Reference = new FP_TEXT( this, FP_TEXT::TEXT_is_REFERENCE );
m_Value = new FP_TEXT( this, FP_TEXT::TEXT_is_VALUE );
m_3D_Drawings.clear();
}
@ -87,9 +87,9 @@ MODULE::MODULE( const MODULE& aModule ) :
m_ThermalGap = aModule.m_ThermalGap;
// Copy reference and value.
m_Reference = new TEXTE_MODULE( *aModule.m_Reference );
m_Reference = new FP_TEXT( *aModule.m_Reference );
m_Reference->SetParent( this );
m_Value = new TEXTE_MODULE( *aModule.m_Value );
m_Value = new FP_TEXT( *aModule.m_Value );
m_Value->SetParent( this );
std::map<BOARD_ITEM*, BOARD_ITEM*> ptrMap;
@ -433,7 +433,7 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
{
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 );
assert( static_cast<FP_TEXT*>( aBoardItem )->GetType() == FP_TEXT::TEXT_is_DIVERS );
KI_FALLTHROUGH;
case PCB_FP_SHAPE_T:
@ -487,7 +487,7 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem )
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,
static_cast<FP_TEXT*>( aBoardItem )->GetType() == FP_TEXT::TEXT_is_DIVERS,
"Please report this bug: Invalid remove operation on required text" );
KI_FALLTHROUGH;
@ -1236,7 +1236,7 @@ void MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
for( BOARD_ITEM* item : m_drawings )
{
if( item->Type() == PCB_FP_TEXT_T )
static_cast<TEXTE_MODULE*>( item )->KeepUpright( orientation, newOrientation );
static_cast<FP_TEXT*>( item )->KeepUpright( orientation, newOrientation );
}
}
@ -1286,11 +1286,11 @@ void MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
switch( item->Type() )
{
case PCB_FP_SHAPE_T:
static_cast<EDGE_MODULE*>( item )->Flip( m_Pos, false );
static_cast<FP_SHAPE*>( item )->Flip( m_Pos, false );
break;
case PCB_FP_TEXT_T:
static_cast<TEXTE_MODULE*>( item )->Flip( m_Pos, false );
static_cast<FP_TEXT*>( item )->Flip( m_Pos, false );
break;
default:
@ -1330,14 +1330,14 @@ void MODULE::SetPosition( const wxPoint& aPos )
{
case PCB_FP_SHAPE_T:
{
EDGE_MODULE* pt_edgmod = (EDGE_MODULE*) item;
pt_edgmod->SetDrawCoord();
FP_SHAPE* shape = static_cast<FP_SHAPE*>( item );
shape->SetDrawCoord();
break;
}
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
FP_TEXT* text = static_cast<FP_TEXT*>( item );
text->EDA_TEXT::Offset( delta );
break;
}
@ -1387,14 +1387,14 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
{
case PCB_FP_SHAPE_T:
{
EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
edge->Move( moveVector );
FP_SHAPE* shape = static_cast<FP_SHAPE*>( item );
shape->Move( moveVector );
}
break;
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
FP_TEXT* text = static_cast<FP_TEXT*>( item );
text->SetPos0( text->GetPos0() + moveVector );
text->SetDrawCoord();
}
@ -1437,11 +1437,11 @@ void MODULE::SetOrientation( double aNewAngle )
{
if( item->Type() == PCB_FP_SHAPE_T )
{
static_cast<EDGE_MODULE*>( item )->SetDrawCoord();
static_cast<FP_SHAPE*>( item )->SetDrawCoord();
}
else if( item->Type() == PCB_FP_TEXT_T )
{
static_cast<TEXTE_MODULE*>( item )->SetDrawCoord();
static_cast<FP_TEXT*>( item )->SetDrawCoord();
}
}
}
@ -1494,18 +1494,18 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule )
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* new_text = new TEXTE_MODULE( *static_cast<const TEXTE_MODULE*>( aItem ) );
FP_TEXT* new_text = new FP_TEXT( *static_cast<const FP_TEXT*>( aItem ) );
const_cast<KIID&>( new_text->m_Uuid ) = KIID();
if( new_text->GetType() == TEXTE_MODULE::TEXT_is_REFERENCE )
if( new_text->GetType() == FP_TEXT::TEXT_is_REFERENCE )
{
new_text->SetText( wxT( "${REFERENCE}" ) );
new_text->SetType( TEXTE_MODULE::TEXT_is_DIVERS );
new_text->SetType( FP_TEXT::TEXT_is_DIVERS );
}
else if( new_text->GetType() == TEXTE_MODULE::TEXT_is_VALUE )
else if( new_text->GetType() == FP_TEXT::TEXT_is_VALUE )
{
new_text->SetText( wxT( "${VALUE}" ) );
new_text->SetType( TEXTE_MODULE::TEXT_is_DIVERS );
new_text->SetType( FP_TEXT::TEXT_is_DIVERS );
}
if( aAddToModule )
@ -1518,13 +1518,13 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule )
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();
FP_SHAPE* new_shape = new FP_SHAPE( *static_cast<const FP_SHAPE*>( aItem ) );
const_cast<KIID&>( new_shape->m_Uuid ) = KIID();
if( aAddToModule )
Add( new_edge );
Add( new_shape );
new_item = new_edge;
new_item = new_shape;
break;
}
@ -1656,8 +1656,8 @@ double MODULE::CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const
// see convert_drawsegment_list_to_polygon.cpp:
extern bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SET& aPolygons,
wxString* aErrorText, unsigned int aTolerance, wxPoint* aErrorLocation = nullptr );
extern bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aSegList, SHAPE_POLY_SET& aPolygons,
wxString* aErrorText, unsigned int aTolerance, wxPoint* aErrorLocation = nullptr );
std::shared_ptr<SHAPE> MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
@ -1675,16 +1675,16 @@ bool MODULE::BuildPolyCourtyard()
// Build the courtyard area from graphic items on the courtyard.
// Only PCB_FP_SHAPE_T have meaning, graphic texts are ignored.
// Collect items:
std::vector< DRAWSEGMENT* > list_front;
std::vector< DRAWSEGMENT* > list_back;
std::vector<PCB_SHAPE*> list_front;
std::vector<PCB_SHAPE*> list_back;
for( BOARD_ITEM* item : GraphicalItems() )
{
if( item->GetLayer() == B_CrtYd && item->Type() == PCB_FP_SHAPE_T )
list_back.push_back( static_cast< DRAWSEGMENT* > ( item ) );
list_back.push_back( static_cast<PCB_SHAPE*>( item ) );
if( item->GetLayer() == F_CrtYd && item->Type() == PCB_FP_SHAPE_T )
list_front.push_back( static_cast< DRAWSEGMENT* > ( item ) );
list_front.push_back( static_cast<PCB_SHAPE*>( item ) );
}
// Note: if no item found on courtyard layers, return true.
@ -1748,8 +1748,8 @@ bool MODULE::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOARD_ITE
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 );
const FP_SHAPE* dwgA = static_cast<const FP_SHAPE*>( aFirst );
const FP_SHAPE* dwgB = static_cast<const FP_SHAPE*>( aSecond );
if( dwgA->GetShape() != dwgB->GetShape() )
return dwgA->GetShape() < dwgB->GetShape();

View File

@ -36,7 +36,7 @@
#include <list>
#include "zones.h"
#include <class_text_mod.h>
#include <fp_text.h>
#include <class_zone.h>
#include <functional>
@ -470,12 +470,12 @@ public:
}
/// read/write accessors:
TEXTE_MODULE& Value() { return *m_Value; }
TEXTE_MODULE& Reference() { return *m_Reference; }
FP_TEXT& Value() { return *m_Value; }
FP_TEXT& Reference() { return *m_Reference; }
/// The const versions to keep the compiler happy.
TEXTE_MODULE& Value() const { return *m_Value; }
TEXTE_MODULE& Reference() const { return *m_Reference; }
FP_TEXT& Value() const { return *m_Value; }
FP_TEXT& Reference() const { return *m_Reference; }
const std::map<wxString, wxString>& GetProperties() const { return m_properties; }
void SetProperties( const std::map<wxString, wxString>& aProps ) { m_properties = aProps; }
@ -699,8 +699,8 @@ private:
double m_Orient; // Orientation in tenths of a degree, 900=90.0 degrees.
wxPoint m_Pos; // Position of module on the board in internal units.
TEXTE_MODULE* m_Reference; // Component reference designator value (U34, R18..)
TEXTE_MODULE* m_Value; // Component value (74LS00, 22K..)
FP_TEXT* m_Reference; // Component reference designator value (U34, R18..)
FP_TEXT* m_Value; // Component value (74LS00, 22K..)
LIB_ID m_fpid; // The #LIB_ID of the MODULE.
int m_Attributs; // Flag bits ( see Mod_Attribut )
int m_ModuleStatus; // For autoplace: flags (LOCKED, FIELDS_AUTOPLACED)

View File

@ -42,7 +42,7 @@
#include <view/view.h>
#include <class_board.h>
#include <class_module.h>
#include <class_drawsegment.h>
#include <pcb_shape.h>
#include <connectivity/connectivity_data.h>
#include <geometry/polygon_test_point_inside.h>
#include <convert_to_biu.h>
@ -407,7 +407,7 @@ void D_PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const
if( GetShape() == PAD_SHAPE_CUSTOM )
{
for( const std::shared_ptr<DRAWSEGMENT>& primitive : m_editPrimitives )
for( const std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
{
for( SHAPE* shape : primitive->MakeEffectiveShapes() )
{
@ -595,7 +595,7 @@ void D_PAD::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
// Flip (mirror) the basic shapes (primitives), in custom pads
void D_PAD::FlipPrimitives( bool aFlipLeftRight )
{
for( std::shared_ptr<DRAWSEGMENT>& primitive : m_editPrimitives )
for( std::shared_ptr<PCB_SHAPE>& primitive : m_editPrimitives )
primitive->Flip( wxPoint( 0, 0 ), aFlipLeftRight );
m_shapesDirty = true;

View File

@ -39,7 +39,7 @@
#include <pad_shapes.h>
#include <pcbnew.h>
class DRAWSEGMENT;
class PCB_SHAPE;
class PARAM_CFG;
class SHAPE;
class SHAPE_SEGMENT;
@ -53,7 +53,7 @@ enum CUST_PAD_SHAPE_IN_ZONE
class LINE_READER;
class EDA_3D_CANVAS;
class MODULE;
class EDGE_MODULE;
class FP_SHAPE;
class TRACK;
namespace KIGFX
@ -277,7 +277,7 @@ public:
/**
* Accessor to the basic shape list for custom-shaped pads.
*/
const std::vector<std::shared_ptr<DRAWSEGMENT>>& GetPrimitives() const
const std::vector<std::shared_ptr<PCB_SHAPE>>& GetPrimitives() const
{
return m_editPrimitives;
}
@ -294,18 +294,18 @@ public:
* Clear the current custom shape primitives list and import a new list. Copies the input,
* which is not altered.
*/
void ReplacePrimitives( const std::vector<std::shared_ptr<DRAWSEGMENT>>& aPrimitivesList );
void ReplacePrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList );
/**
* Import a custom shape primites list (composed of basic shapes) and add items to the
* current list. Copies the input, which is not altered.
*/
void AppendPrimitives( const std::vector<std::shared_ptr<DRAWSEGMENT>>& aPrimitivesList );
void AppendPrimitives( const std::vector<std::shared_ptr<PCB_SHAPE>>& aPrimitivesList );
/**
* Add item to the custom shape primitives list
*/
void AddPrimitive( DRAWSEGMENT* aPrimitive );
void AddPrimitive( PCB_SHAPE* aPrimitive );
/**
* Function SetOrientation
@ -647,7 +647,7 @@ private:
* Editing definitions of primitives for custom pad shapes. In local coordinates relative
* to m_Pos (NOT shapePos) at orient 0.
*/
std::vector<std::shared_ptr<DRAWSEGMENT>> m_editPrimitives;
std::vector<std::shared_ptr<PCB_SHAPE>> m_editPrimitives;
// Must be set to true to force rebuild shapes to draw (after geometry change for instance)
mutable bool m_shapesDirty;

View File

@ -26,12 +26,12 @@
#include <class_board_item.h> // class BOARD_ITEM
#include <class_module.h>
#include <class_edge_mod.h>
#include <fp_shape.h>
#include <class_pad.h>
#include <class_track.h>
#include <class_marker_pcb.h>
#include <class_zone.h>
#include <class_drawsegment.h>
#include <pcb_shape.h>
#include <class_pcb_group.h>
#include <macros.h>
#include <math/util.h> // for KiROUND
@ -189,13 +189,13 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
{
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
MODULE* module = nullptr;
PCB_GROUP* group = nullptr;
PCB_GROUP* group = nullptr;
D_PAD* pad = nullptr;
bool pad_through = false;
VIA* via = nullptr;
MARKER_PCB* marker = nullptr;
ZONE_CONTAINER* zone = nullptr;
DRAWSEGMENT* drawSegment = nullptr;
PCB_SHAPE* shape = nullptr;
#if 0 // debugging
static int breakhere = 0;
@ -236,7 +236,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
case PCB_FP_TEXT_T:
{
TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
FP_TEXT* tm = (FP_TEXT*) item;
if( tm->GetText() == wxT( "10uH" ) )
{
@ -317,7 +317,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
break;
case PCB_SHAPE_T:
drawSegment = static_cast<DRAWSEGMENT*>( item );
shape = static_cast<PCB_SHAPE*>( item );
break;
case PCB_DIM_ALIGNED_T:
@ -331,7 +331,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
case PCB_FP_TEXT_T:
{
TEXTE_MODULE *text = static_cast<TEXTE_MODULE*>( item );
FP_TEXT *text = static_cast<FP_TEXT*>( item );
if( m_Guide->IgnoreMTextsMarkedNoShow() && !text->IsVisible() )
goto exit;
@ -349,17 +349,17 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
switch( text->GetType() )
{
case TEXTE_MODULE::TEXT_is_REFERENCE:
case FP_TEXT::TEXT_is_REFERENCE:
if( m_Guide->IgnoreModulesRefs() )
goto exit;
break;
case TEXTE_MODULE::TEXT_is_VALUE:
case FP_TEXT::TEXT_is_VALUE:
if( m_Guide->IgnoreModulesVals() )
goto exit;
break;
case TEXTE_MODULE::TEXT_is_DIVERS:
case FP_TEXT::TEXT_is_DIVERS:
if( !m_Guide->IsLayerVisible( text->GetLayer() )
&& m_Guide->IgnoreNonVisibleLayers() )
goto exit;
@ -372,7 +372,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
break;
case PCB_FP_SHAPE_T:
drawSegment = static_cast<EDGE_MODULE*>( item );
shape = static_cast<FP_SHAPE*>( item );
break;
case PCB_MODULE_T:
@ -489,9 +489,9 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
goto exit;
}
}
else if( drawSegment )
else if( shape )
{
if( drawSegment->HitTest( m_refPos, accuracy ) )
if( shape->HitTest( m_refPos, accuracy ) )
{
Append( item );
goto exit;
@ -553,9 +553,9 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
goto exit;
}
}
else if( drawSegment )
else if( shape )
{
if( drawSegment->HitTest( m_refPos, accuracy ) )
if( shape->HitTest( m_refPos, accuracy ) )
{
Append( item );
goto exit;

View File

@ -33,7 +33,7 @@
#include <macros.h>
#include <math/vector2d.h>
#include <class_drawsegment.h>
#include <pcb_shape.h>
#include <class_module.h>
#include <base_units.h>
#include <convert_basic_shapes_to_polygon.h>
@ -105,15 +105,16 @@ inline bool close_st( const wxPoint& aReference, const wxPoint& aFirst, const wx
/**
* Searches for a DRAWSEGMENT matching a given end point or start point in a list, and
* Searches for a PCB_SHAPE matching a given end point or start point in a list, and
* if found, removes it from the TYPE_COLLECTOR and returns it, else returns NULL.
* @param aPoint The starting or ending point to search for.
* @param aList The list to remove from.
* @param aLimit is the distance from \a aPoint that still constitutes a valid find.
* @return DRAWSEGMENT* - The first DRAWSEGMENT that has a start or end point matching
* @return PCB_SHAPE* - The first PCB_SHAPE that has a start or end point matching
* aPoint, otherwise NULL if none.
*/
static DRAWSEGMENT* findPoint( const wxPoint& aPoint, std::vector< DRAWSEGMENT* >& aList, unsigned aLimit )
static PCB_SHAPE* findPoint( const wxPoint& aPoint, std::vector< PCB_SHAPE* >& aList,
unsigned aLimit )
{
unsigned min_d = INT_MAX;
int ndx_min = 0;
@ -121,8 +122,8 @@ static DRAWSEGMENT* findPoint( const wxPoint& aPoint, std::vector< DRAWSEGMENT*
// find the point closest to aPoint and perhaps exactly matching aPoint.
for( size_t i = 0; i < aList.size(); ++i )
{
DRAWSEGMENT* graphic = aList[i];
unsigned d;
PCB_SHAPE* graphic = aList[i];
unsigned d;
switch( graphic->GetShape() )
{
@ -173,7 +174,7 @@ static DRAWSEGMENT* findPoint( const wxPoint& aPoint, std::vector< DRAWSEGMENT*
if( min_d <= aLimit )
{
DRAWSEGMENT* graphic = aList[ndx_min];
PCB_SHAPE* graphic = aList[ndx_min];
aList.erase( aList.begin() + ndx_min );
return graphic;
}
@ -184,7 +185,7 @@ static DRAWSEGMENT* findPoint( const wxPoint& aPoint, std::vector< DRAWSEGMENT*
/**
* Function ConvertOutlineToPolygon
* build a polygon (with holes) from a DRAWSEGMENT list, which is expected to be
* build a polygon (with holes) from a PCB_SHAPE list, which is expected to be
* a outline, therefore a closed main outline with perhaps closed inner outlines.
* These closed inner outlines are considered as holes in the main outline
* @param aSegList the initial list of drawsegments (only lines, circles and arcs).
@ -194,7 +195,7 @@ static DRAWSEGMENT* findPoint( const wxPoint& aPoint, std::vector< DRAWSEGMENT*
* @param aErrorText is a wxString to return error message.
* @param aErrorLocation is the optional position of the error in the outline
*/
bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SET& aPolygons,
bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aSegList, SHAPE_POLY_SET& aPolygons,
wxString* aErrorText, unsigned int aTolerance,
wxPoint* aErrorLocation )
{
@ -207,9 +208,9 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
wxString msg;
// Make a working copy of aSegList, because the list is modified during calculations
std::vector< DRAWSEGMENT* > segList = aSegList;
std::vector<PCB_SHAPE*> segList = aSegList;
DRAWSEGMENT* graphic;
PCB_SHAPE* graphic;
wxPoint prevPt;
// Find edge point with minimum x, this should be in the outer polygon
@ -219,7 +220,7 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
for( size_t i = 0; i < segList.size(); i++ )
{
graphic = (DRAWSEGMENT*) segList[i];
graphic = (PCB_SHAPE*) segList[i];
switch( graphic->GetShape() )
{
@ -329,9 +330,9 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
// can put enough graphics together by matching endpoints to formulate a cohesive
// polygon.
graphic = (DRAWSEGMENT*) segList[xmini];
graphic = (PCB_SHAPE*) segList[xmini];
// The first DRAWSEGMENT is in 'graphic', ok to remove it from 'items'
// The first PCB_SHAPE is in 'graphic', ok to remove it from 'items'
segList.erase( segList.begin() + xmini );
// Output the outline perimeter as polygon.
@ -471,7 +472,7 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
default:
if( aErrorText )
{
msg.Printf( "Unsupported DRAWSEGMENT type %s.",
msg.Printf( "Unsupported PCB_SHAPE type %s.",
BOARD_ITEM::ShowShape( graphic->GetShape() ) );
*aErrorText << msg << "\n";
@ -527,7 +528,7 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
int hole = aPolygons.NewHole();
holeNum++;
graphic = (DRAWSEGMENT*) segList[0];
graphic = (PCB_SHAPE*) segList[0];
segList.erase( segList.begin() );
// Both circles and polygons on the edge cuts layer are closed items that
@ -680,7 +681,7 @@ bool ConvertOutlineToPolygon( std::vector<DRAWSEGMENT*>& aSegList, SHAPE_POLY_SE
default:
if( aErrorText )
{
msg.Printf( "Unsupported DRAWSEGMENT type %s.",
msg.Printf( "Unsupported PCB_SHAPE type %s.",
BOARD_ITEM::ShowShape( graphic->GetShape() ) );
*aErrorText << msg << "\n";
@ -787,12 +788,12 @@ bool BuildBoardPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, wxStri
items.Collect( aBoard, scan_graphics );
// Make a working copy of aSegList, because the list is modified during calculations
std::vector< DRAWSEGMENT* > segList;
std::vector<PCB_SHAPE*> segList;
for( int ii = 0; ii < items.GetCount(); ii++ )
{
if( items[ii]->GetLayer() == Edge_Cuts )
segList.push_back( static_cast< DRAWSEGMENT* >( items[ii] ) );
segList.push_back( static_cast<PCB_SHAPE*>( items[ii] ) );
}
if( segList.size() )
@ -1008,12 +1009,12 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines,
items.Collect( aBoard, scan_graphics );
// Make a working copy of aSegList, because the list is modified during calculations
std::vector< DRAWSEGMENT* > segList;
std::vector<PCB_SHAPE*> segList;
for( int ii = 0; ii < items.GetCount(); ii++ )
{
if( items[ii]->GetLayer() == Edge_Cuts )
segList.push_back( static_cast< DRAWSEGMENT* >( items[ii] ) );
segList.push_back( static_cast<PCB_SHAPE*>( items[ii] ) );
}
bool success = ConvertOutlineToPolygon( segList, outlines, aErrorText, aTolerance, aErrorLocation );

Some files were not shown because too many files have changed in this diff Show More