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