VR-Forces 4.0.4 Class Documentation
include/vrvOsgEarthQt/DtOsgEarthStartupDialogLogic.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2011 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtOsgEarthStartupDialogLogic.h,v $ $Revision: 1.1 $ $State: Exp $
00007 ******************************************************************************/
00008 
00011 
00012 #pragma once
00013 
00014 #include <vrvOsgEarthQt/vrvOsgEarthQt.h>
00015 #include <vrvUtil/DtVirtualBaseClass.h>
00016 #include <vrvUtil/DtSignalConnectionManager.h>
00017 
00018 #include <QtNetwork/QNetworkReply>
00019 #include <QtNetwork/QNetworkAccessManager>
00020 #include <QtCore/QUrl>
00021 
00022 namespace osgEarth
00023 {
00024    class Config;
00025 }
00026 
00027 namespace makVrv
00028 {
00029    class DtOsgEarthStartupDialogInterface;
00030    class DtServerAvailable;
00031 
00034    class DT_DLL_VRVOSGEARTHQT DtOsgEarthStartupDialogLogic : public DtVirtualBaseClass
00035    {
00036    public:
00037 
00039       DtOsgEarthStartupDialogLogic(DtDe& de, DtOsgEarthStartupDialogInterface& iface);
00040 
00042       virtual ~DtOsgEarthStartupDialogLogic();
00043 
00044    protected:
00046       virtual void slot_neverShowAgain(bool neverShow);
00047 
00049       virtual void slot_connectToServer(const std::string& server);
00050 
00052       virtual void slot_loadTerrain(const std::string& terrain);
00053 
00056       bool processServers();
00057 
00060       bool processTerrain();
00061 
00064       bool processScenes();
00065 
00067       virtual void slot_checkServerAvailability(const std::string&);
00068 
00070       virtual void slot_serverIsAvailable(const std::string& desc, bool, const std::string& reason);
00071 
00072    protected:
00075       virtual QUrl urlFromServer(const std::string&) const;
00076       virtual QUrl urlFromEarthFile(const std::string&) const;
00077       virtual QUrl urlFromEarthConfig(const osgEarth::Config&) const;
00078 
00079    protected:
00080 
00081       DtDe&                 myDe;
00082       DtOsgEarthStartupDialogInterface& myInterface;
00083       DtSignalConnectionManager myConnections;
00084       std::string myWaitingForServerResponse;
00085       DtServerAvailable* myServerAvailableRequestor;
00086       std::map<std::string, std::string> myServersNameToPathMap;
00087       std::map<std::string, std::string> myTerrainNameToPathMap;
00088       std::map<std::string, std::string> mySceneNameToPathMap;
00089    };
00090 
00093    class DT_DLL_VRVOSGEARTHQT DtOsgEarthStartupDialogLogicCreator : public DtVirtualBaseClass
00094    {
00095    public:
00096 
00098       static DtOsgEarthStartupDialogLogicCreator& instance(DtDe&);
00099 
00101       static void registerInstance(DtDe& de, DtOsgEarthStartupDialogLogicCreator* instance);
00102 
00104       DtOsgEarthStartupDialogLogicCreator();
00105 
00107       virtual ~DtOsgEarthStartupDialogLogicCreator();
00108 
00110       virtual DtVirtualBaseClass* create(DtDe& de, DtOsgEarthStartupDialogInterface& iFace );
00111    };
00112 
00115    class DT_DLL_VRVOSGEARTHQT DtServerAvailable : public QObject
00116    {
00117       Q_OBJECT
00118 
00119    public:
00121       DtServerAvailable(const std::string& serverKey, const QUrl& page);
00122 
00124       virtual ~DtServerAvailable();
00125 
00127       void processRequest();
00128 
00129       boost::signal<void (const std::string&, bool, const std::string&)> signal_serverAvailable;
00130 
00131       protected slots:
00133          virtual void finished(QNetworkReply*);
00134 
00135    protected:
00136       QNetworkAccessManager   myManager;
00137       QUrl                    myUrl;
00138       std::string             myKey;
00139    };
00140 }
00141 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)