/*! \brief Creates and returns a deep copy clone of this object. * */ Tunnel * Tunnel::getClone() { // Tunnel // // Tunnel *clone = new Tunnel(getId(), getFileName(), getName(), getType(), getSStart(), getLength(), lighting_, daylight_); return clone; }
/*! \brief Convenience function. * */ void TrackSpiralArcSpiral::setLocalEndHeading(double endHeading) { while (endHeading <= -180.0) { endHeading += 360.0; } while (endHeading > 180.0) { endHeading -= 360.0; } // Local to internal (Parameters are given in internal coordinates) // // setEndHeadingDeg(endHeading - getLocalHeading(getSStart())); }
/*! \brief Convenience function. * */ void TrackSpiralArcSpiral::setLocalPointAndHeading(const QPointF &point, double hdg, bool isStart) { while (hdg <= -180.0) { hdg += 360.0; } while (hdg > 180.0) { hdg -= 360.0; } if (isStart) { // Local to internal (Parameters are given in internal coordinates) // // QPointF deltaPos(getLocalTransform().inverted().map(point) /* - getPoint(getSStart())*/); // getPoint(s_) == 0 by definition double deltaHeading(hdg - heading()); QTransform trafo; trafo.rotate(deltaHeading); pa_->setEndHeadingDeg(pa_->getEndHeadingRad() * 360.0 / (2.0 * M_PI) - deltaHeading); pa_->setEndPoint(trafo.inverted().map(pa_->pEnd_ - deltaPos)); pa_->init(); applyParameters(); // Set local transform // // setLocalTransform(point, hdg); } else { // Local to internal (Parameters are given in internal coordinates) // // pa_->pEnd_ = getLocalTransform().inverted().map(point); pa_->headingEnd_ = (hdg - getLocalHeading(getSStart())) * 2.0 * M_PI / 360.0; pa_->init(); applyParameters(); } }
/*! \brief Returns the end coordinate of this section. * * In road coordinates [m]. */ double TypeSection::getSEnd() const { return getParentRoad()->getTypeSectionEnd(getSStart()); }
/*! \brief Creates and returns a deep copy clone of this object. * */ TypeSection * TypeSection::getClone() { return new TypeSection(getSStart(), type_); }