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/api_utils.h>
21#include <api/schematic/schematic_types.pb.h>
22#include <google/protobuf/any.pb.h>
23#include <eda_draw_frame.h>
24#include <eda_group.h>
26#include <sch_item.h>
27#include <sch_group.h>
28#include <sch_screen.h>
29#include <schematic.h>
30#include <sch_symbol.h>
31#include <symbol.h>
32#include <confirm.h>
33#include <widgets/msgpanel.h>
34#include <view/view.h>
35
36#include <wx/debug.h>
37#include <properties/property.h>
39
44
46{
48}
49
54
55
56void SCH_GROUP::Serialize( google::protobuf::Any& aContainer ) const
57{
58 using namespace kiapi::schematic::types;
59
60 Group group;
61 EDA_ITEM_SET sortedItems( m_items.begin(), m_items.end() );
62
63 group.mutable_id()->set_value( m_Uuid.AsStdString() );
64 group.set_name( GetName().ToUTF8() );
65 group.set_locked( IsLocked() ? kiapi::common::types::LockedState::LS_LOCKED
66 : kiapi::common::types::LockedState::LS_UNLOCKED );
67
68 for( EDA_ITEM* member : sortedItems )
69 group.add_items()->set_value( member->m_Uuid.AsStdString() );
70
71 kiapi::common::PackCustomProperties( group.mutable_custom_properties(), *this );
72 aContainer.PackFrom( group );
73}
74
75
76bool SCH_GROUP::Deserialize( const google::protobuf::Any& aContainer )
77{
78 return DeserializeGroup( aContainer, nullptr );
79}
80
81bool SCH_GROUP::DeserializeGroup( const google::protobuf::Any& aContainer, COMMIT* aCommit )
82{
83 using namespace kiapi::schematic::types;
84
85 Group group;
86
87 if( !aContainer.UnpackTo( &group ) )
88 return false;
89
90 const_cast<KIID&>( m_Uuid ) = KIID( group.id().value() );
91 SetName( wxString::FromUTF8( group.name() ) );
92 SetLocked( group.locked() == kiapi::common::types::LockedState::LS_LOCKED );
93 kiapi::common::UnpackCustomProperties( group.custom_properties(), *this );
94
95 m_items.clear();
96
98
99 if( !schematic )
100 return false;
101
102 for( const kiapi::common::types::KIID& memberId : group.items() )
103 {
104 KIID id( memberId.value() );
105 EDA_ITEM* item = schematic->ResolveItem( id, nullptr, true );
106
107 if( !item && aCommit )
108 item = aCommit->ResolveItem( id );
109
110 if( item )
111 AddItem( item );
112 }
113
114 return true;
115}
116
117std::unordered_set<SCH_ITEM*> SCH_GROUP::GetSchItems() const
118{
119 std::unordered_set<SCH_ITEM*> items;
120
121 for( EDA_ITEM* item : m_items )
122 {
123 if( item->IsSCH_ITEM() )
124 items.insert( static_cast<SCH_ITEM*>( item ) );
125 }
126
127 return items;
128}
129
130
131/*
132 * @return if not in the symbol editor and aItem is in a symbol, returns the
133 * symbol's parent group. Otherwise, returns the aItem's parent group.
134 */
135EDA_GROUP* getClosestGroup( SCH_ITEM* aItem, bool isSymbolEditor )
136{
137 // In the schematic editor, items with either symbols or sheets as their parents (e.g., fields,
138 // pins, sheet pins, etc.) don't get their own groups and instead follow the group of their parent
139 // object.
140 if( !isSymbolEditor && aItem->GetParent() && aItem->GetParent()->Type() == SCH_SYMBOL_T )
141 return static_cast<SCH_SYMBOL*>( aItem->GetParent() )->GetParentGroup();
142 else if( aItem->GetParent() && aItem->GetParent()->Type() == SCH_SHEET_T )
143 return static_cast<SCH_SHEET*>( aItem->GetParent() )->GetParentGroup();
144 else
145 return aItem->GetParentGroup();
146}
147
148
150EDA_GROUP* getNestedGroup( SCH_ITEM* aItem, EDA_GROUP* aScope, bool isSymbolEditor )
151{
152 EDA_GROUP* group = getClosestGroup( aItem, isSymbolEditor );
153
154 if( group == aScope )
155 return nullptr;
156
157 while( group && group->AsEdaItem()->GetParentGroup() && group->AsEdaItem()->GetParentGroup() != aScope )
158 {
159 if( group->AsEdaItem()->GetParent()->Type() == LIB_SYMBOL_T && isSymbolEditor )
160 break;
161
162 group = group->AsEdaItem()->GetParentGroup();
163 }
164
165 return group;
166}
167
168
169EDA_GROUP* SCH_GROUP::TopLevelGroup( SCH_ITEM* aItem, EDA_GROUP* aScope, bool isSymbolEditor )
170{
171 return getNestedGroup( aItem, aScope, isSymbolEditor );
172}
173
174
175bool SCH_GROUP::WithinScope( SCH_ITEM* aItem, SCH_GROUP* aScope, bool isSymbolEditor )
176{
177 EDA_GROUP* group = getClosestGroup( aItem, isSymbolEditor );
178
179 if( group && group == aScope )
180 return true;
181
182 EDA_GROUP* nested = getNestedGroup( aItem, aScope, isSymbolEditor );
183
184 return nested && nested->AsEdaItem()->GetParentGroup() && nested->AsEdaItem()->GetParentGroup() == aScope;
185}
186
187
189{
190 return GetBoundingBox().Centre();
191}
192
193
194void SCH_GROUP::SetPosition( const VECTOR2I& aNewpos )
195{
196 VECTOR2I delta = aNewpos - GetPosition();
197
198 Move( delta );
199}
200
201
203{
204 // Use copy constructor to get the same uuid and other fields
205 SCH_GROUP* newGroup = new SCH_GROUP( *this );
206 return newGroup;
207}
208
209
211{
212 // Use copy constructor to get the same uuid and other fields
213 SCH_GROUP* newGroup = new SCH_GROUP( *this );
214 newGroup->m_items.clear();
215
216 for( EDA_ITEM* member : m_items )
217 {
218 if( member->Type() == SCH_GROUP_T )
219 newGroup->AddItem( static_cast<SCH_GROUP*>( member )->DeepClone() );
220 else
221 newGroup->AddItem( static_cast<SCH_ITEM*>( member->Clone() ) );
222 }
223
224 return newGroup;
225}
226
227
228SCH_GROUP* SCH_GROUP::DeepDuplicate( bool addToParentGroup, SCH_COMMIT* aCommit ) const
229{
230 SCH_GROUP* newGroup = static_cast<SCH_GROUP*>( Duplicate( addToParentGroup, aCommit ) );
231 newGroup->m_items.clear();
232
233 for( EDA_ITEM* member : m_items )
234 {
235 if( member->Type() == SCH_GROUP_T )
236 newGroup->AddItem( static_cast<SCH_GROUP*>( member )->DeepDuplicate( IGNORE_PARENT_GROUP ) );
237 else
238 newGroup->AddItem( static_cast<SCH_ITEM*>( member )->Duplicate( IGNORE_PARENT_GROUP ) );
239 }
240
241 return newGroup;
242}
243
244
246{
247 assert( aImage->Type() == SCH_GROUP_T );
248 SCH_GROUP* image = static_cast<SCH_GROUP*>( aImage );
249
250 std::swap( m_items, image->m_items );
251 std::swap( m_name, image->m_name );
252 std::swap( m_designBlockLibId, image->m_designBlockLibId );
253
254 // A group doesn't own its children (they're owned by the schematic), so undo doesn't do a
255 // deep clone when making an image. However, it's still safest to update the parentGroup
256 // pointers of the group's children. We must do it in the right order in case any of the
257 // children are shared (ie: image first, "this" second so that any shared children end up
258 // with "this").
259 image->RunOnChildren(
260 [&]( SCH_ITEM* child )
261 {
262 child->SetParentGroup( image );
263 },
265
267 [&]( SCH_ITEM* child )
268 {
269 child->SetParentGroup( this );
270 },
272}
273
274
275bool SCH_GROUP::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
276{
277 // Groups are selected by promoting a selection of one of their children
278 return false;
279}
280
281
282bool SCH_GROUP::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
283{
284 // Groups are selected by promoting a selection of one of their children
285 return false;
286}
287
288
290{
291 BOX2I bbox;
292
293 for( EDA_ITEM* item : m_items )
294 {
295 if( item->Type() == SCH_SYMBOL_T || item->Type() == LIB_SYMBOL_T )
296 bbox.Merge( static_cast<SYMBOL*>( item )->GetBoundingBox() );
297 else
298 bbox.Merge( item->GetBoundingBox() );
299 }
300
301 bbox.Inflate( schIUScale.MilsToIU( 10 ) );
302
303 return bbox;
304}
305
306
307INSPECT_RESULT SCH_GROUP::Visit( INSPECTOR aInspector, void* aTestData,
308 const std::vector<KICAD_T>& aScanTypes )
309{
310 for( KICAD_T scanType : aScanTypes )
311 {
312 if( scanType == Type() )
313 {
314 if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
316 }
317 }
318
320}
321
322
323std::vector<int> SCH_GROUP::ViewGetLayers() const
324{
325 return { LAYER_SCHEMATIC_ANCHOR };
326}
327
328
329double SCH_GROUP::ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const
330{
332 return LOD_SHOW;
333
334 return LOD_HIDE;
335}
336
337
338void SCH_GROUP::Move( const VECTOR2I& aMoveVector )
339{
340 for( EDA_ITEM* member : m_items )
341 {
342 EDA_ITEM_FLAGS flags = member->GetFlags();
343
344 if( member->Type() == SCH_LINE_T )
345 member->SetFlags( STARTPOINT | ENDPOINT );
346
347 static_cast<SCH_ITEM*>( member )->Move( aMoveVector );
348
349 member->SetFlags( flags );
350 }
351}
352
353
354void SCH_GROUP::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
355{
356 for( EDA_ITEM* member : m_items )
357 {
358 EDA_ITEM_FLAGS flags = member->GetFlags();
359
360 if( member->Type() == SCH_LINE_T )
361 member->SetFlags( STARTPOINT | ENDPOINT );
362
363 static_cast<SCH_ITEM*>( member )->Rotate( aCenter, aRotateCCW );
364
365 member->SetFlags( flags );
366 }
367}
368
369
371{
372 for( EDA_ITEM* member : m_items )
373 {
374 EDA_ITEM_FLAGS flags = member->GetFlags();
375
376 if( member->Type() == SCH_LINE_T )
377 member->SetFlags( STARTPOINT | ENDPOINT );
378
379 static_cast<SCH_ITEM*>( member )->MirrorHorizontally( aCenter );
380
381 member->SetFlags( flags );
382 }
383}
384
385
387{
388 for( EDA_ITEM* member : m_items )
389 {
390 EDA_ITEM_FLAGS flags = member->GetFlags();
391
392 if( member->Type() == SCH_LINE_T )
393 member->SetFlags( STARTPOINT | ENDPOINT );
394
395 static_cast<SCH_ITEM*>( member )->MirrorVertically( aCenter );
396
397 member->SetFlags( flags );
398 }
399}
400
401
402void SCH_GROUP::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
403 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
404{
405}
406
407
408wxString SCH_GROUP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
409{
410 if( m_name.empty() )
411 return wxString::Format( _( "Unnamed Group, %zu members" ), m_items.size() );
412 else
413 return wxString::Format( _( "Group '%s', %zu members" ), m_name, m_items.size() );
414}
415
416
418{
419 return BITMAPS::module;
420}
421
422
423void SCH_GROUP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
424{
425 aList.emplace_back( _( "Group" ), m_name.empty() ? _( "<unnamed>" ) : m_name );
426 aList.emplace_back( _( "Members" ), wxString::Format( wxT( "%zu" ), m_items.size() ) );
427}
428
429
430bool SCH_GROUP::Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxData ) const
431{
432 return EDA_ITEM::Matches( UnescapeString( GetName() ), aSearchData );
433}
434
435
436void SCH_GROUP::RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction, RECURSE_MODE aMode )
437{
438 try
439 {
440 for( EDA_ITEM* item : m_items )
441 {
442 aFunction( static_cast<SCH_ITEM*>( item ) );
443
444 if( item->Type() == SCH_GROUP_T && aMode == RECURSE_MODE::RECURSE )
445 static_cast<SCH_GROUP*>( item )->RunOnChildren( aFunction, RECURSE_MODE::RECURSE );
446 }
447 }
448 catch( std::bad_function_call& )
449 {
450 wxFAIL_MSG( wxT( "Error calling function in SCH_GROUP::RunOnChildren" ) );
451 }
452}
453
454
455bool SCH_GROUP::operator==( const SCH_ITEM& aSchItem ) const
456{
457 if( aSchItem.Type() != Type() )
458 return false;
459
460 const SCH_GROUP& other = static_cast<const SCH_GROUP&>( aSchItem );
461
462 return *this == other;
463}
464
465
466bool SCH_GROUP::operator==( const SCH_GROUP& aOther ) const
467{
468 if( m_items.size() != aOther.m_items.size() )
469 return false;
470
471 // The items in groups are in unordered sets hashed by the pointer value, so we need to
472 // order them by UUID (EDA_ITEM_SET) to compare
473 EDA_ITEM_SET itemSet( m_items.begin(), m_items.end() );
474 EDA_ITEM_SET otherItemSet( aOther.m_items.begin(), aOther.m_items.end() );
475
476 for( auto it1 = itemSet.begin(), it2 = otherItemSet.begin(); it1 != itemSet.end(); ++it1, ++it2 )
477 {
478 // Compare UUID instead of the items themselves because we only care if the contents
479 // of the group has changed, not which elements in the group have changed
480 if( ( *it1 )->m_Uuid != ( *it2 )->m_Uuid )
481 return false;
482 }
483
484 return true;
485}
486
487
488double SCH_GROUP::Similarity( const SCH_ITEM& aOther ) const
489{
490 if( aOther.Type() != Type() )
491 return 0.0;
492
493 const SCH_GROUP& other = static_cast<const SCH_GROUP&>( aOther );
494
495 double similarity = 0.0;
496
497 for( EDA_ITEM* item : m_items )
498 {
499 for( EDA_ITEM* otherItem : other.m_items )
500 {
501 similarity += static_cast<SCH_ITEM*>( item )->Similarity( *static_cast<SCH_ITEM*>( otherItem ) );
502 }
503 }
504
505 return similarity / m_items.size();
506}
507
508
509static struct SCH_GROUP_DESC
510{
512 {
519
520 propMgr.Mask( TYPE_HASH( SCH_GROUP ), TYPE_HASH( SCH_ITEM ), _HKI( "Position X" ) );
521 propMgr.Mask( TYPE_HASH( SCH_GROUP ), TYPE_HASH( SCH_ITEM ), _HKI( "Position Y" ) );
522
523 const wxString groupTab = _HKI( "Group Properties" );
524
525 propMgr.AddProperty( new PROPERTY<EDA_GROUP, wxString>( _HKI( "Name" ),
527 groupTab );
528 }
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:123
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:927
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:553
constexpr Vec Centre() const
Definition box2.h:94
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition box2.h:653
Represent a set of changes (additions, deletions or modifications) of a data model (e....
Definition commit.h:68
virtual EDA_ITEM * ResolveItem(KIID &aID)=0
Search for an item in this commit that matches the provided KIID.
The base class for create windows for drawing purpose.
A set of EDA_ITEMs (i.e., without duplicates).
Definition eda_group.h:43
wxString m_name
Definition eda_group.h:92
std::unordered_set< EDA_ITEM * > m_items
Definition eda_group.h:91
wxString GetName() const
Definition eda_group.h:61
LIB_ID m_designBlockLibId
Definition eda_group.h:93
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:62
const KIID m_Uuid
Definition eda_item.h:597
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:482
virtual void SetParentGroup(EDA_GROUP *aGroup)
Definition eda_item.h:115
EDA_ITEM * GetParent() const
Definition eda_item.h:112
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Definition eda_item.cpp:84
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:46
Base plotter engine class.
Definition plotter.h:136
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:148
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.
bool DeserializeGroup(const google::protobuf::Any &aContainer, COMMIT *aCommit) override
Deserializes the given protobuf message into this group.
Definition sch_group.cpp:81
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:76
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:56
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:165
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:170
void SetLocked(bool aLocked) override
Definition sch_item.h:256
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:281
bool IsLocked() const override
Definition sch_item.cpp:158
void SetLayer(SCH_LAYER_ID aLayer)
Definition sch_item.h:346
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:48
Schematic symbol object.
Definition sch_symbol.h:75
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: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:658
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
#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:522
@ LAYER_GROUP
Definition layer_ids.h:525
Message panel definition file.
KICOMMON_API void PackCustomProperties(google::protobuf::RepeatedPtrField< types::CustomProperty > *aOutput, const EDA_ITEM &aItem)
KICOMMON_API void UnpackCustomProperties(const google::protobuf::RepeatedPtrField< types::CustomProperty > &aInput, EDA_ITEM &aItem)
#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:70
@ SCH_GROUP_T
Definition typeinfo.h:169
@ SCH_LINE_T
Definition typeinfo.h:159
@ LIB_SYMBOL_T
Definition typeinfo.h:144
@ SCH_SYMBOL_T
Definition typeinfo.h:168
@ SCH_SHEET_T
Definition typeinfo.h:171
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683