diff --git a/apps/Launcher/mainwindow.h b/apps/Launcher/mainwindow.h index e3360b1c23..9b9d9bd10e 100644 --- a/apps/Launcher/mainwindow.h +++ b/apps/Launcher/mainwindow.h @@ -79,8 +79,8 @@ private: //class MainWindow : public QWidget { //Q_OBJECT //public: -// MainWindow(); -// ~MainWindow(); +// MainWindow(); +// ~MainWindow(); // // std::string nextTarget() const; // @@ -94,7 +94,7 @@ private: // void onSocketConnected(); // void onSocketDisconnected(); // -// void readTcpData(); +// void readTcpData(); // void handleStatusMessage(QByteArray data); // void handlePlaybook(QByteArray data); // @@ -106,7 +106,7 @@ private: // InformationWidget* _informationWidget; // TimelineWidget* _timelineWidget; // -// QTcpSocket* _socket; +// QTcpSocket* _socket; // // bool _hasHongKangTimeline = false; // bool _hasLabelTimeline = false; diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 0eba15f18b..d43be6508b 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -183,7 +183,7 @@ int main(int argc, char** argv) { } void mainInitFunc() { - //is this node the master? (must be set after call to _sgctEngine->init()) + //is this node the master? (must be set after call to _sgctEngine->init()) OsEng.setMaster(_sgctEngine->isMaster()); bool success = OsEng.initialize(); diff --git a/apps/TimelineView/configurationwidget.h b/apps/TimelineView/configurationwidget.h index 3beca827f7..1f7ff034c2 100644 --- a/apps/TimelineView/configurationwidget.h +++ b/apps/TimelineView/configurationwidget.h @@ -32,7 +32,7 @@ class ConfigurationWidget : public QWidget { Q_OBJECT public: - ConfigurationWidget(QWidget* parent); + ConfigurationWidget(QWidget* parent); void socketConnected(); void socketDisconnected(); diff --git a/apps/TimelineView/controlwidget.h b/apps/TimelineView/controlwidget.h index 8ae2f11fd8..5c6e99e5df 100644 --- a/apps/TimelineView/controlwidget.h +++ b/apps/TimelineView/controlwidget.h @@ -35,7 +35,7 @@ class QSlider; class ControlWidget : public QWidget { Q_OBJECT public: - ControlWidget(QWidget* parent); + ControlWidget(QWidget* parent); void update(QString currentTime, QString currentDelta); diff --git a/apps/TimelineView/informationwidget.h b/apps/TimelineView/informationwidget.h index c1a657ee20..811151a415 100644 --- a/apps/TimelineView/informationwidget.h +++ b/apps/TimelineView/informationwidget.h @@ -30,7 +30,7 @@ class InformationWidget : public QTextEdit { Q_OBJECT public: - InformationWidget(QWidget* parent); + InformationWidget(QWidget* parent); void socketConnected(); void socketDisconnected(); diff --git a/apps/TimelineView/main.cpp b/apps/TimelineView/main.cpp index 463578f67e..f9bd72520c 100644 --- a/apps/TimelineView/main.cpp +++ b/apps/TimelineView/main.cpp @@ -28,15 +28,15 @@ static const QString style = R"style( QWidget { - background-color: rgb(80, 80, 80); - font-family: Helvetica; + background-color: rgb(80, 80, 80); + font-family: Helvetica; } QGroupBox { background-color: qlineargradient( - x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #858585, - stop: 1 #959595); + x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #858585, + stop: 1 #959595); border: 2px solid gray; border-radius: 5px; margin-top: 4ex; @@ -44,7 +44,7 @@ QGroupBox { } QGroupBox::title { - background-color: #E0E0E0; + background-color: #E0E0E0; border: 2px solid gray; border-radius: 5px; subcontrol-origin: margin; @@ -60,10 +60,10 @@ QSlider::groove:horizontal { border: 1px solid #999999; height: 8px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ background: qlineargradient( - x1:0, y1:0, x2:1, y2:0, - stop:0 #c4c4c4, - stop:0.5 #555555, - stop:1 #c4c4c4 + x1:0, y1:0, x2:1, y2:0, + stop:0 #c4c4c4, + stop:0.5 #555555, + stop:1 #c4c4c4 ); margin: 2px 0; } @@ -77,7 +77,7 @@ QSlider::handle:horizontal { } QPushButton { - background-color: lightgray; + background-color: lightgray; border-style: outset; border-width: 0.5px; border-radius: 5px; @@ -87,16 +87,16 @@ QPushButton { } QPushButton#connection { - background-color: lightgreen; + background-color: lightgreen; } QPushButton#connection:pressed { - background-color: green; + background-color: green; } QPushButton#pause, QPushButton#play { - padding: 5px; + padding: 5px; } QPushButton#pause:pressed, QPushButton#play:pressed, QPushButton:pressed { @@ -112,7 +112,7 @@ QCombobox { } QComboBox:editable { - background: lightgrey; + background: lightgrey; } QComboBox QAbstractItemView { @@ -123,34 +123,34 @@ QComboBox QAbstractItemView { } QLabel#label { - font-size: 13px; - background-color: transparent; - font-variant: small-caps; + font-size: 13px; + background-color: transparent; + font-variant: small-caps; } QLabel#value { - font-family: monospace; - font-weight: bold; - font-size: 14px; - background-color: transparent; + font-family: monospace; + font-weight: bold; + font-size: 14px; + background-color: transparent; } QWidget#background { - background-color: transparent; + background-color: transparent; } QTextEdit { - font-family: monospace; + font-family: monospace; } )style"; int main(int argc, char** argv) { - QApplication app(argc, argv); + QApplication app(argc, argv); app.setStyleSheet(style); - MainWindow window; - window.show(); + MainWindow window; + window.show(); - return app.exec(); + return app.exec(); } diff --git a/apps/TimelineView/mainwindow.cpp b/apps/TimelineView/mainwindow.cpp index 54bec61456..dc5e623e88 100644 --- a/apps/TimelineView/mainwindow.cpp +++ b/apps/TimelineView/mainwindow.cpp @@ -67,9 +67,9 @@ MainWindow::MainWindow() , _timeControlWidget(nullptr) , _informationWidget(nullptr) , _timelineWidget(nullptr) - , _socket(nullptr) + , _socket(nullptr) { - setWindowTitle("OpenSpace Timeline"); + setWindowTitle("OpenSpace Timeline"); _configurationWidget = new ConfigurationWidget(this); _configurationWidget->setMinimumWidth(350); @@ -79,7 +79,7 @@ MainWindow::MainWindow() _informationWidget->setMinimumWidth(350); _timelineWidget = new TimelineWidget(this); - QGridLayout* layout = new QGridLayout; + QGridLayout* layout = new QGridLayout; layout->addWidget(_configurationWidget, 0, 0); layout->addWidget(_timeControlWidget, 1, 0); layout->addWidget(_informationWidget, 2, 0); @@ -102,7 +102,7 @@ MainWindow::MainWindow() this, SLOT(sendScript(QString)) ); - setLayout(layout); + setLayout(layout); _configurationWidget->socketDisconnected(); _timeControlWidget->socketDisconnected(); @@ -111,7 +111,7 @@ MainWindow::MainWindow() } MainWindow::~MainWindow() { - delete _socket; + delete _socket; } void MainWindow::onConnect(QString host, QString port) { diff --git a/apps/TimelineView/mainwindow.h b/apps/TimelineView/mainwindow.h index 126dc314cf..9c23cf8448 100644 --- a/apps/TimelineView/mainwindow.h +++ b/apps/TimelineView/mainwindow.h @@ -38,8 +38,8 @@ class TimelineWidget; class MainWindow : public QWidget { Q_OBJECT public: - MainWindow(); - ~MainWindow(); + MainWindow(); + ~MainWindow(); std::string nextTarget() const; @@ -53,7 +53,7 @@ private slots: void onSocketConnected(); void onSocketDisconnected(); - void readTcpData(); + void readTcpData(); void handleStatusMessage(QByteArray data); QByteArray handlePlaybook(QByteArray data); void printMapping(QByteArray data); @@ -66,7 +66,7 @@ private: InformationWidget* _informationWidget; TimelineWidget* _timelineWidget; - QTcpSocket* _socket; + QTcpSocket* _socket; bool _isConnected = false; }; diff --git a/apps/TimelineView/timelinewidget.h b/apps/TimelineView/timelinewidget.h index f0c9233a8a..be3a880d00 100644 --- a/apps/TimelineView/timelinewidget.h +++ b/apps/TimelineView/timelinewidget.h @@ -38,7 +38,7 @@ class QPaintEvent; class TimelineWidget : public QWidget { Q_OBJECT public: - TimelineWidget(QWidget* parent); + TimelineWidget(QWidget* parent); void setData(std::vector images, std::map targetMap, std::map instrumentMap); void setCurrentTime(std::string currentTime, double et); diff --git a/ext/ghoul b/ext/ghoul index a1556e0497..fb0ce7bfbd 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit a1556e04976dc66225614a2435a6576e3ff6eecf +Subproject commit fb0ce7bfbd859efa02beab4c84b62991a25d1666 diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index f921b0ded9..891e8c795b 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -66,8 +66,8 @@ public: static bool isInitialized(); static OpenSpaceEngine& ref(); - bool isMaster(); - void setMaster(bool master); + bool isMaster(); + void setMaster(bool master); double runTime(); void setRunTime(double t); @@ -75,29 +75,29 @@ public: ConfigurationManager& configurationManager(); interaction::InteractionHandler& interactionHandler(); RenderEngine& renderEngine(); - scripting::ScriptEngine& scriptEngine(); + scripting::ScriptEngine& scriptEngine(); NetworkEngine& networkEngine(); - LuaConsole& console(); + LuaConsole& console(); ModuleEngine& moduleEngine(); network::ParallelConnection& parallelConnection(); properties::PropertyOwner& globalPropertyOwner(); WindowWrapper& windowWrapper(); ghoul::fontrendering::FontManager& fontManager(); - gui::GUI& gui(); + gui::GUI& gui(); // SGCT callbacks bool initialize(); bool initializeGL(); void preSynchronization(); void postSynchronizationPreDraw(); - void render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix); - void postDraw(); + void render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix); + void postDraw(); void keyboardCallback(Key key, KeyModifier mod, KeyAction action); - void charCallback(unsigned int codepoint, KeyModifier mod); + void charCallback(unsigned int codepoint, KeyModifier mod); void mouseButtonCallback(MouseButton button, MouseAction action); void mousePositionCallback(double x, double y); void mouseScrollWheelCallback(double pos); - void externalControlCallback(const char* receivedChars, int size, int clientId); + void externalControlCallback(const char* receivedChars, int size, int clientId); void encode(); void decode(); @@ -110,22 +110,22 @@ private: OpenSpaceEngine(std::string programName, std::unique_ptr windowWrapper); ~OpenSpaceEngine(); - void clearAllWindows(); - bool gatherCommandlineArguments(); - bool loadSpiceKernels(); + void clearAllWindows(); + bool gatherCommandlineArguments(); + bool loadSpiceKernels(); void loadFonts(); void runScripts(const ghoul::Dictionary& scripts); void runStartupScripts(); - void configureLogging(); + void configureLogging(); // Components std::unique_ptr _configurationManager; std::unique_ptr _interactionHandler; std::unique_ptr _renderEngine; - std::unique_ptr _scriptEngine; + std::unique_ptr _scriptEngine; std::unique_ptr _networkEngine; - std::unique_ptr _commandlineParser; - std::unique_ptr _console; + std::unique_ptr _commandlineParser; + std::unique_ptr _console; std::unique_ptr _moduleEngine; std::unique_ptr _gui; std::unique_ptr _parallelConnection; @@ -136,7 +136,7 @@ private: std::unique_ptr _globalPropertyNamespace; std::unique_ptr _syncBuffer; - bool _isMaster; + bool _isMaster; double _runTime; static OpenSpaceEngine* _engine; diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h index 6a6ce64dd3..d20f5339db 100644 --- a/include/openspace/engine/wrapper/windowwrapper.h +++ b/include/openspace/engine/wrapper/windowwrapper.h @@ -116,7 +116,7 @@ public: */ virtual int currentNumberOfAaSamples() const; - /** + /** * Returns true if the current rendering method is regular, i.e., it is * a flat projection without non-linear distortions. Returns false in * other cases, for example fisheye projections. On default, this method will return diff --git a/include/openspace/interaction/controller.h b/include/openspace/interaction/controller.h index a4349c248d..636b810ebe 100644 --- a/include/openspace/interaction/controller.h +++ b/include/openspace/interaction/controller.h @@ -37,14 +37,14 @@ class InteractionHandler; class Controller { public: - Controller() : - _handler(nullptr) - {} + Controller() : + _handler(nullptr) + {} - void setHandler(InteractionHandler* handler); + void setHandler(InteractionHandler* handler); protected: - InteractionHandler* _handler; + InteractionHandler* _handler; }; } // namespace interaction diff --git a/include/openspace/interaction/deviceidentifier.h b/include/openspace/interaction/deviceidentifier.h index c2174ab204..0497699149 100644 --- a/include/openspace/interaction/deviceidentifier.h +++ b/include/openspace/interaction/deviceidentifier.h @@ -14,39 +14,39 @@ enum class InputDevice {NONE, UNKNOWN, SPACENAVIGATOR, XBOX}; class DeviceIdentifier { public: - static DeviceIdentifier& ref(); - virtual ~DeviceIdentifier(); + static DeviceIdentifier& ref(); + virtual ~DeviceIdentifier(); - static void init(); - static void deinit(); - static bool isInitialized(); - - void scanDevices(); - const int numberOfDevices() const; - const InputDevice type(const int device) const; - - void update(); - void update(const int device); + static void init(); + static void deinit(); + static bool isInitialized(); + + void scanDevices(); + const int numberOfDevices() const; + const InputDevice type(const int device) const; + + void update(); + void update(const int device); - const int getButtons(const int device, unsigned char **buttons = nullptr) const; - const int getAxes(const int device, float **axespos = nullptr) const; - void get(const int device, unsigned char **buttons, float **axespos) const; - + const int getButtons(const int device, unsigned char **buttons = nullptr) const; + const int getAxes(const int device, float **axespos = nullptr) const; + void get(const int device, unsigned char **buttons, float **axespos) const; + private: - // singleton - static DeviceIdentifier* this_; + // singleton + static DeviceIdentifier* this_; DeviceIdentifier(void); DeviceIdentifier(const DeviceIdentifier& src); DeviceIdentifier& operator=(const DeviceIdentifier& rhs); - // member variables - int devices_; - std::array inputDevice_; - std::array numberOfAxes_; - std::array numberOfButtons_; - std::array axesPos_; - std::array buttons_; + // member variables + int devices_; + std::array inputDevice_; + std::array numberOfAxes_; + std::array numberOfButtons_; + std::array axesPos_; + std::array buttons_; }; diff --git a/include/openspace/interaction/externalcontrol/externalconnectioncontroller.h b/include/openspace/interaction/externalcontrol/externalconnectioncontroller.h index 4d45937c59..09e952e10e 100644 --- a/include/openspace/interaction/externalcontrol/externalconnectioncontroller.h +++ b/include/openspace/interaction/externalcontrol/externalconnectioncontroller.h @@ -9,14 +9,14 @@ namespace openspace { class ExternalConnectionController: public ExternalControl { public: - // constructors & destructor - ExternalConnectionController(); - ~ExternalConnectionController(); - + // constructors & destructor + ExternalConnectionController(); + ~ExternalConnectionController(); + private: - std::vector controllers; - + std::vector controllers; + }; } // namespace openspace diff --git a/include/openspace/interaction/externalcontrol/externalcontrol.h b/include/openspace/interaction/externalcontrol/externalcontrol.h index 4e36ed9ce5..986749135b 100644 --- a/include/openspace/interaction/externalcontrol/externalcontrol.h +++ b/include/openspace/interaction/externalcontrol/externalcontrol.h @@ -10,17 +10,17 @@ namespace openspace { class ExternalControl { public: - // constructors & destructor - ExternalControl(); - virtual ~ExternalControl(); - - virtual void update(); - - void rotate(const glm::quat &rotation); - void orbit(const glm::quat &rotation); - void distance(const PowerScaledScalar &distance); + // constructors & destructor + ExternalControl(); + virtual ~ExternalControl(); + + virtual void update(); + + void rotate(const glm::quat &rotation); + void orbit(const glm::quat &rotation); + void distance(const PowerScaledScalar &distance); - + protected: }; diff --git a/include/openspace/interaction/externalcontrol/joystickexternalcontrol.h b/include/openspace/interaction/externalcontrol/joystickexternalcontrol.h index 9416c6b202..4182d3c102 100644 --- a/include/openspace/interaction/externalcontrol/joystickexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/joystickexternalcontrol.h @@ -8,19 +8,19 @@ //class JoystickExternalControl: public PythonExternalControl { //public: // -// // constructors & destructor -// JoystickExternalControl(const char *filename); -// ~JoystickExternalControl(); -// -// void setInputDevice(const int device); -// void update(); +// // constructors & destructor +// JoystickExternalControl(const char *filename); +// ~JoystickExternalControl(); +// +// void setInputDevice(const int device); +// void update(); // //private: // -// // joystick -// int inputDevice_; -// int numberOfButtons_; -// int numberOfAxes_; +// // joystick +// int inputDevice_; +// int numberOfButtons_; +// int numberOfAxes_; //}; // //} // namespace openspace diff --git a/include/openspace/interaction/externalcontrol/keyboardexternalcontrol.h b/include/openspace/interaction/externalcontrol/keyboardexternalcontrol.h index 6e331e69b8..9a01732944 100644 --- a/include/openspace/interaction/externalcontrol/keyboardexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/keyboardexternalcontrol.h @@ -8,15 +8,15 @@ //class KeyboardExternalControl: public PythonExternalControl { //public: // -// // constructors & destructor -// KeyboardExternalControl(const char *filename); -// ~KeyboardExternalControl(); +// // constructors & destructor +// KeyboardExternalControl(const char *filename); +// ~KeyboardExternalControl(); // -// void update(); -// -// void keyboardCallback(int key, int action); +// void update(); +// +// void keyboardCallback(int key, int action); //private: -// int *keys_; +// int *keys_; // //}; // diff --git a/include/openspace/interaction/externalcontrol/mouseexternalcontrol.h b/include/openspace/interaction/externalcontrol/mouseexternalcontrol.h index 890a741733..cbd5cec7d3 100644 --- a/include/openspace/interaction/externalcontrol/mouseexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/mouseexternalcontrol.h @@ -8,18 +8,18 @@ //class MouseExternalControl: public PythonExternalControl { //public: // -// // constructors & destructor -// MouseExternalControl(const char *filename); -// ~MouseExternalControl(); +// // constructors & destructor +// MouseExternalControl(const char *filename); +// ~MouseExternalControl(); // -// void update(); -// -// void mouseButtonCallback(int key, int action); -// void mousePosCallback(int x, int y); -// void mouseScrollCallback(int pos); +// void update(); +// +// void mouseButtonCallback(int key, int action); +// void mousePosCallback(int x, int y); +// void mouseScrollCallback(int pos); //private: // -// int x_, y_, pos_, button1_, button2_, button3_; +// int x_, y_, pos_, button1_, button2_, button3_; // //}; // diff --git a/include/openspace/interaction/externalcontrol/pythonexternalcontrol.h b/include/openspace/interaction/externalcontrol/pythonexternalcontrol.h index 8a01d6f571..432f1c6d9a 100644 --- a/include/openspace/interaction/externalcontrol/pythonexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/pythonexternalcontrol.h @@ -12,22 +12,22 @@ //class PythonExternalControl: public ExternalControl { //public: // -// // constructors & destructor -// PythonExternalControl(const char *filename); -// ~PythonExternalControl(); +// // constructors & destructor +// PythonExternalControl(const char *filename); +// ~PythonExternalControl(); // -// static PyMethodDef* getMethodDef(); -// -// void message(const char *text); -// virtual void update(); -// void clear(); +// static PyMethodDef* getMethodDef(); +// +// void message(const char *text); +// virtual void update(); +// void clear(); //private: -// PythonScript ps_; +// PythonScript ps_; // //protected: -// void run(); -// int pyarrSize_; -// PyObject **pyarr_; +// void run(); +// int pyarrSize_; +// PyObject **pyarr_; //}; // //} // namespace openspace diff --git a/include/openspace/interaction/externalcontrol/randomexternalcontrol.h b/include/openspace/interaction/externalcontrol/randomexternalcontrol.h index 2cc189f4c5..171ab2c79a 100644 --- a/include/openspace/interaction/externalcontrol/randomexternalcontrol.h +++ b/include/openspace/interaction/externalcontrol/randomexternalcontrol.h @@ -11,14 +11,14 @@ namespace openspace { class RandomExternalControl: public ExternalControl { public: - // constructors & destructor - RandomExternalControl(); - ~RandomExternalControl(); - + // constructors & destructor + RandomExternalControl(); + ~RandomExternalControl(); + private: - std::mutex inputGuard; - bool *keepGoing_; - // std::thread *backgroundThread; + std::mutex inputGuard; + bool *keepGoing_; + // std::thread *backgroundThread; }; } // namespace openspace diff --git a/include/openspace/interaction/keyboardcontroller.h b/include/openspace/interaction/keyboardcontroller.h index d739d9b802..94550e2869 100644 --- a/include/openspace/interaction/keyboardcontroller.h +++ b/include/openspace/interaction/keyboardcontroller.h @@ -35,20 +35,20 @@ namespace interaction { class KeyboardController : public Controller { public: virtual ~KeyboardController() {}; - virtual void keyPressed(KeyAction action, Key key, KeyModifier modifier) = 0; + virtual void keyPressed(KeyAction action, Key key, KeyModifier modifier) = 0; }; class KeyboardControllerFixed : public KeyboardController { public: - void keyPressed(KeyAction action, Key key, KeyModifier modifier); + void keyPressed(KeyAction action, Key key, KeyModifier modifier); }; class KeyboardControllerLua : public KeyboardController { public: - void keyPressed(KeyAction action, Key key, KeyModifier modifier); + void keyPressed(KeyAction action, Key key, KeyModifier modifier); protected: - std::string keyToString(Key key, KeyModifier mod) const; + std::string keyToString(Key key, KeyModifier mod) const; }; } // namespace interaction diff --git a/include/openspace/interaction/luaconsole.h b/include/openspace/interaction/luaconsole.h index 547fe09c1e..d3e6aed595 100644 --- a/include/openspace/interaction/luaconsole.h +++ b/include/openspace/interaction/luaconsole.h @@ -36,35 +36,35 @@ namespace openspace { class LuaConsole { public: - LuaConsole(); + LuaConsole(); void initialize(); void deinitialize(); - void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); + void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); void charCallback(unsigned int codepoint, KeyModifier modifier); - void render(); + void render(); Key commandInputButton(); - bool isVisible() const; - void setVisible(bool visible); - void toggleVisibility(); - - static scripting::ScriptEngine::LuaLibrary luaLibrary(); + bool isVisible() const; + void setVisible(bool visible); + void toggleVisibility(); + + static scripting::ScriptEngine::LuaLibrary luaLibrary(); private: void addToCommand(std::string c); - std::string UnicodeToUTF8(unsigned int codepoint); + std::string UnicodeToUTF8(unsigned int codepoint); - size_t _inputPosition; - std::vector _commandsHistory; - size_t _activeCommand; - std::vector _commands; + size_t _inputPosition; + std::vector _commandsHistory; + size_t _activeCommand; + std::vector _commands; - std::string _filename; + std::string _filename; struct { int lastIndex; @@ -72,7 +72,7 @@ private: std::string initialValue; } _autoCompleteInfo; - bool _isVisible; + bool _isVisible; }; } // namespace openspace diff --git a/include/openspace/interaction/mousecontroller.h b/include/openspace/interaction/mousecontroller.h index bc247ec384..6df5c53165 100644 --- a/include/openspace/interaction/mousecontroller.h +++ b/include/openspace/interaction/mousecontroller.h @@ -36,66 +36,66 @@ namespace interaction { class MouseController : public Controller { public: - MouseController(); + MouseController(); virtual ~MouseController() {} - virtual void button(MouseButton button, MouseAction action) = 0; - virtual void move(float x, float y) = 0; - virtual void scrollWheel(int pos) = 0; - virtual void update(const double& dt) = 0; + virtual void button(MouseButton button, MouseAction action) = 0; + virtual void move(float x, float y) = 0; + virtual void scrollWheel(int pos) = 0; + virtual void update(const double& dt) = 0; protected: - glm::vec3 _lastTrackballPos; - bool _isMouseBeingPressedAndHeld; + glm::vec3 _lastTrackballPos; + bool _isMouseBeingPressedAndHeld; - glm::vec3 mapToTrackball(glm::vec2 mousePos); + glm::vec3 mapToTrackball(glm::vec2 mousePos); - glm::vec3 mapToCamera(glm::vec3 trackballPos); + glm::vec3 mapToCamera(glm::vec3 trackballPos); - void trackballRotate(int x, int y); + void trackballRotate(int x, int y); }; class TrackballMouseController : public MouseController { public: - TrackballMouseController(); + TrackballMouseController(); - void button(MouseButton button, MouseAction action) override; + void button(MouseButton button, MouseAction action) override; - void move(float x, float y) override; + void move(float x, float y) override; - void scrollWheel(int pos) override; + void scrollWheel(int pos) override; - void update(const double& dt) override; + void update(const double& dt) override; protected: - bool _leftMouseButtonDown; - glm::vec3 _previousTrackballPos; + bool _leftMouseButtonDown; + glm::vec3 _previousTrackballPos; }; class OrbitalMouseController : public MouseController { public: - OrbitalMouseController(); + OrbitalMouseController(); - void button(MouseButton button, MouseAction action) override; + void button(MouseButton button, MouseAction action) override; - void move(float x, float y) override; + void move(float x, float y) override; - void scrollWheel(int pos) override; + void scrollWheel(int pos) override; - void update(const double& dt) override; + void update(const double& dt) override; protected: - bool _leftMouseButtonDown; - bool _rightMouseButtonDown; - bool _middleMouseButtonDown; - glm::vec2 _previousCursorPos[3]; - glm::vec2 _currentCursorPos; - glm::vec2 _currentCursorDiff[3]; - float _rotationSpeed; - float _navigationSpeed; + bool _leftMouseButtonDown; + bool _rightMouseButtonDown; + bool _middleMouseButtonDown; + glm::vec2 _previousCursorPos[3]; + glm::vec2 _currentCursorPos; + glm::vec2 _currentCursorDiff[3]; + float _rotationSpeed; + float _navigationSpeed; private: - enum MouseButtons{ ButtonLeft = 0, ButtonRight, ButtonMiddle }; + enum MouseButtons{ ButtonLeft = 0, ButtonRight, ButtonMiddle }; }; } // namespace interaction diff --git a/include/openspace/network/parallelconnection.h b/include/openspace/network/parallelconnection.h index b4187c1c5b..caa9b3bdfb 100644 --- a/include/openspace/network/parallelconnection.h +++ b/include/openspace/network/parallelconnection.h @@ -82,7 +82,7 @@ namespace openspace{ void requestHostship(const std::string &password); - void setPassword(const std::string &password); + void setPassword(const std::string &password); void signalDisconnect(); @@ -113,23 +113,23 @@ namespace openspace{ protected: private: - //@TODO change this into the ghoul hasher for client AND server - uint32_t hash(const std::string &val){ - uint32_t hashVal = 0, i; - size_t len = val.length(); + //@TODO change this into the ghoul hasher for client AND server + uint32_t hash(const std::string &val){ + uint32_t hashVal = 0, i; + size_t len = val.length(); - for (hashVal = i = 0; i < len; ++i){ - hashVal += val.c_str()[i]; - hashVal += (hashVal << 10); - hashVal ^= (hashVal >> 6); - } + for (hashVal = i = 0; i < len; ++i){ + hashVal += val.c_str()[i]; + hashVal += (hashVal << 10); + hashVal ^= (hashVal >> 6); + } - hashVal += (hashVal << 3); - hashVal ^= (hashVal >> 11); - hashVal += (hashVal << 15); + hashVal += (hashVal << 3); + hashVal ^= (hashVal >> 11); + hashVal += (hashVal << 15); - return hashVal; - }; + return hashVal; + }; void queueMessage(std::vector message); @@ -137,27 +137,27 @@ namespace openspace{ void writeHeader(std::vector &buffer, uint32_t messageType); - void closeSocket(); + void closeSocket(); - bool initNetworkAPI(); + bool initNetworkAPI(); - void establishConnection(addrinfo *info); + void establishConnection(addrinfo *info); - void sendAuthentication(); + void sendAuthentication(); - void listenCommunication(); + void listenCommunication(); - void delegateDecoding(uint32_t type); + void delegateDecoding(uint32_t type); - void initializationMessageReceived(); + void initializationMessageReceived(); - void dataMessageReceived(); + void dataMessageReceived(); - void hostInfoMessageReceived(); - - void initializationRequestMessageReceived(); + void hostInfoMessageReceived(); + + void initializationRequestMessageReceived(); - void broadcast(); + void broadcast(); int headerSize(); @@ -171,15 +171,15 @@ namespace openspace{ std::string scriptFromPropertyAndValue(const std::string property, const std::string value); - uint32_t _passCode; + uint32_t _passCode; std::string _port; std::string _address; std::string _name; _SOCKET _clientSocket; std::thread *_connectionThread; - std::thread *_broadcastThread; + std::thread *_broadcastThread; std::thread *_sendThread; - std::thread *_listenThread; + std::thread *_listenThread; std::thread *_handlerThread; std::atomic _isHost; std::atomic _isConnected; diff --git a/include/openspace/properties/numericalproperty.h b/include/openspace/properties/numericalproperty.h index 09cf92b517..33a179b7fd 100644 --- a/include/openspace/properties/numericalproperty.h +++ b/include/openspace/properties/numericalproperty.h @@ -35,35 +35,35 @@ class NumericalProperty : public TemplateProperty { public: NumericalProperty(std::string identifier, std::string guiName); NumericalProperty(std::string identifier, std::string guiName, T value); - NumericalProperty(std::string identifier, std::string guiName, T value, - T minimumValue, T maximumValue); + NumericalProperty(std::string identifier, std::string guiName, T value, + T minimumValue, T maximumValue); NumericalProperty(std::string identifier, std::string guiName, T value, T minimumValue, T maximumValue, T steppingValue); - bool getLuaValue(lua_State* state) const override; - bool setLuaValue(lua_State* state) override; - int typeLua() const override; + bool getLuaValue(lua_State* state) const override; + bool setLuaValue(lua_State* state) override; + int typeLua() const override; bool getStringValue(std::string& value) const override; bool setStringValue(std::string value) override; - T minValue() const; - T maxValue() const; + T minValue() const; + T maxValue() const; virtual std::string className() const override; using TemplateProperty::operator=; protected: - static const std::string MinimumValueKey; - static const std::string MaximumValueKey; - static const std::string SteppingValueKey; + static const std::string MinimumValueKey; + static const std::string MaximumValueKey; + static const std::string SteppingValueKey; - std::string generateAdditionalDescription() const; + std::string generateAdditionalDescription() const; T _minimumValue; T _maximumValue; - T _stepping; + T _stepping; }; } // namespace properties diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index ef3f686d53..5366f2d6fd 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -48,9 +48,9 @@ namespace properties { template <> \ TYPE PropertyDelegate>::defaultMaximumValue(); \ \ - template <> \ - template <> \ - TYPE PropertyDelegate>::defaultSteppingValue(); \ + template <> \ + template <> \ + TYPE PropertyDelegate>::defaultSteppingValue(); \ \ template <> \ template <> \ @@ -104,41 +104,41 @@ namespace properties { std::string PropertyDelegate>::className() \ { \ return #CLASS_NAME; \ - } \ + } \ \ template <> \ std::string PropertyDelegate>::className() \ { \ return PropertyDelegate>::className(); \ - } \ + } \ \ template <> \ template <> \ TYPE PropertyDelegate>::defaultValue() \ { \ return DEFAULT_VALUE; \ - } \ + } \ \ template <> \ template <> \ TYPE PropertyDelegate>::defaultMinimumValue() \ { \ return DEFAULT_MIN_VALUE; \ - } \ + } \ \ template <> \ template <> \ TYPE PropertyDelegate>::defaultMaximumValue() \ { \ return DEFAULT_MAX_VALUE; \ - } \ + } \ \ - template <> \ - template <> \ - TYPE PropertyDelegate>::defaultSteppingValue() \ - { \ - return DEFAULT_STEPPING; \ - } \ + template <> \ + template <> \ + TYPE PropertyDelegate>::defaultSteppingValue() \ + { \ + return DEFAULT_STEPPING; \ + } \ \ template <> \ template <> \ @@ -146,7 +146,7 @@ namespace properties { bool& success) \ { \ return FROM_LUA_LAMBDA_EXPRESSION(state, success); \ - } \ + } \ \ template <> \ template <> \ @@ -155,7 +155,7 @@ namespace properties { { \ return PropertyDelegate>::fromLuaValue(state, \ success); \ - } \ + } \ \ template <> \ template <> \ @@ -235,33 +235,33 @@ const std::string NumericalProperty::SteppingValueKey = "SteppingValue"; template NumericalProperty::NumericalProperty(std::string identifier, std::string guiName) : NumericalProperty( - std::move(identifier), std::move(guiName), - PropertyDelegate>::template defaultValue(), - PropertyDelegate>::template defaultMinimumValue(), - PropertyDelegate>::template defaultMaximumValue(), - PropertyDelegate>::template defaultSteppingValue() - ) + std::move(identifier), std::move(guiName), + PropertyDelegate>::template defaultValue(), + PropertyDelegate>::template defaultMinimumValue(), + PropertyDelegate>::template defaultMaximumValue(), + PropertyDelegate>::template defaultSteppingValue() + ) {} template NumericalProperty::NumericalProperty(std::string identifier, std::string guiName, T value) : NumericalProperty( - std::move(identifier), std::move(guiName), std::move(value), - PropertyDelegate>::template defaultMinimumValue(), - PropertyDelegate>::template defaultMaximumValue(), - PropertyDelegate>::template defaultSteppingValue() - ) + std::move(identifier), std::move(guiName), std::move(value), + PropertyDelegate>::template defaultMinimumValue(), + PropertyDelegate>::template defaultMaximumValue(), + PropertyDelegate>::template defaultSteppingValue() + ) {} template NumericalProperty::NumericalProperty(std::string identifier, std::string guiName, - T value, T minimumValue, T maximumValue) - : NumericalProperty( - std::move(identifier) , std::move(guiName), std::move(value), - std::move(minimumValue), std::move(maximumValue), - PropertyDelegate>::template defaultSteppingValue() - ) + T value, T minimumValue, T maximumValue) + : NumericalProperty( + std::move(identifier) , std::move(guiName), std::move(value), + std::move(minimumValue), std::move(maximumValue), + PropertyDelegate>::template defaultSteppingValue() + ) {} template @@ -271,7 +271,7 @@ NumericalProperty::NumericalProperty(std::string identifier, : TemplateProperty(std::move(identifier), std::move(guiName), std::move(value)) , _minimumValue(std::move(minimumValue)) , _maximumValue(std::move(maximumValue)) - , _stepping(std::move(steppingValue)) + , _stepping(std::move(steppingValue)) {} template @@ -282,23 +282,23 @@ std::string NumericalProperty::className() const { template bool NumericalProperty::setLuaValue(lua_State* state) { - bool success = false; - T value = PropertyDelegate>::template fromLuaValue(state, success); - if (success) - TemplateProperty::setValue(value); - return success; + bool success = false; + T value = PropertyDelegate>::template fromLuaValue(state, success); + if (success) + TemplateProperty::setValue(value); + return success; } template bool NumericalProperty::getLuaValue(lua_State* state) const { - bool success = PropertyDelegate>::template toLuaValue(state, TemplateProperty::_value); - return success; + bool success = PropertyDelegate>::template toLuaValue(state, TemplateProperty::_value); + return success; } template int NumericalProperty::typeLua() const { - return PropertyDelegate>::typeLua(); + return PropertyDelegate>::typeLua(); } template @@ -318,21 +318,21 @@ bool NumericalProperty::setStringValue(std::string value) { template T NumericalProperty::minValue() const { - return _minimumValue; + return _minimumValue; } template T NumericalProperty::maxValue() const { - return _maximumValue; + return _maximumValue; } template std::string NumericalProperty::generateAdditionalDescription() const { - std::string result; - result += MinimumValueKey + " = " + std::to_string(_minimumValue) + ","; - result += MaximumValueKey + " = " + std::to_string(_maximumValue) + ","; - result += SteppingValueKey + " = " + std::to_string(_stepping); - return result; + std::string result; + result += MinimumValueKey + " = " + std::to_string(_minimumValue) + ","; + result += MaximumValueKey + " = " + std::to_string(_maximumValue) + ","; + result += SteppingValueKey + " = " + std::to_string(_stepping); + return result; } } // namespace properties diff --git a/include/openspace/properties/optionproperty.h b/include/openspace/properties/optionproperty.h index ef9a3f9f2e..cd248fe336 100644 --- a/include/openspace/properties/optionproperty.h +++ b/include/openspace/properties/optionproperty.h @@ -41,58 +41,58 @@ namespace properties { */ class OptionProperty : public IntProperty { public: - /** - * The struct storing a single option consisting of an integer value and - * a string description. - */ - struct Option { - int value; - std::string description; - }; + /** + * The struct storing a single option consisting of an integer value and + * a string description. + */ + struct Option { + int value; + std::string description; + }; - /** - * The constructor delegating the identifier and the guiName - * to its super class. - * \param identifier A unique identifier for this property - * \param guiName The GUI name that should be used to represent this property - */ - OptionProperty(std::string identifier, std::string guiName); + /** + * The constructor delegating the identifier and the guiName + * to its super class. + * \param identifier A unique identifier for this property + * \param guiName The GUI name that should be used to represent this property + */ + OptionProperty(std::string identifier, std::string guiName); - /** - * Returns the name of the class for reflection purposes. - * \return The name of this class for reflection purposes - */ - std::string className() const override; - using IntProperty::operator=; + /** + * Returns the name of the class for reflection purposes. + * \return The name of this class for reflection purposes + */ + std::string className() const override; + using IntProperty::operator=; - /** - * Adds the passed option to the list of available options. The value of - * the option must not have been registered previously, or a warning will - * be logged. - * \param value The option that will be added to the list of available options + /** + * Adds the passed option to the list of available options. The value of + * the option must not have been registered previously, or a warning will + * be logged. + * \param value The option that will be added to the list of available options * \param desc The description of the value that will be added - */ - void addOption(int value, std::string desc); + */ + void addOption(int value, std::string desc); - /** - * Returns the list of available options. - * /return The list of available options - */ - const std::vector