KiCad PCB EDA Suite
drawing_tool.cpp File Reference
#include "drawing_tool.h"
#include "pcb_actions.h"
#include <wxPcbStruct.h>
#include <class_draw_panel_gal.h>
#include <project.h>
#include <id.h>
#include <pcbnew_id.h>
#include <confirm.h>
#include <dialog_edit_module_text.h>
#include <import_dxf/dialog_dxf_import.h>
#include <view/view_group.h>
#include <view/view_controls.h>
#include <view/view.h>
#include <gal/graphics_abstraction_layer.h>
#include <tool/tool_manager.h>
#include <geometry/direction45.h>
#include <ratsnest_data.h>
#include <board_commit.h>
#include <scoped_set_reset.h>
#include <bitmaps.h>
#include <hotkeys.h>
#include <painter.h>
#include <preview_items/arc_assistant.h>
#include <class_board.h>
#include <class_edge_mod.h>
#include <class_pcb_text.h>
#include <class_dimension.h>
#include <class_zone.h>
#include <class_module.h>
#include <tools/selection_tool.h>
#include <tools/tool_event_utils.h>
#include <tools/zone_create_helper.h>

Go to the source code of this file.

Typedefs

using SCOPED_DRAW_MODE = SCOPED_SET_RESET< DRAWING_TOOL::MODE >
 

Functions

static void updateArcFromConstructionMgr (const KIGFX::PREVIEW::ARC_GEOM_MANAGER &aMgr, DRAWSEGMENT &aArc)
 Update an arc DRAWSEGMENT from the current state of an Arc Geometry Manager. More...
 

Variables

static TOOL_ACTION deleteLastPoint ("pcbnew.InteractiveDrawing.deleteLastPoint", AS_CONTEXT, WXK_BACK, _("Delete Last Point"), _("Delete the last point added to the current item"), undo_xpm)
 
static TOOL_ACTION closeZoneOutline ("pcbnew.InteractiveDrawing.closeZoneOutline", AS_CONTEXT, 0, _("Close Zone Outline"), _("Close the outline of a zone in progress"), checked_ok_xpm)
 

Typedef Documentation

Function Documentation

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

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

Definition at line 1094 of file drawing_tool.cpp.

References KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetOrigin(), KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetStartRadiusEnd(), KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetSubtended(), RAD2DECIDEG(), DRAWSEGMENT::SetAngle(), DRAWSEGMENT::SetArcStart(), and DRAWSEGMENT::SetCenter().

Referenced by DRAWING_TOOL::drawArc().

1096 {
1097  auto vec = aMgr.GetOrigin();
1098 
1099  aArc.SetCenter( { vec.x, vec.y } );
1100 
1101  vec = aMgr.GetStartRadiusEnd();
1102  aArc.SetArcStart( { vec.x, vec.y } );
1103 
1104  aArc.SetAngle( RAD2DECIDEG( -aMgr.GetSubtended() ) );
1105 }
void SetArcStart(const wxPoint &aArcStartPoint)
Initialize the start arc point.
double RAD2DECIDEG(double rad)
Definition: trigo.h:204
void SetCenter(const wxPoint &aCenterPoint)
For arcs and circles:
double GetSubtended() const
Get the angle of the vector leading to the end point (valid if step >= SET_ANGLE) ...
void SetAngle(double aAngle)
Function SetAngle sets the angle for arcs, and normalizes it within the range 0 - 360 degrees...
VECTOR2I GetOrigin() const
Get the centre point of the arc (valid when state > SET_ORIGIN)
VECTOR2I GetStartRadiusEnd() const
Get the coordinates of the arc start

Variable Documentation

TOOL_ACTION closeZoneOutline("pcbnew.InteractiveDrawing.closeZoneOutline", AS_CONTEXT, 0, _("Close Zone Outline"), _("Close the outline of a zone in progress"), checked_ok_xpm)
static
TOOL_ACTION deleteLastPoint("pcbnew.InteractiveDrawing.deleteLastPoint", AS_CONTEXT, WXK_BACK, _("Delete Last Point"), _("Delete the last point added to the current item"), undo_xpm)
static