KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19#include <bitmaps.h>
20#include <api/schematic/schematic_types.pb.h>
21#include <google/protobuf/any.pb.h>
22#include <eda_draw_frame.h>
23#include <eda_group.h>
25#include <sch_item.h>
26#include <sch_group.h>
27#include <sch_screen.h>
28#include <schematic.h>
29#include <sch_symbol.h>
30#include <symbol.h>
31#include <confirm.h>
32#include <widgets/msgpanel.h>
33#include <view/view.h>
34
35#include <wx/debug.h>
36#include <properties/property.h>
38
43
45{
47}
48
53
54
55void SCH_GROUP::Serialize( google::protobuf::Any& aContainer ) const
56{
57 using namespace kiapi::schematic::types;
58
59 Group group;
60 EDA_ITEM_SET sortedItems( m_items.begin(), m_items.end() );
61
62 group.mutable_id()->set_value( m_Uuid.AsStdString() );
63 group.set_name( GetName().ToUTF8() );
64 group.set_locked( IsLocked() ? kiapi::common::types::LockedState::LS_LOCKED
65 : kiapi::common::types::LockedState::LS_UNLOCKED );
66
67 for( EDA_ITEM* member : sortedItems )
68 group.add_items()->set_value( member->m_Uuid.AsStdString() );
69
70 aContainer.PackFrom( group );
71}
72
73
74bool SCH_GROUP::Deserialize( const google::protobuf::Any& aContainer )
75{
76 using namespace kiapi::schematic::types;
77
78 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::FromUTF8( group.name() ) );
85 SetLocked( group.locked() == kiapi::common::types::LockedState::LS_LOCKED );
86
87 m_items.clear();
88
89 SCHEMATIC* schematic = Schematic();
90
91 if( !schematic )
92 return false;
93
94 for( const kiapi::common::types::KIID& memberId : group.items() )
95 {
96 KIID id( memberId.value() );
97
98 if( SCH_ITEM* item = schematic->ResolveItem( id, nullptr, true ) )
99 m_items.insert( item );
100 }
101
102 return true;
103}
104
105std::unordered_set<SCH_ITEM*> SCH_GROUP::GetSchItems() const
106{
107 std::unordered_set<SCH_ITEM*> items;
108
109 for( EDA_ITEM* item : m_items )
110 {
111 if( item->IsSCH_ITEM() )
112 items.insert( static_cast<SCH_ITEM*>( item ) );
113 }
114
115 return items;
116}
117
118
119/*
120 * @return if not in the symbol editor and aItem is in a symbol, returns the
121 * symbol's parent group. Otherwise, returns the aItem's parent group.
122 */
123EDA_GROUP* getClosestGroup( SCH_ITEM* aItem, bool isSymbolEditor )
124{
125 // In the schematic editor, items with either symbols or sheets as their parents (e.g., fields,
126 // pins, sheet pins, etc.) don't get their own groups and instead follow the group of their parent
127 // object.
128 if( !isSymbolEditor && aItem->GetParent() && aItem->GetParent()->Type() == SCH_SYMBOL_T )
129 return static_cast<SCH_SYMBOL*>( aItem->GetParent() )->GetParentGroup();
130 else if( aItem->GetParent() && aItem->GetParent()->Type() == SCH_SHEET_T )
131 return static_cast<SCH_SHEET*>( aItem->GetParent() )->GetParentGroup();
132 else
133 return aItem->GetParentGroup();
134}
135
136
138EDA_GROUP* getNestedGroup( SCH_ITEM* aItem, EDA_GROUP* aScope, bool isSymbolEditor )
139{
140 EDA_GROUP* group = getClosestGroup( aItem, isSymbolEditor );
141
142 if( group == aScope )
143 return nullptr;
144
145 while( group && group->AsEdaItem()->GetParentGroup() && group->AsEdaItem()->GetParentGroup() != aScope )
146 {
147 if( group->AsEdaItem()->GetParent()->Type() == LIB_SYMBOL_T && isSymbolEditor )
148 break;
149
150 group = group->AsEdaItem()->GetParentGroup();
151 }
152
153 return group;
154}
155
156
157EDA_GROUP* SCH_GROUP::TopLevelGroup( SCH_ITEM* aItem, EDA_GROUP* aScope, bool isSymbolEditor )
158{
159 return getNestedGroup( aItem, aScope, isSymbolEditor );
160}
161
162
163bool SCH_GROUP::WithinScope( SCH_ITEM* aItem, SCH_GROUP* aScope, bool isSymbolEditor )
164{
165 EDA_GROUP* group = getClosestGroup( aItem, isSymbolEditor );
166
167 if( group && group == aScope )
168 return true;
169
170 EDA_GROUP* nested = getNestedGroup( aItem, aScope, isSymbolEditor );
171
172 return nested && nested->AsEdaItem()->GetParentGroup() && nested->AsEdaItem()->GetParentGroup() == aScope;
173}
174
175
177{
178 return GetBoundingBox().Centre();
179}
180
181
182void SCH_GROUP::SetPosition( const VECTOR2I& aNewpos )
183{
184 VECTOR2I delta = aNewpos - GetPosition();
185
186 Move( delta );
187}
188
189
191{
192 // Use copy constructor to get the same uuid and other fields
193 SCH_GROUP* newGroup = new SCH_GROUP( *this );
194 return newGroup;
195}
196
197
199{
200 // Use copy constructor to get the same uuid and other fields
201 SCH_GROUP* newGroup = new SCH_GROUP( *this );
202 newGroup->m_items.clear();
203
204 for( EDA_ITEM* member : m_items )
205 {
206 if( member->Type() == SCH_GROUP_T )
207 newGroup->AddItem( static_cast<SCH_GROUP*>( member )->DeepClone() );
208 else
209 newGroup->AddItem( static_cast<SCH_ITEM*>( member->Clone() ) );
210 }
211
212 return newGroup;
213}
214
215
216SCH_GROUP* SCH_GROUP::DeepDuplicate( bool addToParentGroup, SCH_COMMIT* aCommit ) const
217{
218 SCH_GROUP* newGroup = static_cast<SCH_GROUP*>( Duplicate( addToParentGroup, aCommit ) );
219 newGroup->m_items.clear();
220
221 for( EDA_ITEM* member : m_items )
222 {
223 if( member->Type() == SCH_GROUP_T )
224 newGroup->AddItem( static_cast<SCH_GROUP*>( member )->DeepDuplicate( IGNORE_PARENT_GROUP ) );
225 else
226 newGroup->AddItem( static_cast<SCH_ITEM*>( member )->Duplicate( IGNORE_PARENT_GROUP ) );
227 }
228
229 return newGroup;
230}
231
232
234{
235 assert( aImage->Type() == SCH_GROUP_T );
236 SCH_GROUP* image = static_cast<SCH_GROUP*>( aImage );
237
238 std::swap( m_items, image->m_items );
239 std::swap( m_name, image->m_name );
240 std::swap( m_designBlockLibId, image->m_designBlockLibId );
241
242 // A group doesn't own its children (they're owned by the schematic), 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 [&]( SCH_ITEM* child )
249 {
250 child->SetParentGroup( image );
251 },
253
255 [&]( SCH_ITEM* child )
256 {
257 child->SetParentGroup( this );
258 },
260}
261
262
263bool SCH_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 SCH_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
278{
279 BOX2I bbox;
280
281 for( EDA_ITEM* item : m_items )
282 {
283 if( item->Type() == SCH_SYMBOL_T || item->Type() == LIB_SYMBOL_T )
284 bbox.Merge( static_cast<SYMBOL*>( item )->GetBoundingBox() );
285 else
286 bbox.Merge( item->GetBoundingBox() );
287 }
288
289 bbox.Inflate( schIUScale.MilsToIU( 10 ) );
290
291 return bbox;
292}
293
294
295INSPECT_RESULT SCH_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 ) )
304 }
305 }
306
308}
309
310
311std::vector<int> SCH_GROUP::ViewGetLayers() const
312{
313 return { LAYER_SCHEMATIC_ANCHOR };
314}
315
316
317double SCH_GROUP::ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const
318{
320 return LOD_SHOW;
321
322 return LOD_HIDE;
323}
324
325
326void SCH_GROUP::Move( const VECTOR2I& aMoveVector )
327{
328 for( EDA_ITEM* member : m_items )
329 {
330 EDA_ITEM_FLAGS flags = member->GetFlags();
331
332 if( member->Type() == SCH_LINE_T )
333 member->SetFlags( STARTPOINT | ENDPOINT );
334
335 static_cast<SCH_ITEM*>( member )->Move( aMoveVector );
336
337 member->SetFlags( flags );
338 }
339}
340
341
342void SCH_GROUP::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
343{
344 for( EDA_ITEM* member : m_items )
345 {
346 EDA_ITEM_FLAGS flags = member->GetFlags();
347
348 if( member->Type() == SCH_LINE_T )
349 member->SetFlags( STARTPOINT | ENDPOINT );
350
351 static_cast<SCH_ITEM*>( member )->Rotate( aCenter, aRotateCCW );
352
353 member->SetFlags( flags );
354 }
355}
356
357
359{
360 for( EDA_ITEM* member : m_items )
361 {
362 EDA_ITEM_FLAGS flags = member->GetFlags();
363
364 if( member->Type() == SCH_LINE_T )
365 member->SetFlags( STARTPOINT | ENDPOINT );
366
367 static_cast<SCH_ITEM*>( member )->MirrorHorizontally( aCenter );
368
369 member->SetFlags( flags );
370 }
371}
372
373
375{
376 for( EDA_ITEM* member : m_items )
377 {
378 EDA_ITEM_FLAGS flags = member->GetFlags();
379
380 if( member->Type() == SCH_LINE_T )
381 member->SetFlags( STARTPOINT | ENDPOINT );
382
383 static_cast<SCH_ITEM*>( member )->MirrorVertically( aCenter );
384
385 member->SetFlags( flags );
386 }
387}
388
389
390void SCH_GROUP::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
391 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
392{
393}
394
395
396wxString SCH_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 SCH_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
417
418bool SCH_GROUP::Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const
419{
420 return EDA_ITEM::Matches( UnescapeString( GetName() ), aSearchData );
421}
422
423
424void SCH_GROUP::RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction, RECURSE_MODE aMode )
425{
426 try
427 {
428 for( EDA_ITEM* item : m_items )
429 {
430 aFunction( static_cast<SCH_ITEM*>( item ) );
431
432 if( item->Type() == SCH_GROUP_T && aMode == RECURSE_MODE::RECURSE )
433 static_cast<SCH_GROUP*>( item )->RunOnChildren( aFunction, RECURSE_MODE::RECURSE );
434 }
435 }
436 catch( std::bad_function_call& )
437 {
438 wxFAIL_MSG( wxT( "Error calling function in SCH_GROUP::RunOnChildren" ) );
439 }
440}
441
442
443bool SCH_GROUP::operator==( const SCH_ITEM& aSchItem ) const
444{
445 if( aSchItem.Type() != Type() )
446 return false;
447
448 const SCH_GROUP& other = static_cast<const SCH_GROUP&>( aSchItem );
449
450 return *this == other;
451}
452
453
454bool SCH_GROUP::operator==( const SCH_GROUP& aOther ) const
455{
456 if( m_items.size() != aOther.m_items.size() )
457 return false;
458
459 // The items in groups are in unordered sets hashed by the pointer value, so we need to
460 // order them by UUID (EDA_ITEM_SET) to compare
461 EDA_ITEM_SET itemSet( m_items.begin(), m_items.end() );
462 EDA_ITEM_SET otherItemSet( aOther.m_items.begin(), aOther.m_items.end() );
463
464 for( auto it1 = itemSet.begin(), it2 = otherItemSet.begin(); it1 != itemSet.end(); ++it1, ++it2 )
465 {
466 // Compare UUID instead of the items themselves because we only care if the contents
467 // of the group has changed, not which elements in the group have changed
468 if( ( *it1 )->m_Uuid != ( *it2 )->m_Uuid )
469 return false;
470 }
471
472 return true;
473}
474
475
476double SCH_GROUP::Similarity( const SCH_ITEM& aOther ) const
477{
478 if( aOther.Type() != Type() )
479 return 0.0;
480
481 const SCH_GROUP& other = static_cast<const SCH_GROUP&>( aOther );
482
483 double similarity = 0.0;
484
485 for( EDA_ITEM* item : m_items )
486 {
487 for( EDA_ITEM* otherItem : other.m_items )
488 {
489 similarity += static_cast<SCH_ITEM*>( item )->Similarity( *static_cast<SCH_ITEM*>( otherItem ) );
490 }
491 }
492
493 return similarity / m_items.size();
494}
495
496
497static struct SCH_GROUP_DESC
498{
500 {
507
508 propMgr.Mask( TYPE_HASH( SCH_GROUP ), TYPE_HASH( SCH_ITEM ), _HKI( "Position X" ) );
509 propMgr.Mask( TYPE_HASH( SCH_GROUP ), TYPE_HASH( SCH_ITEM ), _HKI( "Position Y" ) );
510
511 const wxString groupTab = _HKI( "Group Properties" );
512
513 propMgr.AddProperty(
515 groupTab );
516 }
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:123
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:554
constexpr Vec Centre() const
Definition box2.h:93
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition box2.h:654
The base class for create windows for drawing purpose.
A set of EDA_ITEMs (i.e., without duplicates).
Definition eda_group.h:42
wxString m_name
Definition eda_group.h:78
std::unordered_set< EDA_ITEM * > m_items
Definition eda_group.h:77
wxString GetName() const
Definition eda_group.h:47
LIB_ID m_designBlockLibId
Definition eda_group.h:79
void AddItem(EDA_ITEM *aItem)
Add item to group.
Definition eda_group.cpp:58
virtual EDA_ITEM * AsEdaItem()=0
void SetName(const wxString &aName)
Definition eda_group.h:48
const KIID m_Uuid
Definition eda_item.h:531
virtual EDA_GROUP * GetParentGroup() const
Definition eda_item.h:114
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:108
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition eda_item.h:416
virtual void SetParentGroup(EDA_GROUP *aGroup)
Definition eda_item.h:113
EDA_ITEM * GetParent() const
Definition eda_item.h:110
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:37
static constexpr double LOD_HIDE
Return this constant from ViewGetLOD() to hide the item unconditionally.
Definition view_item.h:176
static constexpr double LOD_SHOW
Return this constant from ViewGetLOD() to show the item unconditionally.
Definition view_item.h:181
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Definition view.h:427
Definition kiid.h:44
Base plotter engine class.
Definition plotter.h:133
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.
Holds all the data relating to one schematic.
Definition schematic.h:90
A set of SCH_ITEMs (i.e., without duplicates).
Definition sch_group.h:48
SCH_GROUP * DeepDuplicate(bool addToParentGroup, SCH_COMMIT *aCommit=nullptr) const
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
std::vector< int > ViewGetLayers() const override
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition sch_group.cpp:74
static bool WithinScope(SCH_ITEM *aItem, SCH_GROUP *aScope, bool isSymbolEditor)
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
bool operator==(const SCH_GROUP &aOther) 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.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition sch_group.cpp:55
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
SCH_GROUP * DeepClone() const
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
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...
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode) override
void SetPosition(const VECTOR2I &aNewpos) override
std::unordered_set< SCH_ITEM * > GetSchItems() const
static EDA_GROUP * TopLevelGroup(SCH_ITEM *aItem, EDA_GROUP *aScope, bool isSymbolEditor)
void swapData(SCH_ITEM *aImage) override
Swap the internal data structures aItem with the schematic item.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
VECTOR2I GetPosition() const override
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:162
SCH_ITEM * Duplicate(bool addToParentGroup, SCH_COMMIT *aCommit=nullptr, bool doClone=false) const
Routine to create a new copy of given item.
Definition sch_item.cpp:160
void SetLocked(bool aLocked) override
Definition sch_item.h:251
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:268
bool IsLocked() const override
Definition sch_item.cpp:148
void SetLayer(SCH_LAYER_ID aLayer)
Definition sch_item.h:339
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:52
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:44
Schematic symbol object.
Definition sch_symbol.h:69
A base class for LIB_SYMBOL and SCH_SYMBOL.
Definition symbol.h:59
This file is part of the common library.
#define _(s)
RECURSE_MODE
Definition eda_item.h:48
@ RECURSE
Definition eda_item.h:49
@ NO_RECURSE
Definition eda_item.h:50
INSPECT_RESULT
Definition eda_item.h:42
std::set< EDA_ITEM *, CompareByUuid > EDA_ITEM_SET
Definition eda_item.h:585
const INSPECTOR_FUNC & INSPECTOR
std::function passed to nested users by ref, avoids copying std::function.
Definition eda_item.h:89
#define IGNORE_PARENT_GROUP
Definition eda_item.h:53
#define ENDPOINT
ends. (Used to support dragging.)
std::uint32_t EDA_ITEM_FLAGS
#define STARTPOINT
When a line is selected, these flags indicate which.
@ LAYER_SCHEMATIC_ANCHOR
Definition layer_ids.h:498
@ LAYER_GROUP
Definition layer_ids.h:501
Message panel definition file.
#define _HKI(x)
Definition page_info.cpp:40
#define TYPE_HASH(x)
Definition property.h:74
#define REGISTER_TYPE(x)
static struct SCH_GROUP_DESC _SCH_GROUP_DESC
EDA_GROUP * getNestedGroup(SCH_ITEM *aItem, EDA_GROUP *aScope, bool isSymbolEditor)
Returns the top level group inside the aScope group, or nullptr.
EDA_GROUP * getClosestGroup(SCH_ITEM *aItem, bool isSymbolEditor)
Class to handle a set of SCH_ITEMs.
wxString UnescapeString(const wxString &aSource)
int delta
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:71
@ SCH_GROUP_T
Definition typeinfo.h:170
@ SCH_LINE_T
Definition typeinfo.h:160
@ LIB_SYMBOL_T
Definition typeinfo.h:145
@ SCH_SYMBOL_T
Definition typeinfo.h:169
@ SCH_SHEET_T
Definition typeinfo.h:172
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683