int main(int argc, char *argv[]) { // initialize resources, if needed // Q_INIT_RESOURCE(resfile); QApplication app(argc, argv); #ifndef DEBUG_OUTPUT QStringList args = app.arguments(); MainWindow w; w.show(); return app.exec(); #else QStringList args = app.arguments(); if (args.length() == 1) { MainWindow w; w.show(); return app.exec(); } QString optTriangle = args[1]; QString optViewpoint = args[2]; QString optFrequency = args[3]; QString optAmplitude = args[4]; Triangle globalTriangle; MVector globalViewpoint; mdouble frequency; mdouble amplitude; try { globalTriangle = getTriangle(optTriangle); globalViewpoint = getViewpoint(optViewpoint); frequency = optFrequency.toDouble(); amplitude = optAmplitude.toDouble(); } catch (const QString error) { qDebug()<<"Виникла помилка:"<<error; return 0; } mdouble wavelength = Processor::LIGHTSPEED / (frequency * pow(10, 9)); if (!Processor::isTriangleVisible(globalTriangle, QList<Triangle>(), globalViewpoint)) { std::cout<<"Triangle is invisible from this viewpoint, exiting..."<<std::endl; return 0; } QList<Triangle> model; model.push_back(globalTriangle); std::complex<mdouble> e = Processor::getE(globalViewpoint, model, wavelength, amplitude); #endif }
void MapManipulator::updateCameraProjection() { bool isTilted = (getViewpoint().getPitch() > -88); bool isFar = (getDistance() > 7e6); osgEarth::Util::EarthManipulator::CameraProjection projection; if (isTilted || isFar) { projection = osgEarth::Util::EarthManipulator::PROJ_PERSPECTIVE; } else { projection = osgEarth::Util::EarthManipulator::PROJ_ORTHOGRAPHIC; } getSettings()->setCameraProjection(projection); }
void MapManipulator::untilt(double duration) { osgEarth::Util::Viewpoint viewpoint = getViewpoint(); viewpoint.setPitch(-90); setViewpoint(viewpoint, duration); }
void MapManipulator::resetNorth(double duration) { osgEarth::Util::Viewpoint viewpoint = getViewpoint(); viewpoint.setHeading(0); setViewpoint(viewpoint, duration); }