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

An adjunct helper to the DRAWING_TOOL interactive tool, which handles incoming geometry changes from a POLYGON_GEOM_MANAGER and translates that into a SCH_RULE_AREA based on given parameters. More...

#include <rule_area_create_helper.h>

Inheritance diagram for RULE_AREA_CREATE_HELPER:
POLYGON_GEOM_MANAGER::CLIENT

Public Member Functions

 RULE_AREA_CREATE_HELPER (KIGFX::VIEW &aView, SCH_EDIT_FRAME *aFrame, TOOL_MANAGER *aMgr)
 
virtual ~RULE_AREA_CREATE_HELPER ()
 
SCH_RULE_AREAGetRuleArea () const
 
void OnGeometryChange (const POLYGON_GEOM_MANAGER &aMgr) override
 Called when the polygon is complete.
 
bool OnFirstPoint (POLYGON_GEOM_MANAGER &aMgr) override
 Called before the first point is added - clients can do initialization here, and can veto the start of the process (e.g.
 
void OnComplete (const POLYGON_GEOM_MANAGER &aMgr) override
 
std::unique_ptr< SCH_RULE_AREAcreateNewRuleArea ()
 Create a new SCH_RULE_AREA.
 
void commitRuleArea (std::unique_ptr< SCH_RULE_AREA > aRuleArea)
 Commit the current rule area in progress to the schematic.
 

Private Attributes

KIGFX::PREVIEW::POLYGON_ITEM m_previewItem
 < The preview item to display
 
KIGFX::VIEWm_parentView
 The active schematic edit frame.
 
SCH_EDIT_FRAMEm_frame
 The rule area in progress.
 
std::unique_ptr< SCH_RULE_AREAm_rule_area
 The TOOL_MANAGER running the tool.
 
TOOL_MANAGERm_toolManager
 

Detailed Description

An adjunct helper to the DRAWING_TOOL interactive tool, which handles incoming geometry changes from a POLYGON_GEOM_MANAGER and translates that into a SCH_RULE_AREA based on given parameters.

Definition at line 44 of file rule_area_create_helper.h.

Constructor & Destructor Documentation

◆ RULE_AREA_CREATE_HELPER()

RULE_AREA_CREATE_HELPER::RULE_AREA_CREATE_HELPER ( KIGFX::VIEW aView,
SCH_EDIT_FRAME aFrame,
TOOL_MANAGER aMgr 
)

Definition at line 35 of file rule_area_create_helper.cpp.

References KIGFX::VIEW::Add(), m_parentView, and m_previewItem.

◆ ~RULE_AREA_CREATE_HELPER()

RULE_AREA_CREATE_HELPER::~RULE_AREA_CREATE_HELPER ( )
virtual

Member Function Documentation

◆ commitRuleArea()

void RULE_AREA_CREATE_HELPER::commitRuleArea ( std::unique_ptr< SCH_RULE_AREA aRuleArea)

Commit the current rule area in progress to the schematic.

Parameters
aRuleAreais the drawn rule area outline to commit.

Definition at line 62 of file rule_area_create_helper.cpp.

References _, COMMIT::Add(), EE_ACTIONS::addItemToSel, KIGFX::VIEW::ClearPreview(), SCH_EDIT_FRAME::GetScreen(), m_frame, m_parentView, m_toolManager, SCH_COMMIT::Push(), and TOOL_MANAGER::RunAction().

Referenced by OnComplete().

◆ createNewRuleArea()

std::unique_ptr< SCH_RULE_AREA > RULE_AREA_CREATE_HELPER::createNewRuleArea ( )

Create a new SCH_RULE_AREA.

Returns
the new rule area, can be null if the user aborted

Definition at line 52 of file rule_area_create_helper.cpp.

Referenced by OnFirstPoint().

◆ GetRuleArea()

SCH_RULE_AREA * RULE_AREA_CREATE_HELPER::GetRuleArea ( ) const
inline

Definition at line 51 of file rule_area_create_helper.h.

References m_rule_area.

◆ OnComplete()

◆ OnFirstPoint()

bool RULE_AREA_CREATE_HELPER::OnFirstPoint ( POLYGON_GEOM_MANAGER aMgr)
overridevirtual

◆ OnGeometryChange()

Member Data Documentation

◆ m_frame

SCH_EDIT_FRAME* RULE_AREA_CREATE_HELPER::m_frame
private

The rule area in progress.

Definition at line 84 of file rule_area_create_helper.h.

Referenced by commitRuleArea(), and OnFirstPoint().

◆ m_parentView

KIGFX::VIEW& RULE_AREA_CREATE_HELPER::m_parentView
private

The active schematic edit frame.

Definition at line 81 of file rule_area_create_helper.h.

Referenced by commitRuleArea(), OnComplete(), OnFirstPoint(), OnGeometryChange(), RULE_AREA_CREATE_HELPER(), and ~RULE_AREA_CREATE_HELPER().

◆ m_previewItem

KIGFX::PREVIEW::POLYGON_ITEM RULE_AREA_CREATE_HELPER::m_previewItem
private

< The preview item to display

view that show the preview item

Definition at line 78 of file rule_area_create_helper.h.

Referenced by OnComplete(), OnFirstPoint(), OnGeometryChange(), RULE_AREA_CREATE_HELPER(), and ~RULE_AREA_CREATE_HELPER().

◆ m_rule_area

std::unique_ptr<SCH_RULE_AREA> RULE_AREA_CREATE_HELPER::m_rule_area
private

The TOOL_MANAGER running the tool.

Definition at line 87 of file rule_area_create_helper.h.

Referenced by GetRuleArea(), OnComplete(), OnFirstPoint(), and OnGeometryChange().

◆ m_toolManager

TOOL_MANAGER* RULE_AREA_CREATE_HELPER::m_toolManager
private

Definition at line 90 of file rule_area_create_helper.h.

Referenced by commitRuleArea(), and OnFirstPoint().


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