KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ARC_DRAW_BEHAVIOR Class Reference

Interactive arc drawing behaviour: center -> start -> end angle. More...

#include <arc_draw_behavior.h>

Inheritance diagram for ARC_DRAW_BEHAVIOR:
MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT > SHAPE_DRAW_BEHAVIOR

Public Member Functions

 ARC_DRAW_BEHAVIOR (const ARC_DRAW_BEHAVIOR &)=delete
 
ARC_DRAW_BEHAVIORoperator= (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.
 
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_ASSISTANTGetAssistant () 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
 

Detailed Description

Interactive arc drawing behaviour: center -> start -> end angle.

Definition at line 35 of file arc_draw_behavior.h.

Constructor & Destructor Documentation

◆ ARC_DRAW_BEHAVIOR()

ARC_DRAW_BEHAVIOR::ARC_DRAW_BEHAVIOR ( const ARC_DRAW_BEHAVIOR & )
delete

References ARC_DRAW_BEHAVIOR().

Referenced by ARC_DRAW_BEHAVIOR(), and operator=().

Member Function Documentation

◆ AddPoint()

void MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::AddPoint ( const VECTOR2I & aP)
inlineoverridevirtualinherited

Lock in a point and advance the construction state.

Implements SHAPE_DRAW_BEHAVIOR.

Definition at line 67 of file managed_draw_behavior.h.

◆ ApplyToShape()

void ARC_DRAW_BEHAVIOR::ApplyToShape ( EDA_SHAPE & aShape) const
inlineoverridevirtual

◆ ClearGeometryChanged()

void MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::ClearGeometryChanged ( )
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.

◆ GetAssistant()

Return the visual assistant overlay item.

Implements SHAPE_DRAW_BEHAVIOR.

Definition at line 73 of file managed_draw_behavior.h.

◆ GetStep()

int MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::GetStep ( ) const
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.

◆ HasGeometryChanged()

bool MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::HasGeometryChanged ( ) const
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.

◆ IsComplete()

bool MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::IsComplete ( ) const
inlineoverridevirtualinherited

True when all points have been locked in.

Implements SHAPE_DRAW_BEHAVIOR.

Definition at line 56 of file managed_draw_behavior.h.

◆ MANAGED_DRAW_BEHAVIOR()

MANAGED_DRAW_BEHAVIOR< ManagerT, AssistantT >::MANAGED_DRAW_BEHAVIOR ( const EDA_IU_SCALE & aIuScale,
EDA_UNITS aUnits )
inline

Definition at line 46 of file managed_draw_behavior.h.

◆ OnProperties()

bool ARC_DRAW_BEHAVIOR::OnProperties ( EDA_SHAPE & aShape)
inlineoverridevirtual

Called when the user invokes the properties action mid-draw.

Returns
true if the behavior handled the request (the event loop should continue); false if the event should be passed on.

Reimplemented from SHAPE_DRAW_BEHAVIOR.

Definition at line 46 of file arc_draw_behavior.h.

References ANGLE_90, MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager, KIGFX::PREVIEW::ARC_GEOM_MANAGER::SET_ANGLE, KIGFX::PREVIEW::ARC_GEOM_MANAGER::SET_START, and EDA_SHAPE::SetArcAngleAndEnd().

◆ operator=()

ARC_DRAW_BEHAVIOR & ARC_DRAW_BEHAVIOR::operator= ( const ARC_DRAW_BEHAVIOR & )
delete

References ARC_DRAW_BEHAVIOR().

◆ RemoveLastPoint()

void MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::RemoveLastPoint ( )
inlineoverridevirtualinherited

Undo the last locked-in point.

Implements SHAPE_DRAW_BEHAVIOR.

Definition at line 69 of file managed_draw_behavior.h.

◆ Reset()

void MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::Reset ( )
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.

◆ SetAngleSnap()

void ARC_DRAW_BEHAVIOR::SetAngleSnap ( bool aSnap)
inlineoverridevirtual

Enable or disable angle snapping (circular arcs only; no-op for others).

Reimplemented from SHAPE_DRAW_BEHAVIOR.

Definition at line 43 of file arc_draw_behavior.h.

References MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager.

◆ SetCursorPosition()

void MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::SetCursorPosition ( const VECTOR2I & aP)
inlineoverridevirtualinherited

Preview the cursor position without advancing state.

Implements SHAPE_DRAW_BEHAVIOR.

Definition at line 68 of file managed_draw_behavior.h.

◆ SetUnits()

void MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::SetUnits ( EDA_UNITS aUnits)
inlineoverridevirtualinherited

Forward a units change to the assistant overlay.

Implements SHAPE_DRAW_BEHAVIOR.

Definition at line 74 of file managed_draw_behavior.h.

◆ ToggleClockwise()

void ARC_DRAW_BEHAVIOR::ToggleClockwise ( )
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 44 of file arc_draw_behavior.h.

References MANAGED_DRAW_BEHAVIOR< KIGFX::PREVIEW::ARC_GEOM_MANAGER, KIGFX::PREVIEW::ARC_ASSISTANT >::m_manager.

Member Data Documentation

◆ m_assistant

◆ m_manager


The documentation for this class was generated from the following file: