61 switch( aRelation.
Kind() )
89 if( !reference || !secondary )
109 default:
return std::nullopt;
171 std::pair<EDA_ITEM*, int> connectedStart = {
nullptr,
STARTPOINT };
172 std::pair<EDA_ITEM*, int> connectedEnd = {
nullptr,
STARTPOINT };
190 connectedStart = { testLine,
ENDPOINT };
198 connectedEnd = { testLine,
ENDPOINT };
214 std::vector<EDA_ITEM*>& aUpdatedItems )
override
221 if( connected.first )
224 aUpdatedItems.push_back( connected.first );
227 static_cast<SCH_LINE*
>( connected.first )->SetStartPoint(
m_line.GetStartPoint() );
228 else if( connected.second ==
ENDPOINT )
229 static_cast<SCH_LINE*
>( connected.first )->SetEndPoint(
m_line.GetStartPoint() );
234 if( connected.first )
237 aUpdatedItems.push_back( connected.first );
240 static_cast<SCH_LINE*
>( connected.first )->SetStartPoint(
m_line.GetEndPoint() );
241 else if( connected.second ==
ENDPOINT )
242 static_cast<SCH_LINE*
>( connected.first )->SetEndPoint(
m_line.GetEndPoint() );
289 std::vector<EDA_ITEM*>& aUpdatedItems )
override
302 const VECTOR2I newOffset = xfrmOrigin - ( topLeft + botRight ) / 2;
317 oldCorner -= oldSize / 2;
321 newCorner = topRight;
322 oldCorner -=
VECTOR2I( -oldSize.
x, oldSize.
y ) / 2;
327 oldCorner -=
VECTOR2I( oldSize.
x, -oldSize.
y ) / 2;
331 newCorner = botRight;
332 oldCorner += oldSize / 2;
338 *newCorner -= xfrmOrigin;
339 oldCorner -= oldOrigin;
342 if(
sign( newCorner->x ) !=
sign( oldCorner.
x )
343 ||
sign( newCorner->y ) !=
sign( oldCorner.
y ) )
351 double ratio = oldLength > 0 ? ( newLength / oldLength ) : 1.0;
357 ratio = std::min( newWidth / oldSize.
x, newHeight / oldSize.
y );
363 aUpdatedItems.push_back( &
m_bitmap );
382 std::vector<EDA_ITEM*>& aUpdatedItems )
override
385 bool rotated = !
m_cell.GetTextAngle().IsHorizontal();
388 aUpdatedItems.push_back( &
table );
398 for(
int ii = 0; ii <
m_cell.GetColSpan() - 1; ++ii )
399 colWidth -=
table.GetColWidth(
m_cell.GetColumn() + ii );
407 int rowHeight =
m_cell.GetRectangleWidth();
409 for(
int ii = 0; ii <
m_cell.GetRowSpan() - 1; ++ii )
410 rowHeight -=
table.GetRowHeight(
m_cell.GetRow() + ii );
421 int colWidth =
m_cell.GetRectangleWidth();
423 for(
int ii = 0; ii <
m_cell.GetColSpan() - 1; ++ii )
424 colWidth -=
table.GetColWidth(
m_cell.GetColumn() + ii );
432 int rowHeight =
m_cell.GetRectangleHeight();
434 for(
int ii = 0; ii <
m_cell.GetRowSpan() - 1; ++ii )
435 rowHeight -=
table.GetRowHeight(
m_cell.GetRow() + ii );
515 topLeft.
x = std::min( topLeft.
x, botRight.
x - minWidth );
516 topLeft.
y = std::min( topLeft.
y, botRight.
y - minHeight );
519 topRight.
y = topLeft.
y;
520 botLeft.
x = topLeft.
x;
525 topRight.
x = std::max( topRight.
x, botLeft.
x + minWidth );
526 topRight.
y = std::min( topRight.
y, botLeft.
y - minHeight );
529 topLeft.
y = topRight.
y;
530 botRight.
x = topRight.
x;
535 botLeft.
x = std::min( botLeft.
x, topRight.
x - minWidth );
536 botLeft.
y = std::max( botLeft.
y, topRight.
y + minHeight );
539 botRight.
y = botLeft.
y;
540 topLeft.
x = botLeft.
x;
545 botRight.
x = std::max( botRight.
x, topLeft.
x + minWidth );
546 botRight.
y = std::max( botRight.
y, topLeft.
y + minHeight );
549 botLeft.
y = botRight.
y;
550 topRight.
x = botRight.
x;
554 topLeft.
y = std::min( topLeft.
y, botRight.
y - minHeight );
558 topLeft.
x = std::min( topLeft.
x, botRight.
x - minWidth );
562 botRight.
y = std::max( botRight.
y, topLeft.
y + minHeight );
566 botRight.
x = std::max( botRight.
x, topLeft.
x + minWidth );
578 int minWidth = std::max(
schIUScale.MilsToIU( 1 ), aMinSize.x );
579 int minHeight = std::max(
schIUScale.MilsToIU( 1 ), aMinSize.y );
582 topLeft, topRight, botLeft, botRight );
609 for(
unsigned i = 0; i < aPoints.
LinesSize(); ++i )
632 std::vector<EDA_ITEM*>& aUpdatedItems )
override
640 topLeft, topRight, botLeft, botRight );
643 std::vector<SEG> oldSegs;
644 std::vector<VECTOR2I> moveVecs;
655 m_rect.SetPosition( topLeft );
656 m_rect.SetEnd( botRight );
665 int width =
std::abs( botRight.
x - topLeft.
x );
666 int height =
std::abs( botRight.
y - topLeft.
y );
667 int maxRadius = std::min( width, height ) / 2;
669 x = std::clamp( x, botRight.
x - maxRadius, botRight.
x );
671 m_rect.SetCornerRadius( botRight.
x - x );
676 moveVecs.emplace_back( 0, topLeft.
y - oldBox.
GetTop() );
682 moveVecs.emplace_back( topLeft.
x - oldBox.
GetLeft(), 0 );
688 moveVecs.emplace_back( 0, botRight.
y - oldBox.
GetBottom() );
694 moveVecs.emplace_back( botRight.
x - oldBox.
GetRight(), 0 );
700 for(
unsigned i = 0; i < aPoints.
LinesSize(); ++i )
710 void dragPinsOnEdge(
const std::vector<SEG>& aOldEdges,
const std::vector<VECTOR2I>& aMoveVecs,
int aEdgeUnit,
711 COMMIT& aCommit, std::vector<EDA_ITEM*>& aUpdatedItems )
const
713 wxCHECK( aOldEdges.size() == aMoveVecs.size(), );
722 if( !
editor.GetSettings()->m_dragPinsAlongWithEdges )
727 wxCHECK( aEdgeUnit == 0 || aEdgeUnit ==
editor.GetUnit(), );
732 const auto getPinsOnSeg =
734 bool aIncludeEnds ) -> std::vector<SCH_PIN*>
736 std::vector<SCH_PIN*> pins;
743 if( aSeg.Contains( pinRootPos ) )
745 if( aIncludeEnds || ( pinRootPos != aSeg.A && pinRootPos != aSeg.B ) )
747 pins.push_back(
pin );
757 for( std::size_t i = 0; i < aOldEdges.size(); ++i )
759 if( aMoveVecs[i] ==
VECTOR2I( 0, 0 ) || !symbol )
762 const std::vector<SCH_PIN*> pins = getPinsOnSeg( *symbol, aEdgeUnit, aOldEdges[i],
false );
767 aUpdatedItems.push_back(
pin );
770 pin->Move( aMoveVecs[i] );
806 std::vector<EDA_ITEM*>& aUpdatedItems )
override
832 VECTOR2I pinPos = pin->GetPosition();
834 for( SCH_ITEM* item : m_screen.Items().Overlapping( SCH_LINE_T, pinPos ) )
836 SCH_LINE* line = static_cast<SCH_LINE*>( item );
838 if( !line->IsWire() && !line->IsBus() )
841 if( line->GetStartPoint() == pinPos )
842 m_connectedWires.push_back( { pin, line, STARTPOINT } );
843 else if( line->GetEndPoint() == pinPos )
844 m_connectedWires.push_back( { pin, line, ENDPOINT } );
882 std::vector<EDA_ITEM*>& aUpdatedItems )
override
896 editedTopRight =
true;
898 editedBotLeft =
true;
901 aEditedPoint, aPoints,
m_sheet.GetMinWidth( editedTopRight || editedBotRight ),
902 m_sheet.GetMinHeight( editedBotLeft || editedBotRight ), topLeft, topRight, botLeft,
910 sheetNewPos = topLeft;
911 sheetNewSize =
VECTOR2I( botRight.
x - topLeft.
x, botRight.
y - topLeft.
y );
932 for(
unsigned i = 0; i < aPoints.
LinesSize(); ++i )
940 if(
m_sheet.GetPosition() != sheetNewPos )
941 m_sheet.SetPositionIgnoringPins( sheetNewPos );
943 if(
m_sheet.GetSize() != sheetNewSize )
944 m_sheet.Resize( sheetNewSize );
949 if( noConnect->GetPosition() != sheetPin->GetTextPos() )
952 noConnect->SetPosition( sheetPin->GetTextPos() );
953 aUpdatedItems.push_back( noConnect );
961 bool needsUpdate =
false;
963 if( endpoint ==
STARTPOINT && line->GetStartPoint() != newPinPos )
965 else if( endpoint ==
ENDPOINT && line->GetEndPoint() != newPinPos )
973 line->SetStartPoint( newPinPos );
975 line->SetEndPoint( newPinPos );
977 aUpdatedItems.push_back( line );
999 switch( aItem->
Type() )
1033 maxError = schematic->Settings().m_MaxError;
1035 m_editBehavior = std::make_unique<EDA_BEZIER_POINT_EDIT_BEHAVIOR>( *shape, maxError );
1050 m_editBehavior = std::make_unique<EDA_POLYGON_POINT_EDIT_BEHAVIOR>( *shape );
1056 m_editBehavior = std::make_unique<TEXTBOX_POINT_EDIT_BEHAVIOR>( *textbox );
1062 m_editBehavior = std::make_unique<SCH_TABLECELL_POINT_EDIT_BEHAVIOR>( *cell, *
m_frame->GetScreen() );
1074 m_editBehavior = std::make_unique<BITMAP_POINT_EDIT_BEHAVIOR>( bitmap );
1161 const auto arcIsEdited = [&](
const SELECTION& aSelection ) ->
bool
1163 const EDA_ITEM* item = aSelection.Front();
1228 if( !
editor->IsSymbolGraphicallyEditable() )
1245 grid->SetPointEditProfile(
true );
1259 bool inDrag =
false;
1267 grid->SetUseGrid(
getView()->GetGAL()->GetGridSnapping()
1268 && !evt->DisableGridSnapping() );
1274 wxCHECK(
false, 0 );
1297 shape->SetHatchingDirty();
1298 shape->UpdateHatching();
1304 bool snap = !evt->DisableGridSnapping();
1307 bool angleRelation = relation
1311 if( angleRelation && relation->
Reference() )
1318 grid->SetAngleRestriction( std::nullopt, 0.0 );
1321 std::vector<VECTOR2I> stationarySelfPoints;
1322 std::vector<SEG> stationarySelfSegments;
1332 for(
unsigned i = 0; i <
m_editPoints->PointsSize(); ++i )
1338 || ( &point != &editedLine->
GetOrigin() && &point != &editedLine->
GetEnd() ) ) )
1340 stationarySelfPoints.push_back( point.
GetPosition() );
1344 for(
unsigned i = 0; i <
m_editPoints->LinesSize(); ++i )
1367 for(
unsigned i = 0; i <
m_editPoints->LinesSize() && i < 4; ++i )
1382 constexpr int arcStart = 0;
1383 constexpr int arcMid = 1;
1384 constexpr int arcEnd = 2;
1385 constexpr int arcCenter = 3;
1389 if( editedIndex != arcStart )
1390 stationarySelfPoints.push_back(
m_editPoints->Point( arcStart ).GetPosition() );
1392 if( editedIndex != arcEnd )
1393 stationarySelfPoints.push_back(
m_editPoints->Point( arcEnd ).GetPosition() );
1395 else if( editedIndex == arcStart || editedIndex == arcMid || editedIndex == arcEnd )
1397 stationarySelfPoints.push_back(
m_editPoints->Point( arcCenter ).GetPosition() );
1402 grid->SetStationarySelfGeometry( std::move( stationarySelfPoints ), std::move( stationarySelfSegments ) );
1403 grid->SetFeasibilityCallback( {} );
1405 if( relation && !angleRelation )
1409 grid->SetFeasibilityCallback(
1411 const std::vector<SNAP_CANDIDATE>& aCandidates )
1421 if( !
result.Accepted( authored.id ) )
1429 if( !
result.Accepted( candidate.id ) )
1451 else if( inDrag && evt->IsMouseUp(
BUT_LEFT ) )
1453 if( !commit.
Empty() )
1454 commit.
Push(
_(
"Move Point" ) );
1461 shape->SetHatchingDirty();
1462 shape->UpdateHatching();
1467 else if( evt->IsCancelInteractive() || evt->IsActivate() )
1493 shape->SetHatchingDirty();
1494 shape->UpdateHatching();
1501 else if( evt->IsCancelInteractive() )
1506 if( evt->IsActivate() )
1511 evt->SetPassEvent();
1531 shape->SetHatchingDirty();
1532 shape->UpdateHatching();
1547 m_frame->GetCanvas()->Refresh();
1566 std::vector<EDA_ITEM*> updatedItems;
1569 for(
EDA_ITEM* updatedItem : updatedItems )
1617 if(
m_frame->ToolStackIsEmpty() )
1667 return shape->
HitTest( cursorPos, (
int) threshold );
1687 int currentMinDistance = INT_MAX;
1688 int closestLineStart = 0;
1694 for(
unsigned i = 0; i < numPoints; ++i )
1699 if(
distance < currentMinDistance )
1702 closestLineStart = i;
1711 commit.
Push(
_(
"Add Corner" ) );
1756 commit.
Push(
_(
"Remove Corner" ) );
ARC_EDIT_MODE
Settings for arc editing.
@ KEEP_ENDPOINTS_OR_START_DIRECTION
Whe editing endpoints, the other end remains in place.
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
When editing endpoints, the angle and radius are adjusted.
constexpr EDA_IU_SCALE schIUScale
constexpr double ARC_LOW_DEF_MM
static TOOL_ACTION cycleArcEditMode
static TOOL_ACTION pointEditorArcKeepCenter
static TOOL_ACTION pointEditorArcKeepRadius
static TOOL_ACTION activatePointEditor
static TOOL_ACTION pointEditorArcKeepEndpoint
void MakePoints(EDIT_POINTS &aPoints) override
Construct the initial set of edit points for the item and append to the given list.
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.
bool UpdatePoints(EDIT_POINTS &aPoints) override
Update the list of the edit points for the item.
BITMAP_POINT_EDIT_BEHAVIOR(SCH_BITMAP &aBitmap)
static constexpr BOX2< VECTOR2I > ByCorners(const VECTOR2I &aCorner1, const VECTOR2I &aCorner2)
constexpr const Vec GetCenter() const
constexpr coord_type GetLeft() const
constexpr coord_type GetRight() const
constexpr coord_type GetTop() const
constexpr coord_type GetBottom() const
Represent a set of changes (additions, deletions or modifications) of a data model (e....
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
virtual void SetEnd(const VECTOR2I &aEnd)
SHAPE_POLY_SET & GetPolyShape()
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
wxString SHAPE_T_asString() const
int GetCornerRadius() const
EDA_TABLECELL_POINT_EDIT_BEHAVIOR(EDA_SHAPE &aCell)
Represent a line connecting two EDIT_POINTs.
void SetRelation(std::unique_ptr< EDIT_RELATION > aRelation)
Set a relation for an EDIT_LINE.
EDIT_POINT & GetEnd()
Return the end EDIT_POINT.
EDIT_POINT & GetOrigin()
Return the origin EDIT_POINT.
EDIT_POINTS is a VIEW_ITEM that manages EDIT_POINTs and EDIT_LINEs and draws them.
void AddPoint(const EDIT_POINT &aPoint)
Add an EDIT_POINT.
EDIT_LINE & Line(unsigned int aIndex)
unsigned int LinesSize() const
Return number of stored EDIT_LINEs.
EDIT_POINT & Point(unsigned int aIndex)
void AddLine(const EDIT_LINE &aLine)
Adds an EDIT_LINE.
Represent a single point that can be used for modifying items.
virtual std::pair< EDA_ITEM *, int > GetConnected() const
Return a connected item record comprising an EDA_ITEM* and a STARTPOINT/ENDPOINT flag.
int GetY() const
Return Y coordinate of an EDIT_POINT.
static const int POINT_SIZE
Single point size in pixels.
virtual void SetPosition(const VECTOR2I &aPosition)
Set new coordinates for an EDIT_POINT.
virtual VECTOR2I GetPosition() const
Return coordinates of an EDIT_POINT.
int GetX() const
Return X coordinate of an EDIT_POINT.
void SetDrawCircle(bool aDrawCircle=true)
const VECTOR2I & Origin() const
static std::unique_ptr< EDIT_RELATION > PerpendicularTranslation(const EDIT_LINE &aLine)
const EDIT_POINT * Reference() const
const VECTOR2I & Direction() const
const EDIT_POINT * SecondaryReference() const
EDIT_RELATION_KIND Kind() const
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected item had a property changed (except movement)
static const TOOL_EVENT PointSelectedEvent
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual VECTOR2D GetMousePosition(bool aWorldCoordinates=true) const =0
Return the current mouse pointer position.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
Define a library symbol object.
std::vector< SCH_PIN * > GetGraphicalPins(int aUnit=0, int aBodyStyle=0) const override
Graphical pins: Return schematic pin objects as drawn (unexpanded), filtered by unit/body.
bool UpdatePoints(EDIT_POINTS &aPoints) override
Update the list of the edit points for the item.
void UpdateItem(const EDIT_POINT &aEditedPoints, EDIT_POINTS &aPoints, COMMIT &aCommit, std::vector< EDA_ITEM * > &aUpdatedItems) override
Update the item with the new positions of the edit points.
void MakePoints(EDIT_POINTS &aPoints) override
Construct the initial set of edit points for the item and append to the given list.
LINE_POINT_EDIT_BEHAVIOR(SCH_LINE &aLine, SCH_SCREEN &aScreen)
A helper class interface to manage the edit points for a single item.
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.
static void UpdateItem(SCH_SHAPE &aRect, const EDIT_POINT &aEditedPoint, EDIT_POINTS &aPoints, const VECTOR2I &aMinSize={ 0, 0 })
bool UpdatePoints(EDIT_POINTS &aPoints) override
Update the list of the edit points for the item.
static void UpdatePoints(SCH_SHAPE &aRect, EDIT_POINTS &aPoints)
static void PinEditedCorner(const EDIT_POINT &aEditedPoint, const EDIT_POINTS &aPoints, int minWidth, int minHeight, VECTOR2I &topLeft, VECTOR2I &topRight, VECTOR2I &botLeft, VECTOR2I &botRight)
Update the coordinates of 4 corners of a rectangle, according to constraints and the moved corner.
static void MakePoints(SCH_SHAPE &aRect, EDIT_POINTS &aPoints)
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.
void MakePoints(EDIT_POINTS &aPoints) override
Construct the initial set of edit points for the item and append to the given list.
RECTANGLE_POINT_EDIT_BEHAVIOR(SCH_SHAPE &aRect, EDA_DRAW_FRAME &aFrame)
void dragPinsOnEdge(const std::vector< SEG > &aOldEdges, const std::vector< VECTOR2I > &aMoveVecs, int aEdgeUnit, COMMIT &aCommit, std::vector< EDA_ITEM * > &aUpdatedItems) const
A REFERENCE_IMAGE is a wrapper around a BITMAP_IMAGE that is displayed in an editor as a reference fo...
void SetTransformOriginOffset(const VECTOR2I &aCenter)
VECTOR2I GetTransformOriginOffset() const
Get the center of scaling, etc, relative to the image center (GetPosition()).
VECTOR2I GetPosition() const
double GetImageScale() const
void SetImageScale(double aScale)
Set the image "zoom" value.
Holds all the data relating to one schematic.
static TOOL_ACTION pointEditorAddCorner
static TOOL_ACTION pointEditorRemoveCorner
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Object to handle a bitmap image that can be inserted in a schematic.
Commit for the schematic and symbol editors.
void Revert() override
Revert the commit by restoring the modified items state.
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Segment description base class to describe items which have 2 end points (track, wire,...
VECTOR2I GetEndPoint() const
VECTOR2I GetStartPoint() const
void updatePoints()
Update edit points with item's points.
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
void setEditedPoint(EDIT_POINT *aPoint)
Set the current point being edited. NULL means none.
bool Init() override
Init() is called once upon a registration of the tool.
ARC_EDIT_MODE m_arcEditMode
void updateParentItem(bool aSnapToGrid, SCH_COMMIT &aCommit) const
Update item's points with edit points.
void updateEditedPoint(const TOOL_EVENT &aEvent)
Update which point is being edited.
bool addCornerCondition(const SELECTION &aSelection)
std::unique_ptr< POINT_EDIT_BEHAVIOR > m_editBehavior
Current item-specific edit behavior.
EDIT_POINT * m_editedPoint
Currently edited point, NULL if there is none.
int modifiedSelection(const TOOL_EVENT &aEvent)
int Main(const TOOL_EVENT &aEvent)
int getEditedPointIndex() const
std::shared_ptr< EDIT_POINTS > m_editPoints
Currently available edit points.
int clearEditedPoints(const TOOL_EVENT &aEvent)
Clear references to the points.
bool removeCornerCondition(const SELECTION &aSelection)
bool m_inPointEditor
Re-entrancy guards.
void setTransitions() override
Set up handlers for various events.
void makePointsAndBehavior(EDA_ITEM *aItem)
bool m_inDrag
True while a point drag is in progress (between grab and release).
std::unique_ptr< KIGFX::PREVIEW::ANGLE_ITEM > m_angleItem
int changeArcEditMode(const TOOL_EVENT &aEvent)
int removeCorner(const TOOL_EVENT &aEvent)
int addCorner(const TOOL_EVENT &aEvent)
TOOL_ACTION handlers.
void SetPosition(const VECTOR2I &aPos) override
void UpdateHatching() const override
VECTOR2I GetCenter() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
VECTOR2I GetPosition() const override
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
SCH_TABLECELL_POINT_EDIT_BEHAVIOR(SCH_TABLECELL &aCell, SCH_SCREEN &aScreen)
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.
int Distance(const SEG &aSeg) const
Compute minimum Euclidean distance to segment aSeg.
Class that groups generic conditions for selected items.
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
int Size() const
Returns the number of selected parts.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
virtual const VECTOR2I GetPoint(int aIndex) const override
void SetPoint(int aIndex, const VECTOR2I &aPos)
Move a point to a specific location.
virtual size_t GetPointCount() const override
virtual const SEG GetSegment(int aIndex) const override
void Remove(int aStartIndex, int aEndIndex)
Remove the range of points [start_index, end_index] from the line chain.
void Insert(size_t aVertex, const VECTOR2I &aP)
const std::vector< VECTOR2I > & CPoints() const
bool IsEmpty() const
Return true if the set is empty (no polygons at all)
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
SHEET_POINT_EDIT_BEHAVIOR(SCH_SHEET &aSheet, SCH_SCREEN &aScreen)
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.
std::vector< std::tuple< SCH_SHEET_PIN *, SCH_LINE *, int > > m_connectedWires
std::map< SCH_SHEET_PIN *, SCH_NO_CONNECT * > m_noConnects
bool UpdatePoints(EDIT_POINTS &aPoints) override
Update the list of the edit points for the item.
void MakePoints(EDIT_POINTS &aPoints) override
Construct the initial set of edit points for the item and append to the given list.
SNAP_RESULT Resolve(const SNAP_SOURCE_CONTEXT &aContext) const
void AddCandidate(SNAP_CANDIDATE aCandidate)
ARC_EDIT_MODE m_ArcEditMode
The symbol library editor main window.
void MakePoints(EDIT_POINTS &aPoints) override
Construct the initial set of edit points for the item and append to the given list.
bool 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(SCH_TEXTBOX &aTextbox)
double Distance(const VECTOR2< extended_type > &aVector) const
Compute the distance between two vectors.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
const int minSize
Push and Shove router track width and via size dialog.
#define ENDPOINT
ends. (Used to support dragging.)
#define IS_MOVING
Item being moved.
#define STARTPOINT
When a line is selected, these flags indicate which.
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
@ PERPENDICULAR_TRANSLATION
@ FRAME_SCH_SYMBOL_EDITOR
#define UNIMPLEMENTED_FOR(type)
constexpr int Mils2IU(const EDA_IU_SCALE &aIuScale, int mils)
std::vector< SEG > GetSegsInDirection(const BOX2I &aBox, DIRECTION_45::Directions aDir)
Get the segments of a box that are in the given direction.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
ARC_EDIT_MODE IncrementArcEditMode(ARC_EDIT_MODE aMode)
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
static const std::vector< KICAD_T > pointEditorTypes
static std::optional< SNAP_CANDIDATE > authoredSnapRelation(const EDIT_RELATION &aRelation)
std::optional< VECTOR2I > OPT_VECTOR2I
Utility functions for working with shapes.
ARC_EDIT_MODE arc_edit_mode
SNAP_PRIORITY_TIER priority
std::optional< INTERSECTABLE_GEOM > manifold
static SNAP_CANDIDATE Line(SNAP_STABLE_ID aId, SNAP_PRIORITY_TIER aPriority, SNAP_CANDIDATE_SUBTYPE aSubtype, const VECTOR2I &aOrigin, const VECTOR2D &aDirection, double aResidual)
static SNAP_CANDIDATE AxisY(SNAP_STABLE_ID aId, SNAP_PRIORITY_TIER aPriority, SNAP_CANDIDATE_SUBTYPE aSubtype, int aCoordinate, double aResidual)
static SNAP_CANDIDATE AxisX(SNAP_STABLE_ID aId, SNAP_PRIORITY_TIER aPriority, SNAP_CANDIDATE_SUBTYPE aSubtype, int aCoordinate, double aResidual)
SNAP_CANDIDATE_SUBTYPE subtype
wxString result
Test unit parsing edge cases and error handling.
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T
constexpr int sign(T val)
VECTOR2< int32_t > VECTOR2I