Update some classnames including archaic zone names.

This commit is contained in:
Jeff Young 2020-11-11 23:05:59 +00:00
parent fa8c486758
commit f7333ad64a
120 changed files with 964 additions and 1048 deletions

View File

@ -42,8 +42,8 @@
#include <pcb_base_frame.h> #include <pcb_base_frame.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <class_dimension.h> #include <dimension.h>
#include <class_zone.h> #include <zone.h>
#include <class_module.h> #include <class_module.h>
#include <reporter.h> #include <reporter.h>
@ -570,12 +570,12 @@ class BOARD_ADAPTER
PCB_LAYER_ID aLayerId, PCB_LAYER_ID aLayerId,
int aClearanceValue ); int aClearanceValue );
void AddShapeWithClearanceToContainer( const DIMENSION *aDimension, void AddShapeWithClearanceToContainer( const DIMENSION_BASE *aDimension,
CGENERICCONTAINER2D *aDstContainer, CGENERICCONTAINER2D *aDstContainer,
PCB_LAYER_ID aLayerId, PCB_LAYER_ID aLayerId,
int aClearanceValue ); int aClearanceValue );
void AddSolidAreasShapesToContainer( const ZONE_CONTAINER *aZoneContainer, void AddSolidAreasShapesToContainer( const ZONE *aZoneContainer,
CGENERICCONTAINER2D *aDstContainer, CGENERICCONTAINER2D *aDstContainer,
PCB_LAYER_ID aLayerId ); PCB_LAYER_ID aLayerId );

View File

@ -40,7 +40,7 @@
#include <class_pad.h> #include <class_pad.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_zone.h> #include <zone.h>
#include <kicad_string.h> #include <kicad_string.h>
#include <fp_text.h> #include <fp_text.h>
#include <convert_basic_shapes_to_polygon.h> #include <convert_basic_shapes_to_polygon.h>
@ -130,10 +130,9 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const PCB_TEXT* aText,
} }
void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const DIMENSION* aDimension, void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const DIMENSION_BASE* aDimension,
CGENERICCONTAINER2D *aDstContainer, CGENERICCONTAINER2D *aDstContainer,
PCB_LAYER_ID aLayerId, PCB_LAYER_ID aLayerId, int aClearanceValue )
int aClearanceValue )
{ {
AddShapeWithClearanceToContainer(&aDimension->Text(), aDstContainer, aLayerId, aClearanceValue); AddShapeWithClearanceToContainer(&aDimension->Text(), aDstContainer, aLayerId, aClearanceValue);
@ -762,7 +761,7 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const PCB_SHAPE* aDrawSegm
// Based on // Based on
// TransformSolidAreasShapesToPolygonSet // TransformSolidAreasShapesToPolygonSet
// board_items_to_polygon_shape_transform.cpp // board_items_to_polygon_shape_transform.cpp
void BOARD_ADAPTER::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneContainer, void BOARD_ADAPTER::AddSolidAreasShapesToContainer( const ZONE* aZoneContainer,
CGENERICCONTAINER2D *aDstContainer, CGENERICCONTAINER2D *aDstContainer,
PCB_LAYER_ID aLayerId ) PCB_LAYER_ID aLayerId )
{ {

View File

@ -40,7 +40,7 @@
#include <class_pad.h> #include <class_pad.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_zone.h> #include <zone.h>
#include <convert_basic_shapes_to_polygon.h> #include <convert_basic_shapes_to_polygon.h>
#include <trigo.h> #include <trigo.h>
#include <vector> #include <vector>
@ -653,8 +653,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
AddShapeWithClearanceToContainer( (DIMENSION*) item, layerContainer, curr_layer_id, AddShapeWithClearanceToContainer( (DIMENSION_BASE*) item, layerContainer,
0 ); curr_layer_id, 0 );
break; break;
default: default:
@ -711,9 +711,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
if( aStatusReporter ) if( aStatusReporter )
aStatusReporter->Report( _( "Create zones" ) ); aStatusReporter->Report( _( "Create zones" ) );
std::vector<std::pair<const ZONE_CONTAINER*, PCB_LAYER_ID>> zones; std::vector<std::pair<const ZONE*, PCB_LAYER_ID>> zones;
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() ) for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
zones.emplace_back( std::make_pair( zone, layer ) ); zones.emplace_back( std::make_pair( zone, layer ) );
@ -733,7 +733,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
areaId < zones.size(); areaId < zones.size();
areaId = nextZone.fetch_add( 1 ) ) areaId = nextZone.fetch_add( 1 ) )
{ {
const ZONE_CONTAINER* zone = zones[areaId].first; const ZONE* zone = zones[areaId].first;
if( zone == nullptr ) if( zone == nullptr )
break; break;
@ -761,7 +761,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
&& ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) ) && ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) )
{ {
// Add copper zones // Add copper zones
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( zone == nullptr ) if( zone == nullptr )
break; break;
@ -953,7 +953,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
AddShapeWithClearanceToContainer( (DIMENSION*) item, AddShapeWithClearanceToContainer( (DIMENSION_BASE*) item,
layerContainer, layerContainer,
curr_layer_id, curr_layer_id,
0 ); 0 );
@ -1053,13 +1053,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
// Draw non copper zones // Draw non copper zones
if( GetFlag( FL_ZONE ) ) if( GetFlag( FL_ZONE ) )
{ {
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( zone->IsOnLayer( curr_layer_id ) ) if( zone->IsOnLayer( curr_layer_id ) )
AddSolidAreasShapesToContainer( zone, layerContainer, curr_layer_id ); AddSolidAreasShapesToContainer( zone, layerContainer, curr_layer_id );
} }
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( zone->IsOnLayer( curr_layer_id ) ) if( zone->IsOnLayer( curr_layer_id ) )
zone->TransformSolidAreasShapesToPolygon( curr_layer_id, *layerPoly ); zone->TransformSolidAreasShapesToPolygon( curr_layer_id, *layerPoly );

View File

@ -788,9 +788,9 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent &event )
} }
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
{ {
ZONE_CONTAINER* item = dynamic_cast<ZONE_CONTAINER *>( intersectedBoardItem ); ZONE* item = dynamic_cast<ZONE*>( intersectedBoardItem );
if( item ) if( item )
{ {

View File

@ -503,7 +503,7 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/board_items_to_polygon_shape_transform.cpp ${CMAKE_SOURCE_DIR}/pcbnew/board_items_to_polygon_shape_transform.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_board.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_board.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_board_item.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_board_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_dimension.cpp ${CMAKE_SOURCE_DIR}/pcbnew/dimension.cpp
${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp ${CMAKE_SOURCE_DIR}/pcbnew/pcb_shape.cpp
${CMAKE_SOURCE_DIR}/pcbnew/fp_shape.cpp ${CMAKE_SOURCE_DIR}/pcbnew/fp_shape.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_pcb_group.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_pcb_group.cpp
@ -512,12 +512,12 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_list.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_pad.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_pad.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_pcb_target.cpp ${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp
${CMAKE_SOURCE_DIR}/pcbnew/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/board_stackup_manager/class_board_stackup.cpp
${CMAKE_SOURCE_DIR}/pcbnew/fp_text.cpp ${CMAKE_SOURCE_DIR}/pcbnew/fp_text.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_track.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_track.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_zone.cpp ${CMAKE_SOURCE_DIR}/pcbnew/zone.cpp
${CMAKE_SOURCE_DIR}/pcbnew/collectors.cpp ${CMAKE_SOURCE_DIR}/pcbnew/collectors.cpp
${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_algo.cpp ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_algo.cpp
${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_items.cpp ${CMAKE_SOURCE_DIR}/pcbnew/connectivity/connectivity_items.cpp

View File

@ -264,6 +264,7 @@ static struct EDA_ITEM_DESC
.Map( PCB_TEXT_T, _HKI( "Board Text" ) ) .Map( PCB_TEXT_T, _HKI( "Board Text" ) )
.Map( PCB_FP_TEXT_T, _HKI( "Footprint Text" ) ) .Map( PCB_FP_TEXT_T, _HKI( "Footprint Text" ) )
.Map( PCB_FP_SHAPE_T, _HKI( "Graphic Shape" ) ) .Map( PCB_FP_SHAPE_T, _HKI( "Graphic Shape" ) )
.Map( PCB_FP_ZONE_T, _HKI( "Zone" ) )
.Map( PCB_TRACE_T, _HKI( "Track" ) ) .Map( PCB_TRACE_T, _HKI( "Track" ) )
.Map( PCB_VIA_T, _HKI( "Via" ) ) .Map( PCB_VIA_T, _HKI( "Via" ) )
.Map( PCB_MARKER_T, _HKI( "Board Marker" ) ) .Map( PCB_MARKER_T, _HKI( "Board Marker" ) )
@ -272,7 +273,7 @@ static struct EDA_ITEM_DESC
.Map( PCB_DIM_CENTER_T, _HKI( "Center Dimension" ) ) .Map( PCB_DIM_CENTER_T, _HKI( "Center Dimension" ) )
.Map( PCB_DIM_LEADER_T, _HKI( "Leader" ) ) .Map( PCB_DIM_LEADER_T, _HKI( "Leader" ) )
.Map( PCB_TARGET_T, _HKI( "Target" ) ) .Map( PCB_TARGET_T, _HKI( "Target" ) )
.Map( PCB_ZONE_AREA_T, _HKI( "Zone" ) ) .Map( PCB_ZONE_T, _HKI( "Zone" ) )
.Map( PCB_ITEM_LIST_T, _HKI( "Item List" ) ) .Map( PCB_ITEM_LIST_T, _HKI( "Item List" ) )
.Map( PCB_NETINFO_T, _HKI( "Net Info" ) ) .Map( PCB_NETINFO_T, _HKI( "Net Info" ) )
.Map( PCB_GROUP_T, _HKI( "Group" ) ) .Map( PCB_GROUP_T, _HKI( "Group" ) )

View File

@ -207,7 +207,7 @@ struct TEXT_ITEM_INFO
// forward declaration from class_track.h // forward declaration from class_track.h
enum class VIATYPE : int; enum class VIATYPE : int;
// forward declarations from class_dimension.h // forward declarations from dimension.h
enum class DIM_UNITS_FORMAT : int; enum class DIM_UNITS_FORMAT : int;
enum class DIM_TEXT_POSITION : int; enum class DIM_TEXT_POSITION : int;
enum class DIM_UNITS_MODE : int; enum class DIM_UNITS_MODE : int;

View File

@ -92,18 +92,18 @@ enum KICAD_T
PCB_TEXT_T, ///< class PCB_TEXT, text on a layer PCB_TEXT_T, ///< class PCB_TEXT, text on a layer
PCB_FP_TEXT_T, ///< class FP_TEXT, text in a footprint PCB_FP_TEXT_T, ///< class FP_TEXT, text in a footprint
PCB_FP_SHAPE_T, ///< class FP_SHAPE, a footprint edge PCB_FP_SHAPE_T, ///< class FP_SHAPE, a footprint edge
PCB_FP_ZONE_AREA_T, ///< class ZONE_CONTAINER, managed by a footprint PCB_FP_ZONE_T, ///< class ZONE, managed by a footprint
PCB_TRACE_T, ///< class TRACK, a track segment (segment on a copper layer) 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_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 PCB_ARC_T, ///< class ARC, an arc track segment on a copper layer
PCB_MARKER_T, ///< class MARKER_PCB, a marker used to show something PCB_MARKER_T, ///< class MARKER_PCB, a marker used to show something
PCB_DIMENSION_T, ///< class DIMENSION: abstract dimension meta-type PCB_DIMENSION_T, ///< class DIMENSION_BASE: abstract dimension meta-type
PCB_DIM_ALIGNED_T, ///< class ALIGNED_DIMENSION, a linear dimension (graphic item) PCB_DIM_ALIGNED_T, ///< class ALIGNED_DIMENSION, a linear dimension (graphic item)
PCB_DIM_LEADER_T, ///< class LEADER, a leader dimension (graphic item) PCB_DIM_LEADER_T, ///< class LEADER, a leader dimension (graphic item)
PCB_DIM_CENTER_T, ///< class CENTER_DIMENSION, a center point marking (graphic item) PCB_DIM_CENTER_T, ///< class CENTER_DIMENSION, a center point marking (graphic item)
PCB_DIM_ORTHOGONAL_T, ///< class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y PCB_DIM_ORTHOGONAL_T, ///< class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
PCB_TARGET_T, ///< class PCB_TARGET, a target (graphic item) PCB_TARGET_T, ///< class PCB_TARGET, a target (graphic item)
PCB_ZONE_AREA_T, ///< class ZONE_CONTAINER, a zone area PCB_ZONE_T, ///< class ZONE, a copper pour area
PCB_ITEM_LIST_T, ///< class BOARD_ITEM_LIST, a list of board items PCB_ITEM_LIST_T, ///< class BOARD_ITEM_LIST, a list of board items
PCB_NETINFO_T, ///< class NETINFO_ITEM, a description of a net PCB_NETINFO_T, ///< class NETINFO_ITEM, a description of a net
PCB_GROUP_T, ///< class PCB_GROUP, a set of BOARD_ITEMs PCB_GROUP_T, ///< class PCB_GROUP, a set of BOARD_ITEMs

View File

@ -111,7 +111,7 @@ void ARRAY_CREATOR::Invoke()
case PCB_SHAPE_T: case PCB_SHAPE_T:
case PCB_TRACE_T: case PCB_TRACE_T:
case PCB_VIA_T: case PCB_VIA_T:
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
case PCB_TARGET_T: case PCB_TARGET_T:
case PCB_DIM_ALIGNED_T: case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:

View File

@ -150,7 +150,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
} }
else if( boardItem->Type() == PCB_FP_TEXT_T || else if( boardItem->Type() == PCB_FP_TEXT_T ||
boardItem->Type() == PCB_FP_SHAPE_T || boardItem->Type() == PCB_FP_SHAPE_T ||
boardItem->Type() == PCB_FP_ZONE_AREA_T ) boardItem->Type() == PCB_FP_ZONE_T )
{ {
wxASSERT( boardItem->GetParent() && wxASSERT( boardItem->GetParent() &&
boardItem->GetParent()->Type() == PCB_MODULE_T ); boardItem->GetParent()->Type() == PCB_MODULE_T );
@ -187,7 +187,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
case PCB_PAD_T: case PCB_PAD_T:
case PCB_FP_SHAPE_T: case PCB_FP_SHAPE_T:
case PCB_FP_TEXT_T: case PCB_FP_TEXT_T:
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
// This level can only handle module items when editing footprints // This level can only handle module items when editing footprints
wxASSERT( m_isFootprintEditor ); wxASSERT( m_isFootprintEditor );
@ -223,7 +223,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
case PCB_DIM_LEADER_T: // a leader dimension case PCB_DIM_LEADER_T: // a leader dimension
case PCB_TARGET_T: // a target (graphic item) case PCB_TARGET_T: // a target (graphic item)
case PCB_MARKER_T: // a marker used to show something case PCB_MARKER_T: // a marker used to show something
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
view->Remove( boardItem ); view->Remove( boardItem );
if( !( changeFlags & CHT_DONE ) ) if( !( changeFlags & CHT_DONE ) )
@ -369,10 +369,10 @@ EDA_ITEM* BOARD_COMMIT::parentObject( EDA_ITEM* aItem ) const
case PCB_PAD_T: case PCB_PAD_T:
case PCB_FP_SHAPE_T: case PCB_FP_SHAPE_T:
case PCB_FP_TEXT_T: case PCB_FP_TEXT_T:
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
return aItem->GetParent(); return aItem->GetParent();
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
wxASSERT( !dynamic_cast<MODULE*>( aItem->GetParent() ) ); wxASSERT( !dynamic_cast<MODULE*>( aItem->GetParent() ) );
return aItem; return aItem;

View File

@ -60,7 +60,7 @@ public:
case PCB_TRACE_T: case PCB_TRACE_T:
case PCB_ARC_T: case PCB_ARC_T:
case PCB_VIA_T: case PCB_VIA_T:
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
return true; return true;
default: default:

View File

@ -21,7 +21,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <class_dimension.h> #include <dimension.h>
#include <class_track.h> #include <class_track.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
#include <kiface_i.h> #include <kiface_i.h>

View File

@ -31,7 +31,7 @@
#include <kicad_string.h> #include <kicad_string.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_zone.h> #include <zone.h>
#include <class_module.h> #include <class_module.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <convert_basic_shapes_to_polygon.h> #include <convert_basic_shapes_to_polygon.h>
@ -88,7 +88,7 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_
} }
// convert copper zones // convert copper zones
for( ZONE_CONTAINER* zone : Zones() ) for( ZONE* zone : Zones() )
{ {
if( zone->GetLayerSet().test( aLayer ) ) if( zone->GetLayerSet().test( aLayer ) )
zone->TransformSolidAreasShapesToPolygon( aLayer, aOutlines ); zone->TransformSolidAreasShapesToPolygon( aLayer, aOutlines );
@ -283,9 +283,8 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( SHAPE_POLY_SET& aC
} }
void ZONE_CONTAINER::TransformSolidAreasShapesToPolygon( PCB_LAYER_ID aLayer, void ZONE::TransformSolidAreasShapesToPolygon( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aCornerBuffer,
SHAPE_POLY_SET& aCornerBuffer, int aError ) const
int aError ) const
{ {
if( !m_FilledPolysList.count( aLayer ) || m_FilledPolysList.at( aLayer ).IsEmpty() ) if( !m_FilledPolysList.count( aLayer ) || m_FilledPolysList.at( aLayer ).IsEmpty() )
return; return;
@ -711,10 +710,9 @@ bool D_PAD::TransformHoleWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
} }
void ZONE_CONTAINER::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, void ZONE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
PCB_LAYER_ID aLayer, int aClearance, PCB_LAYER_ID aLayer, int aClearance, int aError,
int aError, ERROR_LOC aErrorLoc, ERROR_LOC aErrorLoc, bool ignoreLineWidth ) const
bool ignoreLineWidth ) const
{ {
wxASSERT_MSG( !ignoreLineWidth, "IgnoreLineWidth has no meaning for zones." ); wxASSERT_MSG( !ignoreLineWidth, "IgnoreLineWidth has no meaning for zones." );

View File

@ -34,9 +34,9 @@
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <class_marker_pcb.h> #include <class_marker_pcb.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <core/kicad_algo.h> #include <core/kicad_algo.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
#include <kicad_string.h> #include <kicad_string.h>
@ -102,7 +102,7 @@ BOARD::~BOARD()
// Clean up the owned elements // Clean up the owned elements
DeleteMARKERs(); DeleteMARKERs();
for( ZONE_CONTAINER* zone : m_zones ) for( ZONE* zone : m_zones )
delete zone; delete zone;
m_zones.clear(); m_zones.clear();
@ -251,8 +251,10 @@ void BOARD::Move( const wxPoint& aMoveVector ) // overload
PCB_ARC_T, PCB_ARC_T,
// PCB_PAD_T, Can't be at board level // PCB_PAD_T, Can't be at board level
// PCB_FP_TEXT_T, Can't be at board level // PCB_FP_TEXT_T, Can't be at board level
// PCB_FP_SHAPE_T, Can't be at board level
// PCB_FP_ZONE_T, Can't be at board level
PCB_MODULE_T, PCB_MODULE_T,
PCB_ZONE_AREA_T, PCB_ZONE_T,
EOT EOT
}; };
@ -518,7 +520,7 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID aLayer, bool isEnabled )
pad->SetLocalRatsnestVisible( isEnabled ); pad->SetLocalRatsnestVisible( isEnabled );
} }
for( ZONE_CONTAINER* zone : Zones() ) for( ZONE* zone : Zones() )
zone->SetLocalRatsnestVisible( isEnabled ); zone->SetLocalRatsnestVisible( isEnabled );
break; break;
@ -572,8 +574,8 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
break; break;
// this one uses a vector // this one uses a vector
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
m_zones.push_back( (ZONE_CONTAINER*) aBoardItem ); m_zones.push_back( (ZONE*) aBoardItem );
break; break;
case PCB_TRACE_T: case PCB_TRACE_T:
@ -666,7 +668,7 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem )
} ) ); } ) );
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
m_zones.erase( std::remove_if( m_zones.begin(), m_zones.end(), m_zones.erase( std::remove_if( m_zones.begin(), m_zones.end(),
[aBoardItem]( BOARD_ITEM* aItem ) [aBoardItem]( BOARD_ITEM* aItem )
{ {
@ -802,7 +804,7 @@ BOARD_ITEM* BOARD::GetItem( const KIID& aID ) const
} }
} }
for( ZONE_CONTAINER* zone : Zones() ) for( ZONE* zone : Zones() )
{ {
if( zone->m_Uuid == aID ) if( zone->m_Uuid == aID )
return zone; return zone;
@ -856,7 +858,7 @@ void BOARD::FillItemMap( std::map<KIID, EDA_ITEM*>& aMap )
aMap[ drawing->m_Uuid ] = drawing; aMap[ drawing->m_Uuid ] = drawing;
} }
for( ZONE_CONTAINER* zone : Zones() ) for( ZONE* zone : Zones() )
aMap[ zone->m_Uuid ] = zone; aMap[ zone->m_Uuid ] = zone;
for( BOARD_ITEM* drawing : Drawings() ) for( BOARD_ITEM* drawing : Drawings() )
@ -1039,7 +1041,7 @@ EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
} }
// Check zones // Check zones
for( ZONE_CONTAINER* aZone : m_zones ) for( ZONE* aZone : m_zones )
{ {
if( ( aZone->GetLayerSet() & visible ).any() ) if( ( aZone->GetLayerSet() & visible ).any() )
area.Merge( aZone->GetBoundingBox() ); area.Merge( aZone->GetBoundingBox() );
@ -1118,7 +1120,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
case PCB_PAD_T: case PCB_PAD_T:
case PCB_FP_TEXT_T: case PCB_FP_TEXT_T:
case PCB_FP_SHAPE_T: case PCB_FP_SHAPE_T:
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
// this calls MODULE::Visit() on each module. // this calls MODULE::Visit() on each module.
result = IterateForward<MODULE*>( m_modules, inspector, testData, p ); result = IterateForward<MODULE*>( m_modules, inspector, testData, p );
@ -1132,7 +1134,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
case PCB_PAD_T: case PCB_PAD_T:
case PCB_FP_TEXT_T: case PCB_FP_TEXT_T:
case PCB_FP_SHAPE_T: case PCB_FP_SHAPE_T:
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
continue; continue;
default: default:
@ -1199,8 +1201,8 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
++p; ++p;
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
for( ZONE_CONTAINER* zone : m_zones) for( ZONE* zone : m_zones)
{ {
result = zone->Visit( inspector, testData, p ); result = zone->Visit( inspector, testData, p );
@ -1411,7 +1413,7 @@ int BOARD::SetAreasNetCodesFromNetNames()
{ {
int error_count = 0; int error_count = 0;
for( ZONE_CONTAINER* zone : Zones() ) for( ZONE* zone : Zones() )
{ {
if( !zone->IsOnCopperLayer() ) if( !zone->IsOnCopperLayer() )
{ {
@ -1729,18 +1731,18 @@ MODULE* BOARD::GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer
} }
std::list<ZONE_CONTAINER*> BOARD::GetZoneList( bool aIncludeZonesInFootprints ) std::list<ZONE*> BOARD::GetZoneList( bool aIncludeZonesInFootprints )
{ {
std::list<ZONE_CONTAINER*> zones; std::list<ZONE*> zones;
for( ZONE_CONTAINER* zone : Zones() ) for( ZONE* zone : Zones() )
zones.push_back( zone ); zones.push_back( zone );
if( aIncludeZonesInFootprints ) if( aIncludeZonesInFootprints )
{ {
for( MODULE* footprint : m_modules ) for( MODULE* footprint : m_modules )
{ {
for( MODULE_ZONE_CONTAINER* zone : footprint->Zones() ) for( FP_ZONE* zone : footprint->Zones() )
zones.push_back( zone ); zones.push_back( zone );
} }
} }
@ -1749,10 +1751,10 @@ std::list<ZONE_CONTAINER*> BOARD::GetZoneList( bool aIncludeZonesInFootprints )
} }
ZONE_CONTAINER* BOARD::AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer, ZONE* BOARD::AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
wxPoint aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch ) wxPoint aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch )
{ {
ZONE_CONTAINER* new_area = new ZONE_CONTAINER( this ); ZONE* new_area = new ZONE( this );
new_area->SetNetCode( aNetcode ); new_area->SetNetCode( aNetcode );
new_area->SetLayer( aLayer ); new_area->SetLayer( aLayer );
@ -1774,28 +1776,28 @@ ZONE_CONTAINER* BOARD::AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode,
} }
void BOARD::RemoveArea( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_to_remove ) void BOARD::RemoveZone( PICKED_ITEMS_LIST* aDeletedList, ZONE* aZone )
{ {
if( area_to_remove == NULL ) if( aZone == NULL )
return; return;
if( aDeletedList ) if( aDeletedList )
{ {
ITEM_PICKER picker( nullptr, area_to_remove, UNDO_REDO::DELETED ); ITEM_PICKER picker( nullptr, aZone, UNDO_REDO::DELETED );
aDeletedList->PushItem( picker ); aDeletedList->PushItem( picker );
Remove( area_to_remove ); // remove from zone list, but does not delete it Remove( aZone ); // remove from zone list, but does not delete it
} }
else else
{ {
Delete( area_to_remove ); Delete( aZone );
} }
} }
bool BOARD::NormalizeAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ZONE_CONTAINER* aCurrArea ) bool BOARD::NormalizeAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ZONE* aCurrArea )
{ {
// mark all areas as unmodified except this one, if modified // mark all areas as unmodified except this one, if modified
for( ZONE_CONTAINER* zone : m_zones ) for( ZONE* zone : m_zones )
zone->SetLocalFlags( 0 ); zone->SetLocalFlags( 0 );
aCurrArea->SetLocalFlags( 1 ); aCurrArea->SetLocalFlags( 1 );
@ -1810,7 +1812,7 @@ bool BOARD::NormalizeAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ZONE_CONTAI
// If clipping has created some polygons, we must add these new copper areas. // If clipping has created some polygons, we must add these new copper areas.
if( n_poly > 1 ) if( n_poly > 1 )
{ {
ZONE_CONTAINER* NewArea; ZONE* NewArea;
// Move the newly created polygons to new areas, removing them from the current area // Move the newly created polygons to new areas, removing them from the current area
for( int ip = 1; ip < n_poly; ip++ ) for( int ip = 1; ip < n_poly; ip++ )
@ -1892,7 +1894,7 @@ const std::vector<BOARD_CONNECTED_ITEM*> BOARD::AllConnectedItems()
items.push_back( pad ); items.push_back( pad );
} }
for( ZONE_CONTAINER* zone : Zones() ) for( ZONE* zone : Zones() )
items.push_back( zone ); items.push_back( zone );
return items; return items;

View File

@ -41,7 +41,7 @@ class PCB_BASE_FRAME;
class PCB_EDIT_FRAME; class PCB_EDIT_FRAME;
class PICKED_ITEMS_LIST; class PICKED_ITEMS_LIST;
class BOARD; class BOARD;
class ZONE_CONTAINER; class ZONE;
class TRACK; class TRACK;
class D_PAD; class D_PAD;
class MARKER_PCB; class MARKER_PCB;
@ -165,7 +165,7 @@ public:
DECL_VEC_FOR_SWIG( MARKERS, MARKER_PCB* ) DECL_VEC_FOR_SWIG( MARKERS, MARKER_PCB* )
DECL_VEC_FOR_SWIG( ZONE_CONTAINERS, ZONE_CONTAINER* ) DECL_VEC_FOR_SWIG( ZONES, ZONE* )
DECL_DEQ_FOR_SWIG( TRACKS, TRACK* ) DECL_DEQ_FOR_SWIG( TRACKS, TRACK* )
// Dequeue rather than Vector just so we can use moveUnflaggedItems in pcbnew_control.cpp // Dequeue rather than Vector just so we can use moveUnflaggedItems in pcbnew_control.cpp
DECL_DEQ_FOR_SWIG( GROUPS, PCB_GROUP* ) DECL_DEQ_FOR_SWIG( GROUPS, PCB_GROUP* )
@ -189,31 +189,31 @@ class BOARD : public BOARD_ITEM_CONTAINER
private: private:
/// What is this board being used for /// What is this board being used for
BOARD_USE m_boardUse; BOARD_USE m_boardUse;
wxString m_fileName; wxString m_fileName;
MARKERS m_markers; MARKERS m_markers;
DRAWINGS m_drawings; DRAWINGS m_drawings;
MODULES m_modules; MODULES m_modules;
TRACKS m_tracks; TRACKS m_tracks;
GROUPS m_groups; GROUPS m_groups;
ZONE_CONTAINERS m_zones; ZONES m_zones;
LAYER m_Layer[PCB_LAYER_ID_COUNT]; LAYER m_Layer[PCB_LAYER_ID_COUNT];
// if true m_highLight_NetCode is used // if true m_highLight_NetCode is used
HIGH_LIGHT_INFO m_highLight; // current high light data HIGH_LIGHT_INFO m_highLight; // current high light data
HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
int m_fileFormatVersionAtLoad; // the version loaded from the file int m_fileFormatVersionAtLoad; // the version loaded from the file
std::map<wxString, wxString> m_properties; std::map<wxString, wxString> m_properties;
std::shared_ptr<CONNECTIVITY_DATA> m_connectivity; std::shared_ptr<CONNECTIVITY_DATA> m_connectivity;
PAGE_INFO m_paper; PAGE_INFO m_paper;
TITLE_BLOCK m_titles; // text in lower right of screen and plots TITLE_BLOCK m_titles; // text in lower right of screen and plots
PCB_PLOT_PARAMS m_plotOptions; PCB_PLOT_PARAMS m_plotOptions;
PROJECT* m_project; // project this board is a part of PROJECT* m_project; // project this board is a part of
/** /**
* All of the board design settings are stored as a JSON object inside the project file. The * All of the board design settings are stored as a JSON object inside the project file. The
@ -227,7 +227,7 @@ private:
*/ */
std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings; std::unique_ptr<BOARD_DESIGN_SETTINGS> m_designSettings;
NETINFO_LIST m_NetInfo; // net info list (name, design constraints .. NETINFO_LIST m_NetInfo; // net info list (name, design constraints ..
std::vector<BOARD_LISTENER*> m_listeners; std::vector<BOARD_LISTENER*> m_listeners;
@ -287,8 +287,8 @@ public:
DRAWINGS& Drawings() { return m_drawings; } DRAWINGS& Drawings() { return m_drawings; }
const DRAWINGS& Drawings() const { return m_drawings; } const DRAWINGS& Drawings() const { return m_drawings; }
ZONE_CONTAINERS& Zones() { return m_zones; } ZONES& Zones() { return m_zones; }
const ZONE_CONTAINERS& Zones() const { return m_zones; } const ZONES& Zones() const { return m_zones; }
MARKERS& Markers() { return m_markers; } MARKERS& Markers() { return m_markers; }
@ -877,10 +877,10 @@ public:
/** /**
* Return the Area (Zone Container) at a given index. * Return the Area (Zone Container) at a given index.
* *
* @param index The array type index into a collection of ZONE_CONTAINER *. * @param index The array type index into a collection of ZONE *.
* @return ZONE_CONTAINER* - a pointer to the Area or NULL if index out of range. * @return ZONE* - a pointer to the Area or NULL if index out of range.
*/ */
ZONE_CONTAINER* GetArea( int index ) const ZONE* GetArea( int index ) const
{ {
if( (unsigned) index < m_zones.size() ) if( (unsigned) index < m_zones.size() )
return m_zones[index]; return m_zones[index];
@ -891,10 +891,10 @@ public:
/** /**
* @return a std::list of pointers to all board zones (possibly including zones in footprints) * @return a std::list of pointers to all board zones (possibly including zones in footprints)
*/ */
std::list<ZONE_CONTAINER*> GetZoneList( bool aIncludeZonesInFootprints = false ); std::list<ZONE*> GetZoneList( bool aIncludeZonesInFootprints = false );
/** /**
* @return The number of Areas or ZONE_CONTAINER. * @return The number of copper pour areas or ZONEs.
*/ */
int GetAreaCount() const int GetAreaCount() const
{ {
@ -914,8 +914,8 @@ public:
* @param aHatch = hatch option * @param aHatch = hatch option
* @return a reference to the new area * @return a reference to the new area
*/ */
ZONE_CONTAINER* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer, ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer,
wxPoint aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch ); wxPoint aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch );
/** /**
* Process an area that has been modified, by normalizing its polygon against itself. * Process an area that has been modified, by normalizing its polygon against itself.
@ -925,7 +925,7 @@ public:
* @param aCurrArea = the zone to process * @param aCurrArea = the zone to process
* @return true if changes are made * @return true if changes are made
*/ */
bool NormalizeAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList, ZONE_CONTAINER* aCurrArea ); bool NormalizeAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList, ZONE* aCurrArea );
/** /**
* Process an area that has been modified, by normalizing its polygon * Process an area that has been modified, by normalizing its polygon
@ -936,8 +936,7 @@ public:
* @param modified_area = area to test * @param modified_area = area to test
* @return true if some areas modified * @return true if some areas modified
*/ */
bool OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList, bool OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList, ZONE* modified_area );
ZONE_CONTAINER* modified_area );
/** /**
* Check all copper areas in net for intersections, combining them if found. * Check all copper areas in net for intersections, combining them if found.
@ -949,7 +948,7 @@ public:
* Sets local flag = 1 for any areas modified * Sets local flag = 1 for any areas modified
* @return true if some areas modified * @return true if some areas modified
*/ */
bool CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, bool CombineAllZonesInNet( PICKED_ITEMS_LIST* aDeletedList,
int aNetCode, int aNetCode,
bool aUseLocalFlags ); bool aUseLocalFlags );
@ -958,37 +957,33 @@ public:
* *
* @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas (useful * @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas (useful
* in undo commands can be NULL * in undo commands can be NULL
* @param area_to_remove = area to delete or put in deleted list * @param aZone = area to delete or put in deleted list
*/ */
void RemoveArea( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_to_remove ); void RemoveZone( PICKED_ITEMS_LIST* aDeletedList, ZONE* aZone );
/** /**
* Check for intersection of a given copper area with other areas in same net * Check for intersection of a given copper area with other areas in same net
* @param area_to_test = area to compare to all other areas in the same net * @param aZone = area to compare to all other areas in the same net
*/ */
bool TestAreaIntersections( ZONE_CONTAINER* area_to_test ); bool TestZoneIntersections( ZONE* aZone );
/** /**
* Test for intersection of 2 copper areas * Test for intersection of 2 copper areas
* @param area_ref = area reference * @param aZone1 = area reference
* @param area_to_test = area to compare for intersection calculations * @param aZone2 = area to compare for intersection calculations
* @return : false if no intersection, true if intersection * @return : false if no intersection, true if intersection
*/ */
bool TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_to_test ); bool TestZoneIntersection( ZONE* aZone1, ZONE* aZone2 );
/** /**
* If possible, combine 2 copper areas * If possible, combine 2 copper areas
* @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas * @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas (for undo).
* (useful for undo). * @param aRefZone = the main area (zone)
* @param area_ref = the main area (zone) * @param aZoneToCombine = the zone that can be merged with aRefZone; will be deleted if the
* @param area_to_combine = the zone that can be merged with area_ref * combine is successful
* area_ref must be BEFORE area_to_combine * @return : true if aZoneToCombine is combined with aRefZone (and therefore be deleted)
* area_to_combine will be deleted, if areas are combined
* @return : true if area_to_combine is combined with area_ref (and therefore be deleted)
*/ */
bool CombineAreas( PICKED_ITEMS_LIST* aDeletedList, bool CombineZones( PICKED_ITEMS_LIST* aDeletedList, ZONE* aRefZone, ZONE* aZoneToCombine );
ZONE_CONTAINER* area_ref,
ZONE_CONTAINER* area_to_combine );
/** /**
* Find a pad \a aPosition on \a aLayer. * Find a pad \a aPosition on \a aLayer.

View File

@ -107,9 +107,9 @@ MODULE::MODULE( const MODULE& aFootprint ) :
} }
// Copy zones // Copy zones
for( MODULE_ZONE_CONTAINER* zone : aFootprint.Zones() ) for( FP_ZONE* zone : aFootprint.Zones() )
{ {
MODULE_ZONE_CONTAINER* newZone = static_cast<MODULE_ZONE_CONTAINER*>( zone->Clone() ); FP_ZONE* newZone = static_cast<FP_ZONE*>( zone->Clone() );
ptrMap[ zone ] = newZone; ptrMap[ zone ] = newZone;
Add( newZone ); Add( newZone );
@ -183,7 +183,7 @@ MODULE::~MODULE()
m_pads.clear(); m_pads.clear();
for( MODULE_ZONE_CONTAINER* zone : m_fp_zones ) for( FP_ZONE* zone : m_fp_zones )
delete zone; delete zone;
m_fp_zones.clear(); m_fp_zones.clear();
@ -242,7 +242,7 @@ MODULE& MODULE::operator=( MODULE&& aOther )
// Move the zones // Move the zones
m_fp_zones.clear(); m_fp_zones.clear();
for( MODULE_ZONE_CONTAINER* item : aOther.Zones() ) for( FP_ZONE* item : aOther.Zones() )
{ {
Add( item ); Add( item );
@ -340,9 +340,9 @@ MODULE& MODULE::operator=( const MODULE& aOther )
// Copy zones // Copy zones
m_fp_zones.clear(); m_fp_zones.clear();
for( MODULE_ZONE_CONTAINER* zone : aOther.Zones() ) for( FP_ZONE* zone : aOther.Zones() )
{ {
MODULE_ZONE_CONTAINER* newZone = static_cast<MODULE_ZONE_CONTAINER*>( zone->Clone() ); FP_ZONE* newZone = static_cast<FP_ZONE*>( zone->Clone() );
ptrMap[ zone ] = newZone; ptrMap[ zone ] = newZone;
Add( newZone ); Add( newZone );
@ -461,11 +461,11 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
m_pads.push_front( static_cast<D_PAD*>( aBoardItem ) ); m_pads.push_front( static_cast<D_PAD*>( aBoardItem ) );
break; break;
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
if( aMode == ADD_MODE::APPEND ) if( aMode == ADD_MODE::APPEND )
m_fp_zones.push_back( static_cast<MODULE_ZONE_CONTAINER*>( aBoardItem ) ); m_fp_zones.push_back( static_cast<FP_ZONE*>( aBoardItem ) );
else else
m_fp_zones.insert( m_fp_zones.begin(), static_cast<MODULE_ZONE_CONTAINER*>( aBoardItem ) ); m_fp_zones.insert( m_fp_zones.begin(), static_cast<FP_ZONE*>( aBoardItem ) );
break; break;
case PCB_GROUP_T: case PCB_GROUP_T:
@ -526,10 +526,10 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem )
break; break;
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
for( auto it = m_fp_zones.begin(); it != m_fp_zones.end(); ++it ) for( auto it = m_fp_zones.begin(); it != m_fp_zones.end(); ++it )
{ {
if( *it == static_cast<MODULE_ZONE_CONTAINER*>( aBoardItem ) ) if( *it == static_cast<FP_ZONE*>( aBoardItem ) )
{ {
m_fp_zones.erase( it ); m_fp_zones.erase( it );
break; break;
@ -592,7 +592,7 @@ EDA_RECT MODULE::GetFootprintRect() const
for( D_PAD* pad : m_pads ) for( D_PAD* pad : m_pads )
area.Merge( pad->GetBoundingBox() ); area.Merge( pad->GetBoundingBox() );
for( MODULE_ZONE_CONTAINER* zone : m_fp_zones ) for( FP_ZONE* zone : m_fp_zones )
area.Merge( zone->GetBoundingBox() ); area.Merge( zone->GetBoundingBox() );
// Groups do not contribute to the rect, only their members // Groups do not contribute to the rect, only their members
@ -823,7 +823,7 @@ bool MODULE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) co
return true; return true;
} }
for( MODULE_ZONE_CONTAINER* zone : m_fp_zones ) for( FP_ZONE* zone : m_fp_zones )
{ {
if( zone->HitTest( arect, false, 0 ) ) if( zone->HitTest( arect, false, 0 ) )
return true; return true;
@ -982,8 +982,8 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T
++p; ++p;
break; break;
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
result = IterateForward<MODULE_ZONE_CONTAINER*>( m_fp_zones, inspector, testData, p ); result = IterateForward<FP_ZONE*>( m_fp_zones, inspector, testData, p );
++p; ++p;
break; break;
@ -1070,8 +1070,8 @@ void MODULE::RunOnChildren( const std::function<void (BOARD_ITEM*)>& aFunction )
for( D_PAD* pad : m_pads ) for( D_PAD* pad : m_pads )
aFunction( static_cast<BOARD_ITEM*>( pad ) ); aFunction( static_cast<BOARD_ITEM*>( pad ) );
for( MODULE_ZONE_CONTAINER* zone : m_fp_zones ) for( FP_ZONE* zone : m_fp_zones )
aFunction( static_cast<MODULE_ZONE_CONTAINER*>( zone ) ); aFunction( static_cast<FP_ZONE*>( zone ) );
for( PCB_GROUP* group : m_fp_groups ) for( PCB_GROUP* group : m_fp_groups )
aFunction( static_cast<PCB_GROUP*>( group ) ); aFunction( static_cast<PCB_GROUP*>( group ) );
@ -1287,7 +1287,7 @@ void MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
pad->Flip( m_Pos, false ); pad->Flip( m_Pos, false );
// Mirror zones to other side of board. // Mirror zones to other side of board.
for( ZONE_CONTAINER* zone : m_fp_zones ) for( ZONE* zone : m_fp_zones )
zone->Flip( m_Pos, aFlipLeftRight ); zone->Flip( m_Pos, aFlipLeftRight );
// Mirror reference and value. // Mirror reference and value.
@ -1333,7 +1333,7 @@ void MODULE::SetPosition( const wxPoint& aPos )
for( D_PAD* pad : m_pads ) for( D_PAD* pad : m_pads )
pad->SetPosition( pad->GetPosition() + delta ); pad->SetPosition( pad->GetPosition() + delta );
for( ZONE_CONTAINER* zone : m_fp_zones ) for( ZONE* zone : m_fp_zones )
zone->Move( delta ); zone->Move( delta );
for( BOARD_ITEM* item : m_drawings ) for( BOARD_ITEM* item : m_drawings )
@ -1435,7 +1435,7 @@ void MODULE::SetOrientation( double aNewAngle )
pad->SetDrawCoord(); pad->SetDrawCoord();
} }
for( ZONE_CONTAINER* zone : m_fp_zones ) for( ZONE* zone : m_fp_zones )
{ {
zone->Rotate( GetPosition(), angleChange ); zone->Rotate( GetPosition(), angleChange );
} }
@ -1476,7 +1476,7 @@ BOARD_ITEM* MODULE::Duplicate() const
BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule ) BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule )
{ {
BOARD_ITEM* new_item = NULL; BOARD_ITEM* new_item = NULL;
MODULE_ZONE_CONTAINER* new_zone = NULL; FP_ZONE* new_zone = NULL;
switch( aItem->Type() ) switch( aItem->Type() )
{ {
@ -1492,9 +1492,9 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule )
break; break;
} }
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
{ {
new_zone = new MODULE_ZONE_CONTAINER( *static_cast<const MODULE_ZONE_CONTAINER*>( aItem ) ); new_zone = new FP_ZONE( *static_cast<const FP_ZONE*>( aItem ) );
const_cast<KIID&>( new_zone->m_Uuid ) = KIID(); const_cast<KIID&>( new_zone->m_Uuid ) = KIID();
if( aAddToModule ) if( aAddToModule )

View File

@ -37,7 +37,7 @@
#include "zones.h" #include "zones.h"
#include <fp_text.h> #include <fp_text.h>
#include <class_zone.h> #include <zone.h>
#include <functional> #include <functional>
class LINE_READER; class LINE_READER;
@ -100,7 +100,7 @@ public:
DECL_DEQ_FOR_SWIG( PADS, D_PAD* ) DECL_DEQ_FOR_SWIG( PADS, D_PAD* )
DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* ) DECL_DEQ_FOR_SWIG( DRAWINGS, BOARD_ITEM* )
DECL_VEC_FOR_SWIG( MODULE_ZONE_CONTAINERS, MODULE_ZONE_CONTAINER* ) DECL_VEC_FOR_SWIG( FP_ZONES, FP_ZONE* )
DECL_VEC_FOR_SWIG( MODULE_GROUPS, PCB_GROUP* ) DECL_VEC_FOR_SWIG( MODULE_GROUPS, PCB_GROUP* )
DECL_DEQ_FOR_SWIG( MODULES, MODULE* ) DECL_DEQ_FOR_SWIG( MODULES, MODULE* )
@ -176,19 +176,18 @@ public:
// Virtual function // Virtual function
const EDA_RECT GetBoundingBox() const override; const EDA_RECT GetBoundingBox() const override;
const EDA_RECT GetBoundingBox( bool aIncludeInvisibleText ) const; const EDA_RECT GetBoundingBox( bool aIncludeInvisibleText ) const;
PADS& Pads() { return m_pads; } PADS& Pads() { return m_pads; }
const PADS& Pads() const { return m_pads; } const PADS& Pads() const { return m_pads; }
DRAWINGS& GraphicalItems() { return m_drawings; } DRAWINGS& GraphicalItems() { return m_drawings; }
const DRAWINGS& GraphicalItems() const { return m_drawings; } const DRAWINGS& GraphicalItems() const { return m_drawings; }
MODULE_ZONE_CONTAINERS& Zones() { return m_fp_zones; } FP_ZONES& Zones() { return m_fp_zones; }
const MODULE_ZONE_CONTAINERS& Zones() const { return m_fp_zones; } const FP_ZONES& Zones() const { return m_fp_zones; }
MODULE_GROUPS& Groups() { return m_fp_groups; } MODULE_GROUPS& Groups() { return m_fp_groups; }
const MODULE_GROUPS& Groups() const { return m_fp_groups; } const MODULE_GROUPS& Groups() const { return m_fp_groups; }
bool HasThroughHolePads() const; bool HasThroughHolePads() const;
@ -197,11 +196,9 @@ public:
const std::list<MODULE_3D_SETTINGS>& Models() const { return m_3D_Drawings; } const std::list<MODULE_3D_SETTINGS>& Models() const { return m_3D_Drawings; }
void SetPosition( const wxPoint& aPos ) override; void SetPosition( const wxPoint& aPos ) override;
wxPoint GetPosition() const override { return m_Pos; } wxPoint GetPosition() const override { return m_Pos; }
void SetOrientation( double aNewAngle ); void SetOrientation( double aNewAngle );
void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); } void SetOrientationDegrees( double aOrientation ) { SetOrientation( aOrientation * 10.0 ); }
double GetOrientation() const { return m_Orient; } double GetOrientation() const { return m_Orient; }
double GetOrientationDegrees() const { return m_Orient / 10.0; } double GetOrientationDegrees() const { return m_Orient / 10.0; }
@ -696,7 +693,7 @@ public:
private: private:
DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer. DRAWINGS m_drawings; // BOARD_ITEMs for drawings on the board, owned by pointer.
PADS m_pads; // D_PAD items, owned by pointer PADS m_pads; // D_PAD items, owned by pointer
MODULE_ZONE_CONTAINERS m_fp_zones; // MODULE_ZONE_CONTAINER items, owned by pointer FP_ZONES m_fp_zones; // FP_ZONE items, owned by pointer
MODULE_GROUPS m_fp_groups; // PCB_GROUP items, owned by pointer MODULE_GROUPS m_fp_groups; // PCB_GROUP items, owned by pointer
double m_Orient; // Orientation in tenths of a degree, 900=90.0 degrees. double m_Orient; // Orientation in tenths of a degree, 900=90.0 degrees.

View File

@ -30,8 +30,8 @@
#include <class_pad.h> #include <class_pad.h>
#include <class_track.h> #include <class_track.h>
#include <class_marker_pcb.h> #include <class_marker_pcb.h>
#include <class_dimension.h> #include <dimension.h>
#include <class_zone.h> #include <zone.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <class_pcb_group.h> #include <class_pcb_group.h>
#include <macros.h> #include <macros.h>
@ -46,22 +46,22 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
// there are some restrictions on the order of items in the general case. // there are some restrictions on the order of items in the general case.
// all items in m_Drawings for instance should be contiguous. // all items in m_Drawings for instance should be contiguous.
// *** all items in a same list (shown here) must be contiguous **** // *** all items in a same list (shown here) must be contiguous ****
PCB_MARKER_T, // in m_markers PCB_MARKER_T, // in m_markers
PCB_TEXT_T, // in m_drawings PCB_TEXT_T, // in m_drawings
PCB_SHAPE_T, // in m_drawings PCB_SHAPE_T, // in m_drawings
PCB_DIM_ALIGNED_T, // in m_drawings PCB_DIM_ALIGNED_T, // in m_drawings
PCB_DIM_CENTER_T, // in m_drawings PCB_DIM_CENTER_T, // in m_drawings
PCB_DIM_ORTHOGONAL_T, // in m_drawings PCB_DIM_ORTHOGONAL_T, // in m_drawings
PCB_DIM_LEADER_T, // in m_drawings PCB_DIM_LEADER_T, // in m_drawings
PCB_TARGET_T, // in m_drawings PCB_TARGET_T, // in m_drawings
PCB_VIA_T, // in m_tracks PCB_VIA_T, // in m_tracks
PCB_TRACE_T, // in m_tracks PCB_TRACE_T, // in m_tracks
PCB_ARC_T, // in m_tracks PCB_ARC_T, // in m_tracks
PCB_PAD_T, // in footprints PCB_PAD_T, // in footprints
PCB_FP_TEXT_T, // in footprints PCB_FP_TEXT_T, // in footprints
PCB_MODULE_T, // in m_footprints PCB_MODULE_T, // in m_footprints
PCB_GROUP_T, // in m_groups PCB_GROUP_T, // in m_groups
PCB_ZONE_AREA_T, // in m_zones PCB_ZONE_T, // in m_zones
EOT EOT
}; };
@ -80,7 +80,7 @@ const KICAD_T GENERAL_COLLECTOR::BoardLevelItems[] = {
PCB_TRACE_T, PCB_TRACE_T,
PCB_MODULE_T, PCB_MODULE_T,
PCB_GROUP_T, PCB_GROUP_T,
PCB_ZONE_AREA_T, PCB_ZONE_T,
EOT EOT
}; };
@ -101,7 +101,7 @@ const KICAD_T GENERAL_COLLECTOR::AllButZones[] = {
PCB_FP_TEXT_T, PCB_FP_TEXT_T,
PCB_MODULE_T, PCB_MODULE_T,
PCB_GROUP_T, PCB_GROUP_T,
PCB_ZONE_AREA_T, // if it is visible on screen, it should be selectable PCB_ZONE_T, // if it is visible on screen, it should be selectable
EOT EOT
}; };
@ -133,7 +133,7 @@ const KICAD_T GENERAL_COLLECTOR::ModulesAndTheirItems[] = {
PCB_FP_TEXT_T, PCB_FP_TEXT_T,
PCB_FP_SHAPE_T, PCB_FP_SHAPE_T,
PCB_PAD_T, PCB_PAD_T,
PCB_FP_ZONE_AREA_T, PCB_FP_ZONE_T,
PCB_GROUP_T, PCB_GROUP_T,
EOT EOT
}; };
@ -143,7 +143,7 @@ const KICAD_T GENERAL_COLLECTOR::ModuleItems[] = {
PCB_FP_TEXT_T, PCB_FP_TEXT_T,
PCB_FP_SHAPE_T, PCB_FP_SHAPE_T,
PCB_PAD_T, PCB_PAD_T,
PCB_FP_ZONE_AREA_T, PCB_FP_ZONE_T,
PCB_GROUP_T, PCB_GROUP_T,
EOT EOT
}; };
@ -168,8 +168,8 @@ const KICAD_T GENERAL_COLLECTOR::LockableItems[] = {
const KICAD_T GENERAL_COLLECTOR::Zones[] = { const KICAD_T GENERAL_COLLECTOR::Zones[] = {
PCB_ZONE_AREA_T, PCB_ZONE_T,
PCB_FP_ZONE_AREA_T, PCB_FP_ZONE_T,
EOT EOT
}; };
@ -194,9 +194,9 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
bool pad_through = false; bool pad_through = false;
VIA* via = nullptr; VIA* via = nullptr;
MARKER_PCB* marker = nullptr; MARKER_PCB* marker = nullptr;
ZONE_CONTAINER* zone = nullptr; ZONE* zone = nullptr;
PCB_SHAPE* shape = nullptr; PCB_SHAPE* shape = nullptr;
DIMENSION* dimension = nullptr; DIMENSION_BASE* dimension = nullptr;
#if 0 // debugging #if 0 // debugging
static int breakhere = 0; static int breakhere = 0;
@ -304,14 +304,14 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
goto exit; goto exit;
break; break;
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
module = static_cast<MODULE*>( item->GetParent() ); module = static_cast<MODULE*>( item->GetParent() );
// Fallthrough to get the zone as well // Fallthrough to get the zone as well
KI_FALLTHROUGH; KI_FALLTHROUGH;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
zone = static_cast<ZONE_CONTAINER*>( item ); zone = static_cast<ZONE*>( item );
break; break;
case PCB_TEXT_T: case PCB_TEXT_T:
@ -325,7 +325,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
dimension = static_cast<DIMENSION*>( item ); dimension = static_cast<DIMENSION_BASE*>( item );
break; break;
case PCB_TARGET_T: case PCB_TARGET_T:

View File

@ -74,13 +74,11 @@ bool CN_CONNECTIVITY_ALGO::Remove( BOARD_ITEM* aItem )
m_itemList.SetDirty( true ); m_itemList.SetDirty( true );
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
{
m_itemMap[aItem].MarkItemsAsInvalid(); m_itemMap[aItem].MarkItemsAsInvalid();
m_itemMap.erase ( aItem ); m_itemMap.erase ( aItem );
m_itemList.SetDirty( true ); m_itemList.SetDirty( true );
break; break;
}
default: default:
return false; return false;
@ -174,9 +172,9 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
{ {
auto zone = static_cast<ZONE_CONTAINER*>( aItem ); ZONE* zone = static_cast<ZONE*>( aItem );
if( m_itemMap.find( aItem ) != m_itemMap.end() ) if( m_itemMap.find( aItem ) != m_itemMap.end() )
return false; return false;
@ -184,8 +182,10 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
m_itemMap[zone] = ITEM_MAP_ENTRY(); m_itemMap[zone] = ITEM_MAP_ENTRY();
for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() ) for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
for( auto zitem : m_itemList.Add( zone, layer ) ) {
for( CN_ITEM* zitem : m_itemList.Add( zone, layer ) )
m_itemMap[zone].Link( zitem ); m_itemMap[zone].Link( zitem );
}
break; break;
} }
@ -298,7 +298,7 @@ void CN_CONNECTIVITY_ALGO::searchConnections()
const CN_CONNECTIVITY_ALGO::CLUSTERS CN_CONNECTIVITY_ALGO::SearchClusters( CLUSTER_SEARCH_MODE aMode ) const CN_CONNECTIVITY_ALGO::CLUSTERS CN_CONNECTIVITY_ALGO::SearchClusters( CLUSTER_SEARCH_MODE aMode )
{ {
constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_ARC_T, PCB_PAD_T, PCB_VIA_T, PCB_ZONE_AREA_T, constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_ARC_T, PCB_PAD_T, PCB_VIA_T, PCB_ZONE_T,
PCB_MODULE_T, EOT }; PCB_MODULE_T, EOT };
constexpr KICAD_T no_zones[] = { PCB_TRACE_T, PCB_ARC_T, PCB_PAD_T, PCB_VIA_T, constexpr KICAD_T no_zones[] = { PCB_TRACE_T, PCB_ARC_T, PCB_PAD_T, PCB_VIA_T,
PCB_MODULE_T, EOT }; PCB_MODULE_T, EOT };
@ -438,7 +438,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
size *= 2; // Our caller us gets the other half of the progress bar size *= 2; // Our caller us gets the other half of the progress bar
for( ZONE_CONTAINER* zone : aBoard->Zones() ) for( ZONE* zone : aBoard->Zones() )
{ {
Add( zone ); Add( zone );
reportProgress( aReporter, ii++, size, delta ); reportProgress( aReporter, ii++, size, delta );
@ -550,8 +550,7 @@ void CN_CONNECTIVITY_ALGO::PropagateNets( BOARD_COMMIT* aCommit )
} }
void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( ZONE_CONTAINER* aZone, void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( ZONE* aZone, PCB_LAYER_ID aLayer,
PCB_LAYER_ID aLayer,
std::vector<int>& aIslands ) std::vector<int>& aIslands )
{ {
if( aZone->GetFilledPolysList( aLayer ).IsEmpty() ) if( aZone->GetFilledPolysList( aLayer ).IsEmpty() )
@ -676,8 +675,8 @@ void CN_VISITOR::checkZoneItemConnection( CN_ZONE_LAYER* aZoneLayer, CN_ITEM* aI
void CN_VISITOR::checkZoneZoneConnection( CN_ZONE_LAYER* aZoneLayerA, CN_ZONE_LAYER* aZoneLayerB ) void CN_VISITOR::checkZoneZoneConnection( CN_ZONE_LAYER* aZoneLayerA, CN_ZONE_LAYER* aZoneLayerB )
{ {
const auto zoneA = static_cast<const ZONE_CONTAINER*>( aZoneLayerA->Parent() ); const ZONE* zoneA = static_cast<const ZONE*>( aZoneLayerA->Parent() );
const auto zoneB = static_cast<const ZONE_CONTAINER*>( aZoneLayerB->Parent() ); const ZONE* zoneB = static_cast<const ZONE*>( aZoneLayerB->Parent() );
if( aZoneLayerA->Layer() != aZoneLayerB->Layer() ) if( aZoneLayerA->Layer() != aZoneLayerB->Layer() )
return; return;
@ -754,20 +753,20 @@ bool CN_VISITOR::operator()( CN_ITEM* aCandidate )
return true; return true;
// We should handle zone-zone connection separately // We should handle zone-zone connection separately
if ( parentA->Type() == PCB_ZONE_AREA_T && parentB->Type() == PCB_ZONE_AREA_T ) if ( parentA->Type() == PCB_ZONE_T && parentB->Type() == PCB_ZONE_T )
{ {
checkZoneZoneConnection( static_cast<CN_ZONE_LAYER*>( m_item ), checkZoneZoneConnection( static_cast<CN_ZONE_LAYER*>( m_item ),
static_cast<CN_ZONE_LAYER*>( aCandidate ) ); static_cast<CN_ZONE_LAYER*>( aCandidate ) );
return true; return true;
} }
if( parentA->Type() == PCB_ZONE_AREA_T ) if( parentA->Type() == PCB_ZONE_T )
{ {
checkZoneItemConnection( static_cast<CN_ZONE_LAYER*>( aCandidate ), m_item ); checkZoneItemConnection( static_cast<CN_ZONE_LAYER*>( aCandidate ), m_item );
return true; return true;
} }
if( parentB->Type() == PCB_ZONE_AREA_T ) if( parentB->Type() == PCB_ZONE_T )
{ {
checkZoneItemConnection( static_cast<CN_ZONE_LAYER*>( m_item ), aCandidate ); checkZoneItemConnection( static_cast<CN_ZONE_LAYER*>( m_item ), aCandidate );
return true; return true;

View File

@ -32,7 +32,7 @@
#include <class_board.h> #include <class_board.h>
#include <class_pad.h> #include <class_pad.h>
#include <class_module.h> #include <class_module.h>
#include <class_zone.h> #include <zone.h>
#include <geometry/shape_poly_set.h> #include <geometry/shape_poly_set.h>
#include <geometry/poly_grid_partition.h> #include <geometry/poly_grid_partition.h>
@ -53,7 +53,7 @@ class CN_RATSNEST_NODES;
class BOARD; class BOARD;
class BOARD_CONNECTED_ITEM; class BOARD_CONNECTED_ITEM;
class BOARD_ITEM; class BOARD_ITEM;
class ZONE_CONTAINER; class ZONE;
class PROGRESS_REPORTER; class PROGRESS_REPORTER;
class CN_EDGE class CN_EDGE
@ -224,25 +224,25 @@ public:
return m_dirtyNets.size(); return m_dirtyNets.size();
} }
void Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter = nullptr ); void Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter = nullptr );
void Build( const std::vector<BOARD_ITEM*>& aItems ); void Build( const std::vector<BOARD_ITEM*>& aItems );
void Clear(); void Clear();
bool Remove( BOARD_ITEM* aItem ); bool Remove( BOARD_ITEM* aItem );
bool Add( BOARD_ITEM* aItem ); bool Add( BOARD_ITEM* aItem );
const CLUSTERS SearchClusters( CLUSTER_SEARCH_MODE aMode, const KICAD_T aTypes[], int aSingleNet ); const CLUSTERS SearchClusters( CLUSTER_SEARCH_MODE aMode, const KICAD_T aTypes[],
const CLUSTERS SearchClusters( CLUSTER_SEARCH_MODE aMode ); int aSingleNet );
const CLUSTERS SearchClusters( CLUSTER_SEARCH_MODE aMode );
/** /**
* Propagates nets from pads to other items in clusters * Propagates nets from pads to other items in clusters
* @param aCommit is used to store undo information for items modified by the call * @param aCommit is used to store undo information for items modified by the call
*/ */
void PropagateNets( BOARD_COMMIT* aCommit = nullptr ); void PropagateNets( BOARD_COMMIT* aCommit = nullptr );
void FindIsolatedCopperIslands( ZONE_CONTAINER* aZone, PCB_LAYER_ID aLayer, void FindIsolatedCopperIslands( ZONE* aZone, PCB_LAYER_ID aLayer, std::vector<int>& aIslands );
std::vector<int>& aIslands );
/** /**
* Finds the copper islands that are not connected to a net. These are added to * Finds the copper islands that are not connected to a net. These are added to
@ -250,7 +250,7 @@ public:
* N.B. This must be called after aZones has been refreshed. * N.B. This must be called after aZones has been refreshed.
* @param: aZones The set of zones to search for islands * @param: aZones The set of zones to search for islands
*/ */
void FindIsolatedCopperIslands( std::vector<CN_ZONE_ISOLATED_ISLAND_LIST>& aZones ); void FindIsolatedCopperIslands( std::vector<CN_ZONE_ISOLATED_ISLAND_LIST>& aZones );
const CLUSTERS& GetClusters(); const CLUSTERS& GetClusters();

View File

@ -257,8 +257,7 @@ int CONNECTIVITY_DATA::GetNetCount() const
} }
void CONNECTIVITY_DATA::FindIsolatedCopperIslands( ZONE_CONTAINER* aZone, void CONNECTIVITY_DATA::FindIsolatedCopperIslands( ZONE* aZone, std::vector<int>& aIslands )
std::vector<int>& aIslands )
{ {
// TODO(JE) ZONES // TODO(JE) ZONES
#if 0 #if 0

View File

@ -36,7 +36,7 @@
#include <math/vector2d.h> #include <math/vector2d.h>
#include <geometry/shape_poly_set.h> #include <geometry/shape_poly_set.h>
#include <class_zone.h> #include <zone.h>
class FROM_TO_CACHE; class FROM_TO_CACHE;
class CN_CLUSTER; class CN_CLUSTER;
@ -46,7 +46,7 @@ class BOARD;
class BOARD_COMMIT; class BOARD_COMMIT;
class BOARD_CONNECTED_ITEM; class BOARD_CONNECTED_ITEM;
class BOARD_ITEM; class BOARD_ITEM;
class ZONE_CONTAINER; class ZONE;
class RN_DATA; class RN_DATA;
class RN_NET; class RN_NET;
class TRACK; class TRACK;
@ -66,11 +66,11 @@ struct CN_DISJOINT_NET_ENTRY
*/ */
struct CN_ZONE_ISOLATED_ISLAND_LIST struct CN_ZONE_ISOLATED_ISLAND_LIST
{ {
CN_ZONE_ISOLATED_ISLAND_LIST( ZONE_CONTAINER* aZone ) : CN_ZONE_ISOLATED_ISLAND_LIST( ZONE* aZone ) :
m_zone( aZone ) m_zone( aZone )
{} {}
ZONE_CONTAINER* m_zone; ZONE* m_zone;
std::map<PCB_LAYER_ID, std::vector<int>> m_islands; std::map<PCB_LAYER_ID, std::vector<int>> m_islands;
}; };
@ -167,7 +167,7 @@ public:
* @param aZone zone to test * @param aZone zone to test
* @param aIslands list of islands that have no connections (outline indices in the polygon set) * @param aIslands list of islands that have no connections (outline indices in the polygon set)
*/ */
void FindIsolatedCopperIslands( ZONE_CONTAINER* aZone, std::vector<int>& aIslands ); void FindIsolatedCopperIslands( ZONE* aZone, std::vector<int>& aIslands );
void FindIsolatedCopperIslands( std::vector<CN_ZONE_ISOLATED_ISLAND_LIST>& aZones ); void FindIsolatedCopperIslands( std::vector<CN_ZONE_ISOLATED_ISLAND_LIST>& aZones );
/** /**

View File

@ -166,8 +166,8 @@ int CN_ZONE_LAYER::AnchorCount() const
if( !Valid() ) if( !Valid() )
return 0; return 0;
const auto zone = static_cast<const ZONE_CONTAINER*>( Parent() ); const ZONE* zone = static_cast<const ZONE*>( Parent() );
const auto& outline = zone->GetFilledPolysList( m_layer ).COutline( m_subpolyIndex ); const SHAPE_LINE_CHAIN& outline = zone->GetFilledPolysList( m_layer ).COutline( m_subpolyIndex );
return outline.PointCount() ? 1 : 0; return outline.PointCount() ? 1 : 0;
} }
@ -178,8 +178,8 @@ const VECTOR2I CN_ZONE_LAYER::GetAnchor( int n ) const
if( !Valid() ) if( !Valid() )
return VECTOR2I(); return VECTOR2I();
const auto zone = static_cast<const ZONE_CONTAINER*>( Parent() ); const ZONE* zone = static_cast<const ZONE*>( Parent() );
const auto& outline = zone->GetFilledPolysList( m_layer ).COutline( m_subpolyIndex ); const SHAPE_LINE_CHAIN& outline = zone->GetFilledPolysList( m_layer ).COutline( m_subpolyIndex );
return outline.CPoint( 0 ); return outline.CPoint( 0 );
} }
@ -271,7 +271,7 @@ CN_ITEM* CN_LIST::Add( ARC* aArc )
return item; return item;
} }
const std::vector<CN_ITEM*> CN_LIST::Add( ZONE_CONTAINER* zone, PCB_LAYER_ID aLayer ) const std::vector<CN_ITEM*> CN_LIST::Add( ZONE* zone, PCB_LAYER_ID aLayer )
{ {
const auto& polys = zone->GetFilledPolysList( aLayer ); const auto& polys = zone->GetFilledPolysList( aLayer );
@ -367,9 +367,9 @@ bool CN_ANCHOR::IsDangling() const
connected_count = 0; connected_count = 0;
for( auto item : m_item->ConnectedItems() ) for( auto item : m_item->ConnectedItems() )
{ {
if( item->Parent()->Type() == PCB_ZONE_AREA_T ) if( item->Parent()->Type() == PCB_ZONE_T )
{ {
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( item->Parent() ); ZONE* zone = static_cast<ZONE*>( item->Parent() );
if( zone->HitTestFilledArea( static_cast<PCB_LAYER_ID>( item->Layer() ), if( zone->HitTestFilledArea( static_cast<PCB_LAYER_ID>( item->Layer() ),
wxPoint( Pos() ), accuracy ) ) wxPoint( Pos() ), accuracy ) )
@ -390,17 +390,17 @@ int CN_ANCHOR::ConnectedItemsCount() const
int connected_count = 0; int connected_count = 0;
for( auto item : m_item->ConnectedItems() ) for( CN_ITEM* item : m_item->ConnectedItems() )
{ {
if( item->Parent()->Type() == PCB_ZONE_AREA_T ) if( item->Parent()->Type() == PCB_ZONE_T )
{ {
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( item->Parent() ); ZONE* zone = static_cast<ZONE*>( item->Parent() );
if( zone->HitTestFilledArea( static_cast<PCB_LAYER_ID>( item->Layer() ), if( zone->HitTestFilledArea( static_cast<PCB_LAYER_ID>( item->Layer() ),
wxPoint( Pos().x, Pos().y ) ) ) (wxPoint) Pos() ) )
connected_count++; connected_count++;
} }
else if( item->Parent()->HitTest( wxPoint( Pos().x, Pos().y ) ) ) else if( item->Parent()->HitTest( (wxPoint) Pos() ) )
connected_count++; connected_count++;
} }

View File

@ -33,7 +33,7 @@
#include <class_pad.h> #include <class_pad.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <geometry/shape_poly_set.h> #include <geometry/shape_poly_set.h>
#include <geometry/poly_grid_partition.h> #include <geometry/poly_grid_partition.h>
@ -357,8 +357,7 @@ typedef std::shared_ptr<CN_ITEM> CN_ITEM_PTR;
class CN_ZONE_LAYER : public CN_ITEM class CN_ZONE_LAYER : public CN_ITEM
{ {
public: public:
CN_ZONE_LAYER( ZONE_CONTAINER* aParent, PCB_LAYER_ID aLayer, bool aCanChangeNet, CN_ZONE_LAYER( ZONE* aParent, PCB_LAYER_ID aLayer, bool aCanChangeNet, int aSubpolyIndex ) :
int aSubpolyIndex ) :
CN_ITEM( aParent, aCanChangeNet ), CN_ITEM( aParent, aCanChangeNet ),
m_subpolyIndex( aSubpolyIndex ), m_subpolyIndex( aSubpolyIndex ),
m_layer( aLayer ) m_layer( aLayer )
@ -383,7 +382,7 @@ public:
bool ContainsPoint( const VECTOR2I p, int aAccuracy = 0 ) const bool ContainsPoint( const VECTOR2I p, int aAccuracy = 0 ) const
{ {
auto zone = static_cast<ZONE_CONTAINER*> ( Parent() ); auto zone = static_cast<ZONE*>( Parent() );
int clearance = aAccuracy; int clearance = aAccuracy;
if( zone->GetFilledPolysUseThickness() ) if( zone->GetFilledPolysUseThickness() )
@ -512,7 +511,7 @@ public:
CN_ITEM* Add( VIA* via ); CN_ITEM* Add( VIA* via );
const std::vector<CN_ITEM*> Add( ZONE_CONTAINER* zone, PCB_LAYER_ID aLayer ); const std::vector<CN_ITEM*> Add( ZONE* zone, PCB_LAYER_ID aLayer );
}; };
class CN_CLUSTER class CN_CLUSTER

View File

@ -30,7 +30,7 @@
#include <zones.h> #include <zones.h>
#include <bitmaps.h> #include <bitmaps.h>
#include <widgets/unit_binder.h> #include <widgets/unit_binder.h>
#include <class_zone.h> #include <zone.h>
#include <class_board.h> #include <class_board.h>
#include <trigo.h> #include <trigo.h>
@ -503,7 +503,7 @@ void DIALOG_COPPER_ZONE::ExportSetupToOtherCopperZones( wxCommandEvent& event )
// Export settings ( but layer and netcode ) to others copper zones // Export settings ( but layer and netcode ) to others copper zones
BOARD* pcb = m_Parent->GetBoard(); BOARD* pcb = m_Parent->GetBoard();
for( ZONE_CONTAINER* zone : pcb->Zones() ) for( ZONE* zone : pcb->Zones() )
{ {
// Cannot export settings from a copper zone // Cannot export settings from a copper zone
// to a zone keepout: // to a zone keepout:

View File

@ -19,7 +19,7 @@
*/ */
#include <class_board.h> #include <class_board.h>
#include <class_dimension.h> #include <dimension.h>
#include <pcb_base_edit_frame.h> #include <pcb_base_edit_frame.h>
#include <pcb_layer_box_selector.h> #include <pcb_layer_box_selector.h>
#include <widgets/unit_binder.h> #include <widgets/unit_binder.h>
@ -48,8 +48,8 @@ DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES( PCB_BASE_EDIT_FRAME* a
m_lblExtensionOffsetUnits ) m_lblExtensionOffsetUnits )
{ {
wxASSERT( BaseType( aItem->Type() ) == PCB_DIMENSION_T ); wxASSERT( BaseType( aItem->Type() ) == PCB_DIMENSION_T );
m_dimension = static_cast<DIMENSION*>( aItem ); m_dimension = static_cast<DIMENSION_BASE*>( aItem );
m_previewDimension = static_cast<DIMENSION*>( m_dimension->Clone() ); m_previewDimension = static_cast<DIMENSION_BASE*>( m_dimension->Clone() );
m_previewDimension->SetParent( m_frame->GetBoard() ); m_previewDimension->SetParent( m_frame->GetBoard() );
switch( m_dimension->Type() ) switch( m_dimension->Type() )
@ -284,7 +284,7 @@ bool DIALOG_DIMENSION_PROPERTIES::TransferDataFromWindow()
} }
void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( DIMENSION* aTarget ) void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( DIMENSION_BASE* aTarget )
{ {
BOARD* board = m_frame->GetBoard(); BOARD* board = m_frame->GetBoard();

View File

@ -28,7 +28,7 @@
class BOARD_ITEM; class BOARD_ITEM;
class DIMENSION; class DIMENSION_BASE;
class PCB_BASE_EDIT_FRAME; class PCB_BASE_EDIT_FRAME;
@ -46,13 +46,13 @@ protected:
private: private:
PCB_BASE_EDIT_FRAME* m_frame; PCB_BASE_EDIT_FRAME* m_frame;
DIMENSION* m_dimension; DIMENSION_BASE* m_dimension;
DIMENSION* m_previewDimension; DIMENSION_BASE* m_previewDimension;
PCB_LAYER_BOX_SELECTOR* m_cbLayerActual; // The active layer box control PCB_LAYER_BOX_SELECTOR* m_cbLayerActual; // The active layer box control
wxTextCtrl* m_txtValueActual; // The active value control wxTextCtrl* m_txtValueActual; // The active value control
UNIT_BINDER m_textWidth; UNIT_BINDER m_textWidth;
UNIT_BINDER m_textHeight; UNIT_BINDER m_textHeight;
@ -67,7 +67,7 @@ private:
UNIT_BINDER m_arrowLength; UNIT_BINDER m_arrowLength;
UNIT_BINDER m_extensionOffset; UNIT_BINDER m_extensionOffset;
void updateDimensionFromDialog( DIMENSION* aTarget ); void updateDimensionFromDialog( DIMENSION_BASE* aTarget );
void updatePreviewText(); void updatePreviewText();
}; };

View File

@ -32,7 +32,6 @@ using namespace std::placeholders;
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h>
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
#include <tools/pcb_actions.h> #include <tools/pcb_actions.h>
#include <tools/global_edit_tool.h> #include <tools/global_edit_tool.h>

View File

@ -28,7 +28,7 @@
#include <pcb_layer_box_selector.h> #include <pcb_layer_box_selector.h>
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_dimension.h> #include <dimension.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <widgets/unit_binder.h> #include <widgets/unit_binder.h>
@ -270,10 +270,10 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( BOARD_COMMIT& aCommit, B
{ {
aCommit.Modify( aItem ); aCommit.Modify( aItem );
EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( aItem ); EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( aItem );
FP_TEXT* fpTextItem = dynamic_cast<FP_TEXT*>( aItem ); FP_TEXT* fpTextItem = dynamic_cast<FP_TEXT*>( aItem );
PCB_SHAPE* drawItem = dynamic_cast<PCB_SHAPE*>( aItem ); PCB_SHAPE* drawItem = dynamic_cast<PCB_SHAPE*>( aItem );
DIMENSION* dimension = dynamic_cast<DIMENSION*>( aItem ); DIMENSION_BASE* dimension = dynamic_cast<DIMENSION_BASE*>( aItem );
if( dimension ) if( dimension )
textItem = &dimension->Text(); textItem = &dimension->Text();

View File

@ -31,7 +31,6 @@
#include <pcb_edit_frame.h> #include <pcb_edit_frame.h>
#include <pcbnew_settings.h> #include <pcbnew_settings.h>
#include <widgets/unit_binder.h> #include <widgets/unit_binder.h>
#include <class_zone.h>
#include <zones.h> #include <zones.h>
#include <dialog_non_copper_zones_properties_base.h> #include <dialog_non_copper_zones_properties_base.h>

View File

@ -28,7 +28,6 @@
#include <pcb_edit_frame.h> #include <pcb_edit_frame.h>
#include <pcbnew_settings.h> #include <pcbnew_settings.h>
#include <footprint_edit_frame.h> #include <footprint_edit_frame.h>
#include <class_zone.h>
#include <zones.h> #include <zones.h>
#include <zone_settings.h> #include <zone_settings.h>
#include <dialog_rule_area_properties_base.h> #include <dialog_rule_area_properties_base.h>

View File

@ -26,7 +26,6 @@
#include <class_track.h> #include <class_track.h>
#include <view/view.h> #include <view/view.h>
#include <widgets/wx_grid.h> #include <widgets/wx_grid.h>
#include <class_zone.h>
#include <class_board.h> #include <class_board.h>
#include "dialog_swap_layers.h" #include "dialog_swap_layers.h"

View File

@ -28,7 +28,7 @@
#include <base_units.h> #include <base_units.h>
#include <board_commit.h> #include <board_commit.h>
#include <class_board.h> #include <class_board.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <dialog_target_properties_base.h> #include <dialog_target_properties_base.h>
#include <widgets/unit_binder.h> #include <widgets/unit_binder.h>

View File

@ -28,7 +28,7 @@
#include <pcb_edit_frame.h> #include <pcb_edit_frame.h>
#include <base_units.h> #include <base_units.h>
#include <class_board.h> #include <class_board.h>
#include <class_dimension.h> #include <dimension.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <geometry/shape_circle.h> #include <geometry/shape_circle.h>
#include <geometry/shape_segment.h> #include <geometry/shape_segment.h>
@ -38,7 +38,7 @@
#include <i18n_utility.h> #include <i18n_utility.h>
DIMENSION::DIMENSION( BOARD_ITEM* aParent, KICAD_T aType ) : DIMENSION_BASE::DIMENSION_BASE( BOARD_ITEM* aParent, KICAD_T aType ) :
BOARD_ITEM( aParent, aType ), BOARD_ITEM( aParent, aType ),
m_overrideTextEnabled( false ), m_overrideTextEnabled( false ),
m_units( EDA_UNITS::INCHES ), m_units( EDA_UNITS::INCHES ),
@ -58,14 +58,14 @@ DIMENSION::DIMENSION( BOARD_ITEM* aParent, KICAD_T aType ) :
} }
void DIMENSION::SetParent( EDA_ITEM* aParent ) void DIMENSION_BASE::SetParent( EDA_ITEM* aParent )
{ {
BOARD_ITEM::SetParent( aParent ); BOARD_ITEM::SetParent( aParent );
m_text.SetParent( aParent ); m_text.SetParent( aParent );
} }
void DIMENSION::updateText() void DIMENSION_BASE::updateText()
{ {
wxString text = m_overrideTextEnabled ? m_valueString : GetValueText(); wxString text = m_overrideTextEnabled ? m_valueString : GetValueText();
@ -94,13 +94,13 @@ void DIMENSION::updateText()
template<typename ShapeType> template<typename ShapeType>
void DIMENSION::addShape( const ShapeType& aShape ) void DIMENSION_BASE::addShape( const ShapeType& aShape )
{ {
m_shapes.push_back( std::make_shared<ShapeType>( aShape ) ); m_shapes.push_back( std::make_shared<ShapeType>( aShape ) );
} }
wxString DIMENSION::GetValueText() const wxString DIMENSION_BASE::GetValueText() const
{ {
struct lconv* lc = localeconv(); struct lconv* lc = localeconv();
wxChar sep = lc->decimal_point[0]; wxChar sep = lc->decimal_point[0];
@ -129,25 +129,25 @@ wxString DIMENSION::GetValueText() const
} }
void DIMENSION::SetPrefix( const wxString& aPrefix ) void DIMENSION_BASE::SetPrefix( const wxString& aPrefix )
{ {
m_prefix = aPrefix; m_prefix = aPrefix;
} }
void DIMENSION::SetSuffix( const wxString& aSuffix ) void DIMENSION_BASE::SetSuffix( const wxString& aSuffix )
{ {
m_suffix = aSuffix; m_suffix = aSuffix;
} }
void DIMENSION::SetUnits( EDA_UNITS aUnits ) void DIMENSION_BASE::SetUnits( EDA_UNITS aUnits )
{ {
m_units = aUnits; m_units = aUnits;
} }
DIM_UNITS_MODE DIMENSION::GetUnitsMode() const DIM_UNITS_MODE DIMENSION_BASE::GetUnitsMode() const
{ {
if( m_autoUnits ) if( m_autoUnits )
{ {
@ -171,7 +171,7 @@ DIM_UNITS_MODE DIMENSION::GetUnitsMode() const
} }
void DIMENSION::SetUnitsMode( DIM_UNITS_MODE aMode ) void DIMENSION_BASE::SetUnitsMode( DIM_UNITS_MODE aMode )
{ {
m_autoUnits = false; m_autoUnits = false;
@ -196,27 +196,27 @@ void DIMENSION::SetUnitsMode( DIM_UNITS_MODE aMode )
} }
void DIMENSION::SetText( const wxString& aNewText ) void DIMENSION_BASE::SetText( const wxString& aNewText )
{ {
m_valueString = aNewText; m_valueString = aNewText;
updateText(); updateText();
} }
const wxString DIMENSION::GetText() const const wxString DIMENSION_BASE::GetText() const
{ {
return m_text.GetText(); return m_text.GetText();
} }
void DIMENSION::SetLayer( PCB_LAYER_ID aLayer ) void DIMENSION_BASE::SetLayer( PCB_LAYER_ID aLayer )
{ {
m_Layer = aLayer; m_Layer = aLayer;
m_text.SetLayer( aLayer ); m_text.SetLayer( aLayer );
} }
void DIMENSION::Move( const wxPoint& offset ) void DIMENSION_BASE::Move( const wxPoint& offset )
{ {
m_text.Offset( offset ); m_text.Offset( offset );
@ -227,7 +227,7 @@ void DIMENSION::Move( const wxPoint& offset )
} }
void DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle ) void DIMENSION_BASE::Rotate( const wxPoint& aRotCentre, double aAngle )
{ {
if( m_keepTextAligned ) if( m_keepTextAligned )
m_keepTextAligned = false; m_keepTextAligned = false;
@ -243,7 +243,7 @@ void DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
} }
void DIMENSION::Flip( const wxPoint& aCentre, bool aFlipLeftRight ) void DIMENSION_BASE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
Mirror( aCentre ); Mirror( aCentre );
@ -253,7 +253,7 @@ void DIMENSION::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
} }
void DIMENSION::Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight ) void DIMENSION_BASE::Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight )
{ {
int axis = aMirrorLeftRight ? axis_pos.x : axis_pos.y; int axis = aMirrorLeftRight ? axis_pos.x : axis_pos.y;
wxPoint newPos = m_text.GetTextPos(); wxPoint newPos = m_text.GetTextPos();
@ -286,21 +286,21 @@ void DIMENSION::Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight )
} }
void DIMENSION::SetStart( const wxPoint& aOrigin ) void DIMENSION_BASE::SetStart( const wxPoint& aOrigin )
{ {
m_start = aOrigin; m_start = aOrigin;
Update(); Update();
} }
void DIMENSION::SetEnd( const wxPoint& aEnd ) void DIMENSION_BASE::SetEnd( const wxPoint& aEnd )
{ {
m_end = aEnd; m_end = aEnd;
Update(); Update();
} }
void DIMENSION::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) void DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{ {
// for now, display only the text within the DIMENSION using class PCB_TEXT. // for now, display only the text within the DIMENSION using class PCB_TEXT.
wxString msg; wxString msg;
@ -360,7 +360,7 @@ void DIMENSION::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_I
} }
std::shared_ptr<SHAPE> DIMENSION::GetEffectiveShape( PCB_LAYER_ID aLayer ) const std::shared_ptr<SHAPE> DIMENSION_BASE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
{ {
std::shared_ptr<SHAPE_COMPOUND> effectiveShape = std::make_shared<SHAPE_COMPOUND>(); std::shared_ptr<SHAPE_COMPOUND> effectiveShape = std::make_shared<SHAPE_COMPOUND>();
@ -373,7 +373,7 @@ std::shared_ptr<SHAPE> DIMENSION::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
} }
bool DIMENSION::HitTest( const wxPoint& aPosition, int aAccuracy ) const bool DIMENSION_BASE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
{ {
if( m_text.TextHitTest( aPosition ) ) if( m_text.TextHitTest( aPosition ) )
return true; return true;
@ -392,7 +392,7 @@ bool DIMENSION::HitTest( const wxPoint& aPosition, int aAccuracy ) const
} }
bool DIMENSION::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const bool DIMENSION_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
{ {
EDA_RECT arect = aRect; EDA_RECT arect = aRect;
arect.Inflate( aAccuracy ); arect.Inflate( aAccuracy );
@ -409,7 +409,7 @@ bool DIMENSION::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy )
} }
const EDA_RECT DIMENSION::GetBoundingBox() const const EDA_RECT DIMENSION_BASE::GetBoundingBox() const
{ {
EDA_RECT bBox; EDA_RECT bBox;
int xmin, xmax, ymin, ymax; int xmin, xmax, ymin, ymax;
@ -442,7 +442,7 @@ const EDA_RECT DIMENSION::GetBoundingBox() const
} }
wxString DIMENSION::GetSelectMenuText( EDA_UNITS aUnits ) const wxString DIMENSION_BASE::GetSelectMenuText( EDA_UNITS aUnits ) const
{ {
return wxString::Format( _( "Dimension '%s' on %s" ), return wxString::Format( _( "Dimension '%s' on %s" ),
GetText(), GetText(),
@ -451,7 +451,7 @@ wxString DIMENSION::GetSelectMenuText( EDA_UNITS aUnits ) const
const BOX2I DIMENSION::ViewBBox() const const BOX2I DIMENSION_BASE::ViewBBox() const
{ {
BOX2I dimBBox = BOX2I( VECTOR2I( GetBoundingBox().GetPosition() ), BOX2I dimBBox = BOX2I( VECTOR2I( GetBoundingBox().GetPosition() ),
VECTOR2I( GetBoundingBox().GetSize() ) ); VECTOR2I( GetBoundingBox().GetSize() ) );
@ -461,7 +461,7 @@ const BOX2I DIMENSION::ViewBBox() const
} }
OPT_VECTOR2I DIMENSION::segPolyIntersection( SHAPE_POLY_SET& aPoly, SEG& aSeg, bool aStart ) OPT_VECTOR2I DIMENSION_BASE::segPolyIntersection( SHAPE_POLY_SET& aPoly, SEG& aSeg, bool aStart )
{ {
VECTOR2I start( aStart ? aSeg.A : aSeg.B ); VECTOR2I start( aStart ? aSeg.A : aSeg.B );
VECTOR2I endpoint( aStart ? aSeg.B : aSeg.A ); VECTOR2I endpoint( aStart ? aSeg.B : aSeg.A );
@ -486,7 +486,7 @@ OPT_VECTOR2I DIMENSION::segPolyIntersection( SHAPE_POLY_SET& aPoly, SEG& aSeg, b
ALIGNED_DIMENSION::ALIGNED_DIMENSION( BOARD_ITEM* aParent, KICAD_T aType ) : ALIGNED_DIMENSION::ALIGNED_DIMENSION( BOARD_ITEM* aParent, KICAD_T aType ) :
DIMENSION( aParent, aType ), DIMENSION_BASE( aParent, aType ),
m_height( 0 ) m_height( 0 )
{ {
// To preserve look of old dimensions, initialize extension height based on default arrow length // To preserve look of old dimensions, initialize extension height based on default arrow length
@ -659,7 +659,7 @@ void ALIGNED_DIMENSION::updateText()
m_text.SetTextAngle( textAngle ); m_text.SetTextAngle( textAngle );
} }
DIMENSION::updateText(); DIMENSION_BASE::updateText();
} }
@ -830,12 +830,12 @@ void ORTHOGONAL_DIMENSION::updateText()
m_text.SetTextAngle( textAngle ); m_text.SetTextAngle( textAngle );
} }
DIMENSION::updateText(); DIMENSION_BASE::updateText();
} }
LEADER::LEADER( BOARD_ITEM* aParent ) : LEADER::LEADER( BOARD_ITEM* aParent ) :
DIMENSION( aParent, PCB_DIM_LEADER_T ), DIMENSION_BASE( aParent, PCB_DIM_LEADER_T ),
m_textFrame( DIM_TEXT_FRAME::NONE ) m_textFrame( DIM_TEXT_FRAME::NONE )
{ {
m_unitsFormat = DIM_UNITS_FORMAT::NO_SUFFIX; m_unitsFormat = DIM_UNITS_FORMAT::NO_SUFFIX;
@ -964,7 +964,7 @@ void LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM
CENTER_DIMENSION::CENTER_DIMENSION( BOARD_ITEM* aParent ) : CENTER_DIMENSION::CENTER_DIMENSION( BOARD_ITEM* aParent ) :
DIMENSION( aParent, PCB_DIM_CENTER_T ) DIMENSION_BASE( aParent, PCB_DIM_CENTER_T )
{ {
m_unitsFormat = DIM_UNITS_FORMAT::NO_SUFFIX; m_unitsFormat = DIM_UNITS_FORMAT::NO_SUFFIX;
m_overrideTextEnabled = true; m_overrideTextEnabled = true;
@ -1035,8 +1035,8 @@ static struct DIMENSION_DESC
DIMENSION_DESC() DIMENSION_DESC()
{ {
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
REGISTER_TYPE( DIMENSION ); REGISTER_TYPE( DIMENSION_BASE );
propMgr.InheritsAfter( TYPE_HASH( DIMENSION ), TYPE_HASH( BOARD_ITEM ) ); propMgr.InheritsAfter( TYPE_HASH( DIMENSION_BASE ), TYPE_HASH( BOARD_ITEM ) );
// TODO: add dimension properties: // TODO: add dimension properties:
//propMgr.AddProperty( new PROPERTY<DIMENSION, int>( _HKI( "Height" ), //propMgr.AddProperty( new PROPERTY<DIMENSION, int>( _HKI( "Height" ),
//&DIMENSION::SetHeight, &DIMENSION::GetHeight, PROPERTY_DISPLAY::DISTANCE ) ); //&DIMENSION::SetHeight, &DIMENSION::GetHeight, PROPERTY_DISPLAY::DISTANCE ) );

View File

@ -22,13 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/** #ifndef DIMENSION_H
* @file class_dimension.h #define DIMENSION_H
* @brief DIMENSION class definition.
*/
#ifndef DIMENSION_H_
#define DIMENSION_H_
#include <class_board_item.h> #include <class_board_item.h>
@ -97,10 +92,10 @@ enum class DIM_TEXT_FRAME
* - "crossbar" refers to the perpendicular line (usually with arrows at each end) between feature * - "crossbar" refers to the perpendicular line (usually with arrows at each end) between feature
* lines on linear dimensions * lines on linear dimensions
*/ */
class DIMENSION : public BOARD_ITEM class DIMENSION_BASE : public BOARD_ITEM
{ {
public: public:
DIMENSION( BOARD_ITEM* aParent, KICAD_T aType = PCB_DIMENSION_T ); DIMENSION_BASE( BOARD_ITEM* aParent, KICAD_T aType = PCB_DIMENSION_T );
bool IsType( const KICAD_T aScanTypes[] ) const override bool IsType( const KICAD_T aScanTypes[] ) const override
{ {
@ -160,11 +155,7 @@ public:
wxString GetSuffix() const { return m_suffix; } wxString GetSuffix() const { return m_suffix; }
void SetSuffix( const wxString& aSuffix ); void SetSuffix( const wxString& aSuffix );
void GetUnits( EDA_UNITS& aUnits ) const void GetUnits( EDA_UNITS& aUnits ) const { aUnits = m_units; }
{
aUnits = m_units;
}
void SetUnits( EDA_UNITS aUnits ); void SetUnits( EDA_UNITS aUnits );
DIM_UNITS_MODE GetUnitsMode() const; DIM_UNITS_MODE GetUnitsMode() const;
@ -335,7 +326,7 @@ protected:
* The height (distance from features to crossbar) can be set directly, or set by manipulating the * The height (distance from features to crossbar) can be set directly, or set by manipulating the
* crossbar start or end point (with the point editor). * crossbar start or end point (with the point editor).
*/ */
class ALIGNED_DIMENSION : public DIMENSION class ALIGNED_DIMENSION : public DIMENSION_BASE
{ {
protected: protected:
// Geometry // Geometry
@ -476,7 +467,7 @@ protected:
* Point (a) is m_start, point (b) is m_end, point (c) is the end of the "text line" * Point (a) is m_start, point (b) is m_end, point (c) is the end of the "text line"
* The b-c line is drawn from b to the text center, and clipped on the text bounding box. * The b-c line is drawn from b to the text center, and clipped on the text bounding box.
*/ */
class LEADER : public DIMENSION class LEADER : public DIMENSION_BASE
{ {
DIM_TEXT_FRAME m_textFrame; DIM_TEXT_FRAME m_textFrame;
@ -515,7 +506,7 @@ protected:
* The size and orientation of the cross is adjustable. * The size and orientation of the cross is adjustable.
* m_start always marks the center being measured; m_end marks the end of one leg of the cross. * m_start always marks the center being measured; m_end marks the end of one leg of the cross.
*/ */
class CENTER_DIMENSION : public DIMENSION class CENTER_DIMENSION : public DIMENSION_BASE
{ {
public: public:
@ -546,4 +537,4 @@ protected:
void updateGeometry() override; void updateGeometry() override;
}; };
#endif // DIMENSION_H_ #endif // DIMENSION_H

View File

@ -85,9 +85,9 @@ DRC_ENGINE::~DRC_ENGINE()
static bool isKeepoutZone( const BOARD_ITEM* aItem ) static bool isKeepoutZone( const BOARD_ITEM* aItem )
{ {
if( aItem && ( aItem->Type() == PCB_ZONE_AREA_T || aItem->Type() == PCB_FP_ZONE_AREA_T ) ) if( aItem && ( aItem->Type() == PCB_ZONE_T || aItem->Type() == PCB_FP_ZONE_T ) )
{ {
const ZONE_CONTAINER* zone = static_cast<const ZONE_CONTAINER*>( aItem ); const ZONE* zone = static_cast<const ZONE*>( aItem );
return zone->GetIsRuleArea() && ( zone->GetDoNotAllowTracks() return zone->GetIsRuleArea() && ( zone->GetDoNotAllowTracks()
|| zone->GetDoNotAllowVias() || zone->GetDoNotAllowVias()
@ -357,9 +357,9 @@ void DRC_ENGINE::loadImplicitRules()
rule->AddConstraint( disallowConstraint ); rule->AddConstraint( disallowConstraint );
}; };
std::vector<ZONE_CONTAINER*> keepoutZones; std::vector<ZONE*> keepoutZones;
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( isKeepoutZone( zone ) ) if( isKeepoutZone( zone ) )
keepoutZones.push_back( zone ); keepoutZones.push_back( zone );
@ -367,14 +367,14 @@ void DRC_ENGINE::loadImplicitRules()
for( MODULE* footprint : m_board->Modules() ) for( MODULE* footprint : m_board->Modules() )
{ {
for( ZONE_CONTAINER* zone : footprint->Zones() ) for( ZONE* zone : footprint->Zones() )
{ {
if( isKeepoutZone( zone ) ) if( isKeepoutZone( zone ) )
keepoutZones.push_back( zone ); keepoutZones.push_back( zone );
} }
} }
for( ZONE_CONTAINER* zone : keepoutZones ) for( ZONE* zone : keepoutZones )
{ {
wxString name = zone->GetZoneName(); wxString name = zone->GetZoneName();
@ -656,12 +656,12 @@ void DRC_ENGINE::RunTests( EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aT
m_errorLimits[ ii ] = INT_MAX; m_errorLimits[ ii ] = INT_MAX;
} }
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
zone->CacheBoundingBox(); zone->CacheBoundingBox();
for( MODULE* module : m_board->Modules() ) for( MODULE* module : m_board->Modules() )
{ {
for( ZONE_CONTAINER* zone : module->Zones() ) for( ZONE* zone : module->Zones() )
zone->CacheBoundingBox(); zone->CacheBoundingBox();
module->BuildPolyCourtyards(); module->BuildPolyCourtyards();
@ -829,8 +829,8 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRulesForItems( DRC_CONSTRAINT_TYPE_T aConstraintI
case PCB_FP_SHAPE_T: mask = DRC_DISALLOW_GRAPHICS; break; case PCB_FP_SHAPE_T: mask = DRC_DISALLOW_GRAPHICS; break;
case PCB_TEXT_T: mask = DRC_DISALLOW_TEXTS; break; case PCB_TEXT_T: mask = DRC_DISALLOW_TEXTS; break;
case PCB_FP_TEXT_T: mask = DRC_DISALLOW_TEXTS; break; case PCB_FP_TEXT_T: mask = DRC_DISALLOW_TEXTS; break;
case PCB_ZONE_AREA_T: mask = DRC_DISALLOW_ZONES; break; case PCB_ZONE_T: mask = DRC_DISALLOW_ZONES; break;
case PCB_FP_ZONE_AREA_T: mask = DRC_DISALLOW_ZONES; break; case PCB_FP_ZONE_T: mask = DRC_DISALLOW_ZONES; break;
case PCB_LOCATE_HOLE_T: mask = DRC_DISALLOW_HOLES; break; case PCB_LOCATE_HOLE_T: mask = DRC_DISALLOW_HOLES; break;
default: mask = 0; break; default: mask = 0; break;
} }

View File

@ -36,7 +36,6 @@ class DRC_TEST_PROVIDER;
class PCB_EDIT_FRAME; class PCB_EDIT_FRAME;
class BOARD_ITEM; class BOARD_ITEM;
class BOARD; class BOARD;
class ZONE_CONTAINER;
class MARKER_PCB; class MARKER_PCB;
class NETCLASS; class NETCLASS;
class NETLIST; class NETLIST;

View File

@ -28,7 +28,6 @@
#include <eda_rect.h> #include <eda_rect.h>
#include <class_board_item.h> #include <class_board_item.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h>
#include <unordered_set> #include <unordered_set>
#include <set> #include <set>
#include <vector> #include <vector>

View File

@ -27,7 +27,7 @@
#include <class_track.h> #include <class_track.h>
#include <class_module.h> #include <class_module.h>
#include <class_pad.h> #include <class_pad.h>
#include <class_zone.h> #include <zone.h>
#include <pcb_text.h> #include <pcb_text.h>
@ -140,7 +140,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
{ {
s_allBasicItems.push_back( (KICAD_T) i ); s_allBasicItems.push_back( (KICAD_T) i );
if( i != PCB_ZONE_AREA_T && i != PCB_FP_ZONE_AREA_T ) if( i != PCB_ZONE_T && i != PCB_FP_ZONE_T )
s_allBasicItemsButZones.push_back( (KICAD_T) i ); s_allBasicItemsButZones.push_back( (KICAD_T) i );
} }
} }
@ -214,9 +214,9 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
} }
} }
if( typeMask[ PCB_ZONE_AREA_T ] ) if( typeMask[ PCB_ZONE_T ] )
{ {
for( ZONE_CONTAINER* item : brd->Zones() ) for( ZONE* item : brd->Zones() )
{ {
if( (item->GetLayerSet() & aLayers).any() ) if( (item->GetLayerSet() & aLayers).any() )
{ {
@ -284,9 +284,9 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector<KICAD_T>& aTypes,
} }
} }
if( typeMask[ PCB_FP_ZONE_AREA_T ] ) if( typeMask[ PCB_FP_ZONE_T ] )
{ {
for( ZONE_CONTAINER* zone : mod->Zones() ) for( ZONE* zone : mod->Zones() )
{ {
if( (zone->GetLayerSet() & aLayers).any() ) if( (zone->GetLayerSet() & aLayers).any() )
{ {

View File

@ -117,7 +117,7 @@ bool DRC_TEST_PROVIDER_CONNECTIVITY::Run()
} }
/* test starved zones */ /* test starved zones */
for( ZONE_CONTAINER* zone : board->Zones() ) for( ZONE* zone : board->Zones() )
{ {
if( m_drcEngine->IsErrorLimitExceeded( DRCE_ZONE_HAS_EMPTY_NET ) ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_ZONE_HAS_EMPTY_NET ) )
break; break;

View File

@ -38,7 +38,7 @@
#include <drc/drc_item.h> #include <drc/drc_item.h>
#include <drc/drc_rule.h> #include <drc/drc_rule.h>
#include <drc/drc_test_provider_clearance_base.h> #include <drc/drc_test_provider_clearance_base.h>
#include <class_dimension.h> #include <dimension.h>
/* /*
Copper clearance test. Checks all copper items (pads, vias, tracks, drawings, zones) for their electrical clearance. Copper clearance test. Checks all copper items (pads, vias, tracks, drawings, zones) for their electrical clearance.
@ -96,8 +96,8 @@ private:
DRC_RTREE m_copperTree; DRC_RTREE m_copperTree;
int m_drcEpsilon; int m_drcEpsilon;
std::vector<ZONE_CONTAINER*> m_zones; std::vector<ZONE*> m_zones;
std::map<ZONE_CONTAINER*, std::unique_ptr<DRC_RTREE>> m_zoneTrees; std::map<ZONE*, std::unique_ptr<DRC_RTREE>> m_zoneTrees;
}; };
@ -121,7 +121,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
m_zones.clear(); m_zones.clear();
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( !zone->GetIsRuleArea() ) if( !zone->GetIsRuleArea() )
m_zones.push_back( zone ); m_zones.push_back( zone );
@ -129,7 +129,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
for( MODULE* footprint : m_board->Modules() ) for( MODULE* footprint : m_board->Modules() )
{ {
for( ZONE_CONTAINER* zone : footprint->Zones() ) for( ZONE* zone : footprint->Zones() )
{ {
if( !zone->GetIsRuleArea() ) if( !zone->GetIsRuleArea() )
m_zones.push_back( zone ); m_zones.push_back( zone );
@ -186,7 +186,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run()
ii = 0; ii = 0;
m_zoneTrees.clear(); m_zoneTrees.clear();
for( ZONE_CONTAINER* zone : m_zones ) for( ZONE* zone : m_zones )
{ {
if( !reportProgress( ii++, m_zones.size(), delta ) ) if( !reportProgress( ii++, m_zones.size(), delta ) )
break; break;
@ -308,7 +308,7 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem( TRACK* track, SHA
void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aItem, void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aItem,
PCB_LAYER_ID aLayer ) PCB_LAYER_ID aLayer )
{ {
for( ZONE_CONTAINER* zone : m_zones ) for( ZONE* zone : m_zones )
{ {
if( m_drcEngine->IsErrorLimitExceeded( DRCE_CLEARANCE ) ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_CLEARANCE ) )
break; break;
@ -588,7 +588,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZones()
if( !reportProgress( layer_id * m_zones.size() + ia, B_Cu * m_zones.size(), delta ) ) if( !reportProgress( layer_id * m_zones.size() + ia, B_Cu * m_zones.size(), delta ) )
break; break;
ZONE_CONTAINER* zoneRef = m_zones[ia]; ZONE* zoneRef = m_zones[ia];
if( !zoneRef->IsOnLayer( layer ) ) if( !zoneRef->IsOnLayer( layer ) )
continue; continue;
@ -597,7 +597,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZones()
// Otherwise, we have already tested the zone combination // Otherwise, we have already tested the zone combination
for( size_t ia2 = ia + 1; ia2 < m_zones.size(); ia2++ ) for( size_t ia2 = ia + 1; ia2 < m_zones.size(); ia2++ )
{ {
ZONE_CONTAINER* zoneToTest = m_zones[ia2]; ZONE* zoneToTest = m_zones[ia2];
if( zoneRef == zoneToTest ) if( zoneRef == zoneToTest )
continue; continue;

View File

@ -321,7 +321,7 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
return true; return true;
}; };
forEachGeometryItem( { PCB_TRACE_T, PCB_VIA_T, PCB_PAD_T, PCB_ZONE_AREA_T, PCB_ARC_T }, forEachGeometryItem( { PCB_TRACE_T, PCB_VIA_T, PCB_PAD_T, PCB_ZONE_T, PCB_ARC_T },
LSET::AllCuMask(), addToTree ); LSET::AllCuMask(), addToTree );

View File

@ -145,7 +145,7 @@ void DRC_TEST_PROVIDER_MISC::testDisabledLayers()
}; };
// fixme: what about graphical items? // fixme: what about graphical items?
forEachGeometryItem( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_ZONE_AREA_T, PCB_PAD_T }, forEachGeometryItem( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_ZONE_T, PCB_PAD_T },
LSET::AllLayersMask(), checkDisabledLayers ); LSET::AllLayersMask(), checkDisabledLayers );
} }

View File

@ -33,9 +33,9 @@
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <class_dimension.h> #include <dimension.h>
#include <pcb_layer_box_selector.h> #include <pcb_layer_box_selector.h>
#include <dialog_drc.h> #include <dialog_drc.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
@ -142,7 +142,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
ShowDimensionPropertiesDialog( static_cast<DIMENSION*>( aItem ) ); ShowDimensionPropertiesDialog( static_cast<DIMENSION_BASE*>( aItem ) );
break; break;
case PCB_FP_TEXT_T: case PCB_FP_TEXT_T:
@ -153,8 +153,8 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
ShowGraphicItemPropertiesDialog( aItem ); ShowGraphicItemPropertiesDialog( aItem );
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
Edit_Zone_Params( static_cast<ZONE_CONTAINER*>( aItem ) ); Edit_Zone_Params( static_cast<ZONE*>( aItem ) );
break; break;
case PCB_GROUP_T: case PCB_GROUP_T:
@ -167,7 +167,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
} }
void PCB_EDIT_FRAME::ShowDimensionPropertiesDialog( DIMENSION* aDimension ) void PCB_EDIT_FRAME::ShowDimensionPropertiesDialog( DIMENSION_BASE* aDimension )
{ {
if( aDimension == NULL ) if( aDimension == NULL )
return; return;

View File

@ -27,7 +27,7 @@
#include <class_board_item.h> #include <class_board_item.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <cstdio> #include <cstdio>
#include <vector> #include <vector>
#include <ki_exception.h> #include <ki_exception.h>
@ -473,7 +473,7 @@ bool HYPERLYNX_EXPORTER::writeNetObjects( const std::vector<BOARD_ITEM*>& aObjec
iu2hyp( track->GetEnd().x ), iu2hyp( track->GetEnd().y ), iu2hyp( track->GetEnd().x ), iu2hyp( track->GetEnd().y ),
iu2hyp( track->GetWidth() ), (const char*) layerName.c_str() ); iu2hyp( track->GetWidth() ), (const char*) layerName.c_str() );
} }
else if( ZONE_CONTAINER* zone = dyn_cast<ZONE_CONTAINER*>( item ) ) else if( ZONE* zone = dyn_cast<ZONE*>( item ) )
{ {
for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() ) for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
{ {
@ -561,7 +561,7 @@ const std::vector<BOARD_ITEM*> HYPERLYNX_EXPORTER::collectNetObjects( int netcod
rv.push_back( item ); rv.push_back( item );
} }
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( check( zone ) ) if( check( zone ) )
rv.push_back( zone ); rv.push_back( zone );

View File

@ -37,7 +37,7 @@
#include "class_module.h" #include "class_module.h"
#include "pcb_text.h" #include "pcb_text.h"
#include "class_track.h" #include "class_track.h"
#include "class_zone.h" #include "zone.h"
#include "convert_to_biu.h" #include "convert_to_biu.h"
#include <filename_resolver.h> #include <filename_resolver.h>
#include "plugins/3dapi/ifsg_all.h" #include "plugins/3dapi/ifsg_all.h"
@ -1002,7 +1002,7 @@ static void export_vrml_tracks( MODEL_VRML& aModel, BOARD* pcb )
static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb, COMMIT* aCommit ) static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb, COMMIT* aCommit )
{ {
for( ZONE_CONTAINER* zone : aPcb->Zones() ) for( ZONE* zone : aPcb->Zones() )
{ {
for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() ) for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
{ {
@ -1017,7 +1017,7 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb, COMMIT* aCommit
zone->SetFillMode( ZONE_FILL_MODE::POLYGONS ); // use filled polygons zone->SetFillMode( ZONE_FILL_MODE::POLYGONS ); // use filled polygons
// If the zone fill failed, don't try adding it to the export // If the zone fill failed, don't try adding it to the export
std::vector<ZONE_CONTAINER*> toFill = { zone }; std::vector<ZONE*> toFill = { zone };
if( !filler.Fill( toFill ) ) if( !filler.Fill( toFill ) )
continue; continue;

View File

@ -39,7 +39,7 @@
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <board_stackup_manager/stackup_predefined_prms.h> #include <board_stackup_manager/stackup_predefined_prms.h>
#include <gbr_metadata.h> #include <gbr_metadata.h>
@ -514,7 +514,7 @@ void GERBER_JOBFILE_WRITER::addJSONDesignRules()
minclearanceOuter = INT_MAX; minclearanceOuter = INT_MAX;
minclearanceInner = INT_MAX; minclearanceInner = INT_MAX;
for( ZONE_CONTAINER* zone : m_pcb->Zones() ) for( ZONE* zone : m_pcb->Zones() )
{ {
if( zone->GetIsRuleArea() || !zone->IsOnCopperLayer() ) if( zone->GetIsRuleArea() || !zone->IsOnCopperLayer() )
continue; continue;

View File

@ -177,13 +177,13 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
case PCB_FP_SHAPE_T :ShowGraphicItemPropertiesDialog( aItem ); case PCB_FP_SHAPE_T :ShowGraphicItemPropertiesDialog( aItem );
break; break;
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
{ {
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( aItem ); ZONE* zone = static_cast<ZONE*>( aItem );
bool success = false; bool success = false;
ZONE_SETTINGS zoneSettings; ZONE_SETTINGS zoneSettings;
zoneSettings << *static_cast<ZONE_CONTAINER*>( aItem ); zoneSettings << *static_cast<ZONE*>( aItem );
if( zone->GetIsRuleArea() ) if( zone->GetIsRuleArea() )
{ {
@ -203,7 +203,7 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
BOARD_COMMIT commit( this ); BOARD_COMMIT commit( this );
commit.Modify( zone ); commit.Modify( zone );
commit.Push( _( "Edit Zone" ) ); commit.Push( _( "Edit Zone" ) );
zoneSettings.ExportSetting( *static_cast<ZONE_CONTAINER*>( aItem ) ); zoneSettings.ExportSetting( *static_cast<ZONE*>( aItem ) );
} }
} }
break; break;

View File

@ -25,11 +25,9 @@
#ifndef FP_TEXT_H #ifndef FP_TEXT_H
#define FP_TEXT_H #define FP_TEXT_H
#include <eda_text.h> #include <eda_text.h>
#include <class_board_item.h> #include <class_board_item.h>
class LINE_READER; class LINE_READER;
class EDA_RECT; class EDA_RECT;
class MODULE; class MODULE;
@ -37,8 +35,6 @@ class MSG_PANEL_ITEM;
class PCB_BASE_FRAME; class PCB_BASE_FRAME;
class SHAPE; class SHAPE;
#define UMBILICAL_COLOR LIGHTBLUE
class FP_TEXT : public BOARD_ITEM, public EDA_TEXT class FP_TEXT : public BOARD_ITEM, public EDA_TEXT
{ {

View File

@ -199,11 +199,11 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE
footprint->Add( pad ); footprint->Add( pad );
copy = footprint; copy = footprint;
} }
else if( item->Type() == PCB_FP_ZONE_AREA_T ) else if( item->Type() == PCB_FP_ZONE_T )
{ {
// Convert to PCB_ZONE_AREA_T // Convert to PCB_ZONE_T
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
zone->InitDataFromSrcInCopyCtor( *static_cast<ZONE_CONTAINER*>( item ) ); zone->InitDataFromSrcInCopyCtor( *static_cast<ZONE*>( item ) );
copy = zone; copy = zone;
} }
else if( item->Type() == PCB_GROUP_T ) else if( item->Type() == PCB_GROUP_T )

View File

@ -25,7 +25,7 @@
#include <class_module.h> #include <class_module.h>
#include <class_pad.h> #include <class_pad.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <netinfo.h> #include <netinfo.h>
@ -210,7 +210,7 @@ void NETINFO_MAPPING::Update()
nets.insert( 0 ); nets.insert( 0 );
// Zones // Zones
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
nets.insert( zone->GetNetCode() ); nets.insert( zone->GetNetCode() );
// Tracks // Tracks

View File

@ -39,7 +39,7 @@
#include <class_module.h> #include <class_module.h>
#include <class_pad.h> #include <class_pad.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <kicad_string.h> #include <kicad_string.h>
#include "pcb_netlist.h" #include "pcb_netlist.h"
@ -483,7 +483,7 @@ bool BOARD_NETLIST_UPDATER::updateComponentPadConnections( MODULE* aPcbComponent
void BOARD_NETLIST_UPDATER::cacheCopperZoneConnections() void BOARD_NETLIST_UPDATER::cacheCopperZoneConnections()
{ {
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( !zone->IsOnCopperLayer() || zone->GetIsRuleArea() ) if( !zone->IsOnCopperLayer() || zone->GetIsRuleArea() )
continue; continue;
@ -556,7 +556,7 @@ bool BOARD_NETLIST_UPDATER::updateCopperZoneNets( NETLIST& aNetlist )
} }
// Test copper zones to detect "dead" nets (nets without any pad): // Test copper zones to detect "dead" nets (nets without any pad):
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( !zone->IsOnCopperLayer() || zone->GetIsRuleArea() ) if( !zone->IsOnCopperLayer() || zone->GetIsRuleArea() )
continue; continue;
@ -686,7 +686,7 @@ bool BOARD_NETLIST_UPDATER::deleteSinglePadNets()
// First, see if we have a copper zone attached to this pad. // First, see if we have a copper zone attached to this pad.
// If so, this is not really a single pad net // If so, this is not really a single pad net
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
if( !zone->IsOnCopperLayer() ) if( !zone->IsOnCopperLayer() )
continue; continue;

View File

@ -156,12 +156,12 @@ private:
BOARD* m_board; BOARD* m_board;
REPORTER* m_reporter; REPORTER* m_reporter;
std::map< ZONE_CONTAINER*, std::vector<D_PAD*> > m_zoneConnectionsCache; std::map<ZONE*, std::vector<D_PAD*>> m_zoneConnectionsCache;
std::map< wxString, wxString> m_oldToNewNets; std::map<wxString, wxString> m_oldToNewNets;
std::map< D_PAD*, wxString > m_padNets; std::map<D_PAD*, wxString> m_padNets;
std::map< D_PAD*, wxString > m_padPinFunctions; std::map<D_PAD*, wxString> m_padPinFunctions;
std::vector<MODULE*> m_addedComponents; std::vector<MODULE*> m_addedComponents;
std::map<wxString, NETINFO_ITEM*> m_addedNets; std::map<wxString, NETINFO_ITEM*> m_addedNets;
bool m_deleteSinglePadNets; bool m_deleteSinglePadNets;
bool m_deleteUnusedComponents; bool m_deleteUnusedComponents;

View File

@ -37,7 +37,7 @@
#include <dialogs/dialog_grid_settings.h> #include <dialogs/dialog_grid_settings.h>
#include <widgets/appearance_controls.h> #include <widgets/appearance_controls.h>
#include <dialogs/eda_view_switcher.h> #include <dialogs/eda_view_switcher.h>
#include <class_dimension.h> #include <dimension.h>
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
@ -175,7 +175,7 @@ void PCB_BASE_EDIT_FRAME::unitsChangeRefresh()
INSPECTOR_FUNC inspector = INSPECTOR_FUNC inspector =
[units, view]( EDA_ITEM* aItem, void* aTestData ) [units, view]( EDA_ITEM* aItem, void* aTestData )
{ {
DIMENSION* dimension = static_cast<DIMENSION*>( aItem ); DIMENSION_BASE* dimension = static_cast<DIMENSION_BASE*>( aItem );
if( dimension->GetUnitsMode() == DIM_UNITS_MODE::AUTOMATIC ) if( dimension->GetUnitsMode() == DIM_UNITS_MODE::AUTOMATIC )
{ {

View File

@ -42,10 +42,10 @@ class VIA;
class D_PAD; class D_PAD;
class PCB_TARGET; class PCB_TARGET;
class PCB_GROUP; class PCB_GROUP;
class DIMENSION; class DIMENSION_BASE;
class DRC; class DRC;
class DIALOG_PLOT; class DIALOG_PLOT;
class ZONE_CONTAINER; class ZONE;
class GENERAL_COLLECTOR; class GENERAL_COLLECTOR;
class GENERAL_COLLECTORS_GUIDE; class GENERAL_COLLECTORS_GUIDE;
class SELECTION; class SELECTION;
@ -785,12 +785,11 @@ public:
* Function Edit_Zone_Params * Function Edit_Zone_Params
* Edit params (layer, clearance, ...) for a zone outline * Edit params (layer, clearance, ...) for a zone outline
*/ */
void Edit_Zone_Params( ZONE_CONTAINER* zone_container ); void Edit_Zone_Params( ZONE* zone_container );
// Properties dialogs // Properties dialogs
void ShowTargetOptionsDialog( PCB_TARGET* aTarget ); void ShowTargetOptionsDialog( PCB_TARGET* aTarget );
void ShowDimensionPropertiesDialog( DIMENSION* aDimension ); void ShowDimensionPropertiesDialog( DIMENSION_BASE* aDimension );
void ShowGroupPropertiesDialog( PCB_GROUP* aGroup );
void InstallNetlistFrame(); void InstallNetlistFrame();
/** /**

View File

@ -218,7 +218,7 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self )
return; return;
auto insideZone = auto insideZone =
[&]( ZONE_CONTAINER* zone ) -> bool [&]( ZONE* zone ) -> bool
{ {
if( !zone ) if( !zone )
return false; return false;
@ -297,19 +297,19 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self )
if( arg->AsString() == "A" ) if( arg->AsString() == "A" )
{ {
if( insideZone( dynamic_cast<ZONE_CONTAINER*>( context->GetItem( 0 ) ) ) ) if( insideZone( dynamic_cast<ZONE*>( context->GetItem( 0 ) ) ) )
result->Set( 1.0 ); result->Set( 1.0 );
} }
else if( arg->AsString() == "B" ) else if( arg->AsString() == "B" )
{ {
if( insideZone( dynamic_cast<ZONE_CONTAINER*>( context->GetItem( 1 ) ) ) ) if( insideZone( dynamic_cast<ZONE*>( context->GetItem( 1 ) ) ) )
result->Set( 1.0 ); result->Set( 1.0 );
} }
else if( KIID::SniffTest( arg->AsString() ) ) else if( KIID::SniffTest( arg->AsString() ) )
{ {
KIID target( arg->AsString() ); KIID target( arg->AsString() );
for( ZONE_CONTAINER* candidate : item->GetBoard()->Zones() ) for( ZONE* candidate : item->GetBoard()->Zones() )
{ {
// Only a single zone can match the UUID; exit once we find a match whether // Only a single zone can match the UUID; exit once we find a match whether
// "inside" or not // "inside" or not
@ -324,7 +324,7 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self )
for( MODULE* module : item->GetBoard()->Modules() ) for( MODULE* module : item->GetBoard()->Modules() )
{ {
for( ZONE_CONTAINER* candidate : module->Zones() ) for( ZONE* candidate : module->Zones() )
{ {
// Only a single zone can match the UUID; exit once we find a match whether // Only a single zone can match the UUID; exit once we find a match whether
// "inside" or not // "inside" or not
@ -340,7 +340,7 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self )
} }
else // Match on zone name else // Match on zone name
{ {
for( ZONE_CONTAINER* candidate : item->GetBoard()->Zones() ) for( ZONE* candidate : item->GetBoard()->Zones() )
{ {
if( candidate->GetZoneName().Matches( arg->AsString() ) ) if( candidate->GetZoneName().Matches( arg->AsString() ) )
{ {
@ -355,7 +355,7 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self )
for( MODULE* module : item->GetBoard()->Modules() ) for( MODULE* module : item->GetBoard()->Modules() )
{ {
for( ZONE_CONTAINER* candidate : module->Zones() ) for( ZONE* candidate : module->Zones() )
{ {
// Many zones can match the name; exit only when we find an "inside" // Many zones can match the name; exit only when we find an "inside"
if( candidate->GetZoneName().Matches( arg->AsString() ) ) if( candidate->GetZoneName().Matches( arg->AsString() ) )

View File

@ -30,11 +30,11 @@
#include <class_pad.h> #include <class_pad.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <kicad_string.h> #include <kicad_string.h>
#include <class_zone.h> #include <zone.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_marker_pcb.h> #include <class_marker_pcb.h>
#include <class_dimension.h> #include <dimension.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
#include <pcb_painter.h> #include <pcb_painter.h>
@ -229,7 +229,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
const BOARD_CONNECTED_ITEM* conItem = dynamic_cast<const BOARD_CONNECTED_ITEM*> ( aItem ); const BOARD_CONNECTED_ITEM* conItem = dynamic_cast<const BOARD_CONNECTED_ITEM*> ( aItem );
// Zones should pull from the copper layer // Zones should pull from the copper layer
if( item && item->Type() == PCB_ZONE_AREA_T && IsZoneLayer( aLayer ) ) if( item && item->Type() == PCB_ZONE_T && IsZoneLayer( aLayer ) )
aLayer = aLayer - LAYER_ZONE_START; aLayer = aLayer - LAYER_ZONE_START;
// Marker shadows // Marker shadows
@ -356,7 +356,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
color.a *= m_viaOpacity; color.a *= m_viaOpacity;
else if( item->Type() == PCB_PAD_T ) else if( item->Type() == PCB_PAD_T )
color.a *= m_padOpacity; color.a *= m_padOpacity;
else if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ) else if( item->Type() == PCB_ZONE_T || item->Type() == PCB_FP_ZONE_T )
color.a *= m_zoneOpacity; color.a *= m_zoneOpacity;
// No special modificators enabled // No special modificators enabled
@ -447,19 +447,19 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
draw( static_cast<const PCB_GROUP*>( item ), aLayer ); draw( static_cast<const PCB_GROUP*>( item ), aLayer );
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
draw( static_cast<const ZONE_CONTAINER*>( item ), aLayer ); draw( static_cast<const ZONE*>( item ), aLayer );
break; break;
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
draw( static_cast<const ZONE_CONTAINER*>( item ), aLayer ); draw( static_cast<const ZONE*>( item ), aLayer );
break; break;
case PCB_DIM_ALIGNED_T: case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
draw( static_cast<const DIMENSION*>( item ), aLayer ); draw( static_cast<const DIMENSION_BASE*>( item ), aLayer );
break; break;
case PCB_TARGET_T: case PCB_TARGET_T:
@ -1381,7 +1381,7 @@ void PCB_PAINTER::draw( const PCB_GROUP* aGroup, int aLayer )
} }
void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer ) void PCB_PAINTER::draw( const ZONE* aZone, int aLayer )
{ {
/** /**
* aLayer will be the virtual zone layer (LAYER_ZONE_START, ... in GAL_LAYER_ID) * aLayer will be the virtual zone layer (LAYER_ZONE_START, ... in GAL_LAYER_ID)
@ -1465,7 +1465,7 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer )
} }
void PCB_PAINTER::draw( const DIMENSION* aDimension, int aLayer ) void PCB_PAINTER::draw( const DIMENSION_BASE* aDimension, int aLayer )
{ {
const COLOR4D& strokeColor = m_pcbSettings.GetColor( aDimension, aLayer ); const COLOR4D& strokeColor = m_pcbSettings.GetColor( aDimension, aLayer );

View File

@ -44,10 +44,10 @@ class D_PAD;
class PCB_SHAPE; class PCB_SHAPE;
class PCB_GROUP; class PCB_GROUP;
class MODULE; class MODULE;
class ZONE_CONTAINER; class ZONE;
class PCB_TEXT; class PCB_TEXT;
class FP_TEXT; class FP_TEXT;
class DIMENSION; class DIMENSION_BASE;
class PCB_TARGET; class PCB_TARGET;
class MARKER_PCB; class MARKER_PCB;
class NET_SETTINGS; class NET_SETTINGS;
@ -290,8 +290,8 @@ protected:
void draw( const FP_TEXT* aText, int aLayer ); void draw( const FP_TEXT* aText, int aLayer );
void draw( const MODULE* aModule, int aLayer ); void draw( const MODULE* aModule, int aLayer );
void draw( const PCB_GROUP* aGroup, int aLayer ); void draw( const PCB_GROUP* aGroup, int aLayer );
void draw( const ZONE_CONTAINER* aZone, int aLayer ); void draw( const ZONE* aZone, int aLayer );
void draw( const DIMENSION* aDimension, int aLayer ); void draw( const DIMENSION_BASE* aDimension, int aLayer );
void draw( const PCB_TARGET* aTarget ); void draw( const PCB_TARGET* aTarget );
void draw( const MARKER_PCB* aMarker, int aLayer ); void draw( const MARKER_PCB* aMarker, int aLayer );

View File

@ -4,7 +4,7 @@
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -24,14 +24,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file class_pcb_target.cpp
* PCB_TARGET class definition - targets for photo plots, formerly called MIRE (from French 'mire optique')
*/
#include <bitmaps.h> #include <bitmaps.h>
#include <class_board.h> #include <class_board.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <base_units.h> #include <base_units.h>
#include <settings/color_settings.h> #include <settings/color_settings.h>
#include <settings/settings_manager.h> #include <settings/settings_manager.h>

View File

@ -22,13 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/** #ifndef PCB_TARGET_H
* @file class_pcb_target.h #define PCB_TARGET_H
* @brief PCB_TARGET class definition. (targets for photo plots).
*/
#ifndef PCB_TARGET_H_
#define PCB_TARGET_H_
#include <class_board_item.h> #include <class_board_item.h>

View File

@ -41,12 +41,12 @@ class PLOTTER;
class PCB_TEXT; class PCB_TEXT;
class D_PAD; class D_PAD;
class PCB_SHAPE; class PCB_SHAPE;
class DIMENSION; class DIMENSION_BASE;
class MODULE; class MODULE;
class FP_SHAPE; class FP_SHAPE;
class PCB_TARGET; class PCB_TARGET;
class FP_TEXT; class FP_TEXT;
class ZONE_CONTAINER; class ZONE;
class BOARD; class BOARD;
class REPORTER; class REPORTER;
class wxFileName; class wxFileName;
@ -100,9 +100,9 @@ public:
*/ */
void PlotFootprintTextItems( MODULE* aModule ); void PlotFootprintTextItems( MODULE* aModule );
void PlotDimension( DIMENSION* Dimension ); void PlotDimension( DIMENSION_BASE* Dimension );
void PlotPcbTarget( PCB_TARGET* PtMire ); void PlotPcbTarget( PCB_TARGET* PtMire );
void PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& aPolysList ); void PlotFilledAreas( ZONE* aZone, SHAPE_POLY_SET& aPolysList );
void PlotPcbText( PCB_TEXT* aText ); void PlotPcbText( PCB_TEXT* aText );
void PlotPcbShape( PCB_SHAPE* aShape ); void PlotPcbShape( PCB_SHAPE* aShape );

View File

@ -40,10 +40,10 @@
#include <class_track.h> #include <class_track.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_zone.h> #include <zone.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <class_dimension.h> #include <dimension.h>
#include <pcbplot.h> #include <pcbplot.h>
#include <pcb_painter.h> #include <pcb_painter.h>
@ -487,7 +487,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
NETINFO_ITEM nonet( aBoard ); NETINFO_ITEM nonet( aBoard );
for( ZONE_CONTAINER* zone : aBoard->Zones() ) for( ZONE* zone : aBoard->Zones() )
{ {
for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() ) for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
{ {
@ -510,7 +510,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
if( !islands.IsEmpty() ) if( !islands.IsEmpty() )
{ {
ZONE_CONTAINER dummy( *zone ); ZONE dummy( *zone );
dummy.SetNet( &nonet ); dummy.SetNet( &nonet );
itemplotter.PlotFilledAreas( &dummy, islands ); itemplotter.PlotFilledAreas( &dummy, islands );
} }
@ -809,7 +809,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
int zone_margin = 0; int zone_margin = 0;
#endif #endif
for( ZONE_CONTAINER* zone : aBoard->Zones() ) for( ZONE* zone : aBoard->Zones() )
{ {
if( zone->GetLayer() != layer ) if( zone->GetLayer() != layer )
continue; continue;
@ -829,12 +829,12 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
} }
#if !NEW_ALGO #if !NEW_ALGO
// To avoid a lot of code, use a ZONE_CONTAINER to handle and plot polygons, because our // To avoid a lot of code, use a ZONE to handle and plot polygons, because our polygons look
// polygons look exactly like filled areas in zones. // exactly like filled areas in zones.
// Note, also this code is not optimized: it creates a lot of copy/duplicate data. // Note, also this code is not optimized: it creates a lot of copy/duplicate data.
// However it is not complex, and fast enough for plot purposes (copy/convert data is only a // However it is not complex, and fast enough for plot purposes (copy/convert data is only a
// very small calculation time for these calculations). // very small calculation time for these calculations).
ZONE_CONTAINER zone( aBoard ); ZONE zone( aBoard );
zone.SetMinThickness( 0 ); // trace polygons only zone.SetMinThickness( 0 ); // trace polygons only
zone.SetLayer( layer ); zone.SetLayer( layer );
// Combine the current areas to initial areas. This is mandatory because inflate/deflate // Combine the current areas to initial areas. This is mandatory because inflate/deflate

View File

@ -53,16 +53,16 @@
#include <class_board.h> #include <class_board.h>
#include <class_board_item.h> // for BOARD_ITEM, S_CIRCLE #include <class_board_item.h> // for BOARD_ITEM, S_CIRCLE
#include <class_dimension.h> #include <dimension.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_module.h> #include <class_module.h>
#include <fp_text.h> // for FP_TEXT #include <fp_text.h> // for FP_TEXT
#include <class_track.h> #include <class_track.h>
#include <class_pad.h> // for D_PAD #include <class_pad.h> // for D_PAD
#include <class_pcb_target.h> #include <pcb_target.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_zone.h> #include <zone.h>
#include <wx/debug.h> // for wxASSERT_MSG #include <wx/debug.h> // for wxASSERT_MSG
#include <wx/wx.h> // for wxPoint, wxSize, wxArra... #include <wx/wx.h> // for wxPoint, wxSize, wxArra...
@ -357,7 +357,7 @@ void BRDITEMS_PLOTTER::PlotBoardGraphicItems()
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
if( item->GetLayer() != Edge_Cuts ) if( item->GetLayer() != Edge_Cuts )
PlotDimension( (DIMENSION*) item ); PlotDimension( (DIMENSION_BASE*) item );
break; break;
@ -406,7 +406,7 @@ void BRDITEMS_PLOTTER::PlotFootprintTextItem( FP_TEXT* aTextMod, COLOR4D aColor
} }
void BRDITEMS_PLOTTER::PlotDimension( DIMENSION* aDim ) void BRDITEMS_PLOTTER::PlotDimension( DIMENSION_BASE* aDim )
{ {
if( !m_layerMask[aDim->GetLayer()] ) if( !m_layerMask[aDim->GetLayer()] )
return; return;
@ -746,7 +746,7 @@ void BRDITEMS_PLOTTER::PlotPcbText( PCB_TEXT* aText )
} }
void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE_CONTAINER* aZone, SHAPE_POLY_SET& polysList ) void BRDITEMS_PLOTTER::PlotFilledAreas( ZONE* aZone, SHAPE_POLY_SET& polysList )
{ {
if( polysList.IsEmpty() ) if( polysList.IsEmpty() )
return; return;

View File

@ -27,7 +27,7 @@
#include <plugins/altium/altium_parser_utils.h> #include <plugins/altium/altium_parser_utils.h>
#include <class_board.h> #include <class_board.h>
#include <class_dimension.h> #include <dimension.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_track.h> #include <class_track.h>
@ -1226,7 +1226,7 @@ void ALTIUM_PCB::ParsePolygons6Data(
continue; continue;
} }
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
m_polygons.emplace_back( zone ); m_polygons.emplace_back( zone );
@ -1313,7 +1313,7 @@ void ALTIUM_PCB::ParsePolygons6Data(
} }
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
} }
if( reader.GetRemainingBytes() != 0 ) if( reader.GetRemainingBytes() != 0 )
@ -1391,7 +1391,7 @@ void ALTIUM_PCB::ParseShapeBasedRegions6Data(
continue; continue;
} }
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
zone->SetIsRuleArea( true ); zone->SetIsRuleArea( true );
@ -1423,7 +1423,7 @@ void ALTIUM_PCB::ParseShapeBasedRegions6Data(
} }
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
} }
else if( elem.kind == ALTIUM_REGION_KIND::COPPER ) else if( elem.kind == ALTIUM_REGION_KIND::COPPER )
{ {
@ -1477,12 +1477,10 @@ void ALTIUM_PCB::ParseRegions6Data(
{ {
ALTIUM_PARSER reader( aReader, aEntry ); ALTIUM_PARSER reader( aReader, aEntry );
for( ZONE_CONTAINER* zone : m_polygons ) for( ZONE* zone : m_polygons )
{ {
if( zone != nullptr ) if( zone )
{
zone->UnFill(); // just to be sure zone->UnFill(); // just to be sure
}
} }
while( reader.GetRemainingBytes() >= 4 /* TODO: use Header section of file */ ) while( reader.GetRemainingBytes() >= 4 /* TODO: use Header section of file */ )
@ -1499,7 +1497,7 @@ void ALTIUM_PCB::ParseRegions6Data(
elem.subpolyindex, m_polygons.size() ) ); elem.subpolyindex, m_polygons.size() ) );
} }
ZONE_CONTAINER *zone = m_polygons.at(elem.subpolyindex); ZONE *zone = m_polygons.at( elem.subpolyindex );
if( zone == nullptr ) if( zone == nullptr )
{ {
@ -1571,7 +1569,7 @@ void ALTIUM_PCB::ParseArcs6Data( const CFB::CompoundFileReader& aReader,
shape.SetArcStart( elem.center + arcStartOffset ); shape.SetArcStart( elem.center + arcStartOffset );
} }
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
zone->SetIsRuleArea( true ); zone->SetIsRuleArea( true );
@ -1604,7 +1602,7 @@ void ALTIUM_PCB::ParseArcs6Data( const CFB::CompoundFileReader& aReader,
zone->Outline()->Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); // the outline is not a single polygon! zone->Outline()->Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); // the outline is not a single polygon!
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
continue; continue;
} }
@ -2143,7 +2141,7 @@ void ALTIUM_PCB::ParseTracks6Data( const CFB::CompoundFileReader& aReader,
shape.SetEnd( elem.end ); shape.SetEnd( elem.end );
shape.SetWidth( elem.width ); shape.SetWidth( elem.width );
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
zone->SetIsRuleArea( true ); zone->SetIsRuleArea( true );
@ -2175,7 +2173,7 @@ void ALTIUM_PCB::ParseTracks6Data( const CFB::CompoundFileReader& aReader,
ERROR_INSIDE ); ERROR_INSIDE );
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
continue; continue;
} }
@ -2425,7 +2423,7 @@ void ALTIUM_PCB::ParseFills6Data(
if( elem.is_keepout || elem.net != ALTIUM_NET_UNCONNECTED ) if( elem.is_keepout || elem.net != ALTIUM_NET_UNCONNECTED )
{ {
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
zone->SetNetCode( GetNetCode( elem.net ) ); zone->SetNetCode( GetNetCode( elem.net ) );
@ -2457,7 +2455,7 @@ void ALTIUM_PCB::ParseFills6Data(
zone->Rotate( center, elem.rotation * 10 ); zone->Rotate( center, elem.rotation * 10 );
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
} }
else else
{ {

View File

@ -84,7 +84,7 @@ enum class ALTIUM_PCB_DIR
class BOARD; class BOARD;
class PCB_SHAPE; class PCB_SHAPE;
class MODULE; class MODULE;
class ZONE_CONTAINER; class ZONE;
/** /**
@ -184,13 +184,13 @@ private:
BOARD* m_board; BOARD* m_board;
std::vector<MODULE*> m_components; std::vector<MODULE*> m_components;
std::vector<ZONE_CONTAINER*> m_polygons; std::vector<ZONE*> m_polygons;
std::map<wxString, wxString> m_models; std::map<wxString, wxString> m_models;
size_t m_num_nets; size_t m_num_nets;
std::map<ALTIUM_LAYER, PCB_LAYER_ID> m_layermap; // used to correctly map copper layers std::map<ALTIUM_LAYER, PCB_LAYER_ID> m_layermap; // used to correctly map copper layers
std::map<ALTIUM_RULE_KIND, std::vector<ARULE6>> m_rules; std::map<ALTIUM_RULE_KIND, std::vector<ARULE6>> m_rules;
std::map<ALTIUM_LAYER, ZONE_CONTAINER*> m_outer_plane; std::map<ALTIUM_LAYER, ZONE*> m_outer_plane;
/// Altium stores pour order across all layers /// Altium stores pour order across all layers
int m_highest_pour_index; int m_highest_pour_index;

View File

@ -27,13 +27,13 @@
#include <board_stackup_manager/stackup_predefined_prms.h> // KEY_COPPER, KEY_CORE, KEY_PREPREG #include <board_stackup_manager/stackup_predefined_prms.h> // KEY_COPPER, KEY_CORE, KEY_PREPREG
#include <class_board.h> #include <class_board.h>
#include <class_dimension.h> #include <dimension.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_module.h> #include <class_module.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <convert_basic_shapes_to_polygon.h> #include <convert_basic_shapes_to_polygon.h>
#include <trigo.h> #include <trigo.h>
@ -662,8 +662,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryAreas( const SYMDEF_PCB& aComponent,
if( area.NoVias || area.NoTracks ) if( area.NoVias || area.NoTracks )
{ {
ZONE_CONTAINER* zone = getZoneFromCadstarShape( ZONE* zone = getZoneFromCadstarShape( area.Shape, getLineThickness( area.LineCodeID ),
area.Shape, getLineThickness( area.LineCodeID ), aModule ); aModule );
aModule->Add( zone, ADD_MODE::APPEND ); aModule->Add( zone, ADD_MODE::APPEND );
@ -1137,8 +1137,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadAreas()
if( area.NoVias || area.NoTracks || area.Keepout || area.Routing ) if( area.NoVias || area.NoTracks || area.Keepout || area.Routing )
{ {
ZONE_CONTAINER* zone = getZoneFromCadstarShape( ZONE* zone = getZoneFromCadstarShape( area.Shape, getLineThickness( area.LineCodeID ),
area.Shape, getLineThickness( area.LineCodeID ), mBoard ); mBoard );
mBoard->Add( zone, ADD_MODE::APPEND ); mBoard->Add( zone, ADD_MODE::APPEND );
@ -1327,8 +1327,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates()
{ {
TEMPLATE& csTemplate = tempPair.second; TEMPLATE& csTemplate = tempPair.second;
ZONE_CONTAINER* zone = getZoneFromCadstarShape( ZONE* zone = getZoneFromCadstarShape( csTemplate.Shape,
csTemplate.Shape, getLineThickness( csTemplate.LineCodeID ), mBoard ); getLineThickness( csTemplate.LineCodeID ), mBoard );
mBoard->Add( zone, ADD_MODE::APPEND ); mBoard->Add( zone, ADD_MODE::APPEND );
@ -1450,11 +1450,10 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates()
for( std::pair<BOARD_ID, BOARD> boardPair : Layout.Boards ) for( std::pair<BOARD_ID, BOARD> boardPair : Layout.Boards )
{ {
//create a zone in each board shape //create a zone in each board shape
BOARD_DESIGN_SETTINGS& bds = mBoard->GetDesignSettings();
BOARD& board = boardPair.second; BOARD& board = boardPair.second;
int defaultLineThicknesss = int defaultLineThicknesss = bds.GetLineThickness( PCB_LAYER_ID::Edge_Cuts );
mBoard->GetDesignSettings().GetLineThickness( PCB_LAYER_ID::Edge_Cuts ); ZONE* zone = getZoneFromCadstarShape( board.Shape, defaultLineThicknesss, mBoard );
ZONE_CONTAINER* zone =
getZoneFromCadstarShape( board.Shape, defaultLineThicknesss, mBoard );
mBoard->Add( zone, ADD_MODE::APPEND ); mBoard->Add( zone, ADD_MODE::APPEND );
@ -1523,8 +1522,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers()
} }
else else
{ {
ZONE_CONTAINER* zone = getZoneFromCadstarShape( csCopper.Shape, ZONE* zone = getZoneFromCadstarShape( csCopper.Shape,
getKiCadLength( getCopperCode( csCopper.CopperCodeID ).CopperWidth ), mBoard ); getKiCadLength( getCopperCode( csCopper.CopperCodeID ).CopperWidth ),
mBoard );
mBoard->Add( zone, ADD_MODE::APPEND ); mBoard->Add( zone, ADD_MODE::APPEND );
@ -2077,10 +2077,11 @@ PCB_SHAPE* CADSTAR_PCB_ARCHIVE_LOADER::getDrawSegmentFromVertex( const POINT& aC
} }
ZONE_CONTAINER* CADSTAR_PCB_ARCHIVE_LOADER::getZoneFromCadstarShape( const SHAPE& aCadstarShape, ZONE* CADSTAR_PCB_ARCHIVE_LOADER::getZoneFromCadstarShape( const SHAPE& aCadstarShape,
const int& aLineThickness, BOARD_ITEM_CONTAINER* aParentContainer ) const int& aLineThickness,
BOARD_ITEM_CONTAINER* aParentContainer )
{ {
ZONE_CONTAINER* zone = new ZONE_CONTAINER( aParentContainer, isModule( aParentContainer ) ); ZONE* zone = new ZONE( aParentContainer, isModule( aParentContainer ) );
if( aCadstarShape.Type == SHAPE_TYPE::HATCHED ) if( aCadstarShape.Type == SHAPE_TYPE::HATCHED )
{ {

View File

@ -266,10 +266,10 @@ private:
* @param aCadstarShape * @param aCadstarShape
* @param aLineThickness Thickness of line to draw with * @param aLineThickness Thickness of line to draw with
* @param aParentContainer Parent object (e.g. mBoard or a MODULE pointer) * @param aParentContainer Parent object (e.g. mBoard or a MODULE pointer)
* @return Pointer to ZONE_CONTAINER. Caller owns the object. * @return Pointer to ZONE. Caller owns the object.
*/ */
ZONE_CONTAINER* getZoneFromCadstarShape( const SHAPE& aCadstarShape, const int& aLineThickness, ZONE* getZoneFromCadstarShape( const SHAPE& aCadstarShape, const int& aLineThickness,
BOARD_ITEM_CONTAINER* aParentContainer ); BOARD_ITEM_CONTAINER* aParentContainer );
/** /**
* @brief Returns a SHAPE_POLY_SET object from a Cadstar SHAPE * @brief Returns a SHAPE_POLY_SET object from a Cadstar SHAPE

View File

@ -68,9 +68,9 @@ Load() TODO's
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_zone.h> #include <zone.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_dimension.h> #include <dimension.h>
#include <plugins/eagle/eagle_plugin.h> #include <plugins/eagle/eagle_plugin.h>
@ -174,7 +174,7 @@ static wxString interpret_text( const wxString& aText )
} }
static void setKeepoutSettingsToZone( ZONE_CONTAINER* aZone, LAYER_NUM aLayer ) static void setKeepoutSettingsToZone( ZONE* aZone, LAYER_NUM aLayer )
{ {
if( aLayer == EAGLE_LAYER::TRESTRICT || aLayer == EAGLE_LAYER::BRESTRICT ) if( aLayer == EAGLE_LAYER::TRESTRICT || aLayer == EAGLE_LAYER::BRESTRICT )
{ {
@ -734,7 +734,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
if( c.layer == EAGLE_LAYER::TRESTRICT || c.layer == EAGLE_LAYER::BRESTRICT if( c.layer == EAGLE_LAYER::TRESTRICT || c.layer == EAGLE_LAYER::BRESTRICT
|| c.layer == EAGLE_LAYER::VRESTRICT ) || c.layer == EAGLE_LAYER::VRESTRICT )
{ {
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
setKeepoutSettingsToZone( zone, c.layer ); setKeepoutSettingsToZone( zone, c.layer );
@ -762,7 +762,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
} }
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
} }
else else
{ {
@ -801,7 +801,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
if( IsCopperLayer( layer ) ) if( IsCopperLayer( layer ) )
{ {
// use a "netcode = 0" type ZONE: // use a "netcode = 0" type ZONE:
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
zone->SetLayer( layer ); zone->SetLayer( layer );
@ -819,7 +819,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
zone->Rotate( zone->GetPosition(), r.rot->degrees * 10 ); zone->Rotate( zone->GetPosition(), r.rot->degrees * 10 );
// this is not my fault: // this is not my fault:
zone->SetBorderDisplayStyle( outline_hatch, ZONE_CONTAINER::GetDefaultHatchPitch(), zone->SetBorderDisplayStyle( outline_hatch, ZONE::GetDefaultHatchPitch(),
true ); true );
} }
@ -1236,20 +1236,20 @@ void EAGLE_PLUGIN::loadElements( wxXmlNode* aElements )
} }
ZONE_CONTAINER* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode ) ZONE* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode )
{ {
EPOLYGON p( aPolyNode ); EPOLYGON p( aPolyNode );
PCB_LAYER_ID layer = kicad_layer( p.layer ); PCB_LAYER_ID layer = kicad_layer( p.layer );
ZONE_CONTAINER* zone = nullptr; ZONE* zone = nullptr;
bool keepout = ( p.layer == EAGLE_LAYER::TRESTRICT bool keepout = ( p.layer == EAGLE_LAYER::TRESTRICT
|| p.layer == EAGLE_LAYER::BRESTRICT || p.layer == EAGLE_LAYER::BRESTRICT
|| p.layer == EAGLE_LAYER::VRESTRICT ); || p.layer == EAGLE_LAYER::VRESTRICT );
if( !IsCopperLayer( layer ) && !keepout ) if( !IsCopperLayer( layer ) && !keepout )
return nullptr; return nullptr;
// use a "netcode = 0" type ZONE: // use a "netcode = 0" type ZONE:
zone = new ZONE_CONTAINER( m_board ); zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
if( !keepout ) if( !keepout )
@ -1854,7 +1854,7 @@ void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, wxXmlNode* aTree ) const
if( r.layer == EAGLE_LAYER::TRESTRICT || r.layer == EAGLE_LAYER::BRESTRICT if( r.layer == EAGLE_LAYER::TRESTRICT || r.layer == EAGLE_LAYER::BRESTRICT
|| r.layer == EAGLE_LAYER::VRESTRICT ) || r.layer == EAGLE_LAYER::VRESTRICT )
{ {
MODULE_ZONE_CONTAINER* zone = new MODULE_ZONE_CONTAINER( aModule ); FP_ZONE* zone = new FP_ZONE( aModule );
aModule->Add( zone, ADD_MODE::APPEND ); aModule->Add( zone, ADD_MODE::APPEND );
setKeepoutSettingsToZone( zone, r.layer ); setKeepoutSettingsToZone( zone, r.layer );
@ -1873,7 +1873,7 @@ void EAGLE_PLUGIN::packageRectangle( MODULE* aModule, wxXmlNode* aTree ) const
} }
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
} }
else else
{ {
@ -1968,7 +1968,7 @@ void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, wxXmlNode* aTree ) const
|| p.layer == EAGLE_LAYER::BRESTRICT || p.layer == EAGLE_LAYER::BRESTRICT
|| p.layer == EAGLE_LAYER::VRESTRICT ) || p.layer == EAGLE_LAYER::VRESTRICT )
{ {
MODULE_ZONE_CONTAINER* zone = new MODULE_ZONE_CONTAINER( aModule ); FP_ZONE* zone = new FP_ZONE( aModule );
aModule->Add( zone, ADD_MODE::APPEND ); aModule->Add( zone, ADD_MODE::APPEND );
setKeepoutSettingsToZone( zone, p.layer ); setKeepoutSettingsToZone( zone, p.layer );
@ -1978,7 +1978,7 @@ void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, wxXmlNode* aTree ) const
zone->Outline()->AddOutline( outline ); zone->Outline()->AddOutline( outline );
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
} }
else else
{ {
@ -2010,7 +2010,7 @@ void EAGLE_PLUGIN::packageCircle( MODULE* aModule, wxXmlNode* aTree ) const
|| e.layer == EAGLE_LAYER::BRESTRICT || e.layer == EAGLE_LAYER::BRESTRICT
|| e.layer == EAGLE_LAYER::VRESTRICT ) || e.layer == EAGLE_LAYER::VRESTRICT )
{ {
MODULE_ZONE_CONTAINER* zone = new MODULE_ZONE_CONTAINER( aModule ); FP_ZONE* zone = new FP_ZONE( aModule );
aModule->Add( zone, ADD_MODE::APPEND ); aModule->Add( zone, ADD_MODE::APPEND );
setKeepoutSettingsToZone( zone, e.layer ); setKeepoutSettingsToZone( zone, e.layer );
@ -2038,7 +2038,7 @@ void EAGLE_PLUGIN::packageCircle( MODULE* aModule, wxXmlNode* aTree ) const
} }
zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE, zone->SetBorderDisplayStyle( ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE,
ZONE_CONTAINER::GetDefaultHatchPitch(), true ); ZONE::GetDefaultHatchPitch(), true );
} }
else else
{ {
@ -2436,7 +2436,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
{ {
// KiCad does not support an unconnected zone with its own non-zero netcode, // KiCad does not support an unconnected zone with its own non-zero netcode,
// but only when assigned netcode = 0 w/o a name... // but only when assigned netcode = 0 w/o a name...
for( ZONE_CONTAINER* zone : zones ) for( ZONE* zone : zones )
zone->SetNetCode( NETINFO_LIST::UNCONNECTED ); zone->SetNetCode( NETINFO_LIST::UNCONNECTED );
// therefore omit this signal/net. // therefore omit this signal/net.

View File

@ -34,10 +34,10 @@
class D_PAD; class D_PAD;
class FP_TEXT; class FP_TEXT;
class ZONE_CONTAINER; class ZONE;
typedef std::map<wxString, MODULE*> MODULE_MAP; typedef std::map<wxString, MODULE*> MODULE_MAP;
typedef std::vector<ZONE_CONTAINER*> ZONES; typedef std::vector<ZONE*> ZONES;
typedef std::map<wxString, ENET> NET_MAP; typedef std::map<wxString, ENET> NET_MAP;
typedef NET_MAP::const_iterator NET_MAP_CITER; typedef NET_MAP::const_iterator NET_MAP_CITER;
@ -247,7 +247,7 @@ private:
* *
* @return The loaded zone or nullptr if was not processed. * @return The loaded zone or nullptr if was not processed.
*/ */
ZONE_CONTAINER* loadPolygon( wxXmlNode* aPolyNode ); ZONE* loadPolygon( wxXmlNode* aPolyNode );
void orientModuleAndText( MODULE* m, const EELEMENT& e, const EATTR* nameAttr, const EATTR* valueAttr ); void orientModuleAndText( MODULE* m, const EELEMENT& e, const EATTR* nameAttr, const EATTR* valueAttr );
void orientModuleText( MODULE* m, const EELEMENT& e, FP_TEXT* txt, const EATTR* a ); void orientModuleText( MODULE* m, const EELEMENT& e, FP_TEXT* txt, const EATTR* a );

View File

@ -30,11 +30,11 @@
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_dimension.h> #include <dimension.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <confirm.h> #include <confirm.h>
#include <locale_io.h> #include <locale_io.h>
@ -396,7 +396,7 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:
case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_ORTHOGONAL_T:
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
format( static_cast<DIMENSION*>( aItem ), aNestLevel ); format( static_cast<DIMENSION_BASE*>( aItem ), aNestLevel );
break; break;
case PCB_SHAPE_T: case PCB_SHAPE_T:
@ -437,9 +437,9 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const
format( static_cast<TRACK*>( aItem ), aNestLevel ); format( static_cast<TRACK*>( aItem ), aNestLevel );
break; break;
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
format( static_cast<ZONE_CONTAINER*>( aItem ), aNestLevel ); format( static_cast<ZONE*>( aItem ), aNestLevel );
break; break;
default: default:
@ -665,7 +665,7 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
} }
void PCB_IO::format( DIMENSION* aDimension, int aNestLevel ) const void PCB_IO::format( DIMENSION_BASE* aDimension, int aNestLevel ) const
{ {
ALIGNED_DIMENSION* aligned = dynamic_cast<ALIGNED_DIMENSION*>( aDimension ); ALIGNED_DIMENSION* aligned = dynamic_cast<ALIGNED_DIMENSION*>( aDimension );
ORTHOGONAL_DIMENSION* ortho = dynamic_cast<ORTHOGONAL_DIMENSION*>( aDimension ); ORTHOGONAL_DIMENSION* ortho = dynamic_cast<ORTHOGONAL_DIMENSION*>( aDimension );
@ -1730,10 +1730,10 @@ void PCB_IO::format( TRACK* aTrack, int aNestLevel ) const
} }
void PCB_IO::format( ZONE_CONTAINER* aZone, int aNestLevel ) const void PCB_IO::format( ZONE* aZone, int aNestLevel ) const
{ {
// Save the NET info; For keepout zones, net code and net name are irrelevant // Save the NET info; For keepout zones, net code and net name are irrelevant
// so be sure a dummy value is stored, just for ZONE_CONTAINER compatibility // so be sure a dummy value is stored, just for ZONE compatibility
// (perhaps netcode and netname should be not stored) // (perhaps netcode and netname should be not stored)
m_out->Print( aNestLevel, "(zone (net %d) (net_name %s)", m_out->Print( aNestLevel, "(zone (net %d) (net_name %s)",
aZone->GetIsRuleArea() ? 0 : m_mapping->Translate( aZone->GetNetCode() ), aZone->GetIsRuleArea() ? 0 : m_mapping->Translate( aZone->GetNetCode() ),

View File

@ -35,7 +35,7 @@ class FP_CACHE;
class PCB_PARSER; class PCB_PARSER;
class NETINFO_MAPPING; class NETINFO_MAPPING;
class BOARD_DESIGN_SETTINGS; class BOARD_DESIGN_SETTINGS;
class DIMENSION; class DIMENSION_BASE;
class FP_SHAPE; class FP_SHAPE;
class PCB_SHAPE; class PCB_SHAPE;
class PCB_TARGET; class PCB_TARGET;
@ -43,7 +43,7 @@ class D_PAD;
class FP_TEXT; class FP_TEXT;
class PCB_GROUP; class PCB_GROUP;
class TRACK; class TRACK;
class ZONE_CONTAINER; class ZONE;
class PCB_TEXT; class PCB_TEXT;
@ -258,7 +258,7 @@ protected:
private: private:
void format( BOARD* aBoard, int aNestLevel = 0 ) const; void format( BOARD* aBoard, int aNestLevel = 0 ) const;
void format( DIMENSION* aDimension, int aNestLevel = 0 ) const; void format( DIMENSION_BASE* aDimension, int aNestLevel = 0 ) const;
void format( FP_SHAPE* aModuleDrawing, int aNestLevel = 0 ) const; void format( FP_SHAPE* aModuleDrawing, int aNestLevel = 0 ) const;
@ -278,7 +278,7 @@ private:
void format( TRACK* aTrack, int aNestLevel = 0 ) const; void format( TRACK* aTrack, int aNestLevel = 0 ) const;
void format( ZONE_CONTAINER* aZone, int aNestLevel = 0 ) const; void format( ZONE* aZone, int aNestLevel = 0 ) const;
void formatLayer( const BOARD_ITEM* aItem ) const; void formatLayer( const BOARD_ITEM* aItem ) const;

View File

@ -36,16 +36,16 @@
#include <advanced_config.h> #include <advanced_config.h>
#include <class_board.h> #include <class_board.h>
#include <class_dimension.h> #include <dimension.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_pcb_group.h> #include <class_pcb_group.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <class_module.h> #include <class_module.h>
#include <netclass.h> #include <netclass.h>
#include <class_pad.h> #include <class_pad.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <plugins/kicad/kicad_plugin.h> #include <plugins/kicad/kicad_plugin.h>
#include <pcb_plot_params_parser.h> #include <pcb_plot_params_parser.h>
#include <pcb_plot_params.h> #include <pcb_plot_params.h>
@ -635,7 +635,7 @@ BOARD* PCB_PARSER::parseBOARD_unchecked()
break; break;
case T_zone: case T_zone:
m_board->Add( parseZONE_CONTAINER( m_board ), ADD_MODE::APPEND ); m_board->Add( parseZONE( m_board ), ADD_MODE::APPEND );
break; break;
case T_target: case T_target:
@ -2360,14 +2360,14 @@ PCB_TEXT* PCB_PARSER::parsePCB_TEXT()
} }
DIMENSION* PCB_PARSER::parseDIMENSION() DIMENSION_BASE* PCB_PARSER::parseDIMENSION()
{ {
wxCHECK_MSG( CurTok() == T_dimension, NULL, wxCHECK_MSG( CurTok() == T_dimension, NULL,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as DIMENSION." ) ); wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as DIMENSION." ) );
T token; T token;
std::unique_ptr<DIMENSION> dimension; std::unique_ptr<DIMENSION_BASE> dimension;
// skip value that used to be saved // skip value that used to be saved
if( NextTok() != T_LEFT ) if( NextTok() != T_LEFT )
@ -3056,7 +3056,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments )
case T_zone: case T_zone:
{ {
ZONE_CONTAINER* zone = parseZONE_CONTAINER( module.get() ); ZONE* zone = parseZONE( module.get() );
module->Add( zone, ADD_MODE::APPEND ); module->Add( zone, ADD_MODE::APPEND );
} }
break; break;
@ -4260,35 +4260,35 @@ VIA* PCB_PARSER::parseVIA()
} }
ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER( BOARD_ITEM_CONTAINER* aParent ) ZONE* PCB_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent )
{ {
wxCHECK_MSG( CurTok() == T_zone, NULL, wxCHECK_MSG( CurTok() == T_zone, NULL,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( "Cannot parse " ) + GetTokenString( CurTok() ) +
wxT( " as ZONE_CONTAINER." ) ); wxT( " as ZONE." ) );
ZONE_BORDER_DISPLAY_STYLE hatchStyle = ZONE_BORDER_DISPLAY_STYLE::NO_HATCH; ZONE_BORDER_DISPLAY_STYLE hatchStyle = ZONE_BORDER_DISPLAY_STYLE::NO_HATCH;
int hatchPitch = ZONE_CONTAINER::GetDefaultHatchPitch(); int hatchPitch = ZONE::GetDefaultHatchPitch();
wxPoint pt; wxPoint pt;
T token; T token;
int tmp; int tmp;
wxString netnameFromfile; // the zone net name find in file wxString netnameFromfile; // the zone net name find in file
// bigger scope since each filled_polygon is concatenated in here // bigger scope since each filled_polygon is concatenated in here
std::map<PCB_LAYER_ID, SHAPE_POLY_SET> pts; std::map<PCB_LAYER_ID, SHAPE_POLY_SET> pts;
bool inModule = false; bool inModule = false;
PCB_LAYER_ID filledLayer; PCB_LAYER_ID filledLayer;
bool addedFilledPolygons = false; bool addedFilledPolygons = false;
if( dynamic_cast<MODULE*>( aParent ) ) // The zone belongs a footprint if( dynamic_cast<MODULE*>( aParent ) ) // The zone belongs a footprint
inModule = true; inModule = true;
std::unique_ptr<ZONE_CONTAINER> zone; std::unique_ptr<ZONE> zone;
if( inModule ) if( inModule )
zone = std::make_unique<MODULE_ZONE_CONTAINER>( aParent ); zone = std::make_unique<FP_ZONE>( aParent );
else else
zone = std::make_unique<ZONE_CONTAINER>( aParent ); zone = std::make_unique<ZONE>( aParent );
zone->SetPriority( 0 ); zone->SetPriority( 0 );

View File

@ -45,7 +45,7 @@ class BOARD_ITEM;
class BOARD_ITEM_CONTAINER; class BOARD_ITEM_CONTAINER;
class D_PAD; class D_PAD;
class BOARD_DESIGN_SETTINGS; class BOARD_DESIGN_SETTINGS;
class DIMENSION; class DIMENSION_BASE;
class PCB_SHAPE; class PCB_SHAPE;
class EDA_TEXT; class EDA_TEXT;
class FP_SHAPE; class FP_SHAPE;
@ -56,7 +56,7 @@ class MODULE;
class PCB_GROUP; class PCB_GROUP;
class PCB_TARGET; class PCB_TARGET;
class VIA; class VIA;
class ZONE_CONTAINER; class ZONE;
class MARKER_PCB; class MARKER_PCB;
class MODULE_3D_SETTINGS; class MODULE_3D_SETTINGS;
struct LAYER; struct LAYER;
@ -164,7 +164,7 @@ class PCB_PARSER : public PCB_LEXER
*/ */
PCB_SHAPE* parsePCB_SHAPE( bool aAllowZeroWidth = false ); PCB_SHAPE* parsePCB_SHAPE( bool aAllowZeroWidth = false );
PCB_TEXT* parsePCB_TEXT(); PCB_TEXT* parsePCB_TEXT();
DIMENSION* parseDIMENSION(); DIMENSION_BASE* parseDIMENSION();
/** /**
* Function parseMODULE_unchecked * Function parseMODULE_unchecked
@ -179,7 +179,7 @@ class PCB_PARSER : public PCB_LEXER
ARC* parseARC(); ARC* parseARC();
TRACK* parseTRACK(); TRACK* parseTRACK();
VIA* parseVIA(); VIA* parseVIA();
ZONE_CONTAINER* parseZONE_CONTAINER( BOARD_ITEM_CONTAINER* aParent ); ZONE* parseZONE( BOARD_ITEM_CONTAINER* aParent );
PCB_TARGET* parsePCB_TARGET(); PCB_TARGET* parsePCB_TARGET();
MARKER_PCB* parseMARKER( BOARD_ITEM_CONTAINER* aParent ); MARKER_PCB* parseMARKER( BOARD_ITEM_CONTAINER* aParent );
BOARD* parseBOARD(); BOARD* parseBOARD();

View File

@ -76,10 +76,10 @@
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_zone.h> #include <zone.h>
#include <class_dimension.h> #include <dimension.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <3d_cache/3d_info.h> #include <3d_cache/3d_info.h>
#include <pcb_plot_params.h> #include <pcb_plot_params.h>
@ -2434,7 +2434,7 @@ void LEGACY_PLUGIN::loadNETCLASS()
void LEGACY_PLUGIN::loadZONE_CONTAINER() void LEGACY_PLUGIN::loadZONE_CONTAINER()
{ {
std::unique_ptr<ZONE_CONTAINER> zc = std::make_unique<ZONE_CONTAINER>( m_board ); std::unique_ptr<ZONE> zc = std::make_unique<ZONE>( m_board );
ZONE_BORDER_DISPLAY_STYLE outline_hatch = ZONE_BORDER_DISPLAY_STYLE::NO_HATCH; ZONE_BORDER_DISPLAY_STYLE outline_hatch = ZONE_BORDER_DISPLAY_STYLE::NO_HATCH;
bool endContour = false; bool endContour = false;
@ -2712,8 +2712,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
// HatchBorder here, after outlines corners are read // HatchBorder here, after outlines corners are read
// Set hatch here, after outlines corners are read // Set hatch here, after outlines corners are read
zc->SetBorderDisplayStyle( outline_hatch, ZONE_CONTAINER::GetDefaultHatchPitch(), zc->SetBorderDisplayStyle( outline_hatch, ZONE::GetDefaultHatchPitch(), true );
true );
m_board->Add( zc.release() ); m_board->Add( zc.release() );
} }

View File

@ -43,8 +43,8 @@ class MODULE;
class TRACK; class TRACK;
class NETCLASS; class NETCLASS;
class NETCLASSES; class NETCLASSES;
class ZONE_CONTAINER; class ZONE;
class DIMENSION; class DIMENSION_BASE;
class NETINFO_ITEM; class NETINFO_ITEM;
class NETINFO_MAPPING; class NETINFO_MAPPING;
class FP_TEXT; class FP_TEXT;

View File

@ -38,7 +38,6 @@
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h>
namespace PCAD2KICAD { namespace PCAD2KICAD {

View File

@ -190,7 +190,7 @@ void PCB_POLYGON::AddToBoard()
if( m_outline.GetCount() > 0 ) if( m_outline.GetCount() > 0 )
{ {
ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); ZONE* zone = new ZONE( m_board );
m_board->Add( zone, ADD_MODE::APPEND ); m_board->Add( zone, ADD_MODE::APPEND );
zone->SetLayer( m_KiCadLayer ); zone->SetLayer( m_KiCadLayer );

View File

@ -25,7 +25,7 @@
#include <fp_text.h> #include <fp_text.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <pcb_shape.h> #include <pcb_shape.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <board_commit.h> #include <board_commit.h>
@ -923,8 +923,7 @@ std::unique_ptr<PNS::VIA> PNS_KICAD_IFACE_BASE::syncVia( VIA* aVia )
} }
bool PNS_KICAD_IFACE_BASE::syncZone( PNS::NODE* aWorld, ZONE_CONTAINER* aZone, bool PNS_KICAD_IFACE_BASE::syncZone( PNS::NODE* aWorld, ZONE* aZone, SHAPE_POLY_SET* aBoardOutline )
SHAPE_POLY_SET* aBoardOutline )
{ {
SHAPE_POLY_SET poly; SHAPE_POLY_SET poly;
@ -1182,7 +1181,7 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld )
if( m_board->GetBoardPolygonOutlines( buffer ) ) if( m_board->GetBoardPolygonOutlines( buffer ) )
boardOutline = &buffer; boardOutline = &buffer;
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
syncZone( aWorld, zone, boardOutline ); syncZone( aWorld, zone, boardOutline );
} }
@ -1200,7 +1199,7 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld )
syncTextItem( aWorld, &module->Reference(), module->Reference().GetLayer() ); syncTextItem( aWorld, &module->Reference(), module->Reference().GetLayer() );
syncTextItem( aWorld, &module->Value(), module->Value().GetLayer() ); syncTextItem( aWorld, &module->Value(), module->Value().GetLayer() );
for( MODULE_ZONE_CONTAINER* zone : module->Zones() ) for( FP_ZONE* zone : module->Zones() )
syncZone( aWorld, zone, boardOutline ); syncZone( aWorld, zone, boardOutline );
if( module->IsNetTie() ) if( module->IsNetTie() )

View File

@ -94,7 +94,7 @@ protected:
std::unique_ptr<PNS::VIA> syncVia( VIA* aVia ); std::unique_ptr<PNS::VIA> syncVia( VIA* aVia );
bool syncTextItem( PNS::NODE* aWorld, EDA_TEXT* aText, PCB_LAYER_ID aLayer ); bool syncTextItem( PNS::NODE* aWorld, EDA_TEXT* aText, PCB_LAYER_ID aLayer );
bool syncGraphicalItem( PNS::NODE* aWorld, PCB_SHAPE* aItem ); bool syncGraphicalItem( PNS::NODE* aWorld, PCB_SHAPE* aItem );
bool syncZone( PNS::NODE* aWorld, ZONE_CONTAINER* aZone, SHAPE_POLY_SET* aBoardOutline ); bool syncZone( PNS::NODE* aWorld, ZONE* aZone, SHAPE_POLY_SET* aBoardOutline );
bool inheritTrackWidth( PNS::ITEM* aItem, int* aInheritedWidth ); bool inheritTrackWidth( PNS::ITEM* aItem, int* aInheritedWidth );
protected: protected:

View File

@ -1565,7 +1565,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
view()->AddToPreview( previewItem ); view()->AddToPreview( previewItem );
view()->Hide( &module->Value() ); view()->Hide( &module->Value() );
for( ZONE_CONTAINER* zone : module->Zones() ) for( ZONE* zone : module->Zones() )
{ {
previewItem = static_cast<BOARD_ITEM*>( zone->Clone() ); previewItem = static_cast<BOARD_ITEM*>( zone->Clone() );
previewItem->Move( offset ); previewItem->Move( offset );
@ -1601,7 +1601,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
view()->Hide( &module->Reference(), false ); view()->Hide( &module->Reference(), false );
view()->Hide( &module->Value(), false ); view()->Hide( &module->Value(), false );
for( ZONE_CONTAINER* zone : module->Zones() ) for( ZONE* zone : module->Zones() )
view()->Hide( zone, false ); view()->Hide( zone, false );
view()->ClearPreview(); view()->ClearPreview();

View File

@ -46,7 +46,7 @@
#include <class_module.h> #include <class_module.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <base_units.h> #include <base_units.h>
#include <collectors.h> #include <collectors.h>
#include <geometry/shape_poly_set.h> #include <geometry/shape_poly_set.h>
@ -1073,12 +1073,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
{ {
int netlessZones = 0; int netlessZones = 0;
static const KICAD_T scanZONEs[] = { PCB_ZONE_AREA_T, EOT }; static const KICAD_T scanZONEs[] = { PCB_ZONE_T, EOT };
items.Collect( aBoard, scanZONEs ); items.Collect( aBoard, scanZONEs );
for( int i = 0; i<items.GetCount(); ++i ) for( int i = 0; i<items.GetCount(); ++i )
{ {
ZONE_CONTAINER* item = (ZONE_CONTAINER*) items[i]; ZONE* item = (ZONE*) items[i];
if( item->GetIsRuleArea() ) if( item->GetIsRuleArea() )
continue; continue;
@ -1191,12 +1191,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
//-----<zone containers flagged keepout areas become keepout>-------------------------------- //-----<zone containers flagged keepout areas become keepout>--------------------------------
{ {
static const KICAD_T scanZONEs[] = { PCB_ZONE_AREA_T, EOT }; static const KICAD_T scanZONEs[] = { PCB_ZONE_T, EOT };
items.Collect( aBoard, scanZONEs ); items.Collect( aBoard, scanZONEs );
for( int i=0; i<items.GetCount(); ++i ) for( int i=0; i<items.GetCount(); ++i )
{ {
ZONE_CONTAINER* item = (ZONE_CONTAINER*) items[i]; ZONE* item = (ZONE*) items[i];
if( !item->GetIsRuleArea() ) if( !item->GetIsRuleArea() )
continue; continue;

View File

@ -40,7 +40,6 @@
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
#include <view/view.h> #include <view/view.h>
#include "specctra.h" #include "specctra.h"

View File

@ -54,9 +54,9 @@
0 | 0 ); 0 | 0 );
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
obj = SWIG_NewPointerObj( SWIG_as_voidptr(aItem), obj = SWIG_NewPointerObj( SWIG_as_voidptr(aItem),
SWIGTYPE_p_ZONE_CONTAINER, SWIGTYPE_p_ZONE,
0 | 0 ); 0 | 0 );
break; break;

View File

@ -62,7 +62,8 @@ class EDGE_MODULE;
class D_PAD; class D_PAD;
class TRACK; class TRACK;
class VIA; class VIA;
class ZONE_CONTAINER; class ZONE;
class FP_ZONE;
class PCB_TARGET; class PCB_TARGET;
// Anthing targeted to the %wrapper section is extern "C" whereas code targeted // Anthing targeted to the %wrapper section is extern "C" whereas code targeted
@ -86,7 +87,8 @@ static FP_SHAPE* Cast_to_FP_SHAPE( BOARD_ITEM* );
static D_PAD* Cast_to_D_PAD( BOARD_ITEM* ); static D_PAD* Cast_to_D_PAD( BOARD_ITEM* );
static TRACK* Cast_to_TRACK( BOARD_ITEM* ); static TRACK* Cast_to_TRACK( BOARD_ITEM* );
static VIA* Cast_to_VIA( BOARD_ITEM* ); static VIA* Cast_to_VIA( BOARD_ITEM* );
static ZONE_CONTAINER* Cast_to_ZONE_CONTAINER( BOARD_ITEM* ); static ZONE* Cast_to_ZONE( BOARD_ITEM* );
static FP_ZONE* Cast_to_FP_ZONE( BOARD_ITEM* );
static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* ); static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
#ifdef __cplusplus #ifdef __cplusplus
@ -110,7 +112,8 @@ static FP_SHAPE* Cast_to_FP_SHAPE( BOARD_ITEM* );
static D_PAD* Cast_to_D_PAD( BOARD_ITEM* ); static D_PAD* Cast_to_D_PAD( BOARD_ITEM* );
static TRACK* Cast_to_TRACK( BOARD_ITEM* ); static TRACK* Cast_to_TRACK( BOARD_ITEM* );
static VIA* Cast_to_VIA( BOARD_ITEM* ); static VIA* Cast_to_VIA( BOARD_ITEM* );
static ZONE_CONTAINER* Cast_to_ZONE_CONTAINER( BOARD_ITEM* ); static ZONE* Cast_to_ZONE( BOARD_ITEM* );
static FP_ZONE* Cast_to_FP_ZONE( BOARD_ITEM* );
static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* ); static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
@ -152,8 +155,8 @@ static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
return Cast_to_TRACK(self) return Cast_to_TRACK(self)
elif ct=="PCB_TARGET": elif ct=="PCB_TARGET":
return Cast_to_PCB_TARGET(self) return Cast_to_PCB_TARGET(self)
elif ct=="ZONE_CONTAINER": elif ct=="ZONE":
return Cast_to_ZONE_CONTAINER(self) return Cast_to_ZONE(self)
else: else:
raise TypeError("Unsupported drawing class: %s" % ct) raise TypeError("Unsupported drawing class: %s" % ct)
@ -197,6 +200,7 @@ static FP_SHAPE* Cast_to_FP_SHAPE( BOARD_ITEM* self ) {
static D_PAD* Cast_to_D_PAD( BOARD_ITEM* self ) { return dynamic_cast<D_PAD*>(self); } static D_PAD* Cast_to_D_PAD( BOARD_ITEM* self ) { return dynamic_cast<D_PAD*>(self); }
static TRACK* Cast_to_TRACK( BOARD_ITEM* self ) { return dynamic_cast<TRACK*>(self); } static TRACK* Cast_to_TRACK( BOARD_ITEM* self ) { return dynamic_cast<TRACK*>(self); }
static VIA* Cast_to_VIA( BOARD_ITEM* self ) { return dynamic_cast<VIA*>(self); } static VIA* Cast_to_VIA( BOARD_ITEM* self ) { return dynamic_cast<VIA*>(self); }
static ZONE_CONTAINER* Cast_to_ZONE_CONTAINER( BOARD_ITEM* self ) { return dynamic_cast<ZONE_CONTAINER*>(self); } static ZONE* Cast_to_ZONE( BOARD_ITEM* self ) { return dynamic_cast<ZONE*>( self); }
static FP_ZONE* Cast_to_FP_ZONE( BOARD_ITEM* self ) { return dynamic_cast<FP_ZONE*>( self); }
static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* self ) { return dynamic_cast<PCB_TARGET*>(self); } static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* self ) { return dynamic_cast<PCB_TARGET*>(self); }
%} %}

View File

@ -1,6 +1,6 @@
%include class_dimension.h %include dimension.h
%{ %{
#include <class_dimension.h> #include <dimension.h>
%} %}

View File

@ -25,7 +25,7 @@
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <menus_helpers.h> #include <menus_helpers.h>
#include <pcbnew_settings.h> #include <pcbnew_settings.h>
#include <python_scripting.h> #include <python_scripting.h>
@ -231,7 +231,7 @@ void PCB_EDIT_FRAME::RunActionPlugin( ACTION_PLUGIN* aActionPlugin )
} }
// Append zones outlines // Append zones outlines
for( ZONE_CONTAINER* zone : currentPcb->Zones() ) for( ZONE* zone : currentPcb->Zones() )
{ {
ITEM_PICKER picker( nullptr, zone, UNDO_REDO::CHANGED ); ITEM_PICKER picker( nullptr, zone, UNDO_REDO::CHANGED );
itemsList.PushItem( picker ); itemsList.PushItem( picker );
@ -282,7 +282,7 @@ void PCB_EDIT_FRAME::RunActionPlugin( ACTION_PLUGIN* aActionPlugin )
currItemList.insert( item ); currItemList.insert( item );
// Append zones outlines // Append zones outlines
for( ZONE_CONTAINER* zone : currentPcb->Zones() ) for( ZONE* zone : currentPcb->Zones() )
currItemList.insert( zone ); currItemList.insert( zone );
// Found deleted footprints // Found deleted footprints
@ -331,7 +331,7 @@ void PCB_EDIT_FRAME::RunActionPlugin( ACTION_PLUGIN* aActionPlugin )
} }
} }
for( ZONE_CONTAINER* zone : currentPcb->Zones() ) for( ZONE* zone : currentPcb->Zones() )
{ {
if( !oldBuffer->ContainsItem( zone ) ) if( !oldBuffer->ContainsItem( zone ) )
{ {

View File

@ -351,7 +351,7 @@ bool IsActionRunning()
bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits, bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
bool aTestTracksAgainstZones, bool aReportAllTrackErrors ) bool aReportAllTrackErrors )
{ {
wxCHECK( aBoard, false ); wxCHECK( aBoard, false );

View File

@ -151,12 +151,11 @@ bool IsActionRunning();
* @param aBoard is a valid loaded board * @param aBoard is a valid loaded board
* @param aFileName is the full path and name of the report file to write * @param aFileName is the full path and name of the report file to write
* @param aUnits is the units to use in the report * @param aUnits is the units to use in the report
* @param aTestTracksAgainstZones controls whether full track/zone checking is done (slow)
* @param aReportAllTrackErrors controls whether all errors or just the first error is reported * @param aReportAllTrackErrors controls whether all errors or just the first error is reported
* for each track * for each track
* @return true if successful, false if not * @return true if successful, false if not
*/ */
bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits, bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
bool aTestTracksAgainstZones, bool aReportAllTrackErrors ); bool aReportAllTrackErrors );
#endif // __PCBNEW_SCRIPTING_HELPERS_H #endif // __PCBNEW_SCRIPTING_HELPERS_H

View File

@ -1,11 +1,11 @@
// Do not permit default ZONE_FILLER ctor since commits are not supported from Python // Do not permit default ZONE_FILLER ctor since commits are not supported from Python
%ignore ZONE_FILLER::ZONE_FILLER(BOARD*, COMMIT*); %ignore ZONE_FILLER::ZONE_FILLER(BOARD*, COMMIT*);
%include class_zone.h %include zone.h
%include zones.h %include zones.h
%{ %{
#include <class_zone.h> #include <zone.h>
#include <zones.h> #include <zones.h>
#include <zone_filler.h> #include <zone_filler.h>
%} %}

View File

@ -28,7 +28,7 @@
#include <pcb_shape.h> #include <pcb_shape.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <collectors.h> #include <collectors.h>
#include <confirm.h> #include <confirm.h>
#include <menus_helpers.h> #include <menus_helpers.h>
@ -72,7 +72,7 @@ bool CONVERT_TOOL::Init()
m_menu->SetTitle( _( "Convert..." ) ); m_menu->SetTitle( _( "Convert..." ) );
static KICAD_T convertableTracks[] = { PCB_TRACE_T, PCB_ARC_T, EOT }; static KICAD_T convertableTracks[] = { PCB_TRACE_T, PCB_ARC_T, EOT };
static KICAD_T convertableZones[] = { PCB_ZONE_AREA_T, PCB_FP_ZONE_AREA_T, EOT }; static KICAD_T convertableZones[] = { PCB_ZONE_T, PCB_FP_ZONE_T, EOT };
auto graphicLines = P_S_C::OnlyGraphicShapeTypes( { S_SEGMENT, S_RECT } ) && P_S_C::SameLayer(); auto graphicLines = P_S_C::OnlyGraphicShapeTypes( { S_SEGMENT, S_RECT } ) && P_S_C::SameLayer();
@ -218,8 +218,7 @@ int CONVERT_TOOL::LinesToPoly( const TOOL_EVENT& aEvent )
for( const SHAPE_POLY_SET& poly : polys ) for( const SHAPE_POLY_SET& poly : polys )
{ {
ZONE_CONTAINER* zone = isFootprint ? new MODULE_ZONE_CONTAINER( parent ) ZONE* zone = isFootprint ? new FP_ZONE( parent ) : new ZONE( parent );
: new ZONE_CONTAINER( parent );
*zone->Outline() = poly; *zone->Outline() = poly;
zone->HatchBorder(); zone->HatchBorder();
@ -391,8 +390,8 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent )
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
break; break;
default: default:
@ -411,9 +410,9 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent )
switch( aItem->Type() ) switch( aItem->Type() )
{ {
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
set = *static_cast<ZONE_CONTAINER*>( aItem )->Outline(); set = *static_cast<ZONE*>( aItem )->Outline();
break; break;
case PCB_SHAPE_T: case PCB_SHAPE_T:

View File

@ -43,8 +43,8 @@
#include <class_board.h> #include <class_board.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <pcb_text.h> #include <pcb_text.h>
#include <class_dimension.h> #include <dimension.h>
#include <class_zone.h> #include <zone.h>
#include <class_module.h> #include <class_module.h>
#include <preview_items/two_point_assistant.h> #include <preview_items/two_point_assistant.h>
@ -620,7 +620,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
} }
void DRAWING_TOOL::constrainDimension( DIMENSION* aDim ) void DRAWING_TOOL::constrainDimension( DIMENSION_BASE* aDim )
{ {
const VECTOR2I lineVector{ aDim->GetEnd() - aDim->GetStart() }; const VECTOR2I lineVector{ aDim->GetEnd() - aDim->GetStart() };
@ -633,10 +633,10 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
if( m_isFootprintEditor && !m_frame->GetModel() ) if( m_isFootprintEditor && !m_frame->GetModel() )
return 0; return 0;
TOOL_EVENT originalEvent = aEvent; TOOL_EVENT originalEvent = aEvent;
DIMENSION* dimension = nullptr; DIMENSION_BASE* dimension = nullptr;
BOARD_COMMIT commit( m_frame ); BOARD_COMMIT commit( m_frame );
GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() ); GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() );
const BOARD_DESIGN_SETTINGS& boardSettings = m_board->GetDesignSettings(); const BOARD_DESIGN_SETTINGS& boardSettings = m_board->GetDesignSettings();
@ -770,7 +770,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
// Init the new item attributes // Init the new item attributes
auto setMeasurementAttributes = auto setMeasurementAttributes =
[&]( DIMENSION* aDim ) [&]( DIMENSION_BASE* aDim )
{ {
aDim->SetUnitsMode( boardSettings.m_DimensionUnitsMode ); aDim->SetUnitsMode( boardSettings.m_DimensionUnitsMode );
aDim->SetUnitsFormat( boardSettings.m_DimensionUnitsFormat ); aDim->SetUnitsFormat( boardSettings.m_DimensionUnitsFormat );
@ -1764,7 +1764,7 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool
} }
bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE_CONTAINER** aZone ) bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE** aZone )
{ {
bool clearSelection = false; bool clearSelection = false;
*aZone = nullptr; *aZone = nullptr;
@ -1784,7 +1784,7 @@ bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE_CONTAINER** aZo
// we want a single zone // we want a single zone
if( selection.Size() == 1 ) if( selection.Size() == 1 )
*aZone = dyn_cast<ZONE_CONTAINER*>( selection[0] ); *aZone = dyn_cast<ZONE*>( selection[0] );
// expected a zone, but didn't get one // expected a zone, but didn't get one
if( !*aZone ) if( !*aZone )
@ -1817,7 +1817,7 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
// get a source zone, if we need one. We need it for: // get a source zone, if we need one. We need it for:
// ZONE_MODE::CUTOUT (adding a hole to the source zone) // ZONE_MODE::CUTOUT (adding a hole to the source zone)
// ZONE_MODE::SIMILAR (creating a new zone using settings of source zone // ZONE_MODE::SIMILAR (creating a new zone using settings of source zone
ZONE_CONTAINER* sourceZone = nullptr; ZONE* sourceZone = nullptr;
if( !getSourceZoneForAction( zoneMode, &sourceZone ) ) if( !getSourceZoneForAction( zoneMode, &sourceZone ) )
return 0; return 0;
@ -2182,9 +2182,9 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
} }
} }
std::vector<ZONE_CONTAINER*> foundZones; std::vector<ZONE*> foundZones;
for( ZONE_CONTAINER* zone : m_board->Zones() ) for( ZONE* zone : m_board->Zones() )
{ {
for( PCB_LAYER_ID layer : LSET( zone->GetLayerSet() & lset ).Seq() ) for( PCB_LAYER_ID layer : LSET( zone->GetLayerSet() & lset ).Seq() )
{ {
@ -2194,20 +2194,20 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
} }
std::sort( foundZones.begin(), foundZones.end(), std::sort( foundZones.begin(), foundZones.end(),
[] ( const ZONE_CONTAINER* a, const ZONE_CONTAINER* b ) [] ( const ZONE* a, const ZONE* b )
{ {
return a->GetLayer() < b->GetLayer(); return a->GetLayer() < b->GetLayer();
} ); } );
// first take the net of the active layer // first take the net of the active layer
for( ZONE_CONTAINER* z : foundZones ) for( ZONE* z : foundZones )
{ {
if( m_frame->GetActiveLayer() == z->GetLayer() ) if( m_frame->GetActiveLayer() == z->GetLayer() )
return z->GetNetCode(); return z->GetNetCode();
} }
// none? take the topmost visible layer // none? take the topmost visible layer
for( ZONE_CONTAINER* z : foundZones ) for( ZONE* z : foundZones )
{ {
if( m_board->IsLayerVisible( z->GetLayer() ) ) if( m_board->IsLayerVisible( z->GetLayer() ) )
return z->GetNetCode(); return z->GetNetCode();

View File

@ -211,14 +211,14 @@ private:
* @return true if a suitable zone was found, or the action doesn't * @return true if a suitable zone was found, or the action doesn't
* need a zone. False if the action needs a zone but none was found. * need a zone. False if the action needs a zone but none was found.
*/ */
bool getSourceZoneForAction( ZONE_MODE aMode, ZONE_CONTAINER** aZone ); bool getSourceZoneForAction( ZONE_MODE aMode, ZONE** aZone );
/** /**
* Function constrainDimension() * Function constrainDimension()
* Forces the dimension lime to be drawn on multiple of 45 degrees * Forces the dimension lime to be drawn on multiple of 45 degrees
* @param aDimension is the dimension element currently being drawn * @param aDimension is the dimension element currently being drawn
*/ */
void constrainDimension( DIMENSION* aDim ); void constrainDimension( DIMENSION_BASE* aDim );
///> Returns the appropriate width for a segment depending on the settings. ///> Returns the appropriate width for a segment depending on the settings.
int getSegmentWidth( PCB_LAYER_ID aLayer ) const; int getSegmentWidth( PCB_LAYER_ID aLayer ) const;

View File

@ -73,7 +73,7 @@ void EditToolSelectionFilter( GENERAL_COLLECTOR& aCollector, int aFlags,
{ {
aCollector.Remove( item ); aCollector.Remove( item );
} }
else if( item->Type() == PCB_FP_ZONE_AREA_T ) else if( item->Type() == PCB_FP_ZONE_T )
{ {
MODULE* mod = static_cast<MODULE*>( item->GetParent() ); MODULE* mod = static_cast<MODULE*>( item->GetParent() );
@ -1071,7 +1071,7 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
{ {
case PCB_FP_SHAPE_T: case PCB_FP_SHAPE_T:
case PCB_FP_TEXT_T: case PCB_FP_TEXT_T:
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
case PCB_PAD_T: case PCB_PAD_T:
// Only create undo entry for items on the board // Only create undo entry for items on the board
if( !item->IsNew() && !IsFootprintEditor() ) if( !item->IsNew() && !IsFootprintEditor() )
@ -1092,9 +1092,9 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
break; break;
} }
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
{ {
MODULE_ZONE_CONTAINER* zone = static_cast<MODULE_ZONE_CONTAINER*>( item ); FP_ZONE* zone = static_cast<FP_ZONE*>( item );
zone->Mirror( mirrorPoint, false ); zone->Mirror( mirrorPoint, false );
break; break;
} }
@ -1301,10 +1301,10 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
} }
break; break;
case PCB_FP_ZONE_AREA_T: case PCB_FP_ZONE_T:
{ {
MODULE_ZONE_CONTAINER* zone = static_cast<MODULE_ZONE_CONTAINER*>( item ); FP_ZONE* zone = static_cast<FP_ZONE*>( item );
MODULE* parent = static_cast<MODULE*>( item->GetParent() ); MODULE* parent = static_cast<MODULE*>( item->GetParent() );
m_commit->Modify( parent ); m_commit->Modify( parent );
getView()->Remove( zone ); getView()->Remove( zone );
@ -1312,15 +1312,15 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
} }
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
// We process the zones special so that cutouts can be deleted when the delete tool // We process the zones special so that cutouts can be deleted when the delete tool
// is called from inside a cutout when the zone is selected. // is called from inside a cutout when the zone is selected.
{ {
// Only interact with cutouts when deleting and a single item is selected // Only interact with cutouts when deleting and a single item is selected
if( !isCut && selectionCopy.GetSize() == 1 ) if( !isCut && selectionCopy.GetSize() == 1 )
{ {
VECTOR2I curPos = getViewControls()->GetCursorPosition(); VECTOR2I curPos = getViewControls()->GetCursorPosition();
ZONE_CONTAINER* zone = static_cast<ZONE_CONTAINER*>( item ); ZONE* zone = static_cast<ZONE*>( item );
int outlineIdx, holeIdx; int outlineIdx, holeIdx;
@ -1330,7 +1330,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
m_commit->Modify( zone ); m_commit->Modify( zone );
zone->RemoveCutout( outlineIdx, holeIdx ); zone->RemoveCutout( outlineIdx, holeIdx );
std::vector<ZONE_CONTAINER*> toFill; std::vector<ZONE*> toFill;
toFill.emplace_back( zone ); toFill.emplace_back( zone );
// Fill the modified zone // Fill the modified zone
@ -1595,7 +1595,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
case PCB_SHAPE_T: case PCB_SHAPE_T:
case PCB_TRACE_T: case PCB_TRACE_T:
case PCB_VIA_T: case PCB_VIA_T:
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
case PCB_TARGET_T: case PCB_TARGET_T:
case PCB_DIM_ALIGNED_T: case PCB_DIM_ALIGNED_T:
case PCB_DIM_CENTER_T: case PCB_DIM_CENTER_T:

View File

@ -27,11 +27,11 @@
using namespace std::placeholders; using namespace std::placeholders;
#include <class_board.h> #include <class_board.h>
#include <class_dimension.h> #include <dimension.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <geometry/shape_circle.h> #include <geometry/shape_circle.h>
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>
#include <geometry/shape_rect.h> #include <geometry/shape_rect.h>
@ -658,9 +658,9 @@ void GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos, bo
break; break;
} }
case PCB_ZONE_AREA_T: case PCB_ZONE_T:
{ {
const SHAPE_POLY_SET* outline = static_cast<const ZONE_CONTAINER*>( aItem )->Outline(); const SHAPE_POLY_SET* outline = static_cast<const ZONE*>( aItem )->Outline();
SHAPE_LINE_CHAIN lc; SHAPE_LINE_CHAIN lc;
lc.SetClosed( true ); lc.SetClosed( true );

View File

@ -34,9 +34,9 @@
#include <class_board.h> #include <class_board.h>
#include <class_pcb_group.h> #include <class_pcb_group.h>
#include <class_module.h> #include <class_module.h>
#include <class_pcb_target.h> #include <pcb_target.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <class_marker_pcb.h> #include <class_marker_pcb.h>
#include <collectors.h> #include <collectors.h>
#include <confirm.h> #include <confirm.h>
@ -197,7 +197,7 @@ bool PCB_EDITOR_CONTROL::Init()
menu.AddMenu( lockMenu.get(), SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::LockableItems ), 100 ); menu.AddMenu( lockMenu.get(), SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::LockableItems ), 100 );
menu.AddMenu( zoneMenu.get(), SELECTION_CONDITIONS::OnlyType( PCB_ZONE_AREA_T ), 200 ); menu.AddMenu( zoneMenu.get(), SELECTION_CONDITIONS::OnlyType( PCB_ZONE_T ), 200 );
} }
DRAWING_TOOL* drawingTool = m_toolMgr->GetTool<DRAWING_TOOL>(); DRAWING_TOOL* drawingTool = m_toolMgr->GetTool<DRAWING_TOOL>();
@ -436,7 +436,7 @@ int PCB_EDITOR_CONTROL::RepairBoard( const TOOL_EVENT& aEvent )
for( BOARD_ITEM* item : footprint->GraphicalItems() ) for( BOARD_ITEM* item : footprint->GraphicalItems() )
processItem( item ); processItem( item );
for( ZONE_CONTAINER* zone : footprint->Zones() ) for( ZONE* zone : footprint->Zones() )
processItem( zone ); processItem( zone );
for( PCB_GROUP* group : footprint->Groups() ) for( PCB_GROUP* group : footprint->Groups() )
@ -446,7 +446,7 @@ int PCB_EDITOR_CONTROL::RepairBoard( const TOOL_EVENT& aEvent )
for( BOARD_ITEM* drawing : board()->Drawings() ) for( BOARD_ITEM* drawing : board()->Drawings() )
processItem( drawing ); processItem( drawing );
for( ZONE_CONTAINER* zone : board()->Zones() ) for( ZONE* zone : board()->Zones() )
processItem( zone ); processItem( zone );
for( MARKER_PCB* marker : board()->Markers() ) for( MARKER_PCB* marker : board()->Markers() )
@ -1101,8 +1101,8 @@ int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
} }
static bool mergeZones( BOARD_COMMIT& aCommit, std::vector<ZONE_CONTAINER *>& aOriginZones, static bool mergeZones( BOARD_COMMIT& aCommit, std::vector<ZONE*>& aOriginZones,
std::vector<ZONE_CONTAINER *>& aMergedZones ) std::vector<ZONE*>& aMergedZones )
{ {
for( unsigned int i = 1; i < aOriginZones.size(); i++ ) for( unsigned int i = 1; i < aOriginZones.size(); i++ )
{ {
@ -1118,7 +1118,7 @@ static bool mergeZones( BOARD_COMMIT& aCommit, std::vector<ZONE_CONTAINER *>& aO
// but we should never have more than 2 polys // but we should never have more than 2 polys
if( aOriginZones[0]->Outline()->OutlineCount() > 1 ) if( aOriginZones[0]->Outline()->OutlineCount() > 1 )
{ {
wxLogMessage( "BOARD::CombineAreas error: more than 2 polys after merging" ); wxLogMessage( "BOARD::mergeZones error: more than 2 polys after merging" );
return false; return false;
} }
@ -1149,12 +1149,12 @@ int PCB_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent )
int netcode = -1; int netcode = -1;
ZONE_CONTAINER* firstZone = nullptr; ZONE* firstZone = nullptr;
std::vector<ZONE_CONTAINER*> toMerge, merged; std::vector<ZONE*> toMerge, merged;
for( auto item : selection ) for( auto item : selection )
{ {
auto curr_area = dynamic_cast<ZONE_CONTAINER*>( item ); ZONE* curr_area = dynamic_cast<ZONE*>( item );
if( !curr_area ) if( !curr_area )
continue; continue;
@ -1176,7 +1176,7 @@ int PCB_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent )
if( curr_area->GetLayer() != firstZone->GetLayer() ) if( curr_area->GetLayer() != firstZone->GetLayer() )
continue; continue;
if( !board->TestAreaIntersection( curr_area, firstZone ) ) if( !board->TestZoneIntersection( curr_area, firstZone ) )
continue; continue;
toMerge.push_back( curr_area ); toMerge.push_back( curr_area );
@ -1206,7 +1206,7 @@ int PCB_EDITOR_CONTROL::ZoneDuplicate( const TOOL_EVENT& aEvent )
if( selection.Size() != 1 ) if( selection.Size() != 1 )
return 0; return 0;
auto oldZone = dyn_cast<ZONE_CONTAINER*>( selection[0] ); ZONE* oldZone = dyn_cast<ZONE*>( selection[0] );
if( !oldZone ) if( !oldZone )
return 0; return 0;
@ -1228,7 +1228,7 @@ int PCB_EDITOR_CONTROL::ZoneDuplicate( const TOOL_EVENT& aEvent )
// duplicate the zone // duplicate the zone
BOARD_COMMIT commit( m_frame ); BOARD_COMMIT commit( m_frame );
auto newZone = std::make_unique<ZONE_CONTAINER>( *oldZone ); std::unique_ptr<ZONE> newZone = std::make_unique<ZONE>( *oldZone );
newZone->ClearSelected(); newZone->ClearSelected();
newZone->UnFill(); newZone->UnFill();
zoneSettings.ExportSetting( *newZone ); zoneSettings.ExportSetting( *newZone );

View File

@ -82,7 +82,7 @@ bool PCB_INSPECTION_TOOL::Init()
netSubMenu->SetTool( this ); netSubMenu->SetTool( this );
static KICAD_T connectedTypes[] = { PCB_TRACE_T, PCB_VIA_T, PCB_ARC_T, PCB_PAD_T, static KICAD_T connectedTypes[] = { PCB_TRACE_T, PCB_VIA_T, PCB_ARC_T, PCB_PAD_T,
PCB_ZONE_AREA_T, EOT }; PCB_ZONE_T, EOT };
CONDITIONAL_MENU& menu = selectionTool->GetToolMenu().GetMenu(); CONDITIONAL_MENU& menu = selectionTool->GetToolMenu().GetMenu();
@ -109,7 +109,7 @@ int PCB_INSPECTION_TOOL::ShowStatisticsDialog( const TOOL_EVENT& aEvent )
} }
void PCB_INSPECTION_TOOL::reportZoneConnection( ZONE_CONTAINER* aZone, D_PAD* aPad, REPORTER* r ) void PCB_INSPECTION_TOOL::reportZoneConnection( ZONE* aZone, D_PAD* aPad, REPORTER* r )
{ {
ENUM_MAP<ZONE_CONNECTION> connectionEnum = ENUM_MAP<ZONE_CONNECTION>::Instance(); ENUM_MAP<ZONE_CONNECTION> connectionEnum = ENUM_MAP<ZONE_CONNECTION>::Instance();
wxString source; wxString source;
@ -283,7 +283,7 @@ int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
layer = B_Cu; layer = B_Cu;
} }
if( a->Type() != PCB_ZONE_AREA_T && b->Type() == PCB_ZONE_AREA_T ) if( a->Type() != PCB_ZONE_T && b->Type() == PCB_ZONE_T )
std::swap( a, b ); std::swap( a, b );
else if( !a->IsConnected() && b->IsConnected() ) else if( !a->IsConnected() && b->IsConnected() )
std::swap( a, b ); std::swap( a, b );
@ -340,10 +340,9 @@ int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
{ {
// Same nets.... // Same nets....
if( ac->Type() == PCB_ZONE_AREA_T && bc->Type() == PCB_PAD_T ) if( ac->Type() == PCB_ZONE_T && bc->Type() == PCB_PAD_T )
{ {
reportZoneConnection( static_cast<ZONE_CONTAINER*>( ac ), reportZoneConnection( static_cast<ZONE*>( ac ), static_cast<D_PAD*>( bc ), r );
static_cast<D_PAD*>( bc ), r );
} }
else else
{ {
@ -401,12 +400,12 @@ int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent )
compileError = true; compileError = true;
} }
for( ZONE_CONTAINER* zone : m_frame->GetBoard()->Zones() ) for( ZONE* zone : m_frame->GetBoard()->Zones() )
zone->CacheBoundingBox(); zone->CacheBoundingBox();
for( MODULE* module : m_frame->GetBoard()->Modules() ) for( MODULE* module : m_frame->GetBoard()->Modules() )
{ {
for( ZONE_CONTAINER* zone : module->Zones() ) for( ZONE* zone : module->Zones() )
zone->CacheBoundingBox(); zone->CacheBoundingBox();
module->BuildPolyCourtyards(); module->BuildPolyCourtyards();
@ -1002,7 +1001,7 @@ void PCB_INSPECTION_TOOL::calculateSelectionRatsnest( const VECTOR2I& aDelta )
return( aItem->Type() == PCB_TRACE_T return( aItem->Type() == PCB_TRACE_T
|| aItem->Type() == PCB_PAD_T || aItem->Type() == PCB_PAD_T
|| aItem->Type() == PCB_ARC_T || aItem->Type() == PCB_ARC_T
|| aItem->Type() == PCB_ZONE_AREA_T || aItem->Type() == PCB_ZONE_T
|| aItem->Type() == PCB_MODULE_T || aItem->Type() == PCB_MODULE_T
|| aItem->Type() == PCB_VIA_T ); || aItem->Type() == PCB_VIA_T );
} ) ) } ) )

View File

@ -130,7 +130,7 @@ private:
void onInspectClearanceDialogClosed( wxCommandEvent& aEvent ); void onInspectClearanceDialogClosed( wxCommandEvent& aEvent );
void onInspectConstraintsDialogClosed( wxCommandEvent& aEvent ); void onInspectConstraintsDialogClosed( wxCommandEvent& aEvent );
void reportZoneConnection( ZONE_CONTAINER* aZone, D_PAD* aPad, REPORTER* r ); void reportZoneConnection( ZONE* aZone, D_PAD* aPad, REPORTER* r );
void reportClearance( DRC_CONSTRAINT_TYPE_T aClearanceType, PCB_LAYER_ID aLayer, void reportClearance( DRC_CONSTRAINT_TYPE_T aClearanceType, PCB_LAYER_ID aLayer,
BOARD_ITEM* aA, BOARD_ITEM* aB, REPORTER* r ); BOARD_ITEM* aA, BOARD_ITEM* aB, REPORTER* r );

View File

@ -42,7 +42,7 @@ bool PCB_SELECTION_CONDITIONS::OnlyConnectedItems( const SELECTION& aSelection )
{ {
auto type = item->Type(); auto type = item->Type();
if( type != PCB_PAD_T && type != PCB_VIA_T && type != PCB_TRACE_T && type != PCB_ZONE_AREA_T ) if( type != PCB_PAD_T && type != PCB_VIA_T && type != PCB_TRACE_T && type != PCB_ZONE_T )
return false; return false;
} }

View File

@ -33,10 +33,10 @@
#include <board_commit.h> #include <board_commit.h>
#include <class_board.h> #include <class_board.h>
#include <class_board_item.h> #include <class_board_item.h>
#include <class_dimension.h> #include <dimension.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <zone.h>
#include <fp_shape.h> #include <fp_shape.h>
#include <confirm.h> #include <confirm.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
@ -201,7 +201,7 @@ int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
m_frame->SetDisplayOptions( opts ); m_frame->SetDisplayOptions( opts );
for( ZONE_CONTAINER* zone : board()->Zones() ) for( ZONE* zone : board()->Zones() )
view()->Update( zone, KIGFX::GEOMETRY ); view()->Update( zone, KIGFX::GEOMETRY );
canvas()->Refresh(); canvas()->Refresh();
@ -787,8 +787,7 @@ static void moveUnflaggedItems( std::deque<T>& aList, std::vector<BOARD_ITEM*>&
} }
static void moveUnflaggedItems( ZONE_CONTAINERS& aList, std::vector<BOARD_ITEM*>& aTarget, static void moveUnflaggedItems( ZONES& aList, std::vector<BOARD_ITEM*>& aTarget, bool aIsNew )
bool aIsNew )
{ {
if( aList.size() == 0 ) if( aList.size() == 0 )
return; return;
@ -878,7 +877,7 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsN
case PCB_DIM_LEADER_T: case PCB_DIM_LEADER_T:
{ {
// Dimensions need to have their units updated if they are automatic // Dimensions need to have their units updated if they are automatic
DIMENSION* dim = static_cast<DIMENSION*>( item ); DIMENSION_BASE* dim = static_cast<DIMENSION_BASE*>( item );
if( dim->GetUnitsMode() == DIM_UNITS_MODE::AUTOMATIC ) if( dim->GetUnitsMode() == DIM_UNITS_MODE::AUTOMATIC )
dim->SetUnits( frame()->GetUserUnits() ); dim->SetUnits( frame()->GetUserUnits() );

View File

@ -33,7 +33,6 @@ using namespace std::placeholders;
#include <class_board_item.h> #include <class_board_item.h>
#include <class_track.h> #include <class_track.h>
#include <class_module.h> #include <class_module.h>
#include <class_zone.h>
#include <pcb_edit_frame.h> #include <pcb_edit_frame.h>
#include <class_draw_panel_gal.h> #include <class_draw_panel_gal.h>
#include <view/view_controls.h> #include <view/view_controls.h>

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