KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_rule_area.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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <algorithm>
25#include <iterator>
26#include <map>
27#include <vector>
28
29#include <eda_draw_frame.h>
30#include <erc/erc_item.h>
31#include <erc/erc_settings.h>
34#include <sch_line.h>
35#include <sch_marker.h>
36#include <sch_rtree.h>
37#include <sch_rule_area.h>
38#include <sch_screen.h>
39#include <sch_sheet_path.h>
40#include <geometry/shape_rect.h>
41#include <properties/property.h>
43
44
46{
47 // Break bidirectional references so that items destroyed after this rule area
48 // don't try to call RemoveItem() on freed memory.
49 for( SCH_ITEM* item : m_items )
50 item->RemoveRuleAreaFromCache( this );
51
52 for( SCH_DIRECTIVE_LABEL* label : m_directives )
53 label->RemoveConnectedRuleArea( this );
54}
55
56
58{
59 return wxT( "SCH_RULE_AREA" );
60}
61
62
64{
65 return _( "Rule Area" );
66}
67
68
70{
71 return new SCH_RULE_AREA( *this );
72}
73
74
79
80
81std::vector<SHAPE*> SCH_RULE_AREA::MakeEffectiveShapes( bool aEdgeOnly ) const
82{
83 std::vector<SHAPE*> effectiveShapes;
84 int width = GetEffectiveWidth();
85
86 switch( m_shape )
87 {
88 case SHAPE_T::POLY:
89 if( GetPolyShape().OutlineCount() == 0 ) // malformed/empty polygon
90 break;
91
92 for( int ii = 0; ii < GetPolyShape().OutlineCount(); ++ii )
93 {
94 const SHAPE_LINE_CHAIN& l = GetPolyShape().COutline( ii );
95
96 if( IsSolidFill() && !aEdgeOnly )
97 effectiveShapes.emplace_back( new SHAPE_SIMPLE( l ) );
98
99 if( width > 0 || !IsSolidFill() || aEdgeOnly )
100 {
101 int segCount = l.SegmentCount();
102
103 for( int jj = 0; jj < segCount; jj++ )
104 effectiveShapes.emplace_back( new SHAPE_SEGMENT( l.CSegment( jj ), width ) );
105 }
106 }
107
108 break;
109
110 default:
111 return SCH_SHAPE::MakeEffectiveShapes( aEdgeOnly );
112 }
113
114 return effectiveShapes;
115}
116
117
118void SCH_RULE_AREA::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
119 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
120{
121 if( IsPrivate() )
122 return;
123
124 SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
125 int pen_size = GetEffectivePenWidth( renderSettings );
126
127 if( GetShape() != SHAPE_T::POLY )
128 SCH_SHAPE::Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
129
130 static std::vector<VECTOR2I> ptList;
131
132 ptList.clear();
133
134 const std::vector<VECTOR2I>& polyPoints = GetPolyShape().Outline( 0 ).CPoints();
135
136 for( const VECTOR2I& pt : polyPoints )
137 ptList.push_back( pt );
138
139 ptList.push_back( polyPoints[0] );
140
141 COLOR4D color = GetStroke().GetColor();
142 COLOR4D bg = renderSettings->GetBackgroundColor();
143 LINE_STYLE lineStyle = GetStroke().GetLineStyle();
144 FILL_T fill = m_fill;
145
146 if( aBackground )
147 {
148 if( !aPlotter->GetColorMode() )
149 return;
150
151 switch( m_fill )
152 {
154 return;
155
157 color = GetFillColor();
158 break;
159
161 color = renderSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
162 break;
163
164 default:
165 return;
166 }
167
168 pen_size = 0;
169 lineStyle = LINE_STYLE::SOLID;
170 }
171 else /* if( aForeground ) */
172 {
173 if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
174 color = renderSettings->GetLayerColor( m_layer );
175
176 if( lineStyle == LINE_STYLE::DEFAULT )
177 lineStyle = LINE_STYLE::SOLID;
178
180 fill = m_fill;
181 else
182 fill = FILL_T::NO_FILL;
183
184 pen_size = GetEffectivePenWidth( renderSettings );
185 }
186
187 if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
188 bg = COLOR4D::WHITE;
189
190 if( color.m_text && Schematic() )
191 color = COLOR4D( ResolveText( *color.m_text, &Schematic()->CurrentSheet() ) );
192
193 if( aDimmed )
194 {
195 color.Desaturate();
196 color = color.Mix( bg, 0.5f );
197 }
198
199 aPlotter->SetColor( color );
200 aPlotter->SetCurrentLineWidth( pen_size );
201 aPlotter->SetDash( pen_size, lineStyle );
202
203 aPlotter->PlotPoly( ptList, fill, pen_size, nullptr );
204
205 aPlotter->SetDash( pen_size, LINE_STYLE::SOLID );
206}
207
208
209wxString SCH_RULE_AREA::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
210{
211 return _( "Schematic rule area" );
212}
213
214
216{
217 // Save the current state
220
221 // Reset the rule area
222 // Do NOT assume these pointers are valid.
223 m_items.clear();
224 m_itemIDs.clear();
225 m_directives.clear();
226 m_directiveIDs.clear();
227}
228
229
231{
232 EE_RTREE& items = screen->Items();
234
235 // Get any SCH_DIRECTIVE_LABELs which are attached to the rule area border
236 std::unordered_set<SCH_DIRECTIVE_LABEL*> attachedDirectives;
237 EE_RTREE::EE_TYPE candidateDirectives = items.Overlapping( SCH_DIRECTIVE_LABEL_T, boundingBox );
238
239 for( SCH_ITEM* candidateDirective : candidateDirectives )
240 {
241 SCH_DIRECTIVE_LABEL* label = static_cast<SCH_DIRECTIVE_LABEL*>( candidateDirective );
242 const std::vector<VECTOR2I> labelConnectionPoints = label->GetConnectionPoints();
243 assert( labelConnectionPoints.size() == 1 );
244
245 if( GetPolyShape().CollideEdge( labelConnectionPoints[0], nullptr, 5 ) )
246 addDirective( label );
247 }
248
249 // Next find any connectable items which lie within the rule area
250 EE_RTREE::EE_TYPE ruleAreaItems = items.Overlapping( boundingBox );
251
252 for( SCH_ITEM* areaItem : ruleAreaItems )
253 {
254 if( areaItem->IsType( { SCH_ITEM_LOCATE_WIRE_T, SCH_ITEM_LOCATE_BUS_T } ) )
255 {
256 SCH_LINE* lineItem = static_cast<SCH_LINE*>( areaItem );
257 SHAPE_SEGMENT lineSeg( lineItem->GetStartPoint(), lineItem->GetEndPoint(),
258 lineItem->GetLineWidth() );
259
260 if( GetPolyShape().Collide( &lineSeg ) )
261 addContainedItem( areaItem );
262 }
263 else if( areaItem->IsType( { SCH_PIN_T, SCH_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T } ) )
264 {
265 std::vector<VECTOR2I> connectionPoints = areaItem->GetConnectionPoints();
266 wxASSERT( connectionPoints.size() == 1 );
267
268 if( GetPolyShape().Collide( connectionPoints[0] ) )
269 addContainedItem( areaItem );
270 }
271 else if( areaItem->IsType( { SCH_SYMBOL_T } ) )
272 {
273 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( areaItem );
274 const BOX2I symbolBb = symbol->GetBoundingBox();
275 const SHAPE_RECT rect( symbolBb );
276
277 if( GetPolyShape().Collide( &rect ) )
278 {
279 addContainedItem( areaItem );
280
281 // Add child pins which are within the rule area
282 for( SCH_PIN* pin : symbol->GetPins() )
283 {
284 if( GetPolyShape().Collide( pin->GetPosition() ) )
286 }
287 }
288 }
289 else if( areaItem->IsType( { SCH_SHEET_T } ) )
290 {
291 const BOX2I sheetBb = areaItem->GetBoundingBox();
292 const SHAPE_RECT rect( sheetBb );
293
294 if( GetPolyShape().Collide( &rect ) )
295 {
296 addContainedItem( areaItem );
297 }
298 }
299 }
300}
301
302
303std::vector<std::pair<SCH_RULE_AREA*, SCH_SCREEN*>>
304SCH_RULE_AREA::UpdateRuleAreasInScreens( std::unordered_set<SCH_SCREEN*>& screens, KIGFX::SCH_VIEW* view )
305{
306 std::vector<std::pair<SCH_RULE_AREA*, SCH_SCREEN*>> forceUpdateRuleAreas;
307
308 for( SCH_SCREEN* screen : screens )
309 {
310 // First reset all item caches - must be done first to ensure two rule areas
311 // on the same item don't overwrite each other's caches
312 for( SCH_ITEM* item : screen->Items() )
313 {
314 if( item->Type() == SCH_RULE_AREA_T )
315 static_cast<SCH_RULE_AREA*>( item )->resetCaches();
316
317 if( item->Type() == SCH_DIRECTIVE_LABEL_T && view )
318 view->Update( item, KIGFX::REPAINT );
319
320 item->ClearRuleAreasCache();
321 }
322
323 // Secondly refresh the contained items
324 for( SCH_ITEM* ruleAreaAsItem : screen->Items().OfType( SCH_RULE_AREA_T ) )
325 {
326 SCH_RULE_AREA* ruleArea = static_cast<SCH_RULE_AREA*>( ruleAreaAsItem );
327
328 ruleArea->RefreshContainedItemsAndDirectives( screen );
329
330 if( ruleArea->m_directiveIDs != ruleArea->m_prev_directives )
331 forceUpdateRuleAreas.push_back( { ruleArea, screen } );
332 }
333 }
334
335 return forceUpdateRuleAreas;
336}
337
338
339const std::unordered_set<SCH_ITEM*>& SCH_RULE_AREA::GetContainedItems() const
340{
341 return m_items;
342}
343
344
345const std::unordered_set<SCH_DIRECTIVE_LABEL*>& SCH_RULE_AREA::GetDirectives() const
346{
347 return m_directives;
348}
349
350
351const std::unordered_set<KIID>& SCH_RULE_AREA::GetPastContainedItems() const
352{
353 return m_prev_items;
354}
355
356
357const std::vector<std::pair<wxString, SCH_ITEM*>>
359{
360 std::vector<std::pair<wxString, SCH_ITEM*>> resolvedNetclasses;
361
362 for( SCH_DIRECTIVE_LABEL* directive : m_directives )
363 {
364 directive->RunOnChildren(
365 [&]( SCH_ITEM* aChild )
366 {
367 if( aChild->Type() == SCH_FIELD_T )
368 {
369 SCH_FIELD* field = static_cast<SCH_FIELD*>( aChild );
370
371 if( field->GetCanonicalName() == wxT( "Netclass" ) )
372 {
373 wxString netclass = field->GetShownText( aSheetPath, false );
374
375 if( netclass != wxEmptyString )
376 resolvedNetclasses.push_back( { netclass, directive } );
377 }
378 }
379
380 return true;
381 },
383 }
384
385 return resolvedNetclasses;
386}
387
388
389void SCH_RULE_AREA::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
390{
391 aList.emplace_back( _( "Rule Area" ), wxEmptyString );
392
393 wxString msg;
394 msg.Printf( wxS( "%d" ), GetPolyShape().Outline( 0 ).PointCount() );
395 aList.emplace_back( _( "Points" ), msg );
396
397 m_stroke.GetMsgPanelInfo( aFrame, aList );
398
399 const std::vector<std::pair<wxString, SCH_ITEM*>> netclasses = SCH_RULE_AREA::GetResolvedNetclasses( nullptr );
400 wxString resolvedNetclass = _( "<None>" );
401
402 if( netclasses.size() > 0 )
403 resolvedNetclass = netclasses[0].first;
404
405 aList.emplace_back( _( "Resolved netclass" ), resolvedNetclass );
406}
407
408
410{
411 label->AddConnectedRuleArea( this );
412 m_directives.insert( label );
413 m_directiveIDs.insert( label->m_Uuid );
414}
415
416
418{
419 item->AddRuleAreaToCache( this );
420 m_items.insert( item );
421 m_itemIDs.insert( item->m_Uuid );
422}
423
424
426{
427 m_items.erase( aItem );
428 m_prev_items.erase( aItem->m_Uuid );
429}
430
431
433{
434 m_directives.erase( aLabel );
435 m_prev_directives.erase( aLabel->m_Uuid );
436}
437
438
440{
442 {
451
452 const wxString groupAttributes = _HKI( "Attributes" );
453
454 propMgr.AddProperty( new PROPERTY<SCH_RULE_AREA, bool>( _HKI( "Exclude From Board" ),
457 groupAttributes );
458
459 propMgr.AddProperty( new PROPERTY<SCH_RULE_AREA, bool>( _HKI( "Exclude From Simulation" ),
462 groupAttributes );
463
464 propMgr.AddProperty( new PROPERTY<SCH_RULE_AREA, bool>( _HKI( "Exclude From Bill of Materials" ),
467 groupAttributes );
468
469 propMgr.AddProperty( new PROPERTY<SCH_RULE_AREA, bool>( _HKI( "Do not Populate" ), &SCH_RULE_AREA::SetDNPProp,
471 groupAttributes );
472 }
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
static const COLOR4D WHITE
Definition color4d.h:405
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:402
The base class for create windows for drawing purpose.
const KIID m_Uuid
Definition eda_item.h:528
KICAD_T Type() const
Returns the type of object.
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:41
SHAPE_T m_shape
Definition eda_shape.h:514
SHAPE_POLY_SET & GetPolyShape()
SHAPE_T GetShape() const
Definition eda_shape.h:181
bool IsSolidFill() const
Definition eda_shape.h:129
COLOR4D GetFillColor() const
Definition eda_shape.h:165
STROKE_PARAMS m_stroke
Definition eda_shape.h:515
FILL_T m_fill
Definition eda_shape.h:516
Implement an R-tree for fast spatial and type indexing of schematic items.
Definition sch_rtree.h:38
EE_TYPE Overlapping(const BOX2I &aRect) const
Definition sch_rtree.h:230
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:105
std::shared_ptr< wxString > m_text
Definition color4d.h:399
COLOR4D & Desaturate()
Removes color (in HSL model)
Definition color4d.cpp:532
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Definition color4d.h:296
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void Update(const KIGFX::VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition sch_view.cpp:60
Base plotter engine class.
Definition plotter.h:136
virtual void SetDash(int aLineWidth, LINE_STYLE aLineStyle)=0
bool GetColorMode() const
Definition plotter.h:164
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void PlotPoly(const std::vector< VECTOR2I > &aCornerList, FILL_T aFill, int aWidth, void *aData)=0
Draw a polygon ( filled or not ).
virtual void SetColor(const COLOR4D &color)=0
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.
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.
void AddConnectedRuleArea(SCH_RULE_AREA *aRuleArea)
Adds an entry to the connected rule area cache.
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0, const wxString &aVariantName=wxEmptyString) const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:168
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
Definition sch_item.h:730
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:269
bool IsPrivate() const
Definition sch_item.h:254
void AddRuleAreaToCache(SCH_RULE_AREA *aRuleArea)
Add a rule area to the item's cache.
Definition sch_item.h:677
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:56
wxString ResolveText(const wxString &aText, const SCH_SHEET_PATH *aPath, int aDepth=0) const
Definition sch_item.cpp:378
int GetEffectivePenWidth(const SCH_RENDER_SETTINGS *aSettings) const
Definition sch_item.cpp:789
SCH_LAYER_ID m_layer
Definition sch_item.h:781
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Segment description base class to describe items which have 2 end points (track, wire,...
Definition sch_line.h:42
VECTOR2I GetEndPoint() const
Definition sch_line.h:148
VECTOR2I GetStartPoint() const
Definition sch_line.h:139
int GetLineWidth() const
Definition sch_line.h:198
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
std::unordered_set< KIID > m_directiveIDs
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const override
Make a set of SHAPE objects representing the EDA_SHAPE.
const std::unordered_set< SCH_ITEM * > & GetContainedItems() const
Return a set of all items contained within the rule area.
void addContainedItem(SCH_ITEM *item)
Add an item to the list of items which this rule area affects.
std::unordered_set< KIID > m_prev_items
All SCH_ITEM objectss contained or intersecting the rule area in the previous update.
std::unordered_set< KIID > m_prev_directives
All SCH_DIRECTIVE_LABEL objects attached to the rule area border in the previous update.
void RefreshContainedItemsAndDirectives(SCH_SCREEN *screen)
Refresh the list of items which this rule area affects.
void SetExcludedFromBOMProp(bool aExcludeFromBOM)
void resetCaches()
Reset all item and directive caches, saving the current state first.
const std::unordered_set< SCH_DIRECTIVE_LABEL * > & GetDirectives() const
Return the set of all directive labels attached to the rule area border.
void addDirective(SCH_DIRECTIVE_LABEL *label)
Add a directive label which applies to items within ths rule area.
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
bool GetExcludedFromBoardProp() const
void SetExcludedFromSimProp(bool aExcludeFromSim)
wxString GetFriendlyName() const override
virtual 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.
std::unordered_set< SCH_DIRECTIVE_LABEL * > m_directives
All SCH_DIRECTIVE_LABEL objects attached to the rule area border. No ownership.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool GetExcludedFromSimProp() const
const std::vector< std::pair< wxString, SCH_ITEM * > > GetResolvedNetclasses(const SCH_SHEET_PATH *aSheetPath) const
Resolve the netclass of this rule area from connected directive labels.
static std::vector< std::pair< SCH_RULE_AREA *, SCH_SCREEN * > > UpdateRuleAreasInScreens(std::unordered_set< SCH_SCREEN * > &screens, KIGFX::SCH_VIEW *view)
Update all rule area connectvity / caches in the given sheet paths.
virtual ~SCH_RULE_AREA()
std::unordered_set< SCH_ITEM * > m_items
All SCH_ITEM objects currently contained or intersecting the rule area. No ownership.
const std::unordered_set< KIID > & GetPastContainedItems() const
void SetExcludedFromBoardProp(bool aExclude)
std::unordered_set< KIID > m_itemIDs
void RemoveDirective(SCH_DIRECTIVE_LABEL *aLabel)
Remove a directive label from this rule area's caches (called when the label is deleted).
bool GetExcludedFromBOMProp() const
bool GetDNPProp() const
wxString GetClass() const override
Return the class name.
void RemoveItem(SCH_ITEM *aItem)
Remove an item from this rule area's caches (called when the item is deleted).
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Get the message panel info for the rule area.
void SetDNPProp(bool aDNP)
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Definition sch_screen.h:119
std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const override
Make a set of SHAPE objects representing the SCH_SHAPE.
Definition sch_shape.h:112
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.
STROKE_PARAMS GetStroke() const override
Definition sch_shape.h:58
int GetEffectiveWidth() const override
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Schematic symbol object.
Definition sch_symbol.h:76
std::vector< const SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet) const
Retrieve a list of the SCH_PINs for the given sheet path.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int SegmentCount() const
Return the number of segments in this line chain.
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
const std::vector< VECTOR2I > & CPoints() const
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int OutlineCount() const
Return the number of outlines in the set.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
LINE_STYLE GetLineStyle() const
KIGFX::COLOR4D GetColor() const
#define _(s)
@ NO_RECURSE
Definition eda_item.h:54
FILL_T
Definition eda_shape.h:58
@ FILLED_WITH_COLOR
Definition eda_shape.h:62
@ NO_FILL
Definition eda_shape.h:59
@ FILLED_WITH_BG_BODYCOLOR
Definition eda_shape.h:61
@ FILLED_SHAPE
Fill with object color.
Definition eda_shape.h:60
@ LAYER_RULE_AREAS
Definition layer_ids.h:467
@ LAYER_DEVICE_BACKGROUND
Definition layer_ids.h:486
@ LAYER_NOTES_BACKGROUND
Definition layer_ids.h:471
@ LAYER_SELECTION_SHADOWS
Definition layer_ids.h:497
@ REPAINT
Item needs to be redrawn.
Definition view_item.h:58
#define _HKI(x)
Definition page_info.cpp:44
#define TYPE_HASH(x)
Definition property.h:74
#define REGISTER_TYPE(x)
static struct SCH_RULE_AREA_DESC _SCH_RULE_AREA_DESC
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
static bool Collide(const SHAPE_CIRCLE &aA, const SHAPE_CIRCLE &aB, int aClearance, int *aActual, VECTOR2I *aLocation, VECTOR2I *aMTV)
BOX2I boundingBox(T aObject, int aLayer)
Used by SHAPE_INDEX to get the bounding box of a generic T object.
Definition shape_index.h:62
LINE_STYLE
Dashed line types.
The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.
Definition sch_rtree.h:175
KIBIS_PIN * pin
@ SCH_FIELD_T
Definition typeinfo.h:151
@ SCH_DIRECTIVE_LABEL_T
Definition typeinfo.h:172
@ SCH_RULE_AREA_T
Definition typeinfo.h:171
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:687