void drawLine(ImgRGB& outImg, double l[], uchar r, uchar g, uchar b) { double x1, y1, x2, y2; getEndPoints(l, outImg.h - 1, outImg.w - 1, x1, y1, x2, y2); cv::Mat tmpImg(outImg.h, outImg.w, CV_8UC3, outImg.data); cv::line(tmpImg, cv::Point2f(x1, y1), cv::Point2f(x2, y2), cv::Scalar(r, g, b)); }
/** * \return A point that is on the entity. Used to check if an entity is * inside a polygon. */ RVector REntityData::getPointOnEntity() const { QList<RVector> endPoints = getEndPoints(); if (endPoints.size()>0) { return endPoints[0]; } else { return getClosestPointOnEntity(RVector(0.0,0.0)); } }
QString WizCommonApiEntry::getUrlFromCache(const QString& strCommand) { QMutexLocker locker(&m_mutex); // if (m_cacheMap.isEmpty()) { getEndPoints(); } if (!m_cacheMap.value(strCommand).isEmpty()) return m_cacheMap.value(strCommand); return QString(); }
/** * \return Shortest vector from any end point of this shape * to the given point. */ RVector RShape::getVectorFromEndpointTo(const RVector& point) const { QList<RVector> endPoints = getEndPoints(); RVector closest = point.getClosest(endPoints); return point - closest; }