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

A textbox is edited as a rectnagle when it is orthogonally aligned. More...

Inheritance diagram for TEXTBOX_POINT_EDIT_BEHAVIOR:
POINT_EDIT_BEHAVIOR

Public Member Functions

 TEXTBOX_POINT_EDIT_BEHAVIOR (SCH_TEXTBOX &aTextbox)
 
void MakePoints (EDIT_POINTS &aPoints) override
 Construct the initial set of edit points for the item and append to the given list.
 
void UpdatePoints (EDIT_POINTS &aPoints) override
 Update the list of the edit points for the item.
 
void UpdateItem (const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints, COMMIT &aCommit, std::vector< EDA_ITEM * > &aUpdatedItems) override
 Update the item with the new positions of the edit points.
 
 TEXTBOX_POINT_EDIT_BEHAVIOR (PCB_TEXTBOX &aTextbox)
 
void MakePoints (EDIT_POINTS &aPoints) override
 Construct the initial set of edit points for the item and append to the given list.
 
void UpdatePoints (EDIT_POINTS &aPoints) override
 Update the list of the edit points for the item.
 
void UpdateItem (const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints, COMMIT &aCommit, std::vector< EDA_ITEM * > &aUpdatedItems) override
 Update the item with the new positions of the edit points.
 
virtual OPT_VECTOR2I Get45DegreeConstrainer (const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints) const
 Get the 45-degree constrainer for the item, when the given point is moved.
 

Static Protected Member Functions

static bool isModified (const EDIT_POINT &aEditedPoint, const EDIT_POINT &aPoint)
 Checks if two points are the same instance - which means the point is being edited.
 

Private Attributes

SCH_TEXTBOXm_textbox
 
PCB_TEXTBOXm_textbox
 

Detailed Description

A textbox is edited as a rectnagle when it is orthogonally aligned.

Definition at line 712 of file ee_point_editor.cpp.

Constructor & Destructor Documentation

◆ TEXTBOX_POINT_EDIT_BEHAVIOR() [1/2]

TEXTBOX_POINT_EDIT_BEHAVIOR::TEXTBOX_POINT_EDIT_BEHAVIOR ( SCH_TEXTBOX aTextbox)
inline

Definition at line 715 of file ee_point_editor.cpp.

◆ TEXTBOX_POINT_EDIT_BEHAVIOR() [2/2]

TEXTBOX_POINT_EDIT_BEHAVIOR::TEXTBOX_POINT_EDIT_BEHAVIOR ( PCB_TEXTBOX aTextbox)
inline

Definition at line 1793 of file pcb_point_editor.cpp.

Member Function Documentation

◆ Get45DegreeConstrainer()

virtual OPT_VECTOR2I POINT_EDIT_BEHAVIOR::Get45DegreeConstrainer ( const EDIT_POINT aEditedPoint,
EDIT_POINTS aPoints 
) const
inlinevirtualinherited

Get the 45-degree constrainer for the item, when the given point is moved.

Return std::nullopt if not, and the caller can decide.

If you want to actively disable constraining, return the aEditedPoint position.

Reimplemented in EDA_SEGMENT_POINT_EDIT_BEHAVIOR, EDA_CIRCLE_POINT_EDIT_BEHAVIOR, ARC_POINT_EDIT_BEHAVIOR, ALIGNED_DIMENSION_POINT_EDIT_BEHAVIOR, DIM_CENTER_POINT_EDIT_BEHAVIOR, and DIM_RADIAL_POINT_EDIT_BEHAVIOR.

Definition at line 96 of file point_editor_behavior.h.

◆ isModified()

◆ MakePoints() [1/2]

void TEXTBOX_POINT_EDIT_BEHAVIOR::MakePoints ( EDIT_POINTS aPoints)
inlineoverridevirtual

Construct the initial set of edit points for the item and append to the given list.

Parameters
aPointsThe list of edit points to fill.

Implements POINT_EDIT_BEHAVIOR.

Definition at line 717 of file ee_point_editor.cpp.

References m_textbox, RECTANGLE_POINT_EDIT_BEHAVIOR::MakePoints(), and SCH_SHAPE::Normalize().

Referenced by UpdatePoints().

◆ MakePoints() [2/2]

void TEXTBOX_POINT_EDIT_BEHAVIOR::MakePoints ( EDIT_POINTS aPoints)
inlineoverridevirtual

Construct the initial set of edit points for the item and append to the given list.

Parameters
aPointsThe list of edit points to fill.

Implements POINT_EDIT_BEHAVIOR.

Definition at line 1795 of file pcb_point_editor.cpp.

References EDA_SHAPE::GetShape(), m_textbox, and RECTANGLE_POINT_EDIT_BEHAVIOR::MakePoints().

◆ UpdateItem() [1/2]

void TEXTBOX_POINT_EDIT_BEHAVIOR::UpdateItem ( const EDIT_POINT aEditedPoint,
EDIT_POINTS aPoints,
COMMIT aCommit,
std::vector< EDA_ITEM * > &  aUpdatedItems 
)
inlineoverridevirtual

Update the item with the new positions of the edit points.

This method should all commit and add to the update list anything that is NOT the parent item of the EDIT_POINTs. For example, connected lines, parent tables, etc. The item itself is already handled (most behaviors don't need more than that).

Parameters
aEditedPointThe point that was dragged. You can use this to check by address which point to update.
aPointsThe new positions of the edit points.
aCommitThe commit object to use to modify the item.
aUpdatedItemsThe list of items that were updated by the edit (not only the item that was being edited, but also any other items that were affected, e.g. by being conneted to the edited item).

Implements POINT_EDIT_BEHAVIOR.

Definition at line 732 of file ee_point_editor.cpp.

References EDA_TEXT::ClearRenderCache(), m_textbox, and RECTANGLE_POINT_EDIT_BEHAVIOR::UpdateItem().

◆ UpdateItem() [2/2]

void TEXTBOX_POINT_EDIT_BEHAVIOR::UpdateItem ( const EDIT_POINT aEditedPoint,
EDIT_POINTS aPoints,
COMMIT aCommit,
std::vector< EDA_ITEM * > &  aUpdatedItems 
)
inlineoverridevirtual

Update the item with the new positions of the edit points.

This method should all commit and add to the update list anything that is NOT the parent item of the EDIT_POINTs. For example, connected lines, parent tables, etc. The item itself is already handled (most behaviors don't need more than that).

Parameters
aEditedPointThe point that was dragged. You can use this to check by address which point to update.
aPointsThe new positions of the edit points.
aCommitThe commit object to use to modify the item.
aUpdatedItemsThe list of items that were updated by the edit (not only the item that was being edited, but also any other items that were affected, e.g. by being conneted to the edited item).

Implements POINT_EDIT_BEHAVIOR.

Definition at line 1834 of file pcb_point_editor.cpp.

References EDA_SHAPE::GetShape(), m_textbox, and RECTANGLE_POINT_EDIT_BEHAVIOR::UpdateItem().

◆ UpdatePoints() [1/2]

void TEXTBOX_POINT_EDIT_BEHAVIOR::UpdatePoints ( EDIT_POINTS aPoints)
inlineoverridevirtual

Update the list of the edit points for the item.

Be very careful not to overrun the list of points - this class knows how bug there are because it made them in the first place.

If item has changed such that that number of points needs to change, this method has to handle that (probably by clearing the list and refilling it).

Parameters
aPointsThe list of edit points to update.

Implements POINT_EDIT_BEHAVIOR.

Definition at line 723 of file ee_point_editor.cpp.

References m_textbox, SCH_SHAPE::Normalize(), and RECTANGLE_POINT_EDIT_BEHAVIOR::UpdatePoints().

◆ UpdatePoints() [2/2]

void TEXTBOX_POINT_EDIT_BEHAVIOR::UpdatePoints ( EDIT_POINTS aPoints)
inlineoverridevirtual

Update the list of the edit points for the item.

Be very careful not to overrun the list of points - this class knows how bug there are because it made them in the first place.

If item has changed such that that number of points needs to change, this method has to handle that (probably by clearing the list and refilling it).

Parameters
aPointsThe list of edit points to update.

Implements POINT_EDIT_BEHAVIOR.

Definition at line 1808 of file pcb_point_editor.cpp.

References EDIT_POINTS::Clear(), EDA_SHAPE::GetShape(), m_textbox, MakePoints(), EDIT_POINTS::PointsSize(), and RECTANGLE_POINT_EDIT_BEHAVIOR::UpdatePoints().

Member Data Documentation

◆ m_textbox [1/2]

SCH_TEXTBOX& TEXTBOX_POINT_EDIT_BEHAVIOR::m_textbox
private

Definition at line 740 of file ee_point_editor.cpp.

Referenced by MakePoints(), UpdateItem(), and UpdatePoints().

◆ m_textbox [2/2]

PCB_TEXTBOX& TEXTBOX_POINT_EDIT_BEHAVIOR::m_textbox
private

Definition at line 1844 of file pcb_point_editor.cpp.


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