diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-06 11:37:00 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-06 11:37:00 -0300 |
commit | c5636d2031b20e673441e095d90ba94942698e7c (patch) | |
tree | 30b9f15cd5d91fe11a07960154d03afc2328bf8a /Project/ConnectionLine.cpp | |
parent | 0586ac0d34e4d8d5dd9845f2fdd212716b3004f9 (diff) | |
download | PSP.git-c5636d2031b20e673441e095d90ba94942698e7c.tar.gz PSP.git-c5636d2031b20e673441e095d90ba94942698e7c.tar.xz PSP.git-c5636d2031b20e673441e095d90ba94942698e7c.zip |
Some class enum implementation
Just for better code design: https://docs.microsoft.com/pt-br/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types
Diffstat (limited to 'Project/ConnectionLine.cpp')
-rw-r--r-- | Project/ConnectionLine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Project/ConnectionLine.cpp b/Project/ConnectionLine.cpp index 1a858a4..4ce7df8 100644 --- a/Project/ConnectionLine.cpp +++ b/Project/ConnectionLine.cpp @@ -42,7 +42,7 @@ void ConnectionLine::Draw(wxPoint2DDouble translation, double scale) const glColor4d(0.0, 0.0, 0.0, 1.0); DrawLine(m_pointList); - if(m_type == ELEMENT_LINE) { + if(m_type == ConnectionLineType::ELEMENT_LINE) { glColor4d(0.0, 0.0, 0.0, 1.0); DrawCircle(m_pointList[5], 3, 10, GL_POLYGON); } @@ -64,7 +64,7 @@ bool ConnectionLine::Intersects(wxRect2DDouble rect) const void ConnectionLine::UpdatePoints() { - if(m_type == ELEMENT_ELEMENT) { + if(m_type == ConnectionLineType::ELEMENT_ELEMENT) { bool hasOneNode = true; wxPoint2DDouble pt1 = m_nodeList[0]->GetPosition(); wxPoint2DDouble pt2; @@ -103,7 +103,7 @@ void ConnectionLine::UpdatePoints() } m_pointList[3] = m_pointList[4] + wxPoint2DDouble(0.0, midPt.m_y - m_pointList[4].m_y); - } else if(m_type == ELEMENT_LINE) { + } else if(m_type == ConnectionLineType::ELEMENT_LINE) { wxPoint2DDouble pt1 = m_nodeList[0]->GetPosition(); wxPoint2DDouble pt2 = m_parentLine->GetMidPoint(); wxPoint2DDouble midPt = (pt1 + pt2) / 2.0 + wxPoint2DDouble(0.0, m_lineOffset); @@ -169,7 +169,7 @@ bool ConnectionLine::SetParentLine(ConnectionLine* parent) if(m_nodeList[0]->GetNodeType() != Node::NodeType::NODE_IN) return false; if(!parent) return false; - m_type = ELEMENT_LINE; + m_type = ConnectionLineType::ELEMENT_LINE; m_parentLine = parent; return true; } |