From 4ddc7be64451db873e49169e951532ce8893e359 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 3 Mar 2017 18:50:40 -0300 Subject: More connection line methods implemented --- Project/Element.h | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index c2ce506..bd34f5c 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -225,13 +225,20 @@ public: virtual std::vector GetPointList() const { return m_pointList; } /** - * @brief Add a parent to the element. The parent must be a bus. The element basic points are calculated in this - * method, so apply this when the element is being inserted. + * @brief Add a parent to the element. This method must be used on power elements that connect to a bus, so the + * parent must be a bus. + * The element basic points are calculated in this method, so apply this when the element is being inserted. * @param parent Element parent. * @param position Node position in the parent. */ virtual bool AddParent(Element* parent, wxPoint2DDouble position) { return false; } + /** + * @brief Add a parent to the element. + * @param parent Element parent. + */ + virtual void AddParent(Element* parent) { m_parentList.push_back(parent); } + /** * @brief Checks if the element contains a position. * @param position Position to be checked. @@ -426,16 +433,16 @@ public: double scale, double offsetX = 0.0, double offsetY = 0.0) const; - virtual bool - /** - * @brief Check if two roteted rectangles intersect. - * @param rect1 First rect. - * @param rect2 Second rect. - * @param angle1 Rotation algle of first rectangle. - * @param angle2 Rotation angle of second rectangle. - */ - RotatedRectanglesIntersects(wxRect2DDouble rect1, wxRect2DDouble rect2, double angle1, double angle2) const; + /** + * @brief Check if two roteted rectangles intersect. + * @param rect1 First rect. + * @param rect2 Second rect. + * @param angle1 Rotation algle of first rectangle. + * @param angle2 Rotation angle of second rectangle. + */ + virtual bool + RotatedRectanglesIntersects(wxRect2DDouble rect1, wxRect2DDouble rect2, double angle1, double angle2) const; /** * @brief Draw a circle. @@ -563,7 +570,7 @@ public: * @param minDecimal Minimum number of decimal places. */ static wxString StringFromDouble(double value, int minDecimal = 1); - + /** * @brief Calculate the distance between a line (formed by point list) and a point. * @param point origin point. -- cgit