KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_marker.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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
23#include <google/protobuf/any.pb.h>
24#include <api/api_enums.h>
25#include <api/api_utils.h>
26#include <api/board/board_rules.pb.h>
27#include <bitmaps.h>
28#include <base_units.h>
29#include <eda_draw_frame.h>
30#include <board.h>
32#include <pcb_marker.h>
33#include <layer_ids.h>
36#include <geometry/shape_null.h>
37#include <widgets/ui_common.h>
39#include <pgm_base.h>
40#include <drc/drc_item.h>
41#include <drc/drc_rule.h>
42#include <trigo.h>
43#include <properties/property.h>
45
46
48#define SCALING_FACTOR pcbIUScale.mmToIU( 0.1625 )
49
50
51
52PCB_MARKER::PCB_MARKER( std::shared_ptr<DRC_ITEM> aItem, const VECTOR2I& aPosition, int aLayer ) :
53 BOARD_ITEM( nullptr, PCB_MARKER_T, F_Cu ), // parent set during BOARD::Add()
54 MARKER_BASE( SCALING_FACTOR, std::move( aItem ) ),
55 m_pathLength( 0 )
56{
57 if( m_rcItem )
58 {
59 m_rcItem->SetParent( this );
60
61 if( aLayer == LAYER_DRAWINGSHEET )
62 {
64 }
65 else
66 {
67 switch( m_rcItem->GetErrorCode() )
68 {
71 break;
72
81 break;
82
83 default:
85 break;
86 }
87
88 SetLayer( ToLAYER_ID( aLayer ) );
89 }
90 }
91
92 m_Pos = aPosition;
93}
94
95
97{
98 if( m_rcItem )
99 m_rcItem->SetParent( nullptr );
100}
101
102
103void PCB_MARKER::ToProto( kiapi::board::DrcMarker& aMsg, const PCB_MARKER& aMarker )
104{
105 std::shared_ptr<DRC_ITEM> drc = std::static_pointer_cast<DRC_ITEM>( aMarker.GetRCItem() );
106
107 aMsg.set_error_type(
109
110 kiapi::common::PackVector2( *aMsg.mutable_position(), aMarker.GetPos() );
111
112 for( const KIID& id : drc->GetIDs() )
113 {
114 if( id != niluuid )
115 aMsg.add_items()->set_value( id.AsStdString() );
116 }
117
118 aMsg.set_marker_type(
120
121 // Only store the layer for error types where it affects identity.
122 bool storeLayer = false;
123
124 switch( drc->GetErrorCode() )
125 {
131 storeLayer = true;
132 break;
133
134 default:
135 break;
136 }
137
138 if( storeLayer )
139 {
140 PCB_LAYER_ID layer = aMarker.GetLayer();
141
142 if( layer == UNDEFINED_LAYER )
143 layer = F_Cu;
144
146 }
147
148 if( const DRC_RULE* rule = drc->GetViolatingRule() )
149 aMsg.set_violating_rule( rule->m_Name.ToUTF8() );
150
151 aMsg.set_description( HYPERLINK_DV_RENDERER::StripMarkup( drc->GetErrorMessage( false ) ).ToUTF8() );
152
153 if( aMarker.GetBoard() )
154 {
156 aMsg.set_excluded( aMarker.IsTreatedAsExcluded() );
157 }
158 else if( aMarker.IsExcluded() )
159 {
161 aMsg.set_excluded( true );
162 }
163}
164
165
166PCB_MARKER* PCB_MARKER::FromProto( const kiapi::board::DrcMarker& aMsg )
167{
169
170 std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( code );
171
172 if( !drcItem )
173 return nullptr;
174
175 VECTOR2I pos = kiapi::common::UnpackVector2( aMsg.position() );
177
178 // MarkerType will be set by the c'tor, based on the PCB_DRC_CODE and the layer. Since the
179 // LAYER_DRAWINGSHEET can't be represented in a PCB_LAYER_ID (it's a GAL_LAYER_ID), we have
180 // to give that one a little bit of help.
181 if( aMsg.marker_type() == kiapi::common::types::MT_DRAWING_SHEET )
182 layer = LAYER_DRAWINGSHEET;
183
184 PCB_MARKER* marker = new PCB_MARKER( drcItem, pos, layer );
185
186 KIID mainId = aMsg.items_size() > 0 ? KIID( aMsg.items( 0 ).value() ) : niluuid;
187 KIID auxId = aMsg.items_size() > 1 ? KIID( aMsg.items( 1 ).value() ) : niluuid;
188 KIID aux2Id = aMsg.items_size() > 2 ? KIID( aMsg.items( 2 ).value() ) : niluuid;
189 KIID aux3Id = aMsg.items_size() > 3 ? KIID( aMsg.items( 3 ).value() ) : niluuid;
190
191 marker->GetRCItem()->SetItems( mainId, auxId, aux2Id, aux3Id );
192
193 return marker;
194}
195
196
197void PCB_MARKER::Serialize( google::protobuf::Any& aContainer ) const
198{
199 kiapi::board::DrcMarker msg;
200 ToProto( msg, *this );
201
202 if( !aContainer.PackFrom( msg ) )
203 wxFAIL_MSG( wxT( "Failed to pack PCB_MARKER" ) );
204}
205
206
207bool PCB_MARKER::Deserialize( const google::protobuf::Any& aContainer )
208{
209 kiapi::board::DrcMarker msg;
210
211 if( !aContainer.UnpackTo( &msg ) )
212 return false;
213
214 std::unique_ptr<PCB_MARKER> tmp( PCB_MARKER::FromProto( msg ) );
215
216 if( !tmp )
217 return false;
218
219 swapData( tmp.get() );
220 return true;
221}
222
223
225{
226 auto getMarkerLayer =
227 []( const wxString& layerName ) -> int
228 {
229 for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer )
230 {
231 if( LayerName( ToLAYER_ID( layer ) ) == layerName )
232 return layer;
233 }
234
235 return F_Cu;
236 };
237
238 wxArrayString props = wxSplit( aData, '|' );
239
240 // Every legacy marker has a settings key, position and at least two item fields.
241 // Reject truncated settings rather than indexing past wxArrayString below.
242 if( props.size() < 5 )
243 return nullptr;
244
245 int markerLayer = F_Cu;
246 VECTOR2I markerPos( (int) strtol( props[1].c_str(), nullptr, 10 ),
247 (int) strtol( props[2].c_str(), nullptr, 10 ) );
248
249 std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( props[0] );
250
251 if( !drcItem )
252 return nullptr;
253
254 if( drcItem->GetErrorCode() == DRCE_COPPER_SLIVER
255 || drcItem->GetErrorCode() == DRCE_GENERIC_WARNING
256 || drcItem->GetErrorCode() == DRCE_GENERIC_ERROR )
257 {
258 drcItem->SetItems( KIID( props[3] ) );
259 markerLayer = getMarkerLayer( props[4] );
260 }
261 else if( drcItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS )
262 {
263 // Pre-9.0.4 versions didn't have KIIDs as last two properties to allow sorting stability
264 if( props.size() == 5 )
265 drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) );
266 else if( props.size() >= 7 )
267 drcItem->SetItems( KIID( props[5] ), KIID( props[6] ) );
268 else
269 return nullptr;
270 }
271 else if( drcItem->GetErrorCode() == DRCE_STARVED_THERMAL )
272 {
273 drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) );
274
275 // Pre-7.0 versions didn't differentiate between layers
276 if( props.size() == 6 )
277 markerLayer = getMarkerLayer( props[5] );
278 }
279 else if( drcItem->GetErrorCode() == DRCE_UNRESOLVED_VARIABLE
280 && props[3].IsEmpty()
281 && props[4].IsEmpty() )
282 {
283 // Note: caller must load our item pointer with the drawing sheet proxy item
284 markerLayer = LAYER_DRAWINGSHEET;
285 }
286 else
287 {
288 drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) );
289 }
290
291 return new PCB_MARKER( drcItem, markerPos, markerLayer );
292}
293
294
296{
297 PCB_MARKER* res = new PCB_MARKER( *this );
298
299 // An RC_ITEM is shared between its marker and various tree views. It cannot be shared between
300 // two markers.
301 if( m_rcItem )
302 {
303 res->m_rcItem = std::make_shared<DRC_ITEM>( *std::static_pointer_cast<DRC_ITEM>( m_rcItem ) );
304 res->m_rcItem->SetParent( res );
305 }
306
307 return res;
308}
309
310
312{
313 wxASSERT( aImage->Type() == PCB_MARKER_T );
314 PCB_MARKER* image = static_cast<PCB_MARKER*>( aImage );
315
316 std::swap( *this, *image );
317
318 if( m_rcItem )
319 m_rcItem->SetParent( this );
320
321 if( image->m_rcItem )
322 image->m_rcItem->SetParent( image );
323}
324
325
326void PCB_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
327{
328 aList.emplace_back( _( "Type" ), _( "Marker" ) );
329 aList.emplace_back( _( "Violation" ), HYPERLINK_DV_RENDERER::StripMarkup( m_rcItem->GetErrorMessage( true ) ) );
330
331 switch( GetSeverity() )
332 {
333 case RPT_SEVERITY_IGNORE: aList.emplace_back( _( "Severity" ), _( "Ignore" ) ); break;
334 case RPT_SEVERITY_WARNING: aList.emplace_back( _( "Severity" ), _( "Warning" ) ); break;
335 case RPT_SEVERITY_ERROR: aList.emplace_back( _( "Severity" ), _( "Error" ) ); break;
336 default: break;
337 }
338
340 {
341 aList.emplace_back( _( "Drawing Sheet" ), wxEmptyString );
342 }
343 else
344 {
345 wxString mainText;
346 wxString auxText;
347 EDA_ITEM* mainItem = aFrame->ResolveItem( m_rcItem->GetMainItemID() );
348 EDA_ITEM* auxItem = aFrame->ResolveItem( m_rcItem->GetAuxItemID() );
349
350 if( mainItem )
351 mainText = mainItem->GetItemDescription( aFrame, true );
352
353 if( auxItem )
354 auxText = auxItem->GetItemDescription( aFrame, true );
355
356 aList.emplace_back( mainText, auxText );
357 }
358
359 if( IsExcluded() )
360 aList.emplace_back( _( "Excluded" ), m_comment );
361}
362
363
364void PCB_MARKER::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
365{
366 // Marker geometry isn't user-editable
367}
368
369
370void PCB_MARKER::Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
371{
372 // Marker geometry isn't user-editable
373}
374
375
377{
378 // Markers do not participate in the board geometry space, and therefore have no effective shape.
379 return std::make_shared<SHAPE_NULL>();
380}
381
382
383double PCB_MARKER::GetCoverageArea( int aTextMargin ) const
384{
385 SHAPE_LINE_CHAIN markerShape;
386 ShapeToPolygon( markerShape );
387 return markerShape.Area();
388}
389
390
392 int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth ) const
393{
394 // Markers do not participate in the board geometry space, and therefore have no shape.
395};
396
397
398wxString PCB_MARKER::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
399{
400 return wxString::Format( _( "Marker (%s)" ), aFull ? m_rcItem->GetErrorMessage( true )
401 : m_rcItem->GetErrorText( true ) );
402}
403
404
406{
407 return BITMAPS::drc;
408}
409
410
412{
413 if( IsExcluded() )
415
416 DRC_ITEM* item = static_cast<DRC_ITEM*>( m_rcItem.get() );
417
418 if( item->GetErrorCode() == DRCE_GENERIC_WARNING )
420 else if( item->GetErrorCode() == DRCE_GENERIC_ERROR )
421 return RPT_SEVERITY_ERROR;
422
423 DRC_RULE* rule = item->GetViolatingRule();
424
425 if( rule && rule->m_Severity != RPT_SEVERITY_UNDEFINED )
426 return rule->m_Severity;
427
428 return GetBoard()->GetDesignSettings().GetSeverity( item->GetErrorCode() );
429}
430
431
432std::vector<int> PCB_MARKER::ViewGetLayers() const
433{
435 return {};
436
437 std::vector<int> layers{ 0, LAYER_MARKER_SHADOWS, LAYER_DRC_HIGHLIGHTED };
438
439 switch( GetSeverity() )
440 {
441 default:
442 case SEVERITY::RPT_SEVERITY_ERROR: layers[0] = LAYER_DRC_ERROR; break;
443 case SEVERITY::RPT_SEVERITY_WARNING: layers[0] = LAYER_DRC_WARNING; break;
445 }
446
447 return layers;
448}
449
450
461
462
464{
465 return ::GetColorSettings( DEFAULT_THEME )->GetColor( GetColorLayer() );
466}
467
468
469void PCB_MARKER::SetZoom( double aZoomFactor ) const
470{
471 SetMarkerScale( SCALING_FACTOR * aZoomFactor );
472}
473
474
475std::vector<PCB_SHAPE> PCB_MARKER::GetErrorLegendShapes() const
476{
477 STROKE_PARAMS hairline( 1.0 ); // Segments of width 1.0 will get drawn as lines by PCB_PAINTER
478 std::vector<PCB_SHAPE> pathShapes;
479
480 if( m_pathStart == m_pathEnd )
481 {
482 // Add a collision 'X'
483 const int len = KiROUND( 2.5 * MarkerScale() );
484
485 PCB_SHAPE s( nullptr, SHAPE_T::SEGMENT );
486 s.SetStroke( hairline );
487
488 s.SetStart( m_pathStart + VECTOR2I( -len, -len ) );
489 s.SetEnd( m_pathStart + VECTOR2I( len, len ) );
490 pathShapes.push_back( s );
491
492 s.SetStart( m_pathStart + VECTOR2I( -len, len ) );
493 s.SetEnd( m_pathStart + VECTOR2I( len, -len ) );
494 pathShapes.push_back( s );
495 }
496 else
497 {
498 // Add the path
499 for( PCB_SHAPE shape : m_pathShapes )
500 {
501 shape.SetStroke( hairline );
502 pathShapes.push_back( std::move( shape ) );
503 }
504
505 // Draw perpendicular begin/end stops
506 if( pathShapes.size() > 0 )
507 {
508 VECTOR2I V1 = pathShapes[0].GetStart() - pathShapes[0].GetEnd();
509 VECTOR2I V2 = pathShapes.back().GetStart() - pathShapes.back().GetEnd();
510 V1 = V1.Perpendicular().Resize( 2.5 * MarkerScale() );
511 V2 = V2.Perpendicular().Resize( 2.5 * MarkerScale() );
512
513 PCB_SHAPE s( nullptr, SHAPE_T::SEGMENT );
514 s.SetStroke( hairline );
515
516 s.SetStart( m_pathStart + V1 );
517 s.SetEnd( m_pathStart - V1 );
518 pathShapes.push_back( s );
519
520 s.SetStart( m_pathEnd + V2 );
521 s.SetEnd( m_pathEnd - V2 );
522 pathShapes.push_back( s );
523 }
524 }
525
526 // Add shaded areas
527 for( PCB_SHAPE shape : m_pathShapes )
528 {
529 shape.SetWidth( 10 * MarkerScale() );
530 pathShapes.push_back( std::move( shape ) );
531 }
532
533 return pathShapes;
534}
535
536
538{
540
541 for( const PCB_SHAPE& s : m_pathShapes )
542 box.Merge( s.GetBoundingBox() );
543
544 return box;
545}
546
547
549{
550 return GetBoundingBox();
551}
552
553
554static struct PCB_MARKER_DESC
555{
557 {
564
565 // Markers cannot be locked and have no user-accessible layer control
566 propMgr.Mask( TYPE_HASH( PCB_MARKER ), TYPE_HASH( BOARD_ITEM ), _HKI( "Layer" ) );
567 propMgr.Mask( TYPE_HASH( PCB_MARKER ), TYPE_HASH( BOARD_ITEM ), _HKI( "Locked" ) );
568 }
KICOMMON_API types::KiCadObjectType ToProtoEnum(KICAD_T aValue)
KICOMMON_API KICAD_T FromProtoEnum(types::KiCadObjectType aValue)
Definition api_enums.cpp:56
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:917
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:985
SEVERITY GetSeverity(int aDRCErrorCode) const
Return the severity of a given DRC error code.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:99
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
Definition board_item.h:101
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition board_item.h:397
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
BOARD_DESIGN_SETTINGS & GetDesignSettings()
Definition board.cpp:1318
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition box2.h:597
DRC_RULE * GetViolatingRule() const
Definition drc_item.h:192
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
Definition drc_item.cpp:505
SEVERITY m_Severity
Definition drc_rule.h:86
The base class for create windows for drawing purpose.
virtual EDA_ITEM * ResolveItem(const KIID &aId, bool aAllowNullptrReturn=false) const
Fetch an item by KIID.
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
Definition eda_item.cpp:314
KICAD_T Type() const
Returns the type of object.
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:84
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
Definition kiid.h:46
Marker are mainly used to show a DRC or ERC error or warning.
Definition marker_base.h:44
void SetMarkerScale(int aScale) const
Definition marker_base.h:64
bool IsExcluded() const
Definition marker_base.h:88
std::shared_ptr< RC_ITEM > GetRCItem() const
wxString m_comment
User supplied comment.
int MarkerScale() const
The scaling factor to convert polygonal shape coordinates to internal units.
Definition marker_base.h:63
const VECTOR2I & GetPos() const
Definition marker_base.h:78
VECTOR2I m_Pos
Position of the marker.
bool IsTreatedAsExcluded() const
A marker is treated as excluded when the user has dismissed it through the DRC UI (m_excluded) or whe...
@ MARKER_DRAWING_SHEET
Definition marker_base.h:51
void SetMarkerType(enum MARKER_T aMarkerType)
Accessors to set/get marker type (DRC, ERC, or other)
Definition marker_base.h:85
std::shared_ptr< RC_ITEM > m_rcItem
enum MARKER_T GetMarkerType() const
Definition marker_base.h:86
void ShapeToPolygon(SHAPE_LINE_CHAIN &aPolygon, int aScale=-1) const
Return the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to the...
MARKER_BASE(int aScalingFactor, std::shared_ptr< RC_ITEM > aItem, MARKER_T aType=MARKER_UNSPEC)
BOX2I GetBoundingBoxMarker() const
Return the orthogonal, bounding box of this object for display purposes.
void SetZoom(double aZoomFactor) 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.
VECTOR2I m_pathEnd
Definition pcb_marker.h:178
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth) const override
Convert the item shape to a closed polygon.
PCB_MARKER(std::shared_ptr< DRC_ITEM > aItem, const VECTOR2I &aPos, int aLayer=F_Cu)
VECTOR2I m_pathStart
Definition pcb_marker.h:177
std::vector< PCB_SHAPE > m_pathShapes
Definition pcb_marker.h:176
std::vector< PCB_SHAPE > GetErrorLegendShapes() const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
SEVERITY GetSeverity() const override
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
static PCB_MARKER * FromLegacyString(const wxString &aData)
static void ToProto(kiapi::board::DrcMarker &aMsg, const PCB_MARKER &aMarker)
GAL_LAYER_ID GetColorLayer() const
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
KIGFX::COLOR4D getColor() const override
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
int m_pathLength
Definition pcb_marker.h:179
double GetCoverageArea(int aTextMargin) const override
Return the board area this item covers, used to rank candidates under the cursor so a click on a smal...
static PCB_MARKER * FromProto(const kiapi::board::DrcMarker &aMsg)
void swapData(BOARD_ITEM *aImage) override
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void SetEnd(const VECTOR2I &aEnd) override
void SetStart(const VECTOR2I &aStart) override
void SetStroke(const STROKE_PARAMS &aStroke) override
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()
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
int GetErrorCode() const
Definition rc_item.h:213
void SetItems(const std::vector< KIID > &aIds)
Definition rc_item.h:165
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
double Area(bool aAbsolute=true) const
Return the area of this chain.
Represent a set of closed polygons.
Simple container to manage line stroke parameters.
constexpr VECTOR2< T > Perpendicular() const
Compute the perpendicular vector.
Definition vector2d.h:335
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
Definition vector2d.h:406
PCB_DRC_CODE
Definition drc_item.h:46
@ DRCE_FOOTPRINT_FILTERS
Definition drc_item.h:94
@ DRCE_UNCONNECTED_ITEMS
Definition drc_item.h:48
@ DRCE_STARVED_THERMAL
Definition drc_item.h:58
@ DRCE_SCHEMATIC_FIELDS_PARITY
Definition drc_item.h:138
@ DRCE_GENERIC_ERROR
Definition drc_item.h:106
@ DRCE_COPPER_SLIVER
Definition drc_item.h:108
@ DRCE_UNRESOLVED_VARIABLE
Definition drc_item.h:103
@ DRCE_DUPLICATE_FOOTPRINT
Definition drc_item.h:90
@ DRCE_EXTRA_FOOTPRINT
Definition drc_item.h:91
@ DRCE_NET_CONFLICT
Definition drc_item.h:92
@ DRCE_MISSING_FOOTPRINT
Definition drc_item.h:89
@ DRCE_GENERIC_WARNING
Definition drc_item.h:105
@ DRCE_SCHEMATIC_PARITY
Definition drc_item.h:93
#define _(s)
@ SEGMENT
Definition eda_shape.h:57
KIID niluuid(0)
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
Definition layer_id.cpp:31
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
Definition layer_ids.h:180
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition layer_ids.h:224
@ LAYER_DRAWINGSHEET
Sheet frame and title block.
Definition layer_ids.h:274
@ LAYER_DRC_EXCLUSION
Layer for DRC markers which have been individually excluded.
Definition layer_ids.h:300
@ LAYER_DRC_HIGHLIGHTED
Color for highlighted DRC markers.
Definition layer_ids.h:337
@ LAYER_DRC_WARNING
Layer for DRC markers with RPT_SEVERITY_WARNING.
Definition layer_ids.h:297
@ LAYER_MARKER_SHADOWS
Shadows for DRC markers.
Definition layer_ids.h:301
@ LAYER_DRC_ERROR
Layer for DRC markers with RPT_SEVERITY_ERROR.
Definition layer_ids.h:273
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ UNDEFINED_LAYER
Definition layer_ids.h:57
@ PCB_LAYER_ID_COUNT
Definition layer_ids.h:167
@ F_Cu
Definition layer_ids.h:60
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition lset.cpp:750
FLIP_DIRECTION
Definition mirror.h:26
KICOMMON_API VECTOR2I UnpackVector2(const types::Vector2 &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void PackVector2(types::Vector2 &aOutput, const VECTOR2I &aInput, const EDA_IU_SCALE &aScale)
STL namespace.
#define _HKI(x)
Definition page_info.cpp:40
static struct PCB_MARKER_DESC _PCB_MARKER_DESC
see class PGM_BASE
#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.
SEVERITY
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_UNDEFINED
@ RPT_SEVERITY_EXCLUSION
@ RPT_SEVERITY_IGNORE
#define SCALING_FACTOR
Factor to convert the maker unit shape to internal units:
#define DEFAULT_THEME
nanodbc::result res
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
Definition typeinfo.h:91
Functions to provide common constants and other functions to assist in making a consistent UI.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708