From 87dbfa7e4748cd142efa70eeed4282196fb93189 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Thu, 18 Aug 2016 09:51:41 -0700 Subject: [PATCH] add -Wsuggest-override to compile flags and deal with fallout --- CMakeLists.txt | 2 +- assignment-client/src/Agent.h | 4 +- assignment-client/src/AssignmentAction.h | 30 +++---- .../src/AssignmentActionFactory.h | 4 +- assignment-client/src/assets/AssetServer.h | 8 +- assignment-client/src/assets/SendAssetTask.h | 2 +- .../src/assets/UploadAssetTask.h | 6 +- assignment-client/src/audio/AudioMixer.h | 4 +- .../src/audio/AudioMixerClientData.h | 8 +- .../src/audio/AvatarAudioStream.h | 2 +- assignment-client/src/avatars/AvatarMixer.h | 14 +-- .../src/entities/AssignmentParentFinder.h | 3 +- .../src/entities/EntityNodeData.h | 2 +- .../src/messages/MessagesMixer.h | 4 +- .../src/octree/OctreeInboundPacketProcessor.h | 10 +-- .../src/octree/OctreeSendThread.h | 2 +- assignment-client/src/octree/OctreeServer.h | 8 +- domain-server/src/DomainServer.h | 4 +- interface/src/FileLogger.h | 2 +- interface/src/InterfaceActionFactory.h | 4 +- interface/src/InterfaceParentFinder.h | 3 +- interface/src/ModelSelector.h | 14 +-- interface/src/ScriptHighlighting.h | 2 +- interface/src/avatar/Head.h | 12 +-- interface/src/devices/DdeFaceTracker.h | 34 ++++---- interface/src/devices/Faceshift.h | 36 ++++---- interface/src/devices/Leapmotion.h | 2 +- .../scripting/ControllerScriptingInterface.h | 14 +-- interface/src/scripting/WebWindowClass.h | 2 +- interface/src/ui/AudioStatsDialog.h | 47 +++++----- interface/src/ui/BandwidthDialog.h | 6 +- interface/src/ui/CachesSizeDialog.h | 14 +-- interface/src/ui/DataWebPage.h | 6 +- interface/src/ui/HMDToolsDialog.h | 16 ++-- interface/src/ui/JSConsole.h | 6 +- interface/src/ui/LodToolsDialog.h | 6 +- interface/src/ui/LogDialog.h | 6 +- interface/src/ui/OctreeStatsDialog.h | 6 +- interface/src/ui/ScriptEditBox.h | 2 +- interface/src/ui/ScriptEditorWindow.h | 4 +- interface/src/ui/ScriptLineNumberArea.h | 4 +- interface/src/ui/ScriptsTableWidget.h | 4 +- .../src/ui/overlays/LocalModelsOverlay.h | 10 +-- interface/src/ui/overlays/OverlayPanel.h | 2 +- interface/src/ui/overlays/RectangleOverlay.h | 5 +- libraries/animation/src/AnimationCache.h | 6 +- libraries/audio-client/src/AudioClient.h | 16 ++-- .../audio/src/AudioInjectorLocalBuffer.h | 22 ++--- libraries/audio/src/AudioLimiter.cpp | 2 +- .../audio/src/MixedProcessedAudioStream.h | 8 +- libraries/audio/src/PositionalAudioStream.h | 6 +- libraries/audio/src/SoundCache.h | 6 +- .../controllers/impl/endpoints/JSEndpoint.h | 4 +- .../display-plugins/hmd/HmdDisplayPlugin.cpp | 2 +- .../embedded-webserver/src/HTTPManager.h | 4 +- .../src/EntityTreeRenderer.h | 32 +++---- libraries/entities/src/AddEntityOperator.h | 6 +- .../entities/src/AnimationPropertyGroup.h | 29 ++++--- libraries/entities/src/DeleteEntityOperator.h | 4 +- .../entities/src/EntityEditPacketSender.h | 4 +- libraries/entities/src/EntityItem.h | 2 +- .../entities/src/EntityScriptingInterface.h | 10 +-- libraries/entities/src/EntityTree.cpp | 12 +-- libraries/entities/src/EntityTreeElement.h | 48 ++++++----- .../entities/src/EntityTreeHeadlessViewer.h | 10 +-- .../entities/src/KeyLightPropertyGroup.h | 52 +++++------ libraries/entities/src/LightEntityItem.h | 22 ++--- libraries/entities/src/LineEntityItem.h | 43 +++++----- libraries/entities/src/ModelEntityItem.h | 22 ++--- .../entities/src/MovingEntitiesOperator.h | 6 +- .../entities/src/ParticleEffectEntityItem.h | 22 ++--- libraries/entities/src/PolyLineEntityItem.h | 45 +++++----- libraries/entities/src/PolyVoxEntityItem.h | 20 ++--- libraries/entities/src/PropertyGroup.h | 2 +- .../entities/src/RecurseOctreeToMapOperator.h | 4 +- libraries/entities/src/SkyboxPropertyGroup.h | 45 +++++----- libraries/entities/src/StagePropertyGroup.h | 49 ++++++----- libraries/entities/src/TextEntityItem.h | 34 ++++---- libraries/entities/src/UpdateEntityOperator.h | 6 +- libraries/entities/src/WebEntityItem.h | 30 +++---- libraries/entities/src/ZoneEntityItem.h | 36 ++++---- libraries/gl/src/gl/OffscreenQmlSurface.cpp | 2 +- libraries/gl/src/gl/OglplusHelpers.h | 9 ++ libraries/gpu-gl/src/gpu/gl/GLBackend.h | 7 +- libraries/gpu-gl/src/gpu/gl/GLState.cpp | 12 +++ libraries/gpu/src/gpu/Buffer.h | 2 +- libraries/gpu/src/gpu/Texture.h | 2 +- .../src/model-networking/ModelCache.h | 2 +- .../src/model-networking/TextureCache.cpp | 2 +- .../src/model-networking/TextureCache.h | 8 +- libraries/networking/src/NLPacketList.h | 2 +- .../src/OAuthNetworkAccessManager.h | 4 +- libraries/networking/src/PacketSender.h | 4 +- .../networking/src/ReceivedPacketProcessor.h | 4 +- libraries/networking/src/udt/BasePacket.h | 10 +-- .../networking/src/udt/CongestionControl.h | 10 +-- libraries/networking/src/udt/PacketList.h | 8 +- .../octree/src/DirtyOctreeElementOperator.h | 4 +- libraries/octree/src/OctreeEditPacketSender.h | 2 +- libraries/octree/src/OctreePersistThread.h | 2 +- libraries/physics/src/CharacterController.cpp | 2 +- libraries/render-utils/src/Model.cpp | 2 +- libraries/render/src/render/Item.h | 46 +++++----- libraries/render/src/render/Task.h | 25 +++--- .../script-engine/src/ArrayBufferClass.h | 28 +++--- .../script-engine/src/ArrayBufferViewClass.h | 14 +-- libraries/script-engine/src/DataViewClass.h | 14 +-- libraries/script-engine/src/ScriptEngine.h | 7 +- libraries/script-engine/src/ScriptsModel.h | 10 +-- .../script-engine/src/ScriptsModelFilter.h | 4 +- libraries/script-engine/src/TypedArrays.h | 86 +++++++++---------- .../src/UndoStackScriptingInterface.h | 8 +- libraries/shared/src/CrashHelpers.h | 2 +- libraries/shared/src/GenericQueueThread.h | 2 +- libraries/shared/src/Preferences.h | 16 ++-- libraries/shared/src/SettingHandle.h | 62 ++++++------- libraries/shared/src/ShutdownEventListener.h | 2 +- .../src/steamworks-wrapper/SteamClient.cpp | 3 +- libraries/ui/src/CursorManager.cpp | 4 +- libraries/ui/src/ErrorDialog.h | 2 +- libraries/ui/src/MainWindow.h | 16 ++-- tools/vhacd-util/src/VHACDUtil.h | 2 +- 122 files changed, 773 insertions(+), 737 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d42be3d95..5ecd65ae22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ if (WIN32) else () set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fno-strict-aliasing -Wno-unused-parameter") if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -Woverloaded-virtual -Wdouble-promotion") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -Woverloaded-virtual -Wdouble-promotion -Wsuggest-override") endif () endif(WIN32) diff --git a/assignment-client/src/Agent.h b/assignment-client/src/Agent.h index 63d4cfa4d6..3f4e36374c 100644 --- a/assignment-client/src/Agent.h +++ b/assignment-client/src/Agent.h @@ -52,10 +52,10 @@ public: float getLastReceivedAudioLoudness() const { return _lastReceivedAudioLoudness; } QUuid getSessionUUID() const; - virtual void aboutToFinish(); + virtual void aboutToFinish() override; public slots: - void run(); + void run() override; void playAvatarSound(SharedSoundPointer avatarSound) { setAvatarSound(avatarSound); } private slots: diff --git a/assignment-client/src/AssignmentAction.h b/assignment-client/src/AssignmentAction.h index 6b55b280bb..98504b3545 100644 --- a/assignment-client/src/AssignmentAction.h +++ b/assignment-client/src/AssignmentAction.h @@ -24,27 +24,27 @@ public: AssignmentAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity); virtual ~AssignmentAction(); - virtual void removeFromSimulation(EntitySimulationPointer simulation) const; - virtual EntityItemWeakPointer getOwnerEntity() const { return _ownerEntity; } - virtual void setOwnerEntity(const EntityItemPointer ownerEntity) { _ownerEntity = ownerEntity; } - virtual bool updateArguments(QVariantMap arguments); - virtual QVariantMap getArguments(); + virtual void removeFromSimulation(EntitySimulationPointer simulation) const override; + virtual EntityItemWeakPointer getOwnerEntity() const override { return _ownerEntity; } + virtual void setOwnerEntity(const EntityItemPointer ownerEntity) override { _ownerEntity = ownerEntity; } + virtual bool updateArguments(QVariantMap arguments) override; + virtual QVariantMap getArguments() override; - virtual QByteArray serialize() const; - virtual void deserialize(QByteArray serializedArguments); + virtual QByteArray serialize() const override; + virtual void deserialize(QByteArray serializedArguments) override; private: QByteArray _data; protected: - virtual glm::vec3 getPosition(); - virtual void setPosition(glm::vec3 position); - virtual glm::quat getRotation(); - virtual void setRotation(glm::quat rotation); - virtual glm::vec3 getLinearVelocity(); - virtual void setLinearVelocity(glm::vec3 linearVelocity); - virtual glm::vec3 getAngularVelocity(); - virtual void setAngularVelocity(glm::vec3 angularVelocity); + virtual glm::vec3 getPosition() override; + virtual void setPosition(glm::vec3 position) override; + virtual glm::quat getRotation() override; + virtual void setRotation(glm::quat rotation) override; + virtual glm::vec3 getLinearVelocity() override; + virtual void setLinearVelocity(glm::vec3 linearVelocity) override; + virtual glm::vec3 getAngularVelocity() override; + virtual void setAngularVelocity(glm::vec3 angularVelocity) override; bool _active; EntityItemWeakPointer _ownerEntity; diff --git a/assignment-client/src/AssignmentActionFactory.h b/assignment-client/src/AssignmentActionFactory.h index e2d58f3e6a..87970c9431 100644 --- a/assignment-client/src/AssignmentActionFactory.h +++ b/assignment-client/src/AssignmentActionFactory.h @@ -22,8 +22,8 @@ public: virtual EntityActionPointer factory(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity, - QVariantMap arguments); - virtual EntityActionPointer factoryBA(EntityItemPointer ownerEntity, QByteArray data); + QVariantMap arguments) override; + virtual EntityActionPointer factoryBA(EntityItemPointer ownerEntity, QByteArray data) override; }; #endif // hifi_AssignmentActionFactory_h diff --git a/assignment-client/src/assets/AssetServer.h b/assignment-client/src/assets/AssetServer.h index 07ff0a92b3..132fb51433 100644 --- a/assignment-client/src/assets/AssetServer.h +++ b/assignment-client/src/assets/AssetServer.h @@ -26,7 +26,7 @@ public: AssetServer(ReceivedMessage& message); public slots: - void run(); + void run() override; private slots: void completeSetup(); @@ -35,9 +35,9 @@ private slots: void handleAssetGet(QSharedPointer packet, SharedNodePointer senderNode); void handleAssetUpload(QSharedPointer packetList, SharedNodePointer senderNode); void handleAssetMappingOperation(QSharedPointer message, SharedNodePointer senderNode); - - void sendStatsPacket(); - + + void sendStatsPacket() override; + private: using Mappings = QVariantHash; diff --git a/assignment-client/src/assets/SendAssetTask.h b/assignment-client/src/assets/SendAssetTask.h index 9fef8662d4..38da5e728b 100644 --- a/assignment-client/src/assets/SendAssetTask.h +++ b/assignment-client/src/assets/SendAssetTask.h @@ -27,7 +27,7 @@ class SendAssetTask : public QRunnable { public: SendAssetTask(QSharedPointer message, const SharedNodePointer& sendToNode, const QDir& resourcesDir); - void run(); + void run() override; private: QSharedPointer _message; diff --git a/assignment-client/src/assets/UploadAssetTask.h b/assignment-client/src/assets/UploadAssetTask.h index aa7beccd5c..700eecbf9a 100644 --- a/assignment-client/src/assets/UploadAssetTask.h +++ b/assignment-client/src/assets/UploadAssetTask.h @@ -27,9 +27,9 @@ class Node; class UploadAssetTask : public QRunnable { public: UploadAssetTask(QSharedPointer message, QSharedPointer senderNode, const QDir& resourcesDir); - - void run(); - + + void run() override; + private: QSharedPointer _receivedMessage; QSharedPointer _senderNode; diff --git a/assignment-client/src/audio/AudioMixer.h b/assignment-client/src/audio/AudioMixer.h index 9b26989847..7e3ef8a69b 100644 --- a/assignment-client/src/audio/AudioMixer.h +++ b/assignment-client/src/audio/AudioMixer.h @@ -35,9 +35,9 @@ public: public slots: /// threaded run of assignment - void run(); + void run() override; - void sendStatsPacket(); + void sendStatsPacket() override; static const InboundAudioStream::Settings& getStreamSettings() { return _streamSettings; } diff --git a/assignment-client/src/audio/AudioMixerClientData.h b/assignment-client/src/audio/AudioMixerClientData.h index 106841ee03..2f8ff4d049 100644 --- a/assignment-client/src/audio/AudioMixerClientData.h +++ b/assignment-client/src/audio/AudioMixerClientData.h @@ -49,17 +49,17 @@ public: // removes an AudioHRTF object for a given stream void removeHRTFForStream(const QUuid& nodeID, const QUuid& streamID = QUuid()); - - int parseData(ReceivedMessage& message); + + int parseData(ReceivedMessage& message) override; void checkBuffersBeforeFrameSend(); void removeDeadInjectedStreams(); QJsonObject getAudioStreamStats(); - + void sendAudioStreamStatsPackets(const SharedNodePointer& destinationNode); - + void incrementOutgoingMixedAudioSequenceNumber() { _outgoingMixedAudioSequenceNumber++; } quint16 getOutgoingSequenceNumber() const { return _outgoingMixedAudioSequenceNumber; } diff --git a/assignment-client/src/audio/AvatarAudioStream.h b/assignment-client/src/audio/AvatarAudioStream.h index cc2ff1aca7..d2e1137ae6 100644 --- a/assignment-client/src/audio/AvatarAudioStream.h +++ b/assignment-client/src/audio/AvatarAudioStream.h @@ -25,7 +25,7 @@ private: AvatarAudioStream(const AvatarAudioStream&); AvatarAudioStream& operator= (const AvatarAudioStream&); - int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples); + int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) override; }; #endif // hifi_AvatarAudioStream_h diff --git a/assignment-client/src/avatars/AvatarMixer.h b/assignment-client/src/avatars/AvatarMixer.h index 00cf457d40..9286cd4691 100644 --- a/assignment-client/src/avatars/AvatarMixer.h +++ b/assignment-client/src/avatars/AvatarMixer.h @@ -27,11 +27,11 @@ public: ~AvatarMixer(); public slots: /// runs the avatar mixer - void run(); + void run() override; void nodeKilled(SharedNodePointer killedNode); - - void sendStatsPacket(); + + void sendStatsPacket() override; private slots: void handleAvatarDataPacket(QSharedPointer message, SharedNodePointer senderNode); @@ -45,14 +45,14 @@ private slots: private: void broadcastAvatarData(); void parseDomainServerSettings(const QJsonObject& domainSettings); - + QThread _broadcastThread; - + p_high_resolution_clock::time_point _lastFrameTimestamp; - + float _trailingSleepRatio { 1.0f }; float _performanceThrottlingRatio { 0.0f }; - + int _sumListeners { 0 }; int _numStatFrames { 0 }; int _sumIdentityPackets { 0 }; diff --git a/assignment-client/src/entities/AssignmentParentFinder.h b/assignment-client/src/entities/AssignmentParentFinder.h index 0c16143143..0ac915817c 100644 --- a/assignment-client/src/entities/AssignmentParentFinder.h +++ b/assignment-client/src/entities/AssignmentParentFinder.h @@ -25,7 +25,8 @@ class AssignmentParentFinder : public SpatialParentFinder { public: AssignmentParentFinder(EntityTreePointer tree) : _tree(tree) { } virtual ~AssignmentParentFinder() { } - virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success, SpatialParentTree* entityTree = nullptr) const; + virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success, + SpatialParentTree* entityTree = nullptr) const override; protected: EntityTreePointer _tree; diff --git a/assignment-client/src/entities/EntityNodeData.h b/assignment-client/src/entities/EntityNodeData.h index 0ca0834fef..e1f8a91030 100644 --- a/assignment-client/src/entities/EntityNodeData.h +++ b/assignment-client/src/entities/EntityNodeData.h @@ -18,7 +18,7 @@ class EntityNodeData : public OctreeQueryNode { public: - virtual PacketType getMyPacketType() const { return PacketType::EntityData; } + virtual PacketType getMyPacketType() const override { return PacketType::EntityData; } quint64 getLastDeletedEntitiesSentAt() const { return _lastDeletedEntitiesSentAt; } void setLastDeletedEntitiesSentAt(quint64 sentAt) { _lastDeletedEntitiesSentAt = sentAt; } diff --git a/assignment-client/src/messages/MessagesMixer.h b/assignment-client/src/messages/MessagesMixer.h index 76ae2f7195..800d42199b 100644 --- a/assignment-client/src/messages/MessagesMixer.h +++ b/assignment-client/src/messages/MessagesMixer.h @@ -24,9 +24,9 @@ public: MessagesMixer(ReceivedMessage& message); public slots: - void run(); + void run() override; void nodeKilled(SharedNodePointer killedNode); - void sendStatsPacket(); + void sendStatsPacket() override; private slots: void handleMessages(QSharedPointer message, SharedNodePointer senderNode); diff --git a/assignment-client/src/octree/OctreeInboundPacketProcessor.h b/assignment-client/src/octree/OctreeInboundPacketProcessor.h index 8d0245c2b1..4611fcada0 100644 --- a/assignment-client/src/octree/OctreeInboundPacketProcessor.h +++ b/assignment-client/src/octree/OctreeInboundPacketProcessor.h @@ -74,15 +74,15 @@ public: NodeToSenderStatsMap getSingleSenderStats() { QReadLocker locker(&_senderStatsLock); return _singleSenderStats; } - virtual void terminating() { _shuttingDown = true; ReceivedPacketProcessor::terminating(); } + virtual void terminating() override { _shuttingDown = true; ReceivedPacketProcessor::terminating(); } protected: - virtual void processPacket(QSharedPointer message, SharedNodePointer sendingNode); + virtual void processPacket(QSharedPointer message, SharedNodePointer sendingNode) override; - virtual unsigned long getMaxWait() const; - virtual void preProcess(); - virtual void midProcess(); + virtual unsigned long getMaxWait() const override; + virtual void preProcess() override; + virtual void midProcess() override; private: int sendNackPackets(); diff --git a/assignment-client/src/octree/OctreeSendThread.h b/assignment-client/src/octree/OctreeSendThread.h index 166171c7f9..7efe5b3a86 100644 --- a/assignment-client/src/octree/OctreeSendThread.h +++ b/assignment-client/src/octree/OctreeSendThread.h @@ -47,7 +47,7 @@ public: protected: /// Implements generic processing behavior for this thread. - virtual bool process(); + virtual bool process() override; private: int handlePacketSend(SharedNodePointer node, OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent, bool dontSuppressDuplicate = false); diff --git a/assignment-client/src/octree/OctreeServer.h b/assignment-client/src/octree/OctreeServer.h index d153f31154..beea322e9b 100644 --- a/assignment-client/src/octree/OctreeServer.h +++ b/assignment-client/src/octree/OctreeServer.h @@ -120,16 +120,16 @@ public: static int howManyThreadsDidHandlePacketSend(quint64 since = 0); static int howManyThreadsDidCallWriteDatagram(quint64 since = 0); - bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler); + bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler) override; - virtual void aboutToFinish(); + virtual void aboutToFinish() override; public slots: /// runs the octree server assignment - void run(); + void run() override; virtual void nodeAdded(SharedNodePointer node); virtual void nodeKilled(SharedNodePointer node); - void sendStatsPacket(); + void sendStatsPacket() override; private slots: void domainSettingsRequestComplete(); diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 06b3ed2c0a..e30f4515cc 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -50,8 +50,8 @@ public: static int const EXIT_CODE_REBOOT; - bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false); - bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url, bool skipSubHandler = false); + bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false) override; + bool handleHTTPSRequest(HTTPSConnection* connection, const QUrl& url, bool skipSubHandler = false) override; public slots: /// Called by NodeList to inform us a node has been added diff --git a/interface/src/FileLogger.h b/interface/src/FileLogger.h index 28ac6fba40..950590e789 100644 --- a/interface/src/FileLogger.h +++ b/interface/src/FileLogger.h @@ -48,7 +48,7 @@ signals: protected: void rollFileIfNecessary(QFile& file, bool notifyListenersIfRolled = true); - virtual bool processQueueItems(const Queue& messages); + virtual bool processQueueItems(const Queue& messages) override; private: const FileLogger& _logger; diff --git a/interface/src/InterfaceActionFactory.h b/interface/src/InterfaceActionFactory.h index 2031f5c57a..3e8a17d871 100644 --- a/interface/src/InterfaceActionFactory.h +++ b/interface/src/InterfaceActionFactory.h @@ -21,9 +21,9 @@ public: virtual EntityActionPointer factory(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity, - QVariantMap arguments); + QVariantMap arguments) override; virtual EntityActionPointer factoryBA(EntityItemPointer ownerEntity, - QByteArray data); + QByteArray data) override; }; #endif // hifi_InterfaceActionFactory_h diff --git a/interface/src/InterfaceParentFinder.h b/interface/src/InterfaceParentFinder.h index a2e9fb50e4..19f7e30dca 100644 --- a/interface/src/InterfaceParentFinder.h +++ b/interface/src/InterfaceParentFinder.h @@ -21,7 +21,8 @@ class InterfaceParentFinder : public SpatialParentFinder { public: InterfaceParentFinder() { } virtual ~InterfaceParentFinder() { } - virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success, SpatialParentTree* entityTree = nullptr) const; + virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success, + SpatialParentTree* entityTree = nullptr) const override; }; #endif // hifi_InterfaceParentFinder_h diff --git a/interface/src/ModelSelector.h b/interface/src/ModelSelector.h index 0ac3df5963..ee9e75c17a 100644 --- a/interface/src/ModelSelector.h +++ b/interface/src/ModelSelector.h @@ -24,23 +24,23 @@ class QPushButton; class ModelSelector : public QDialog { Q_OBJECT - + public: ModelSelector(); - + QFileInfo getFileInfo() const; FSTReader::ModelType getModelType() const; - + public slots: - virtual void accept(); - + virtual void accept() override; + private slots: void browse(); - + private: QFileInfo _modelFile; QPushButton* _browseButton; QComboBox* _modelType; }; -#endif // hifi_ModelSelector_h \ No newline at end of file +#endif // hifi_ModelSelector_h diff --git a/interface/src/ScriptHighlighting.h b/interface/src/ScriptHighlighting.h index 2eb40796e3..8952b1bcbd 100644 --- a/interface/src/ScriptHighlighting.h +++ b/interface/src/ScriptHighlighting.h @@ -26,7 +26,7 @@ public: }; protected: - void highlightBlock(const QString& text); + void highlightBlock(const QString& text) override; void highlightKeywords(const QString& text); void formatComments(const QString& text); void formatQuotedText(const QString& text); diff --git a/interface/src/avatar/Head.h b/interface/src/avatar/Head.h index 33ea180d33..29cd06865c 100644 --- a/interface/src/avatar/Head.h +++ b/interface/src/avatar/Head.h @@ -82,12 +82,12 @@ public: void setDeltaRoll(float roll) { _deltaRoll = roll; } float getDeltaRoll() const { return _deltaRoll; } - virtual void setFinalYaw(float finalYaw); - virtual void setFinalPitch(float finalPitch); - virtual void setFinalRoll(float finalRoll); - virtual float getFinalPitch() const; - virtual float getFinalYaw() const; - virtual float getFinalRoll() const; + virtual void setFinalYaw(float finalYaw) override; + virtual void setFinalPitch(float finalPitch) override; + virtual void setFinalRoll(float finalRoll) override; + virtual float getFinalPitch() const override; + virtual float getFinalYaw() const override; + virtual float getFinalRoll() const override; void relax(float deltaTime); diff --git a/interface/src/devices/DdeFaceTracker.h b/interface/src/devices/DdeFaceTracker.h index 9673f541d2..931ab099e9 100644 --- a/interface/src/devices/DdeFaceTracker.h +++ b/interface/src/devices/DdeFaceTracker.h @@ -27,26 +27,26 @@ class DdeFaceTracker : public FaceTracker, public Dependency { Q_OBJECT SINGLETON_DEPENDENCY - -public: - virtual void init(); - virtual void reset(); - virtual void update(float deltaTime); - virtual bool isActive() const; - virtual bool isTracking() const; - +public: + virtual void init() override; + virtual void reset() override; + virtual void update(float deltaTime) override; + + virtual bool isActive() const override; + virtual bool isTracking() const override; + float getLeftBlink() const { return getBlendshapeCoefficient(_leftBlinkIndex); } float getRightBlink() const { return getBlendshapeCoefficient(_rightBlinkIndex); } float getLeftEyeOpen() const { return getBlendshapeCoefficient(_leftEyeOpenIndex); } float getRightEyeOpen() const { return getBlendshapeCoefficient(_rightEyeOpenIndex); } - + float getBrowDownLeft() const { return getBlendshapeCoefficient(_browDownLeftIndex); } float getBrowDownRight() const { return getBlendshapeCoefficient(_browDownRightIndex); } float getBrowUpCenter() const { return getBlendshapeCoefficient(_browUpCenterIndex); } float getBrowUpLeft() const { return getBlendshapeCoefficient(_browUpLeftIndex); } float getBrowUpRight() const { return getBlendshapeCoefficient(_browUpRightIndex); } - + float getMouthSize() const { return getBlendshapeCoefficient(_jawOpenIndex); } float getMouthSmileLeft() const { return getBlendshapeCoefficient(_mouthSmileLeftIndex); } float getMouthSmileRight() const { return getBlendshapeCoefficient(_mouthSmileRightIndex); } @@ -55,7 +55,7 @@ public: void setEyeClosingThreshold(float eyeClosingThreshold); public slots: - void setEnabled(bool enabled); + void setEnabled(bool enabled) override; void calibrate(); private slots: @@ -77,18 +77,18 @@ private: QHostAddress _host; quint16 _serverPort; quint16 _controlPort; - + float getBlendshapeCoefficient(int index) const; void decodePacket(const QByteArray& buffer); - + // sockets QUdpSocket _udpSocket; quint64 _lastReceiveTimestamp; - + bool _reset; glm::vec3 _referenceTranslation; glm::quat _referenceRotation; - + int _leftBlinkIndex; int _rightBlinkIndex; int _leftEyeDownIndex; @@ -103,10 +103,10 @@ private: int _browUpCenterIndex; int _browUpLeftIndex; int _browUpRightIndex; - + int _mouthSmileLeftIndex; int _mouthSmileRightIndex; - + int _jawOpenIndex; QVector _coefficients; diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index 4cb7557410..48a4cd682a 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -49,7 +49,7 @@ public: // these pitch/yaw angles are in degrees float getEyeGazeLeftPitch() const { return _eyeGazeLeftPitch; } float getEyeGazeLeftYaw() const { return _eyeGazeLeftYaw; } - + float getEyeGazeRightPitch() const { return _eyeGazeRightPitch; } float getEyeGazeRightYaw() const { return _eyeGazeRightYaw; } @@ -67,10 +67,10 @@ public: float getMouthSize() const { return getBlendshapeCoefficient(_jawOpenIndex); } float getMouthSmileLeft() const { return getBlendshapeCoefficient(_mouthSmileLeftIndex); } float getMouthSmileRight() const { return getBlendshapeCoefficient(_mouthSmileRightIndex); } - + QString getHostname() { return _hostname.get(); } void setHostname(const QString& hostname); - + void updateFakeCoefficients(float leftBlink, float rightBlink, float browUp, @@ -79,76 +79,76 @@ public: float mouth3, float mouth4, QVector& coefficients) const; - + signals: void connectionStateChanged(); public slots: - void setEnabled(bool enabled); - + void setEnabled(bool enabled) override; + private slots: void connectSocket(); void noteConnected(); void noteError(QAbstractSocket::SocketError error); void readPendingDatagrams(); - void readFromSocket(); + void readFromSocket(); void noteDisconnected(); private: Faceshift(); virtual ~Faceshift() {} - + void send(const std::string& message); void receive(const QByteArray& buffer); - + QTcpSocket _tcpSocket; QUdpSocket _udpSocket; #ifdef HAVE_FACESHIFT fs::fsBinaryStream _stream; #endif - + bool _tcpEnabled = true; int _tcpRetryCount = 0; bool _tracking = false; quint64 _lastReceiveTimestamp = 0; quint64 _lastMessageReceived = 0; float _averageFrameTime = STARTING_FACESHIFT_FRAME_TIME; - + glm::vec3 _headAngularVelocity = glm::vec3(0.0f); glm::vec3 _headLinearVelocity = glm::vec3(0.0f); glm::vec3 _lastHeadTranslation = glm::vec3(0.0f); glm::vec3 _filteredHeadTranslation = glm::vec3(0.0f); - + // degrees float _eyeGazeLeftPitch = 0.0f; float _eyeGazeLeftYaw = 0.0f; float _eyeGazeRightPitch = 0.0f; float _eyeGazeRightYaw = 0.0f; - + // degrees float _longTermAverageEyePitch = 0.0f; float _longTermAverageEyeYaw = 0.0f; bool _longTermAverageInitialized = false; - + Setting::Handle _hostname; - + // see http://support.faceshift.com/support/articles/35129-export-of-blendshapes int _leftBlinkIndex = 0; int _rightBlinkIndex = 1; int _leftEyeOpenIndex = 8; int _rightEyeOpenIndex = 9; - + // Brows int _browDownLeftIndex = 14; int _browDownRightIndex = 15; int _browUpCenterIndex = 16; int _browUpLeftIndex = 17; int _browUpRightIndex = 18; - + int _mouthSmileLeftIndex = 28; int _mouthSmileRightIndex = 29; - + int _jawOpenIndex = 21; }; diff --git a/interface/src/devices/Leapmotion.h b/interface/src/devices/Leapmotion.h index 266b9beb87..d7981a65e8 100644 --- a/interface/src/devices/Leapmotion.h +++ b/interface/src/devices/Leapmotion.h @@ -33,7 +33,7 @@ public: bool isActive() const { return _active; } - virtual void update(); + virtual void update() override; protected: Leapmotion(); diff --git a/interface/src/scripting/ControllerScriptingInterface.h b/interface/src/scripting/ControllerScriptingInterface.h index fc8d125839..50539e7a05 100644 --- a/interface/src/scripting/ControllerScriptingInterface.h +++ b/interface/src/scripting/ControllerScriptingInterface.h @@ -33,16 +33,16 @@ class InputController : public controller::InputController { public: InputController(int deviceTrackerId, int subTrackerId, QObject* parent = NULL); - virtual void update(); - virtual Key getKey() const; + virtual void update() override; + virtual Key getKey() const override; public slots: - virtual bool isActive() const { return _isActive; } - virtual glm::vec3 getAbsTranslation() const { return _eventCache.absTranslation; } - virtual glm::quat getAbsRotation() const { return _eventCache.absRotation; } - virtual glm::vec3 getLocTranslation() const { return _eventCache.locTranslation; } - virtual glm::quat getLocRotation() const { return _eventCache.locRotation; } + virtual bool isActive() const override { return _isActive; } + virtual glm::vec3 getAbsTranslation() const override { return _eventCache.absTranslation; } + virtual glm::quat getAbsRotation() const override { return _eventCache.absRotation; } + virtual glm::vec3 getLocTranslation() const override { return _eventCache.locTranslation; } + virtual glm::quat getLocRotation() const override { return _eventCache.locRotation; } private: diff --git a/interface/src/scripting/WebWindowClass.h b/interface/src/scripting/WebWindowClass.h index 8859eb5b37..d7a610dd39 100644 --- a/interface/src/scripting/WebWindowClass.h +++ b/interface/src/scripting/WebWindowClass.h @@ -66,7 +66,7 @@ signals: void closed(); protected: - virtual bool eventFilter(QObject* sender, QEvent* event); + virtual bool eventFilter(QObject* sender, QEvent* event) override; private slots: void hasClosed(); diff --git a/interface/src/ui/AudioStatsDialog.h b/interface/src/ui/AudioStatsDialog.h index 7f14cd6018..3abab258c4 100644 --- a/interface/src/ui/AudioStatsDialog.h +++ b/interface/src/ui/AudioStatsDialog.h @@ -36,13 +36,13 @@ public: AudioStatsDisplay(QFormLayout* form, QString text, unsigned colorRGBA); void updatedDisplay(QString str); void paint(); - + private: QString _strBuf; QLabel* _label; QString _text; unsigned _colorRGBA; - + }; //dialog @@ -51,9 +51,9 @@ class AudioStatsDialog : public QDialog { public: AudioStatsDialog(QWidget* parent); ~AudioStatsDialog(); - - void paintEvent(QPaintEvent*); - + + void paintEvent(QPaintEvent*) override; + private: // audio stats methods for rendering QVector _audioMixerStats; @@ -61,48 +61,47 @@ private: QVector _upstreamMixerStats; QVector _downstreamStats; QVector _upstreamInjectedStats; - + int _audioMixerID; int _upstreamClientID; int _upstreamMixerID; int _downstreamID; int _upstreamInjectedID; - + QVector> _audioDisplayChannels; - + int addChannel(QFormLayout* form, QVector& stats, const unsigned color); void updateStats(QVector& stats, const int channelID); void renderStats(); void clearAllChannels(); void renderAudioStreamStats(const AudioStreamStats* streamStats, QVector* audioStreamstats, bool isDownstreamStats); - - + + const AudioIOStats* _stats; QFormLayout* _form; - + bool _isEnabled; bool _shouldShowInjectedStreams; - - + + signals: - - + + void closed(); - + public slots: - - - void reject(); + + + void reject() override; void updateTimerTimeout(); - + protected: - + // Emits a 'closed' signal when this dialog is closed. - void closeEvent(QCloseEvent*); - + void closeEvent(QCloseEvent*) override; + private: QTimer* averageUpdateTimer = new QTimer(this); - }; diff --git a/interface/src/ui/BandwidthDialog.h b/interface/src/ui/BandwidthDialog.h index 1fc8627191..a53cc21030 100644 --- a/interface/src/ui/BandwidthDialog.h +++ b/interface/src/ui/BandwidthDialog.h @@ -57,7 +57,7 @@ public: BandwidthDialog(QWidget* parent); ~BandwidthDialog(); - void paintEvent(QPaintEvent*); + void paintEvent(QPaintEvent*) override; private: BandwidthChannelDisplay* _audioChannelDisplay; @@ -77,14 +77,14 @@ signals: public slots: - void reject(); + void reject() override; void updateTimerTimeout(); protected: // Emits a 'closed' signal when this dialog is closed. - void closeEvent(QCloseEvent*); + void closeEvent(QCloseEvent*) override; private: QTimer* averageUpdateTimer = new QTimer(this); diff --git a/interface/src/ui/CachesSizeDialog.h b/interface/src/ui/CachesSizeDialog.h index fa01ce4534..025d0f2bac 100644 --- a/interface/src/ui/CachesSizeDialog.h +++ b/interface/src/ui/CachesSizeDialog.h @@ -21,19 +21,19 @@ class CachesSizeDialog : public QDialog { public: // Sets up the UI CachesSizeDialog(QWidget* parent); - + signals: void closed(); - + public slots: - void reject(); + void reject() override; void confirmClicked(bool checked); void resetClicked(bool checked); - + protected: // Emits a 'closed' signal when this dialog is closed. - void closeEvent(QCloseEvent* event); - + void closeEvent(QCloseEvent* event) override; + private: QDoubleSpinBox* _animations = nullptr; QDoubleSpinBox* _geometries = nullptr; @@ -42,4 +42,4 @@ private: QDoubleSpinBox* _textures = nullptr; }; -#endif // hifi_CachesSizeDialog_h \ No newline at end of file +#endif // hifi_CachesSizeDialog_h diff --git a/interface/src/ui/DataWebPage.h b/interface/src/ui/DataWebPage.h index c1c343a216..f9aa5be8a8 100644 --- a/interface/src/ui/DataWebPage.h +++ b/interface/src/ui/DataWebPage.h @@ -18,9 +18,9 @@ class DataWebPage : public QWebPage { public: DataWebPage(QObject* parent = 0); protected: - void javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID); - bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, QWebPage::NavigationType type); - virtual QString userAgentForUrl(const QUrl& url) const; + void javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID) override; + bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, QWebPage::NavigationType type) override; + virtual QString userAgentForUrl(const QUrl& url) const override; }; #endif // hifi_DataWebPage_h diff --git a/interface/src/ui/HMDToolsDialog.h b/interface/src/ui/HMDToolsDialog.h index 7d30fc17f6..16ea090d95 100644 --- a/interface/src/ui/HMDToolsDialog.h +++ b/interface/src/ui/HMDToolsDialog.h @@ -29,18 +29,18 @@ public: QScreen* getLastApplicationScreen() const { return _previousScreen; } bool hasHMDScreen() const { return _hmdScreenNumber >= -1; } void watchWindow(QWindow* window); - + signals: void closed(); public slots: - void reject(); + void reject() override; void screenCountChanged(int newCount); - + protected: - virtual void closeEvent(QCloseEvent*); // Emits a 'closed' signal when this dialog is closed. - virtual void showEvent(QShowEvent* event); - virtual void hideEvent(QHideEvent* event); + virtual void closeEvent(QCloseEvent*) override; // Emits a 'closed' signal when this dialog is closed. + virtual void showEvent(QShowEvent* event) override; + virtual void hideEvent(QHideEvent* event) override; private: void centerCursorOnWidget(QWidget* widget); @@ -59,7 +59,7 @@ private: QScreen* _previousDialogScreen{ nullptr }; QString _hmdPluginName; QString _defaultPluginName; - + QHash _windowWatchers; friend class HMDWindowWatcher; }; @@ -75,7 +75,7 @@ public: public slots: void windowScreenChanged(QScreen* screen); void windowGeometryChanged(int arg); - + private: QWindow* _window; HMDToolsDialog* _hmdTools; diff --git a/interface/src/ui/JSConsole.h b/interface/src/ui/JSConsole.h index cb58beab35..47878fea99 100644 --- a/interface/src/ui/JSConsole.h +++ b/interface/src/ui/JSConsole.h @@ -40,9 +40,9 @@ public slots: protected: void setAndSelectCommand(const QString& command); - virtual bool eventFilter(QObject* sender, QEvent* event); - virtual void mouseReleaseEvent(QMouseEvent* event); - virtual void showEvent(QShowEvent* event); + virtual bool eventFilter(QObject* sender, QEvent* event) override; + virtual void mouseReleaseEvent(QMouseEvent* event) override; + virtual void showEvent(QShowEvent* event) override; protected slots: void scrollToBottom(); diff --git a/interface/src/ui/LodToolsDialog.h b/interface/src/ui/LodToolsDialog.h index e5a2dae836..b2390a1cd7 100644 --- a/interface/src/ui/LodToolsDialog.h +++ b/interface/src/ui/LodToolsDialog.h @@ -24,12 +24,12 @@ class LodToolsDialog : public QDialog { public: // Sets up the UI LodToolsDialog(QWidget* parent); - + signals: void closed(); public slots: - void reject(); + void reject() override; void sizeScaleValueChanged(int value); void resetClicked(bool checked); void reloadSliders(); @@ -38,7 +38,7 @@ public slots: protected: // Emits a 'closed' signal when this dialog is closed. - void closeEvent(QCloseEvent* event); + void closeEvent(QCloseEvent* event) override; private: QSlider* _lodSize; diff --git a/interface/src/ui/LogDialog.h b/interface/src/ui/LogDialog.h index 999a8394cc..c38cf84f00 100644 --- a/interface/src/ui/LogDialog.h +++ b/interface/src/ui/LogDialog.h @@ -30,7 +30,7 @@ public: QString keyword; protected: - void highlightBlock(const QString &text); + void highlightBlock(const QString &text) override; private: QTextCharFormat keywordFormat; @@ -54,8 +54,8 @@ private slots: void handleSearchTextChanged(const QString); protected: - void resizeEvent(QResizeEvent*); - void showEvent(QShowEvent*); + void resizeEvent(QResizeEvent*) override; + void showEvent(QShowEvent*) override; private: QPushButton* _searchButton; diff --git a/interface/src/ui/OctreeStatsDialog.h b/interface/src/ui/OctreeStatsDialog.h index 97f87849ec..67f5c01f65 100644 --- a/interface/src/ui/OctreeStatsDialog.h +++ b/interface/src/ui/OctreeStatsDialog.h @@ -33,15 +33,15 @@ signals: void closed(); public slots: - void reject(); + void reject() override; void moreless(const QString& link); protected: // State <- data model held by BandwidthMeter - void paintEvent(QPaintEvent*); + void paintEvent(QPaintEvent*) override; // Emits a 'closed' signal when this dialog is closed. - void closeEvent(QCloseEvent*); + void closeEvent(QCloseEvent*) override; int AddStatItem(const char* caption, unsigned colorRGBA = DEFAULT_COLOR); void RemoveStatItem(int item); diff --git a/interface/src/ui/ScriptEditBox.h b/interface/src/ui/ScriptEditBox.h index 41d881b904..0b037db16a 100644 --- a/interface/src/ui/ScriptEditBox.h +++ b/interface/src/ui/ScriptEditBox.h @@ -24,7 +24,7 @@ public: int lineNumberAreaWidth(); protected: - void resizeEvent(QResizeEvent* event); + void resizeEvent(QResizeEvent* event) override; private slots: void updateLineNumberAreaWidth(int blockCount); diff --git a/interface/src/ui/ScriptEditorWindow.h b/interface/src/ui/ScriptEditorWindow.h index 185a0f40bd..af9863d136 100644 --- a/interface/src/ui/ScriptEditorWindow.h +++ b/interface/src/ui/ScriptEditorWindow.h @@ -35,8 +35,8 @@ signals: void windowActivated(); protected: - void closeEvent(QCloseEvent* event); - virtual bool event(QEvent* event); + void closeEvent(QCloseEvent* event) override; + virtual bool event(QEvent* event) override; private: Ui::ScriptEditorWindow* _ScriptEditorWindowUI; diff --git a/interface/src/ui/ScriptLineNumberArea.h b/interface/src/ui/ScriptLineNumberArea.h index 00bd078170..77de8244ce 100644 --- a/interface/src/ui/ScriptLineNumberArea.h +++ b/interface/src/ui/ScriptLineNumberArea.h @@ -20,10 +20,10 @@ class ScriptLineNumberArea : public QWidget { public: ScriptLineNumberArea(ScriptEditBox* scriptEditBox); - QSize sizeHint() const; + QSize sizeHint() const override; protected: - void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event) override; private: ScriptEditBox* _scriptEditBox; diff --git a/interface/src/ui/ScriptsTableWidget.h b/interface/src/ui/ScriptsTableWidget.h index 4b54130e82..f5e3407e97 100644 --- a/interface/src/ui/ScriptsTableWidget.h +++ b/interface/src/ui/ScriptsTableWidget.h @@ -21,8 +21,8 @@ public: explicit ScriptsTableWidget(QWidget* parent); protected: - virtual void paintEvent(QPaintEvent* event); - virtual void keyPressEvent(QKeyEvent* event); + virtual void paintEvent(QPaintEvent* event) override; + virtual void keyPressEvent(QKeyEvent* event) override; }; #endif // hifi__ScriptsTableWidget_h diff --git a/interface/src/ui/overlays/LocalModelsOverlay.h b/interface/src/ui/overlays/LocalModelsOverlay.h index 011f3dfb11..6bab7f5f86 100644 --- a/interface/src/ui/overlays/LocalModelsOverlay.h +++ b/interface/src/ui/overlays/LocalModelsOverlay.h @@ -20,15 +20,15 @@ class LocalModelsOverlay : public Volume3DOverlay { Q_OBJECT public: static QString const TYPE; - virtual QString getType() const { return TYPE; } + virtual QString getType() const override { return TYPE; } LocalModelsOverlay(EntityTreeRenderer* entityTreeRenderer); LocalModelsOverlay(const LocalModelsOverlay* localModelsOverlay); - - virtual void update(float deltatime); - virtual void render(RenderArgs* args); - virtual LocalModelsOverlay* createClone() const; + virtual void update(float deltatime) override; + virtual void render(RenderArgs* args) override; + + virtual LocalModelsOverlay* createClone() const override; private: EntityTreeRenderer* _entityTreeRenderer; diff --git a/interface/src/ui/overlays/OverlayPanel.h b/interface/src/ui/overlays/OverlayPanel.h index df553883f1..b0b8cdb989 100644 --- a/interface/src/ui/overlays/OverlayPanel.h +++ b/interface/src/ui/overlays/OverlayPanel.h @@ -62,7 +62,7 @@ public: void setProperties(const QVariantMap& properties); QVariant getProperty(const QString& property); - virtual void applyTransformTo(Transform& transform, bool force = false); + virtual void applyTransformTo(Transform& transform, bool force = false) override; private: Transform _anchorTransform; diff --git a/interface/src/ui/overlays/RectangleOverlay.h b/interface/src/ui/overlays/RectangleOverlay.h index 06e2fb228c..c429210c42 100644 --- a/interface/src/ui/overlays/RectangleOverlay.h +++ b/interface/src/ui/overlays/RectangleOverlay.h @@ -14,14 +14,13 @@ class RectangleOverlay : public QmlOverlay { public: static QString const TYPE; - virtual QString getType() const { return TYPE; } + virtual QString getType() const override { return TYPE; } static QUrl const URL; RectangleOverlay(); RectangleOverlay(const RectangleOverlay* RectangleOverlay); - virtual RectangleOverlay* createClone() const; + virtual RectangleOverlay* createClone() const override; }; - #endif // hifi_RectangleOverlay_h diff --git a/libraries/animation/src/AnimationCache.h b/libraries/animation/src/AnimationCache.h index 9da649e66e..a7d8700fed 100644 --- a/libraries/animation/src/AnimationCache.h +++ b/libraries/animation/src/AnimationCache.h @@ -34,9 +34,9 @@ public: Q_INVOKABLE AnimationPointer getAnimation(const QUrl& url); protected: - + virtual QSharedPointer createResource(const QUrl& url, const QSharedPointer& fallback, - const void* extra); + const void* extra) override; private: explicit AnimationCache(QObject* parent = NULL); virtual ~AnimationCache() { } @@ -82,7 +82,7 @@ class AnimationReader : public QObject, public QRunnable { public: AnimationReader(const QUrl& url, const QByteArray& data); - virtual void run(); + virtual void run() override; signals: void onSuccess(FBXGeometry::Pointer geometry); diff --git a/libraries/audio-client/src/AudioClient.h b/libraries/audio-client/src/AudioClient.h index 171014edda..b83547ce00 100644 --- a/libraries/audio-client/src/AudioClient.h +++ b/libraries/audio-client/src/AudioClient.h @@ -86,7 +86,7 @@ public: using Mutex = std::mutex; using Lock = std::unique_lock; - + class AudioOutputIODevice : public QIODevice { public: AudioOutputIODevice(MixedProcessedAudioStream& receivedAudioStream, AudioClient* audio) : @@ -94,8 +94,8 @@ public: void start() { open(QIODevice::ReadOnly); } void stop() { close(); } - qint64 readData(char * data, qint64 maxSize); - qint64 writeData(const char * data, qint64 maxSize) { return 0; } + qint64 readData(char * data, qint64 maxSize) override; + qint64 writeData(const char * data, qint64 maxSize) override { return 0; } int getRecentUnfulfilledReads() { int unfulfilledReads = _unfulfilledReads; _unfulfilledReads = 0; return unfulfilledReads; } private: MixedProcessedAudioStream& _receivedAudioStream; @@ -136,7 +136,7 @@ public: void setPositionGetter(AudioPositionGetter positionGetter) { _positionGetter = positionGetter; } void setOrientationGetter(AudioOrientationGetter orientationGetter) { _orientationGetter = orientationGetter; } - + QVector& getActiveLocalAudioInjectors() { return _activeLocalAudioInjectors; } static const float CALLBACK_ACCELERATOR_RATIO; @@ -163,7 +163,7 @@ public slots: void audioMixerKilled(); void toggleMute(); - virtual void setIsStereoInput(bool stereo); + virtual void setIsStereoInput(bool stereo) override; void toggleAudioNoiseReduction() { _isNoiseGateEnabled = !_isNoiseGateEnabled; } @@ -175,7 +175,7 @@ public slots: int setOutputBufferSize(int numFrames, bool persist = true); - virtual bool outputLocalInjector(bool isStereo, AudioInjector* injector); + virtual bool outputLocalInjector(bool isStereo, AudioInjector* injector) override; bool switchInputToAudioDevice(const QString& inputDeviceName); bool switchOutputToAudioDevice(const QString& outputDeviceName); @@ -215,7 +215,7 @@ protected: AudioClient(); ~AudioClient(); - virtual void customDeleter() { + virtual void customDeleter() override { deleteLater(); } @@ -316,7 +316,7 @@ private: void checkDevices(); bool _hasReceivedFirstPacket = false; - + QVector _activeLocalAudioInjectors; CodecPluginPointer _codec; diff --git a/libraries/audio/src/AudioInjectorLocalBuffer.h b/libraries/audio/src/AudioInjectorLocalBuffer.h index 32a1221b78..988b622ce7 100644 --- a/libraries/audio/src/AudioInjectorLocalBuffer.h +++ b/libraries/audio/src/AudioInjectorLocalBuffer.h @@ -20,27 +20,27 @@ class AudioInjectorLocalBuffer : public QIODevice { Q_OBJECT public: AudioInjectorLocalBuffer(const QByteArray& rawAudioArray, QObject* parent); - + void stop(); - - bool seek(qint64 pos); - - qint64 readData(char* data, qint64 maxSize); - qint64 writeData(const char* data, qint64 maxSize) { return 0; } - + + bool seek(qint64 pos) override; + + qint64 readData(char* data, qint64 maxSize) override; + qint64 writeData(const char* data, qint64 maxSize) override { return 0; } + void setShouldLoop(bool shouldLoop) { _shouldLoop = shouldLoop; } void setCurrentOffset(int currentOffset) { _currentOffset = currentOffset; } void setVolume(float volume) { _volume = glm::clamp(volume, 0.0f, 1.0f); } - + private: qint64 recursiveReadFromFront(char* data, qint64 maxSize); - + QByteArray _rawAudioArray; bool _shouldLoop; bool _isStopped; - + int _currentOffset; float _volume; }; -#endif // hifi_AudioInjectorLocalBuffer_h \ No newline at end of file +#endif // hifi_AudioInjectorLocalBuffer_h diff --git a/libraries/audio/src/AudioLimiter.cpp b/libraries/audio/src/AudioLimiter.cpp index d9257b7df5..b5550fba0c 100644 --- a/libraries/audio/src/AudioLimiter.cpp +++ b/libraries/audio/src/AudioLimiter.cpp @@ -567,7 +567,7 @@ class LimiterMono : public LimiterImpl { public: LimiterMono(int sampleRate) : LimiterImpl(sampleRate) {} - void process(float* input, int16_t* output, int numFrames); + void process(float* input, int16_t* output, int numFrames) override; }; template diff --git a/libraries/audio/src/MixedProcessedAudioStream.h b/libraries/audio/src/MixedProcessedAudioStream.h index 2f9a691278..b2127abcf7 100644 --- a/libraries/audio/src/MixedProcessedAudioStream.h +++ b/libraries/audio/src/MixedProcessedAudioStream.h @@ -22,7 +22,7 @@ public: MixedProcessedAudioStream(int numFrameSamples, int numFramesCapacity, const InboundAudioStream::Settings& settings); signals: - + void addedSilence(int silentSamplesPerChannel); void addedLastFrameRepeatedWithFade(int samplesPerChannel); void addedStereoSamples(const QByteArray& samples); @@ -33,9 +33,9 @@ public: void outputFormatChanged(int outputFormatChannelCountTimesSampleRate); protected: - int writeDroppableSilentSamples(int silentSamples); - int writeLastFrameRepeatedWithFade(int samples); - int parseAudioData(PacketType type, const QByteArray& packetAfterStreamProperties); + int writeDroppableSilentSamples(int silentSamples) override; + int writeLastFrameRepeatedWithFade(int samples) override; + int parseAudioData(PacketType type, const QByteArray& packetAfterStreamProperties) override; private: int networkToDeviceSamples(int networkSamples); diff --git a/libraries/audio/src/PositionalAudioStream.h b/libraries/audio/src/PositionalAudioStream.h index 5b50cfa60e..a330fbdd3f 100644 --- a/libraries/audio/src/PositionalAudioStream.h +++ b/libraries/audio/src/PositionalAudioStream.h @@ -32,9 +32,9 @@ public: const QUuid DEFAULT_STREAM_IDENTIFIER = QUuid(); virtual const QUuid& getStreamIdentifier() const { return DEFAULT_STREAM_IDENTIFIER; } - virtual void resetStats(); + virtual void resetStats() override; - virtual AudioStreamStats getAudioStreamStats() const; + virtual AudioStreamStats getAudioStreamStats() const override; void updateLastPopOutputLoudnessAndTrailingLoudness(); float getLastPopOutputTrailingLoudness() const { return _lastPopOutputTrailingLoudness; } @@ -46,7 +46,7 @@ public: PositionalAudioStream::Type getType() const { return _type; } const glm::vec3& getPosition() const { return _position; } const glm::quat& getOrientation() const { return _orientation; } - + protected: // disallow copying of PositionalAudioStream objects diff --git a/libraries/audio/src/SoundCache.h b/libraries/audio/src/SoundCache.h index 59a25dd847..97d5f659d8 100644 --- a/libraries/audio/src/SoundCache.h +++ b/libraries/audio/src/SoundCache.h @@ -23,12 +23,12 @@ class SoundCache : public ResourceCache, public Dependency { public: Q_INVOKABLE SharedSoundPointer getSound(const QUrl& url); - + protected: virtual QSharedPointer createResource(const QUrl& url, const QSharedPointer& fallback, - const void* extra); + const void* extra) override; private: SoundCache(QObject* parent = NULL); }; -#endif // hifi_SoundCache_h \ No newline at end of file +#endif // hifi_SoundCache_h diff --git a/libraries/controllers/src/controllers/impl/endpoints/JSEndpoint.h b/libraries/controllers/src/controllers/impl/endpoints/JSEndpoint.h index 958914264e..24d5ec93e9 100644 --- a/libraries/controllers/src/controllers/impl/endpoints/JSEndpoint.h +++ b/libraries/controllers/src/controllers/impl/endpoints/JSEndpoint.h @@ -24,11 +24,11 @@ public: : Endpoint(Input::INVALID_INPUT), _callable(callable) { } - virtual float peek() const { + virtual float peek() const override { return (float)const_cast(this)->_callable.call().toNumber(); } - virtual void apply(float newValue, const Pointer& source) { + virtual void apply(float newValue, const Pointer& source) override { _callable.call(QJSValueList({ QJSValue(newValue) })); } diff --git a/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp index c916fcafe2..6904700be5 100644 --- a/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp @@ -305,7 +305,7 @@ void HmdDisplayPlugin::updateFrameData() { { vec2 xdir = glm::normalize(vec2(intersectionPosition.x, -intersectionPosition.z)); yawPitch.x = glm::atan(xdir.x, xdir.y); - yawPitch.y = (acosf(intersectionPosition.y) * -1.0f) + M_PI_2; + yawPitch.y = (acosf(intersectionPosition.y) * -1.0f) + (float)M_PI_2; } vec2 halfFov = CompositorHelper::VIRTUAL_UI_TARGET_FOV / 2.0f; diff --git a/libraries/embedded-webserver/src/HTTPManager.h b/libraries/embedded-webserver/src/HTTPManager.h index c560c43a5e..cb76eed9f2 100644 --- a/libraries/embedded-webserver/src/HTTPManager.h +++ b/libraries/embedded-webserver/src/HTTPManager.h @@ -35,7 +35,7 @@ public: /// Initializes the manager. HTTPManager(const QHostAddress& listenAddress, quint16 port, const QString& documentRoot, HTTPRequestHandler* requestHandler = NULL, QObject* parent = 0); - bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false); + bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler = false) override; private slots: void isTcpServerListening(); @@ -46,7 +46,7 @@ private: protected: /// Accepts all pending connections - virtual void incomingConnection(qintptr socketDescriptor); + virtual void incomingConnection(qintptr socketDescriptor) override; virtual bool requestHandledByRequestHandler(HTTPConnection* connection, const QUrl& url); QHostAddress _listenAddress; diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.h b/libraries/entities-renderer/src/EntityTreeRenderer.h index 99c62ab5f6..5d8db371b8 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.h +++ b/libraries/entities-renderer/src/EntityTreeRenderer.h @@ -44,10 +44,10 @@ public: AbstractScriptingServicesInterface* scriptingServices); virtual ~EntityTreeRenderer(); - virtual char getMyNodeType() const { return NodeType::EntityServer; } - virtual PacketType getMyQueryMessageType() const { return PacketType::EntityQuery; } - virtual PacketType getExpectedPacketType() const { return PacketType::EntityData; } - virtual void setTree(OctreePointer newTree); + virtual char getMyNodeType() const override { return NodeType::EntityServer; } + virtual PacketType getMyQueryMessageType() const override { return PacketType::EntityQuery; } + virtual PacketType getExpectedPacketType() const override { return PacketType::EntityData; } + virtual void setTree(OctreePointer newTree) override; // Returns the priority at which an entity should be loaded. Higher values indicate higher priority. float getEntityLoadingPriority(const EntityItem& item) const { return _calculateEntityLoadingPriorityFunc(item); } @@ -60,29 +60,29 @@ public: void processEraseMessage(ReceivedMessage& message, const SharedNodePointer& sourceNode); - virtual void init(); + virtual void init() override; + + virtual const FBXGeometry* getGeometryForEntity(EntityItemPointer entityItem) override; + virtual ModelPointer getModelForEntityItem(EntityItemPointer entityItem) override; + virtual const FBXGeometry* getCollisionGeometryForEntity(EntityItemPointer entityItem) override; - virtual const FBXGeometry* getGeometryForEntity(EntityItemPointer entityItem); - virtual ModelPointer getModelForEntityItem(EntityItemPointer entityItem); - virtual const FBXGeometry* getCollisionGeometryForEntity(EntityItemPointer entityItem); - /// clears the tree - virtual void clear(); + virtual void clear() override; /// reloads the entity scripts, calling unload and preload void reloadEntityScripts(); /// if a renderable entity item needs a model, we will allocate it for them Q_INVOKABLE ModelPointer allocateModel(const QString& url, const QString& collisionUrl, float loadingPriority = 0.0f); - + /// if a renderable entity item needs to update the URL of a model, we will handle that for the entity Q_INVOKABLE ModelPointer updateModel(ModelPointer original, const QString& newUrl, const QString& collisionUrl); /// if a renderable entity item is done with a model, it should return it to us void releaseModel(ModelPointer model); - + void deleteReleasedModels(); - + // event handles which may generate entity related events void mouseReleaseEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event); @@ -128,7 +128,7 @@ public slots: void setDontDoPrecisionPicking(bool value) { _dontDoPrecisionPicking = value; } protected: - virtual OctreePointer createTree() { + virtual OctreePointer createTree() override { EntityTreePointer newTree = EntityTreePointer(new EntityTree(true)); newTree->createRootElement(); return newTree; @@ -180,7 +180,7 @@ private: AbstractScriptingServicesInterface* _scriptingServices; bool _displayModelBounds; bool _dontDoPrecisionPicking; - + bool _shuttingDown { false }; QMultiMap _waitingOnPreload; @@ -203,7 +203,7 @@ private: float _previousStageAltitude; float _previousStageHour; int _previousStageDay; - + QHash _entitiesInScene; // For Scene.shouldRenderEntities QList _entityIDsLastInScene; diff --git a/libraries/entities/src/AddEntityOperator.h b/libraries/entities/src/AddEntityOperator.h index 6aa2d5f727..0f33cacae3 100644 --- a/libraries/entities/src/AddEntityOperator.h +++ b/libraries/entities/src/AddEntityOperator.h @@ -16,9 +16,9 @@ class AddEntityOperator : public RecurseOctreeOperator { public: AddEntityOperator(EntityTreePointer tree, EntityItemPointer newEntity); - virtual bool preRecursion(OctreeElementPointer element); - virtual bool postRecursion(OctreeElementPointer element); - virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex); + virtual bool preRecursion(OctreeElementPointer element) override; + virtual bool postRecursion(OctreeElementPointer element) override; + virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex) override; private: EntityTreePointer _tree; EntityItemPointer _newEntity; diff --git a/libraries/entities/src/AnimationPropertyGroup.h b/libraries/entities/src/AnimationPropertyGroup.h index 3ee452cc5f..4284be1eda 100644 --- a/libraries/entities/src/AnimationPropertyGroup.h +++ b/libraries/entities/src/AnimationPropertyGroup.h @@ -34,30 +34,33 @@ public: void associateWithAnimationLoop(AnimationLoop* animationLoop) { _animationLoop = animationLoop; } // EntityItemProperty related helpers - virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const; - virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings); - virtual void debugDump() const; - virtual void listChangedProperties(QList& out); + virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, + QScriptEngine* engine, bool skipDefaults, + EntityItemProperties& defaultEntityProperties) const override; + virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override; + virtual void debugDump() const override; + virtual void listChangedProperties(QList& out) override; virtual bool appendToEditPacket(OctreePacketData* packetData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, int& propertyCount, - OctreeElement::AppendState& appendState) const; + OctreeElement::AppendState& appendState) const override; - virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes); - virtual void markAllChanged(); - virtual EntityPropertyFlags getChangedProperties() const; + virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, + const unsigned char*& dataAt, int& processedBytes) override; + virtual void markAllChanged() override; + virtual EntityPropertyFlags getChangedProperties() const override; // EntityItem related helpers // methods for getting/setting all properties of an entity - virtual void getProperties(EntityItemProperties& propertiesOut) const; + virtual void getProperties(EntityItemProperties& propertiesOut) const override; /// returns true if something changed - virtual bool setProperties(const EntityItemProperties& properties); + virtual bool setProperties(const EntityItemProperties& properties) override; - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData, @@ -65,12 +68,12 @@ public: EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, int& propertyCount, - OctreeElement::AppendState& appendState) const; + OctreeElement::AppendState& appendState) const override; virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; DEFINE_PROPERTY_REF(PROP_ANIMATION_URL, URL, url, QString, ""); DEFINE_PROPERTY(PROP_ANIMATION_FPS, FPS, fps, float, 30.0f); diff --git a/libraries/entities/src/DeleteEntityOperator.h b/libraries/entities/src/DeleteEntityOperator.h index ae2ec3621e..245d331743 100644 --- a/libraries/entities/src/DeleteEntityOperator.h +++ b/libraries/entities/src/DeleteEntityOperator.h @@ -36,8 +36,8 @@ public: ~DeleteEntityOperator(); void addEntityIDToDeleteList(const EntityItemID& searchEntityID); - virtual bool preRecursion(OctreeElementPointer element); - virtual bool postRecursion(OctreeElementPointer element); + virtual bool preRecursion(OctreeElementPointer element) override; + virtual bool postRecursion(OctreeElementPointer element) override; const RemovedEntities& getEntities() const { return _entitiesToDelete; } private: diff --git a/libraries/entities/src/EntityEditPacketSender.h b/libraries/entities/src/EntityEditPacketSender.h index 1991142f3f..9150748a68 100644 --- a/libraries/entities/src/EntityEditPacketSender.h +++ b/libraries/entities/src/EntityEditPacketSender.h @@ -42,8 +42,8 @@ public: void queueEraseEntityMessage(const EntityItemID& entityItemID); // My server type is the model server - virtual char getMyNodeType() const { return NodeType::EntityServer; } - virtual void adjustEditPacketForClockSkew(PacketType type, QByteArray& buffer, qint64 clockSkew); + virtual char getMyNodeType() const override { return NodeType::EntityServer; } + virtual void adjustEditPacketForClockSkew(PacketType type, QByteArray& buffer, qint64 clockSkew) override; public slots: void processEntityEditNackPacket(QSharedPointer message, SharedNodePointer sendingNode); diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h index 3677a0bbc8..fd2cf41b77 100644 --- a/libraries/entities/src/EntityItem.h +++ b/libraries/entities/src/EntityItem.h @@ -53,7 +53,7 @@ namespace render { } #define DONT_ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() = 0; -#define ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() { }; +#define ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() override { }; #define debugTime(T, N) qPrintable(QString("%1 [ %2 ago]").arg(T, 16, 10).arg(formatUsecTime(N - T), 15)) #define debugTimeOnly(T) qPrintable(QString("%1").arg(T, 16, 10)) diff --git a/libraries/entities/src/EntityScriptingInterface.h b/libraries/entities/src/EntityScriptingInterface.h index 5aa0f5907e..afc529bc53 100644 --- a/libraries/entities/src/EntityScriptingInterface.h +++ b/libraries/entities/src/EntityScriptingInterface.h @@ -59,15 +59,15 @@ void RayToEntityIntersectionResultFromScriptValue(const QScriptValue& object, Ra /// handles scripting of Entity commands from JS passed to assigned clients class EntityScriptingInterface : public OctreeScriptingInterface, public Dependency { Q_OBJECT - + Q_PROPERTY(float currentAvatarEnergy READ getCurrentAvatarEnergy WRITE setCurrentAvatarEnergy) Q_PROPERTY(float costMultiplier READ getCostMultiplier WRITE setCostMultiplier) public: EntityScriptingInterface(bool bidOnSimulationOwnership); EntityEditPacketSender* getEntityPacketSender() const { return (EntityEditPacketSender*)getPacketSender(); } - virtual NodeType_t getServerNodeType() const { return NodeType::EntityServer; } - virtual OctreeEditPacketSender* createPacketSender() { return new EntityEditPacketSender(); } + virtual NodeType_t getServerNodeType() const override { return NodeType::EntityServer; } + virtual OctreeEditPacketSender* createPacketSender() override { return new EntityEditPacketSender(); } void setEntityTree(EntityTreePointer modelTree); EntityTreePointer getEntityTree() { return _entityTree; } @@ -221,12 +221,12 @@ private: std::recursive_mutex _entitiesScriptEngineLock; EntitiesScriptEngineProvider* _entitiesScriptEngine { nullptr }; - + bool _bidOnSimulationOwnership { false }; float _currentAvatarEnergy = { FLT_MAX }; float getCurrentAvatarEnergy() { return _currentAvatarEnergy; } void setCurrentAvatarEnergy(float energy); - + float costMultiplier = { 0.01f }; float getCostMultiplier(); void setCostMultiplier(float value); diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 848d473321..4cdebc364c 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -1304,8 +1304,8 @@ void EntityTree::debugDumpMap() { class ContentsDimensionOperator : public RecurseOctreeOperator { public: - virtual bool preRecursion(OctreeElementPointer element); - virtual bool postRecursion(OctreeElementPointer element) { return true; } + virtual bool preRecursion(OctreeElementPointer element) override; + virtual bool postRecursion(OctreeElementPointer element) override { return true; } glm::vec3 getDimensions() const { return _contentExtents.size(); } float getLargestDimension() const { return _contentExtents.largestDimension(); } private: @@ -1332,8 +1332,8 @@ float EntityTree::getContentsLargestDimension() { class DebugOperator : public RecurseOctreeOperator { public: - virtual bool preRecursion(OctreeElementPointer element); - virtual bool postRecursion(OctreeElementPointer element) { return true; } + virtual bool preRecursion(OctreeElementPointer element) override; + virtual bool postRecursion(OctreeElementPointer element) override { return true; } }; bool DebugOperator::preRecursion(OctreeElementPointer element) { @@ -1350,8 +1350,8 @@ void EntityTree::dumpTree() { class PruneOperator : public RecurseOctreeOperator { public: - virtual bool preRecursion(OctreeElementPointer element) { return true; } - virtual bool postRecursion(OctreeElementPointer element); + virtual bool preRecursion(OctreeElementPointer element) override { return true; } + virtual bool postRecursion(OctreeElementPointer element) override; }; bool PruneOperator::postRecursion(OctreeElementPointer element) { diff --git a/libraries/entities/src/EntityTreeElement.h b/libraries/entities/src/EntityTreeElement.h index aa05438bde..4875e258da 100644 --- a/libraries/entities/src/EntityTreeElement.h +++ b/libraries/entities/src/EntityTreeElement.h @@ -80,7 +80,7 @@ class EntityTreeElement : public OctreeElement, ReadWriteLockable { EntityTreeElement(unsigned char* octalCode = NULL); - virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL); + virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL) override; public: virtual ~EntityTreeElement(); @@ -93,67 +93,69 @@ public: // methods you can and should override to implement your tree functionality /// Adds a child to the current element. Override this if there is additional child initialization your class needs. - virtual OctreeElementPointer addChildAtIndex(int index); + virtual OctreeElementPointer addChildAtIndex(int index) override; /// Override this to implement LOD averaging on changes to the tree. - virtual void calculateAverageFromChildren(); + virtual void calculateAverageFromChildren() override; /// Override this to implement LOD collapsing and identical child pruning on changes to the tree. - virtual bool collapseChildren(); + virtual bool collapseChildren() override; /// Should this element be considered to have content in it. This will be used in collision and ray casting methods. /// By default we assume that only leaves are actual content, but some octrees may have different semantics. - virtual bool hasContent() const { return hasEntities(); } + virtual bool hasContent() const override { return hasEntities(); } /// Should this element be considered to have detailed content in it. Specifically should it be rendered. /// By default we assume that only leaves have detailed content, but some octrees may have different semantics. - virtual bool hasDetailedContent() const { return hasEntities(); } + virtual bool hasDetailedContent() const override { return hasEntities(); } /// Override this to break up large octree elements when an edit operation is performed on a smaller octree element. /// For example, if the octrees represent solid cubes and a delete of a smaller octree element is done then the /// meaningful split would be to break the larger cube into smaller cubes of the same color/texture. - virtual void splitChildren() { } + virtual void splitChildren() override { } /// Override to indicate that this element requires a split before editing lower elements in the octree - virtual bool requiresSplit() const { return false; } + virtual bool requiresSplit() const override { return false; } - virtual void debugExtraEncodeData(EncodeBitstreamParams& params) const; - virtual void initializeExtraEncodeData(EncodeBitstreamParams& params); - virtual bool shouldIncludeChildData(int childIndex, EncodeBitstreamParams& params) const; - virtual bool shouldRecurseChildTree(int childIndex, EncodeBitstreamParams& params) const; - virtual void updateEncodedData(int childIndex, AppendState childAppendState, EncodeBitstreamParams& params) const; - virtual void elementEncodeComplete(EncodeBitstreamParams& params) const; + virtual void debugExtraEncodeData(EncodeBitstreamParams& params) const override; + virtual void initializeExtraEncodeData(EncodeBitstreamParams& params) override; + virtual bool shouldIncludeChildData(int childIndex, EncodeBitstreamParams& params) const override; + virtual bool shouldRecurseChildTree(int childIndex, EncodeBitstreamParams& params) const override; + virtual void updateEncodedData(int childIndex, AppendState childAppendState, EncodeBitstreamParams& params) const override; + virtual void elementEncodeComplete(EncodeBitstreamParams& params) const override; bool alreadyFullyEncoded(EncodeBitstreamParams& params) const; /// Override to serialize the state of this element. This is used for persistance and for transmission across the network. - virtual OctreeElement::AppendState appendElementData(OctreePacketData* packetData, EncodeBitstreamParams& params) const; + virtual OctreeElement::AppendState appendElementData(OctreePacketData* packetData, + EncodeBitstreamParams& params) const override; /// Override to deserialize the state of this element. This is used for loading from a persisted file or from reading /// from the network. - virtual int readElementDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args); + virtual int readElementDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + ReadBitstreamToTreeParams& args) override; /// Override to indicate that the item is currently rendered in the rendering engine. By default we assume that if /// the element should be rendered, then your rendering engine is rendering. But some rendering engines my have cases /// where an element is not actually rendering all should render elements. If the isRendered() state doesn't match the /// shouldRender() state, the tree will remark elements as changed even in cases there the elements have not changed. - virtual bool isRendered() const { return getShouldRender(); } - virtual bool deleteApproved() const { return !hasEntities(); } + virtual bool isRendered() const override { return getShouldRender(); } + virtual bool deleteApproved() const override { return !hasEntities(); } - virtual bool canRayIntersect() const { return hasEntities(); } + virtual bool canRayIntersect() const override { return hasEntities(); } virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, bool& keepSearching, OctreeElementPointer& node, float& distance, - BoxFace& face, glm::vec3& surfaceNormal, const QVector& entityIdsToInclude, + BoxFace& face, glm::vec3& surfaceNormal, const QVector& entityIdsToInclude, const QVector& entityIdsToDiscard, void** intersectedObject = NULL, bool precisionPicking = false); virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, - bool& keepSearching, OctreeElementPointer& element, float& distance, + bool& keepSearching, OctreeElementPointer& element, float& distance, BoxFace& face, glm::vec3& surfaceNormal, const QVector& entityIdsToInclude, const QVector& entityIdsToDiscard, void** intersectedObject, bool precisionPicking, float distanceToElementCube); virtual bool findSpherePenetration(const glm::vec3& center, float radius, - glm::vec3& penetration, void** penetratedObject) const; + glm::vec3& penetration, void** penetratedObject) const override; template @@ -232,7 +234,7 @@ public: } protected: - virtual void init(unsigned char * octalCode); + virtual void init(unsigned char * octalCode) override; EntityTreePointer _myTree; EntityItems _entityItems; }; diff --git a/libraries/entities/src/EntityTreeHeadlessViewer.h b/libraries/entities/src/EntityTreeHeadlessViewer.h index 0e0d4f9726..fe05323a0b 100644 --- a/libraries/entities/src/EntityTreeHeadlessViewer.h +++ b/libraries/entities/src/EntityTreeHeadlessViewer.h @@ -30,9 +30,9 @@ public: EntityTreeHeadlessViewer(); virtual ~EntityTreeHeadlessViewer(); - virtual char getMyNodeType() const { return NodeType::EntityServer; } - virtual PacketType getMyQueryMessageType() const { return PacketType::EntityQuery; } - virtual PacketType getExpectedPacketType() const { return PacketType::EntityData; } + virtual char getMyNodeType() const override { return NodeType::EntityServer; } + virtual PacketType getMyQueryMessageType() const override { return PacketType::EntityQuery; } + virtual PacketType getExpectedPacketType() const override { return PacketType::EntityData; } void update(); @@ -40,10 +40,10 @@ public: void processEraseMessage(ReceivedMessage& message, const SharedNodePointer& sourceNode); - virtual void init(); + virtual void init() override; protected: - virtual OctreePointer createTree() { + virtual OctreePointer createTree() override { EntityTreePointer newTree = EntityTreePointer(new EntityTree(true)); newTree->createRootElement(); return newTree; diff --git a/libraries/entities/src/KeyLightPropertyGroup.h b/libraries/entities/src/KeyLightPropertyGroup.h index b905a5a997..029a257bf1 100644 --- a/libraries/entities/src/KeyLightPropertyGroup.h +++ b/libraries/entities/src/KeyLightPropertyGroup.h @@ -30,57 +30,57 @@ class ReadBitstreamToTreeParams; class KeyLightPropertyGroup : public PropertyGroup { public: // EntityItemProperty related helpers - virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const; - virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings); - virtual void debugDump() const; - virtual void listChangedProperties(QList& out); + virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, + QScriptEngine* engine, bool skipDefaults, + EntityItemProperties& defaultEntityProperties) const override; + virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override; + virtual void debugDump() const override; + virtual void listChangedProperties(QList& out) override; - virtual bool appendToEditPacket(OctreePacketData* packetData, + virtual bool appendToEditPacket(OctreePacketData* packetData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes); - virtual void markAllChanged(); - virtual EntityPropertyFlags getChangedProperties() const; + virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, + const unsigned char*& dataAt, int& processedBytes) override; + virtual void markAllChanged() override; + virtual EntityPropertyFlags getChangedProperties() const override; // EntityItem related helpers // methods for getting/setting all properties of an entity - virtual void getProperties(EntityItemProperties& propertiesOut) const; - - /// returns true if something changed - virtual bool setProperties(const EntityItemProperties& properties); + virtual void getProperties(EntityItemProperties& propertiesOut) const override; - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; - - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + /// returns true if something changed + virtual bool setProperties(const EntityItemProperties& properties) override; + + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; + + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); - + bool& somethingChanged) override; + static const xColor DEFAULT_KEYLIGHT_COLOR; static const float DEFAULT_KEYLIGHT_INTENSITY; static const float DEFAULT_KEYLIGHT_AMBIENT_INTENSITY; static const glm::vec3 DEFAULT_KEYLIGHT_DIRECTION; - + DEFINE_PROPERTY_REF(PROP_KEYLIGHT_COLOR, Color, color, xColor, DEFAULT_KEYLIGHT_COLOR); DEFINE_PROPERTY(PROP_KEYLIGHT_INTENSITY, Intensity, intensity, float, DEFAULT_KEYLIGHT_INTENSITY); DEFINE_PROPERTY(PROP_KEYLIGHT_AMBIENT_INTENSITY, AmbientIntensity, ambientIntensity, float, DEFAULT_KEYLIGHT_AMBIENT_INTENSITY); DEFINE_PROPERTY_REF(PROP_KEYLIGHT_DIRECTION, Direction, direction, glm::vec3, DEFAULT_KEYLIGHT_DIRECTION); DEFINE_PROPERTY_REF(PROP_KEYLIGHT_AMBIENT_URL, AmbientURL, ambientURL, QString, ""); - -protected: - }; #endif // hifi_KeyLightPropertyGroup_h diff --git a/libraries/entities/src/LightEntityItem.h b/libraries/entities/src/LightEntityItem.h index 4c84d3204c..31ef012f6a 100644 --- a/libraries/entities/src/LightEntityItem.h +++ b/libraries/entities/src/LightEntityItem.h @@ -25,30 +25,30 @@ public: static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); LightEntityItem(const EntityItemID& entityItemID); - + ALLOW_INSTANTIATION // This class can be instantiated /// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately - virtual void setDimensions(const glm::vec3& value); - + virtual void setDimensions(const glm::vec3& value) override; + // methods for getting/setting all properties of an entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; const rgbColor& getColor() const { return _color; } xColor getXColor() const { diff --git a/libraries/entities/src/LineEntityItem.h b/libraries/entities/src/LineEntityItem.h index 6a5ef20bac..575d987605 100644 --- a/libraries/entities/src/LineEntityItem.h +++ b/libraries/entities/src/LineEntityItem.h @@ -12,35 +12,35 @@ #ifndef hifi_LineEntityItem_h #define hifi_LineEntityItem_h -#include "EntityItem.h" +#include "EntityItem.h" class LineEntityItem : public EntityItem { public: static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); LineEntityItem(const EntityItemID& entityItemID); - + ALLOW_INSTANTIATION // This class can be instantiated - + // methods for getting/setting all properties of an entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; // TODO: eventually only include properties changed since the params.lastViewFrustumSent time - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; const rgbColor& getColor() const { return _color; } xColor getXColor() const { xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color; } @@ -51,25 +51,26 @@ class LineEntityItem : public EntityItem { _color[GREEN_INDEX] = value.green; _color[BLUE_INDEX] = value.blue; } - + void setLineWidth(float lineWidth){ _lineWidth = lineWidth; } float getLineWidth() const{ return _lineWidth; } - + bool setLinePoints(const QVector& points); bool appendPoint(const glm::vec3& point); - + const QVector& getLinePoints() const{ return _points; } - - virtual ShapeType getShapeType() const { return SHAPE_TYPE_NONE; } + + virtual ShapeType getShapeType() const override { return SHAPE_TYPE_NONE; } // never have a ray intersection pick a LineEntityItem. - virtual bool supportsDetailedRayIntersection() const { return true; } + virtual bool supportsDetailedRayIntersection() const override { return true; } virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, - bool& keepSearching, OctreeElementPointer& element, float& distance, - BoxFace& face, glm::vec3& surfaceNormal, - void** intersectedObject, bool precisionPicking) const { return false; } + bool& keepSearching, OctreeElementPointer& element, float& distance, + BoxFace& face, glm::vec3& surfaceNormal, + void** intersectedObject, + bool precisionPicking) const override { return false; } - virtual void debugDump() const; + virtual void debugDump() const override; static const float DEFAULT_LINE_WIDTH; static const int MAX_POINTS_PER_LINE; diff --git a/libraries/entities/src/ModelEntityItem.h b/libraries/entities/src/ModelEntityItem.h index 7b7edaf945..6f2a0e1b31 100644 --- a/libraries/entities/src/ModelEntityItem.h +++ b/libraries/entities/src/ModelEntityItem.h @@ -26,11 +26,11 @@ public: ALLOW_INSTANTIATION // This class can be instantiated // methods for getting/setting all properties of an entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; // TODO: eventually only include properties changed since the params.lastViewFrustumSent time - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData, @@ -38,20 +38,20 @@ public: EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, int& propertyCount, - OctreeElement::AppendState& appendState) const; + OctreeElement::AppendState& appendState) const override; virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; - virtual void update(const quint64& now); - virtual bool needsToCallUpdate() const; - virtual void debugDump() const; + virtual void update(const quint64& now) override; + virtual bool needsToCallUpdate() const override; + virtual void debugDump() const override; - void setShapeType(ShapeType type); - virtual ShapeType getShapeType() const; + void setShapeType(ShapeType type) override; + virtual ShapeType getShapeType() const override; // TODO: Move these to subclasses, or other appropriate abstraction @@ -115,7 +115,7 @@ public: const QString getTextures() const; void setTextures(const QString& textures); - virtual bool shouldBePhysical() const; + virtual bool shouldBePhysical() const override; virtual glm::vec3 getJointPosition(int jointIndex) const { return glm::vec3(); } virtual glm::quat getJointRotation(int jointIndex) const { return glm::quat(); } diff --git a/libraries/entities/src/MovingEntitiesOperator.h b/libraries/entities/src/MovingEntitiesOperator.h index 5d16c41543..27ecb340a8 100644 --- a/libraries/entities/src/MovingEntitiesOperator.h +++ b/libraries/entities/src/MovingEntitiesOperator.h @@ -38,9 +38,9 @@ public: ~MovingEntitiesOperator(); void addEntityToMoveList(EntityItemPointer entity, const AACube& newCube); - virtual bool preRecursion(OctreeElementPointer element); - virtual bool postRecursion(OctreeElementPointer element); - virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex); + virtual bool preRecursion(OctreeElementPointer element) override; + virtual bool postRecursion(OctreeElementPointer element) override; + virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex) override; bool hasMovingEntities() const { return _entitiesToMove.size() > 0; } private: EntityTreePointer _tree; diff --git a/libraries/entities/src/ParticleEffectEntityItem.h b/libraries/entities/src/ParticleEffectEntityItem.h index 9ddda62c8b..36bc5e6247 100644 --- a/libraries/entities/src/ParticleEffectEntityItem.h +++ b/libraries/entities/src/ParticleEffectEntityItem.h @@ -26,10 +26,10 @@ public: ParticleEffectEntityItem(const EntityItemID& entityItemID); // methods for getting/setting all properties of this entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData, @@ -37,15 +37,15 @@ public: EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, int& propertyCount, - OctreeElement::AppendState& appendState) const; + OctreeElement::AppendState& appendState) const override; virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; - virtual void update(const quint64& now); - virtual bool needsToCallUpdate() const; + virtual void update(const quint64& now) override; + virtual bool needsToCallUpdate() const override; const rgbColor& getColor() const { return _color; } xColor getXColor() const { xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color; } @@ -95,10 +95,10 @@ public: void setAlphaSpread(float alphaSpread); float getAlphaSpread() const { return _alphaSpread; } - void setShapeType(ShapeType type); - virtual ShapeType getShapeType() const { return _shapeType; } + void setShapeType(ShapeType type) override; + virtual ShapeType getShapeType() const override { return _shapeType; } - virtual void debugDump() const; + virtual void debugDump() const override; bool isEmittingParticles() const; /// emitting enabled, and there are particles alive bool getIsEmitting() const { return _isEmitting; } @@ -219,7 +219,7 @@ public: _emitterShouldTrail = emitterShouldTrail; } - virtual bool supportsDetailedRayIntersection() const { return false; } + virtual bool supportsDetailedRayIntersection() const override { return false; } protected: struct Particle; diff --git a/libraries/entities/src/PolyLineEntityItem.h b/libraries/entities/src/PolyLineEntityItem.h index 3231e7c5e1..95522fe57f 100644 --- a/libraries/entities/src/PolyLineEntityItem.h +++ b/libraries/entities/src/PolyLineEntityItem.h @@ -12,35 +12,35 @@ #ifndef hifi_PolyLineEntityItem_h #define hifi_PolyLineEntityItem_h -#include "EntityItem.h" +#include "EntityItem.h" class PolyLineEntityItem : public EntityItem { public: static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); PolyLineEntityItem(const EntityItemID& entityItemID); - + ALLOW_INSTANTIATION // This class can be instantiated - + // methods for getting/setting all properties of an entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; // TODO: eventually only include properties changed since the params.lastViewFrustumSent time - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; const rgbColor& getColor() const { return _color; } xColor getXColor() const { xColor color = { _color[RED_INDEX], _color[GREEN_INDEX], _color[BLUE_INDEX] }; return color; } @@ -49,22 +49,21 @@ class PolyLineEntityItem : public EntityItem { memcpy(_color, value, sizeof(_color)); } void setColor(const xColor& value) { - _color[RED_INDEX] = value.red; _color[GREEN_INDEX] = value.green; _color[BLUE_INDEX] = value.blue; } - + void setLineWidth(float lineWidth){ _lineWidth = lineWidth; } float getLineWidth() const{ return _lineWidth; } - + bool setLinePoints(const QVector& points); bool appendPoint(const glm::vec3& point); const QVector& getLinePoints() const{ return _points; } - + bool setNormals(const QVector& normals); const QVector& getNormals() const{ return _normals; } - + bool setStrokeWidths(const QVector& strokeWidths); const QVector& getStrokeWidths() const{ return _strokeWidths; } @@ -76,18 +75,18 @@ class PolyLineEntityItem : public EntityItem { } } - virtual bool needsToCallUpdate() const { return true; } + virtual bool needsToCallUpdate() const override { return true; } - virtual ShapeType getShapeType() const { return SHAPE_TYPE_NONE; } + virtual ShapeType getShapeType() const override { return SHAPE_TYPE_NONE; } // never have a ray intersection pick a PolyLineEntityItem. - virtual bool supportsDetailedRayIntersection() const { return true; } + virtual bool supportsDetailedRayIntersection() const override { return true; } virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, - bool& keepSearching, OctreeElementPointer& element, float& distance, - BoxFace& face, glm::vec3& surfaceNormal, - void** intersectedObject, bool precisionPicking) const { return false;} + bool& keepSearching, OctreeElementPointer& element, float& distance, + BoxFace& face, glm::vec3& surfaceNormal, + void** intersectedObject, bool precisionPicking) const override { return false; } - virtual void debugDump() const; + virtual void debugDump() const override; static const float DEFAULT_LINE_WIDTH; static const int MAX_POINTS_PER_LINE; diff --git a/libraries/entities/src/PolyVoxEntityItem.h b/libraries/entities/src/PolyVoxEntityItem.h index 7441b34c9c..b2d64b60b1 100644 --- a/libraries/entities/src/PolyVoxEntityItem.h +++ b/libraries/entities/src/PolyVoxEntityItem.h @@ -23,11 +23,11 @@ class PolyVoxEntityItem : public EntityItem { ALLOW_INSTANTIATION // This class can be instantiated // methods for getting/setting all properties of an entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; // TODO: eventually only include properties changed since the params.lastViewFrustumSent time - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData, @@ -35,21 +35,21 @@ class PolyVoxEntityItem : public EntityItem { EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, int& propertyCount, - OctreeElement::AppendState& appendState) const; + OctreeElement::AppendState& appendState) const override; virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; // never have a ray intersection pick a PolyVoxEntityItem. - virtual bool supportsDetailedRayIntersection() const { return true; } + virtual bool supportsDetailedRayIntersection() const override { return true; } virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, - bool& keepSearching, OctreeElementPointer& element, float& distance, - BoxFace& face, glm::vec3& surfaceNormal, - void** intersectedObject, bool precisionPicking) const { return false; } + bool& keepSearching, OctreeElementPointer& element, float& distance, + BoxFace& face, glm::vec3& surfaceNormal, + void** intersectedObject, bool precisionPicking) const override { return false; } - virtual void debugDump() const; + virtual void debugDump() const override; virtual void setVoxelVolumeSize(glm::vec3 voxelVolumeSize); virtual glm::vec3 getVoxelVolumeSize() const; diff --git a/libraries/entities/src/PropertyGroup.h b/libraries/entities/src/PropertyGroup.h index 138ee020c1..d2d48c4cd0 100644 --- a/libraries/entities/src/PropertyGroup.h +++ b/libraries/entities/src/PropertyGroup.h @@ -63,7 +63,7 @@ public: EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, + int& propertyCount, OctreeElement::AppendState& appendState) const = 0; virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes) = 0; diff --git a/libraries/entities/src/RecurseOctreeToMapOperator.h b/libraries/entities/src/RecurseOctreeToMapOperator.h index c64cf91b61..dbf8dbd15b 100644 --- a/libraries/entities/src/RecurseOctreeToMapOperator.h +++ b/libraries/entities/src/RecurseOctreeToMapOperator.h @@ -15,8 +15,8 @@ class RecurseOctreeToMapOperator : public RecurseOctreeOperator { public: RecurseOctreeToMapOperator(QVariantMap& map, OctreeElementPointer top, QScriptEngine* engine, bool skipDefaultValues, bool skipThoseWithBadParents); - bool preRecursion(OctreeElementPointer element); - bool postRecursion(OctreeElementPointer element); + bool preRecursion(OctreeElementPointer element) override; + bool postRecursion(OctreeElementPointer element) override; private: QVariantMap& _map; OctreeElementPointer _top; diff --git a/libraries/entities/src/SkyboxPropertyGroup.h b/libraries/entities/src/SkyboxPropertyGroup.h index 745f762821..8b485353b8 100644 --- a/libraries/entities/src/SkyboxPropertyGroup.h +++ b/libraries/entities/src/SkyboxPropertyGroup.h @@ -30,44 +30,47 @@ class ReadBitstreamToTreeParams; class SkyboxPropertyGroup : public PropertyGroup { public: // EntityItemProperty related helpers - virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const; - virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings); - virtual void debugDump() const; - virtual void listChangedProperties(QList& out); + virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, + QScriptEngine* engine, bool skipDefaults, + EntityItemProperties& defaultEntityProperties) const override; + virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override; + virtual void debugDump() const override; + virtual void listChangedProperties(QList& out) override; virtual bool appendToEditPacket(OctreePacketData* packetData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes); - virtual void markAllChanged(); - virtual EntityPropertyFlags getChangedProperties() const; + virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, + const unsigned char*& dataAt, int& processedBytes) override; + virtual void markAllChanged() override; + virtual EntityPropertyFlags getChangedProperties() const override; // EntityItem related helpers // methods for getting/setting all properties of an entity - virtual void getProperties(EntityItemProperties& propertiesOut) const; - - /// returns true if something changed - virtual bool setProperties(const EntityItemProperties& properties); + virtual void getProperties(EntityItemProperties& propertiesOut) const override; - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; - - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + /// returns true if something changed + virtual bool setProperties(const EntityItemProperties& properties) override; + + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; + + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); - + bool& somethingChanged) override; + glm::vec3 getColorVec3() const { const quint8 MAX_COLOR = 255; glm::vec3 color = { (float)_color.red / (float)MAX_COLOR, diff --git a/libraries/entities/src/StagePropertyGroup.h b/libraries/entities/src/StagePropertyGroup.h index c25a1e629e..80f02f851a 100644 --- a/libraries/entities/src/StagePropertyGroup.h +++ b/libraries/entities/src/StagePropertyGroup.h @@ -30,54 +30,57 @@ class ReadBitstreamToTreeParams; class StagePropertyGroup : public PropertyGroup { public: // EntityItemProperty related helpers - virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const; - virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings); - virtual void debugDump() const; - virtual void listChangedProperties(QList& out); + virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, + QScriptEngine* engine, bool skipDefaults, + EntityItemProperties& defaultEntityProperties) const override; + virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override; + virtual void debugDump() const override; + virtual void listChangedProperties(QList& out) override; virtual bool appendToEditPacket(OctreePacketData* packetData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, const unsigned char*& dataAt , int& processedBytes); - virtual void markAllChanged(); - virtual EntityPropertyFlags getChangedProperties() const; + virtual bool decodeFromEditPacket(EntityPropertyFlags& propertyFlags, + const unsigned char*& dataAt, int& processedBytes) override; + virtual void markAllChanged() override; + virtual EntityPropertyFlags getChangedProperties() const override; // EntityItem related helpers // methods for getting/setting all properties of an entity - virtual void getProperties(EntityItemProperties& propertiesOut) const; - - /// returns true if something changed - virtual bool setProperties(const EntityItemProperties& properties); + virtual void getProperties(EntityItemProperties& propertiesOut) const override; - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; - - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + /// returns true if something changed + virtual bool setProperties(const EntityItemProperties& properties) override; + + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; + + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); - + bool& somethingChanged) override; + static const bool DEFAULT_STAGE_SUN_MODEL_ENABLED; static const float DEFAULT_STAGE_LATITUDE; static const float DEFAULT_STAGE_LONGITUDE; static const float DEFAULT_STAGE_ALTITUDE; static const quint16 DEFAULT_STAGE_DAY; static const float DEFAULT_STAGE_HOUR; - + float calculateHour() const; uint16_t calculateDay() const; - + DEFINE_PROPERTY(PROP_STAGE_SUN_MODEL_ENABLED, SunModelEnabled, sunModelEnabled, bool, DEFAULT_STAGE_SUN_MODEL_ENABLED); DEFINE_PROPERTY(PROP_STAGE_LATITUDE, Latitude, latitude, float, DEFAULT_STAGE_LATITUDE); DEFINE_PROPERTY(PROP_STAGE_LONGITUDE, Longitude, longitude, float, DEFAULT_STAGE_LONGITUDE); diff --git a/libraries/entities/src/TextEntityItem.h b/libraries/entities/src/TextEntityItem.h index 1caceee085..65d3d8bb21 100644 --- a/libraries/entities/src/TextEntityItem.h +++ b/libraries/entities/src/TextEntityItem.h @@ -12,45 +12,45 @@ #ifndef hifi_TextEntityItem_h #define hifi_TextEntityItem_h -#include "EntityItem.h" +#include "EntityItem.h" class TextEntityItem : public EntityItem { public: static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); TextEntityItem(const EntityItemID& entityItemID); - + ALLOW_INSTANTIATION // This class can be instantiated /// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately - virtual void setDimensions(const glm::vec3& value); - virtual ShapeType getShapeType() const { return SHAPE_TYPE_BOX; } - + virtual void setDimensions(const glm::vec3& value) override; + virtual ShapeType getShapeType() const override { return SHAPE_TYPE_BOX; } + // methods for getting/setting all properties of an entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; // TODO: eventually only include properties changed since the params.lastViewFrustumSent time - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; - virtual bool supportsDetailedRayIntersection() const { return true; } + virtual bool supportsDetailedRayIntersection() const override { return true; } virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, - bool& keepSearching, OctreeElementPointer& element, float& distance, + bool& keepSearching, OctreeElementPointer& element, float& distance, BoxFace& face, glm::vec3& surfaceNormal, - void** intersectedObject, bool precisionPicking) const; + void** intersectedObject, bool precisionPicking) const override; static const QString DEFAULT_TEXT; void setText(const QString& value) { _text = value; } @@ -81,7 +81,7 @@ public: _backgroundColor[GREEN_INDEX] = value.green; _backgroundColor[BLUE_INDEX] = value.blue; } - + static const bool DEFAULT_FACE_CAMERA; bool getFaceCamera() const { return _faceCamera; } void setFaceCamera(bool value) { _faceCamera = value; } diff --git a/libraries/entities/src/UpdateEntityOperator.h b/libraries/entities/src/UpdateEntityOperator.h index 8b5bbdf135..b33d6c6c3b 100644 --- a/libraries/entities/src/UpdateEntityOperator.h +++ b/libraries/entities/src/UpdateEntityOperator.h @@ -25,9 +25,9 @@ public: ~UpdateEntityOperator(); - virtual bool preRecursion(OctreeElementPointer element); - virtual bool postRecursion(OctreeElementPointer element); - virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex); + virtual bool preRecursion(OctreeElementPointer element) override; + virtual bool postRecursion(OctreeElementPointer element) override; + virtual OctreeElementPointer possiblyCreateChildAt(OctreeElementPointer element, int childIndex) override; private: EntityTreePointer _tree; EntityItemPointer _existingEntity; diff --git a/libraries/entities/src/WebEntityItem.h b/libraries/entities/src/WebEntityItem.h index 8e9d924cde..7c4e9f801a 100644 --- a/libraries/entities/src/WebEntityItem.h +++ b/libraries/entities/src/WebEntityItem.h @@ -9,7 +9,7 @@ #ifndef hifi_WebEntityItem_h #define hifi_WebEntityItem_h -#include "EntityItem.h" +#include "EntityItem.h" class WebEntityItem : public EntityItem { public: @@ -18,38 +18,38 @@ public: static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); WebEntityItem(const EntityItemID& entityItemID); - + ALLOW_INSTANTIATION // This class can be instantiated /// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately - virtual void setDimensions(const glm::vec3& value); - virtual ShapeType getShapeType() const { return SHAPE_TYPE_BOX; } - + virtual void setDimensions(const glm::vec3& value) override; + virtual ShapeType getShapeType() const override { return SHAPE_TYPE_BOX; } + // methods for getting/setting all properties of an entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; // TODO: eventually only include properties changed since the params.lastViewFrustumSent time - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; - virtual bool supportsDetailedRayIntersection() const { return true; } + virtual bool supportsDetailedRayIntersection() const override { return true; } virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, bool& keepSearching, OctreeElementPointer& element, float& distance, BoxFace& face, glm::vec3& surfaceNormal, - void** intersectedObject, bool precisionPicking) const; + void** intersectedObject, bool precisionPicking) const override; virtual void setSourceUrl(const QString& value); const QString& getSourceUrl() const; diff --git a/libraries/entities/src/ZoneEntityItem.h b/libraries/entities/src/ZoneEntityItem.h index f0f2a91d63..cad8a3baac 100644 --- a/libraries/entities/src/ZoneEntityItem.h +++ b/libraries/entities/src/ZoneEntityItem.h @@ -23,28 +23,28 @@ public: static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties); ZoneEntityItem(const EntityItemID& entityItemID); - + ALLOW_INSTANTIATION // This class can be instantiated - + // methods for getting/setting all properties of an entity - virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const; - virtual bool setProperties(const EntityItemProperties& properties); + virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override; + virtual bool setProperties(const EntityItemProperties& properties) override; // TODO: eventually only include properties changed since the params.lastViewFrustumSent time - virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const; + virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override; - virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, + virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params, EntityTreeElementExtraEncodeData* modelTreeElementExtraEncodeData, EntityPropertyFlags& requestedProperties, EntityPropertyFlags& propertyFlags, EntityPropertyFlags& propertiesDidntFit, - int& propertyCount, - OctreeElement::AppendState& appendState) const; + int& propertyCount, + OctreeElement::AppendState& appendState) const override; - virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, + virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args, EntityPropertyFlags& propertyFlags, bool overwriteLocalData, - bool& somethingChanged); + bool& somethingChanged) override; @@ -53,11 +53,11 @@ public: static bool getDrawZoneBoundaries() { return _drawZoneBoundaries; } static void setDrawZoneBoundaries(bool value) { _drawZoneBoundaries = value; } - - virtual bool isReadyToComputeShape() { return false; } - void setShapeType(ShapeType type) { _shapeType = type; } - virtual ShapeType getShapeType() const; - + + virtual bool isReadyToComputeShape() override { return false; } + void setShapeType(ShapeType type) override { _shapeType = type; } + virtual ShapeType getShapeType() const override; + virtual bool hasCompoundShapeURL() const { return !_compoundShapeURL.isEmpty(); } const QString getCompoundShapeURL() const { return _compoundShapeURL; } virtual void setCompoundShapeURL(const QString& url); @@ -75,13 +75,13 @@ public: bool getGhostingAllowed() const { return _ghostingAllowed; } void setGhostingAllowed(bool value) { _ghostingAllowed = value; } - virtual bool supportsDetailedRayIntersection() const { return true; } + virtual bool supportsDetailedRayIntersection() const override { return true; } virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, bool& keepSearching, OctreeElementPointer& element, float& distance, BoxFace& face, glm::vec3& surfaceNormal, - void** intersectedObject, bool precisionPicking) const; + void** intersectedObject, bool precisionPicking) const override; - virtual void debugDump() const; + virtual void debugDump() const override; static const ShapeType DEFAULT_SHAPE_TYPE; static const QString DEFAULT_COMPOUND_SHAPE_URL; diff --git a/libraries/gl/src/gl/OffscreenQmlSurface.cpp b/libraries/gl/src/gl/OffscreenQmlSurface.cpp index d813e002c7..0470766eb9 100644 --- a/libraries/gl/src/gl/OffscreenQmlSurface.cpp +++ b/libraries/gl/src/gl/OffscreenQmlSurface.cpp @@ -65,7 +65,7 @@ protected: class QmlNetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory { public: - QNetworkAccessManager* create(QObject* parent); + QNetworkAccessManager* create(QObject* parent) override; }; QNetworkAccessManager* QmlNetworkAccessManagerFactory::create(QObject* parent) { diff --git a/libraries/gl/src/gl/OglplusHelpers.h b/libraries/gl/src/gl/OglplusHelpers.h index c453fbad28..2ed5f7b14b 100644 --- a/libraries/gl/src/gl/OglplusHelpers.h +++ b/libraries/gl/src/gl/OglplusHelpers.h @@ -33,6 +33,11 @@ #pragma clang diagnostic ignored "-Wpessimizing-move" #endif +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif + #include #include @@ -42,6 +47,10 @@ #include #include +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #ifdef _WIN32 #pragma warning(pop) #elif defined(Q_OS_MAC) diff --git a/libraries/gpu-gl/src/gpu/gl/GLBackend.h b/libraries/gpu-gl/src/gpu/gl/GLBackend.h index 080c05829f..bc348e3c3f 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLBackend.h +++ b/libraries/gpu-gl/src/gpu/gl/GLBackend.h @@ -46,17 +46,18 @@ public: ~GLBackend(); void setCameraCorrection(const Mat4& correction); - void render(const Batch& batch) final; + void render(const Batch& batch) final override; // This call synchronize the Full Backend cache with the current GLState // THis is only intended to be used when mixing raw gl calls with the gpu api usage in order to sync // the gpu::Backend state with the true gl state which has probably been messed up by these ugly naked gl calls // Let's try to avoid to do that as much as possible! - void syncCache() final; + void syncCache() final override; // This is the ugly "download the pixels to sysmem for taking a snapshot" // Just avoid using it, it's ugly and will break performances - virtual void downloadFramebuffer(const FramebufferPointer& srcFramebuffer, const Vec4i& region, QImage& destImage) final; + virtual void downloadFramebuffer(const FramebufferPointer& srcFramebuffer, + const Vec4i& region, QImage& destImage) final override; static const int MAX_NUM_ATTRIBUTES = Stream::NUM_INPUT_SLOTS; diff --git a/libraries/gpu-gl/src/gpu/gl/GLState.cpp b/libraries/gpu-gl/src/gpu/gl/GLState.cpp index 8cb2efa7b4..6d81eb7371 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLState.cpp +++ b/libraries/gpu-gl/src/gpu/gl/GLState.cpp @@ -5,7 +5,19 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsuggest-override" +#endif + #include "GLState.h" + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + + #include "GLBackend.h" using namespace gpu; diff --git a/libraries/gpu/src/gpu/Buffer.h b/libraries/gpu/src/gpu/Buffer.h index da1a987bee..d2f52180c5 100644 --- a/libraries/gpu/src/gpu/Buffer.h +++ b/libraries/gpu/src/gpu/Buffer.h @@ -58,7 +58,7 @@ public: ~Buffer(); // The size in bytes of data stored in the buffer - Size getSize() const; + Size getSize() const override; template Size getTypedSize() const { return getSize() / sizeof(T); }; diff --git a/libraries/gpu/src/gpu/Texture.h b/libraries/gpu/src/gpu/Texture.h index 8f075d906b..a7ac472922 100755 --- a/libraries/gpu/src/gpu/Texture.h +++ b/libraries/gpu/src/gpu/Texture.h @@ -294,7 +294,7 @@ public: Stamp getDataStamp() const { return _storage->getStamp(); } // The theoretical size in bytes of data stored in the texture - Size getSize() const { return _size; } + Size getSize() const override { return _size; } // The actual size in bytes of data stored in the texture Size getStoredSize() const; diff --git a/libraries/model-networking/src/model-networking/ModelCache.h b/libraries/model-networking/src/model-networking/ModelCache.h index 962a919d6c..5c1aafdd45 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.h +++ b/libraries/model-networking/src/model-networking/ModelCache.h @@ -140,7 +140,7 @@ protected: friend class GeometryMappingResource; virtual QSharedPointer createResource(const QUrl& url, const QSharedPointer& fallback, - const void* extra); + const void* extra) override; private: ModelCache(); diff --git a/libraries/model-networking/src/model-networking/TextureCache.cpp b/libraries/model-networking/src/model-networking/TextureCache.cpp index e10be30f54..1cc00bb850 100644 --- a/libraries/model-networking/src/model-networking/TextureCache.cpp +++ b/libraries/model-networking/src/model-networking/TextureCache.cpp @@ -282,7 +282,7 @@ public: ImageReader(const QWeakPointer& resource, const QByteArray& data, const QUrl& url = QUrl()); - virtual void run(); + virtual void run() override; private: static void listSupportedImageFormats(); diff --git a/libraries/model-networking/src/model-networking/TextureCache.h b/libraries/model-networking/src/model-networking/TextureCache.h index 9c78e7e378..e1fa119e0d 100644 --- a/libraries/model-networking/src/model-networking/TextureCache.h +++ b/libraries/model-networking/src/model-networking/TextureCache.h @@ -127,19 +127,19 @@ public: /// Loads a texture from the specified URL. NetworkTexturePointer getTexture(const QUrl& url, Type type = Type::DEFAULT_TEXTURE, const QByteArray& content = QByteArray()); - + protected: // Overload ResourceCache::prefetch to allow specifying texture type for loads Q_INVOKABLE ScriptableResource* prefetch(const QUrl& url, int type); virtual QSharedPointer createResource(const QUrl& url, const QSharedPointer& fallback, - const void* extra); - + const void* extra) override; + private: TextureCache(); virtual ~TextureCache(); friend class DilatableNetworkTexture; - + gpu::TexturePointer _permutationNormalTexture; gpu::TexturePointer _whiteTexture; gpu::TexturePointer _grayTexture; diff --git a/libraries/networking/src/NLPacketList.h b/libraries/networking/src/NLPacketList.h index 01a017f371..48ce5ef81a 100644 --- a/libraries/networking/src/NLPacketList.h +++ b/libraries/networking/src/NLPacketList.h @@ -31,7 +31,7 @@ private: NLPacketList(const NLPacketList& other) = delete; NLPacketList& operator=(const NLPacketList& other) = delete; - virtual std::unique_ptr createPacket(); + virtual std::unique_ptr createPacket() override; PacketVersion _packetVersion; diff --git a/libraries/networking/src/OAuthNetworkAccessManager.h b/libraries/networking/src/OAuthNetworkAccessManager.h index 434d9b7c75..f4139e5cfd 100644 --- a/libraries/networking/src/OAuthNetworkAccessManager.h +++ b/libraries/networking/src/OAuthNetworkAccessManager.h @@ -19,7 +19,7 @@ public: static OAuthNetworkAccessManager* getInstance(); protected: OAuthNetworkAccessManager(QObject* parent = Q_NULLPTR) : NetworkAccessManager(parent) { } - virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& req, QIODevice* outgoingData = 0); + virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& req, QIODevice* outgoingData = 0) override; }; -#endif // hifi_OAuthNetworkAccessManager_h \ No newline at end of file +#endif // hifi_OAuthNetworkAccessManager_h diff --git a/libraries/networking/src/PacketSender.h b/libraries/networking/src/PacketSender.h index e177172788..68faeaca47 100644 --- a/libraries/networking/src/PacketSender.h +++ b/libraries/networking/src/PacketSender.h @@ -43,8 +43,8 @@ public: void setPacketsPerSecond(int packetsPerSecond); int getPacketsPerSecond() const { return _packetsPerSecond; } - virtual bool process(); - virtual void terminating(); + virtual bool process() override; + virtual void terminating() override; /// are there packets waiting in the send queue to be sent bool hasPacketsToSend() const { return _packets.size() > 0; } diff --git a/libraries/networking/src/ReceivedPacketProcessor.h b/libraries/networking/src/ReceivedPacketProcessor.h index cbb27fa5d6..dd790a9b3d 100644 --- a/libraries/networking/src/ReceivedPacketProcessor.h +++ b/libraries/networking/src/ReceivedPacketProcessor.h @@ -49,7 +49,7 @@ public: float getIncomingPPS() const { return _incomingPPS.getAverage(); } float getProcessedPPS() const { return _processedPPS.getAverage(); } - virtual void terminating(); + virtual void terminating() override; public slots: void nodeKilled(SharedNodePointer node); @@ -61,7 +61,7 @@ protected: virtual void processPacket(QSharedPointer message, SharedNodePointer sendingNode) = 0; /// Implements generic processing behavior for this thread. - virtual bool process(); + virtual bool process() override; /// Determines the timeout of the wait when there are no packets to process. Default value means no timeout virtual unsigned long getMaxWait() const { return ULONG_MAX; } diff --git a/libraries/networking/src/udt/BasePacket.h b/libraries/networking/src/udt/BasePacket.h index 846c05ecbf..33b8020d3c 100644 --- a/libraries/networking/src/udt/BasePacket.h +++ b/libraries/networking/src/udt/BasePacket.h @@ -70,9 +70,9 @@ public: // QIODevice virtual functions // WARNING: Those methods all refer to the payload ONLY and NOT the entire packet - virtual bool isSequential() const { return false; } - virtual bool reset(); - virtual qint64 size() const { return _payloadCapacity; } + virtual bool isSequential() const override { return false; } + virtual bool reset() override; + virtual qint64 size() const override { return _payloadCapacity; } using QIODevice::read; // Bring QIODevice::read methods to scope, otherwise they are hidden by folling method QByteArray read(qint64 maxSize); @@ -94,8 +94,8 @@ protected: BasePacket& operator=(BasePacket&& other); // QIODevice virtual functions - virtual qint64 writeData(const char* data, qint64 maxSize); - virtual qint64 readData(char* data, qint64 maxSize); + virtual qint64 writeData(const char* data, qint64 maxSize) override; + virtual qint64 readData(char* data, qint64 maxSize) override; void adjustPayloadStartAndCapacity(qint64 headerSize, bool shouldDecreasePayloadSize = false); diff --git a/libraries/networking/src/udt/CongestionControl.h b/libraries/networking/src/udt/CongestionControl.h index cb99e6c8d4..3ab69efe52 100644 --- a/libraries/networking/src/udt/CongestionControl.h +++ b/libraries/networking/src/udt/CongestionControl.h @@ -94,7 +94,7 @@ public: template class CongestionControlFactory: public CongestionControlVirtualFactory { public: virtual ~CongestionControlFactory() {} - virtual std::unique_ptr create() { return std::unique_ptr(new T()); } + virtual std::unique_ptr create() override { return std::unique_ptr(new T()); } }; class DefaultCC: public CongestionControl { @@ -102,12 +102,12 @@ public: DefaultCC(); public: - virtual void onACK(SequenceNumber ackNum); - virtual void onLoss(SequenceNumber rangeStart, SequenceNumber rangeEnd); - virtual void onTimeout(); + virtual void onACK(SequenceNumber ackNum) override; + virtual void onLoss(SequenceNumber rangeStart, SequenceNumber rangeEnd) override; + virtual void onTimeout() override; protected: - virtual void setInitialSendSequenceNumber(SequenceNumber seqNum); + virtual void setInitialSendSequenceNumber(SequenceNumber seqNum) override; private: void stopSlowStart(); // stops the slow start on loss or timeout diff --git a/libraries/networking/src/udt/PacketList.h b/libraries/networking/src/udt/PacketList.h index 875eb70e45..5083d77ec9 100644 --- a/libraries/networking/src/udt/PacketList.h +++ b/libraries/networking/src/udt/PacketList.h @@ -54,8 +54,8 @@ public: void closeCurrentPacket(bool shouldSendEmpty = false); // QIODevice virtual functions - virtual bool isSequential() const { return false; } - virtual qint64 size() const { return getDataSize(); } + virtual bool isSequential() const override { return false; } + virtual qint64 size() const override { return getDataSize(); } template qint64 readPrimitive(T* data); template qint64 writePrimitive(const T& data); @@ -68,9 +68,9 @@ protected: void preparePackets(MessageNumber messageNumber); - virtual qint64 writeData(const char* data, qint64 maxSize); + virtual qint64 writeData(const char* data, qint64 maxSize) override; // Not implemented, added an assert so that it doesn't get used by accident - virtual qint64 readData(char* data, qint64 maxSize) { Q_ASSERT(false); return 0; } + virtual qint64 readData(char* data, qint64 maxSize) override { Q_ASSERT(false); return 0; } PacketType _packetType; std::list> _packets; diff --git a/libraries/octree/src/DirtyOctreeElementOperator.h b/libraries/octree/src/DirtyOctreeElementOperator.h index a5eec780a0..a8d00a13f0 100644 --- a/libraries/octree/src/DirtyOctreeElementOperator.h +++ b/libraries/octree/src/DirtyOctreeElementOperator.h @@ -20,8 +20,8 @@ public: ~DirtyOctreeElementOperator() {} - virtual bool preRecursion(OctreeElementPointer element); - virtual bool postRecursion(OctreeElementPointer element); + virtual bool preRecursion(OctreeElementPointer element) override; + virtual bool postRecursion(OctreeElementPointer element) override; private: glm::vec3 _point; OctreeElementPointer _element; diff --git a/libraries/octree/src/OctreeEditPacketSender.h b/libraries/octree/src/OctreeEditPacketSender.h index 4a390814f4..fd8cc85f91 100644 --- a/libraries/octree/src/OctreeEditPacketSender.h +++ b/libraries/octree/src/OctreeEditPacketSender.h @@ -58,7 +58,7 @@ public: } /// if you're running in non-threaded mode, you must call this method regularly - virtual bool process(); + virtual bool process() override; /// Set the desired number of pending messages that the OctreeEditPacketSender should attempt to queue even if /// servers are not present. This only applies to how the OctreeEditPacketSender will manage messages when no diff --git a/libraries/octree/src/OctreePersistThread.h b/libraries/octree/src/OctreePersistThread.h index 061a7a0e15..d0f0f03f98 100644 --- a/libraries/octree/src/OctreePersistThread.h +++ b/libraries/octree/src/OctreePersistThread.h @@ -51,7 +51,7 @@ signals: protected: /// Implements generic processing behavior for this thread. - virtual bool process(); + virtual bool process() override; void persist(); void backup(); diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index b5ef03be0f..19207f13ed 100644 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -36,7 +36,7 @@ public: m_collisionFilterGroup = BULLET_COLLISION_GROUP_MY_AVATAR; m_collisionFilterMask = BULLET_COLLISION_MASK_MY_AVATAR; } - virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace) { + virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace) override { if (rayResult.m_collisionObject == _me) { return 1.0f; } diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 2c7e9485fb..a6e1bb53f4 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -916,7 +916,7 @@ public: Blender(ModelPointer model, int blendNumber, const Geometry::WeakPointer& geometry, const QVector& meshes, const QVector& blendshapeCoefficients); - virtual void run(); + virtual void run() override; private: diff --git a/libraries/render/src/render/Item.h b/libraries/render/src/render/Item.h index fb5534e3ab..9a65b48021 100644 --- a/libraries/render/src/render/Item.h +++ b/libraries/render/src/render/Item.h @@ -31,7 +31,7 @@ namespace render { class Context; - + // Key is the KEY to filter Items and create specialized lists class ItemKey { public: @@ -51,8 +51,8 @@ public: NUM_FLAGS, // Not a valid flag }; - typedef std::bitset Flags; - + typedef std::bitset Flags; + // The key is the Flags Flags _flags; @@ -103,7 +103,7 @@ public: bool isRigid() const { return !_flags[DEFORMED]; } bool isDeformed() const { return _flags[DEFORMED]; } - + bool isVisible() const { return !_flags[INVISIBLE]; } bool isInvisible() const { return _flags[INVISIBLE]; } @@ -125,12 +125,12 @@ using ItemKeys = std::vector; inline QDebug operator<<(QDebug debug, const ItemKey& itemKey) { debug << "[ItemKey: isOpaque:" << itemKey.isOpaque() - << ", isStatic:" << itemKey.isStatic() - << ", isWorldSpace:" << itemKey.isWorldSpace() + << ", isStatic:" << itemKey.isStatic() + << ", isWorldSpace:" << itemKey.isWorldSpace() << "]"; return debug; } - + class ItemFilter { public: ItemKey::Flags _value{ 0 }; @@ -150,10 +150,10 @@ public: Builder& withTypeShape() { _value.set(ItemKey::TYPE_SHAPE); _mask.set(ItemKey::TYPE_SHAPE); return (*this); } Builder& withTypeLight() { _value.set(ItemKey::TYPE_LIGHT); _mask.set(ItemKey::TYPE_LIGHT); return (*this); } - + Builder& withOpaque() { _value.reset(ItemKey::TRANSLUCENT); _mask.set(ItemKey::TRANSLUCENT); return (*this); } Builder& withTransparent() { _value.set(ItemKey::TRANSLUCENT); _mask.set(ItemKey::TRANSLUCENT); return (*this); } - + Builder& withWorldSpace() { _value.reset(ItemKey::VIEW_SPACE); _mask.set(ItemKey::VIEW_SPACE); return (*this); } Builder& withViewSpace() { _value.set(ItemKey::VIEW_SPACE); _mask.set(ItemKey::VIEW_SPACE); return (*this); } @@ -224,9 +224,9 @@ public: // Bound is the AABBox fully containing this item typedef AABox Bound; - + // Status records the life history and performances of this item while performing at rendering and updating. - // This is Used for monitoring and dynamically adjust the quality + // This is Used for monitoring and dynamically adjust the quality class Status { public: @@ -243,7 +243,7 @@ public: Value() {} Value(float scale, float hue, unsigned char icon = 0xFF) { setScale(scale); setColor(hue); setIcon(icon); } - // It can be scaled in the range [0, 1] + // It can be scaled in the range [0, 1] void setScale(float scale); // the color hue in the range [0, 360] representing the color wheel hue void setColor(float hue); @@ -378,7 +378,7 @@ template const ItemKey payloadGetKey(const std::shared_ptr& payload template const Item::Bound payloadGetBound(const std::shared_ptr& payloadData) { return Item::Bound(); } template int payloadGetLayer(const std::shared_ptr& payloadData) { return 0; } template void payloadRender(const std::shared_ptr& payloadData, RenderArgs* args) { } - + // Shape type interface // This allows shapes to characterize their pipeline via a ShapeKey, to be picked with a subclass of Shape. // When creating a new shape payload you need to create a specialized version, or the ShapeKey will be ownPipeline, @@ -393,21 +393,23 @@ public: Payload(const DataPointer& data) : _data(data) {} // Payload general interface - virtual const ItemKey getKey() const { return payloadGetKey(_data); } - virtual const Item::Bound getBound() const { return payloadGetBound(_data); } - virtual int getLayer() const { return payloadGetLayer(_data); } + virtual const ItemKey getKey() const override { return payloadGetKey(_data); } + virtual const Item::Bound getBound() const override { return payloadGetBound(_data); } + virtual int getLayer() const override { return payloadGetLayer(_data); } - virtual void render(RenderArgs* args) { payloadRender(_data, args); } + virtual void render(RenderArgs* args) override { payloadRender(_data, args); } // Shape Type interface - virtual const ShapeKey getShapeKey() const { return shapeGetShapeKey(_data); } + virtual const ShapeKey getShapeKey() const override { return shapeGetShapeKey(_data); } protected: DataPointer _data; // Update mechanics - virtual void update(const UpdateFunctorPointer& functor) { std::static_pointer_cast(functor)->_func((*_data)); } + virtual void update(const UpdateFunctorPointer& functor) override { + std::static_pointer_cast(functor)->_func((*_data)); + } friend class Item; }; @@ -440,7 +442,7 @@ template <> const Item::Bound payloadGetBound(const FooPointer& foo) { return foo->evaluateMyBound(); } -// In this example, do not specialize the payloadRender call which means the compiler will use the default version which does nothing +// In this example, do not specialize the payloadRender call which means the compiler will use the default version which does nothing */ // End of the example @@ -448,7 +450,7 @@ template <> const Item::Bound payloadGetBound(const FooPointer& foo) { typedef Item::PayloadPointer PayloadPointer; typedef std::vector< PayloadPointer > Payloads; -// A few typedefs for standard containers of ItemIDs +// A few typedefs for standard containers of ItemIDs using ItemIDs = std::vector; using ItemIDSet = std::set; @@ -457,7 +459,7 @@ class ItemBound { public: ItemBound(ItemID id) : id(id) { } ItemBound(ItemID id, const AABox& bound) : id(id), bound(bound) { } - + ItemID id; AABox bound; }; diff --git a/libraries/render/src/render/Task.h b/libraries/render/src/render/Task.h index 8268090997..53e5319fc1 100644 --- a/libraries/render/src/render/Task.h +++ b/libraries/render/src/render/Task.h @@ -47,19 +47,19 @@ public: template T& edit() { return std::static_pointer_cast>(_concept)->_data; } template const T& get() const { return std::static_pointer_cast>(_concept)->_data; } - + // access potential sub varyings contained in this one. Varying operator[] (uint8_t index) const { return (*_concept)[index]; } uint8_t length() const { return (*_concept).length(); } template Varying getN (uint8_t index) const { return get()[index]; } template Varying editN (uint8_t index) { return edit()[index]; } - + protected: class Concept { public: virtual ~Concept() = default; - + virtual Varying operator[] (uint8_t index) const = 0; virtual uint8_t length() const = 0; }; @@ -69,12 +69,12 @@ protected: Model(const Data& data) : _data(data) {} virtual ~Model() = default; - - virtual Varying operator[] (uint8_t index) const { + + virtual Varying operator[] (uint8_t index) const override { Varying var; return var; } - virtual uint8_t length() const { return 0; } + virtual uint8_t length() const override { return 0; } Data _data; }; @@ -362,7 +362,7 @@ public: Q_INVOKABLE QString toJSON() { return QJsonDocument(toJsonValue(*this).toObject()).toJson(QJsonDocument::Compact); } Q_INVOKABLE void load(const QVariantMap& map) { qObjectFromJsonValue(QJsonObject::fromVariantMap(map), *this); emit loaded(); } - // Running Time measurement + // Running Time measurement // The new stats signal is emitted once per run time of a job when stats (cpu runtime) are updated void setCPURunTime(quint64 ustime) { _CPURunTime = ustime; emit newStats(); } quint64 getCPUTRunTime() const { return _CPURunTime; } @@ -457,8 +457,8 @@ public: Varying _input; Varying _output; - const Varying getInput() const { return _input; } - const Varying getOutput() const { return _output; } + const Varying getInput() const override { return _input; } + const Varying getOutput() const override { return _output; } template Model(const Varying& input, A&&... args) : @@ -466,11 +466,11 @@ public: applyConfiguration(); } - void applyConfiguration() { + void applyConfiguration() override { jobConfigure(_data, *std::static_pointer_cast(_config)); } - void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { + void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) override { renderContext->jobConfig = std::static_pointer_cast(_config); if (renderContext->jobConfig->alwaysEnabled || renderContext->jobConfig->isEnabled()) { jobRun(_data, sceneContext, renderContext, _input.get(), _output.edit()); @@ -609,7 +609,7 @@ public: void configure(const QObject& configuration) { for (auto& job : _jobs) { job.applyConfiguration(); - + } } @@ -622,5 +622,4 @@ protected: } - #endif // hifi_render_Task_h diff --git a/libraries/script-engine/src/ArrayBufferClass.h b/libraries/script-engine/src/ArrayBufferClass.h index f7ad8ad4bd..69c2cc0799 100644 --- a/libraries/script-engine/src/ArrayBufferClass.h +++ b/libraries/script-engine/src/ArrayBufferClass.h @@ -28,34 +28,34 @@ public: ArrayBufferClass(ScriptEngine* scriptEngine); QScriptValue newInstance(qint32 size); QScriptValue newInstance(const QByteArray& ba); - + QueryFlags queryProperty(const QScriptValue& object, const QScriptString& name, - QueryFlags flags, uint* id); + QueryFlags flags, uint* id) override; QScriptValue property(const QScriptValue& object, - const QScriptString& name, uint id); + const QScriptString& name, uint id) override; QScriptValue::PropertyFlags propertyFlags(const QScriptValue& object, - const QScriptString& name, uint id); - - QString name() const; - QScriptValue prototype() const; - + const QScriptString& name, uint id) override; + + QString name() const override; + QScriptValue prototype() const override; + ScriptEngine* getEngine() { return _scriptEngine; } - + private: static QScriptValue construct(QScriptContext* context, QScriptEngine* engine); - + static QScriptValue toScriptValue(QScriptEngine* eng, const QByteArray& ba); static void fromScriptValue(const QScriptValue& obj, QByteArray& ba); - + QScriptValue _proto; QScriptValue _ctor; - + // JS Object attributes QScriptString _name; QScriptString _byteLength; - + ScriptEngine* _scriptEngine; }; -#endif // hifi_ArrayBufferClass_h \ No newline at end of file +#endif // hifi_ArrayBufferClass_h diff --git a/libraries/script-engine/src/ArrayBufferViewClass.h b/libraries/script-engine/src/ArrayBufferViewClass.h index b673ebf280..67af4a3fc3 100644 --- a/libraries/script-engine/src/ArrayBufferViewClass.h +++ b/libraries/script-engine/src/ArrayBufferViewClass.h @@ -30,23 +30,23 @@ class ArrayBufferViewClass : public QObject, public QScriptClass { Q_OBJECT public: ArrayBufferViewClass(ScriptEngine* scriptEngine); - + ScriptEngine* getScriptEngine() { return _scriptEngine; } - + virtual QueryFlags queryProperty(const QScriptValue& object, const QScriptString& name, - QueryFlags flags, uint* id); + QueryFlags flags, uint* id) override; virtual QScriptValue property(const QScriptValue& object, - const QScriptString& name, uint id); + const QScriptString& name, uint id) override; virtual QScriptValue::PropertyFlags propertyFlags(const QScriptValue& object, - const QScriptString& name, uint id); + const QScriptString& name, uint id) override; protected: // JS Object attributes QScriptString _bufferName; QScriptString _byteOffsetName; QScriptString _byteLengthName; - + ScriptEngine* _scriptEngine; }; -#endif // hifi_ArrayBufferViewClass_h \ No newline at end of file +#endif // hifi_ArrayBufferViewClass_h diff --git a/libraries/script-engine/src/DataViewClass.h b/libraries/script-engine/src/DataViewClass.h index b87803f4b4..72c920a727 100644 --- a/libraries/script-engine/src/DataViewClass.h +++ b/libraries/script-engine/src/DataViewClass.h @@ -19,18 +19,18 @@ class DataViewClass : public ArrayBufferViewClass { public: DataViewClass(ScriptEngine* scriptEngine); QScriptValue newInstance(QScriptValue buffer, quint32 byteOffset, quint32 byteLength); - - QString name() const; - QScriptValue prototype() const; - + + QString name() const override; + QScriptValue prototype() const override; + private: static QScriptValue construct(QScriptContext* context, QScriptEngine* engine); - + QScriptValue _proto; QScriptValue _ctor; - + QScriptString _name; }; -#endif // hifi_DataViewClass_h \ No newline at end of file +#endif // hifi_DataViewClass_h diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index e093f0393b..38455e8fd3 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -138,7 +138,8 @@ public: static void loadEntityScript(QWeakPointer theEngine, const EntityItemID& entityID, const QString& entityScript, bool forceRedownload); Q_INVOKABLE void unloadEntityScript(const EntityItemID& entityID); // will call unload method Q_INVOKABLE void unloadAllEntityScripts(); - Q_INVOKABLE void callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const QStringList& params = QStringList()); + Q_INVOKABLE void callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, + const QStringList& params = QStringList()) override; Q_INVOKABLE void callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const MouseEvent& event); Q_INVOKABLE void callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const EntityItemID& otherID, const Collision& collision); @@ -157,8 +158,8 @@ public: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NOTE - These are the callback implementations for ScriptUser the get called by ScriptCache when the contents // of a script are available. - virtual void scriptContentsAvailable(const QUrl& url, const QString& scriptContents); - virtual void errorInLoadingScript(const QUrl& url); + virtual void scriptContentsAvailable(const QUrl& url, const QString& scriptContents) override; + virtual void errorInLoadingScript(const QUrl& url) override; // These are currently used by Application to track if a script is user loaded or not. Consider finding a solution // inside of Application so that the ScriptEngine class is not polluted by this notion diff --git a/libraries/script-engine/src/ScriptsModel.h b/libraries/script-engine/src/ScriptsModel.h index e1902f4b23..a3ca554e51 100644 --- a/libraries/script-engine/src/ScriptsModel.h +++ b/libraries/script-engine/src/ScriptsModel.h @@ -68,11 +68,11 @@ class ScriptsModel : public QAbstractItemModel { public: ScriptsModel(QObject* parent = NULL); ~ScriptsModel(); - QModelIndex index(int row, int column, const QModelIndex& parent) const; - QModelIndex parent(const QModelIndex& child) const; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; + QModelIndex index(int row, int column, const QModelIndex& parent) const override; + QModelIndex parent(const QModelIndex& child) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; TreeNodeBase* getTreeNodeFromIndex(const QModelIndex& index) const; QList getFolderNodes(TreeNodeFolder* parent) const; diff --git a/libraries/script-engine/src/ScriptsModelFilter.h b/libraries/script-engine/src/ScriptsModelFilter.h index 7b7cdd974e..4854665d12 100644 --- a/libraries/script-engine/src/ScriptsModelFilter.h +++ b/libraries/script-engine/src/ScriptsModelFilter.h @@ -20,8 +20,8 @@ class ScriptsModelFilter : public QSortFilterProxyModel { public: ScriptsModelFilter(QObject *parent = NULL); protected: - bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const; - bool lessThan(const QModelIndex& left, const QModelIndex& right) const; + bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override; + bool lessThan(const QModelIndex& left, const QModelIndex& right) const override; }; #endif // hifi_ScriptsModelFilter_h diff --git a/libraries/script-engine/src/TypedArrays.h b/libraries/script-engine/src/TypedArrays.h index a1a288c3c9..141e7870d9 100644 --- a/libraries/script-engine/src/TypedArrays.h +++ b/libraries/script-engine/src/TypedArrays.h @@ -34,33 +34,33 @@ public: virtual QScriptValue newInstance(quint32 length); virtual QScriptValue newInstance(QScriptValue array); virtual QScriptValue newInstance(QScriptValue buffer, quint32 byteOffset, quint32 length); - + virtual QueryFlags queryProperty(const QScriptValue& object, - const QScriptString& name, - QueryFlags flags, uint* id); + const QScriptString& name, + QueryFlags flags, uint* id) override; virtual QScriptValue property(const QScriptValue& object, - const QScriptString& name, uint id); - virtual void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) = 0; + const QScriptString& name, uint id) override; + virtual void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override = 0; virtual QScriptValue::PropertyFlags propertyFlags(const QScriptValue& object, - const QScriptString& name, uint id); - - QString name() const; - QScriptValue prototype() const; - + const QScriptString& name, uint id) override; + + QString name() const override; + QScriptValue prototype() const override; + protected: static QScriptValue construct(QScriptContext* context, QScriptEngine* engine); - + void setBytesPerElement(quint32 bytesPerElement); - + QScriptValue _proto; QScriptValue _ctor; - + QScriptString _name; QScriptString _bytesPerElementName; QScriptString _lengthName; - + quint32 _bytesPerElement; - + friend class TypedArrayPrototype; }; @@ -68,81 +68,81 @@ class Int8ArrayClass : public TypedArray { Q_OBJECT public: Int8ArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; class Uint8ArrayClass : public TypedArray { Q_OBJECT public: Uint8ArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; class Uint8ClampedArrayClass : public TypedArray { Q_OBJECT public: Uint8ClampedArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; class Int16ArrayClass : public TypedArray { Q_OBJECT public: Int16ArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; class Uint16ArrayClass : public TypedArray { Q_OBJECT public: Uint16ArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; class Int32ArrayClass : public TypedArray { Q_OBJECT public: Int32ArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; class Uint32ArrayClass : public TypedArray { Q_OBJECT public: Uint32ArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; class Float32ArrayClass : public TypedArray { Q_OBJECT public: Float32ArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; class Float64ArrayClass : public TypedArray { Q_OBJECT public: Float64ArrayClass(ScriptEngine* scriptEngine); - - QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id); - void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value); + + QScriptValue property(const QScriptValue& object, const QScriptString& name, uint id) override; + void setProperty(QScriptValue& object, const QScriptString& name, uint id, const QScriptValue& value) override; }; -#endif // hifi_TypedArrays_h \ No newline at end of file +#endif // hifi_TypedArrays_h diff --git a/libraries/script-engine/src/UndoStackScriptingInterface.h b/libraries/script-engine/src/UndoStackScriptingInterface.h index 479648fc92..420a282c38 100644 --- a/libraries/script-engine/src/UndoStackScriptingInterface.h +++ b/libraries/script-engine/src/UndoStackScriptingInterface.h @@ -33,10 +33,10 @@ class ScriptUndoCommand : public QObject, public QUndoCommand { public: ScriptUndoCommand(QScriptValue undoFunction, QScriptValue undoData, QScriptValue redoFunction, QScriptValue redoData); - virtual void undo(); - virtual void redo(); - virtual bool mergeWith(const QUndoCommand* command) { return false; } - virtual int id() const { return -1; } + virtual void undo() override; + virtual void redo() override; + virtual bool mergeWith(const QUndoCommand* command) override { return false; } + virtual int id() const override { return -1; } public slots: void doUndo(); diff --git a/libraries/shared/src/CrashHelpers.h b/libraries/shared/src/CrashHelpers.h index dae39d4a99..6233ab9177 100644 --- a/libraries/shared/src/CrashHelpers.h +++ b/libraries/shared/src/CrashHelpers.h @@ -30,7 +30,7 @@ private: class B : public A { public: B() : A(this) { } - virtual void virtualFunction() { } + virtual void virtualFunction() override { } }; A::~A() { diff --git a/libraries/shared/src/GenericQueueThread.h b/libraries/shared/src/GenericQueueThread.h index 91b8e5b6d8..5c16693d53 100644 --- a/libraries/shared/src/GenericQueueThread.h +++ b/libraries/shared/src/GenericQueueThread.h @@ -55,7 +55,7 @@ public: } } - virtual bool process() { + virtual bool process() override { lock(); if (!_items.size()) { unlock(); diff --git a/libraries/shared/src/Preferences.h b/libraries/shared/src/Preferences.h index 0b8140af1b..abb3f5afbd 100644 --- a/libraries/shared/src/Preferences.h +++ b/libraries/shared/src/Preferences.h @@ -105,7 +105,7 @@ public: using Lambda = std::function; ButtonPreference(const QString& category, const QString& name, Lambda triggerHandler) : Preference(category, name), _triggerHandler(triggerHandler) { } - Type getType() { return Button; } + Type getType() override { return Button; } Q_INVOKABLE void trigger() { _triggerHandler(); } protected: @@ -210,7 +210,7 @@ public: SliderPreference(const QString& category, const QString& name, Getter getter, Setter setter) : FloatPreference(category, name, getter, setter) { } - Type getType() { return Slider; } + Type getType() override { return Slider; } }; class SpinnerPreference : public FloatPreference { @@ -219,7 +219,7 @@ public: SpinnerPreference(const QString& category, const QString& name, Getter getter, Setter setter) : FloatPreference(category, name, getter, setter) { } - Type getType() { return Spinner; } + Type getType() override { return Spinner; } }; class EditPreference : public StringPreference { @@ -229,7 +229,7 @@ class EditPreference : public StringPreference { public: EditPreference(const QString& category, const QString& name, Getter getter, Setter setter) : StringPreference(category, name, getter, setter) { } - Type getType() { return Editable; } + Type getType() override { return Editable; } const QString& getPlaceholderText() const { return _placeholderText; } void setPlaceholderText(const QString& placeholderText) { _placeholderText = placeholderText; } @@ -244,7 +244,7 @@ class ComboBoxPreference : public EditPreference { public: ComboBoxPreference(const QString& category, const QString& name, Getter getter, Setter setter) : EditPreference(category, name, getter, setter) { } - Type getType() { return ComboBox; } + Type getType() override { return ComboBox; } const QStringList& getItems() { return _items; } void setItems(const QStringList& items) { _items = items; } @@ -260,7 +260,7 @@ class BrowsePreference : public EditPreference { public: BrowsePreference(const QString& category, const QString& name, Getter getter, Setter setter) : EditPreference(category, name, getter, setter) { } - Type getType() { return Browsable; } + Type getType() override { return Browsable; } const QString& getBrowseLabel() { return _browseLabel; } void setBrowseLabel(const QString& browseLabel) { _browseLabel = browseLabel; } @@ -276,7 +276,7 @@ public: : BrowsePreference(category, name, getter, setter) { _browseLabel = "Change"; } - Type getType() { return Avatar; } + Type getType() override { return Avatar; } }; @@ -285,7 +285,7 @@ class CheckPreference : public BoolPreference { public: CheckPreference(const QString& category, const QString& name, Getter getter, Setter setter) : BoolPreference(category, name, getter, setter) { } - Type getType() { return Checkbox; } + Type getType() override { return Checkbox; } }; #endif diff --git a/libraries/shared/src/SettingHandle.h b/libraries/shared/src/SettingHandle.h index 8e07d28dad..36d4f0b249 100644 --- a/libraries/shared/src/SettingHandle.h +++ b/libraries/shared/src/SettingHandle.h @@ -70,57 +70,57 @@ namespace Setting { public: Handle(const QString& key) : Interface(key) {} Handle(const QStringList& path) : Interface(path.join("/")) {} - + Handle(const QString& key, const T& defaultValue) : Interface(key), _defaultValue(defaultValue) {} Handle(const QStringList& path, const T& defaultValue) : Handle(path.join("/"), defaultValue) {} - + virtual ~Handle() { deinit(); } - + // Returns setting value, returns its default value if not found - T get() const { - return get(_defaultValue); + T get() const { + return get(_defaultValue); } // Returns setting value, returns other if not found - T get(const T& other) const { - maybeInit(); - return (_isSet) ? _value : other; + T get(const T& other) const { + maybeInit(); + return (_isSet) ? _value : other; } - const T& getDefault() const { - return _defaultValue; - } - - void reset() { - set(_defaultValue); + const T& getDefault() const { + return _defaultValue; } - void set(const T& value) { - maybeInit(); + void reset() { + set(_defaultValue); + } + + void set(const T& value) { + maybeInit(); if ((!_isSet && (value != _defaultValue)) || _value != value) { - _value = value; - _isSet = true; - save(); - } + _value = value; + _isSet = true; + save(); + } } - void remove() { - maybeInit(); - if (_isSet) { - _isSet = false; - save(); - } + void remove() { + maybeInit(); + if (_isSet) { + _isSet = false; + save(); + } } - + protected: - virtual void setVariant(const QVariant& variant); - virtual QVariant getVariant() { return QVariant::fromValue(get()); } - + virtual void setVariant(const QVariant& variant) override; + virtual QVariant getVariant() override { return QVariant::fromValue(get()); } + private: T _value; const T _defaultValue; }; - + template void Handle::setVariant(const QVariant& variant) { if (variant.canConvert() || std::is_same::value) { diff --git a/libraries/shared/src/ShutdownEventListener.h b/libraries/shared/src/ShutdownEventListener.h index f6d50401b2..8a9363e2c8 100644 --- a/libraries/shared/src/ShutdownEventListener.h +++ b/libraries/shared/src/ShutdownEventListener.h @@ -20,7 +20,7 @@ class ShutdownEventListener : public QObject, public QAbstractNativeEventFilter public: static ShutdownEventListener& getInstance(); - virtual bool nativeEventFilter(const QByteArray& eventType, void* message, long* result); + virtual bool nativeEventFilter(const QByteArray& eventType, void* message, long* result) override; private: ShutdownEventListener(QObject* parent = 0); }; diff --git a/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.cpp b/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.cpp index 2e8f6bd7b3..549bf69ef4 100644 --- a/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.cpp +++ b/libraries/steamworks-wrapper/src/steamworks-wrapper/SteamClient.cpp @@ -23,6 +23,7 @@ #if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Woverloaded-virtual" +#pragma GCC diagnostic ignored "-Wsuggest-override" #endif #include @@ -310,4 +311,4 @@ void SteamClient::joinLobby(QString lobbyIdStr) { qDebug() << "Trying to join Steam lobby:" << lobbyIdStr; CSteamID lobbyId(lobbyIdStr.toULongLong()); SteamMatchmaking()->JoinLobby(lobbyId); -} \ No newline at end of file +} diff --git a/libraries/ui/src/CursorManager.cpp b/libraries/ui/src/CursorManager.cpp index a4c7cf9fb2..f768b5f227 100644 --- a/libraries/ui/src/CursorManager.cpp +++ b/libraries/ui/src/CursorManager.cpp @@ -26,7 +26,7 @@ namespace Cursor { class MouseInstance : public Instance { - Source getType() const { + Source getType() const override { return Source::MOUSE; } }; @@ -79,4 +79,4 @@ namespace Cursor { _scale = scale; } -} \ No newline at end of file +} diff --git a/libraries/ui/src/ErrorDialog.h b/libraries/ui/src/ErrorDialog.h index 38954714a7..4312e82036 100644 --- a/libraries/ui/src/ErrorDialog.h +++ b/libraries/ui/src/ErrorDialog.h @@ -36,7 +36,7 @@ signals: void textChanged(); protected slots: - virtual void accept(); + virtual void accept() override; private: QString _text; diff --git a/libraries/ui/src/MainWindow.h b/libraries/ui/src/MainWindow.h index 3fee62692d..db02bfa1b6 100644 --- a/libraries/ui/src/MainWindow.h +++ b/libraries/ui/src/MainWindow.h @@ -31,14 +31,14 @@ signals: void windowShown(bool shown); protected: - virtual void closeEvent(QCloseEvent* event); - virtual void moveEvent(QMoveEvent* event); - virtual void resizeEvent(QResizeEvent* event); - virtual void showEvent(QShowEvent* event); - virtual void hideEvent(QHideEvent* event); - virtual void changeEvent(QEvent* event); - virtual void dragEnterEvent(QDragEnterEvent *e); - virtual void dropEvent(QDropEvent *e); + virtual void closeEvent(QCloseEvent* event) override; + virtual void moveEvent(QMoveEvent* event) override; + virtual void resizeEvent(QResizeEvent* event) override; + virtual void showEvent(QShowEvent* event) override; + virtual void hideEvent(QHideEvent* event) override; + virtual void changeEvent(QEvent* event) override; + virtual void dragEnterEvent(QDragEnterEvent *e) override; + virtual void dropEvent(QDropEvent *e) override; private: Setting::Handle _windowGeometry; diff --git a/tools/vhacd-util/src/VHACDUtil.h b/tools/vhacd-util/src/VHACDUtil.h index 8f82c4e4e4..35ec3ef56b 100644 --- a/tools/vhacd-util/src/VHACDUtil.h +++ b/tools/vhacd-util/src/VHACDUtil.h @@ -51,7 +51,7 @@ namespace vhacd { // Couldn't follow coding guideline here due to virtual function declared in IUserCallback void Update(const double overallProgress, const double stageProgress, const double operationProgress, - const char * const stage, const char * const operation); + const char * const stage, const char * const operation) override; }; }