Rename class GROUP in pcbnew to PCB_GROUP

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5156
This commit is contained in:
Qbort 2020-08-12 12:23:30 +01:00
parent 826f81f57d
commit b41892e4da
24 changed files with 137 additions and 137 deletions

View File

@ -467,7 +467,7 @@ set( PCB_COMMON_SRCS
${CMAKE_SOURCE_DIR}/pcbnew/class_dimension.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_dimension.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_drawsegment.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_drawsegment.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_edge_mod.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_edge_mod.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_group.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_pcb_group.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_marker_pcb.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_marker_pcb.cpp
${CMAKE_SOURCE_DIR}/pcbnew/class_module.cpp ${CMAKE_SOURCE_DIR}/pcbnew/class_module.cpp
${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp ${CMAKE_SOURCE_DIR}/pcbnew/netinfo_item.cpp

View File

@ -23,7 +23,7 @@
*/ */
/** /**
* @file class_group.h * @file class_pcb_group.h
* @brief Class to handle a set of BOARD_ITEMs. * @brief Class to handle a set of BOARD_ITEMs.
* Group parent is always board, not logical parent group. * Group parent is always board, not logical parent group.
* Group is transparent container - e.g., its position is derived from the position * Group is transparent container - e.g., its position is derived from the position
@ -32,8 +32,8 @@
* on sets of items, like committing, updating the view, etc the set is explicit. * on sets of items, like committing, updating the view, etc the set is explicit.
*/ */
#ifndef CLASS_GROUP_H_ #ifndef CLASS_PCB_GROUP_H_
#define CLASS_GROUP_H_ #define CLASS_PCB_GROUP_H_
#include <class_board_item.h> #include <class_board_item.h>
#include <common.h> #include <common.h>
@ -47,12 +47,12 @@ class VIEW;
typedef std::unordered_set<BOARD_ITEM*> ITEM_SET; typedef std::unordered_set<BOARD_ITEM*> ITEM_SET;
/** /**
* GROUP is a set of BOARD_ITEMs (i.e., without duplicates) * PCB_GROUP is a set of BOARD_ITEMs (i.e., without duplicates)
*/ */
class GROUP : public BOARD_ITEM class PCB_GROUP : public BOARD_ITEM
{ {
public: public:
GROUP( BOARD* parent ); PCB_GROUP( BOARD* parent );
static inline bool ClassOf( const EDA_ITEM* aItem ) static inline bool ClassOf( const EDA_ITEM* aItem )
{ {
@ -88,7 +88,7 @@ public:
wxString GetClass() const override wxString GetClass() const override
{ {
return wxT( "GROUP" ); return wxT( "PCB_GROUP" );
} }
#if defined( DEBUG ) #if defined( DEBUG )
@ -119,12 +119,12 @@ public:
/* /*
* Clone() this and all descendents * Clone() this and all descendents
*/ */
GROUP* DeepClone() const; PCB_GROUP* DeepClone() const;
/* /*
* Duplicate() this and all descendents * Duplicate() this and all descendents
*/ */
GROUP* DeepDuplicate() const; PCB_GROUP* DeepDuplicate() const;
///> @copydoc BOARD_ITEM::SwapData ///> @copydoc BOARD_ITEM::SwapData
void SwapData( BOARD_ITEM* aImage ) override; void SwapData( BOARD_ITEM* aImage ) override;
@ -195,4 +195,4 @@ private:
wxString m_name; wxString m_name;
}; };
#endif // CLASS_GROUP_H_ #endif // CLASS_PCB_GROUP_H_

View File

@ -102,7 +102,7 @@ enum KICAD_T
PCB_ZONE_AREA_T, ///< class ZONE_CONTAINER, a zone area PCB_ZONE_AREA_T, ///< class ZONE_CONTAINER, a zone 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 GROUP, a set of BOARD_ITEMs PCB_GROUP_T, ///< class PCB_GROUP, a set of BOARD_ITEMs
PCB_LOCATE_STDVIA_T, PCB_LOCATE_STDVIA_T,
PCB_LOCATE_UVIA_T, PCB_LOCATE_UVIA_T,

View File

@ -563,7 +563,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
// this one uses a vector // this one uses a vector
case PCB_GROUP_T: case PCB_GROUP_T:
m_groups.push_back( (GROUP*) aBoardItem ); m_groups.push_back( (PCB_GROUP*) aBoardItem );
break; break;
// this one uses a vector // this one uses a vector
@ -803,7 +803,7 @@ BOARD_ITEM* BOARD::GetItem( const KIID& aID )
if( marker->m_Uuid == aID ) if( marker->m_Uuid == aID )
return marker; return marker;
for( GROUP* group : m_groups ) for( PCB_GROUP* group : m_groups )
if( group->m_Uuid == aID ) if( group->m_Uuid == aID )
return group; return group;
@ -843,7 +843,7 @@ void BOARD::FillItemMap( std::map<KIID, EDA_ITEM*>& aMap )
for( MARKER_PCB* marker : m_markers ) for( MARKER_PCB* marker : m_markers )
aMap[ marker->m_Uuid ] = marker; aMap[ marker->m_Uuid ] = marker;
for( GROUP* group : m_groups ) for( PCB_GROUP* group : m_groups )
aMap[ group->m_Uuid ] = group; aMap[ group->m_Uuid ] = group;
} }
@ -1132,7 +1132,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
break; break;
case PCB_GROUP_T: case PCB_GROUP_T:
result = IterateForward<GROUP*>( m_groups, inspector, testData, p ); result = IterateForward<PCB_GROUP*>( m_groups, inspector, testData, p );
++p; ++p;
break; break;
@ -1988,15 +1988,15 @@ void BOARD::HighLightON( bool aValue )
} }
} }
GROUP* BOARD::TopLevelGroup( BOARD_ITEM* item, GROUP* scope ) PCB_GROUP* BOARD::TopLevelGroup( BOARD_ITEM* item, PCB_GROUP* scope )
{ {
GROUP* candidate = NULL; PCB_GROUP* candidate = NULL;
bool foundParent; bool foundParent;
do do
{ {
foundParent = false; foundParent = false;
for( GROUP* group : m_groups ) for( PCB_GROUP* group : m_groups )
{ {
BOARD_ITEM* toFind = ( candidate == NULL ) ? item : candidate; BOARD_ITEM* toFind = ( candidate == NULL ) ? item : candidate;
if( group->GetItems().find( toFind ) != group->GetItems().end() ) if( group->GetItems().find( toFind ) != group->GetItems().end() )
@ -2022,9 +2022,9 @@ GROUP* BOARD::TopLevelGroup( BOARD_ITEM* item, GROUP* scope )
} }
GROUP* BOARD::ParentGroup( BOARD_ITEM* item ) PCB_GROUP* BOARD::ParentGroup( BOARD_ITEM* item )
{ {
for( GROUP* group : m_groups ) for( PCB_GROUP* group : m_groups )
{ {
if( group->GetItems().find( item ) != group->GetItems().end() ) if( group->GetItems().find( item ) != group->GetItems().end() )
return group; return group;
@ -2057,7 +2057,7 @@ wxString BOARD::GroupsSanityCheckInternal( bool repair )
for( size_t idx = 0; idx < groups.size(); idx++ ) for( size_t idx = 0; idx < groups.size(); idx++ )
{ {
GROUP& group = *( groups[idx] ); PCB_GROUP& group = *( groups[idx] );
BOARD_ITEM* testItem = board.GetItem( group.m_Uuid ); BOARD_ITEM* testItem = board.GetItem( group.m_Uuid );
if( testItem != groups[idx] ) if( testItem != groups[idx] )
@ -2212,7 +2212,7 @@ BOARD::GroupLegalOpsField BOARD::GroupLegalOps( const PCBNEW_SELECTION& selectio
GroupLegalOpsField legalOps = { false, false, false, false, false, false }; GroupLegalOpsField legalOps = { false, false, false, false, false, false };
std::unordered_set<const BOARD_ITEM*> allMembers; std::unordered_set<const BOARD_ITEM*> allMembers;
for( const GROUP* grp : m_groups ) for( const PCB_GROUP* grp : m_groups )
{ {
for( const BOARD_ITEM* member : grp->GetItems() ) for( const BOARD_ITEM* member : grp->GetItems() )
{ {
@ -2238,21 +2238,21 @@ BOARD::GroupLegalOpsField BOARD::GroupLegalOps( const PCBNEW_SELECTION& selectio
// Check that no groups are descendant subgroups of another group in the selection // Check that no groups are descendant subgroups of another group in the selection
for( EDA_ITEM* item : selection ) for( EDA_ITEM* item : selection )
{ {
const GROUP* group = static_cast<const GROUP*>( item ); const PCB_GROUP* group = static_cast<const PCB_GROUP*>( item );
std::unordered_set<const GROUP*> subgroupos; std::unordered_set<const PCB_GROUP*> subgroupos;
std::queue<const GROUP*> toCheck; std::queue<const PCB_GROUP*> toCheck;
toCheck.push( group ); toCheck.push( group );
while( !toCheck.empty() ) while( !toCheck.empty() )
{ {
const GROUP* candidate = toCheck.front(); const PCB_GROUP* candidate = toCheck.front();
toCheck.pop(); toCheck.pop();
for( const BOARD_ITEM* aChild : candidate->GetItems() ) for( const BOARD_ITEM* aChild : candidate->GetItems() )
{ {
if( aChild->Type() == PCB_GROUP_T ) if( aChild->Type() == PCB_GROUP_T )
{ {
const GROUP* childGroup = static_cast<const GROUP*>( aChild ); const PCB_GROUP* childGroup = static_cast<const PCB_GROUP*>( aChild );
subgroupos.insert( childGroup ); subgroupos.insert( childGroup );
toCheck.push( childGroup ); toCheck.push( childGroup );
} }
@ -2262,7 +2262,7 @@ BOARD::GroupLegalOpsField BOARD::GroupLegalOps( const PCBNEW_SELECTION& selectio
for( EDA_ITEM* otherItem : selection ) for( EDA_ITEM* otherItem : selection )
{ {
if( otherItem != item if( otherItem != item
&& subgroupos.find( static_cast<GROUP*>( otherItem ) ) != subgroupos.end() ) && subgroupos.find( static_cast<PCB_GROUP*>( otherItem ) ) != subgroupos.end() )
{ {
// otherItem is a descendant subgroup of item // otherItem is a descendant subgroup of item
onlyGroups = false; onlyGroups = false;
@ -2308,10 +2308,10 @@ BOARD::GroupLegalOpsField BOARD::GroupLegalOps( const PCBNEW_SELECTION& selectio
void BOARD::GroupRemoveItems( const PCBNEW_SELECTION& selection, BOARD_COMMIT* commit ) void BOARD::GroupRemoveItems( const PCBNEW_SELECTION& selection, BOARD_COMMIT* commit )
{ {
std::unordered_set<BOARD_ITEM*> emptyGroups; std::unordered_set<BOARD_ITEM*> emptyGroups;
std::unordered_set<GROUP*> emptyGroupParents; std::unordered_set<PCB_GROUP*> emptyGroupParents;
// groups who have had children removed, either items or empty groups. // groups who have had children removed, either items or empty groups.
std::unordered_set<GROUP*> itemParents; std::unordered_set<PCB_GROUP*> itemParents;
std::unordered_set<BOARD_ITEM*> itemsToRemove; std::unordered_set<BOARD_ITEM*> itemsToRemove;
for( EDA_ITEM* item : selection ) for( EDA_ITEM* item : selection )
@ -2322,7 +2322,7 @@ void BOARD::GroupRemoveItems( const PCBNEW_SELECTION& selection, BOARD_COMMIT* c
for( BOARD_ITEM* item : itemsToRemove ) for( BOARD_ITEM* item : itemsToRemove )
{ {
GROUP* parentGroup = ParentGroup( item ); PCB_GROUP* parentGroup = ParentGroup( item );
itemParents.insert( parentGroup ); itemParents.insert( parentGroup );
while( parentGroup != nullptr ) while( parentGroup != nullptr )
@ -2354,7 +2354,7 @@ void BOARD::GroupRemoveItems( const PCBNEW_SELECTION& selection, BOARD_COMMIT* c
// Items themselves are removed outside the context of this function // Items themselves are removed outside the context of this function
// First let's check the parents of items that are no empty // First let's check the parents of items that are no empty
for( GROUP* grp : itemParents ) for( PCB_GROUP* grp : itemParents )
{ {
if( emptyGroups.find( grp ) == emptyGroups.end() ) if( emptyGroups.find( grp ) == emptyGroups.end() )
{ {

View File

@ -28,7 +28,7 @@
#include <tuple> #include <tuple>
#include <board_design_settings.h> #include <board_design_settings.h>
#include <board_item_container.h> #include <board_item_container.h>
#include <class_group.h> #include <class_pcb_group.h>
#include <class_module.h> #include <class_module.h>
#include <class_pad.h> #include <class_pad.h>
#include <common.h> // PAGE_INFO #include <common.h> // PAGE_INFO
@ -175,7 +175,7 @@ DECL_VEC_FOR_SWIG( MARKERS, MARKER_PCB* )
DECL_VEC_FOR_SWIG( ZONE_CONTAINERS, ZONE_CONTAINER* ) DECL_VEC_FOR_SWIG( ZONE_CONTAINERS, ZONE_CONTAINER* )
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, GROUP* ) DECL_DEQ_FOR_SWIG( GROUPS, PCB_GROUP* )
/** /**
* BOARD * BOARD
@ -1234,14 +1234,14 @@ public:
* @param scope restricts the search to groups within the group scope. * @param scope restricts the search to groups within the group scope.
* @return group containing item, if it exists, otherwise, NULL * @return group containing item, if it exists, otherwise, NULL
*/ */
GROUP* TopLevelGroup( BOARD_ITEM* item, GROUP* scope ); PCB_GROUP* TopLevelGroup( BOARD_ITEM* item, PCB_GROUP* scope );
/* /*
* @return The group containing item as a child, or NULL if there is no * @return The group containing item as a child, or NULL if there is no
* such group. * such group.
*/ */
GROUP* ParentGroup( BOARD_ITEM* item ); PCB_GROUP* ParentGroup( BOARD_ITEM* item );
/* /*
* Given a selection of items, remove them from their groups and also * Given a selection of items, remove them from their groups and also

View File

@ -22,32 +22,32 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <bitmaps.h> #include <bitmaps.h>
#include <class_group.h> #include <class_pcb_group.h>
#include <confirm.h> #include <confirm.h>
#include <msgpanel.h> #include <msgpanel.h>
#include <view/view.h> #include <view/view.h>
GROUP::GROUP( BOARD* parent ) : BOARD_ITEM( (BOARD_ITEM*) parent, PCB_GROUP_T ) PCB_GROUP::PCB_GROUP( BOARD* parent ) : BOARD_ITEM( (BOARD_ITEM*) parent, PCB_GROUP_T )
{ {
} }
bool GROUP::AddItem( BOARD_ITEM* item ) bool PCB_GROUP::AddItem( BOARD_ITEM* item )
{ {
return m_items.insert( item ).second; return m_items.insert( item ).second;
} }
bool GROUP::RemoveItem( const BOARD_ITEM* item ) bool PCB_GROUP::RemoveItem( const BOARD_ITEM* item )
{ {
return m_items.erase( const_cast<BOARD_ITEM*>( item ) ) == 1; return m_items.erase( const_cast<BOARD_ITEM*>( item ) ) == 1;
} }
wxPoint GROUP::GetPosition() const wxPoint PCB_GROUP::GetPosition() const
{ {
return GetBoundingBox().Centre(); return GetBoundingBox().Centre();
} }
void GROUP::SetPosition( const wxPoint& newpos ) void PCB_GROUP::SetPosition( const wxPoint& newpos )
{ {
wxPoint delta = newpos - GetPosition(); wxPoint delta = newpos - GetPosition();
@ -57,24 +57,24 @@ void GROUP::SetPosition( const wxPoint& newpos )
} }
} }
EDA_ITEM* GROUP::Clone() const EDA_ITEM* PCB_GROUP::Clone() const
{ {
// Use copy constructor to get the same uuid and other fields // Use copy constructor to get the same uuid and other fields
GROUP* newGroup = new GROUP( *this ); PCB_GROUP* newGroup = new PCB_GROUP( *this );
return newGroup; return newGroup;
} }
GROUP* GROUP::DeepClone() const PCB_GROUP* PCB_GROUP::DeepClone() const
{ {
// Use copy constructor to get the same uuid and other fields // Use copy constructor to get the same uuid and other fields
GROUP* newGroup = new GROUP( *this ); PCB_GROUP* newGroup = new PCB_GROUP( *this );
newGroup->m_items.clear(); newGroup->m_items.clear();
for( auto member : m_items ) for( auto member : m_items )
{ {
if( member->Type() == PCB_GROUP_T ) if( member->Type() == PCB_GROUP_T )
{ {
newGroup->AddItem( static_cast<GROUP*>( member )->DeepClone() ); newGroup->AddItem( static_cast<PCB_GROUP*>( member )->DeepClone() );
} }
else else
{ {
@ -86,16 +86,16 @@ GROUP* GROUP::DeepClone() const
} }
GROUP* GROUP::DeepDuplicate() const PCB_GROUP* PCB_GROUP::DeepDuplicate() const
{ {
GROUP* newGroup = static_cast<GROUP*>( this->Duplicate() ); PCB_GROUP* newGroup = static_cast<PCB_GROUP*>( this->Duplicate() );
newGroup->m_items.clear(); newGroup->m_items.clear();
for( auto member : m_items ) for( auto member : m_items )
{ {
if( member->Type() == PCB_GROUP_T ) if( member->Type() == PCB_GROUP_T )
{ {
newGroup->AddItem( static_cast<GROUP*>( member )->DeepDuplicate() ); newGroup->AddItem( static_cast<PCB_GROUP*>( member )->DeepDuplicate() );
} }
else else
{ {
@ -107,32 +107,32 @@ GROUP* GROUP::DeepDuplicate() const
} }
void GROUP::SwapData( BOARD_ITEM* aImage ) void PCB_GROUP::SwapData( BOARD_ITEM* aImage )
{ {
assert( aImage->Type() == PCB_GROUP_T ); assert( aImage->Type() == PCB_GROUP_T );
std::swap( *( (GROUP*) this ), *( (GROUP*) aImage ) ); std::swap( *( (PCB_GROUP*) this ), *( (PCB_GROUP*) aImage ) );
} }
#if 0 #if 0
void GROUP::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, void PCB_GROUP::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue, int aError = ARC_LOW_DEF, bool ignoreLineWidth = false ) const int aClearanceValue, int aError = ARC_LOW_DEF, bool ignoreLineWidth = false ) const
{ {
} }
const BOX2I GROUP::ViewBBox() const const BOX2I PCB_GROUP::ViewBBox() const
{ {
return GetBoundingBox(); return GetBoundingBox();
} }
#endif #endif
bool GROUP::HitTest( const wxPoint& aPosition, int aAccuracy ) const bool PCB_GROUP::HitTest( const wxPoint& aPosition, int aAccuracy ) const
{ {
EDA_RECT rect = GetBoundingBox(); EDA_RECT rect = GetBoundingBox();
return rect.Inflate( aAccuracy ).Contains( aPosition ); return rect.Inflate( aAccuracy ).Contains( aPosition );
} }
bool GROUP::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const bool PCB_GROUP::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
{ {
EDA_RECT arect = aRect; EDA_RECT arect = aRect;
arect.Inflate( aAccuracy ); arect.Inflate( aAccuracy );
@ -158,7 +158,7 @@ bool GROUP::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) con
} }
} }
const EDA_RECT GROUP::GetBoundingBox() const const EDA_RECT PCB_GROUP::GetBoundingBox() const
{ {
EDA_RECT area; EDA_RECT area;
bool isFirst = true; bool isFirst = true;
@ -180,7 +180,7 @@ const EDA_RECT GROUP::GetBoundingBox() const
return area; return area;
} }
SEARCH_RESULT GROUP::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) SEARCH_RESULT PCB_GROUP::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{ {
for( const KICAD_T* stype = scanTypes; *stype != EOT; ++stype ) for( const KICAD_T* stype = scanTypes; *stype != EOT; ++stype )
{ {
@ -195,7 +195,7 @@ SEARCH_RESULT GROUP::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
return SEARCH_RESULT::CONTINUE; return SEARCH_RESULT::CONTINUE;
} }
LSET GROUP::GetLayerSet() const LSET PCB_GROUP::GetLayerSet() const
{ {
LSET aSet; LSET aSet;
@ -206,9 +206,9 @@ LSET GROUP::GetLayerSet() const
return aSet; return aSet;
} }
void GROUP::ViewGetLayers( int aLayers[], int& aCount ) const void PCB_GROUP::ViewGetLayers( int aLayers[], int& aCount ) const
{ {
// What layer to put bounding box on? change in class_group.cpp // What layer to put bounding box on? change in class_pcb_group.cpp
std::unordered_set<int> layers = { LAYER_ANCHOR }; // for bounding box std::unordered_set<int> layers = { LAYER_ANCHOR }; // for bounding box
for( BOARD_ITEM* item : m_items ) for( BOARD_ITEM* item : m_items )
@ -227,7 +227,7 @@ void GROUP::ViewGetLayers( int aLayers[], int& aCount ) const
aLayers[i++] = layer; aLayers[i++] = layer;
} }
unsigned int GROUP::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const unsigned int PCB_GROUP::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{ {
if( aView->IsLayerVisible( LAYER_ANCHOR ) ) if( aView->IsLayerVisible( LAYER_ANCHOR ) )
return 0; return 0;
@ -235,13 +235,13 @@ unsigned int GROUP::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
return std::numeric_limits<unsigned int>::max(); return std::numeric_limits<unsigned int>::max();
} }
void GROUP::Move( const wxPoint& aMoveVector ) void PCB_GROUP::Move( const wxPoint& aMoveVector )
{ {
wxPoint newpos = GetPosition() + aMoveVector; wxPoint newpos = GetPosition() + aMoveVector;
SetPosition( newpos ); SetPosition( newpos );
} }
void GROUP::Rotate( const wxPoint& aRotCentre, double aAngle ) void PCB_GROUP::Rotate( const wxPoint& aRotCentre, double aAngle )
{ {
for( BOARD_ITEM* item : m_items ) for( BOARD_ITEM* item : m_items )
{ {
@ -249,7 +249,7 @@ void GROUP::Rotate( const wxPoint& aRotCentre, double aAngle )
} }
} }
void GROUP::Flip( const wxPoint& aCentre, bool aFlipLeftRight ) void PCB_GROUP::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
for( BOARD_ITEM* item : m_items ) for( BOARD_ITEM* item : m_items )
{ {
@ -257,7 +257,7 @@ void GROUP::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
} }
} }
wxString GROUP::GetSelectMenuText( EDA_UNITS aUnits ) const wxString PCB_GROUP::GetSelectMenuText( EDA_UNITS aUnits ) const
{ {
if( m_name.empty() ) if( m_name.empty() )
{ {
@ -266,19 +266,19 @@ wxString GROUP::GetSelectMenuText( EDA_UNITS aUnits ) const
return wxString::Format( _( "Group \"%s\" with %ld members" ), m_name, m_items.size() ); return wxString::Format( _( "Group \"%s\" with %ld members" ), m_name, m_items.size() );
} }
BITMAP_DEF GROUP::GetMenuImage() const BITMAP_DEF PCB_GROUP::GetMenuImage() const
{ {
return module_xpm; return module_xpm;
} }
void GROUP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) void PCB_GROUP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{ {
aList.emplace_back( _( "Group" ), m_name.empty() ? _( "Anonymous" ) : aList.emplace_back( _( "Group" ), m_name.empty() ? _( "Anonymous" ) :
wxString::Format( _( "\"%s\"" ), m_name ), DARKCYAN ); wxString::Format( _( "\"%s\"" ), m_name ), DARKCYAN );
aList.emplace_back( _( "Members" ), wxString::Format( _( "%ld" ), m_items.size() ), BROWN ); aList.emplace_back( _( "Members" ), wxString::Format( _( "%ld" ), m_items.size() ), BROWN );
} }
void GROUP::RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction ) void PCB_GROUP::RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction )
{ {
try try
{ {
@ -287,11 +287,11 @@ void GROUP::RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction )
} }
catch( std::bad_function_call& ) catch( std::bad_function_call& )
{ {
DisplayError( NULL, wxT( "Error running GROUP::RunOnChildren" ) ); DisplayError( NULL, wxT( "Error running PCB_GROUP::RunOnChildren" ) );
} }
} }
void GROUP::RunOnDescendants( const std::function<void( BOARD_ITEM* )>& aFunction ) void PCB_GROUP::RunOnDescendants( const std::function<void( BOARD_ITEM* )>& aFunction )
{ {
try try
{ {
@ -299,11 +299,11 @@ void GROUP::RunOnDescendants( const std::function<void( BOARD_ITEM* )>& aFunctio
{ {
aFunction( item ); aFunction( item );
if( item->Type() == PCB_GROUP_T ) if( item->Type() == PCB_GROUP_T )
static_cast<GROUP*>( item )->RunOnDescendants( aFunction ); static_cast<PCB_GROUP*>( item )->RunOnDescendants( aFunction );
} }
} }
catch( std::bad_function_call& ) catch( std::bad_function_call& )
{ {
DisplayError( NULL, wxT( "Error running GROUP::RunOnDescendants" ) ); DisplayError( NULL, wxT( "Error running PCB_GROUP::RunOnDescendants" ) );
} }
} }

View File

@ -32,7 +32,7 @@
#include <class_marker_pcb.h> #include <class_marker_pcb.h>
#include <class_zone.h> #include <class_zone.h>
#include <class_drawsegment.h> #include <class_drawsegment.h>
#include <class_group.h> #include <class_pcb_group.h>
#include <macros.h> #include <macros.h>
#include <math/util.h> // for KiROUND #include <math/util.h> // for KiROUND
@ -168,7 +168,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
{ {
BOARD_ITEM* item = (BOARD_ITEM*) testItem; BOARD_ITEM* item = (BOARD_ITEM*) testItem;
MODULE* module = nullptr; MODULE* module = nullptr;
GROUP* group = nullptr; PCB_GROUP* group = nullptr;
D_PAD* pad = nullptr; D_PAD* pad = nullptr;
bool pad_through = false; bool pad_through = false;
VIA* via = nullptr; VIA* via = nullptr;
@ -356,7 +356,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
break; break;
case PCB_GROUP_T: case PCB_GROUP_T:
group = static_cast<GROUP*>( item ); group = static_cast<PCB_GROUP*>( item );
break; break;
case PCB_MARKER_T: case PCB_MARKER_T:

View File

@ -193,7 +193,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE
} }
else if( item->Type() == PCB_GROUP_T ) else if( item->Type() == PCB_GROUP_T )
{ {
copy = static_cast<GROUP*>( item )->DeepClone(); copy = static_cast<PCB_GROUP*>( item )->DeepClone();
} }
else else
{ {
@ -219,8 +219,8 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE
if( copy->Type() == PCB_GROUP_T ) if( copy->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( copy )->RunOnDescendants( prepItem ); static_cast<PCB_GROUP*>( copy )->RunOnDescendants( prepItem );
static_cast<GROUP*>( copy )->RunOnDescendants( [&]( BOARD_ITEM* titem ) { static_cast<PCB_GROUP*>( copy )->RunOnDescendants( [&]( BOARD_ITEM* titem ) {
Format( titem, 1 ); Format( titem, 1 );
} ); } );
} }

View File

@ -456,7 +456,7 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const
break; break;
case PCB_GROUP_T: case PCB_GROUP_T:
format( static_cast<GROUP*>( aItem ), aNestLevel ); format( static_cast<PCB_GROUP*>( aItem ), aNestLevel );
break; break;
case PCB_TRACE_T: case PCB_TRACE_T:
@ -1517,7 +1517,7 @@ void PCB_IO::format( TEXTE_PCB* aText, int aNestLevel ) const
} }
void PCB_IO::format( GROUP* aGroup, int aNestLevel ) const void PCB_IO::format( PCB_GROUP* aGroup, int aNestLevel ) const
{ {
m_out->Print( aNestLevel, "(group %s (id %s)\n", m_out->Quotew( aGroup->GetName() ).c_str(), m_out->Print( aNestLevel, "(group %s (id %s)\n", m_out->Quotew( aGroup->GetName() ).c_str(),
TO_UTF8( aGroup->m_Uuid.AsString() ) ); TO_UTF8( aGroup->m_Uuid.AsString() ) );

View File

@ -41,7 +41,7 @@ class DRAWSEGMENT;
class PCB_TARGET; class PCB_TARGET;
class D_PAD; class D_PAD;
class TEXTE_MODULE; class TEXTE_MODULE;
class GROUP; class PCB_GROUP;
class TRACK; class TRACK;
class ZONE_CONTAINER; class ZONE_CONTAINER;
class TEXTE_PCB; class TEXTE_PCB;
@ -244,7 +244,7 @@ private:
void format( EDGE_MODULE* aModuleDrawing, int aNestLevel = 0 ) const; void format( EDGE_MODULE* aModuleDrawing, int aNestLevel = 0 ) const;
void format( GROUP* aGroup, int aNestLevel = 0 ) const; void format( PCB_GROUP* aGroup, int aNestLevel = 0 ) const;
void format( DRAWSEGMENT* aSegment, int aNestLevel = 0 ) const; void format( DRAWSEGMENT* aSegment, int aNestLevel = 0 ) const;

View File

@ -189,7 +189,7 @@ void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem )
} }
else if( lastItem->Type() == PCB_GROUP_T ) else if( lastItem->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( lastItem )->RunOnChildren( [&] ( BOARD_ITEM* child ) static_cast<PCB_GROUP*>( lastItem )->RunOnChildren( [&] ( BOARD_ITEM* child )
{ {
child->ClearBrightened(); child->ClearBrightened();
}); });
@ -213,7 +213,7 @@ void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem )
} }
else if( aItem->Type() == PCB_GROUP_T ) else if( aItem->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( aItem )->RunOnChildren( [&] ( BOARD_ITEM* child ) static_cast<PCB_GROUP*>( aItem )->RunOnChildren( [&] ( BOARD_ITEM* child )
{ {
child->SetBrightened(); child->SetBrightened();
}); });

View File

@ -25,7 +25,7 @@
#include <class_board.h> #include <class_board.h>
#include <class_track.h> #include <class_track.h>
#include <class_group.h> #include <class_pcb_group.h>
#include <class_module.h> #include <class_module.h>
#include <class_pad.h> #include <class_pad.h>
#include <class_drawsegment.h> #include <class_drawsegment.h>
@ -414,7 +414,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
break; break;
case PCB_GROUP_T: case PCB_GROUP_T:
draw( static_cast<const GROUP*>( item ), aLayer ); draw( static_cast<const PCB_GROUP*>( item ), aLayer );
break; break;
case PCB_ZONE_AREA_T: case PCB_ZONE_AREA_T:
@ -1156,7 +1156,7 @@ void PCB_PAINTER::draw( const MODULE* aModule, int aLayer )
} }
void PCB_PAINTER::draw( const GROUP* aGroup, int aLayer ) void PCB_PAINTER::draw( const PCB_GROUP* aGroup, int aLayer )
{ {
if( aLayer == LAYER_ANCHOR ) if( aLayer == LAYER_ANCHOR )
{ {

View File

@ -42,7 +42,7 @@ class VIA;
class TRACK; class TRACK;
class D_PAD; class D_PAD;
class DRAWSEGMENT; class DRAWSEGMENT;
class GROUP; class PCB_GROUP;
class MODULE; class MODULE;
class ZONE_CONTAINER; class ZONE_CONTAINER;
class TEXTE_PCB; class TEXTE_PCB;
@ -304,7 +304,7 @@ protected:
void draw( const TEXTE_PCB* aText, int aLayer ); void draw( const TEXTE_PCB* aText, int aLayer );
void draw( const TEXTE_MODULE* aText, int aLayer ); void draw( const TEXTE_MODULE* aText, int aLayer );
void draw( const MODULE* aModule, int aLayer ); void draw( const MODULE* aModule, int aLayer );
void draw( const GROUP* aGroup, int aLayer ); void draw( const PCB_GROUP* aGroup, int aLayer );
void draw( const ZONE_CONTAINER* aZone, int aLayer ); void draw( const ZONE_CONTAINER* aZone, int aLayer );
void draw( const DIMENSION* aDimension, int aLayer ); void draw( const DIMENSION* aDimension, int aLayer );
void draw( const PCB_TARGET* aTarget ); void draw( const PCB_TARGET* aTarget );

View File

@ -38,7 +38,7 @@
#include <class_dimension.h> #include <class_dimension.h>
#include <class_drawsegment.h> #include <class_drawsegment.h>
#include <class_edge_mod.h> #include <class_edge_mod.h>
#include <class_group.h> #include <class_pcb_group.h>
#include <class_pcb_target.h> #include <class_pcb_target.h>
#include <class_module.h> #include <class_module.h>
#include <netclass.h> #include <netclass.h>
@ -723,7 +723,7 @@ BOARD* PCB_PARSER::parseBOARD_unchecked()
for( size_t idx = 0; idx < m_groupInfos.size(); idx++ ) for( size_t idx = 0; idx < m_groupInfos.size(); idx++ )
{ {
auto& aGrp = m_groupInfos[idx]; auto& aGrp = m_groupInfos[idx];
GROUP* group = new GROUP( m_board ); PCB_GROUP* group = new PCB_GROUP( m_board );
group->SetName( aGrp.name ); group->SetName( aGrp.name );
const_cast<KIID&>( group->m_Uuid ) = aGrp.uuid; const_cast<KIID&>( group->m_Uuid ) = aGrp.uuid;
m_board->Add( group ); m_board->Add( group );
@ -742,7 +742,7 @@ BOARD* PCB_PARSER::parseBOARD_unchecked()
continue; continue;
} }
GROUP* group = static_cast<GROUP*>( bItem ); PCB_GROUP* group = static_cast<PCB_GROUP*>( bItem );
for( const auto& aUuid : aGrp.memberUuids ) for( const auto& aUuid : aGrp.memberUuids )
{ {
@ -3664,7 +3664,7 @@ bool PCB_PARSER::parseD_PAD_option( D_PAD* aPad )
void PCB_PARSER::parseGROUP() void PCB_PARSER::parseGROUP()
{ {
wxCHECK_RET( CurTok() == T_group, wxCHECK_RET( CurTok() == T_group,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as GROUP." ) ); wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as PCB_GROUP." ) );
wxPoint pt; wxPoint pt;
T token; T token;

View File

@ -53,7 +53,7 @@ class TEXTE_MODULE;
class TEXTE_PCB; class TEXTE_PCB;
class TRACK; class TRACK;
class MODULE; class MODULE;
class GROUP; class PCB_GROUP;
class PCB_TARGET; class PCB_TARGET;
class VIA; class VIA;
class ZONE_CONTAINER; class ZONE_CONTAINER;

View File

@ -31,7 +31,7 @@ using namespace std::placeholders;
#include <pcb_display_options.h> #include <pcb_display_options.h>
#include <pcb_painter.h> #include <pcb_painter.h>
#include <class_group.h> #include <class_pcb_group.h>
#include <class_module.h> #include <class_module.h>
namespace KIGFX { namespace KIGFX {

View File

@ -50,7 +50,7 @@
class TEXTE_PCB; class TEXTE_PCB;
class DIMENSION; class DIMENSION;
class MODULE; class MODULE;
class GROUP; class PCB_GROUP;
class TEXTE_MODULE; class TEXTE_MODULE;
class DRAWSEGMENT; class DRAWSEGMENT;
class MARKER_PCB; class MARKER_PCB;
@ -71,7 +71,7 @@ extern "C" {
static TEXTE_PCB* Cast_to_TEXTE_PCB( BOARD_ITEM* ); static TEXTE_PCB* Cast_to_TEXTE_PCB( BOARD_ITEM* );
static DIMENSION* Cast_to_DIMENSION( BOARD_ITEM* ); static DIMENSION* Cast_to_DIMENSION( BOARD_ITEM* );
static MODULE* Cast_to_MODULE( BOARD_ITEM* ); static MODULE* Cast_to_MODULE( BOARD_ITEM* );
static GROUP* Cast_to_GROUP( BOARD_ITEM* ); static PCB_GROUP* Cast_to_PCB_GROUP( BOARD_ITEM* );
static TEXTE_MODULE* Cast_to_TEXTE_MODULE( BOARD_ITEM* ); static TEXTE_MODULE* Cast_to_TEXTE_MODULE( BOARD_ITEM* );
static DRAWSEGMENT* Cast_to_DRAWSEGMENT( BOARD_ITEM* ); static DRAWSEGMENT* Cast_to_DRAWSEGMENT( BOARD_ITEM* );
static MARKER_PCB* Cast_to_MARKER_PCB( BOARD_ITEM* ); static MARKER_PCB* Cast_to_MARKER_PCB( BOARD_ITEM* );
@ -92,7 +92,7 @@ static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
static TEXTE_PCB* Cast_to_TEXTE_PCB( BOARD_ITEM* ); static TEXTE_PCB* Cast_to_TEXTE_PCB( BOARD_ITEM* );
static DIMENSION* Cast_to_DIMENSION( BOARD_ITEM* ); static DIMENSION* Cast_to_DIMENSION( BOARD_ITEM* );
static MODULE* Cast_to_MODULE( BOARD_ITEM* ); static MODULE* Cast_to_MODULE( BOARD_ITEM* );
static GROUP* Cast_to_GROUP( BOARD_ITEM* ); static PCB_GROUP* Cast_to_PCB_GROUP( BOARD_ITEM* );
static TEXTE_MODULE* Cast_to_TEXTE_MODULE( BOARD_ITEM* ); static TEXTE_MODULE* Cast_to_TEXTE_MODULE( BOARD_ITEM* );
static DRAWSEGMENT* Cast_to_DRAWSEGMENT( BOARD_ITEM* ); static DRAWSEGMENT* Cast_to_DRAWSEGMENT( BOARD_ITEM* );
static MARKER_PCB* Cast_to_MARKER_PCB( BOARD_ITEM* ); static MARKER_PCB* Cast_to_MARKER_PCB( BOARD_ITEM* );
@ -125,8 +125,8 @@ static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
return Cast_to_EDGE_MODULE(self) return Cast_to_EDGE_MODULE(self)
elif ct=="MODULE": elif ct=="MODULE":
return Cast_to_MODULE(self) return Cast_to_MODULE(self)
elif ct=="GROUP": elif ct=="PCB_GROUP":
return Cast_to_GROUP(self) return Cast_to_PCB_GROUP(self)
elif ct=="PAD": elif ct=="PAD":
return Cast_to_D_PAD(self) return Cast_to_D_PAD(self)
elif ct=="MTEXT": elif ct=="MTEXT":
@ -170,7 +170,7 @@ static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
static TEXTE_PCB* Cast_to_TEXTE_PCB( BOARD_ITEM* self ) { return dynamic_cast<TEXTE_PCB*>(self); } static TEXTE_PCB* Cast_to_TEXTE_PCB( BOARD_ITEM* self ) { return dynamic_cast<TEXTE_PCB*>(self); }
static DIMENSION* Cast_to_DIMENSION( BOARD_ITEM* self ) { return dynamic_cast<DIMENSION*>(self); } static DIMENSION* Cast_to_DIMENSION( BOARD_ITEM* self ) { return dynamic_cast<DIMENSION*>(self); }
static MODULE* Cast_to_MODULE( BOARD_ITEM* self ) { return dynamic_cast<MODULE*>(self); } static MODULE* Cast_to_MODULE( BOARD_ITEM* self ) { return dynamic_cast<MODULE*>(self); }
static GROUP* Cast_to_GROUP( BOARD_ITEM* self ) { return dynamic_cast<GROUP*>(self); } static PCB_GROUP* Cast_to_PCB_GROUP( BOARD_ITEM* self ) { return dynamic_cast<PCB_GROUP*>(self); }
static TEXTE_MODULE* Cast_to_TEXTE_MODULE( BOARD_ITEM* self ) { return dynamic_cast<TEXTE_MODULE*>(self); } static TEXTE_MODULE* Cast_to_TEXTE_MODULE( BOARD_ITEM* self ) { return dynamic_cast<TEXTE_MODULE*>(self); }
static DRAWSEGMENT* Cast_to_DRAWSEGMENT( BOARD_ITEM* self ) { return dynamic_cast<DRAWSEGMENT*>(self); } static DRAWSEGMENT* Cast_to_DRAWSEGMENT( BOARD_ITEM* self ) { return dynamic_cast<DRAWSEGMENT*>(self); }
static MARKER_PCB* Cast_to_MARKER_PCB( BOARD_ITEM* self ) { return dynamic_cast<MARKER_PCB*>(self); } static MARKER_PCB* Cast_to_MARKER_PCB( BOARD_ITEM* self ) { return dynamic_cast<MARKER_PCB*>(self); }

View File

@ -477,7 +477,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference )
// If moving a group, record position of all the descendants for undo // If moving a group, record position of all the descendants for undo
if( item->Type() == PCB_GROUP_T ) if( item->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) { static_cast<PCB_GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) {
m_commit->Modify( bItem ); m_commit->Modify( bItem );
}); });
} }
@ -770,7 +770,7 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
// If rotating a group, record position of all the descendants for undo // If rotating a group, record position of all the descendants for undo
if( item->Type() == PCB_GROUP_T ) if( item->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) { static_cast<PCB_GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) {
m_commit->Modify( bItem ); m_commit->Modify( bItem );
}); });
} }
@ -973,7 +973,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
if( item->Type() == PCB_GROUP_T ) if( item->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) { static_cast<PCB_GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) {
m_commit->Modify( bItem ); m_commit->Modify( bItem );
}); });
} }
@ -1160,7 +1160,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
m_commit->Remove( item ); m_commit->Remove( item );
removed.Add( item ); removed.Add( item );
static_cast<GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) { static_cast<PCB_GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) {
m_commit->Remove( bItem ); m_commit->Remove( bItem );
}); });
} }
@ -1178,7 +1178,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
// removed in their entirety and so no empty group could remain. If entered // removed in their entirety and so no empty group could remain. If entered
// group is set, then we could be removing all items of the entered group, // group is set, then we could be removing all items of the entered group,
// in which case we need to remove the group itself. // in which case we need to remove the group itself.
GROUP* enteredGroup = m_selectionTool->GetEnteredGroup(); PCB_GROUP* enteredGroup = m_selectionTool->GetEnteredGroup();
if( enteredGroup != nullptr ) if( enteredGroup != nullptr )
{ {
@ -1280,7 +1280,7 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
if( item->Type() == PCB_GROUP_T ) if( item->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) { static_cast<PCB_GROUP*>( item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) {
m_commit->Modify( bItem ); m_commit->Modify( bItem );
}); });
} }
@ -1398,7 +1398,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
break; break;
case PCB_GROUP_T: case PCB_GROUP_T:
dupe_item = static_cast<GROUP*>( orig_item )->DeepDuplicate(); dupe_item = static_cast<PCB_GROUP*>( orig_item )->DeepDuplicate();
break; break;
default: default:
@ -1411,7 +1411,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
{ {
if( dupe_item->Type() == PCB_GROUP_T ) if( dupe_item->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( dupe_item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) { static_cast<PCB_GROUP*>( dupe_item )->RunOnDescendants( [&]( BOARD_ITEM* bItem ) {
m_commit->Add( bItem ); m_commit->Add( bItem );
}); });
} }

View File

@ -31,7 +31,7 @@
#include <bitmaps.h> #include <bitmaps.h>
#include <board_commit.h> #include <board_commit.h>
#include <class_board.h> #include <class_board.h>
#include <class_group.h> #include <class_pcb_group.h>
#include <class_module.h> #include <class_module.h>
#include <class_pcb_target.h> #include <class_pcb_target.h>
#include <class_track.h> #include <class_track.h>
@ -1031,7 +1031,7 @@ int PCB_EDITOR_CONTROL::GroupSelected( const TOOL_EVENT& aEvent )
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true );
// why don't we have to update the selection after selectionCursor action? // why don't we have to update the selection after selectionCursor action?
GROUP* group = new GROUP( board ); PCB_GROUP* group = new PCB_GROUP( board );
for( EDA_ITEM* item : selection ) for( EDA_ITEM* item : selection )
{ {
@ -1071,7 +1071,7 @@ int PCB_EDITOR_CONTROL::GroupMergeSelected( const TOOL_EVENT& aEvent )
m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true );
// why don't we have to update the selection after selectionCursor action? // why don't we have to update the selection after selectionCursor action?
GROUP* firstGroup = NULL; PCB_GROUP* firstGroup = NULL;
for( EDA_ITEM* item : selection ) for( EDA_ITEM* item : selection )
{ {
@ -1079,7 +1079,7 @@ int PCB_EDITOR_CONTROL::GroupMergeSelected( const TOOL_EVENT& aEvent )
if( firstGroup == NULL && board_item->Type() == PCB_GROUP_T ) if( firstGroup == NULL && board_item->Type() == PCB_GROUP_T )
{ {
firstGroup = static_cast<GROUP*>( board_item ); firstGroup = static_cast<PCB_GROUP*>( board_item );
break; break;
} }
} }
@ -1139,7 +1139,7 @@ int PCB_EDITOR_CONTROL::UngroupSelected( const TOOL_EVENT& aEvent )
commit.Remove( board_item ); commit.Remove( board_item );
for( BOARD_ITEM* bItem : static_cast<GROUP*>( board_item )->GetItems() ) for( BOARD_ITEM* bItem : static_cast<PCB_GROUP*>( board_item )->GetItems() )
{ {
ungroupedItems.insert( bItem ); ungroupedItems.insert( bItem );
} }
@ -1213,22 +1213,22 @@ int PCB_EDITOR_CONTROL::GroupFlattenSelected( const TOOL_EVENT& aEvent )
BOARD_ITEM* board_item = static_cast<BOARD_ITEM*>( item ); BOARD_ITEM* board_item = static_cast<BOARD_ITEM*>( item );
wxCHECK_MSG( board_item->Type() == PCB_GROUP_T, 0, wxCHECK_MSG( board_item->Type() == PCB_GROUP_T, 0,
_( "Selection for ungroup should only have groups in it - was checked." ) ); _( "Selection for ungroup should only have groups in it - was checked." ) );
std::queue<GROUP*> groupsToFlatten; std::queue<PCB_GROUP*> groupsToFlatten;
groupsToFlatten.push( static_cast<GROUP*>( board_item ) ); groupsToFlatten.push( static_cast<PCB_GROUP*>( board_item ) );
GROUP* topGroup = groupsToFlatten.front(); PCB_GROUP* topGroup = groupsToFlatten.front();
commit.Modify( topGroup ); commit.Modify( topGroup );
std::unordered_set<BOARD_ITEM*> topSubgroupsToRemove; std::unordered_set<BOARD_ITEM*> topSubgroupsToRemove;
while( !groupsToFlatten.empty() ) while( !groupsToFlatten.empty() )
{ {
GROUP* grp = groupsToFlatten.front(); PCB_GROUP* grp = groupsToFlatten.front();
groupsToFlatten.pop(); groupsToFlatten.pop();
for( BOARD_ITEM* grpItem : grp->GetItems() ) for( BOARD_ITEM* grpItem : grp->GetItems() )
{ {
if( grpItem->Type() == PCB_GROUP_T ) if( grpItem->Type() == PCB_GROUP_T )
{ {
groupsToFlatten.push( static_cast<GROUP*>( grpItem ) ); groupsToFlatten.push( static_cast<PCB_GROUP*>( grpItem ) );
commit.Remove( grpItem ); commit.Remove( grpItem );
if( grp == topGroup ) if( grp == topGroup )
topSubgroupsToRemove.insert( grpItem ); topSubgroupsToRemove.insert( grpItem );

View File

@ -866,16 +866,16 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsN
// Filter out from selection any items that are in groups that are also in the selection // Filter out from selection any items that are in groups that are also in the selection
// For PCB_GROUP_T, a selection including the group should not include its descendants. // For PCB_GROUP_T, a selection including the group should not include its descendants.
std::unordered_set<GROUP*> groups; std::unordered_set<PCB_GROUP*> groups;
for( BOARD_ITEM* item : aItems ) for( BOARD_ITEM* item : aItems )
{ {
if( item->Type() == PCB_GROUP_T ) if( item->Type() == PCB_GROUP_T )
groups.insert( static_cast<GROUP*>( item ) ); groups.insert( static_cast<PCB_GROUP*>( item ) );
} }
for( BOARD_ITEM* item : aItems ) for( BOARD_ITEM* item : aItems )
{ {
bool inGroup = false; bool inGroup = false;
for( GROUP* grp : groups ) for( PCB_GROUP* grp : groups )
{ {
if( grp->GetItems().find( item ) != grp->GetItems().end() ) if( grp->GetItems().find( item ) != grp->GetItems().end() )
{ {

View File

@ -104,7 +104,7 @@ const KIGFX::VIEW_GROUP::ITEMS PCBNEW_SELECTION::updateDrawList() const
} }
else if( item->Type() == PCB_GROUP_T ) else if( item->Type() == PCB_GROUP_T )
{ {
GROUP* group = static_cast<GROUP*>( item ); PCB_GROUP* group = static_cast<PCB_GROUP*>( item );
group->RunOnChildren( [&] ( BOARD_ITEM* bitem ) { addItem( bitem ); } ); group->RunOnChildren( [&] ( BOARD_ITEM* bitem ) { addItem( bitem ); } );
} }
}; };
@ -125,7 +125,7 @@ const KIGFX::VIEW_GROUP::ITEMS PCBNEW_SELECTION::updateDrawList() const
} }
else if( item->Type() == PCB_GROUP_T ) else if( item->Type() == PCB_GROUP_T )
{ {
GROUP* group = static_cast<GROUP*>( item ); PCB_GROUP* group = static_cast<PCB_GROUP*>( item );
group->RunOnChildren( [&] ( BOARD_ITEM* bitem ) { items.push_back( bitem ); } ); group->RunOnChildren( [&] ( BOARD_ITEM* bitem ) { items.push_back( bitem ); } );
} }
} }

View File

@ -347,7 +347,7 @@ void SELECTION_TOOL::EnterGroup()
{ {
wxCHECK_RET( m_selection.GetSize() == 1 && m_selection[0]->Type() == PCB_GROUP_T, wxCHECK_RET( m_selection.GetSize() == 1 && m_selection[0]->Type() == PCB_GROUP_T,
_( "EnterGroup called when selection is not a single group") ); _( "EnterGroup called when selection is not a single group") );
GROUP* aGroup = static_cast<GROUP*>( m_selection[0] ); PCB_GROUP* aGroup = static_cast<PCB_GROUP*>( m_selection[0] );
if( m_enteredGroup != NULL ) if( m_enteredGroup != NULL )
{ {
@ -1938,7 +1938,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn
case PCB_GROUP_T: case PCB_GROUP_T:
{ {
GROUP* group = const_cast<GROUP*>( static_cast<const GROUP*>( aItem ) ); PCB_GROUP* group = const_cast<PCB_GROUP*>( static_cast<const PCB_GROUP*>( aItem ) );
// Similar to logic for module, a group is selectable if any of its // Similar to logic for module, a group is selectable if any of its
// members are. (This recurses) // members are. (This recurses)
@ -2035,7 +2035,7 @@ void SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, PCBNEW_SEL
} }
else if( aItem->Type() == PCB_GROUP_T ) else if( aItem->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( aItem )->RunOnChildren( [&]( BOARD_ITEM* titem ) { static_cast<PCB_GROUP*>( aItem )->RunOnChildren( [&]( BOARD_ITEM* titem ) {
highlightInternal( titem, aMode, aGroup, true ); } ); highlightInternal( titem, aMode, aGroup, true ); } );
} }
} }
@ -2085,7 +2085,7 @@ void SELECTION_TOOL::unhighlightInternal( BOARD_ITEM* aItem, int aMode, PCBNEW_S
} }
else if( aItem->Type() == PCB_GROUP_T ) else if( aItem->Type() == PCB_GROUP_T )
{ {
static_cast<GROUP*>( aItem )->RunOnChildren( [&]( BOARD_ITEM* titem ) { static_cast<PCB_GROUP*>( aItem )->RunOnChildren( [&]( BOARD_ITEM* titem ) {
unhighlightInternal( titem, aMode, aGroup, true ); } ); unhighlightInternal( titem, aMode, aGroup, true ); } );
} }
} }
@ -2536,7 +2536,7 @@ void SELECTION_TOOL::FilterCollectorForGroups( GENERAL_COLLECTOR& aCollector ) c
// If any element is a member of a group, replace those elements with the top containing group. // If any element is a member of a group, replace those elements with the top containing group.
for( int j = 0; j < aCollector.GetCount(); ++j ) for( int j = 0; j < aCollector.GetCount(); ++j )
{ {
GROUP* aTop = board()->TopLevelGroup( aCollector[j], m_enteredGroup ); PCB_GROUP* aTop = board()->TopLevelGroup( aCollector[j], m_enteredGroup );
if( aTop != NULL ) if( aTop != NULL )
{ {

View File

@ -185,7 +185,7 @@ public:
void exitGroup(); void exitGroup();
void FilterCollectorForGroups( GENERAL_COLLECTOR& aCollector ) const; void FilterCollectorForGroups( GENERAL_COLLECTOR& aCollector ) const;
GROUP* GetEnteredGroup() { return m_enteredGroup; } PCB_GROUP* GetEnteredGroup() { return m_enteredGroup; }
private: private:
/** /**
@ -370,7 +370,7 @@ private:
bool m_multiple; // Multiple selection mode is active bool m_multiple; // Multiple selection mode is active
bool m_skip_heuristics; // Heuristics are not allowed when choosing item under cursor bool m_skip_heuristics; // Heuristics are not allowed when choosing item under cursor
bool m_locked; // Other tools are not allowed to modify locked items bool m_locked; // Other tools are not allowed to modify locked items
GROUP* m_enteredGroup; // If non-null, selections are limited to members of this group PCB_GROUP* m_enteredGroup; // If non-null, selections are limited to members of this group
/// Private state (opaque pointer/compilation firewall) /// Private state (opaque pointer/compilation firewall)
class PRIV; class PRIV;

View File

@ -66,13 +66,13 @@ enum ItemType
BOARD* createBoard( const std::vector<std::vector<ItemType>>& spec ) BOARD* createBoard( const std::vector<std::vector<ItemType>>& spec )
{ {
BOARD* aBoard = new BOARD(); BOARD* aBoard = new BOARD();
std::vector<GROUP*> groups; std::vector<PCB_GROUP*> groups;
std::vector<TEXTE_PCB*> textItems; std::vector<TEXTE_PCB*> textItems;
// Create groups // Create groups
for( int idx = 0; idx < 6; idx++ ) for( int idx = 0; idx < 6; idx++ )
{ {
GROUP* gr = new GROUP( aBoard ); PCB_GROUP* gr = new PCB_GROUP( aBoard );
if( idx >= ( NAME_GROUP3 - GROUP0 ) ) if( idx >= ( NAME_GROUP3 - GROUP0 ) )
{ {
wxString name = wxString::Format( wxString name = wxString::Format(
@ -99,7 +99,7 @@ BOARD* createBoard( const std::vector<std::vector<ItemType>>& spec )
for( int groupIdx = 0; groupIdx < spec.size(); groupIdx++ ) for( int groupIdx = 0; groupIdx < spec.size(); groupIdx++ )
{ {
auto& groupSpec = spec[groupIdx]; auto& groupSpec = spec[groupIdx];
GROUP* group = groups[groupIdx]; PCB_GROUP* group = groups[groupIdx];
int count = 0; int count = 0;
for( ItemType item : groupSpec ) for( ItemType item : groupSpec )
{ {
@ -123,7 +123,7 @@ BOARD* createBoard( const std::vector<std::vector<ItemType>>& spec )
} }
// Check if two groups are identical by comparing the fields (by Uuid). // Check if two groups are identical by comparing the fields (by Uuid).
void testGroupEqual( const GROUP& group1, const GROUP& group2 ) void testGroupEqual( const PCB_GROUP& group1, const PCB_GROUP& group2 )
{ {
BOOST_CHECK_EQUAL( group1.m_Uuid.AsString(), group2.m_Uuid.AsString() ); BOOST_CHECK_EQUAL( group1.m_Uuid.AsString(), group2.m_Uuid.AsString() );
BOOST_CHECK_EQUAL( group1.GetName(), group2.GetName() ); BOOST_CHECK_EQUAL( group1.GetName(), group2.GetName() );