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