Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
Gain Class Reference

Provide an output multiplying the input by a constant. More...

#include <Gain.h>

Inheritance diagram for Gain:
Collaboration diagram for Gain:

Public Member Functions

 Gain (int id)
 
virtual void DrawDC (wxPoint2DDouble translation, double scale, wxGraphicsContext *gc) const
 Draw the element using GDI+.
 
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 bool ShowForm (wxWindow *parent, Element *element)
 Show element data form.
 
virtual void Rotate (bool clockwise=true)
 Rotate the element.
 
virtual void Move (wxPoint2DDouble position)
 Move the element other position.
 
virtual bool UpdateText ()
 Update the OpenGL text in the element (if present).
 
virtual void SetValue (double value)
 
virtual double GetValue () const
 
virtual void UpdatePoints ()
 
virtual bool Solve (double *input, double timeStep)
 Multiply the input by a constant.
 
virtual rapidxml::xml_node * SaveElement (rapidxml::xml_document<> &doc, rapidxml::xml_node<> *elementListNode)
 
virtual bool OpenElement (rapidxml::xml_node<> *elementNode)
 
virtual ElementGetCopy ()
 Get a the element copy.
 
- Public Member Functions inherited from ControlElement
 ControlElement (int id)
 
virtual void StartMove (wxPoint2DDouble position)
 Update the element attributes related to the movement.
 
void SetNodeList (std::vector< Node * > nodeList)
 
std::vector< Node * > GetNodeList () const
 
virtual void DrawDCNodes (wxGraphicsContext *gc) const
 
virtual void ReplaceNode (Node *oldNode, Node *newNode)
 
virtual bool IsSolved () const
 
virtual void SetSolved (bool solved=true)
 
virtual bool Initialize ()
 
virtual double GetOutput () const
 
virtual void SetOutput (double output)
 
- Public Member Functions inherited from Element
 Element ()
 Constructor.
 
virtual ~Element ()
 Destructor.
 
void SetDragging (bool dragging=true)
 Set if the element are being dragged.
 
void SetHeight (double height)
 Set element height.
 
void SetPosition (const wxPoint2DDouble position)
 Set the element position and update the rectangle.
 
void SetSelected (bool selected=true)
 Set element selection.
 
void SetWidth (double width)
 Set element width.
 
void SetAngle (double angle)
 Set element angle.
 
void ShowPickbox (bool showPickbox=true)
 Set if the pickbox is shown.
 
void SetBorderSize (double borderSize)
 Set the size of the border (shown in selected elements).
 
bool SetOnline (bool online=true)
 Set if the element is online or offline.
 
virtual void SetPointList (std::vector< wxPoint2DDouble > pointList)
 Set the list of points that connect the element to the bus.
 
ElementType GetElementType ()
 
wxRect2DDouble GetRect () const
 Get the element rectangle.
 
wxPoint2DDouble GetPosition () const
 Get the element position.
 
bool IsDragging () const
 Checks if the element is being dragged.
 
double GetHeight () const
 Get the element height.
 
bool IsSelected () const
 Checks if the element is selected.
 
double GetWidth () const
 Get the element width.
 
double GetAngle () const
 Get the element angle.
 
double GetRotationAngle () const
 Get the angle of rotation.
 
bool IsPickboxShown () const
 Checks if the pickbox is shown.
 
bool IsOnline () const
 Checks if the element is online or offline.
 
virtual std::vector< wxPoint2DDouble > GetPointList () const
 Get the list of points that connect the element to bus.
 
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, so the parent must be a bus. The element basic points are calculated in this method, so apply this when the element is being inserted.
 
virtual void AddParent (Element *parent)
 Add a parent to the element.
 
virtual void SetID (int id)
 Set the element ID.
 
virtual int GetID () const
 Get the element ID.
 
virtual void AddChild (Element *child)
 Add a child to the child list.
 
virtual void RemoveChild (Element *child)
 Remove a child from the list.
 
virtual void ReplaceChild (Element *oldChild, Element *newChild)
 Replace a child from the list.
 
virtual wxString GetTipText () const
 Get the tip text.
 
virtual void DrawDC (wxPoint2DDouble translation, double scale, wxDC &dc) const
 Draw the element using wxDC.
 
virtual bool GetContextMenu (wxMenu &menu)
 Get the element contex menu.
 
virtual void AddPoint (wxPoint2DDouble point)
 Add point to the list of points that connect the element to the bus.
 
virtual void MoveNode (Element *parent, wxPoint2DDouble position)
 Move a node. StartMove(wxPoint2DDouble position) before start moving.
 
virtual bool NodeContains (wxPoint2DDouble position)
 Check if a node contains a point. If contains, set the attributes related to node movement.
 
virtual void UpdateNodes ()
 Update the nodes according to the parents. If a parent is removed, use this method.
 
void SetParent (Element *parent, int num)
 
void SetChild (Element *child, int num)
 
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 points related to the nodes will be calculated.
 
virtual void RemoveParent (Element *parent)
 Remove a parent.
 
virtual void ReplaceParent (Element *oldParent, Element *newParent)
 Replace a parent.
 
virtual void RotateNode (Element *parent, bool clockwise=true)
 Rotate a node.
 
virtual bool PickboxContains (wxPoint2DDouble position)
 Check if a pickbox contains a point. If contains the attributes related to pickbox movement will be calculated.
 
virtual void MovePickbox (wxPoint2DDouble position)
 Move the pickbox.
 
virtual wxCursor GetBestPickboxCursor () const
 Get the best cursor to shown to the user when the mouse is above a pickbox.
 
virtual void ResetPickboxes ()
 Remove the pickboxes.
 
virtual void ResetNodes ()
 Remove the active nodes.
 
virtual wxPoint2DDouble WorldToScreen (wxPoint2DDouble translation, double scale, double offsetX=0.0, double offsetY=0.0) const
 Convert the element position to screen position.
 
virtual wxPoint2DDouble WorldToScreen (wxPoint2DDouble position, wxPoint2DDouble translation, double scale, double offsetX=0.0, double offsetY=0.0) const
 Convert a generic position to screen position.
 
virtual bool RotatedRectanglesIntersects (wxRect2DDouble rect1, wxRect2DDouble rect2, double angle1, double angle2) const
 Check if two roteted rectangles intersect.
 
virtual void DrawDCRectangle (wxPoint2DDouble position, double width, double height, double angle, wxDC &dc) const
 Draw a circle.
 
virtual void DrawDCRoundedRectRotated (wxDC &dc, const wxPoint2DDouble &center, double width, double height, double radius, double angleDeg, int arcSegments=8) const
 
virtual void DrawDCCircle (wxPoint2DDouble position, double radius, int numSegments, wxGraphicsContext *gc) const
 Draw a circle using device context.
 
virtual void DrawDCCircle (wxPoint2DDouble position, double radius, wxDC &dc) const
 
virtual void DrawDCArc (wxPoint2DDouble position, double radius, double initAngle, double finalAngle, int numSegments, wxGraphicsContext *gc) const
 
virtual void DrawDCArc (wxPoint2DDouble position, double radius, double initAngle, double finalAngle, wxDC &dc) const
 
virtual void DrawDCTriangle (std::vector< wxPoint2DDouble > points, wxGraphicsContext *gc) const
 Draw rectangle.
 
virtual void DrawDCTriangle (std::vector< wxPoint > points, wxDC &dc) const
 
virtual void DrawDCPickbox (wxPoint2DDouble position, wxGraphicsContext *gc) const
 Draw a point.
 
virtual wxPoint2DDouble RotateAtPosition (wxPoint2DDouble pointToRotate, double angle, bool degrees=true) const
 Rotate a point as element position being the origin.
 
virtual wxPoint2DDouble RotateLocal (wxPoint2DDouble local, double angleDeg) const
 
virtual wxPoint RotateAround (const wxPoint2DDouble &p, const wxPoint2DDouble &center, double angleDeg) const
 
virtual std::vector< Element * > GetParentList () const
 Get the parent list.
 
virtual std::vector< Element * > GetChildList () const
 Get the Child list.
 
virtual void CalculateBoundaries (wxPoint2DDouble &leftUp, wxPoint2DDouble &rightBottom) const
 Calculate the element boundaries.
 
virtual void GeneralMenuItens (wxMenu &menu)
 Insert general itens to context menu.
 
virtual double PointToLineDistance (wxPoint2DDouble point, int *segmentNumber=nullptr) const
 Calculate the distance between a line (formed by point list) and a point.
 
bool IsInserted () const
 Check if the element is properly inserted in the workspace.
 
void SetInserted (bool inserted=true)
 Set if the element is properly inserted in the workspace.
 
void SaveCADProperties (rapidxml::xml_document<> &doc, rapidxml::xml_node<> *elementNode)
 
bool OpenCADProperties (rapidxml::xml_node<> *elementNode)
 

Protected Attributes

double m_value = 1.0
 
GCTextm_gcText = nullptr
 
std::vector< wxPoint2DDouble > m_triPts
 
- Protected Attributes inherited from ControlElement
std::vector< Node * > m_nodeList
 
bool m_solved = false
 
double m_output = 0.0
 
- Protected Attributes inherited from Element
ElementType m_elementType = ElementType::TYPE_NONE
 
int m_elementID = 0
 
std::vector< Element * > m_parentList
 
std::vector< Element * > m_childList
 
wxRect2DDouble m_rect
 
wxPoint2DDouble m_position
 
double m_width = 0.0
 
double m_height = 0.0
 
double m_angle = 0.0
 
double m_borderSize = 2.0
 
double m_rotationAngle = 45.0
 
double m_switchSize = 10.0
 
std::vector< wxRect2DDouble > m_switchRect
 
bool m_selected = false
 
bool m_dragging = false
 
bool m_showPickbox = false
 
bool m_inserted = false
 
int m_activePickboxID = ID_PB_NONE
 
int m_activeNodeID = 0
 
std::vector< wxPoint2DDouble > m_pointList
 
std::vector< wxPoint2DDouble > m_movePts
 
wxPoint2DDouble m_moveStartPt
 
wxPoint2DDouble m_movePos
 
bool m_online = true
 
wxColour m_selectionColour
 

Additional Inherited Members

- Static Public Member Functions inherited from ControlElement
static ControlElementGetControlElementFromID (std::vector< std::shared_ptr< ControlElement > > elementList, int id)
 
- Static Public Member Functions inherited from Element
static bool DoubleFromString (wxWindow *parent, wxString strValue, double &value, wxString errorMsg)
 Get a double value from a string. Show a error message if the conversion fail.
 
static bool IntFromString (wxWindow *parent, wxString strValue, int &value, wxString errorMsg)
 Convert a string to int. Show a error message if the conversion fail.
 
static wxString StringFromDouble (double value, int minDecimal=1, int maxDecimals=13)
 Convert a double value to string.
 
- Protected Member Functions inherited from ControlElement
void SaveControlNodes (rapidxml::xml_document<> &doc, rapidxml::xml_node<> *elementNode)
 
bool OpenControlNodes (rapidxml::xml_node<> *elementNode)
 

Detailed Description

Provide an output multiplying the input by a constant.

Author
Thales Lima Oliveira thale.nosp@m.s@uf.nosp@m.u.br
Date
05/10/2017

Definition at line 36 of file Gain.h.

Constructor & Destructor Documentation

◆ Gain()

Gain::Gain ( int  id)

Definition at line 21 of file Gain.cpp.

21 : ControlElement(id)
22{
23 m_triPts.resize(3);
24 SetValue(m_value);
25 Node* nodeIn = new Node(m_position + wxPoint2DDouble(-m_width / 2, 0), Node::NodeType::NODE_IN, m_borderSize);
26 nodeIn->StartMove(m_position);
27 Node* nodeOut = new Node(m_position + wxPoint2DDouble(m_width / 2, 0), Node::NodeType::NODE_OUT, m_borderSize);
28 nodeOut->SetAngle(180.0);
29 nodeOut->StartMove(m_position);
30 m_nodeList.push_back(nodeIn);
31 m_nodeList.push_back(nodeOut);
32}
Node of a control element. This class manages the user interaction with the connection and control el...

◆ ~Gain()

Gain::~Gain ( )

Definition at line 34 of file Gain.cpp.

35{
36 //if(m_glText) delete m_glText;
37 if (m_gcText) delete m_gcText;
38 for (auto& node : m_nodeList) if (node) delete node;
39 m_nodeList.clear();
40}

Member Function Documentation

◆ Contains()

virtual bool Gain::Contains ( wxPoint2DDouble  position) const
inlinevirtual

Checks if the element contains a position.

Parameters
positionPosition to be checked.

Implements Element.

Definition at line 44 of file Gain.h.

44{ return m_rect.Contains(position); }

◆ DrawDC()

void Gain::DrawDC ( wxPoint2DDouble  translation,
double  scale,
wxGraphicsContext *  gc 
) const
virtual

Draw the element using GDI+.

Parameters
translationTranslation of the system.
scaleScale of the system.
gcGraphics context

Reimplemented from Element.

Definition at line 87 of file Gain.cpp.

88{
89 if (m_selected) {
90 gc->SetPen(*wxTRANSPARENT_PEN);
91 gc->SetBrush(wxBrush(m_selectionColour));
92 double borderSize = (m_borderSize * 2.0 + 1.0) / scale;
93 std::vector<wxPoint2DDouble> m_triSelectedPts;
94 if (m_angle == 0.0) {
95 m_triSelectedPts.push_back(m_triPts[0] - wxPoint2DDouble(borderSize / 2, borderSize / 1.5));
96 m_triSelectedPts.push_back(m_triPts[1] - wxPoint2DDouble(borderSize / 2, -borderSize / 1.5));
97 m_triSelectedPts.push_back(m_triPts[2] - wxPoint2DDouble(-borderSize, 0));
98 }
99 else if (m_angle == 90.0) {
100 m_triSelectedPts.push_back(m_triPts[0] - wxPoint2DDouble(borderSize / 1.5, borderSize / 2));
101 m_triSelectedPts.push_back(m_triPts[1] - wxPoint2DDouble(-borderSize / 1.5, borderSize / 2));
102 m_triSelectedPts.push_back(m_triPts[2] - wxPoint2DDouble(0, -borderSize));
103 }
104 else if (m_angle == 180.0) {
105 m_triSelectedPts.push_back(m_triPts[0] - wxPoint2DDouble(borderSize, 0));
106 m_triSelectedPts.push_back(m_triPts[1] - wxPoint2DDouble(-borderSize / 2, borderSize / 1.5));
107 m_triSelectedPts.push_back(m_triPts[2] - wxPoint2DDouble(-borderSize / 2, -borderSize / 1.5));
108 }
109 else if (m_angle == 270.0) {
110 m_triSelectedPts.push_back(m_triPts[0] - wxPoint2DDouble(0, borderSize));
111 m_triSelectedPts.push_back(m_triPts[1] - wxPoint2DDouble(-borderSize / 1.5, -borderSize / 2));
112 m_triSelectedPts.push_back(m_triPts[2] - wxPoint2DDouble(borderSize / 1.5, -borderSize / 2));
113 }
114 DrawDCTriangle(m_triSelectedPts, gc);
115 }
116 //glLineWidth(1.0);
117 //glColor4d(1.0, 1.0, 1.0, 1.0);
118 //DrawTriangle(m_triPts);
119 //glColor4d(0.0, 0.0, 0.0, 1.0);
120 //DrawTriangle(m_triPts, GL_LINE_LOOP);
121
122 gc->SetPen(wxPen(wxColour(0, 0, 0, 255), 1));
123 gc->SetBrush(wxBrush(wxColour(255, 255, 255, 255)));
124 DrawDCTriangle(m_triPts, gc);
125
126 // Plot number.
127 if (m_angle == 0.0)
128 m_gcText->Draw(m_position + wxPoint2DDouble(-m_width / 2 + 2 + m_borderSize, -m_gcText->GetHeight() / 2), gc);
129 else if (m_angle == 90.0)
130 m_gcText->Draw(m_position + wxPoint2DDouble(-m_gcText->GetWidth() / 2, -m_height / 2 + 2 + m_borderSize), gc);
131 else if (m_angle == 180.0)
132 m_gcText->Draw(m_position + wxPoint2DDouble(m_width / 2 - m_gcText->GetWidth() - 2 - m_borderSize, -m_gcText->GetHeight() / 2), gc);
133 else if (m_angle == 270.0)
134 m_gcText->Draw(m_position + wxPoint2DDouble(-m_gcText->GetWidth() / 2, m_height / 2 - m_gcText->GetHeight() - 2 - m_borderSize), gc);
135
136 gc->SetPen(*wxTRANSPARENT_PEN);
137 gc->SetBrush(wxBrush(wxColour(0, 0, 0, 255)));
138 DrawDCNodes(gc);
139}
virtual void DrawDCTriangle(std::vector< wxPoint2DDouble > points, wxGraphicsContext *gc) const
Draw rectangle.
Definition Element.cpp:237
virtual void Draw(wxPoint2DDouble position, wxGraphicsContext *gc, double angle=0.0, wxColour colour= *wxBLACK) const
Draw the text in wxGraphicsContext.
Definition GCText.cpp:35
Here is the call graph for this function:

◆ GetCopy()

Element * Gain::GetCopy ( )
virtual

Get a the element copy.

Returns
Copy of the element.

Reimplemented from Element.

Definition at line 247 of file Gain.cpp.

248{
249 Gain* copy = new Gain(m_elementID);
250 *copy = *this;
251 //copy->m_glText = m_glText->GetCopy();
252 copy->m_gcText = m_gcText->GetCopy();
253 return copy;
254}
virtual GCText * GetCopy()
Get a deep text copy.
Definition GCText.cpp:161
Provide an output multiplying the input by a constant.
Definition Gain.h:37
Here is the call graph for this function:

◆ GetValue()

virtual double Gain::GetValue ( ) const
inlinevirtual

Definition at line 51 of file Gain.h.

51{ return m_value; }

◆ Intersects()

virtual bool Gain::Intersects ( wxRect2DDouble  rect) const
inlinevirtual

Check if the element's rect intersects other rect.

Parameters
rectRect to check intersection.

Implements Element.

Definition at line 45 of file Gain.h.

45{ return m_rect.Intersects(rect); }

◆ Move()

void Gain::Move ( wxPoint2DDouble  position)
virtual

Move the element other position.

Parameters
positionPosition that the element will be moved. Use StartMove(wxPoint2DDouble position) before start moving.

Reimplemented from ControlElement.

Definition at line 231 of file Gain.cpp.

232{
233 SetPosition(m_movePos + position - m_moveStartPt);
234 UpdatePoints();
235}
void SetPosition(const wxPoint2DDouble position)
Set the element position and update the rectangle.
Definition Element.cpp:27
Here is the call graph for this function:

◆ OpenElement()

bool Gain::OpenElement ( rapidxml::xml_node<> *  elementNode)
virtual

Reimplemented from Element.

Definition at line 278 of file Gain.cpp.

279{
280 if (!OpenCADProperties(elementNode)) return false;
281 if (!OpenControlNodes(elementNode)) return false;
282
283 // Element properties
284 double value = XMLParser::GetNodeValueDouble(elementNode, "Value");
285 SetValue(value);
286 return true;
287}

◆ Rotate()

void Gain::Rotate ( bool  clockwise = true)
virtual

Rotate the element.

Parameters
clockwiseTrue to rotate clockwise, false to rotate counter-clockwise.

Reimplemented from Element.

Definition at line 151 of file Gain.cpp.

152{
153 if (clockwise)
154 m_angle += 90.0;
155 else
156 m_angle -= 90.0;
157 if (m_angle >= 360.0)
158 m_angle = 0.0;
159 else if (m_angle < 0)
160 m_angle = 270.0;
161
162 UpdatePoints();
163
164 for (auto it = m_nodeList.begin(), itEnd = m_nodeList.end(); it != itEnd; ++it) {
165 Node* node = *it;
166 node->Rotate(clockwise);
167 }
168}

◆ SaveElement()

rapidxml::xml_node * Gain::SaveElement ( rapidxml::xml_document<> &  doc,
rapidxml::xml_node<> *  elementListNode 
)
virtual

Reimplemented from Element.

Definition at line 263 of file Gain.cpp.

264{
265 auto elementNode = XMLParser::AppendNode(doc, elementListNode, "Gain");
266 XMLParser::SetNodeAttribute(doc, elementNode, "ID", m_elementID);
267
268 SaveCADProperties(doc, elementNode);
269 SaveControlNodes(doc, elementNode);
270
271 // Element properties
272 auto value = XMLParser::AppendNode(doc, elementNode, "Value");
273 XMLParser::SetNodeValue(doc, value, m_value);
274
275 return elementNode;
276}

◆ SetValue()

void Gain::SetValue ( double  value)
virtual

Definition at line 170 of file Gain.cpp.

171{
172 m_value = value;
173 wxString text = "";
174 if (std::abs(m_value) > 1e3 || std::abs(m_value) < 1e-3)
175 text = wxString::Format("%g", m_value);
176 else
177 text = StringFromDouble(m_value);
178
179 if (m_gcText)
180 m_gcText->SetText(text);
181 else
182 m_gcText = new GCText(text);
183
184 m_width = m_gcText->GetWidth() + 18 + 2 * m_borderSize;
185 m_height = m_gcText->GetHeight() + 18 + 2 * m_borderSize;
186
187 if (m_width > m_height)
188 m_height = m_width;
189 else
190 m_width = m_height;
191
192 SetPosition(m_position); // Update rectangle.
193
194 UpdatePoints();
195}
static wxString StringFromDouble(double value, int minDecimal=1, int maxDecimals=13)
Convert a double value to string.
Definition Element.cpp:533
Class to draw text on Graphics Context using wxWidgets.
Definition GCText.h:32
virtual void SetText(wxString text)
Set correctly a new text string.
Definition GCText.cpp:68

◆ ShowForm()

bool Gain::ShowForm ( wxWindow *  parent,
Element element 
)
virtual

Show element data form.

Parameters
parentForm parent
elementElement that will be edited.
Returns
True if the form is shown, false otherwise.

Reimplemented from Element.

Definition at line 141 of file Gain.cpp.

142{
143 GainForm form(parent, this);
144 form.CenterOnParent();
145 if (form.ShowModal() == wxID_OK) {
146 return true;
147 }
148 return false;
149}
Form to edit the gain control data.
Definition GainForm.h:32

◆ Solve()

bool Gain::Solve ( double *  input,
double  timeStep 
)
virtual

Multiply the input by a constant.

\( output = K \cdot input \)
Parameters
inputInput value.
timeStepTime step.
Returns
Always true.

Reimplemented from ControlElement.

Definition at line 237 of file Gain.cpp.

238{
239 if (!input) {
240 m_output = 0.0;
241 return true;
242 }
243 m_output = input[0] * m_value;
244 return true;
245}

◆ UpdatePoints()

void Gain::UpdatePoints ( )
virtual

Definition at line 197 of file Gain.cpp.

198{
199 if (m_nodeList.size() != 0) {
200 if (m_angle == 0.0) {
201 m_triPts[0] = m_rect.GetLeftTop() + wxPoint2DDouble(m_borderSize, m_borderSize);
202 m_triPts[1] = m_rect.GetLeftBottom() + wxPoint2DDouble(m_borderSize, -m_borderSize);
203 m_triPts[2] = m_position + wxPoint2DDouble(m_width / 2 - m_borderSize, 0);
204 m_nodeList[0]->SetPosition(m_position + wxPoint2DDouble(-m_width / 2, 0));
205 m_nodeList[1]->SetPosition(m_position + wxPoint2DDouble(m_width / 2 - 2, 0));
206 }
207 else if (m_angle == 90.0) {
208 m_triPts[0] = m_rect.GetLeftTop() + wxPoint2DDouble(m_borderSize, m_borderSize);
209 m_triPts[1] = m_rect.GetRightTop() + wxPoint2DDouble(-m_borderSize, m_borderSize);
210 m_triPts[2] = m_position + wxPoint2DDouble(0, m_height / 2 - m_borderSize);
211 m_nodeList[0]->SetPosition(m_position + wxPoint2DDouble(0, -m_height / 2));
212 m_nodeList[1]->SetPosition(m_position + wxPoint2DDouble(0, m_height / 2 - 2));
213 }
214 else if (m_angle == 180.0) {
215 m_triPts[0] = m_position + wxPoint2DDouble(-m_width / 2 + m_borderSize, 0);
216 m_triPts[1] = m_rect.GetRightTop() + wxPoint2DDouble(-m_borderSize, m_borderSize);
217 m_triPts[2] = m_rect.GetRightBottom() + wxPoint2DDouble(-m_borderSize, -m_borderSize);
218 m_nodeList[0]->SetPosition(m_position + wxPoint2DDouble(m_width / 2, 0));
219 m_nodeList[1]->SetPosition(m_position + wxPoint2DDouble(-m_width / 2 + 2, 0));
220 }
221 else if (m_angle == 270.0) {
222 m_triPts[0] = m_position + wxPoint2DDouble(0, -m_height / 2 + m_borderSize);
223 m_triPts[1] = m_rect.GetRightBottom() + wxPoint2DDouble(-m_borderSize, -m_borderSize);
224 m_triPts[2] = m_rect.GetLeftBottom() + wxPoint2DDouble(m_borderSize, -m_borderSize);
225 m_nodeList[0]->SetPosition(m_position + wxPoint2DDouble(0, m_height / 2));
226 m_nodeList[1]->SetPosition(m_position + wxPoint2DDouble(0, -m_height / 2 + 2));
227 }
228 }
229}

◆ UpdateText()

bool Gain::UpdateText ( )
virtual

Update the OpenGL text in the element (if present).

Returns
true if OpenGLText is ok, false otherwise.

Reimplemented from ControlElement.

Definition at line 256 of file Gain.cpp.

257{
258 SetValue(m_value);
259 //if (!m_glText->IsTextureOK()) return false;
260 return true;
261}

Member Data Documentation

◆ m_gcText

GCText* Gain::m_gcText = nullptr
protected

Definition at line 72 of file Gain.h.

◆ m_triPts

std::vector<wxPoint2DDouble> Gain::m_triPts
protected

Definition at line 74 of file Gain.h.

◆ m_value

double Gain::m_value = 1.0
protected

Definition at line 69 of file Gain.h.


The documentation for this class was generated from the following files: