KiCad PCB EDA Suite
drawing_tool.cpp File Reference
#include "drawing_tool.h"
#include "geometry/shape_rect.h"
#include <pgm_base.h>
#include <settings/settings_manager.h>
#include <pcbnew_settings.h>
#include <footprint_editor_settings.h>
#include <dialogs/dialog_text_properties.h>
#include <dialogs/dialog_track_via_size.h>
#include <geometry/geometry_utils.h>
#include <geometry/shape_segment.h>
#include <import_gfx/dialog_import_gfx.h>
#include <preview_items/two_point_assistant.h>
#include <preview_items/two_point_geom_manager.h>
#include <ratsnest/ratsnest_data.h>
#include <router/router_tool.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_grid_helper.h>
#include <tools/pcb_selection_tool.h>
#include <tools/tool_event_utils.h>
#include <tools/zone_create_helper.h>
#include <tools/zone_filler_tool.h>
#include <view/view.h>
#include <widgets/appearance_controls.h>
#include <widgets/wx_infobar.h>
#include <wx/filedlg.h>
#include <bitmaps.h>
#include <board.h>
#include <board_commit.h>
#include <board_design_settings.h>
#include <confirm.h>
#include <footprint.h>
#include <fp_shape.h>
#include <fp_textbox.h>
#include <macros.h>
#include <painter.h>
#include <pcb_edit_frame.h>
#include <pcb_group.h>
#include <pcb_bitmap.h>
#include <pcb_text.h>
#include <pcb_textbox.h>
#include <pcb_dimension.h>
#include <pcbnew_id.h>
#include <preview_items/arc_assistant.h>
#include <scoped_set_reset.h>
#include <status_popup.h>
#include <string_utils.h>
#include <zone.h>

Go to the source code of this file.

Classes

class  VIA_SIZE_MENU
 

Macros

#define TOGGLE(a)   a = !a
 

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...
 

Macro Definition Documentation

◆ TOGGLE

#define TOGGLE (   a)    a = !a

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 2172 of file drawing_tool.cpp.

2174{
2175 VECTOR2I vec = aMgr.GetOrigin();
2176
2177 aArc.SetCenter( vec );
2178
2179 if( aMgr.GetSubtended() < ANGLE_0 )
2180 {
2181 vec = aMgr.GetStartRadiusEnd();
2182 aArc.SetStart( vec );
2183 vec = aMgr.GetEndRadiusEnd();
2184 aArc.SetEnd( vec );
2185 }
2186 else
2187 {
2188 vec = aMgr.GetEndRadiusEnd();
2189 aArc.SetStart( vec );
2190 vec = aMgr.GetStartRadiusEnd();
2191 aArc.SetEnd( vec );
2192 }
2193}
void SetCenter(const VECTOR2I &aCenter)
Definition: eda_shape.cpp:470
void SetStart(const VECTOR2I &aStart)
Definition: eda_shape.h:124
void SetEnd(const VECTOR2I &aEnd)
Definition: eda_shape.h:149
VECTOR2I GetOrigin() const
< Get the center point of the arc (valid when state > SET_ORIGIN)
VECTOR2I GetStartRadiusEnd() const
Get the coordinates of the arc end point.
VECTOR2I GetEndRadiusEnd() const
Get the radius of the arc (valid if step >= SET_START)
static constexpr EDA_ANGLE & ANGLE_0
Definition: eda_angle.h:429

References ANGLE_0, KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetEndRadiusEnd(), KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetOrigin(), KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetStartRadiusEnd(), KIGFX::PREVIEW::ARC_GEOM_MANAGER::GetSubtended(), 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