diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2016-12-06 13:26:46 -0200 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2016-12-06 13:26:46 -0200 |
commit | e282ec268db0d17a1d53f813c5fff9473d25e797 (patch) | |
tree | 517e01b8685248f04548513091e7040a1b36ec0b /Project/Text.h | |
parent | d4efffcdedbb41596eecd0882a1cef76f6afc435 (diff) | |
parent | e266f5811403beea13c9cc5399c55db4a34fdd3c (diff) | |
download | PSP.git-e282ec268db0d17a1d53f813c5fff9473d25e797.tar.gz PSP.git-e282ec268db0d17a1d53f813c5fff9473d25e797.tar.xz PSP.git-e282ec268db0d17a1d53f813c5fff9473d25e797.zip |
Merge remote-tracking branch 'refs/remotes/origin/wip/currentState'
Diffstat (limited to 'Project/Text.h')
-rw-r--r-- | Project/Text.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/Project/Text.h b/Project/Text.h new file mode 100644 index 0000000..2b10380 --- /dev/null +++ b/Project/Text.h @@ -0,0 +1,93 @@ +#ifndef TEXT_H +#define TEXT_H + +#include "Element.h" +#include "wxGLString.h" + +class TextForm; + +class Bus; +class Line; +class Transformer; +class SyncGenerator; +class IndMotor; +class SyncMotor; +class Load; +class Inductor; +class Capacitor; + +enum ElementType { + TYPE_BUS, + TYPE_CAPACITOR, + TYPE_IND_MOTOR, + TYPE_INDUCTOR, + TYPE_LINE, + TYPE_LOAD, + TYPE_SYNC_GENERATOR, + TYPE_SYNC_MOTOR, + TYPE_TRANSFORMER +}; + +enum DataType { + DATA_NAME, + DATA_VOLTAGE, + DATA_ANGLE, + DATA_SC_CURRENT, + DATA_SC_VOLTAGE, + DATA_SC_POWER, + DATA_ACTIVE_POWER, + DATA_REACTIVE_POWER, + DATA_PF_ACTIVE, + DATA_PF_REACTIVE, + DATA_PF_LOSSES, + DATA_PF_CURRENT +}; + +class Text : public Element +{ + public: + Text(); + Text(wxPoint2DDouble position); + ~Text(); + + virtual bool AddParent(Element* parent, wxPoint2DDouble position) { return true; }; + virtual bool Contains(wxPoint2DDouble position) const; + virtual void Draw(wxPoint2DDouble translation, double scale); + virtual bool Intersects(wxRect2DDouble rect) const; + virtual void Rotate(bool clockwise = true); + virtual bool ShowForm(wxWindow* parent, std::vector<Element*> elementList); + virtual void UpdateText(double systemPowerBase); + virtual wxString GetText() const { return m_text; } + virtual void SetText(wxString text); + + void SetDataType(const DataType& dataType) { m_dataType = dataType; } + void SetDirection(int direction) { m_direction = direction; } + void SetElement(Element* element) { m_element = element; } + void SetElementNumber(int elementNumber) { m_elementNumber = elementNumber; } + void SetElementType(const ElementType elementType) { m_elementType = elementType; } + void SetFontSize(int fontSize) { m_fontSize = fontSize; } + void SetUnit(const ElectricalUnit unit) { m_unit = unit; } + void SetDecimalPlaces(int decimalPlaces) { m_decimalPlaces = decimalPlaces; } + const DataType GetDataType() const { return m_dataType; } + int GetDirection() const { return m_direction; } + Element* GetElement() { return m_element; } + int GetElementNumber() const { return m_elementNumber; } + const ElementType GetElementType() const { return m_elementType; } + int GetFontSize() const { return m_fontSize; } + const ElectricalUnit GetUnit() const { return m_unit; } + int GetDecimalPlaces() const { return m_decimalPlaces; } + + protected: + wxString m_text = _("Text"); + int m_fontSize = 10; + + Element* m_element = NULL; + ElementType m_elementType; + int m_elementNumber; + DataType m_dataType; + ElectricalUnit m_unit; + int m_direction; + int m_decimalPlaces; +}; + +#endif // TEXT_H |