37 virtual bool Contains(wxPoint2DDouble position)
const {
return m_rect.Contains(position); }
38 virtual bool Intersects(wxRect2DDouble rect)
const {
return m_rect.Intersects(rect); }
39 virtual void Move(wxPoint2DDouble position);
40 virtual void AlignToGrid(
double gridSize = 20.0)
override;
42 virtual void StartMove(wxPoint2DDouble position);
48 virtual void UpdateSwitchesPosition()
override;
49 virtual void UpdatePowerFlowArrowsPosition()
override;
53 void DrawDCGround(wxPoint2DDouble position, wxGraphicsContext* gc)
const;
54 void DrawDCGround(wxPoint2DDouble position, wxDC& dc)
const;
Base class of all elements of the program. This class is responsible for manage graphical and his dat...
PowerElement()
Constructor.
virtual void MoveNode(Element *element, wxPoint2DDouble position)
Move a node. StartMove(wxPoint2DDouble position) before start moving.
virtual bool Contains(wxPoint2DDouble position) const
Checks if the element contains a position.
virtual void StartMove(wxPoint2DDouble position)
Update the element attributes related to the movement.
virtual void RemoveParent(Element *parent)
Remove a parent.
virtual void RotateNode(Element *parent, bool clockwise=true)
Rotate a node.
virtual void Move(wxPoint2DDouble position)
Move the element other position.
virtual bool SetNodeParent(Element *parent)
Set a perent to the node. If all conditions are met, a new parent are added to the element and the po...
virtual void UpdateNodes()
Update the nodes according to the parents. If a parent is removed, use this method.
virtual bool NodeContains(wxPoint2DDouble position)
Check if a node contains a point. If contains, set the attributes related to node movement.
virtual bool Intersects(wxRect2DDouble rect) const
Check if the element's rect intersects other rect.