KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_group.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020 Joshua Redstone redstone at gmail.com
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24#include "pcb_group.h"
25
26#include <bitmaps.h>
27#include <eda_draw_frame.h>
29#include <board.h>
30#include <board_item.h>
31#include <confirm.h>
32#include <footprint.h>
33#include <pcb_generator.h>
34#include <string_utils.h>
35#include <widgets/msgpanel.h>
36#include <view/view.h>
37#include <api/api_enums.h>
38#include <api/api_utils.h>
39#include <api/api_pcb_utils.h>
40#include <api/board/board_types.pb.h>
41#include <google/protobuf/any.pb.h>
42
43#include <wx/debug.h>
44
46 BOARD_ITEM( aParent, PCB_GROUP_T )
47{
48}
49
50
52 BOARD_ITEM( aParent, idtype, aLayer )
53{
54}
55
56void PCB_GROUP::Serialize( google::protobuf::Any &aContainer ) const
57{
58 using namespace kiapi::board::types;
59 Group group;
60
61 group.mutable_id()->set_value( m_Uuid.AsStdString() );
62 group.set_name( GetName().ToUTF8() );
63
64 for( EDA_ITEM* item : GetItems() )
65 {
66 kiapi::common::types::KIID* itemId = group.add_items();
67 itemId->set_value( item->m_Uuid.AsStdString() );
68 }
69
70 aContainer.PackFrom( group );
71}
72
73
74bool PCB_GROUP::Deserialize( const google::protobuf::Any &aContainer )
75{
76 kiapi::board::types::Group group;
77
78 if( !aContainer.UnpackTo( &group ) )
79 return false;
80
81 const_cast<KIID&>( m_Uuid ) = KIID( group.id().value() );
82 SetName( wxString( group.name().c_str(), wxConvUTF8 ) );
83
84 BOARD* board = GetBoard();
85
86 if( !board )
87 return false;
88
89 for( const kiapi::common::types::KIID& itemId : group.items() )
90 {
91 KIID id( itemId.value() );
92
93 if( BOARD_ITEM* item = board->ResolveItem( id, true ) )
94 AddItem( item );
95 }
96
97 return true;
98}
99
100std::unordered_set<BOARD_ITEM*> PCB_GROUP::GetBoardItems() const
101{
102 std::unordered_set<BOARD_ITEM*> items;
103
104 for( EDA_ITEM* item : m_items )
105 {
106 if( item->IsBOARD_ITEM() )
107 items.insert( static_cast<BOARD_ITEM*>( item ) );
108 }
109
110 return items;
111}
112
113
114/*
115 * @return if not in the footprint editor and aItem is in a footprint, returns the
116 * footprint's parent group. Otherwise, returns the aItem's parent group.
117 */
118EDA_GROUP* getClosestGroup( BOARD_ITEM* aItem, bool isFootprintEditor )
119{
120 if( !isFootprintEditor && aItem->GetParent() && aItem->GetParent()->Type() == PCB_FOOTPRINT_T )
121 return aItem->GetParent()->GetParentGroup();
122 else
123 return aItem->GetParentGroup();
124}
125
126
128EDA_GROUP* getNestedGroup( BOARD_ITEM* aItem, EDA_GROUP* aScope, bool isFootprintEditor )
129{
130 EDA_GROUP* group = getClosestGroup( aItem, isFootprintEditor );
131
132 if( group == aScope )
133 return nullptr;
134
135 while( group && group->AsEdaItem()->GetParentGroup() && group->AsEdaItem()->GetParentGroup() != aScope )
136 group = group->AsEdaItem()->GetParentGroup();
137
138 return group;
139}
140
141
142EDA_GROUP* PCB_GROUP::TopLevelGroup( BOARD_ITEM* aItem, EDA_GROUP* aScope, bool isFootprintEditor )
143{
144 return getNestedGroup( aItem, aScope, isFootprintEditor );
145}
146
147
148bool PCB_GROUP::WithinScope( BOARD_ITEM* aItem, PCB_GROUP* aScope, bool isFootprintEditor )
149{
150 EDA_GROUP* group = getClosestGroup( aItem, isFootprintEditor );
151
152 if( group && group == aScope )
153 return true;
154
155 EDA_GROUP* nested = getNestedGroup( aItem, aScope, isFootprintEditor );
156
157 return nested && nested->AsEdaItem()->GetParentGroup() && ( nested->AsEdaItem()->GetParentGroup() == aScope );
158}
159
160
162{
163 return GetBoundingBox().Centre();
164}
165
166
167void PCB_GROUP::SetPosition( const VECTOR2I& aNewpos )
168{
169 VECTOR2I delta = aNewpos - GetPosition();
170
171 Move( delta );
172}
173
174
175void PCB_GROUP::SetLocked( bool aLockState )
176{
177 BOARD_ITEM::SetLocked( aLockState );
178
180 [&]( BOARD_ITEM* child )
181 {
182 child->SetLocked( aLockState );
183 },
185}
186
187
189{
190 // Use copy constructor to get the same uuid and other fields
191 PCB_GROUP* newGroup = new PCB_GROUP( *this );
192 return newGroup;
193}
194
195
197{
198 // Use copy constructor to get the same uuid and other fields
199 PCB_GROUP* newGroup = new PCB_GROUP( *this );
200 newGroup->m_items.clear();
201
202 for( EDA_ITEM* member : m_items )
203 {
204 if( member->Type() == PCB_GROUP_T )
205 newGroup->AddItem( static_cast<PCB_GROUP*>( member )->DeepClone() );
206 else if( member->Type() == PCB_GENERATOR_T )
207 newGroup->AddItem( static_cast<PCB_GENERATOR*>( member )->DeepClone() );
208 else
209 newGroup->AddItem( static_cast<BOARD_ITEM*>( member->Clone() ) );
210 }
211
212 return newGroup;
213}
214
215
216PCB_GROUP* PCB_GROUP::DeepDuplicate( bool addToParentGroup, BOARD_COMMIT* aCommit ) const
217{
218 PCB_GROUP* newGroup = static_cast<PCB_GROUP*>( Duplicate( addToParentGroup, aCommit ) );
219 newGroup->m_items.clear();
220
221 for( EDA_ITEM* member : m_items )
222 {
223 if( member->Type() == PCB_GROUP_T )
224 newGroup->AddItem( static_cast<PCB_GROUP*>( member )->DeepDuplicate( IGNORE_PARENT_GROUP ) );
225 else
226 newGroup->AddItem( static_cast<BOARD_ITEM*>( member )->Duplicate( IGNORE_PARENT_GROUP ) );
227 }
228
229 return newGroup;
230}
231
232
234{
235 assert( aImage->Type() == PCB_GROUP_T );
236 PCB_GROUP* image = static_cast<PCB_GROUP*>( aImage );
237
238 std::swap( *this, *image );
239}
240
241
242bool PCB_GROUP::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
243{
244 // Groups are selected by promoting a selection of one of their children
245 return false;
246}
247
248
249bool PCB_GROUP::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
250{
251 // Groups are selected by promoting a selection of one of their children
252 return false;
253}
254
255
256bool PCB_GROUP::HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const
257{
258 // Groups are selected by promoting a selection of one of their children
259 return false;
260}
261
262
264{
265 BOX2I bbox;
266
267 for( EDA_ITEM* item : m_items )
268 {
269 if( item->Type() == PCB_FOOTPRINT_T )
270 bbox.Merge( static_cast<FOOTPRINT*>( item )->GetBoundingBox( true ) );
271 else
272 bbox.Merge( item->GetBoundingBox() );
273 }
274
275 bbox.Inflate( pcbIUScale.mmToIU( 0.25 ) ); // Give a min size to the bbox
276
277 return bbox;
278}
279
280
281std::shared_ptr<SHAPE> PCB_GROUP::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
282{
283 std::shared_ptr<SHAPE_COMPOUND> shape = std::make_shared<SHAPE_COMPOUND>();
284
285 for( BOARD_ITEM* item : GetBoardItems() )
286 shape->AddShape( item->GetEffectiveShape( aLayer, aFlash )->Clone() );
287
288 return shape;
289}
290
291
292INSPECT_RESULT PCB_GROUP::Visit( INSPECTOR aInspector, void* aTestData,
293 const std::vector<KICAD_T>& aScanTypes )
294{
295 for( KICAD_T scanType : aScanTypes )
296 {
297 if( scanType == Type() )
298 {
299 if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
301 }
302 }
303
305}
306
307
309{
310 LSET aSet;
311
312 for( EDA_ITEM* item : m_items )
313 aSet |= static_cast<BOARD_ITEM*>( item )->GetLayerSet();
314
315 return aSet;
316}
317
318
320{
321 // A group is on a layer if any item is on the layer
322 for( EDA_ITEM* item : m_items )
323 {
324 if( static_cast<BOARD_ITEM*>( item )->IsOnLayer( aLayer ) )
325 return true;
326 }
327
328 return false;
329}
330
331
332std::vector<int> PCB_GROUP::ViewGetLayers() const
333{
334 return { LAYER_ANCHOR };
335}
336
337
338double PCB_GROUP::ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const
339{
340 if( aView->IsLayerVisible( LAYER_ANCHOR ) )
341 return LOD_SHOW;
342
343 return LOD_HIDE;
344}
345
346
347void PCB_GROUP::Move( const VECTOR2I& aMoveVector )
348{
349 for( EDA_ITEM* member : m_items )
350 static_cast<BOARD_ITEM*>( member )->Move( aMoveVector );
351}
352
353
354void PCB_GROUP::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
355{
356 for( EDA_ITEM* item : m_items )
357 static_cast<BOARD_ITEM*>( item )->Rotate( aRotCentre, aAngle );
358}
359
360
361void PCB_GROUP::Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
362{
363 for( EDA_ITEM* item : m_items )
364 static_cast<BOARD_ITEM*>( item )->Flip( aCentre, aFlipDirection );
365}
366
367
368void PCB_GROUP::Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
369{
370 for( EDA_ITEM* item : m_items )
371 static_cast<BOARD_ITEM*>( item )->Mirror( aCentre, aFlipDirection );
372}
373
374
375wxString PCB_GROUP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
376{
377 if( m_name.empty() )
378 return wxString::Format( _( "Unnamed Group, %zu members" ), m_items.size() );
379 else
380 return wxString::Format( _( "Group '%s', %zu members" ), m_name, m_items.size() );
381}
382
383
385{
386 return BITMAPS::module;
387}
388
389
390void PCB_GROUP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
391{
392 aList.emplace_back( _( "Group" ), m_name.empty() ? _( "<unnamed>" ) : m_name );
393 aList.emplace_back( _( "Members" ), wxString::Format( wxT( "%zu" ), m_items.size() ) );
394
395 if( aFrame->GetName() == PCB_EDIT_FRAME_NAME && IsLocked() )
396 aList.emplace_back( _( "Status" ), _( "Locked" ) );
397}
398
399
400bool PCB_GROUP::Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const
401{
402 return EDA_ITEM::Matches( UnescapeString( GetName() ), aSearchData );
403}
404
405
406void PCB_GROUP::RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction, RECURSE_MODE aMode ) const
407{
408 try
409 {
410 for( BOARD_ITEM* item : GetBoardItems() )
411 {
412 aFunction( item );
413
414 if( aMode == RECURSE_MODE::RECURSE && ( item->Type() == PCB_GROUP_T || item->Type() == PCB_GENERATOR_T ) )
415 {
416 item->RunOnChildren( aFunction, RECURSE_MODE::RECURSE );
417 }
418 }
419 }
420 catch( std::bad_function_call& )
421 {
422 wxFAIL_MSG( wxT( "Error calling function in PCB_GROUP::RunOnChildren" ) );
423 }
424}
425
426
427bool PCB_GROUP::operator==( const BOARD_ITEM& aBoardItem ) const
428{
429 if( aBoardItem.Type() != Type() )
430 return false;
431
432 const PCB_GROUP& other = static_cast<const PCB_GROUP&>( aBoardItem );
433
434 return *this == other;
435}
436
437
438bool PCB_GROUP::operator==( const PCB_GROUP& aOther ) const
439{
440 if( m_items.size() != aOther.m_items.size() )
441 return false;
442
443 // The items in groups are in unordered sets hashed by the pointer value, so we need to
444 // order them by UUID (EDA_ITEM_SET) to compare
445 EDA_ITEM_SET itemSet( m_items.begin(), m_items.end() );
446 EDA_ITEM_SET otherItemSet( aOther.m_items.begin(), aOther.m_items.end() );
447
448 for( auto it1 = itemSet.begin(), it2 = otherItemSet.begin(); it1 != itemSet.end(); ++it1, ++it2 )
449 {
450 // Compare UUID instead of the items themselves because we only care if the contents
451 // of the group has changed, not which elements in the group have changed
452 if( ( *it1 )->m_Uuid != ( *it2 )->m_Uuid )
453 return false;
454 }
455
456 return true;
457}
458
459
460double PCB_GROUP::Similarity( const BOARD_ITEM& aOther ) const
461{
462 if( aOther.Type() != Type() )
463 return 0.0;
464
465 const PCB_GROUP& other = static_cast<const PCB_GROUP&>( aOther );
466
467 double similarity = 0.0;
468
469 for( EDA_ITEM* item : m_items )
470 {
471 for( EDA_ITEM* otherItem : other.m_items )
472 {
473 similarity += static_cast<BOARD_ITEM*>( item )->Similarity( *static_cast<BOARD_ITEM*>( otherItem ) );
474 }
475 }
476
477 return similarity / m_items.size();
478}
479
480
481static struct PCB_GROUP_DESC
482{
484 {
491
492 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Position X" ) );
493 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Position Y" ) );
494 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ) );
495
496 const wxString groupTab = _HKI( "Group Properties" );
497
498 propMgr.AddProperty(
500 groupTab );
501 }
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:112
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:79
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:81
virtual BOARD_ITEM * Duplicate(bool addToParentGroup, BOARD_COMMIT *aCommit=nullptr) const
Create a copy of this BOARD_ITEM.
void SetLocked(bool aLocked) override
Definition board_item.h:323
bool IsLocked() const override
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD_ITEM_CONTAINER * GetParent() const
Definition board_item.h:210
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:317
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:558
constexpr Vec Centre() const
Definition box2.h:97
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition box2.h:658
The base class for create windows for drawing purpose.
A set of EDA_ITEMs (i.e., without duplicates).
Definition eda_group.h:46
wxString m_name
Definition eda_group.h:77
std::unordered_set< EDA_ITEM * > m_items
Definition eda_group.h:76
std::unordered_set< EDA_ITEM * > & GetItems()
Definition eda_group.h:54
wxString GetName() const
Definition eda_group.h:51
void AddItem(EDA_ITEM *aItem)
Add item to group.
Definition eda_group.cpp:27
virtual EDA_ITEM * AsEdaItem()=0
void SetName(const wxString &aName)
Definition eda_group.h:52
const KIID m_Uuid
Definition eda_item.h:516
virtual EDA_GROUP * GetParentGroup() const
Definition eda_item.h:116
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition eda_item.h:401
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:39
static constexpr double LOD_HIDE
Return this constant from ViewGetLOD() to hide the item unconditionally.
Definition view_item.h:180
static constexpr double LOD_SHOW
Return this constant from ViewGetLOD() to show the item unconditionally.
Definition view_item.h:185
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:66
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition view.h:422
Definition kiid.h:49
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
A set of BOARD_ITEMs (i.e., without duplicates).
Definition pcb_group.h:53
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
static bool WithinScope(BOARD_ITEM *aItem, PCB_GROUP *aScope, bool isFootprintEditor)
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const override
Invoke a function on all children.
PCB_GROUP * DeepClone() const
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition pcb_group.cpp:74
void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
static EDA_GROUP * TopLevelGroup(BOARD_ITEM *aItem, EDA_GROUP *aScope, bool isFootprintEditor)
bool operator==(const PCB_GROUP &aOther) const
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition pcb_group.cpp:56
void SetPosition(const VECTOR2I &aNewpos) override
void Move(const VECTOR2I &aMoveVector) override
Move this object.
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
INSPECT_RESULT Visit(INSPECTOR aInspector, void *aTestData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
std::unordered_set< BOARD_ITEM * > GetBoardItems() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
VECTOR2I GetPosition() const override
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
PCB_GROUP * DeepDuplicate(bool addToParentGroup, BOARD_COMMIT *aCommit=nullptr) const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
PCB_GROUP(BOARD_ITEM *aParent)
Definition pcb_group.cpp:45
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void swapData(BOARD_ITEM *aImage) override
void SetLocked(bool aLocked) override
std::vector< int > ViewGetLayers() const override
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
void Mask(TYPE_ID aDerived, TYPE_ID aBase, const wxString &aName)
Sets a base class property as masked in a derived class.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
This file is part of the common library.
#define _(s)
#define PCB_EDIT_FRAME_NAME
RECURSE_MODE
Definition eda_item.h:50
@ RECURSE
Definition eda_item.h:51
@ NO_RECURSE
Definition eda_item.h:52
INSPECT_RESULT
Definition eda_item.h:44
std::set< EDA_ITEM *, CompareByUuid > EDA_ITEM_SET
Definition eda_item.h:568
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:91
#define IGNORE_PARENT_GROUP
Definition eda_item.h:55
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition layer_ids.h:184
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
Definition layer_ids.h:247
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
FLIP_DIRECTION
Definition mirror.h:27
Message panel definition file.
#define _HKI(x)
Definition page_info.cpp:44
EDA_GROUP * getClosestGroup(BOARD_ITEM *aItem, bool isFootprintEditor)
static struct PCB_GROUP_DESC _PCB_GROUP_DESC
EDA_GROUP * getNestedGroup(BOARD_ITEM *aItem, EDA_GROUP *aScope, bool isFootprintEditor)
Returns the top level group inside the aScope group, or nullptr.
Class to handle a set of BOARD_ITEMs.
#define TYPE_HASH(x)
Definition property.h:73
#define REGISTER_TYPE(x)
EDA_GROUP * getNestedGroup(SCH_ITEM *aItem, EDA_GROUP *aScope, bool isSymbolEditor)
Returns the top level group inside the aScope group, or nullptr.
Definition sch_group.cpp:78
EDA_GROUP * getClosestGroup(SCH_ITEM *aItem, bool isSymbolEditor)
Definition sch_group.cpp:68
wxString UnescapeString(const wxString &aSource)
int delta
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:78
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition typeinfo.h:91
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition typeinfo.h:110
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:86
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695