KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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 <bitmaps.h>
25#include <eda_draw_frame.h>
27#include <board.h>
28#include <board_item.h>
29#include <footprint.h>
30#include <pcb_generator.h>
31#include <pcb_group.h>
32#include <confirm.h>
33#include <widgets/msgpanel.h>
34#include <view/view.h>
35
36#include <wx/debug.h>
37
39 BOARD_ITEM( aParent, PCB_GROUP_T )
40{
41}
42
43
45 BOARD_ITEM( aParent, idtype, aLayer )
46{
47}
48
49
51{
52 switch ( aType )
53 {
54 case PCB_FOOTPRINT_T:
55 case PCB_PAD_T:
56 case PCB_SHAPE_T:
58 case PCB_FIELD_T:
59 case PCB_TEXT_T:
60 case PCB_TEXTBOX_T:
61 case PCB_TABLE_T:
62 case PCB_GROUP_T:
63 case PCB_GENERATOR_T:
64 case PCB_TRACE_T:
65 case PCB_VIA_T:
66 case PCB_ARC_T:
67 case PCB_DIMENSION_T:
73 case PCB_ZONE_T:
74 return true;
75 default:
76 return false;
77 }
78}
79
80
82{
83 wxCHECK_MSG( aItem, false, wxT( "Nullptr added to group." ) );
84
85 wxCHECK_MSG( IsGroupableType( aItem->Type() ), false,
86 wxT( "Invalid item type added to group: " ) + aItem->GetTypeDesc() );
87
88 // Items can only be in one group at a time
89 if( aItem->GetParentGroup() )
90 aItem->GetParentGroup()->RemoveItem( aItem );
91
92 m_items.insert( aItem );
93 aItem->SetParentGroup( this );
94 return true;
95}
96
97
99{
100 wxCHECK_MSG( aItem, false, wxT( "Nullptr removed from group." ) );
101
102 // Only clear the item's group field if it was inside this group
103 if( m_items.erase( aItem ) == 1 )
104 {
105 aItem->SetParentGroup( nullptr );
106 return true;
107 }
108
109 return false;
110}
111
112
114{
115 for( EDA_ITEM* item : m_items )
116 item->SetParentGroup( nullptr );
117
118 m_items.clear();
119}
120
121
122std::unordered_set<BOARD_ITEM*> PCB_GROUP::GetBoardItems() const
123{
124 std::unordered_set<BOARD_ITEM*> items;
125
126 for( EDA_ITEM* item : m_items )
127 {
128 BOARD_ITEM* board_item = dynamic_cast<BOARD_ITEM*>( item );
129
130 if( board_item )
131 {
132 items.insert( board_item );
133 }
134 }
135
136 return items;
137}
138
139
140/*
141 * @return if not in the footprint editor and aItem is in a footprint, returns the
142 * footprint's parent group. Otherwise, returns the aItem's parent group.
143 */
144EDA_GROUP* getClosestGroup( BOARD_ITEM* aItem, bool isFootprintEditor )
145{
146 if( !isFootprintEditor && aItem->GetParent() && aItem->GetParent()->Type() == PCB_FOOTPRINT_T )
147 return aItem->GetParent()->GetParentGroup();
148 else
149 return aItem->GetParentGroup();
150}
151
152
154EDA_GROUP* getNestedGroup( BOARD_ITEM* aItem, EDA_GROUP* aScope, bool isFootprintEditor )
155{
156 EDA_GROUP* group = getClosestGroup( aItem, isFootprintEditor );
157
158 if( group == aScope )
159 return nullptr;
160
161 while( group && group->AsEdaItem()->GetParentGroup() && group->AsEdaItem()->GetParentGroup() != aScope )
162 {
163 if( group->AsEdaItem()->GetParent()->Type() == PCB_FOOTPRINT_T && isFootprintEditor )
164 break;
165
166 group = group->AsEdaItem()->GetParentGroup();
167 }
168
169 return group;
170}
171
172
173EDA_GROUP* PCB_GROUP::TopLevelGroup( BOARD_ITEM* aItem, EDA_GROUP* aScope, bool isFootprintEditor )
174{
175 return getNestedGroup( aItem, aScope, isFootprintEditor );
176}
177
178
179bool PCB_GROUP::WithinScope( BOARD_ITEM* aItem, PCB_GROUP* aScope, bool isFootprintEditor )
180{
181 EDA_GROUP* group = getClosestGroup( aItem, isFootprintEditor );
182
183 if( group && group == aScope )
184 return true;
185
186 EDA_GROUP* nested = getNestedGroup( aItem, aScope, isFootprintEditor );
187
188 return nested && nested->AsEdaItem()->GetParentGroup() && ( nested->AsEdaItem()->GetParentGroup() == aScope );
189}
190
191
193{
194 return GetBoundingBox().Centre();
195}
196
197
198void PCB_GROUP::SetPosition( const VECTOR2I& aNewpos )
199{
200 VECTOR2I delta = aNewpos - GetPosition();
201
202 Move( delta );
203}
204
205
206void PCB_GROUP::SetLocked( bool aLockState )
207{
208 BOARD_ITEM::SetLocked( aLockState );
209
211 [&]( BOARD_ITEM* child )
212 {
213 child->SetLocked( aLockState );
214 },
215 RECURSE_MODE::NO_RECURSE );
216}
217
218
220{
221 // Use copy constructor to get the same uuid and other fields
222 PCB_GROUP* newGroup = new PCB_GROUP( *this );
223 return newGroup;
224}
225
226
228{
229 // Use copy constructor to get the same uuid and other fields
230 PCB_GROUP* newGroup = new PCB_GROUP( *this );
231 newGroup->m_items.clear();
232
233 for( EDA_ITEM* member : m_items )
234 {
235 if( member->Type() == PCB_GROUP_T )
236 newGroup->AddItem( static_cast<PCB_GROUP*>( member )->DeepClone() );
237 else if( member->Type() == PCB_GENERATOR_T )
238 newGroup->AddItem( static_cast<PCB_GENERATOR*>( member )->DeepClone() );
239 else
240 newGroup->AddItem( static_cast<BOARD_ITEM*>( member->Clone() ) );
241 }
242
243 return newGroup;
244}
245
246
248{
249 PCB_GROUP* newGroup = static_cast<PCB_GROUP*>( Duplicate() );
250 newGroup->m_items.clear();
251
252 for( EDA_ITEM* member : m_items )
253 {
254 if( member->Type() == PCB_GROUP_T )
255 newGroup->AddItem( static_cast<PCB_GROUP*>( member )->DeepDuplicate() );
256 else
257 newGroup->AddItem( static_cast<BOARD_ITEM*>( static_cast<BOARD_ITEM*>( member )->Duplicate() ) );
258 }
259
260 return newGroup;
261}
262
263
265{
266 assert( aImage->Type() == PCB_GROUP_T );
267
268 std::swap( *( (PCB_GROUP*) this ), *( (PCB_GROUP*) aImage ) );
269}
270
271
272bool PCB_GROUP::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
273{
274 // Groups are selected by promoting a selection of one of their children
275 return false;
276}
277
278
279bool PCB_GROUP::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
280{
281 // Groups are selected by promoting a selection of one of their children
282 return false;
283}
284
285
287{
288 BOX2I bbox;
289
290 for( EDA_ITEM* item : m_items )
291 {
292 if( item->Type() == PCB_FOOTPRINT_T )
293 bbox.Merge( static_cast<FOOTPRINT*>( item )->GetBoundingBox( true ) );
294 else
295 bbox.Merge( item->GetBoundingBox() );
296 }
297
298 bbox.Inflate( pcbIUScale.mmToIU( 0.25 ) ); // Give a min size to the bbox
299
300 return bbox;
301}
302
303
304std::shared_ptr<SHAPE> PCB_GROUP::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
305{
306 std::shared_ptr<SHAPE_COMPOUND> shape = std::make_shared<SHAPE_COMPOUND>();
307
308 for( EDA_ITEM* item : m_items )
309 shape->AddShape( static_cast<BOARD_ITEM*>( item )->GetEffectiveShape( aLayer, aFlash )->Clone() );
310
311 return shape;
312}
313
314
315INSPECT_RESULT PCB_GROUP::Visit( INSPECTOR aInspector, void* aTestData,
316 const std::vector<KICAD_T>& aScanTypes )
317{
318 for( KICAD_T scanType : aScanTypes )
319 {
320 if( scanType == Type() )
321 {
322 if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
323 return INSPECT_RESULT::QUIT;
324 }
325 }
326
327 return INSPECT_RESULT::CONTINUE;
328}
329
330
332{
333 LSET aSet;
334
335 for( EDA_ITEM* item : m_items )
336 aSet |= static_cast<BOARD_ITEM*>( item )->GetLayerSet();
337
338 return aSet;
339}
340
341
343{
344 // A group is on a layer if any item is on the layer
345 for( EDA_ITEM* item : m_items )
346 {
347 if( static_cast<BOARD_ITEM*>( item )->IsOnLayer( aLayer ) )
348 return true;
349 }
350
351 return false;
352}
353
354
355std::vector<int> PCB_GROUP::ViewGetLayers() const
356{
357 return { LAYER_ANCHOR };
358}
359
360
361double PCB_GROUP::ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const
362{
363 if( aView->IsLayerVisible( LAYER_ANCHOR ) )
364 return LOD_SHOW;
365
366 return LOD_HIDE;
367}
368
369
370void PCB_GROUP::Move( const VECTOR2I& aMoveVector )
371{
372 for( EDA_ITEM* member : m_items )
373 static_cast<BOARD_ITEM*>( member )->Move( aMoveVector );
374}
375
376
377void PCB_GROUP::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
378{
379 for( EDA_ITEM* item : m_items )
380 static_cast<BOARD_ITEM*>( item )->Rotate( aRotCentre, aAngle );
381}
382
383
384void PCB_GROUP::Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
385{
386 for( EDA_ITEM* item : m_items )
387 static_cast<BOARD_ITEM*>( item )->Flip( aCentre, aFlipDirection );
388}
389
390
391void PCB_GROUP::Mirror( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
392{
393 for( EDA_ITEM* item : m_items )
394 static_cast<BOARD_ITEM*>( item )->Mirror( aCentre, aFlipDirection );
395}
396
397
398wxString PCB_GROUP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
399{
400 if( m_name.empty() )
401 return wxString::Format( _( "Unnamed Group, %zu members" ), m_items.size() );
402 else
403 return wxString::Format( _( "Group '%s', %zu members" ), m_name, m_items.size() );
404}
405
406
408{
409 return BITMAPS::module;
410}
411
412
413void PCB_GROUP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
414{
415 aList.emplace_back( _( "Group" ), m_name.empty() ? _( "<unnamed>" ) : m_name );
416 aList.emplace_back( _( "Members" ), wxString::Format( wxT( "%zu" ), m_items.size() ) );
417
418 if( aFrame->GetName() == PCB_EDIT_FRAME_NAME && IsLocked() )
419 aList.emplace_back( _( "Status" ), _( "Locked" ) );
420}
421
422
423void PCB_GROUP::RunOnChildren( const std::function<void( BOARD_ITEM* )>& aFunction, RECURSE_MODE aMode ) const
424{
425 try
426 {
427 for( BOARD_ITEM* item : GetBoardItems() )
428 {
429 aFunction( item );
430
431 if( aMode == RECURSE_MODE::RECURSE && ( item->Type() == PCB_GROUP_T || item->Type() == PCB_GENERATOR_T ) )
432 {
433 item->RunOnChildren( aFunction, RECURSE_MODE::RECURSE );
434 }
435 }
436 }
437 catch( std::bad_function_call& )
438 {
439 wxFAIL_MSG( wxT( "Error calling function in PCB_GROUP::RunOnChildren" ) );
440 }
441}
442
443
444bool PCB_GROUP::operator==( const BOARD_ITEM& aBoardItem ) const
445{
446 if( aBoardItem.Type() != Type() )
447 return false;
448
449 const PCB_GROUP& other = static_cast<const PCB_GROUP&>( aBoardItem );
450
451 return *this == other;
452}
453
454
455bool PCB_GROUP::operator==( const PCB_GROUP& aOther ) const
456{
457 if( m_items.size() != aOther.m_items.size() )
458 return false;
459
460 // The items in groups are in unordered sets hashed by the pointer value, so we need to
461 // order them by UUID (EDA_ITEM_SET) to compare
462 EDA_ITEM_SET itemSet( m_items.begin(), m_items.end() );
463 EDA_ITEM_SET otherItemSet( aOther.m_items.begin(), aOther.m_items.end() );
464
465 for( auto it1 = itemSet.begin(), it2 = otherItemSet.begin(); it1 != itemSet.end(); ++it1, ++it2 )
466 {
467 // Compare UUID instead of the items themselves because we only care if the contents
468 // of the group has changed, not which elements in the group have changed
469 if( ( *it1 )->m_Uuid != ( *it2 )->m_Uuid )
470 return false;
471 }
472
473 return true;
474}
475
476
477double PCB_GROUP::Similarity( const BOARD_ITEM& aOther ) const
478{
479 if( aOther.Type() != Type() )
480 return 0.0;
481
482 const PCB_GROUP& other = static_cast<const PCB_GROUP&>( aOther );
483
484 double similarity = 0.0;
485
486 for( EDA_ITEM* item : m_items )
487 {
488 for( EDA_ITEM* otherItem : other.m_items )
489 {
490 similarity += static_cast<BOARD_ITEM*>( item )->Similarity( *static_cast<BOARD_ITEM*>( otherItem ) );
491 }
492 }
493
494 return similarity / m_items.size();
495}
496
497
498static struct PCB_GROUP_DESC
499{
501 {
508
509 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Position X" ) );
510 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Position Y" ) );
511 propMgr.Mask( TYPE_HASH( PCB_GROUP ), TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ) );
512
513 const wxString groupTab = _HKI( "Group Properties" );
514
515 propMgr.AddProperty(
517 groupTab );
518 }
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:108
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:78
virtual void SetLocked(bool aLocked)
Definition: board_item.h:320
virtual BOARD_ITEM * Duplicate() const
Create a copy of this BOARD_ITEM.
Definition: board_item.cpp:244
virtual bool IsLocked() const
Definition: board_item.cpp:76
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:207
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:45
wxString m_name
Definition: eda_group.h:92
std::unordered_set< EDA_ITEM * > m_items
Check if the proposed type can be added to a group.
Definition: eda_group.h:91
wxString GetName() const
Definition: eda_group.h:50
virtual bool RemoveItem(EDA_ITEM *aItem)=0
Remove item from group.
virtual EDA_ITEM * AsEdaItem()=0
void SetName(const wxString &aName)
Definition: eda_group.h:51
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:96
wxString GetTypeDesc() const
Return a translated description of the type for this EDA_ITEM for display in user facing messages.
Definition: eda_item.cpp:365
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:108
virtual void SetParentGroup(EDA_GROUP *aGroup)
Definition: eda_item.h:113
EDA_GROUP * GetParentGroup() const
Definition: eda_item.h:114
static constexpr double LOD_HIDE
Return this constant from ViewGetLOD() to hide the item unconditionally.
Definition: view_item.h:174
static constexpr double LOD_SHOW
Return this constant from ViewGetLOD() to show the item unconditionally.
Definition: view_item.h:179
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:418
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.
Definition: pcb_group.cpp:286
static bool WithinScope(BOARD_ITEM *aItem, PCB_GROUP *aScope, bool isFootprintEditor)
Definition: pcb_group.cpp:179
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition: pcb_group.cpp:398
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const override
Invoke a function on all children.
Definition: pcb_group.cpp:423
PCB_GROUP * DeepDuplicate() const override
Definition: pcb_group.cpp:247
static bool IsGroupableType(KICAD_T aType)
Check if the proposed type can be added to a group.
Definition: pcb_group.cpp:50
void Mirror(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Mirror this object relative to a given horizontal axis the layer is not changed.
Definition: pcb_group.cpp:391
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: pcb_group.cpp:377
bool RemoveItem(EDA_ITEM *aItem) override
Remove item from group.
Definition: pcb_group.cpp:98
static EDA_GROUP * TopLevelGroup(BOARD_ITEM *aItem, EDA_GROUP *aScope, bool isFootprintEditor)
Definition: pcb_group.cpp:173
bool operator==(const PCB_GROUP &aOther) const
Definition: pcb_group.cpp:455
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
Definition: pcb_group.cpp:342
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: pcb_group.cpp:331
void SetPosition(const VECTOR2I &aNewpos) override
Definition: pcb_group.cpp:198
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Definition: pcb_group.cpp:370
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
Definition: pcb_group.cpp:477
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...
Definition: pcb_group.cpp:315
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Definition: pcb_group.cpp:361
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.
Definition: pcb_group.cpp:304
void RemoveAll() override
Definition: pcb_group.cpp:113
std::unordered_set< BOARD_ITEM * > GetBoardItems() const
Definition: pcb_group.cpp:122
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.
Definition: pcb_group.cpp:413
VECTOR2I GetPosition() const override
Definition: pcb_group.cpp:192
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
Definition: pcb_group.cpp:384
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: pcb_group.cpp:272
bool AddItem(EDA_ITEM *aItem) override
Add item to group.
Definition: pcb_group.cpp:81
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: pcb_group.cpp:219
PCB_GROUP * DeepClone() const override
Definition: pcb_group.cpp:227
PCB_GROUP(BOARD_ITEM *aParent)
Definition: pcb_group.cpp:38
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition: pcb_group.cpp:407
void swapData(BOARD_ITEM *aImage) override
Definition: pcb_group.cpp:264
void SetLocked(bool aLocked) override
Definition: pcb_group.cpp:206
std::vector< int > ViewGetLayers() const override
Definition: pcb_group.cpp:355
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:85
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()
Definition: property_mgr.h:87
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
This file is part of the common library.
#define _HKI(x)
#define _(s)
#define PCB_EDIT_FRAME_NAME
RECURSE_MODE
Definition: eda_item.h:49
INSPECT_RESULT
Definition: eda_item.h:43
std::set< EDA_ITEM *, CompareByUuid > EDA_ITEM_SET
Definition: eda_item.h:550
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition: eda_item.h:89
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.
EDA_GROUP * getClosestGroup(BOARD_ITEM *aItem, bool isFootprintEditor)
Definition: pcb_group.cpp:144
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.
Definition: pcb_group.cpp:154
Class to handle a set of BOARD_ITEMs.
#define TYPE_HASH(x)
Definition: property.h:71
#define REGISTER_TYPE(x)
Definition: property_mgr.h:371
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:151
EDA_GROUP * getClosestGroup(SCH_ITEM *aItem, bool isSymbolEditor)
Definition: sch_group.cpp:141
constexpr int mmToIU(double mm) const
Definition: base_units.h:88
constexpr int delta
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:105
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:102
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
Definition: typeinfo.h:91
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:103
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:110
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition: typeinfo.h:93
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:107
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition: typeinfo.h:92
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
Definition: typeinfo.h:89
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition: typeinfo.h:90
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:101
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:100
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition: typeinfo.h:94
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition: typeinfo.h:104