KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_line.h
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) 2009 Jean-Pierre Charras, [email protected]
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef _SCH_LINE_H_
22#define _SCH_LINE_H_
23
24#include <sch_item.h>
25#include <line_ending.h>
26#include <wx/pen.h> // for wxPenStyle
27#include <list> // for std::list
28#include <geometry/seg.h>
29#include <math/vector3.h>
30
31class NETLIST_OBJECT_LIST;
32
33
38class SCH_LINE : public SCH_ITEM
39{
40public:
41 static const enum wxPenStyle PenStyle[];
42
43 SCH_LINE( const VECTOR2I& pos = VECTOR2I( 0, 0 ), int layer = LAYER_NOTES );
44
45 SCH_LINE( const VECTOR2D& pos, int layer = LAYER_NOTES ) :
46 SCH_LINE( VECTOR2I( pos.x, pos.y ), layer )
47 {}
48
49 SCH_LINE( const SCH_LINE& aLine );
50
52
53 void Serialize( google::protobuf::Any &aContainer ) const override;
54 bool Deserialize( const google::protobuf::Any &aContainer ) override;
55
56 static inline bool ClassOf( const EDA_ITEM* aItem )
57 {
58 return aItem && SCH_LINE_T == aItem->Type();
59 }
60
61 wxString GetClass() const override
62 {
63 return wxT( "SCH_LINE" );
64 }
65
66 wxString GetFriendlyName() const override;
67
68 bool IsType( const std::vector<KICAD_T>& aScanTypes ) const override
69 {
70 if( SCH_ITEM::IsType( aScanTypes ) )
71 return true;
72
73 for( KICAD_T scanType : aScanTypes )
74 {
75 if( scanType == SCH_ITEM_LOCATE_WIRE_T && m_layer == LAYER_WIRE )
76 return true;
77
78 if ( scanType == SCH_ITEM_LOCATE_BUS_T && m_layer == LAYER_BUS )
79 return true;
80
82 return true;
83 }
84
85 return false;
86 }
87
88 bool IsEndPoint( const VECTOR2I& aPoint ) const override
89 {
90 return aPoint == m_start || aPoint == m_end;
91 }
92
93 int GetAngleFrom( const VECTOR2I& aPoint ) const;
94 int GetReverseAngleFrom( const VECTOR2I& aPoint ) const;
95
101 inline EDA_ANGLE Angle() const
102 {
103 return ( EDA_ANGLE( (VECTOR2I) m_end - (VECTOR2I) m_start ) );
104 }
105
112 inline void StoreAngle()
113 {
114 if( !IsNull() )
116 }
117
118 inline void StoreAngle( const EDA_ANGLE& aAngle ) { m_storedAngle = aAngle; }
119
125 inline EDA_ANGLE GetStoredAngle() const { return m_storedAngle; }
126
132 inline bool IsOrthogonal() const { return Angle().IsCardinal(); }
133
134 bool IsNull() const { return m_start == m_end; }
135
136 VECTOR2I GetStartPoint() const { return m_start; }
137 void SetStartPoint( const VECTOR2I& aPosition ) { m_start = aPosition; }
138 int GetStartX() const { return m_start.x; }
139 void SetStartX( int aX ) { SetStartPoint( VECTOR2I( aX, m_start.y ) ); }
140 int GetStartY() const { return m_start.y; }
141 void SetStartY( int aY ) { SetStartPoint( VECTOR2I( m_start.x, aY ) ); }
142
143 VECTOR2I GetMidPoint() const { return ( m_start + m_end ) / 2; }
144
145 VECTOR2I GetEndPoint() const { return m_end; }
146 void SetEndPoint( const VECTOR2I& aPosition ) { m_end = aPosition; }
147 int GetEndX() const { return m_end.x; }
148 void SetEndX( int aX ) { SetEndPoint( VECTOR2I( aX, m_end.y ) ); }
149 int GetEndY() const { return m_end.y; }
150 void SetEndY( int aY ) { SetEndPoint( VECTOR2I( m_end.x, aY ) ); }
151
155 SEG GetSeg() const
156 {
157 return SEG{ m_start, m_end };
158 }
159
160 void SetLastResolvedState( const SCH_ITEM* aItem ) override
161 {
162 const SCH_LINE* aLine = dynamic_cast<const SCH_LINE*>( aItem );
163
164 if( aLine )
165 {
166 m_stroke = aLine->GetStroke();
170 }
171 }
172
173 void SetLineStyle( const LINE_STYLE aStyle );
174 LINE_STYLE GetLineStyle() const;
175
179
180 // Special Getter/Setters for properties panel. Required because it uses #WIRE_STYLE instead
181 // of #LINE_STYLE. (The two enums are identical, but we expose "default" in the #WIRE_STYLE
182 // property while we don't with the LINE_STYLE property.)
183 void SetWireStyle( const WIRE_STYLE aStyle ) { SetLineStyle( (LINE_STYLE) aStyle ); }
185
186
187 void SetLineColor( const COLOR4D& aColor );
188
189 void SetLineColor( const double r, const double g, const double b, const double a );
190
192 COLOR4D GetLineColor() const;
193
194 void SetLineWidth( const int aSize );
195 int GetLineWidth() const { return m_stroke.GetWidth(); }
196
197 virtual bool HasLineStroke() const override { return true; }
198 virtual STROKE_PARAMS GetStroke() const override { return m_stroke; }
199 virtual void SetStroke( const STROKE_PARAMS& aStroke ) override { m_stroke = aStroke; }
200
201 const LINE_ENDING& GetStartEnding() const { return m_startEnding; }
202 void SetStartEnding( const LINE_ENDING& aEnding ) { m_startEnding = aEnding; }
203
204 const LINE_ENDING& GetEndEnding() const { return m_endEnding; }
205 void SetEndEnding( const LINE_ENDING& aEnding ) { m_endEnding = aEnding; }
206
208 void SetStartEndingStyle( LINE_ENDING_STYLE aStyle ) { m_startEnding.SetStyle( aStyle ); }
209
210 LINE_ENDING_STYLE GetEndEndingStyle() const { return m_endEnding.GetStyle(); }
211 void SetEndEndingStyle( LINE_ENDING_STYLE aStyle ) { m_endEnding.SetStyle( aStyle ); }
212
213 int GetStartEndingLength() const { return m_startEnding.GetLength(); }
214 void SetStartEndingLength( int aLength ) { m_startEnding.SetLength( aLength ); }
215 int GetStartEndingWidth() const { return m_startEnding.GetWidth(); }
216 void SetStartEndingWidth( int aWidth ) { m_startEnding.SetWidth( aWidth ); }
217
218 int GetEndEndingLength() const { return m_endEnding.GetLength(); }
219 void SetEndEndingLength( int aLength ) { m_endEnding.SetLength( aLength ); }
220 int GetEndEndingWidth() const { return m_endEnding.GetWidth(); }
221 void SetEndEndingWidth( int aWidth ) { m_endEnding.SetWidth( aWidth ); }
222
223 int GetStartEndingStrokeWidth() const { return m_startEnding.GetStrokeWidth(); }
224 void SetStartEndingStrokeWidth( int aWidth ) { m_startEnding.SetStrokeWidth( aWidth ); }
225 int GetEndEndingStrokeWidth() const { return m_endEnding.GetStrokeWidth(); }
226 void SetEndEndingStrokeWidth( int aWidth ) { m_endEnding.SetStrokeWidth( aWidth ); }
227
228 bool IsStrokeEquivalent( const SCH_LINE* aLine )
229 {
230 if( m_stroke.GetWidth() != aLine->GetStroke().GetWidth() )
231 return false;
232
233 if( m_stroke.GetColor() != aLine->GetStroke().GetColor() )
234 return false;
235
236 LINE_STYLE style_a = m_stroke.GetLineStyle();
237 LINE_STYLE style_b = aLine->GetStroke().GetLineStyle();
238
239 return style_a == style_b
240 || ( style_a == LINE_STYLE::DEFAULT && style_b == LINE_STYLE::SOLID )
241 || ( style_a == LINE_STYLE::SOLID && style_b == LINE_STYLE::DEFAULT );
242 }
243
244 std::vector<int> ViewGetLayers() const override;
245
246 double ViewGetLOD( int aLayer, const KIGFX::VIEW* aView ) const override;
247
248 const BOX2I GetBoundingBox() const override;
249
253 double GetLength() const;
254 void SetLength( double aLength );
255
256 int GetPenWidth() const override;
257
258 void Move( const VECTOR2I& aMoveVector ) override;
259 void MoveStart( const VECTOR2I& aMoveVector );
260 void MoveEnd( const VECTOR2I& aMoveVector );
261
262 void MirrorVertically( int aCenter ) override;
263 void MirrorHorizontally( int aCenter ) override;
264 void Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) override;
265
279 SCH_LINE* MergeOverlap( SCH_SCREEN* aScreen, SCH_LINE* aLine, bool aCheckJunctions );
280
293 SCH_LINE* BreakAt( SCH_COMMIT* aCommit, const VECTOR2I& aPoint );
294
299 SCH_LINE* NonGroupAware_BreakAt( const VECTOR2I& aPoint );
300
301 bool IsParallel( const SCH_LINE* aLine ) const;
302
308 bool ShouldHopOver( const SCH_LINE* aLine ) const;
309
319 std::vector<VECTOR3I> BuildWireWithHopShape( const SCH_SCREEN* aScreen, double aArcRadius ) const;
320
321 void GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList ) override;
322
323 bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemListByType,
324 std::vector<DANGLING_END_ITEM>& aItemListByPos,
325 const SCH_SHEET_PATH* aPath = nullptr ) override;
326
327 bool IsStartDangling() const { return m_startIsDangling; }
328 bool IsEndDangling() const { return m_endIsDangling; }
329 bool IsDangling() const override { return m_startIsDangling || m_endIsDangling; }
330
331 bool IsConnectable() const override;
332
333 bool HasConnectivityChanges( const SCH_ITEM* aItem,
334 const SCH_SHEET_PATH* aInstance = nullptr ) const override;
335
336 std::vector<VECTOR2I> GetConnectionPoints() const override;
337
338 bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const override;
339
340 void GetSelectedPoints( std::vector<VECTOR2I>& aPoints ) const;
341
342 bool CanConnect( const SCH_ITEM* aItem ) const override;
343
344 wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
345
346 BITMAPS GetMenuImage() const override;
347
348 bool operator <( const SCH_ITEM& aItem ) const override;
349
350 VECTOR2I GetPosition() const override { return m_start; }
351 void SetPosition( const VECTOR2I& aPosition ) override;
352 VECTOR2I GetSortPosition() const override { return GetMidPoint(); }
353
354 bool IsPointClickableAnchor( const VECTOR2I& aPos ) const override
355 {
356 return ( GetStartPoint() == aPos && IsStartDangling() )
357 || ( GetEndPoint() == aPos && IsEndDangling() );
358 }
359
360 bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
361 bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
362 bool HitTest( const SHAPE_LINE_CHAIN& aPoly, bool aContained ) const override;
363
364 void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
365 int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
366
367 EDA_ITEM* Clone() const override;
368
369 void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
370
371 const wxString& GetOperatingPoint() const { return m_operatingPoint; }
372 void SetOperatingPoint( const wxString& aText ) { m_operatingPoint = aText; }
373
374#if defined(DEBUG)
375 void Show( int nestLevel, std::ostream& os ) const override;
376#endif
377
383 bool IsGraphicLine() const;
384
390 bool IsWire() const;
391
397 bool IsBus() const;
398
399 double Similarity( const SCH_ITEM& aOther ) const override;
400
401 bool operator==( const SCH_ITEM& aOther ) const override;
402
403protected:
404 void swapData( SCH_ITEM* aItem ) override;
405
406private:
407 bool doIsConnected( const VECTOR2I& aPosition ) const override;
408
409private:
418
419 // If real-time connectivity gets disabled (due to being too slow on a particular
420 // design), we can no longer rely on getting the NetClass to find netclass-specific
421 // linestyles, linewidths and colors.
425
427};
428
429
431
432
433#endif // _SCH_LINE_H_
BITMAPS
A list of all bitmap identifiers.
BOX2< VECTOR2I > BOX2I
Definition box2.h:927
bool IsCardinal() const
Definition eda_angle.cpp:40
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
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
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition view.h:63
Decorative shape (arrowhead, circle, square) at the start or end of a graphic line,...
Definition line_ending.h:62
Base plotter engine class.
Definition plotter.h:136
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
Definition sch_item.cpp:52
SCH_LAYER_ID m_layer
Definition sch_item.h:790
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition sch_item.h:180
Segment description base class to describe items which have 2 end points (track, wire,...
Definition sch_line.h:39
int GetPenWidth() const override
Definition sch_line.cpp:444
void SetStartY(int aY)
Definition sch_line.h:141
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
Definition sch_line.cpp:989
int GetStartEndingStrokeWidth() const
Definition sch_line.h:223
int GetEndY() const
Definition sch_line.h:149
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
Definition sch_line.cpp:692
void SetStartPoint(const VECTOR2I &aPosition)
Definition sch_line.h:137
void SetEndEnding(const LINE_ENDING &aEnding)
Definition sch_line.h:205
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition sch_line.cpp:241
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Definition sch_line.cpp:872
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
Definition sch_line.cpp:702
void SetOperatingPoint(const wxString &aText)
Definition sch_line.h:372
bool m_startIsDangling
True if start point is not connected.
Definition sch_line.h:410
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition sch_line.cpp:906
bool IsPointClickableAnchor(const VECTOR2I &aPos) const override
Definition sch_line.h:354
void SetPosition(const VECTOR2I &aPosition) override
void StoreAngle()
Save the current line angle.
Definition sch_line.h:112
void SetEndEndingStyle(LINE_ENDING_STYLE aStyle)
Definition sch_line.h:211
std::vector< VECTOR3I > BuildWireWithHopShape(const SCH_SCREEN *aScreen, double aArcRadius) const
For wires only: build the list of points to draw the shape using segments and 180 deg arcs Points are...
int GetStartX() const
Definition sch_line.h:138
SCH_LINE * NonGroupAware_BreakAt(const VECTOR2I &aPoint)
This version should only be used when importing files.
Definition sch_line.cpp:680
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
Definition sch_line.cpp:806
int GetReverseAngleFrom(const VECTOR2I &aPoint) const
Definition sch_line.cpp:521
SCH_LINE(const VECTOR2I &pos=VECTOR2I(0, 0), int layer=LAYER_NOTES)
Definition sch_line.cpp:75
virtual bool HasLineStroke() const override
Check if this schematic item has line stoke properties.
Definition sch_line.h:197
bool IsWire() const
Return true if the line is a wire.
void SetStartEndingStyle(LINE_ENDING_STYLE aStyle)
Definition sch_line.h:208
bool IsStartDangling() const
Definition sch_line.h:327
SCH_LINE(const VECTOR2D &pos, int layer=LAYER_NOTES)
Definition sch_line.h:45
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition sch_line.cpp:315
void SetEndEndingWidth(int aWidth)
Definition sch_line.h:221
void SetWireStyle(const WIRE_STYLE aStyle)
Definition sch_line.h:183
void SetLineColor(const COLOR4D &aColor)
Definition sch_line.cpp:371
bool CanConnect(const SCH_ITEM *aItem) const override
Definition sch_line.cpp:764
EDA_ANGLE GetStoredAngle() const
Return the angle stored by StoreAngle().
Definition sch_line.h:125
bool IsParallel(const SCH_LINE *aLine) const
Definition sch_line.cpp:534
int GetStartY() const
Definition sch_line.h:140
int GetEndEndingLength() const
Definition sch_line.h:218
void SetLineWidth(const int aSize)
Definition sch_line.cpp:437
bool ShouldHopOver(const SCH_LINE *aLine) const
For wires only:
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Definition sch_line.cpp:488
virtual STROKE_PARAMS GetStroke() const override
Definition sch_line.h:198
LINE_ENDING m_startEnding
Line ending at start point.
Definition sch_line.h:416
int GetAngleFrom(const VECTOR2I &aPoint) const
Definition sch_line.cpp:508
void GetSelectedPoints(std::vector< VECTOR2I > &aPoints) const
Definition sch_line.cpp:825
COLOR4D m_lastResolvedColor
Definition sch_line.h:424
LINE_STYLE GetEffectiveLineStyle() const
Definition sch_line.cpp:424
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 SetEndEndingStrokeWidth(int aWidth)
Definition sch_line.h:226
EDA_ANGLE Angle() const
Get the angle between the start and end lines.
Definition sch_line.h:101
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.
Definition sch_line.cpp:998
wxString m_operatingPoint
Definition sch_line.h:426
void SetLength(double aLength)
Definition sch_line.cpp:346
const LINE_ENDING & GetEndEnding() const
Definition sch_line.h:204
wxString GetClass() const override
Return the class name.
Definition sch_line.h:61
static bool ClassOf(const EDA_ITEM *aItem)
Definition sch_line.h:56
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
Definition sch_line.cpp:498
VECTOR2I GetMidPoint() const
Definition sch_line.h:143
VECTOR2I GetEndPoint() const
Definition sch_line.h:145
VECTOR2I GetStartPoint() const
Definition sch_line.h:136
bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
Definition sch_line.cpp:812
LINE_STYLE m_lastResolvedLineStyle
Definition sch_line.h:422
VECTOR2I GetPosition() const override
Definition sch_line.h:350
SEG GetSeg() const
Get the geometric aspect of the wire as a SEG.
Definition sch_line.h:155
bool IsEndDangling() const
Definition sch_line.h:328
SCH_LINE * MergeOverlap(SCH_SCREEN *aScreen, SCH_LINE *aLine, bool aCheckJunctions)
Check line against aLine to see if it overlaps and merge if it does.
Definition sch_line.cpp:547
int GetEndEndingWidth() const
Definition sch_line.h:220
void SetEndY(int aY)
Definition sch_line.h:150
int GetStartEndingWidth() const
Definition sch_line.h:215
VECTOR2I m_start
Line start point.
Definition sch_line.h:412
bool IsBus() const
Return true if the line is a bus.
int m_lastResolvedWidth
Definition sch_line.h:423
void SetStartEndingLength(int aLength)
Definition sch_line.h:214
void StoreAngle(const EDA_ANGLE &aAngle)
Definition sch_line.h:118
LINE_ENDING m_endEnding
Line ending at end point.
Definition sch_line.h:417
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
Definition sch_line.cpp:788
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
Definition sch_line.cpp:133
LINE_ENDING_STYLE GetEndEndingStyle() const
Definition sch_line.h:210
void SetLineStyle(const LINE_STYLE aStyle)
Definition sch_line.cpp:408
VECTOR2I m_end
Line end point.
Definition sch_line.h:413
void SetEndEndingLength(int aLength)
Definition sch_line.h:219
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
Definition sch_line.cpp:247
int GetEndX() const
Definition sch_line.h:147
LINE_STYLE GetLineStyle() const
Definition sch_line.cpp:415
void SetStartEndingWidth(int aWidth)
Definition sch_line.h:216
int GetEndEndingStrokeWidth() const
Definition sch_line.h:225
LINE_ENDING_STYLE GetStartEndingStyle() const
Definition sch_line.h:207
bool IsNull() const
Definition sch_line.h:134
void SetStartEnding(const LINE_ENDING &aEnding)
Definition sch_line.h:202
void MoveEnd(const VECTOR2I &aMoveVector)
Definition sch_line.cpp:260
VECTOR2I GetSortPosition() const override
Return the coordinates that should be used for sorting this element visually compared to other elemen...
Definition sch_line.h:352
STROKE_PARAMS m_stroke
Line stroke properties.
Definition sch_line.h:415
EDA_ANGLE m_storedAngle
Stored angle.
Definition sch_line.h:414
SCH_LINE * BreakAt(SCH_COMMIT *aCommit, const VECTOR2I &aPoint)
Break this segment into two at the specified point.
Definition sch_line.cpp:668
bool m_endIsDangling
True if end point is not connected.
Definition sch_line.h:411
bool IsConnectable() const override
Definition sch_line.cpp:755
wxString GetFriendlyName() const override
Definition sch_line.cpp:230
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
Definition sch_line.cpp:293
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
Definition sch_line.cpp:478
bool operator==(const SCH_ITEM &aOther) const override
bool operator<(const SCH_ITEM &aItem) const override
Definition sch_line.cpp:883
virtual void SetStroke(const STROKE_PARAMS &aStroke) override
Definition sch_line.h:199
bool IsStrokeEquivalent(const SCH_LINE *aLine)
Definition sch_line.h:228
WIRE_STYLE GetWireStyle() const
Definition sch_line.h:184
void SetLastResolvedState(const SCH_ITEM *aItem) override
Definition sch_line.h:160
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
Definition sch_line.cpp:835
bool IsEndPoint(const VECTOR2I &aPoint) const override
Test if aPt is an end point of this schematic object.
Definition sch_line.h:88
bool IsGraphicLine() const
Return if the line is a graphic (non electrical line)
static enum wxPenStyle PenStyle[]
Definition sch_line.h:41
int GetLineWidth() const
Definition sch_line.h:195
COLOR4D GetLineColor() const
Return COLOR4D::UNSPECIFIED if a custom color hasn't been set for this line.
Definition sch_line.cpp:395
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition sch_line.cpp:283
void MoveStart(const VECTOR2I &aMoveVector)
Definition sch_line.cpp:254
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
Definition sch_line.cpp:181
double GetLength() const
Definition sch_line.cpp:340
void SetEndX(int aX)
Definition sch_line.h:148
void SetStartEndingStrokeWidth(int aWidth)
Definition sch_line.h:224
const LINE_ENDING & GetStartEnding() const
Definition sch_line.h:201
~SCH_LINE()
Definition sch_line.h:51
bool IsOrthogonal() const
Check if line is orthogonal (to the grid).
Definition sch_line.h:132
int GetStartEndingLength() const
Definition sch_line.h:213
void SetEndPoint(const VECTOR2I &aPosition)
Definition sch_line.h:146
void SetStartX(int aX)
Definition sch_line.h:139
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
Definition sch_line.h:68
bool IsDangling() const override
Definition sch_line.h:329
const wxString & GetOperatingPoint() const
Definition sch_line.h:371
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void swapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
Definition sch_line.cpp:975
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Definition seg.h:38
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Simple container to manage line stroke parameters.
int GetWidth() const
LINE_STYLE GetLineStyle() const
KIGFX::COLOR4D GetColor() const
@ LAYER_WIRE
Definition layer_ids.h:474
@ LAYER_NOTES
Definition layer_ids.h:489
@ LAYER_BUS
Definition layer_ids.h:475
LINE_ENDING_STYLE
Line ending styles for graphic lines, arcs, and beziers.
Definition line_ending.h:44
#define DECLARE_ENUM_TO_WXANY(type)
Definition property.h:838
LINE_STYLE
Dashed line types.
WIRE_STYLE
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70
@ SCH_LINE_T
Definition typeinfo.h:159
@ SCH_ITEM_LOCATE_WIRE_T
Definition typeinfo.h:182
@ SCH_ITEM_LOCATE_BUS_T
Definition typeinfo.h:183
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T
Definition typeinfo.h:184
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683
VECTOR2< double > VECTOR2D
Definition vector2d.h:682