Esempio n. 1
0
void Model::registerProxy(IProxy* proxy)
{
    const string& name=proxy->getName();
    if(!hasProxy(name))
    {
        m_mModels[name]=const_cast<IProxy*>(proxy);
    }
}
Esempio n. 2
0
IProxy *Model::retrieveProxy(const QString &proxyName)
{
    if (!hasProxy(proxyName))
    {
        return NULL;
    }

    return m_proxyMap[proxyName];
}
Esempio n. 3
0
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);
    }
}
Esempio n. 4
0
void Model::registerProxy(IProxy *proxy)
{
    if (proxy == NULL)
    {
        return;
    }

    if (hasProxy(proxy->getProxyName()))
    {
        return;
    }

    m_proxyMap[proxy->getProxyName()] = proxy;
}
Esempio n. 5
0
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);
}
Esempio n. 6
0
RPolyline RSpline::approximateWithArcs(double tolerance) const {
    if (hasProxy()) {
        return getSplineProxy()->approximateWithArcs(*this, tolerance);
    }
    return RPolyline();
}