diff options
Diffstat (limited to 'Project/ControlElement.h')
-rw-r--r-- | Project/ControlElement.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Project/ControlElement.h b/Project/ControlElement.h index dbff95e..51f8df3 100644 --- a/Project/ControlElement.h +++ b/Project/ControlElement.h @@ -58,6 +58,7 @@ class Node void SetConnected(bool connected = true) { m_connected = connected; } int GetID() const { return m_id; } void SetID(int id) { m_id = id; } + protected: int m_id = -1; @@ -94,7 +95,7 @@ class ControlElement : public Element std::vector<Node*> GetNodeList() const { return m_nodeList; } virtual void DrawNodes() const; virtual void ReplaceNode(Node* oldNode, Node* newNode); - + /** * @brief Update the OpenGL text in the element (if present). * @return true if OpenGLText is ok, false otherwise. @@ -103,13 +104,19 @@ class ControlElement : public Element virtual bool IsSolved() const { return m_solved; } virtual void SetSolved(bool solved = true) { m_solved = solved; } virtual bool Solve(double* input, double timeStep); - virtual bool Initialize() { return true; } + virtual bool Initialize(); virtual double GetOutput() const { return m_output; } virtual void SetOutput(double output) { m_output = output; } + + static ControlElement* GetControlElementFromID(std::vector<ControlElement*> elementList, int id); + protected: std::vector<Node*> m_nodeList; bool m_solved = false; double m_output = 0.0; + + void SaveControlNodes(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementNode); + bool OpenControlNodes(rapidxml::xml_node<>* elementNode); }; #endif // CONTROLELEMENT_H |