From 90ef109476cce4e021eed1e8f0d5562b245035d7 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 25 Sep 2018 11:11:53 +1200 Subject: [PATCH] Remove superseded Pointers API functions --- interface/src/raypick/PathPointer.cpp | 29 ------------------- interface/src/raypick/PathPointer.h | 4 --- .../src/raypick/PointerScriptingInterface.cpp | 12 -------- .../src/raypick/PointerScriptingInterface.h | 29 +------------------ interface/src/raypick/StylusPointer.cpp | 6 ---- interface/src/raypick/StylusPointer.h | 4 --- libraries/pointers/src/Pointer.h | 4 --- libraries/pointers/src/PointerManager.cpp | 25 ---------------- libraries/pointers/src/PointerManager.h | 4 --- .../controllers/controllerModules/teleport.js | 19 +++++++----- 10 files changed, 12 insertions(+), 124 deletions(-) diff --git a/interface/src/raypick/PathPointer.cpp b/interface/src/raypick/PathPointer.cpp index ecdff7f81d..0301136bfa 100644 --- a/interface/src/raypick/PathPointer.cpp +++ b/interface/src/raypick/PathPointer.cpp @@ -360,32 +360,3 @@ glm::vec2 PathPointer::findPos2D(const PickedObject& pickedObject, const glm::ve return glm::vec2(NAN); } } - -QVector PathPointer::getOverlayIDs() { - QVector result; - for (auto& state : _renderStates) { - QUuid uuid = state.second->getStartID(); - if (!uuid.isNull()) { - result.append(uuid); - } - uuid = state.second->getEndID(); - if (!uuid.isNull()) { - result.append(uuid); - } - } - return result; -} - -QUuid PathPointer::getStartOverlayID(const QString& state) { - if (_renderStates.find(_currentRenderState) != _renderStates.end()) { - return _renderStates[_currentRenderState]->getStartID(); - } - return QUuid(); -} - -QUuid PathPointer::getEndOverlayID(const QString& state) { - if (_renderStates.find(_currentRenderState) != _renderStates.end()) { - return _renderStates[_currentRenderState]->getEndID(); - } - return QUuid(); -} diff --git a/interface/src/raypick/PathPointer.h b/interface/src/raypick/PathPointer.h index 134eac059d..b3638d1f7d 100644 --- a/interface/src/raypick/PathPointer.h +++ b/interface/src/raypick/PathPointer.h @@ -80,10 +80,6 @@ public: // You cannot use editRenderState to change the type of any part of the pointer. You can only edit the properties of the existing overlays. void editRenderState(const std::string& state, const QVariant& startProps, const QVariant& pathProps, const QVariant& endProps) override; - QVector getOverlayIDs() override; - QUuid getStartOverlayID(const QString& state) override; - QUuid getEndOverlayID(const QString& state) override; - void setLength(float length) override; void setLockEndUUID(const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) override; diff --git a/interface/src/raypick/PointerScriptingInterface.cpp b/interface/src/raypick/PointerScriptingInterface.cpp index 33a571a445..e880e14f8f 100644 --- a/interface/src/raypick/PointerScriptingInterface.cpp +++ b/interface/src/raypick/PointerScriptingInterface.cpp @@ -394,15 +394,3 @@ QVariantMap PointerScriptingInterface::getPrevPickResult(unsigned int uid) const QVariantMap PointerScriptingInterface::getPointerProperties(unsigned int uid) const { return DependencyManager::get()->getPointerProperties(uid); } - -QVector PointerScriptingInterface::getOverlayIDs(unsigned int uid) { - return DependencyManager::get()->getOverlayIDs(uid); -} - -QUuid PointerScriptingInterface::getStartOverlayID(unsigned int uid, const QString& state) { - return DependencyManager::get()->getStartOverlayID(uid, state); -} - -QUuid PointerScriptingInterface::getEndOverlayID(unsigned int uid, const QString& state) { - return DependencyManager::get()->getEndOverlayID(uid, state); -} diff --git a/interface/src/raypick/PointerScriptingInterface.h b/interface/src/raypick/PointerScriptingInterface.h index 7046c6bb70..2677f37fae 100644 --- a/interface/src/raypick/PointerScriptingInterface.h +++ b/interface/src/raypick/PointerScriptingInterface.h @@ -205,39 +205,12 @@ public: /**jsdoc * Returns information about an existing Pointer - * @function Pointers.getPointerState + * @function Pointers.getPointerProperties * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. * @returns {Pointers.LaserPointerProperties|Pointers.StylusPointerProperties|Pointers.ParabolaPointerProperties} The information about the Pointer. * Currently only includes renderStates and defaultRenderStates with associated overlay IDs. */ Q_INVOKABLE QVariantMap getPointerProperties(unsigned int uid) const; - /**jsdoc - * Get the IDs of the overlays used by a Pointer. - * @function Pointers.getOverlayIDs - * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. - * @returns {Uuid[]} The overlay IDs used by the Pointer if a {@link PickType|Parabola}, otherwise null. - */ - Q_INVOKABLE QVector getOverlayIDs(unsigned int uid); - - /**jsdoc - * Get the ID of the start overlay for a particular state used by a {@link PickType|Path} or {@link PickType|Parabola} - * Pointer. - * @function Pointers.getStartOverlayID - * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. - * @returns {Uuid} The ID of the start overlay used by the Pointer if a {@link PickType|Path} or {@link PickType|Parabola}, - * otherwise Uuid.NULL. - */ - Q_INVOKABLE QUuid getStartOverlayID(unsigned int uid, const QString& state); - - /**jsdoc - * Get the ID of the end overlay for a particular state used by a {@link PickType|Path} or {@link PickType|Parabola} - * Pointer. - * @function Pointers.getEndOverlayID - * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. - * @returns {Uuid} The ID of the end overlay used by the Pointer if a {@link PickType|Path} or {@link PickType|Parabola}, - * otherwise Uuid.NULL. - */ - Q_INVOKABLE QUuid getEndOverlayID(unsigned int uid, const QString& state); }; #endif // hifi_PointerScriptingInterface_h diff --git a/interface/src/raypick/StylusPointer.cpp b/interface/src/raypick/StylusPointer.cpp index 7549402227..cd34547b2a 100644 --- a/interface/src/raypick/StylusPointer.cpp +++ b/interface/src/raypick/StylusPointer.cpp @@ -234,9 +234,3 @@ glm::vec2 StylusPointer::findPos2D(const PickedObject& pickedObject, const glm:: return glm::vec2(NAN); } } - -QVector StylusPointer::getOverlayIDs() { - QVector result; - result.append(_stylusOverlay); - return result; -} diff --git a/interface/src/raypick/StylusPointer.h b/interface/src/raypick/StylusPointer.h index c5b87e39ae..4095acb529 100644 --- a/interface/src/raypick/StylusPointer.h +++ b/interface/src/raypick/StylusPointer.h @@ -35,10 +35,6 @@ public: QVariantMap toVariantMap() const override; - QVector getOverlayIDs() override; - QUuid getStartOverlayID(const QString& state) override { return QUuid(); }; - QUuid getEndOverlayID(const QString& state) override { return QUuid(); };; - static OverlayID buildStylusOverlay(const QVariantMap& properties); protected: diff --git a/libraries/pointers/src/Pointer.h b/libraries/pointers/src/Pointer.h index 2594330fbc..4264a60079 100644 --- a/libraries/pointers/src/Pointer.h +++ b/libraries/pointers/src/Pointer.h @@ -52,10 +52,6 @@ public: virtual QVariantMap toVariantMap() const = 0; - virtual QVector getOverlayIDs() = 0; - virtual QUuid getStartOverlayID(const QString& state) = 0; - virtual QUuid getEndOverlayID(const QString& state) = 0; - virtual void setPrecisionPicking(bool precisionPicking); virtual void setIgnoreItems(const QVector& ignoreItems) const; virtual void setIncludeItems(const QVector& includeItems) const; diff --git a/libraries/pointers/src/PointerManager.cpp b/libraries/pointers/src/PointerManager.cpp index 1a4b304d0d..72e4b417cd 100644 --- a/libraries/pointers/src/PointerManager.cpp +++ b/libraries/pointers/src/PointerManager.cpp @@ -154,28 +154,3 @@ bool PointerManager::isMouse(unsigned int uid) { } return false; } - -QVector PointerManager::getOverlayIDs(unsigned int uid) { - auto pointer = find(uid); - if (pointer) { - return pointer->getOverlayIDs(); - } - QVector empty; - return empty; -} - -QUuid PointerManager::getStartOverlayID(unsigned int uid, const QString& state) { - auto pointer = find(uid); - if (pointer) { - return pointer->getStartOverlayID(state); - } - return QUuid(); -} - -QUuid PointerManager::getEndOverlayID(unsigned int uid, const QString& state) { - auto pointer = find(uid); - if (pointer) { - return pointer->getEndOverlayID(state); - } - return QUuid(); -} diff --git a/libraries/pointers/src/PointerManager.h b/libraries/pointers/src/PointerManager.h index 75bdbc850f..2d0b2a107e 100644 --- a/libraries/pointers/src/PointerManager.h +++ b/libraries/pointers/src/PointerManager.h @@ -45,10 +45,6 @@ public: bool isRightHand(unsigned int uid); bool isMouse(unsigned int uid); - QVector getOverlayIDs(unsigned int uid); - QUuid getStartOverlayID(unsigned int uid, const QString& state); - QUuid getEndOverlayID(unsigned int uid, const QString& state); - static const unsigned int MOUSE_POINTER_ID { PointerEvent::INVALID_POINTER_ID + 1 }; private: diff --git a/scripts/system/controllers/controllerModules/teleport.js b/scripts/system/controllers/controllerModules/teleport.js index 0bbd0ffe3a..b943fd74a7 100644 --- a/scripts/system/controllers/controllerModules/teleport.js +++ b/scripts/system/controllers/controllerModules/teleport.js @@ -259,9 +259,12 @@ Script.include("/~/system/libraries/controllers.js"); isOutlineSmooth: false }; - this.addToSelectedItemsList = function (overlays) { - for (var i = 0, length = overlays.length; i < length; i++) { - Selection.addToSelectedItemsList(this.teleporterSelectionName, "overlay", overlays[i]); + this.addToSelectedItemsList = function (properties) { + for (var i = 0, length = teleportRenderStates.length; i < length; i++) { + var state = properties.renderStates[teleportRenderStates[i].name]; + if (state && state.end) { + Selection.addToSelectedItemsList(this.teleporterSelectionName, "overlay", state.end); + } } }; @@ -345,10 +348,10 @@ Script.include("/~/system/libraries/controllers.js"); maxDistance: 8.0 }); - _this.addToSelectedItemsList(Pointers.getOverlayIDs(_this.teleportParabolaHandVisuals)); - _this.addToSelectedItemsList(Pointers.getOverlayIDs(_this.teleportParabolaHandCollisions)); - _this.addToSelectedItemsList(Pointers.getOverlayIDs(_this.teleportParabolaHeadVisuals)); - _this.addToSelectedItemsList(Pointers.getOverlayIDs(_this.teleportParabolaHeadCollisions)); + _this.addToSelectedItemsList(Pointers.getPointerProperties(_this.teleportParabolaHandVisuals)); + _this.addToSelectedItemsList(Pointers.getPointerProperties(_this.teleportParabolaHandCollisions)); + _this.addToSelectedItemsList(Pointers.getPointerProperties(_this.teleportParabolaHeadVisuals)); + _this.addToSelectedItemsList(Pointers.getPointerProperties(_this.teleportParabolaHeadCollisions)); var capsuleData = MyAvatar.getCollisionCapsule(); @@ -776,7 +779,7 @@ Script.include("/~/system/libraries/controllers.js"); Pointers.setRenderState(_this.teleportParabolaHandCollisions, invisibleState); pointerID = _this.teleportParabolaHandVisuals; } - this.setPlayAreaVisible(visible, Pointers.getEndOverlayID(pointerID, "teleport"), true); + this.setPlayAreaVisible(visible, Pointers.getPointerProperties(pointerID).renderStates.teleport.end, true); this.setTeleportVisible(visible, mode); };