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#include <properties/property.h>
46
48 BOARD_ITEM( aParent, PCB_GROUP_T )
49{
50}
51
52
54 BOARD_ITEM( aParent, idtype, aLayer )
55{
56}
57
58void PCB_GROUP::Serialize( google::protobuf::Any &aContainer ) const
59{
60 using namespace kiapi::board::types;
61 Group group;
62
63 group.mutable_id()->set_value( m_Uuid.AsStdString() );
64 group.set_name( GetName().ToUTF8() );
65
66 for( EDA_ITEM* item : GetItems() )
67 {
68 kiapi::common::types::KIID* itemId = group.add_items();
69 itemId->set_value( item->m_Uuid.AsStdString() );
70 }
71
72 aContainer.PackFrom( group );
73}
74
75
76bool PCB_GROUP::Deserialize( const google::protobuf::Any &aContainer )
77{
78 kiapi::board::types::Group group;
79
80 if( !aContainer.UnpackTo( &group ) )
81 return false;
82
83 const_cast<KIID&>( m_Uuid ) = KIID( group.id().value() );
84 SetName( wxString( group.name().c_str(), wxConvUTF8 ) );
85
86 BOARD* board = GetBoard();
87
88 if( !board )
89 return false;
90
91 for( const kiapi::common::types::KIID& itemId : group.items() )
92 {
93 KIID id( itemId.value() );
94
95 if( BOARD_ITEM* item = board->ResolveItem( id, true ) )
96 AddItem( item );
97 }
98
99 return true;
100}
101
102std::unordered_set<BOARD_ITEM*> PCB_GROUP::GetBoardItems() const
103{
104 std::unordered_set<BOARD_ITEM*> items;
105
106 for( EDA_ITEM* item : m_items )
107 {
108 if( item->IsBOARD_ITEM() )
109 items.insert( static_cast<BOARD_ITEM*>( item ) );
110 }
111
112 return items;
113}
114
115
116/*
117 * @return if not in the footprint editor and aItem is in a footprint, returns the
118 * footprint's parent group. Otherwise, returns the aItem's parent group.
119 */
120EDA_GROUP* getClosestGroup( BOARD_ITEM* aItem, bool isFootprintEditor )
121{
122 if( !isFootprintEditor && aItem->GetParent() && aItem->GetParent()->Type() == PCB_FOOTPRINT_T )
123 return aItem->GetParent()->GetParentGroup();
124 else
125 return aItem->GetParentGroup();
126}
127
128
130EDA_GROUP* getNestedGroup( BOARD_ITEM* aItem, EDA_GROUP* aScope, bool isFootprintEditor )
131{
132 EDA_GROUP* group = getClosestGroup( aItem, isFootprintEditor );
133
134 if( group == aScope )
135 return nullptr;
136
137 while( group && group->AsEdaItem()->GetParentGroup() && group->AsEdaItem()->GetParentGroup() != aScope )
138 group = group->AsEdaItem()->GetParentGroup();
139
140 return group;
141}
142
143
144EDA_GROUP* PCB_GROUP::TopLevelGroup( BOARD_ITEM* aItem, EDA_GROUP* aScope, bool isFootprintEditor )
145{
146 return getNestedGroup( aItem, aScope, isFootprintEditor );
147}
148
149
150bool PCB_GROUP::WithinScope( BOARD_ITEM* aItem, PCB_GROUP* aScope, bool isFootprintEditor )
151{
152 EDA_GROUP* group = getClosestGroup( aItem, isFootprintEditor );
153
154 if( group && group == aScope )
155 return true;
156
157 EDA_GROUP* nested = getNestedGroup( aItem, aScope, isFootprintEditor );
158
159 return nested && nested->AsEdaItem()->GetParentGroup() && ( nested->AsEdaItem()->GetParentGroup() == aScope );
160}
161
162
164{
165 return GetBoundingBox().Centre();
166}
167
168
169void PCB_GROUP::SetPosition( const VECTOR2I& aNewpos )
170{
171 VECTOR2I delta = aNewpos - GetPosition();
172
173 Move( delta );
174}
175
176
177void PCB_GROUP::SetLocked( bool aLockState )
178{
179 BOARD_ITEM::SetLocked( aLockState );
180
182 [&]( BOARD_ITEM* child )
183 {
184 child->SetLocked( aLockState );
185 },
187}
188
189
191{
192 // Use copy constructor to get the same uuid and other fields
193 PCB_GROUP* newGroup = new PCB_GROUP( *this );
194 return newGroup;
195}
196
197
199{
200 // Use copy constructor to get the same uuid and other fields
201 PCB_GROUP* newGroup = new PCB_GROUP( *this );
202 newGroup->m_items.clear();
203
204 for( EDA_ITEM* member : m_items )
205 {
206 if( member->Type() == PCB_GROUP_T )
207 newGroup->AddItem( static_cast<PCB_GROUP*>( member )->DeepClone() );
208 else if( member->Type() == PCB_GENERATOR_T )
209 newGroup->AddItem( static_cast<PCB_GENERATOR*>( member )->DeepClone() );
210 else
211 newGroup->AddItem( static_cast<BOARD_ITEM*>( member->Clone() ) );
212 }
213
214 return newGroup;
215}
216
217
218PCB_GROUP* PCB_GROUP::DeepDuplicate( bool addToParentGroup, BOARD_COMMIT* aCommit ) const
219{
220 PCB_GROUP* newGroup = static_cast<PCB_GROUP*>( Duplicate( addToParentGroup, aCommit ) );
221 newGroup->m_items.clear();
222
223 for( EDA_ITEM* member : m_items )
224 {
225 if( member->Type() == PCB_GROUP_T )
226 newGroup->AddItem( static_cast<PCB_GROUP*>( member )->DeepDuplicate( IGNORE_PARENT_GROUP ) );
227 else
228 newGroup->AddItem( static_cast<BOARD_ITEM*>( member )->Duplicate( IGNORE_PARENT_GROUP ) );
229 }
230
231 return newGroup;
232}
233
234
236{
237 assert( aImage->Type() == PCB_GROUP_T );
238 PCB_GROUP* image = static_cast<PCB_GROUP*>( aImage );
239
240 std::swap( *this, *image );
241
242 // A group doesn't own its children (they're owned by the board), so undo doesn't do a
243 // deep clone when making an image. However, it's still safest to update the parentGroup
244 // pointers of the group's children. We must do it in the right order in case any of the
245 // children are shared (ie: image first, "this" second so that any shared children end up
246 // with "this").
247 image->RunOnChildren(
248 [&]( BOARD_ITEM* child )
249 {
250 child->SetParentGroup( image );
251 },
253
255 [&]( BOARD_ITEM* child )
256 {
257 child->SetParentGroup( this );
258 },
260}
261
262
263bool PCB_GROUP::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
264{
265 // Groups are selected by promoting a selection of one of their children
266 return false;
267}
268
269
270bool PCB_GROUP::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
271{
272 // Groups are selected by promoting a selection of one of their children
273 return false;
274}
275
276
277bool PCB_GROUP::HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const
278{
279 // Groups are selected by promoting a selection of one of their children
280 return false;
281}
282
283
285{
286 BOX2I bbox;
287
288 for( EDA_ITEM* item : m_items )
289 {
290 if( item->Type() == PCB_FOOTPRINT_T )
291 bbox.Merge( static_cast<FOOTPRINT*>( item )->GetBoundingBox( true ) );
292 else
293 bbox.Merge( item->GetBoundingBox() );
294 }
295
296 bbox.Inflate( pcbIUScale.mmToIU( 0.25 ) ); // Give a min size to the bbox
297
298 return bbox;
299}
300
301
302std::shared_ptr<SHAPE> PCB_GROUP::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
303{
304 std::shared_ptr<SHAPE_COMPOUND> shape = std::make_shared<SHAPE_COMPOUND>();
305
306 for( BOARD_ITEM* item : GetBoardItems() )
307 shape->AddShape( item->GetEffectiveShape( aLayer, aFlash )->Clone() );
308
309 return shape;
310}
311
312
313INSPECT_RESULT PCB_GROUP::Visit( INSPECTOR aInspector, void* aTestData,
314 const std::vector<KICAD_T>& aScanTypes )
315{
316 for( KICAD_T scanType : aScanTypes )
317 {
318 if( scanType == Type() )
319 {
320 if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
322 }
323 }
324
326}
327
328
330{
331 LSET aSet;
332
333 for( EDA_ITEM* item : m_items )
334 aSet |= static_cast<BOARD_ITEM*>( item )->GetLayerSet();
335
336 return aSet;
337}
338
339
341{
342 // A group is on a layer if any item is on the layer
343 for( EDA_ITEM* item : m_items )
344 {
345 if( static_cast<BOARD_ITEM*>( item )->IsOnLayer( aLayer ) )
346 return true;
347 }
348
349 return false;
350}
351
352
353std::vector<int> PCB_GROUP::ViewGetLayers() const
354{
355 return { LAYER_ANCHOR };
356}
357
358
359double PCB_GROUP::ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const
360{
361 if( aView->IsLayerVisible( LAYER_ANCHOR ) )
362 return LOD_SHOW;
363
364 return LOD_HIDE;
365}
366
367
368void PCB_GROUP::Move( const VECTOR2I& aMoveVector )
369{
370 for( EDA_ITEM* member : m_items )
371 static_cast<BOARD_ITEM*>( member )->Move( aMoveVector );
372}
373
374
375void PCB_GROUP::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
376{
377 for( EDA_ITEM* item : m_items )
378 static_cast<BOARD_ITEM*>( item )->Rotate( aRotCentre, aAngle );
379}
380
381
382void PCB_GROUP::Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
383{
384 for( EDA_ITEM* item : m_items )
385 static_cast<BOARD_ITEM*>( item )->Flip( aCentre, aFlipDirection );
386}
387
388
389void PCB_GROUP::Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
390{
391 for( EDA_ITEM* item : m_items )
392 static_cast<BOARD_ITEM*>( item )->Mirror( aCentre, aFlipDirection );
393}
394
395
396wxString PCB_GROUP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
397{
398 if( m_name.empty() )
399 return wxString::Format( _( "Unnamed Group, %zu members" ), m_items.size() );
400 else
401 return wxString::Format( _( "Group '%s', %zu members" ), m_name, m_items.size() );
402}
403
404
406{
407 return BITMAPS::module;
408}
409
410
411void PCB_GROUP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
412{
413 aList.emplace_back( _( "Group" ), m_name.empty() ? _( "<unnamed>" ) : m_name );
414 aList.emplace_back( _( "Members" ), wxString::Format( wxT( "%zu" ), m_items.size() ) );
415
416 if( aFrame->GetName() == PCB_EDIT_FRAME_NAME && IsLocked() )
417 aList.emplace_back( _( "Status" ), _( "Locked" ) );
418}
419
420
421bool PCB_GROUP::Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const
422{
423 return EDA_ITEM::Matches( UnescapeString( GetName() ), aSearchData );
424}
425
426
427void PCB_GROUP::RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction, RECURSE_MODE aMode ) const
428{
429 try
430 {
431 for( BOARD_ITEM* item : GetBoardItems() )
432 {
433 aFunction( item );
434
435 if( aMode == RECURSE_MODE::RECURSE && ( item->Type() == PCB_GROUP_T || item->Type() == PCB_GENERATOR_T ) )
436 {
437 item->RunOnChildren( aFunction, RECURSE_MODE::RECURSE );
438 }
439 }
440 }
441 catch( std::bad_function_call& )
442 {
443 wxFAIL_MSG( wxT( "Error calling function in PCB_GROUP::RunOnChildren" ) );
444 }
445}
446
447
448bool PCB_GROUP::operator==( const BOARD_ITEM& aBoardItem ) const
449{
450 if( aBoardItem.Type() != Type() )
451 return false;
452
453 const PCB_GROUP& other = static_cast<const PCB_GROUP&>( aBoardItem );
454
455 return *this == other;
456}
457
458
459bool PCB_GROUP::operator==( const PCB_GROUP& aOther ) const
460{
461 if( m_items.size() != aOther.m_items.size() )
462 return false;
463
464 // The items in groups are in unordered sets hashed by the pointer value, so we need to
465 // order them by UUID (EDA_ITEM_SET) to compare
466 EDA_ITEM_SET itemSet( m_items.begin(), m_items.end() );
467 EDA_ITEM_SET otherItemSet( aOther.m_items.begin(), aOther.m_items.end() );
468
469 for( auto it1 = itemSet.begin(), it2 = otherItemSet.begin(); it1 != itemSet.end(); ++it1, ++it2 )
470 {
471 // Compare UUID instead of the items themselves because we only care if the contents
472 // of the group has changed, not which elements in the group have changed
473 if( ( *it1 )->m_Uuid != ( *it2 )->m_Uuid )
474 return false;
475 }
476
477 return true;
478}
479
480
481double PCB_GROUP::Similarity( const BOARD_ITEM& aOther ) const
482{
483 if( aOther.Type() != Type() )
484 return 0.0;
485
486 const PCB_GROUP& other = static_cast<const PCB_GROUP&>( aOther );
487
488 double similarity = 0.0;
489
490 for( EDA_ITEM* item : m_items )
491 {
492 for( EDA_ITEM* otherItem : other.m_items )
493 {
494 similarity += static_cast<BOARD_ITEM*>( item )->Similarity( *static_cast<BOARD_ITEM*>( otherItem ) );
495 }
496 }
497
498 return similarity / m_items.size();
499}
500
501
502static struct PCB_GROUP_DESC
503{
505 {
512
513 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Position X" ) );
514 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Position Y" ) );
515 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ) );
516
517 const wxString groupTab = _HKI( "Group Properties" );
518
519 propMgr.AddProperty(
521 groupTab );
522 }
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:84
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:86
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:328
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:215
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
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:522
virtual EDA_GROUP * GetParentGroup() const
Definition eda_item.h:117
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:111
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition eda_item.h:407
virtual void SetParentGroup(EDA_GROUP *aGroup)
Definition eda_item.h:116
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:41
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:67
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition view.h:423
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:76
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:58
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:47
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:51
@ RECURSE
Definition eda_item.h:52
@ NO_RECURSE
Definition eda_item.h:53
INSPECT_RESULT
Definition eda_item.h:45
std::set< EDA_ITEM *, CompareByUuid > EDA_ITEM_SET
Definition eda_item.h:576
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:92
#define IGNORE_PARENT_GROUP
Definition eda_item.h:56
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:248
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:74
#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:83
EDA_GROUP * getClosestGroup(SCH_ITEM *aItem, bool isSymbolEditor)
Definition sch_group.cpp:73
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:111
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition typeinfo.h:86
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695