diff options
| author | 2015-08-20 11:36:18 +0200 | |
|---|---|---|
| committer | 2015-08-20 11:36:18 +0200 | |
| commit | 8a1c33fb342a3609ec4d22e918c5f847c59c1b91 (patch) | |
| tree | e813b281a6c78b881b811bcb931d32232b1bd435 /node | |
| parent | bb413e7eab871cbc377eea0ece5444d1c758481b (diff) | |
| download | OneRoll-8a1c33fb342a3609ec4d22e918c5f847c59c1b91.tar.gz OneRoll-8a1c33fb342a3609ec4d22e918c5f847c59c1b91.zip | |
start fixing dot tree generation
Diffstat (limited to 'node')
| -rw-r--r-- | node/countexecutenode.cpp | 11 | ||||
| -rw-r--r-- | node/countexecutenode.h | 2 | ||||
| -rw-r--r-- | node/executionnode.h | 2 | ||||
| -rw-r--r-- | node/numbernode.cpp | 11 | ||||
| -rw-r--r-- | node/numbernode.h | 2 | ||||
| -rw-r--r-- | node/rerolldicenode.cpp | 2 | ||||
| -rw-r--r-- | node/rerolldicenode.h | 2 | ||||
| -rw-r--r-- | node/scalaroperatornode.cpp | 5 | ||||
| -rw-r--r-- | node/scalaroperatornode.h | 2 | ||||
| -rw-r--r-- | node/sortresult.cpp | 6 | ||||
| -rw-r--r-- | node/sortresult.h | 2 | ||||
| -rw-r--r-- | node/startingnode.cpp | 7 | ||||
| -rw-r--r-- | node/startingnode.h | 2 |
13 files changed, 42 insertions, 14 deletions
diff --git a/node/countexecutenode.cpp b/node/countexecutenode.cpp index ff3d67b..295fdad 100644 --- a/node/countexecutenode.cpp +++ b/node/countexecutenode.cpp @@ -46,10 +46,19 @@ void CountExecuteNode::run(ExecutionNode *previous) } } } -QString CountExecuteNode::toString() const +QString CountExecuteNode::toString(bool withlabel) const +{ +if(withlabel) { return "CountExecuteNode"+m_validator->toString(); } +else +{ + + return "CountExecuteNode"+m_validator->toString(); +} +} +} qint64 CountExecuteNode::getPriority() const { qint64 priority=0; diff --git a/node/countexecutenode.h b/node/countexecutenode.h index 519403b..167ee82 100644 --- a/node/countexecutenode.h +++ b/node/countexecutenode.h @@ -30,7 +30,7 @@ public: * @brief toString * @return */ - virtual QString toString()const; + virtual QString toString(bool withLabel)const; /** * @brief getPriority * @return diff --git a/node/executionnode.h b/node/executionnode.h index 39d714b..cca7903 100644 --- a/node/executionnode.h +++ b/node/executionnode.h @@ -46,7 +46,7 @@ public: * @brief toString * @return */ - virtual QString toString()const=0; + virtual QString toString(bool withLabel)const=0; /** * @brief getPriority * @return diff --git a/node/numbernode.cpp b/node/numbernode.cpp index c63aadf..55ee752 100644 --- a/node/numbernode.cpp +++ b/node/numbernode.cpp @@ -44,9 +44,16 @@ void NumberNode::setNumber(qint64 a) m_scalarResult->setValue(a); m_number = a; } -QString NumberNode::toString() const +QString NumberNode::toString(bool withLabel) const { - return QString("NumberNode [label=\"NumberNode %1\"]").arg(m_number); + if(withLabel) + { + return QString("NumberNode%2 [label=\"NumberNode %1\"]").arg(m_number).arg(m_number); + } + else + { + return QString("NumberNode%1").arg(m_number); + } } qint64 NumberNode::getPriority() const { diff --git a/node/numbernode.h b/node/numbernode.h index 3c43a51..50d29ad 100644 --- a/node/numbernode.h +++ b/node/numbernode.h @@ -34,7 +34,7 @@ public: NumberNode(); void run(ExecutionNode* previous); void setNumber(qint64); -virtual QString toString()const; + virtual QString toString(bool withLabel)const; virtual qint64 getPriority() const; private: qint64 m_number; diff --git a/node/rerolldicenode.cpp b/node/rerolldicenode.cpp index 038a3ec..7798f61 100644 --- a/node/rerolldicenode.cpp +++ b/node/rerolldicenode.cpp @@ -46,7 +46,7 @@ void RerollDiceNode::setValidator(Validator* val) { m_validator = val; } -QString RerollDiceNode::toString() const +QString RerollDiceNode::toString(bool wl) const { return QString("RerollDiceNode [label=\"RerollDiceNode validatior:%1\"").arg(m_validator->toString()); } diff --git a/node/rerolldicenode.h b/node/rerolldicenode.h index a97e448..f456bb3 100644 --- a/node/rerolldicenode.h +++ b/node/rerolldicenode.h @@ -39,7 +39,7 @@ public: * @brief toString * @return */ - virtual QString toString()const; + virtual QString toString(bool )const; /** diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp index c5f91f9..dead500 100644 --- a/node/scalaroperatornode.cpp +++ b/node/scalaroperatornode.cpp @@ -138,7 +138,7 @@ qint64 ScalarOperatorNode::multiple(qint64 a,qint64 b) { return a*b; } -QString ScalarOperatorNode::toString() const +QString ScalarOperatorNode::toString(bool wl) const { QString op=""; switch(m_operator) @@ -159,7 +159,10 @@ QString ScalarOperatorNode::toString() const break; } +if(wl) return QString("ScalarOperatorNode [label=\"ScalarOperatorNode %1\"").arg(op); +else + return QString("ScalarOperatorNode"); } qint64 ScalarOperatorNode::getPriority() const { diff --git a/node/scalaroperatornode.h b/node/scalaroperatornode.h index e43f6f8..4aab39a 100644 --- a/node/scalaroperatornode.h +++ b/node/scalaroperatornode.h @@ -42,7 +42,7 @@ public: bool setOperatorChar(QChar c); void setInternalNode(ExecutionNode* node); - virtual QString toString()const; + virtual QString toString(bool wl)const; virtual qint64 getPriority() const; void generateDotTree(QString& s); diff --git a/node/sortresult.cpp b/node/sortresult.cpp index 44a25f0..727810e 100644 --- a/node/sortresult.cpp +++ b/node/sortresult.cpp @@ -110,9 +110,13 @@ void SortResultNode::setSortAscending(bool asc) { m_ascending = asc; } -QString SortResultNode::toString() const +QString SortResultNode::toString(bool wl) const { +if(wl) return QString("SortResultNode [label=\"SortResultNode %1\"").arg(m_ascending ? "Ascending":"Descending"); +else + return QString("SortResultNode"); + } qint64 SortResultNode::getPriority() const { diff --git a/node/sortresult.h b/node/sortresult.h index d505e4b..c4f96dc 100644 --- a/node/sortresult.h +++ b/node/sortresult.h @@ -49,7 +49,7 @@ public: * @brief toString * @return */ - virtual QString toString()const; + virtual QString toString(bool wl)const; /** * @brief getPriority * @return diff --git a/node/startingnode.cpp b/node/startingnode.cpp index b15101b..15ea053 100644 --- a/node/startingnode.cpp +++ b/node/startingnode.cpp @@ -13,9 +13,14 @@ void StartingNode::run(ExecutionNode*) m_nextNode->run(this); } } -QString StartingNode::toString() const +QString StartingNode::toString(bool withlabel) const { +if(withlabel) return "StartingNode [shape=box]"; +else + return "StartingNode"; +} + } qint64 StartingNode::getPriority() const { diff --git a/node/startingnode.h b/node/startingnode.h index ebe28c0..e9bc5a5 100644 --- a/node/startingnode.h +++ b/node/startingnode.h @@ -22,7 +22,7 @@ public: * @brief toString * @return */ - virtual QString toString()const; + virtual QString toString(bool withlabel)const; /** * @brief getPriority * @return |