From a54f50d0bf86c7c4d400e8b4d30cbc6091cfd9df Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 24 Feb 2017 12:25:41 -0300 Subject: Connection line implementation start --- Project/ConnectionLine.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Project/ConnectionLine.cpp (limited to 'Project/ConnectionLine.cpp') diff --git a/Project/ConnectionLine.cpp b/Project/ConnectionLine.cpp new file mode 100644 index 0000000..68d893a --- /dev/null +++ b/Project/ConnectionLine.cpp @@ -0,0 +1,29 @@ +#include "ConnectionLine.h" + +ConnectionLine::ConnectionLine() + : ControlElement() +{ +} + +ConnectionLine::~ConnectionLine() {} + +void ConnectionLine::Draw(wxPoint2DDouble translation, double scale) const +{ + +} + +bool ConnectionLine::Contains(wxPoint2DDouble position) const +{ + if(PointToLineDistance(position) < 5.0) { + return true; + } + return false; +} + +bool ConnectionLine::Intersects(wxRect2DDouble rect) const +{ + for(auto it = m_pointList.begin(); it != m_pointList.end(); ++it) { + if(rect.Contains(*it)) return true; + } + return false; +} -- cgit