|
KiCad PCB EDA Suite
|
Template base for SHAPE_DRAW_BEHAVIOR implementations that wrap a MULTISTEP_GEOM_MANAGER and an assistant. More...
#include <managed_draw_behavior.h>
Public Member Functions | |
| 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. | |
| AssistantT & | GetAssistant () override |
| Return the visual assistant overlay item. | |
| void | SetUnits (EDA_UNITS aUnits) override |
| Forward a units change to the assistant overlay. | |
| virtual void | ToggleClockwise () |
| Flip arc direction (applies only when the shape has such a concept of directionality, e.g. | |
| virtual void | SetAngleSnap (bool aSnap) |
| Enable or disable angle snapping (circular arcs only; no-op for others). | |
| virtual bool | OnProperties (EDA_SHAPE &aShape) |
| Called when the user invokes the properties action mid-draw. | |
| virtual void | ApplyToShape (EDA_SHAPE &aShape) const =0 |
| Transfer the current geometry to an EDA_SHAPE. | |
Protected Attributes | |
| ManagerT | m_manager |
| AssistantT | m_assistant |
Template base for SHAPE_DRAW_BEHAVIOR implementations that wrap a MULTISTEP_GEOM_MANAGER and an assistant.
Provides the standard pass-through methods (IsStarted, AddPoint, etc.) so that concrete classes only need to supply ApplyToShape() and any shape-specific geometry accessors.
| ManagerT | the geometry-manager type (e.g. ARC_GEOM_MANAGER). |
| AssistantT | the visual-assistant type (e.g. ARC_ASSISTANT). |
Definition at line 41 of file managed_draw_behavior.h.
|
inline |
Definition at line 46 of file managed_draw_behavior.h.
References m_assistant, and m_manager.
|
inlineoverridevirtual |
Lock in a point and advance the construction state.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 67 of file managed_draw_behavior.h.
References m_manager.
|
pure virtualinherited |
Transfer the current geometry to an EDA_SHAPE.
Implemented in ARC_DRAW_BEHAVIOR, BEZIER_DRAW_BEHAVIOR, and ELLIPSE_ARC_DRAW_BEHAVIOR.
Referenced by DRAWING_TOOL::drawManagedShape(), and EE_GRAPHIC_TOOL::drawManagedShape().
|
inlineoverridevirtual |
Reset the geometry-changed flag (call after updating the preview).
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 58 of file managed_draw_behavior.h.
References m_manager.
|
inlineoverridevirtual |
Return the visual assistant overlay item.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 73 of file managed_draw_behavior.h.
References m_assistant.
|
inlineoverridevirtual |
Return the current construction step (0-based, shape-specific meaning).
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 61 of file managed_draw_behavior.h.
References m_manager.
|
inlineoverridevirtual |
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.
References m_manager.
|
inlineoverridevirtual |
True when all points have been locked in.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 56 of file managed_draw_behavior.h.
References m_manager.
|
inlinevirtualinherited |
Called when the user invokes the properties action mid-draw.
Reimplemented in ARC_DRAW_BEHAVIOR.
Definition at line 91 of file shape_draw_behavior.h.
Referenced by DRAWING_TOOL::drawManagedShape().
|
inlineoverridevirtual |
Undo the last locked-in point.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 69 of file managed_draw_behavior.h.
References m_manager.
|
inlineoverridevirtual |
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.
References m_manager.
|
inlinevirtualinherited |
Enable or disable angle snapping (circular arcs only; no-op for others).
Reimplemented in ARC_DRAW_BEHAVIOR.
Definition at line 83 of file shape_draw_behavior.h.
Referenced by DRAWING_TOOL::drawManagedShape().
|
inlineoverridevirtual |
Preview the cursor position without advancing state.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 68 of file managed_draw_behavior.h.
References m_manager.
|
inlineoverridevirtual |
Forward a units change to the assistant overlay.
Implements SHAPE_DRAW_BEHAVIOR.
Definition at line 74 of file managed_draw_behavior.h.
References m_assistant.
|
inlinevirtualinherited |
Flip arc direction (applies only when the shape has such a concept of directionality, e.g.
circular arcs).
Reimplemented in ARC_DRAW_BEHAVIOR.
Definition at line 80 of file shape_draw_behavior.h.
Referenced by DRAWING_TOOL::drawManagedShape(), and EE_GRAPHIC_TOOL::drawManagedShape().
|
protected |
Definition at line 78 of file managed_draw_behavior.h.
Referenced by GetAssistant(), MANAGED_DRAW_BEHAVIOR(), and SetUnits().
|
protected |
Definition at line 77 of file managed_draw_behavior.h.
Referenced by AddPoint(), ClearGeometryChanged(), GetStep(), HasGeometryChanged(), IsComplete(), MANAGED_DRAW_BEHAVIOR(), RemoveLastPoint(), Reset(), and SetCursorPosition().