73 Text(wxPoint2DDouble position, wxString fontName = wxT(
"Arial"),
int fontSize = 10);
78 virtual bool Contains(wxPoint2DDouble position)
const;
80 virtual void DrawDC(wxPoint2DDouble translation,
double scale, wxGraphicsContext* gc);
81 virtual void DrawDC(wxPoint2DDouble translation,
double scale, wxDC& dc);
82 virtual bool Intersects(wxRect2DDouble rect)
const;
83 virtual void Rotate(
bool clockwise =
true);
84 virtual bool ShowForm(wxWindow* parent, std::vector<Element*> elementList);
85 virtual void UpdateText(
double systemPowerBase);
86 virtual wxString GetText()
const {
return m_text; }
87 virtual void SetText(wxString text);
88 virtual void SetFontName(wxString fontName) { m_fontName = fontName; }
89 virtual void SetFontSize(
int fontSize) { m_fontSize = fontSize; }
90 virtual void SetAltSelectionColour(
bool useAltSelectionColour =
true) { m_useAltSelectionColour = useAltSelectionColour; }
91 virtual void SetAllowRotation(
bool allowRotation =
true) { m_allowRotation = allowRotation; }
94 void SetDataType(
const DataType& dataType) { m_dataType = dataType; }
95 void SetDirection(
int direction) { m_direction = direction; }
96 void SetElement(
Element* element) { m_element = element; }
97 void SetElementNumber(
int elementNumber) { m_elementNumber = elementNumber; }
98 void SetElementTypeText(
const ElementType elementType) { m_elementTypeText = elementType; }
100 void SetDecimalPlaces(
int decimalPlaces) { m_decimalPlaces = decimalPlaces; }
101 const DataType GetDataType()
const {
return m_dataType; }
102 int GetDirection()
const {
return m_direction; }
103 Element* GetElement() {
return m_element; }
104 int GetElementNumber()
const {
return m_elementNumber; }
105 const ElementType GetElementTypeText()
const {
return m_elementTypeText; }
107 int GetDecimalPlaces()
const {
return m_decimalPlaces; }
109 virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode);
110 virtual bool OpenElement(rapidxml::xml_node<>* elementNode);
113 wxString m_text = _(
"Label");
114 wxString m_fontName = wxT(
"Arial");
116 int m_numberOfLines = 0;
117 bool m_isMultlineText =
false;
118 bool m_useAltSelectionColour =
false;
119 bool m_allowRotation =
true;
120 bool m_updateTextRectangle =
true;
122 std::vector<GCText*> m_gcTextList;
125 ElementType m_elementTypeText = TYPE_NONE;
130 int m_decimalPlaces = 2;
Element that shows power element informations in workspace.
virtual Element * GetCopy()
Get a the element copy.
virtual bool AddParent(Element *parent, wxPoint2DDouble position)
Add a parent to the element. This method must be used on power elements that connect to a bus,...
virtual bool Contains(wxPoint2DDouble position) const
Checks if the element contains a position.
virtual bool Intersects(wxRect2DDouble rect) const
Check if the element's rect intersects other rect.
virtual void Rotate(bool clockwise=true)
Rotate the element.