Exemplo n.º 1
0
void StelMovementMgr::changeConstellationArtIntensity()
{
	ConstellationMgr *cmgr = GETSTELMODULE(ConstellationMgr);
	// During startup this may not have been initialized yet!
	if (!cmgr)
		return;

	if (cmgr->getFlagArt())
	{
		double artInt = getInitConstellationIntensity();
		// Fade out constellation art when FOV less 2 degrees
		if (currentFov<=2.)
		{
			artInt *= currentFov>1.? (currentFov-1.) : 0. ;
		}
		cmgr->setArtIntensity(artInt);
	}
}
Exemplo n.º 2
0
void StelGui::initConstellationMgr()
{
	ConstellationMgr* constellationMgr = GETSTELMODULE(ConstellationMgr);
	getGuiAction("actionShow_Constellation_Lines")->setChecked(constellationMgr->getFlagLines());
	connect(getGuiAction("actionShow_Constellation_Lines"),
					SIGNAL(toggled(bool)),
					constellationMgr,
					SLOT(setFlagLines(bool)));
	connect(constellationMgr,
					SIGNAL(linesDisplayedChanged(const bool)),
					this,
					SLOT(linesDisplayedUpdated(const bool)));

	getGuiAction("actionShow_Constellation_Art")->setChecked(constellationMgr->getFlagArt());
	connect(getGuiAction("actionShow_Constellation_Art"),
					SIGNAL(toggled(bool)),
					constellationMgr,
					SLOT(setFlagArt(bool)));
	connect(constellationMgr,
					SIGNAL(artDisplayedChanged(const bool)),
					this,
					SLOT(artDisplayedUpdated(const bool)));

	getGuiAction("actionShow_Constellation_Labels")->setChecked(constellationMgr->getFlagLabels());
	connect(getGuiAction("actionShow_Constellation_Labels"),
					SIGNAL(toggled(bool)),
					constellationMgr,
					SLOT(setFlagLabels(bool)));
	connect(constellationMgr,
					SIGNAL(namesDisplayedChanged(const bool)),
					this,
					SLOT(namesDisplayedUpdated(const bool)));

	getGuiAction("actionShow_Constellation_Boundaries")->setChecked(constellationMgr->getFlagBoundaries());
	connect(getGuiAction("actionShow_Constellation_Boundaries"),
					SIGNAL(toggled(bool)),
					constellationMgr,
					SLOT(setFlagBoundaries(bool)));
	connect(constellationMgr,
					SIGNAL(boundariesDisplayedChanged(const bool)),
					this,
					SLOT(boundariesDisplayedUpdated(const bool)));
}
Exemplo n.º 3
0
void StelApp::init(QSettings* conf)
{
	confSettings = conf;

	devicePixelsPerPixel = QOpenGLContext::currentContext()->screen()->devicePixelRatio();

	setBaseFontSize(confSettings->value("gui/base_font_size", 13).toInt());
	
	core = new StelCore();
	if (saveProjW!=-1 && saveProjH!=-1)
		core->windowHasBeenResized(0, 0, saveProjW, saveProjH);

	// Initialize AFTER creation of openGL context
	textureMgr = new StelTextureMgr();
	textureMgr->init();

	networkAccessManager = new QNetworkAccessManager(this);
	// Activate http cache if Qt version >= 4.5
	QNetworkDiskCache* cache = new QNetworkDiskCache(networkAccessManager);
	QString cachePath = StelFileMgr::getCacheDir();

	qDebug() << "Cache directory is: " << QDir::toNativeSeparators(cachePath);
	cache->setCacheDirectory(cachePath);
	networkAccessManager->setCache(cache);
	connect(networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(reportFileDownloadFinished(QNetworkReply*)));

	// Stel Object Data Base manager
	stelObjectMgr = new StelObjectMgr();
	stelObjectMgr->init();
	getModuleMgr().registerModule(stelObjectMgr);

	localeMgr = new StelLocaleMgr();
	skyCultureMgr = new StelSkyCultureMgr();
	planetLocationMgr = new StelLocationMgr();
	actionMgr = new StelActionMgr();

	localeMgr->init();

	// Init the solar system first
	SolarSystem* ssystem = new SolarSystem();
	ssystem->init();
	getModuleMgr().registerModule(ssystem);

	// Load hipparcos stars & names
	StarMgr* hip_stars = new StarMgr();
	hip_stars->init();
	getModuleMgr().registerModule(hip_stars);

	core->init();

	// Init nebulas
	NebulaMgr* nebulas = new NebulaMgr();
	nebulas->init();
	getModuleMgr().registerModule(nebulas);

	// Init milky way
	MilkyWay* milky_way = new MilkyWay();
	milky_way->init();
	getModuleMgr().registerModule(milky_way);

	// Init zodiacal light
	ZodiacalLight* zodiacal_light = new ZodiacalLight();
	zodiacal_light->init();
	getModuleMgr().registerModule(zodiacal_light);

	// Init sky image manager
	skyImageMgr = new StelSkyLayerMgr();
	skyImageMgr->init();
	getModuleMgr().registerModule(skyImageMgr);

	// Init audio manager
	audioMgr = new StelAudioMgr();

	// Init video manager
	videoMgr = new StelVideoMgr();

	// Constellations
	ConstellationMgr* asterisms = new ConstellationMgr(hip_stars);
	asterisms->init();
	getModuleMgr().registerModule(asterisms);

	// Landscape, atmosphere & cardinal points section
	LandscapeMgr* landscape = new LandscapeMgr();
	landscape->init();
	getModuleMgr().registerModule(landscape);

	GridLinesMgr* gridLines = new GridLinesMgr();
	gridLines->init();
	getModuleMgr().registerModule(gridLines);

	// Sporadic Meteors
	SporadicMeteorMgr* meteors = new SporadicMeteorMgr(10, 72);
	meteors->init();
	getModuleMgr().registerModule(meteors);

	// User labels
	LabelMgr* skyLabels = new LabelMgr();
	skyLabels->init();
	getModuleMgr().registerModule(skyLabels);

	skyCultureMgr->init();

	//Create the script manager here, maybe some modules/plugins may want to connect to it
	//It has to be initialized later after all modules have been loaded by calling initScriptMgr
#ifndef DISABLE_SCRIPTING
	scriptAPIProxy = new StelMainScriptAPIProxy(this);
	scriptMgr = new StelScriptMgr(this);
#endif

	// Initialisation of the color scheme
	emit colorSchemeChanged("color");
	setVisionModeNight(confSettings->value("viewing/flag_night").toBool());

	// Enable viewport effect at startup if he set
	setViewportEffect(confSettings->value("video/viewport_effect", "none").toString());

	// Proxy Initialisation
	setupNetworkProxy();
	updateI18n();

	// Init actions.
	actionMgr->addAction("actionShow_Night_Mode", N_("Display Options"), N_("Night mode"), this, "nightMode");

	setFlagShowDecimalDegrees(confSettings->value("gui/flag_show_decimal_degrees", false).toBool());
	setFlagOldAzimuthUsage(confSettings->value("gui/flag_use_azimuth_from_south", false).toBool());
	
	initialized = true;
}