void Model::registerProxy(IProxy* proxy) { const string& name=proxy->getName(); if(!hasProxy(name)) { m_mModels[name]=const_cast<IProxy*>(proxy); } }
IProxy *Model::retrieveProxy(const QString &proxyName) { if (!hasProxy(proxyName)) { return NULL; } return m_proxyMap[proxyName]; }
bool RSpline::isOnShape(const RVector& point, bool limited, double tolerance) const { if (hasProxy()) { double t = getTAtPoint(point); RVector p = getPointAt(t); return point.getDistanceTo(p) < tolerance; } else { return RShape::isOnShape(point, limited, tolerance); } }
void Model::registerProxy(IProxy *proxy) { if (proxy == NULL) { return; } if (hasProxy(proxy->getProxyName())) { return; } m_proxyMap[proxy->getProxyName()] = proxy; }
double RSpline::getLength() const { if (!isValid()) { return 0.0; } if (hasProxy()) { return splineProxy->getDistanceAtT(*this, getTMax()); } else { double length = 0.0; QList<QSharedPointer<RShape> > shapes = getExploded(); for (int i=0; i<shapes.size(); i++) { QSharedPointer<RShape> shape = shapes[i]; length += shape->getLength(); } return length; } // seems to only work in the context of another product which uses OpenNURBS: // curve.GetLength(&length); }
RPolyline RSpline::approximateWithArcs(double tolerance) const { if (hasProxy()) { return getSplineProxy()->approximateWithArcs(*this, tolerance); } return RPolyline(); }