Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
Shunt.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef SHUNT_H
19#define SHUNT_H
20
21#include "PowerElement.h"
22#include "Bus.h"
23
31class Shunt : public PowerElement
32{
33 public:
34 Shunt();
35 ~Shunt();
36
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 MoveNode(Element* element, wxPoint2DDouble position);
41 virtual void StartMove(wxPoint2DDouble position);
42 virtual void RotateNode(Element* parent, bool clockwise = true);
43 virtual void RemoveParent(Element* parent);
44 virtual bool NodeContains(wxPoint2DDouble position);
45 virtual bool SetNodeParent(Element* parent);
46 virtual void UpdateNodes();
47
48 protected:
49 void UpdateSwitchesPosition();
50 void UpdatePowerFlowArrowsPosition();
51 //void DrawGround(wxPoint2DDouble position) const;
52 void DrawDCGround(wxPoint2DDouble position, wxGraphicsContext* gc) const;
53 void DrawDCGround(wxPoint2DDouble position, wxDC& dc) const;
54 //bool m_inserted = false;
55};
56
57#endif // SHUNT_H
Base class of all elements of the program. This class is responsible for manage graphical and his dat...
Definition Element.h:112
Abstract class of power elements.
Abstract class for shunt power elements.
Definition Shunt.h:32
virtual void MoveNode(Element *element, wxPoint2DDouble position)
Move a node. StartMove(wxPoint2DDouble position) before start moving.
Definition Shunt.cpp:45
virtual bool Contains(wxPoint2DDouble position) const
Checks if the element contains a position.
Definition Shunt.h:37
virtual void StartMove(wxPoint2DDouble position)
Update the element attributes related to the movement.
Definition Shunt.cpp:67
virtual void RemoveParent(Element *parent)
Remove a parent.
Definition Shunt.cpp:74
virtual void RotateNode(Element *parent, bool clockwise=true)
Rotate a node.
Definition Shunt.cpp:141
virtual void Move(wxPoint2DDouble position)
Move the element other position.
Definition Shunt.cpp:32
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...
Definition Shunt.cpp:98
virtual void UpdateNodes()
Update the nodes according to the parents. If a parent is removed, use this method.
Definition Shunt.cpp:125
virtual bool NodeContains(wxPoint2DDouble position)
Check if a node contains a point. If contains, set the attributes related to node movement.
Definition Shunt.cpp:84
virtual bool Intersects(wxRect2DDouble rect) const
Check if the element's rect intersects other rect.
Definition Shunt.h:38