From 9bc95a0fc120f142b821afe33777dae978a5fba3 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 5 Oct 2015 15:17:10 -0700 Subject: [PATCH 1/7] fix override warnings in assignment-client --- assignment-client/src/entities/EntityServer.h | 26 +++++++++---------- libraries/octree/src/OctreeHeadlessViewer.h | 6 ++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/assignment-client/src/entities/EntityServer.h b/assignment-client/src/entities/EntityServer.h index 114e0e1726..065834cbc2 100644 --- a/assignment-client/src/entities/EntityServer.h +++ b/assignment-client/src/entities/EntityServer.h @@ -26,28 +26,28 @@ public: ~EntityServer(); // Subclasses must implement these methods - virtual OctreeQueryNode* createOctreeQueryNode(); - virtual char getMyNodeType() const { return NodeType::EntityServer; } - virtual PacketType getMyQueryMessageType() const { return PacketType::EntityQuery; } - virtual const char* getMyServerName() const { return MODEL_SERVER_NAME; } - virtual const char* getMyLoggingServerTargetName() const { return MODEL_SERVER_LOGGING_TARGET_NAME; } - virtual const char* getMyDefaultPersistFilename() const { return LOCAL_MODELS_PERSIST_FILE; } - virtual PacketType getMyEditNackType() const { return PacketType::EntityEditNack; } - virtual QString getMyDomainSettingsKey() const { return QString("entity_server_settings"); } + virtual OctreeQueryNode* createOctreeQueryNode() override ; + virtual char getMyNodeType() const override { return NodeType::EntityServer; } + virtual PacketType getMyQueryMessageType() const override { return PacketType::EntityQuery; } + virtual const char* getMyServerName() const override { return MODEL_SERVER_NAME; } + virtual const char* getMyLoggingServerTargetName() const override { return MODEL_SERVER_LOGGING_TARGET_NAME; } + virtual const char* getMyDefaultPersistFilename() const override { return LOCAL_MODELS_PERSIST_FILE; } + virtual PacketType getMyEditNackType() const override { return PacketType::EntityEditNack; } + virtual QString getMyDomainSettingsKey() const override { return QString("entity_server_settings"); } // subclass may implement these method - virtual void beforeRun(); - virtual bool hasSpecialPacketsToSend(const SharedNodePointer& node); - virtual int sendSpecialPackets(const SharedNodePointer& node, OctreeQueryNode* queryNode, int& packetsSent); + virtual void beforeRun() override; + virtual bool hasSpecialPacketsToSend(const SharedNodePointer& node) override; + virtual int sendSpecialPackets(const SharedNodePointer& node, OctreeQueryNode* queryNode, int& packetsSent) override; - virtual void entityCreated(const EntityItem& newEntity, const SharedNodePointer& senderNode); + virtual void entityCreated(const EntityItem& newEntity, const SharedNodePointer& senderNode) override; virtual bool readAdditionalConfiguration(const QJsonObject& settingsSectionObject) override; public slots: void pruneDeletedEntities(); protected: - virtual OctreePointer createTree(); + virtual OctreePointer createTree() override; private slots: void handleEntityPacket(QSharedPointer packet, SharedNodePointer senderNode); diff --git a/libraries/octree/src/OctreeHeadlessViewer.h b/libraries/octree/src/OctreeHeadlessViewer.h index 5a17f48a19..605db15cd2 100644 --- a/libraries/octree/src/OctreeHeadlessViewer.h +++ b/libraries/octree/src/OctreeHeadlessViewer.h @@ -30,9 +30,9 @@ class OctreeHeadlessViewer : public OctreeRenderer { public: OctreeHeadlessViewer(); virtual ~OctreeHeadlessViewer() {}; - virtual void renderElement(OctreeElementPointer element, RenderArgs* args) { /* swallow these */ } + virtual void renderElement(OctreeElementPointer element, RenderArgs* args) override { /* swallow these */ } - virtual void init(); + virtual void init() override ; virtual void render(RenderArgs* renderArgs) override { /* swallow these */ } void setJurisdictionListener(JurisdictionListener* jurisdictionListener) { _jurisdictionListener = jurisdictionListener; } @@ -58,7 +58,7 @@ public slots: // getters for LOD and PPS float getVoxelSizeScale() const { return _voxelSizeScale; } - int getBoundaryLevelAdjust() const { return _boundaryLevelAdjust; } + int getBoundaryLevelAdjust() const override { return _boundaryLevelAdjust; } int getMaxPacketsPerSecond() const { return _maxPacketsPerSecond; } unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); } From e835b5ccf397729f0c120700c7d50121a76c723e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 5 Oct 2015 15:30:26 -0700 Subject: [PATCH 2/7] remove old gnutls code from domain-server --- domain-server/src/DomainServer.cpp | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 614b0a1528..48bb9bed62 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -133,33 +133,14 @@ bool DomainServer::optionallyReadX509KeyAndCertificate() { QString keyPath = _settingsManager.getSettingsMap().value(X509_PRIVATE_KEY_OPTION).toString(); if (!certPath.isEmpty() && !keyPath.isEmpty()) { - // the user wants to use DTLS to encrypt communication with nodes + // the user wants to use the following cert and key for HTTPS + // this is used for Oauth callbacks when authorizing users against a data server // let's make sure we can load the key and certificate -// _x509Credentials = new gnutls_certificate_credentials_t; -// gnutls_certificate_allocate_credentials(_x509Credentials); QString keyPassphraseString = QProcessEnvironment::systemEnvironment().value(X509_KEY_PASSPHRASE_ENV); - qDebug() << "Reading certificate file at" << certPath << "for DTLS."; - qDebug() << "Reading key file at" << keyPath << "for DTLS."; - -// int gnutlsReturn = gnutls_certificate_set_x509_key_file2(*_x509Credentials, -// certPath.toLocal8Bit().constData(), -// keyPath.toLocal8Bit().constData(), -// GNUTLS_X509_FMT_PEM, -// keyPassphraseString.toLocal8Bit().constData(), -// 0); -// -// if (gnutlsReturn < 0) { -// qDebug() << "Unable to load certificate or key file." << "Error" << gnutlsReturn << "- domain-server will now quit."; -// QMetaObject::invokeMethod(this, "quit", Qt::QueuedConnection); -// return false; -// } - -// qDebug() << "Successfully read certificate and private key."; - - // we need to also pass this certificate and private key to the HTTPS manager - // this is used for Oauth callbacks when authorizing users against a data server + qDebug() << "Reading certificate file at" << certPath << "for HTTPS."; + qDebug() << "Reading key file at" << keyPath << "for HTTPS."; QFile certFile(certPath); certFile.open(QIODevice::ReadOnly); From 3ddfcc10c2dcf591038f8d8af9d7dadaeac89deb Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 5 Oct 2015 15:50:35 -0700 Subject: [PATCH 3/7] override additions to input-plugins --- libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.h | 2 +- libraries/input-plugins/src/input-plugins/SDL2Manager.h | 2 +- libraries/input-plugins/src/input-plugins/SixenseManager.h | 2 +- .../input-plugins/src/input-plugins/ViveControllerManager.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.h b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.h index 70e2ee5d34..6f703bc6f9 100644 --- a/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.h +++ b/libraries/input-plugins/src/input-plugins/KeyboardMouseDevice.h @@ -59,7 +59,7 @@ public: // Plugin functions virtual bool isSupported() const override { return true; } virtual bool isJointController() const override { return false; } - const QString& getName() const { return NAME; } + const QString& getName() const override { return NAME; } virtual void activate() override {}; virtual void deactivate() override {}; diff --git a/libraries/input-plugins/src/input-plugins/SDL2Manager.h b/libraries/input-plugins/src/input-plugins/SDL2Manager.h index f017e2cc65..52d39597ef 100644 --- a/libraries/input-plugins/src/input-plugins/SDL2Manager.h +++ b/libraries/input-plugins/src/input-plugins/SDL2Manager.h @@ -30,7 +30,7 @@ public: // Plugin functions virtual bool isSupported() const override; virtual bool isJointController() const override { return false; } - const QString& getName() const { return NAME; } + const QString& getName() const override { return NAME; } virtual void init() override; virtual void deinit() override; diff --git a/libraries/input-plugins/src/input-plugins/SixenseManager.h b/libraries/input-plugins/src/input-plugins/SixenseManager.h index 22340cfc95..5e3815cd20 100644 --- a/libraries/input-plugins/src/input-plugins/SixenseManager.h +++ b/libraries/input-plugins/src/input-plugins/SixenseManager.h @@ -63,7 +63,7 @@ public: // Plugin functions virtual bool isSupported() const override; virtual bool isJointController() const override { return true; } - const QString& getName() const { return NAME; } + const QString& getName() const override { return NAME; } virtual void activate() override; virtual void deactivate() override; diff --git a/libraries/input-plugins/src/input-plugins/ViveControllerManager.h b/libraries/input-plugins/src/input-plugins/ViveControllerManager.h index 98f32b9f35..5cae8daaf4 100644 --- a/libraries/input-plugins/src/input-plugins/ViveControllerManager.h +++ b/libraries/input-plugins/src/input-plugins/ViveControllerManager.h @@ -53,7 +53,7 @@ public: // Plugin functions virtual bool isSupported() const override; virtual bool isJointController() const override { return true; } - const QString& getName() const { return NAME; } + const QString& getName() const override { return NAME; } virtual void activate() override; virtual void deactivate() override; From a2c9d7a4b2502837918512529896a7b28b2dad2c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 5 Oct 2015 15:52:47 -0700 Subject: [PATCH 4/7] add overrides for Avatar classes in Interface --- interface/src/avatar/MyAvatar.h | 32 ++++++++++++++-------------- interface/src/avatar/SkeletonModel.h | 6 +++--- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 96c9f37c39..5d87737dd7 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -139,19 +139,19 @@ public: void updateLookAtTargetAvatar(); void clearLookAtTargetAvatar(); - virtual void setJointRotations(QVector jointRotations); - virtual void setJointTranslations(QVector jointTranslations); - virtual void setJointData(int index, const glm::quat& rotation, const glm::vec3& translation); - virtual void setJointRotation(int index, const glm::quat& rotation); - virtual void setJointTranslation(int index, const glm::vec3& translation); - virtual void clearJointData(int index); - virtual void clearJointsData(); + virtual void setJointRotations(QVector jointRotations) override; + virtual void setJointTranslations(QVector jointTranslations) override; + virtual void setJointData(int index, const glm::quat& rotation, const glm::vec3& translation) override; + virtual void setJointRotation(int index, const glm::quat& rotation) override; + virtual void setJointTranslation(int index, const glm::vec3& translation) override; + virtual void clearJointData(int index) override; + virtual void clearJointsData() override; Q_INVOKABLE void useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelName = QString()); Q_INVOKABLE const QUrl& getFullAvatarURLFromPreferences() const { return _fullAvatarURLFromPreferences; } Q_INVOKABLE const QString& getFullAvatarModelName() const { return _fullAvatarModelName; } - virtual void setAttachmentData(const QVector& attachmentData); + virtual void setAttachmentData(const QVector& attachmentData) override; DynamicCharacterController* getCharacterController() { return &_characterController; } @@ -218,7 +218,7 @@ public slots: void saveRecording(QString filename); void loadLastRecording(); - virtual void rebuildSkeletonBody(); + virtual void rebuildSkeletonBody() override; bool getEnableRigAnimations() const { return _rig->getEnableRig(); } void setEnableRigAnimations(bool isEnabled); @@ -243,7 +243,7 @@ private: glm::vec3 getWorldBodyPosition() const; glm::quat getWorldBodyOrientation() const; - QByteArray toByteArray(bool cullSmallChanges, bool sendAll); + QByteArray toByteArray(bool cullSmallChanges, bool sendAll) override; void simulate(float deltaTime); void updateFromTrackers(float deltaTime); virtual void render(RenderArgs* renderArgs, const glm::vec3& cameraPositio) override; @@ -252,9 +252,9 @@ private: void setShouldRenderLocally(bool shouldRender) { _shouldRender = shouldRender; } bool getShouldRenderLocally() const { return _shouldRender; } bool getDriveKeys(int key) { return _driveKeys[key] != 0.0f; }; - bool isMyAvatar() const { return true; } - virtual int parseDataFromBuffer(const QByteArray& buffer); - virtual glm::vec3 getSkeletonPosition() const; + bool isMyAvatar() const override { return true; } + virtual int parseDataFromBuffer(const QByteArray& buffer) override; + virtual glm::vec3 getSkeletonPosition() const override; glm::vec3 getScriptedMotorVelocity() const { return _scriptedMotorVelocity; } float getScriptedMotorTimescale() const { return _scriptedMotorTimescale; } @@ -264,7 +264,7 @@ private: void setScriptedMotorFrame(QString frame); virtual void attach(const QString& modelURL, const QString& jointName = QString(), const glm::vec3& translation = glm::vec3(), const glm::quat& rotation = glm::quat(), float scale = 1.0f, - bool allowDuplicates = false, bool useSaved = true); + bool allowDuplicates = false, bool useSaved = true) override; void renderLaserPointers(gpu::Batch& batch); const RecorderPointer getRecorder() const { return _recorder; } @@ -273,8 +273,8 @@ private: bool cameraInsideHead() const; // These are made private for MyAvatar so that you will use the "use" methods instead - virtual void setFaceModelURL(const QUrl& faceModelURL); - virtual void setSkeletonModelURL(const QUrl& skeletonModelURL); + virtual void setFaceModelURL(const QUrl& faceModelURL) override; + virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override; void setVisibleInSceneIfReady(Model* model, render::ScenePointer scene, bool visiblity); diff --git a/interface/src/avatar/SkeletonModel.h b/interface/src/avatar/SkeletonModel.h index e2c3ab8f83..d655d6e01f 100644 --- a/interface/src/avatar/SkeletonModel.h +++ b/interface/src/avatar/SkeletonModel.h @@ -27,10 +27,10 @@ public: SkeletonModel(Avatar* owningAvatar, QObject* parent = nullptr, RigPointer rig = nullptr); ~SkeletonModel(); - virtual void initJointStates(QVector states); + virtual void initJointStates(QVector states) override; - virtual void simulate(float deltaTime, bool fullUpdate = true); - virtual void updateRig(float deltaTime, glm::mat4 parentTransform); + virtual void simulate(float deltaTime, bool fullUpdate = true) override; + virtual void updateRig(float deltaTime, glm::mat4 parentTransform) override; void updateAttitude(); void renderIKConstraints(gpu::Batch& batch); From 25a1f2dd11a855c544f6c2d8b79e21a9c9d2d9c2 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 5 Oct 2015 15:53:37 -0700 Subject: [PATCH 5/7] add override to suppress warning for PluginContainerProxy --- interface/src/PluginContainerProxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/PluginContainerProxy.h b/interface/src/PluginContainerProxy.h index e01cabc3b8..16e9b951fe 100644 --- a/interface/src/PluginContainerProxy.h +++ b/interface/src/PluginContainerProxy.h @@ -16,7 +16,7 @@ class PluginContainerProxy : public QObject, PluginContainer { virtual QAction* addMenuItem(const QString& path, const QString& name, std::function onClicked, bool checkable = false, bool checked = false, const QString& groupName = "") override; virtual void removeMenuItem(const QString& menuName, const QString& menuItem) override; virtual bool isOptionChecked(const QString& name) override; - virtual void setIsOptionChecked(const QString& path, bool checked); + virtual void setIsOptionChecked(const QString& path, bool checked) override; virtual void setFullscreen(const QScreen* targetScreen, bool hideMenu = true) override; virtual void unsetFullscreen(const QScreen* avoidScreen = nullptr) override; virtual void showDisplayPluginsTools() override; From 7bd98354d819219aa6557337a0ca6a2cd3891e9a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 5 Oct 2015 15:53:52 -0700 Subject: [PATCH 6/7] add override to supress warnings in ui-test --- tests/ui/src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ui/src/main.cpp b/tests/ui/src/main.cpp index 6611e8f343..3879d0b029 100644 --- a/tests/ui/src/main.cpp +++ b/tests/ui/src/main.cpp @@ -260,7 +260,7 @@ protected: } - void keyPressEvent(QKeyEvent* event) { + void keyPressEvent(QKeyEvent* event) override { _altPressed = Qt::Key_Alt == event->key(); switch (event->key()) { case Qt::Key_B: @@ -292,13 +292,13 @@ protected: QWindow::keyPressEvent(event); } QQmlContext* menuContext{ nullptr }; - void keyReleaseEvent(QKeyEvent *event) { + void keyReleaseEvent(QKeyEvent *event) override { if (_altPressed && Qt::Key_Alt == event->key()) { VrMenu::toggle(); } } - void moveEvent(QMoveEvent* event) { + void moveEvent(QMoveEvent* event) override { static qreal oldPixelRatio = 0.0; if (devicePixelRatio() != oldPixelRatio) { oldPixelRatio = devicePixelRatio(); From 5989cad054410eb64d0fc23d671245b6fc41597c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 5 Oct 2015 15:55:05 -0700 Subject: [PATCH 7/7] add override qualifier to suppress warnings in entities-renderer --- .../src/RenderableParticleEffectEntityItem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.h b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.h index 9581c43ca5..5d69d19026 100644 --- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.h +++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.h @@ -25,8 +25,8 @@ public: void updateRenderItem(); - virtual bool addToScene(EntityItemPointer self, render::ScenePointer scene, render::PendingChanges& pendingChanges); - virtual void removeFromScene(EntityItemPointer self, render::ScenePointer scene, render::PendingChanges& pendingChanges); + virtual bool addToScene(EntityItemPointer self, render::ScenePointer scene, render::PendingChanges& pendingChanges) override; + virtual void removeFromScene(EntityItemPointer self, render::ScenePointer scene, render::PendingChanges& pendingChanges) override; protected: render::ItemID _renderItemId;