From 21ebf63bb59357000f9bb44acde176d4ff169c01 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 9 Mar 2017 15:09:43 -0300 Subject: Sum implemented --- Project/ConnectionLine.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Project/ConnectionLine.cpp') diff --git a/Project/ConnectionLine.cpp b/Project/ConnectionLine.cpp index ecbec1d..8a232fe 100644 --- a/Project/ConnectionLine.cpp +++ b/Project/ConnectionLine.cpp @@ -27,7 +27,7 @@ void ConnectionLine::Draw(wxPoint2DDouble translation, double scale) const glLineWidth(1.5); glColor4d(0.0, 0.0, 0.0, 1.0); DrawLine(m_pointList); - + if(m_type == ELEMENT_LINE) { glColor4d(0.0, 0.0, 0.0, 1.0); DrawCircle(m_pointList[5], 3, 10, GL_POLYGON); @@ -95,7 +95,7 @@ void ConnectionLine::UpdatePoints() wxPoint2DDouble pt1 = m_nodeList[0]->GetPosition(); wxPoint2DDouble pt2 = m_parentLine->GetMidPoint(); wxPoint2DDouble midPt = (pt1 + pt2) / 2.0 + wxPoint2DDouble(0.0, m_lineOffset); - + m_pointList[0] = pt1; if(m_nodeList[0]->GetAngle() == 0.0) m_pointList[1] = m_pointList[0] + wxPoint2DDouble(-10, 0); @@ -157,7 +157,7 @@ bool ConnectionLine::SetParentLine(ConnectionLine* parent) { if(m_nodeList[0]->GetNodeType() != Node::NODE_IN) return false; if(!parent) return false; - + m_type = ELEMENT_LINE; m_parentLine = parent; return true; @@ -172,3 +172,11 @@ std::vector ConnectionLine::GetLineChildList() const } return childList; } + +void ConnectionLine::RemoveParent(Element* parent) +{ + for(auto it = m_parentList.begin(); it != m_parentList.end(); ++it) { + Element* element = *it; + if(element == parent) m_parentList.erase(it--); + } +} -- cgit