Stellarium  0.90.0
Scenery3dRemoteControlService.hpp
1 /*
2  * Stellarium Scenery3d Plug-in
3  *
4  * Copyright (C) 2017 Florian Schaukowitsch
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19  */
20 
21 #ifndef _SCENERY3DREMOTECONTROLSERVICE_HPP_
22 #define _SCENERY3DREMOTECONTROLSERVICE_HPP_
23 
24 #include "../../RemoteControl/include/RemoteControlServiceInterface.hpp"
25 #include "Scenery3d.hpp"
26 
27 
30 {
31  Q_OBJECT
32  Q_INTERFACES(RemoteControlServiceInterface)
33 
34 public:
37 
38  // RemoteControlServiceInterface interface
39  virtual QLatin1String getPath() const Q_DECL_OVERRIDE;
40  virtual bool isThreadSafe() const Q_DECL_OVERRIDE;
41  virtual void get(const QByteArray &operation, const APIParameters &parameters, APIServiceResponse &response) Q_DECL_OVERRIDE;
42  virtual void post(const QByteArray &operation, const APIParameters &parameters, const QByteArray &data, APIServiceResponse &response) Q_DECL_OVERRIDE;
43  virtual void update(double deltaTime) Q_DECL_OVERRIDE;
44 protected:
45  void performMove(double x,double y, double z);
46 private:
47  Scenery3d* s3d;
48  Vec3d move;
49  qint64 lastMoveUpdateTime;
50 };
51 
52 
53 #endif // _SCENERY3DREMOTECONTROLSERVICE_HPP_
54 
virtual bool isThreadSafe() const Q_DECL_OVERRIDE
Return true if the service's get() and post() methods can safely be run in the HTTP handler thread...
virtual void update(double deltaTime) Q_DECL_OVERRIDE
Called in the main thread each frame.
Thread-safe version of HttpResponse that can be passed around through QMetaObject::invokeMethod.
virtual QLatin1String getPath() const Q_DECL_OVERRIDE
Returns the desired path mapping If there is a conflict, only the first object is mapped...
Main class of the module, inherits from StelModule.
Definition: Scenery3d.hpp:51
QMultiMap< QByteArray, QByteArray > APIParameters
Defines the HTTP request parameters for the service.
virtual void post(const QByteArray &operation, const APIParameters &parameters, const QByteArray &data, APIServiceResponse &response) Q_DECL_OVERRIDE
Implement this to define reactions to HTTP POST requests.
Interface for all Remote Control Plug-in services.
Provides a Scenery3d service for the Remote Control Plug-in plugin.
Scenery3dRemoteControlService()
Requires the Scenery3d module to be registered.