KiCad PCB EDA Suite
drawing_tool.cpp File Reference

Go to the source code of this file.

Classes

class  VIA_SIZE_MENU
 

Typedefs

using SCOPED_DRAW_MODE = SCOPED_SET_RESET< DRAWING_TOOL::MODE >
 

Functions

static void updateSegmentFromGeometryMgr (const KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER &aMgr, PCB_SHAPE *aGraphic)
 Update a PCB_SHAPE from the current state of a #TWO_POINT_GEOMETRY_MANAGER. More...
 
static void updateArcFromConstructionMgr (const KIGFX::PREVIEW::ARC_GEOM_MANAGER &aMgr, PCB_SHAPE &aArc)
 Update an arc PCB_SHAPE from the current state of an Arc Geometry Manager. More...
 

Typedef Documentation

◆ SCOPED_DRAW_MODE

Function Documentation

◆ updateArcFromConstructionMgr()

static void updateArcFromConstructionMgr ( const KIGFX::PREVIEW::ARC_GEOM_MANAGER aMgr,
PCB_SHAPE aArc 
)
static

Update an arc PCB_SHAPE from the current state of an Arc Geometry Manager.

Definition at line 1713 of file drawing_tool.cpp.

1715 {
1716  VECTOR2I vec = aMgr.GetOrigin();
1717 
1718  aArc.SetCenter( (wxPoint) vec );
1719 
1720  vec = aMgr.GetStartRadiusEnd();
1721  aArc.SetStart( (wxPoint) vec );
1722  vec = aMgr.GetEndRadiusEnd();
1723  aArc.SetEnd( (wxPoint) vec );
1724 }
VECTOR2I GetEndRadiusEnd() const
Get the radius of the arc (valid if step >= SET_START)
void SetEnd(const wxPoint &aEnd)
Definition: eda_shape.h:126
VECTOR2I GetStartRadiusEnd() const
Get the coordinates of the arc end point.
void SetStart(const wxPoint &aStart)
Definition: eda_shape.h:101
VECTOR2I GetOrigin() const
< Get the center point of the arc (valid when state > SET_ORIGIN)
void SetCenter(const wxPoint &aCenter)
Definition: eda_shape.cpp:416

References KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetEndRadiusEnd(), KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetOrigin(), KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetStartRadiusEnd(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().

Referenced by DRAWING_TOOL::drawArc().

◆ updateSegmentFromGeometryMgr()

static void updateSegmentFromGeometryMgr ( const KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER aMgr,
PCB_SHAPE aGraphic 
)
static

Update a PCB_SHAPE from the current state of a #TWO_POINT_GEOMETRY_MANAGER.

Definition at line 1391 of file drawing_tool.cpp.

1393 {
1394  if( !aMgr.IsReset() )
1395  {
1396  aGraphic->SetStart( (wxPoint) aMgr.GetOrigin() );
1397  aGraphic->SetEnd( (wxPoint) aMgr.GetEnd() );
1398  }
1399 }
void SetEnd(const wxPoint &aEnd)
Definition: eda_shape.h:126
void SetStart(const wxPoint &aStart)
Definition: eda_shape.h:101

References KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::GetEnd(), KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::GetOrigin(), KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::IsReset(), EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().

Referenced by DRAWING_TOOL::drawSegment().