Scenery3dMgr.cpp   Scenery3dMgr.cpp 
skipping to change at line 18 skipping to change at line 18
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
#include <QString> #include <QString>
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QKeyEvent> #include <QKeyEvent>
#include <QTimer> #include <QTimer>
#include <QOpenGLShaderProgram> #include <QOpenGLShaderProgram>
skipping to change at line 231 skipping to change at line 231
defaultScenery3dID = conf->value("default_location_id","").toString( ); defaultScenery3dID = conf->value("default_location_id","").toString( );
conf->endGroup(); conf->endGroup();
} }
void Scenery3dMgr::createActions() void Scenery3dMgr::createActions()
{ {
QString groupName = N_("Scenery3d: 3D landscapes"); QString groupName = N_("Scenery3d: 3D landscapes");
//enable action will be set checkable if a scene was loaded //enable action will be set checkable if a scene was loaded
addAction("actionShow_Scenery3d", groupName, N_("To addAction("actionShow_Scenery3d", groupName, N_("To
ggle 3D landscape"), this, "enableScene", "Ctrl+3"); ggle 3D landscape"), this, "enableScene", "Ctrl+W");
addAction("actionShow_Scenery3d_dialog", groupName, N_("Sh addAction("actionShow_Scenery3d_dialog", groupName, N_("Sh
ow settings dialog"), scenery3dDialog, "visible", "Ctrl+Shift+3 ow settings dialog"), scenery3dDialog, "visible", "Ctrl+Shift+W
"); ");
addAction("actionShow_Scenery3d_storedViewDialog", groupName, N_("Sh addAction("actionShow_Scenery3d_storedViewDialog", groupName, N_("Sh
ow viewpoint dialog"), storedViewDialog, "visible", "Ctrl+Alt+3") ow viewpoint dialog"), storedViewDialog, "visible", "Ctrl+Alt+W")
; ;
addAction("actionShow_Scenery3d_shadows", groupName, N_("To ggle shadows"), this, "enableShadows", "Ctrl+R, S"); addAction("actionShow_Scenery3d_shadows", groupName, N_("To ggle shadows"), this, "enableShadows", "Ctrl+R, S");
addAction("actionShow_Scenery3d_debuginfo", groupName, N_("To ggle debug information"), this, "enableDebugInfo", "Ctrl+R, D"); addAction("actionShow_Scenery3d_debuginfo", groupName, N_("To ggle debug information"), this, "enableDebugInfo", "Ctrl+R, D");
addAction("actionShow_Scenery3d_locationinfo", groupName, N_("To ggle location text"), this, "enableLocationInfo","Ctrl+R, T"); addAction("actionShow_Scenery3d_locationinfo", groupName, N_("To ggle location text"), this, "enableLocationInfo","Ctrl+R, T");
addAction("actionShow_Scenery3d_torchlight", groupName, N_("To ggle torchlight"), this, "enableTorchLight", "Ctrl+R, L"); addAction("actionShow_Scenery3d_torchlight", groupName, N_("To ggle torchlight"), this, "enableTorchLight", "Ctrl+R, L");
addAction("actionReload_Scenery3d_shaders", groupName, N_("Re load shaders"), this, "reloadShaders()", "Ctrl+R, P"); addAction("actionReload_Scenery3d_shaders", groupName, N_("Re load shaders"), this, "reloadShaders()", "Ctrl+R, P");
} }
void Scenery3dMgr::createToolbarButtons() const void Scenery3dMgr::createToolbarButtons() const
{ {
// Add 3 toolbar buttons (copy/paste widely from AngleMeasure): acti vate, settings, and viewpoints. // Add 3 toolbar buttons (copy/paste widely from AngleMeasure): acti vate, settings, and viewpoints.
skipping to change at line 477 skipping to change at line 477
QString id = getDefaultScenery3dID(); QString id = getDefaultScenery3dID();
if(!id.isEmpty()) if(!id.isEmpty())
{ {
if(!currentLoadScene.isValid) if(!currentLoadScene.isValid)
loadScenery3dByID(id); loadScenery3dByID(id);
return; return;
} }
else else
{ {
flagEnabled = false; flagEnabled = false;
showMessage("Please load a scene first!"); showMessage(q_("Please load a scene first!"));
emit enableSceneChanged(false); emit enableSceneChanged(false);
} }
} }
if(enable!=flagEnabled) if(enable!=flagEnabled)
{ {
flagEnabled=enable; flagEnabled=enable;
if (scenery3d->getCubemapSize()==0) if (scenery3d->getCubemapSize()==0)
{ {
//TODO FS: remove this? //TODO FS: remove this?
if (flagEnabled) if (flagEnabled)
skipping to change at line 843 skipping to change at line 843
bool Scenery3dMgr::getIsANGLE() const bool Scenery3dMgr::getIsANGLE() const
{ {
return scenery3d->isANGLEContext(); return scenery3d->isANGLEContext();
} }
uint Scenery3dMgr::getMaximumFramebufferSize() const uint Scenery3dMgr::getMaximumFramebufferSize() const
{ {
return scenery3d->getMaximumFramebufferSize(); return scenery3d->getMaximumFramebufferSize();
} }
void Scenery3dMgr::setView(const StoredView &view) void Scenery3dMgr::setView(const StoredView &view, const bool setDate)
{ {
//update position //update position
//important: set eye height first //important: set eye height first
scenery3d->setEyeHeight(view.position[3]); scenery3d->setEyeHeight(view.position[3]);
//then, set grid position //then, set grid position
scenery3d->setGridPosition(Vec3d(view.position[0],view.position[1],v iew.position[2])); scenery3d->setGridPosition(Vec3d(view.position[0],view.position[1],v iew.position[2]));
//update time, if relevant and wanted.
if (view.jdIsRelevant && setDate)
{
StelCore *core=StelApp::getInstance().getCore();
core->setJD(view.jd);
}
//update view vector //update view vector
StelMovementMgr* mm=StelApp::getInstance().getCore()->getMovementMgr (); StelMovementMgr* mm=StelApp::getInstance().getCore()->getMovementMgr ();
// This vector is (az_deg, alt_deg, fov_deg) // This vector is (az_deg, alt_deg, fov_deg)
Vec3d v; Vec3d v;
StelUtils::spheToRect((180.0-view.view_fov[0])*M_PI/180.0, view.view _fov[1]*M_PI/180.0, v); StelUtils::spheToRect((180.0-view.view_fov[0])*M_PI/180.0, view.view _fov[1]*M_PI/180.0, v);
mm->setViewDirectionJ2000(StelApp::getInstance().getCore()->altAzToJ 2000(v, StelCore::RefractionOff)); mm->setViewDirectionJ2000(StelApp::getInstance().getCore()->altAzToJ 2000(v, StelCore::RefractionOff));
mm->zoomTo(view.view_fov[2]); mm->zoomTo(view.view_fov[2]);
} }
StoredView Scenery3dMgr::getCurrentView() StoredView Scenery3dMgr::getCurrentView()
{ {
StoredView view; StoredView view;
 End of changes. 6 change blocks. 
12 lines changed or deleted 18 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/