KiCad PCB EDA Suite
sch_bus_entry.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) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2004-2020 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, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <fctsys.h>
26 #include <sch_draw_panel.h>
27 #include <bitmaps.h>
28 #include <schematic.h>
29 #include <sch_bus_entry.h>
30 #include <sch_edit_frame.h>
31 #include <sch_line.h>
32 #include <sch_text.h>
34 #include <netclass.h>
35 #include "sch_painter.h"
36 
37 
38 SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos, bool aFlipY ) :
39  SCH_ITEM( NULL, aType )
40 {
41  m_pos = pos;
42  m_size.x = Mils2iu( DEFAULT_SCH_ENTRY_SIZE );
43  m_size.y = Mils2iu( DEFAULT_SCH_ENTRY_SIZE );
44 
45  if( aFlipY )
46  m_size.y *= -1;
47 
49 }
50 
51 
52 SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY( const wxPoint& pos, bool aFlipY ) :
54 {
56  m_connected_bus_item = nullptr;
57 }
58 
59 
60 SCH_BUS_BUS_ENTRY::SCH_BUS_BUS_ENTRY( const wxPoint& pos, bool aFlipY ) :
62 {
64  m_connected_bus_items[0] = nullptr;
65  m_connected_bus_items[1] = nullptr;
66 }
67 
68 
70 {
71  return new SCH_BUS_WIRE_ENTRY( *this );
72 }
73 
74 
76 {
77  return new SCH_BUS_BUS_ENTRY( *this );
78 }
79 
80 
81 bool SCH_BUS_ENTRY_BASE::doIsConnected( const wxPoint& aPosition ) const
82 {
83  return ( m_pos == aPosition || GetEnd() == aPosition );
84 }
85 
86 
88 {
89  return wxPoint( m_pos.x + m_size.x, m_pos.y + m_size.y );
90 }
91 
92 
94 {
95  SCH_BUS_ENTRY_BASE* item = dynamic_cast<SCH_BUS_ENTRY_BASE*>( aItem );
96  wxCHECK_RET( item, wxT( "Cannot swap bus entry data with invalid item." ) );
97 
98  std::swap( m_pos, item->m_pos );
99  std::swap( m_size, item->m_size );
100  std::swap( m_stroke, item->m_stroke );
101 }
102 
103 
104 void SCH_BUS_ENTRY_BASE::ViewGetLayers( int aLayers[], int& aCount ) const
105 {
106  aCount = 2;
107  aLayers[0] = Type() == SCH_BUS_BUS_ENTRY_T ? LAYER_BUS : LAYER_WIRE;
108  aLayers[1] = LAYER_SELECTION_SHADOWS;
109 }
110 
111 
113 {
114  EDA_RECT box;
115 
116  box.SetOrigin( m_pos );
117  box.SetEnd( GetEnd() );
118 
119  box.Normalize();
120  box.Inflate( ( GetPenWidth() / 2 ) + 1 );
121 
122  return box;
123 }
124 
125 
127 {
128  NETCLASSPTR netclass = NetClass();
129 
130  if( netclass && netclass->GetSchematicColor() != COLOR4D::UNSPECIFIED )
131  return netclass->GetSchematicColor();
132 
133  return m_stroke.GetColor();
134 }
135 
136 
138 {
139  NETCLASSPTR netclass = NetClass();
140 
141  if( netclass )
142  return (PLOT_DASH_TYPE) netclass->GetLineStyle();
143 
144  return m_stroke.GetType();
145 }
146 
147 
149 {
150  NETCLASSPTR netclass = NetClass();
151 
152  if( netclass )
153  return netclass->GetWireWidth();
154 
155  if( m_stroke.GetWidth() == 0 && Schematic() )
156  return std::max( Schematic()->Settings().m_DefaultWireThickness, 1 );
157 
158  return ( m_stroke.GetWidth() == 0 ) ? 1 : m_stroke.GetWidth();
159 }
160 
161 
163 {
164  NETCLASSPTR netclass = NetClass();
165 
166  if( netclass )
167  return netclass->GetBusWidth();
168 
169  if( m_stroke.GetWidth() == 0 && Schematic() )
170  return std::max( Schematic()->Settings().m_DefaultBusThickness, 1 );
171 
172  return ( m_stroke.GetWidth() == 0 ) ? 1 : m_stroke.GetWidth();
173 }
174 
175 
176 void SCH_BUS_WIRE_ENTRY::GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList )
177 {
178  DANGLING_END_ITEM item( WIRE_ENTRY_END, this, m_pos );
179  aItemList.push_back( item );
180 
181  DANGLING_END_ITEM item1( WIRE_ENTRY_END, this, GetEnd() );
182  aItemList.push_back( item1 );
183 }
184 
185 
186 void SCH_BUS_BUS_ENTRY::GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList )
187 {
188  DANGLING_END_ITEM item( BUS_ENTRY_END, this, m_pos );
189  aItemList.push_back( item );
190 
191  DANGLING_END_ITEM item1( BUS_ENTRY_END, this, GetEnd() );
192  aItemList.push_back( item1 );
193 }
194 
195 
196 void SCH_BUS_ENTRY_BASE::Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset )
197 {
198  wxDC* DC = aSettings->GetPrintDC();
199  COLOR4D color = ( GetStrokeColor() == COLOR4D::UNSPECIFIED ) ?
200  aSettings->GetLayerColor( m_Layer ) : GetStrokeColor();
201  int penWidth = ( GetPenWidth() == 0 ) ? aSettings->GetDefaultPenWidth() : GetPenWidth();
202 
203  GRLine( nullptr, DC, m_pos.x + aOffset.x, m_pos.y + aOffset.y, GetEnd().x + aOffset.x,
204  GetEnd().y + aOffset.y, penWidth, color,
206 }
207 
208 
209 void SCH_BUS_ENTRY_BASE::MirrorX( int aXaxis_position )
210 {
211  MIRROR( m_pos.y, aXaxis_position );
212  m_size.y = -m_size.y;
213 }
214 
215 
216 void SCH_BUS_ENTRY_BASE::MirrorY( int aYaxis_position )
217 {
218  MIRROR( m_pos.x, aYaxis_position );
219  m_size.x = -m_size.x;
220 }
221 
222 
224 {
225  RotatePoint( &m_pos, aPosition, 900 );
226  RotatePoint( &m_size.x, &m_size.y, 900 );
227 }
228 
229 
230 bool SCH_BUS_WIRE_ENTRY::UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
231  const SCH_SHEET_PATH* aPath )
232 {
233  bool previousStateStart = m_isDanglingStart;
234  bool previousStateEnd = m_isDanglingEnd;
235 
237 
238  // Wires and buses are stored in the list as a pair, start and end. This
239  // variable holds the start position from one iteration so it can be used
240  // when the end position is found.
241  wxPoint seg_start;
242 
243  // Store the connection type and state for the start (0) and end (1)
244  bool has_wire[2] = { false };
245  bool has_bus[2] = { false };
246 
247  for( DANGLING_END_ITEM& each_item : aItemList )
248  {
249  if( each_item.GetItem() == this )
250  continue;
251 
252  switch( each_item.GetType() )
253  {
254  case WIRE_START_END:
255  case WIRE_END_END:
256  if( m_pos == each_item.GetPosition() )
257  has_wire[0] = true;
258  else if( GetEnd() == each_item.GetPosition() )
259  has_wire[1] = true;
260 
261  break;
262 
263  case BUS_START_END:
264  seg_start = each_item.GetPosition();
265  break;
266 
267  case BUS_END_END:
268  if( IsPointOnSegment( seg_start, each_item.GetPosition(), m_pos ) )
269  has_bus[0] = true;
270  else if( IsPointOnSegment( seg_start, each_item.GetPosition(), GetEnd() ) )
271  has_bus[1] = true;
272 
273  break;
274 
275  default:
276  break;
277  }
278  }
279 
280  // A bus-wire entry is connected at both ends if it has a bus and a wire on its
281  // ends. Otherwise, we connect only one end (in the case of a wire-wire or bus-bus)
282  if( ( has_wire[0] && has_bus[1] ) || ( has_wire[1] && has_bus[0] ) )
284  else if( has_wire[0] || has_bus[0] )
285  m_isDanglingStart = false;
286  else if( has_wire[1] || has_bus[1] )
287  m_isDanglingEnd = false;
288 
289  return (previousStateStart != m_isDanglingStart) || (previousStateEnd != m_isDanglingEnd);
290 }
291 
292 
293 bool SCH_BUS_BUS_ENTRY::UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
294  const SCH_SHEET_PATH* aPath )
295 {
296  bool previousStateStart = m_isDanglingStart;
297  bool previousStateEnd = m_isDanglingEnd;
298 
300 
301  // Wires and buses are stored in the list as a pair, start and end. This
302  // variable holds the start position from one iteration so it can be used
303  // when the end position is found.
304  wxPoint seg_start;
305 
306  for( DANGLING_END_ITEM& each_item : aItemList )
307  {
308  if( each_item.GetItem() == this )
309  continue;
310 
311  switch( each_item.GetType() )
312  {
313  case BUS_START_END:
314  seg_start = each_item.GetPosition();
315  break;
316  case BUS_END_END:
317  if( IsPointOnSegment( seg_start, each_item.GetPosition(), m_pos ) )
318  m_isDanglingStart = false;
319  if( IsPointOnSegment( seg_start, each_item.GetPosition(), GetEnd() ) )
320  m_isDanglingEnd = false;
321  break;
322  default:
323  break;
324  }
325  }
326 
327  return (previousStateStart != m_isDanglingStart) || (previousStateEnd != m_isDanglingEnd);
328 }
329 
330 
332 {
334 }
335 
336 
337 std::vector<wxPoint> SCH_BUS_ENTRY_BASE::GetConnectionPoints() const
338 {
339  return { m_pos, GetEnd() };
340 }
341 
342 
344 {
345  return wxString( _( "Bus to Wire Entry" ) );
346 }
347 
348 
350 {
351  return wxString( _( "Bus to Bus Entry" ) );
352 }
353 
354 
356 {
357  return add_line2bus_xpm;
358 }
359 
360 
362 {
363  return add_bus2bus_xpm;
364 }
365 
366 
367 bool SCH_BUS_ENTRY_BASE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
368 {
369  // Insure minimum accuracy
370  if( aAccuracy == 0 )
371  aAccuracy = ( GetPenWidth() / 2 ) + 4;
372 
373  return TestSegmentHit( aPosition, m_pos, GetEnd(), aAccuracy );
374 }
375 
376 
377 bool SCH_BUS_ENTRY_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
378 {
379  EDA_RECT rect = aRect;
380 
381  rect.Inflate( aAccuracy );
382 
383  if( aContained )
384  return rect.Contains( GetBoundingBox() );
385 
386  return rect.Intersects( GetBoundingBox() );
387 }
388 
389 
391 {
392  auto* settings = static_cast<KIGFX::SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
393 
394  COLOR4D color = ( GetStrokeColor() == COLOR4D::UNSPECIFIED ) ?
395  settings->GetLayerColor( m_Layer ) : GetStrokeColor();
396  int penWidth = ( GetPenWidth() == 0 ) ? settings->GetDefaultPenWidth() : GetPenWidth();
397 
398  penWidth = std::max( penWidth, settings->GetMinPenWidth() );
399 
400  aPlotter->SetCurrentLineWidth( penWidth );
401  aPlotter->SetColor( color );
402  aPlotter->SetDash( GetStrokeStyle() );
403  aPlotter->MoveTo( m_pos );
404  aPlotter->FinishTo( GetEnd() );
405 }
406 
407 
409 {
410  wxString msg;
411 
412  switch( GetLayer() )
413  {
414  default:
415  case LAYER_WIRE: msg = _( "Wire" ); break;
416  case LAYER_BUS: msg = _( "Bus" ); break;
417  }
418 
419  aList.push_back( MSG_PANEL_ITEM( _( "Bus Entry Type" ), msg, DARKCYAN ) );
420 
421  SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( aFrame );
422 
423  if( !frame )
424  return;
425 
426  if( auto conn = Connection( frame->GetCurrentSheet() ) )
427  conn->AppendInfoToMsgPanel( aList );
428 }
429 
430 
431 bool SCH_BUS_ENTRY_BASE::operator <( const SCH_ITEM& aItem ) const
432 {
433  if( Type() != aItem.Type() )
434  return Type() < aItem.Type();
435 
436  auto component = static_cast<const SCH_BUS_ENTRY_BASE*>( &aItem );
437 
438  if( GetLayer() != component->GetLayer() )
439  return GetLayer() < component->GetLayer();
440 
441  if( GetPosition().x != component->GetPosition().x )
442  return GetPosition().x < component->GetPosition().x;
443 
444  if( GetPosition().y != component->GetPosition().y )
445  return GetPosition().y < component->GetPosition().y;
446 
447  if( GetEnd().x != component->GetEnd().x )
448  return GetEnd().x < component->GetEnd().x;
449 
450  return GetEnd().y < component->GetEnd().y;
451 }
452 
453 
455 {
456  // Don't generate connections between bus entries and buses, since there is
457  // a connectivity change at that point (e.g. A[7..0] to A7)
458  if( ( aItem->Type() == SCH_LINE_T ) &&
459  ( static_cast<const SCH_LINE*>( aItem )->GetLayer() == LAYER_BUS ) )
460  {
461  return false;
462  }
463 
464  // Don't generate connections between bus entries and bus labels that happen
465  // to land at the same point on the bus wire as this bus entry
466  if( ( aItem->Type() == SCH_LABEL_T ) &&
467  SCH_CONNECTION::IsBusLabel( static_cast<const SCH_LABEL*>( aItem )->GetText() ) )
468  {
469  return false;
470  }
471 
472  // Don't generate connections between two bus-wire entries
473  if( aItem->Type() == SCH_BUS_WIRE_ENTRY_T )
474  return false;
475 
476  return true;
477 }
void FinishTo(const wxPoint &pos)
Definition: plotter.h:267
EDA_UNITS
Definition: common.h:198
SCH_LAYER_ID m_Layer
Definition: sch_item.h:199
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
bool doIsConnected(const wxPoint &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
PNG memory record (file in memory).
Definition: bitmap_def.h:29
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
#define DEFAULT_SCH_ENTRY_SIZE
The default text size in mils. (can be changed in preference menu)
SCH_ITEM * m_connected_bus_item
Pointer to the bus item (usually a bus wire) connected to this bus-wire entry, if it is connected to ...
SCH_ITEM * m_connected_bus_items[2]
Pointer to the bus items (usually bus wires) connected to this bus-bus entry (either or both may be n...
const BITMAP_OPAQUE add_line2bus_xpm[1]
virtual void SetColor(COLOR4D color)=0
SCH_BUS_BUS_ENTRY(const wxPoint &pos=wxPoint(0, 0), bool aFlipY=false)
static bool IsBusLabel(const wxString &aLabel)
Test if aLabel has a bus notation.
SCH_BUS_ENTRY_BASE(KICAD_T aType, const wxPoint &pos=wxPoint(0, 0), bool aFlipY=false)
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:124
int color
Definition: DXF_plotter.cpp:61
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
SCH_BUS_WIRE_ENTRY(const wxPoint &pos=wxPoint(0, 0), bool aFlipY=false)
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:116
void Rotate(wxPoint aPosition) override
Rotate the item around aPosition 90 degrees in the clockwise direction.
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
bool IsPointOnSegment(const wxPoint &aSegStart, const wxPoint &aSegEnd, const wxPoint &aTestPoint)
Test if aTestPoint is on line defined by aSegStart and aSegEnd.
Definition: trigo.cpp:42
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:131
Schematic editor (Eeschema) main window.
const BITMAP_OPAQUE add_bus2bus_xpm[1]
Definition: add_bus2bus.cpp:38
wxPoint m_pos
Definition: sch_bus_entry.h:46
wxSize m_size
Definition: sch_bus_entry.h:47
void RotatePoint(int *pX, int *pY, double angle)
Definition: trigo.cpp:208
The base class for create windows for drawing purpose.
bool Contains(const wxPoint &aPoint) const
Function Contains.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
void Print(RENDER_SETTINGS *aSettings, const wxPoint &aOffset) override
Print a schematic item.
bool TestSegmentHit(const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
Definition: trigo.cpp:129
Base class for a bus or wire entry.
Definition: sch_bus_entry.h:43
virtual bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Returns true if this item should propagate connection info to aItem.
PLOT_DASH_TYPE GetStrokeStyle() const
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
void MIRROR(T &aPoint, const T &aMirrorRef)
Definition: macros.h:175
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
bool IsDangling() const override
std::vector< wxPoint > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
#define NULL
NETCLASSPTR NetClass() const
Definition: sch_item.cpp:160
void SetEnd(int x, int y)
Definition: eda_rect.h:192
bool m_isDanglingStart
Definition: sch_bus_entry.h:48
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
int GetWidth() const
Definition: sch_item.h:169
SCH_SHEET_PATH.
void GRLine(EDA_RECT *ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, COLOR4D Color, wxPenStyle aStyle)
Definition: gr_basic.cpp:232
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemList, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
STROKE_PARAMS m_stroke
Definition: sch_bus_entry.h:50
SCH_CONNECTION * Connection(const SCH_SHEET_PATH &aPath) const
Retrieve the connection associated with this object in the given sheet.
Definition: sch_item.cpp:150
virtual int GetPenWidth() const
Definition: sch_item.h:296
const EDA_RECT GetBoundingBox() const override
Function GetBoundingBox returns the orthogonal, bounding box of this object for display purposes.
PLOT_DASH_TYPE
Enum for choosing dashed line type.
Definition: plotter.h:87
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:279
void MoveTo(const wxPoint &pos)
Definition: plotter.h:257
void Normalize()
Function Normalize ensures that the height ant width are positive.
Base plotter engine class.
Definition: plotter.h:114
COLOR4D GetColor() const
Definition: sch_item.h:175
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
int GetPenWidth() const override
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
#define _(s)
Definition: 3d_actions.cpp:33
void MirrorX(int aXaxis_position) override
Mirror item relative to the X axis about aXaxis_position.
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
bool m_isDanglingEnd
Definition: sch_bus_entry.h:49
void Plot(PLOTTER *aPlotter) override
Plot the schematic item to aPlotter.
PLOT_DASH_TYPE GetType() const
Definition: sch_item.h:172
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
int GetDefaultPenWidth() const
SCH_SHEET_PATH & GetCurrentSheet() const
COLOR4D GetStrokeColor() const
bool operator<(const SCH_ITEM &aItem) const override
Helper class used to store the state of schematic items that can be connected to other schematic item...
Definition: sch_item.h:85
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo populates aList of MSG_PANEL_ITEM objects with it's internal state for displ...
EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Definition: msgpanel.h:53
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Function HitTest tests if aPosition is contained within or on the bounding box of an item.
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
void MirrorY(int aYaxis_position) override
Mirror item relative to the Y axis about aYaxis_position.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:194
wxPenStyle GetwxPenStyle(PLOT_DASH_TYPE aType)
Convert KiCad line plot styles to wxWidgets device context styles.
Definition: plotter.cpp:599
virtual void SetDash(PLOT_DASH_TYPE dashed)=0
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
int GetPenWidth() const override
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
wxPoint GetEnd() const
virtual void SetCurrentLineWidth(int width, void *aData=NULL)=0
Set the line width for the next drawing.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99
wxPoint GetPosition() const override