|
KiCad PCB EDA Suite
|
Interactive arc drawing behaviour. More...
#include <arc_draw_behavior.h>
Public Member Functions | |
| ARC_DRAW_BEHAVIOR (const ARC_DRAW_BEHAVIOR &)=delete | |
| ARC_DRAW_BEHAVIOR & | operator= (const ARC_DRAW_BEHAVIOR &)=delete |
| void | SetAngleSnap (bool aSnap) override |
| Enable or disable angle snapping (circular arcs only; no-op for others). | |
| void | ToggleClockwise () override |
| Flip arc direction (applies only when the shape has such a concept of directionality, e.g. | |
| void | SetArcDrawMode (ARC_DRAW_MODE aMode) override |
| Select the construction sequence (circular arcs only; no-op for others). | |
| void | SetTangentSeed (const VECTOR2I &aStart, const VECTOR2D &aDirection, bool aDirectionIsAxis=false) override |
| Preload the start point and departure direction for ARC_DRAW_MODE::TANGENT. | |
| bool | OnProperties (EDA_SHAPE &aShape) override |
| Called when the user invokes the properties action mid-draw. | |
| void | ApplyToShape (EDA_SHAPE &aShape) const override |
| Transfer the current geometry to an EDA_SHAPE. | |
| MANAGED_DRAW_BEHAVIOR (const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits) | |
| bool | IsComplete () const override |
| True when all points have been locked in. | |
| bool | HasGeometryChanged () const override |
| True if the geometry changed since the last call to ClearGeometryChanged(). | |
| void | ClearGeometryChanged () override |
| Reset the geometry-changed flag (call after updating the preview). | |
| void | Reset () override |
| Reset the behaviour to its initial state for chained object creation loops. | |
| int | GetStep () const override |
| Return the current construction step (0-based, shape-specific meaning). | |
| void | AddPoint (const VECTOR2I &aP) override |
| Lock in a point and advance the construction state. | |
| void | SetCursorPosition (const VECTOR2I &aP) override |
| Preview the cursor position without advancing state. | |
| void | RemoveLastPoint () override |
| Undo the last locked-in point. | |
| KIGFX::PREVIEW::ARC_ASSISTANT & | GetAssistant () override |
| Return the visual assistant overlay item. | |
| void | SetUnits (EDA_UNITS aUnits) override |
| Forward a units change to the assistant overlay. | |
Protected Attributes | |
| KIGFX::PREVIEW::ARC_GEOM_MANAGER | m_manager |
| KIGFX::PREVIEW::ARC_ASSISTANT | m_assistant |
Interactive arc drawing behaviour.
The points to click depend on the arc draw mode, which defaults to center -> start -> end angle.
Definition at line 37 of file arc_draw_behavior.h.
|
delete |
References ARC_DRAW_BEHAVIOR().
Referenced by ARC_DRAW_BEHAVIOR(), and operator=().
|
inlineoverridevirtualinherited |
Lock in a point and advance the construction state.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 67 of file managed_draw_behavior.h.
|
inlineoverridevirtual |
Transfer the current geometry to an EDA_SHAPE.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 82 of file arc_draw_behavior.h.
References ANGLE_0, center, KIGEOM::ARC_SOLUTION::end, MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager, KIGEOM::ARC_SOLUTION::mid, EDA_SHAPE::SetArcGeometry(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), and KIGEOM::ARC_SOLUTION::start.
Referenced by OnProperties().
|
inlineoverridevirtualinherited |
Reset the geometry-changed flag (call after updating the preview).
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 58 of file managed_draw_behavior.h.
|
inlineoverridevirtualinherited |
Return the visual assistant overlay item.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 73 of file managed_draw_behavior.h.
|
inlineoverridevirtualinherited |
Return the current construction step (0-based, shape-specific meaning).
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 61 of file managed_draw_behavior.h.
|
inlineoverridevirtualinherited |
True if the geometry changed since the last call to ClearGeometryChanged().
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 57 of file managed_draw_behavior.h.
|
inlineoverridevirtualinherited |
True when all points have been locked in.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 56 of file managed_draw_behavior.h.
|
inline |
Definition at line 46 of file managed_draw_behavior.h.
|
inlineoverridevirtual |
Called when the user invokes the properties action mid-draw.
Reimplemented from SHAPE_DRAW_BEHAVIOR.
Definition at line 55 of file arc_draw_behavior.h.
References ANGLE_90, ApplyToShape(), MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager, KIGFX::PREVIEW::ARC_GEOM_MANAGER::SECOND_POINT, EDA_SHAPE::SetArcAngleAndEnd(), and KIGFX::PREVIEW::ARC_GEOM_MANAGER::THIRD_POINT.
|
delete |
References ARC_DRAW_BEHAVIOR().
|
inlineoverridevirtualinherited |
Undo the last locked-in point.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 69 of file managed_draw_behavior.h.
|
inlineoverridevirtualinherited |
Reset the behaviour to its initial state for chained object creation loops.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 59 of file managed_draw_behavior.h.
|
inlineoverridevirtual |
Enable or disable angle snapping (circular arcs only; no-op for others).
Reimplemented from SHAPE_DRAW_BEHAVIOR.
Definition at line 45 of file arc_draw_behavior.h.
References MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager.
|
inlineoverridevirtual |
Select the construction sequence (circular arcs only; no-op for others).
Switching mid-draw keeps the first locked point when it is an arc start in both modes, which is every mode except CENTER_START_END; otherwise construction restarts.
Reimplemented from SHAPE_DRAW_BEHAVIOR.
Definition at line 48 of file arc_draw_behavior.h.
References MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager.
|
inlineoverridevirtualinherited |
Preview the cursor position without advancing state.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 68 of file managed_draw_behavior.h.
|
inlineoverridevirtual |
Preload the start point and departure direction for ARC_DRAW_MODE::TANGENT.
Reset() clears the seed, so call this after Reset() and before the first AddPoint(). Without a seed, TANGENT takes its start and direction from clicks exactly like START_DIR_END.
| aDirectionIsAxis | false when aDirection is the signed departure direction (continuing from an endpoint); true when only the tangent line is known (starting inside an item), in which case the sign giving the smaller sweep to the cursor is used and ToggleClockwise() flips it. |
Reimplemented from SHAPE_DRAW_BEHAVIOR.
Definition at line 50 of file arc_draw_behavior.h.
References MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager.
|
inlineoverridevirtualinherited |
Forward a units change to the assistant overlay.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 74 of file managed_draw_behavior.h.
|
inlineoverridevirtual |
Flip arc direction (applies only when the shape has such a concept of directionality, e.g.
circular arcs).
Reimplemented from SHAPE_DRAW_BEHAVIOR.
Definition at line 46 of file arc_draw_behavior.h.
References MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager.
|
protectedinherited |
Definition at line 78 of file managed_draw_behavior.h.
|
protectedinherited |
Definition at line 77 of file managed_draw_behavior.h.
Referenced by ARC_DRAW_BEHAVIOR::ApplyToShape(), ARC_DRAW_BEHAVIOR::OnProperties(), ARC_DRAW_BEHAVIOR::SetAngleSnap(), ARC_DRAW_BEHAVIOR::SetArcDrawMode(), ARC_DRAW_BEHAVIOR::SetTangentSeed(), and ARC_DRAW_BEHAVIOR::ToggleClockwise().