diff --git a/assignment-client/src/Agent.h b/assignment-client/src/Agent.h index 0cdc9e0029..0fc3fbe1f9 100644 --- a/assignment-client/src/Agent.h +++ b/assignment-client/src/Agent.h @@ -33,6 +33,19 @@ #include "entities/EntityTreeHeadlessViewer.h" #include "avatars/ScriptableAvatar.h" +/**jsdoc + * @namespace Agent + * + * @hifi-assignment-client + * + * @property {boolean} isAvatar + * @property {boolean} isPlayingAvatarSound Read-only. + * @property {boolean} isListeningToAudioStream + * @property {boolean} isNoiseGateEnabled + * @property {number} lastReceivedAudioLoudness Read-only. + * @property {Uuid} sessionUUID Read-only. + */ + class Agent : public ThreadedAssignment { Q_OBJECT @@ -60,10 +73,28 @@ public: virtual void aboutToFinish() override; public slots: + /**jsdoc + * @function Agent.run + * @deprecated This function is being removed from the API. + */ void run() override; + + /**jsdoc + * @function Agent.playAvatarSound + * @param {object} avatarSound + */ void playAvatarSound(SharedSoundPointer avatarSound); + /**jsdoc + * @function Agent.setIsAvatar + * @param {boolean} isAvatar + */ void setIsAvatar(bool isAvatar); + + /**jsdoc + * @function Agent.isAvatar + * @returns {boolean} + */ bool isAvatar() const { return _isAvatar; } private slots: diff --git a/assignment-client/src/avatars/ScriptableAvatar.h b/assignment-client/src/avatars/ScriptableAvatar.h index b1039b5ac0..d34ad2d21e 100644 --- a/assignment-client/src/avatars/ScriptableAvatar.h +++ b/assignment-client/src/avatars/ScriptableAvatar.h @@ -17,20 +17,144 @@ #include #include +/**jsdoc + * The Avatar API is used to manipulate scriptable avatars on the domain. This API is a subset of the + * {@link MyAvatar} API. + * + *

Note: In the examples, use "Avatar" instead of "MyAvatar".

+ * + * @namespace Avatar + * + * @hifi-assignment-client + * + * @property {Vec3} position + * @property {number} scale + * @property {number} density Read-only. + * @property {Vec3} handPosition + * @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar. + * Yaw is sometimes called "heading". + * @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is + * sometimes called "elevation". + * @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is + * sometimes called "bank". + * @property {Quat} orientation + * @property {Quat} headOrientation - The orientation of the avatar's head. + * @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is + * sometimes called "elevation". + * @property {number} headYaw - The rotation left or right about an axis running from the base to the crown of the avatar's + * head. Yaw is sometimes called "heading". + * @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is + * sometimes called "bank". + * @property {Vec3} velocity + * @property {Vec3} angularVelocity + * @property {number} audioLoudness + * @property {number} audioAverageLoudness + * @property {string} displayName + * @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer + * rather than by Interface clients. The result is unique among all avatars present at the time. + * @property {boolean} lookAtSnappingEnabled + * @property {string} skeletonModelURL + * @property {AttachmentData[]} attachmentData + * @property {string[]} jointNames - The list of joints in the current avatar model. Read-only. + * @property {Uuid} sessionUUID Read-only. + * @property {Mat4} sensorToWorldMatrix Read-only. + * @property {Mat4} controllerLeftHandMatrix Read-only. + * @property {Mat4} controllerRightHandMatrix Read-only. + * @property {number} sensorToWorldScale Read-only. + * + * @borrows MyAvatar.getDomainMinScale as getDomainMinScale + * @borrows MyAvatar.getDomainMaxScale as getDomainMaxScale + * @borrows MyAvatar.canMeasureEyeHeight as canMeasureEyeHeight + * @borrows MyAvatar.getEyeHeight as getEyeHeight + * @borrows MyAvatar.getHeight as getHeight + * @borrows MyAvatar.setHandState as setHandState + * @borrows MyAvatar.getHandState as getHandState + * @borrows MyAvatar.setRawJointData as setRawJointData + * @borrows MyAvatar.setJointData as setJointData + * @borrows MyAvatar.setJointRotation as setJointRotation + * @borrows MyAvatar.setJointTranslation as setJointTranslation + * @borrows MyAvatar.clearJointData as clearJointData + * @borrows MyAvatar.isJointDataValid as isJointDataValid + * @borrows MyAvatar.getJointRotation as getJointRotation + * @borrows MyAvatar.getJointTranslation as getJointTranslation + * @borrows MyAvatar.getJointRotations as getJointRotations + * @borrows MyAvatar.getJointTranslations as getJointTranslations + * @borrows MyAvatar.setJointRotations as setJointRotations + * @borrows MyAvatar.setJointTranslations as setJointTranslations + * @borrows MyAvatar.clearJointsData as clearJointsData + * @borrows MyAvatar.getJointIndex as getJointIndex + * @borrows MyAvatar.getJointNames as getJointNames + * @borrows MyAvatar.setBlendshape as setBlendshape + * @borrows MyAvatar.getAttachmentsVariant as getAttachmentsVariant + * @borrows MyAvatar.setAttachmentsVariant as setAttachmentsVariant + * @borrows MyAvatar.updateAvatarEntity as updateAvatarEntity + * @borrows MyAvatar.clearAvatarEntity as clearAvatarEntity + * @borrows MyAvatar.setForceFaceTrackerConnected as setForceFaceTrackerConnected + * @borrows MyAvatar.getAttachmentData as getAttachmentData + * @borrows MyAvatar.setAttachmentData as setAttachmentData + * @borrows MyAvatar.attach as attach + * @borrows MyAvatar.detachOne as detachOne + * @borrows MyAvatar.detachAll as detachAll + * @borrows MyAvatar.getAvatarEntityData as getAvatarEntityData + * @borrows MyAvatar.setAvatarEntityData as setAvatarEntityData + * @borrows MyAvatar.getSensorToWorldMatrix as getSensorToWorldMatrix + * @borrows MyAvatar.getSensorToWorldScale as getSensorToWorldScale + * @borrows MyAvatar.getControllerLeftHandMatrix as getControllerLeftHandMatrix + * @borrows MyAvatar.getControllerRightHandMatrix as getControllerRightHandMatrix + * @borrows MyAvatar.getDataRate as getDataRate + * @borrows MyAvatar.getUpdateRate as getUpdateRate + * @borrows MyAvatar.displayNameChanged as displayNameChanged + * @borrows MyAvatar.sessionDisplayNameChanged as sessionDisplayNameChanged + * @borrows MyAvatar.skeletonModelURLChanged as skeletonModelURLChanged + * @borrows MyAvatar.lookAtSnappingChanged as lookAtSnappingChanged + * @borrows MyAvatar.sessionUUIDChanged as sessionUUIDChanged + * @borrows MyAvatar.sendAvatarDataPacket as sendAvatarDataPacket + * @borrows MyAvatar.sendIdentityPacket as sendIdentityPacket + * @borrows MyAvatar.setJointMappingsFromNetworkReply as setJointMappingsFromNetworkReply + * @borrows MyAvatar.setSessionUUID as setSessionUUID + * @borrows MyAvatar.getAbsoluteJointRotationInObjectFrame as getAbsoluteJointRotationInObjectFrame + * @borrows MyAvatar.getAbsoluteJointTranslationInObjectFrame as getAbsoluteJointTranslationInObjectFrame + * @borrows MyAvatar.setAbsoluteJointRotationInObjectFrame as setAbsoluteJointRotationInObjectFrame + * @borrows MyAvatar.setAbsoluteJointTranslationInObjectFrame as setAbsoluteJointTranslationInObjectFrame + * @borrows MyAvatar.getTargetScale as getTargetScale + * @borrows MyAvatar.resetLastSent as resetLastSent + */ + class ScriptableAvatar : public AvatarData, public Dependency { Q_OBJECT public: - + + /**jsdoc + * @function Avatar.startAnimation + * @param {string} url + * @param {number} [fps=30] + * @param {number} [priority=1] + * @param {boolean} [loop=false] + * @param {boolean} [hold=false] + * @param {number} [firstFrame=0] + * @param {number} [lastFrame=3.403e+38] + * @param {string[]} [maskedJoints=[]] + */ /// Allows scripts to run animations. Q_INVOKABLE void startAnimation(const QString& url, float fps = 30.0f, float priority = 1.0f, bool loop = false, - bool hold = false, float firstFrame = 0.0f, float lastFrame = FLT_MAX, const QStringList& maskedJoints = QStringList()); + bool hold = false, float firstFrame = 0.0f, float lastFrame = FLT_MAX, + const QStringList& maskedJoints = QStringList()); + + /**jsdoc + * @function Avatar.stopAnimation + */ Q_INVOKABLE void stopAnimation(); + + /**jsdoc + * @function Avatar.getAnimationDetails + * @returns {Avatar.AnimationDetails} + */ Q_INVOKABLE AnimationDetails getAnimationDetails(); + virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override; virtual QByteArray toByteArrayStateful(AvatarDataDetail dataDetail, bool dropFaceTracking = false) override; - private slots: void update(float deltatime); diff --git a/assignment-client/src/entities/EntityTreeHeadlessViewer.h b/assignment-client/src/entities/EntityTreeHeadlessViewer.h index 17bb37186a..f4d5911821 100644 --- a/assignment-client/src/entities/EntityTreeHeadlessViewer.h +++ b/assignment-client/src/entities/EntityTreeHeadlessViewer.h @@ -23,6 +23,13 @@ class EntitySimulation; +/**jsdoc + * @namespace EntityViewer + * + * @hifi-assignment-client + */ +// API functions are defined in OctreeHeadlessViewer. + // Generic client side Octree renderer class. class EntityTreeHeadlessViewer : public OctreeHeadlessViewer { Q_OBJECT diff --git a/assignment-client/src/octree/OctreeHeadlessViewer.h b/assignment-client/src/octree/OctreeHeadlessViewer.h index dea91ce66f..a2a49dceb8 100644 --- a/assignment-client/src/octree/OctreeHeadlessViewer.h +++ b/assignment-client/src/octree/OctreeHeadlessViewer.h @@ -26,28 +26,101 @@ public: static void trackIncomingOctreePacket(const QByteArray& packet, const SharedNodePointer& sendingNode, bool wasStatsPacket); public slots: + + /**jsdoc + * @function EntityViewer.queryOctree + */ void queryOctree(); + // setters for camera attributes + + /**jsdoc + * @function EntityViewer.setPosition + * @param {Vec3} position + */ void setPosition(const glm::vec3& position) { _hasViewFrustum = true; _viewFrustum.setPosition(position); } + + /**jsdoc + * @function EntityViewer.setOrientation + * @param {Quat} orientation + */ void setOrientation(const glm::quat& orientation) { _hasViewFrustum = true; _viewFrustum.setOrientation(orientation); } + + /**jsdoc + * @function EntityViewer.setCenterRadius + * @param {number} radius + */ void setCenterRadius(float radius) { _hasViewFrustum = true; _viewFrustum.setCenterRadius(radius); } + + /**jsdoc + * @function EntityViewer.setKeyholeRadius + * @param {number} radius + * @deprecated Use {@link EntityViewer.setCenterRadius|setCenterRadius} instead. + */ void setKeyholeRadius(float radius) { _hasViewFrustum = true; _viewFrustum.setCenterRadius(radius); } // TODO: remove this legacy support + // setters for LOD and PPS + + /**jsdoc + * @function EntityViewer.setVoxelSizeScale + * @param {number} sizeScale + */ void setVoxelSizeScale(float sizeScale) { _octreeQuery.setOctreeSizeScale(sizeScale) ; } + + /**jsdoc + * @function EntityViewer.setBoundaryLevelAdjust + * @param {number} boundaryLevelAdjust + */ void setBoundaryLevelAdjust(int boundaryLevelAdjust) { _octreeQuery.setBoundaryLevelAdjust(boundaryLevelAdjust); } + + /**jsdoc + * @function EntityViewer.setMaxPacketsPerSecond + * @param {number} maxPacketsPerSecond + */ void setMaxPacketsPerSecond(int maxPacketsPerSecond) { _octreeQuery.setMaxQueryPacketsPerSecond(maxPacketsPerSecond); } // getters for camera attributes + + /**jsdoc + * @function EntityViewer.getPosition + * @returns {Vec3} + */ const glm::vec3& getPosition() const { return _viewFrustum.getPosition(); } + + /**jsdoc + * @function EntityViewer.getOrientation + * @returns {Quat} + */ const glm::quat& getOrientation() const { return _viewFrustum.getOrientation(); } + // getters for LOD and PPS + + /**jsdoc + * @function EntityViewer.getVoxelSizeScale + * @returns {number} + */ float getVoxelSizeScale() const { return _octreeQuery.getOctreeSizeScale(); } + + /**jsdoc + * @function EntityViewer.getBoundaryLevelAdjust + * @returns {number} + */ int getBoundaryLevelAdjust() const { return _octreeQuery.getBoundaryLevelAdjust(); } + + /**jsdoc + * @function EntityViewer.getMaxPacketsPerSecond + * @returns {number} + */ int getMaxPacketsPerSecond() const { return _octreeQuery.getMaxQueryPacketsPerSecond(); } + + /**jsdoc + * @function EntityViewer.getOctreeElementsCount + * @returns {number} + */ unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); } private: diff --git a/interface/src/Bookmarks.h b/interface/src/Bookmarks.h index 7bd32ce7f1..dc08d4b279 100644 --- a/interface/src/Bookmarks.h +++ b/interface/src/Bookmarks.h @@ -51,6 +51,9 @@ protected slots: /**jsdoc * @function AvatarBookmarks.deleteBookmark */ + /**jsdoc + * @function LocationBookmarks.deleteBookmark + */ void deleteBookmark(); private: diff --git a/interface/src/LocationBookmarks.h b/interface/src/LocationBookmarks.h index 39abea9ba4..70ea50e2e7 100644 --- a/interface/src/LocationBookmarks.h +++ b/interface/src/LocationBookmarks.h @@ -16,6 +16,13 @@ #include "Bookmarks.h" +/**jsdoc + * @namespace LocationBookmarks + * + * @hifi-client-entity + * @hifi-interface + */ + class LocationBookmarks : public Bookmarks, public Dependency { Q_OBJECT SINGLETON_DEPENDENCY @@ -27,7 +34,16 @@ public: static const QString HOME_BOOKMARK; public slots: + + /**jsdoc + * @function LocationBookmarks.addBookmark + */ void addBookmark(); + + /**jsdoc + * @function LocationBookmarks.setHomeLocationToAddress + * @param {string} address + */ void setHomeLocationToAddress(const QVariant& address); protected: diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index 7f5aa00466..6a3d0355f6 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -29,10 +29,25 @@ /**jsdoc * The AvatarManager API has properties and methods which manage Avatars within the same domain. + * + *

Note: This API is also provided to Interface and client entity scripts as the synonym, + * AvatarList. For assignment client scripts, see the separate {@link AvatarList} API. + * * @namespace AvatarManager * * @hifi-interface * @hifi-client-entity + * + * @borrows AvatarList.getAvatarIdentifiers as getAvatarIdentifiers + * @borrows AvatarList.getAvatarsInRange as getAvatarsInRange + * @borrows AvatarList.avatarAddedEvent as avatarAddedEvent + * @borrows AvatarList.avatarRemovedEvent as avatarRemovedEvent + * @borrows AvatarList.avatarSessionChangedEvent as avatarSessionChangedEvent + * @borrows AvatarList.isAvatarInRange as isAvatarInRange + * @borrows AvatarList.sessionUUIDChanged as sessionUUIDChanged + * @borrows AvatarList.processAvatarDataPacket as processAvatarDataPacket + * @borrows AvatarList.processAvatarIdentityPacket as processAvatarIdentityPacket + * @borrows AvatarList.processKillAvatar as processKillAvatar */ class AvatarManager : public AvatarHashMap { diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 154e2e4d09..fa6a675d99 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -137,9 +137,9 @@ class MyAvatar : public Avatar { * @property {number} scale * @property {number} density Read-only. * @property {Vec3} handPosition - * @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of MyAvatar. Yaw - * is sometimes called "heading". - * @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of MyAvatar. Pitch is + * @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar. + * Yaw is sometimes called "heading". + * @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is * sometimes called "elevation". * @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is * sometimes called "bank". diff --git a/interface/src/raypick/LaserPointerScriptingInterface.h b/interface/src/raypick/LaserPointerScriptingInterface.h index c2e6c8f113..5aaacd7960 100644 --- a/interface/src/raypick/LaserPointerScriptingInterface.h +++ b/interface/src/raypick/LaserPointerScriptingInterface.h @@ -20,24 +20,122 @@ class LaserPointerScriptingInterface : public QObject, public Dependency { Q_OBJECT SINGLETON_DEPENDENCY +/**jsdoc + * Synonym for {@link Pointers} as used for laser pointers. + * + * @namespace LaserPointers + * + * @hifi-interface + * @hifi-client-entity + */ public: + + /**jsdoc + * @function LaserPointers.createLaserPointer + * @param {Pointers.LaserPointerProperties} properties + * @returns {number} + */ Q_INVOKABLE unsigned int createLaserPointer(const QVariant& properties) const; + + /**jsdoc + * @function LaserPointers.enableLaserPointer + * @param {number} id + */ Q_INVOKABLE void enableLaserPointer(unsigned int uid) const { DependencyManager::get()->enablePointer(uid); } + + /**jsdoc + * @function LaserPointers.disableLaserPointer + * @param {number} id + */ Q_INVOKABLE void disableLaserPointer(unsigned int uid) const { DependencyManager::get()->disablePointer(uid); } + + /**jsdoc + * @function LaserPointers.removeLaserPointer + * @param {number} id + */ Q_INVOKABLE void removeLaserPointer(unsigned int uid) const { DependencyManager::get()->removePointer(uid); } + + /**jsdoc + * @function LaserPointers.editRenderState + * @param {number} id + * @param {string} renderState + * @param {Pointers.RayPointerRenderState} properties + */ Q_INVOKABLE void editRenderState(unsigned int uid, const QString& renderState, const QVariant& properties) const; + + /**jsdoc + * @function LaserPointers.setRenderState + * @param {string} renderState + * @param {number} id + */ Q_INVOKABLE void setRenderState(unsigned int uid, const QString& renderState) const { DependencyManager::get()->setRenderState(uid, renderState.toStdString()); } + + /**jsdoc + * @function LaserPointers.getPrevRayPickResult + * @param {number} id + * @returns {RayPickResult} + */ Q_INVOKABLE QVariantMap getPrevRayPickResult(unsigned int uid) const; + + /**jsdoc + * @function LaserPointers.setPrecisionPicking + * @param {number} id + * @param {boolean} precisionPicking + */ Q_INVOKABLE void setPrecisionPicking(unsigned int uid, bool precisionPicking) const { DependencyManager::get()->setPrecisionPicking(uid, precisionPicking); } + + /**jsdoc + * @function LaserPointers.setLaserLength + * @param {number} id + * @param {number} laserLength + */ Q_INVOKABLE void setLaserLength(unsigned int uid, float laserLength) const { DependencyManager::get()->setLength(uid, laserLength); } + + /**jsdoc + * @function LaserPointers.setIgnoreItems + * @param {number} id + * @param {Uuid[]} ignoreItems + */ Q_INVOKABLE void setIgnoreItems(unsigned int uid, const QScriptValue& ignoreEntities) const; + + /**jsdoc + * @function LaserPointers.setIncludeItems + * @param {number} id + * @param {Uuid[]} includeItems + */ Q_INVOKABLE void setIncludeItems(unsigned int uid, const QScriptValue& includeEntities) const; + + /**jsdoc + * @function LaserPointers.setLockEndUUID + * @param {number} id + * @param {Uuid} itemID + * @param {boolean} isOverlay + * @param {Mat4} [offsetMat] + */ Q_INVOKABLE void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const { DependencyManager::get()->setLockEndUUID(uid, objectID, isOverlay, offsetMat); } + + /**jsdoc + * @function LaserPointers.isLeftHand + * @param {number} id + * @returns {boolean} + */ Q_INVOKABLE bool isLeftHand(unsigned int uid) { return DependencyManager::get()->isLeftHand(uid); } + + /**jsdoc + * @function LaserPointers.isRightHand + * @param {number} id + * @returns {boolean} + */ Q_INVOKABLE bool isRightHand(unsigned int uid) { return DependencyManager::get()->isRightHand(uid); } + + /**jsdoc + * @function LaserPointers.isMouse + * @param {number} id + * @returns {boolean} + */ Q_INVOKABLE bool isMouse(unsigned int uid) { return DependencyManager::get()->isMouse(uid); } }; diff --git a/interface/src/raypick/PickScriptingInterface.cpp b/interface/src/raypick/PickScriptingInterface.cpp index 1bf6dd2f8e..8da6e7c615 100644 --- a/interface/src/raypick/PickScriptingInterface.cpp +++ b/interface/src/raypick/PickScriptingInterface.cpp @@ -31,6 +31,20 @@ unsigned int PickScriptingInterface::createPick(const PickQuery::PickType type, } } +/**jsdoc + * A set of properties that can be passed to {@link Picks.createPick} to create a new Ray Pick. + * @typedef {object} Picks.RayPickProperties + * @property {boolean} [enabled=false] If this Pick should start enabled or not. Disabled Picks do not updated their pick results. + * @property {number} [filter=Picks.PICK_NOTHING] The filter for this Pick to use, constructed using filter flags combined using bitwise OR. + * @property {float} [maxDistance=0.0] The max distance at which this Pick will intersect. 0.0 = no max. < 0.0 is invalid. + * @property {string} [joint] Only for Joint or Mouse Ray Picks. If "Mouse", it will create a Ray Pick that follows the system mouse, in desktop or HMD. + * If "Avatar", it will create a Joint Ray Pick that follows your avatar's head. Otherwise, it will create a Joint Ray Pick that follows the given joint, if it + * exists on your current avatar. + * @property {Vec3} [posOffset=Vec3.ZERO] Only for Joint Ray Picks. A local joint position offset, in meters. x = upward, y = forward, z = lateral + * @property {Vec3} [dirOffset=Vec3.UP] Only for Joint Ray Picks. A local joint direction offset. x = upward, y = forward, z = lateral + * @property {Vec3} [position] Only for Static Ray Picks. The world-space origin of the ray. + * @property {Vec3} [direction=-Vec3.UP] Only for Static Ray Picks. The world-space direction of the ray. + */ unsigned int PickScriptingInterface::createRayPick(const QVariant& properties) { QVariantMap propMap = properties.toMap(); @@ -83,6 +97,14 @@ unsigned int PickScriptingInterface::createRayPick(const QVariant& properties) { return PickManager::INVALID_PICK_ID; } +/**jsdoc + * A set of properties that can be passed to {@link Picks.createPick} to create a new Stylus Pick. + * @typedef {object} Picks.StylusPickProperties + * @property {number} [hand=-1] An integer. 0 == left, 1 == right. Invalid otherwise. + * @property {boolean} [enabled=false] If this Pick should start enabled or not. Disabled Picks do not updated their pick results. + * @property {number} [filter=Picks.PICK_NOTHING] The filter for this Pick to use, constructed using filter flags combined using bitwise OR. + * @property {float} [maxDistance=0.0] The max distance at which this Pick will intersect. 0.0 = no max. < 0.0 is invalid. + */ unsigned int PickScriptingInterface::createStylusPick(const QVariant& properties) { QVariantMap propMap = properties.toMap(); diff --git a/interface/src/raypick/PickScriptingInterface.h b/interface/src/raypick/PickScriptingInterface.h index 2568dd8457..a39aa3a4a1 100644 --- a/interface/src/raypick/PickScriptingInterface.h +++ b/interface/src/raypick/PickScriptingInterface.h @@ -22,19 +22,22 @@ * @hifi-interface * @hifi-client-entity * - * @property PICK_NOTHING {number} A filter flag. Don't intersect with anything. - * @property PICK_ENTITIES {number} A filter flag. Include entities when intersecting. - * @property PICK_OVERLAYS {number} A filter flag. Include overlays when intersecting. - * @property PICK_AVATARS {number} A filter flag. Include avatars when intersecting. - * @property PICK_HUD {number} A filter flag. Include the HUD sphere when intersecting in HMD mode. - * @property PICK_COARSE {number} A filter flag. Pick against coarse meshes, instead of exact meshes. - * @property PICK_INCLUDE_INVISIBLE {number} A filter flag. Include invisible objects when intersecting. - * @property PICK_INCLUDE_NONCOLLIDABLE {number} A filter flag. Include non-collidable objects when intersecting. - * @property INTERSECTED_NONE {number} An intersection type. Intersected nothing with the given filter flags. - * @property INTERSECTED_ENTITY {number} An intersection type. Intersected an entity. - * @property INTERSECTED_OVERLAY {number} An intersection type. Intersected an overlay. - * @property INTERSECTED_AVATAR {number} An intersection type. Intersected an avatar. - * @property INTERSECTED_HUD {number} An intersection type. Intersected the HUD sphere. + * @property PICK_NOTHING {number} A filter flag. Don't intersect with anything. Read-only. + * @property PICK_ENTITIES {number} A filter flag. Include entities when intersecting. Read-only. + * @property PICK_OVERLAYS {number} A filter flag. Include overlays when intersecting. Read-only. + * @property PICK_AVATARS {number} A filter flag. Include avatars when intersecting. Read-only. + * @property PICK_HUD {number} A filter flag. Include the HUD sphere when intersecting in HMD mode. Read-only. + * @property PICK_COARSE {number} A filter flag. Pick against coarse meshes, instead of exact meshes. Read-only. + * @property PICK_INCLUDE_INVISIBLE {number} A filter flag. Include invisible objects when intersecting. Read-only. + * @property PICK_INCLUDE_NONCOLLIDABLE {number} A filter flag. Include non-collidable objects when intersecting. + * Read-only. + * @property PICK_ALL_INTERSECTIONS {number} Read-only. + * @property INTERSECTED_NONE {number} An intersection type. Intersected nothing with the given filter flags. Read-only. + * @property INTERSECTED_ENTITY {number} An intersection type. Intersected an entity. Read-only. + * @property INTERSECTED_OVERLAY {number} An intersection type. Intersected an overlay. Read-only. + * @property INTERSECTED_AVATAR {number} An intersection type. Intersected an avatar. Read-only. + * @property INTERSECTED_HUD {number} An intersection type. Intersected the HUD sphere. Read-only. + * @property {number} perFrameTimeBudget - The max number of usec to spend per frame updating Pick results. Read-only. */ class PickScriptingInterface : public QObject, public Dependency { @@ -61,46 +64,31 @@ public: void registerMetaTypes(QScriptEngine* engine); - /**jsdoc - * A set of properties that can be passed to {@link Picks.createPick} to create a new Pick. - * - * Different {@link Picks.PickType}s use different properties, and within one PickType, the properties you choose can lead to a wide range of behaviors. For example, - * with PickType.Ray, depending on which optional parameters you pass, you could create a Static Ray Pick, a Mouse Ray Pick, or a Joint Ray Pick. - * - * @typedef {Object} Picks.PickProperties - * @property {boolean} [enabled=false] If this Pick should start enabled or not. Disabled Picks do not updated their pick results. - * @property {number} [filter=Picks.PICK_NOTHING] The filter for this Pick to use, constructed using filter flags combined using bitwise OR. - * @property {float} [maxDistance=0.0] The max distance at which this Pick will intersect. 0.0 = no max. < 0.0 is invalid. - * @property {string} [joint] Only for Joint or Mouse Ray Picks. If "Mouse", it will create a Ray Pick that follows the system mouse, in desktop or HMD. - * If "Avatar", it will create a Joint Ray Pick that follows your avatar's head. Otherwise, it will create a Joint Ray Pick that follows the given joint, if it - * exists on your current avatar. - * @property {Vec3} [posOffset=Vec3.ZERO] Only for Joint Ray Picks. A local joint position offset, in meters. x = upward, y = forward, z = lateral - * @property {Vec3} [dirOffset=Vec3.UP] Only for Joint Ray Picks. A local joint direction offset. x = upward, y = forward, z = lateral - * @property {Vec3} [position] Only for Static Ray Picks. The world-space origin of the ray. - * @property {Vec3} [direction=-Vec3.UP] Only for Static Ray Picks. The world-space direction of the ray. - * @property {number} [hand=-1] Only for Stylus Picks. An integer. 0 == left, 1 == right. Invalid otherwise. - */ - /**jsdoc * Adds a new Pick. + * Different {@link PickType}s use different properties, and within one PickType, the properties you choose can lead to a wide range of behaviors. For example, + * with PickType.Ray, depending on which optional parameters you pass, you could create a Static Ray Pick, a Mouse Ray Pick, or a Joint Ray Pick. * @function Picks.createPick - * @param {Picks.PickType} type A PickType that specifies the method of picking to use - * @param {Picks.PickProperties} properties A PickProperties object, containing all the properties for initializing this Pick + * @param {PickType} type A PickType that specifies the method of picking to use + * @param {Picks.RayPickProperties|Picks.StylusPickProperties} properties A PickProperties object, containing all the properties for initializing this Pick * @returns {number} The ID of the created Pick. Used for managing the Pick. 0 if invalid. */ Q_INVOKABLE unsigned int createPick(const PickQuery::PickType type, const QVariant& properties); + /**jsdoc * Enables a Pick. * @function Picks.enablePick * @param {number} uid The ID of the Pick, as returned by {@link Picks.createPick}. */ Q_INVOKABLE void enablePick(unsigned int uid); + /**jsdoc * Disables a Pick. * @function Picks.disablePick * @param {number} uid The ID of the Pick, as returned by {@link Picks.createPick}. */ Q_INVOKABLE void disablePick(unsigned int uid); + /**jsdoc * Removes a Pick. * @function Picks.removePick @@ -111,7 +99,7 @@ public: /**jsdoc * An intersection result for a Ray Pick. * - * @typedef {Object} Picks.RayPickResult + * @typedef {Object} RayPickResult * @property {number} type The intersection type. * @property {boolean} intersects If there was a valid intersection (type != INTERSECTED_NONE) * @property {Uuid} objectID The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections. @@ -125,7 +113,7 @@ public: /**jsdoc * An intersection result for a Stylus Pick. * - * @typedef {Object} Picks.StylusPickResult + * @typedef {Object} StylusPickResult * @property {number} type The intersection type. * @property {boolean} intersects If there was a valid intersection (type != INTERSECTED_NONE) * @property {Uuid} objectID The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections. @@ -140,7 +128,7 @@ public: * Get the most recent pick result from this Pick. This will be updated as long as the Pick is enabled. * @function Picks.getPrevPickResult * @param {number} uid The ID of the Pick, as returned by {@link Picks.createPick}. - * @returns {PickResult} The most recent intersection result. This will be slightly different for different PickTypes. See {@link Picks.RayPickResult} and {@link Picks.StylusPickResult}. + * @returns {RayPickResult|StylusPickResult} The most recent intersection result. This will be different for different PickTypes. */ Q_INVOKABLE QVariantMap getPrevPickResult(unsigned int uid); @@ -151,6 +139,7 @@ public: * @param {boolean} precisionPicking Whether or not to use precision picking */ Q_INVOKABLE void setPrecisionPicking(unsigned int uid, bool precisionPicking); + /**jsdoc * Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs to ignore during intersection. Not used by Stylus Picks. * @function Picks.setIgnoreItems @@ -158,6 +147,7 @@ public: * @param {Uuid[]} ignoreItems A list of IDs to ignore. */ Q_INVOKABLE void setIgnoreItems(unsigned int uid, const QScriptValue& ignoreItems); + /**jsdoc * Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs to include during intersection, instead of intersecting with everything. Stylus * Picks only intersect with objects in their include list. @@ -174,6 +164,7 @@ public: * @returns {boolean} True if the Pick is a Joint Ray Pick with joint == "_CONTROLLER_LEFTHAND" or "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND", or a Stylus Pick with hand == 0. */ Q_INVOKABLE bool isLeftHand(unsigned int uid); + /**jsdoc * Check if a Pick is associated with the right hand. * @function Picks.isRightHand @@ -181,6 +172,7 @@ public: * @returns {boolean} True if the Pick is a Joint Ray Pick with joint == "_CONTROLLER_RIGHTHAND" or "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND", or a Stylus Pick with hand == 1. */ Q_INVOKABLE bool isRightHand(unsigned int uid); + /**jsdoc * Check if a Pick is associated with the system mouse. * @function Picks.isMouse @@ -189,28 +181,96 @@ public: */ Q_INVOKABLE bool isMouse(unsigned int uid); + // FIXME: Move to other property definitions. Q_PROPERTY(unsigned int perFrameTimeBudget READ getPerFrameTimeBudget WRITE setPerFrameTimeBudget) - /**jsdoc - * The max number of usec to spend per frame updating Pick results. - * @typedef {number} Picks.perFrameTimeBudget - */ + unsigned int getPerFrameTimeBudget() const; void setPerFrameTimeBudget(unsigned int numUsecs); public slots: + + /**jsdoc + * @function Picks.PICK_NOTHING + * @returns {number} + */ static constexpr unsigned int PICK_NOTHING() { return 0; } + + /**jsdoc + * @function Picks.PICK_ENTITIES + * @returns {number} + */ static constexpr unsigned int PICK_ENTITIES() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_ENTITIES); } + + /**jsdoc + * @function Picks.PICK_OVERLAYS + * @returns {number} + */ static constexpr unsigned int PICK_OVERLAYS() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_OVERLAYS); } + + /**jsdoc + * @function Picks.PICK_AVATARS + * @returns {number} + */ static constexpr unsigned int PICK_AVATARS() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_AVATARS); } + + /**jsdoc + * @function Picks.PICK_HUD + * @returns {number} + */ static constexpr unsigned int PICK_HUD() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_HUD); } + + /**jsdoc + * @function Picks.PICK_COARSE + * @returns {number} + */ static constexpr unsigned int PICK_COARSE() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_COARSE); } + + /**jsdoc + * @function Picks.PICK_INCLUDE_INVISIBLE + * @returns {number} + */ static constexpr unsigned int PICK_INCLUDE_INVISIBLE() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_INCLUDE_INVISIBLE); } + + /**jsdoc + * @function Picks.PICK_INCLUDE_NONCOLLIDABLE + * @returns {number} + */ static constexpr unsigned int PICK_INCLUDE_NONCOLLIDABLE() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_INCLUDE_NONCOLLIDABLE); } + + /**jsdoc + * @function Picks.PICK_ALL_INTERSECTIONS + * @returns {number} + */ static constexpr unsigned int PICK_ALL_INTERSECTIONS() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_ALL_INTERSECTIONS); } + + /**jsdoc + * @function Picks.INTERSECTED_NONE + * @returns {number} + */ static constexpr unsigned int INTERSECTED_NONE() { return IntersectionType::NONE; } + + /**jsdoc + * @function Picks.INTERSECTED_ENTITY + * @returns {number} + */ static constexpr unsigned int INTERSECTED_ENTITY() { return IntersectionType::ENTITY; } + + /**jsdoc + * @function Picks.INTERSECTED_OVERLAY + * @returns {number} + */ static constexpr unsigned int INTERSECTED_OVERLAY() { return IntersectionType::OVERLAY; } + + /**jsdoc + * @function Picks.INTERSECTED_AVATAR + * @returns {number} + */ static constexpr unsigned int INTERSECTED_AVATAR() { return IntersectionType::AVATAR; } + + /**jsdoc + * @function Picks.INTERSECTED_HUD + * @returns {number} + */ static constexpr unsigned int INTERSECTED_HUD() { return IntersectionType::HUD; } }; diff --git a/interface/src/raypick/PointerScriptingInterface.cpp b/interface/src/raypick/PointerScriptingInterface.cpp index ac5a467e76..b7ac899c8d 100644 --- a/interface/src/raypick/PointerScriptingInterface.cpp +++ b/interface/src/raypick/PointerScriptingInterface.cpp @@ -42,6 +42,12 @@ unsigned int PointerScriptingInterface::createPointer(const PickQuery::PickType& } } +/**jsdoc + * A set of properties that can be passed to {@link Pointers.createPointer} to create a new Pointer. Contains the relevant {@link Picks.PickProperties} to define the underlying Pick. + * @typedef {object} Pointers.StylusPointerProperties + * @property {boolean} [hover=false] If this pointer should generate hover events. + * @property {boolean} [enabled=false] + */ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) const { QVariantMap propertyMap = properties.toMap(); @@ -58,6 +64,48 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) return DependencyManager::get()->addPointer(std::make_shared(properties, StylusPointer::buildStylusOverlay(propertyMap), hover, enabled)); } +/**jsdoc + * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is not intersecting something. Same as a {@link Pointers.RayPointerRenderState}, + * but with an additional distance field. + * + * @typedef {Object} Pointers.DefaultRayPointerRenderState + * @augments Pointers.RayPointerRenderState + * @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined. + */ +/**jsdoc + * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is intersecting something. + * + * @typedef {Object} Pointers.RayPointerRenderState + * @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState} + * @property {Overlays.OverlayProperties} [start] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a type field). + * An overlay to represent the beginning of the Ray Pointer, if desired. + * @property {Overlays.OverlayProperties} [path] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a type field), which must be "line3d". + * An overlay to represent the path of the Ray Pointer, if desired. + * @property {Overlays.OverlayProperties} [end] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a type field). + * An overlay to represent the end of the Ray Pointer, if desired. + */ +/**jsdoc + * A trigger mechanism for Ray Pointers. + * + * @typedef {Object} Pointers.Trigger + * @property {Controller.Standard|Controller.Actions|function} action This can be a built-in Controller action, like Controller.Standard.LTClick, or a function that evaluates to >= 1.0 when you want to trigger button. + * @property {string} button Which button to trigger. "Primary", "Secondary", "Tertiary", and "Focus" are currently supported. Only "Primary" will trigger clicks on web surfaces. If "Focus" is triggered, + * it will try to set the entity or overlay focus to the object at which the Pointer is aimed. Buttons besides the first three will still trigger events, but event.button will be "None". + */ +/**jsdoc + * A set of properties that can be passed to {@link Pointers.createPointer} to create a new Pointer. Contains the relevant {@link Picks.PickProperties} to define the underlying Pick. + * @typedef {object} Pointers.LaserPointerProperties + * @property {boolean} [faceAvatar=false] Ray Pointers only. If true, the end of the Pointer will always rotate to face the avatar. + * @property {boolean} [centerEndY=true] Ray Pointers only. If false, the end of the Pointer will be moved up by half of its height. + * @property {boolean} [lockEnd=false] Ray Pointers only. If true, the end of the Pointer will lock on to the center of the object at which the laser is pointing. + * @property {boolean} [distanceScaleEnd=false] Ray Pointers only. If true, the dimensions of the end of the Pointer will scale linearly with distance. + * @property {boolean} [scaleWithAvatar=false] Ray Pointers only. If true, the width of the Pointer's path will scale linearly with your avatar's scale. + * @property {boolean} [enabled=false] + * @property {Pointers.RayPointerRenderState[]} [renderStates] Ray Pointers only. A list of different visual states to switch between. + * @property {Pointers.DefaultRayPointerRenderState[]} [defaultRenderStates] Ray Pointers only. A list of different visual states to use if there is no intersection. + * @property {boolean} [hover=false] If this Pointer should generate hover events. + * @property {Pointers.Trigger[]} [triggers] Ray Pointers only. A list of different triggers mechanisms that control this Pointer's click event generation. + */ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& properties) const { QVariantMap propertyMap = properties.toMap(); diff --git a/interface/src/raypick/PointerScriptingInterface.h b/interface/src/raypick/PointerScriptingInterface.h index e7acfd4037..49eb40504d 100644 --- a/interface/src/raypick/PointerScriptingInterface.h +++ b/interface/src/raypick/PointerScriptingInterface.h @@ -16,7 +16,7 @@ /**jsdoc * The Pointers API lets you create and manage objects for repeatedly calculating intersections in different ways, as well as the visual representation of those objects. - * Pointers can also be configured to automatically generate PointerEvents. + * Pointers can also be configured to automatically generate {@link PointerEvent}s on {@link Entities} and {@link Overlays}. * * @namespace Pointers * @@ -33,59 +33,12 @@ public: unsigned int createStylus(const QVariant& properties) const; /**jsdoc - * A set of properties that can be passed to {@link Pointers.createPointer} to create a new Pointer. Also contains the relevant {@link Picks.PickProperties} to define the underlying Pick. - * + * Adds a new Pointer * Different {@link PickType}s use different properties, and within one PickType, the properties you choose can lead to a wide range of behaviors. For example, * with PickType.Ray, depending on which optional parameters you pass, you could create a Static Ray Pointer, a Mouse Ray Pointer, or a Joint Ray Pointer. - * - * @typedef {Object} Pointers.PointerProperties - * @property {boolean} [hover=false] If this Pointer should generate hover events. - * @property {boolean} [faceAvatar=false] Ray Pointers only. If true, the end of the Pointer will always rotate to face the avatar. - * @property {boolean} [centerEndY=true] Ray Pointers only. If false, the end of the Pointer will be moved up by half of its height. - * @property {boolean} [lockEnd=false] Ray Pointers only. If true, the end of the Pointer will lock on to the center of the object at which the laser is pointing. - * @property {boolean} [distanceScaleEnd=false] Ray Pointers only. If true, the dimensions of the end of the Pointer will scale linearly with distance. - * @property {boolean} [scaleWithAvatar=false] Ray Pointers only. If true, the width of the Pointer's path will scale linearly with your avatar's scale. - * @property {Pointers.RayPointerRenderState[]} [renderStates] Ray Pointers only. A list of different visual states to switch between. - * @property {Pointers.DefaultRayPointerRenderState[]} [defaultRenderStates] Ray Pointers only. A list of different visual states to use if there is no intersection. - * @property {Pointers.Trigger[]} [triggers] Ray Pointers only. A list of different triggers mechanisms that control this Pointer's click event generation. - */ - - /**jsdoc - * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is intersecting something. - * - * @typedef {Object} Pointers.RayPointerRenderState - * @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState} - * @property {OverlayProperties} [start] All of the properties you would normally pass to {@Overlays.addOverlay}, plus the type (as a type field). - * An overlay to represent the beginning of the Ray Pointer, if desired. - * @property {OverlayProperties} [path] All of the properties you would normally pass to {@Overlays.addOverlay}, plus the type (as a type field), which must be "line3d". - * An overlay to represent the path of the Ray Pointer, if desired. - * @property {OverlayProperties} [end] All of the properties you would normally pass to {@Overlays.addOverlay}, plus the type (as a type field). - * An overlay to represent the end of the Ray Pointer, if desired. - */ - - /**jsdoc - * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is not intersecting something. Same as a {@link Pointers.RayPointerRenderState}, - * but with an additional distance field. - * - * @typedef {Object} Pointers.DefaultRayPointerRenderState - * @augments Pointers.RayPointerRenderState - * @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined. - */ - - /**jsdoc - * A trigger mechanism for Ray Pointers. - * - * @typedef {Object} Pointers.Trigger - * @property {Controller.Action} action This can be a built-in Controller action, like Controller.Standard.LTClick, or a function that evaluates to >= 1.0 when you want to trigger button. - * @property {string} button Which button to trigger. "Primary", "Secondary", "Tertiary", and "Focus" are currently supported. Only "Primary" will trigger clicks on web surfaces. If "Focus" is triggered, - * it will try to set the entity or overlay focus to the object at which the Pointer is aimed. Buttons besides the first three will still trigger events, but event.button will be "None". - */ - - /**jsdoc - * Adds a new Pointer * @function Pointers.createPointer - * @param {Picks.PickType} type A PickType that specifies the method of picking to use - * @param {Pointers.PointerProperties} properties A PointerProperties object, containing all the properties for initializing this Pointer and the {@link Picks.PickProperties} for the Pick that + * @param {PickType} type A PickType that specifies the method of picking to use + * @param {Pointers.LaserPointerProperties|Pointers.StylusPointerProperties} properties A PointerProperties object, containing all the properties for initializing this Pointer and the {@link Picks.PickProperties} for the Pick that * this Pointer will use to do its picking. * @returns {number} The ID of the created Pointer. Used for managing the Pointer. 0 if invalid. * @@ -121,32 +74,37 @@ public: * Pointers.setRenderState(pointer, "test"); */ Q_INVOKABLE unsigned int createPointer(const PickQuery::PickType& type, const QVariant& properties); + /**jsdoc * Enables a Pointer. * @function Pointers.enablePointer * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. */ Q_INVOKABLE void enablePointer(unsigned int uid) const { DependencyManager::get()->enablePointer(uid); } + /**jsdoc * Disables a Pointer. * @function Pointers.disablePointer * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. */ Q_INVOKABLE void disablePointer(unsigned int uid) const { DependencyManager::get()->disablePointer(uid); } + /**jsdoc * Removes a Pointer. * @function Pointers.removePointer * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. */ Q_INVOKABLE void removePointer(unsigned int uid) const { DependencyManager::get()->removePointer(uid); } + /**jsdoc * Edit some visual aspect of a Pointer. Currently only supported for Ray Pointers. * @function Pointers.editRenderState * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. * @param {string} renderState The name of the render state you want to edit. - * @param {RenderState} properties The new properties for renderState. For Ray Pointers, a {@link Pointers.RayPointerRenderState}. + * @param {Pointers.RayPointerRenderState} properties The new properties for renderStates item. */ Q_INVOKABLE void editRenderState(unsigned int uid, const QString& renderState, const QVariant& properties) const; + /**jsdoc * Set the render state of a Pointer. For Ray Pointers, this means switching between their {@link Pointers.RayPointerRenderState}s, or "" to turn off rendering and hover/trigger events. * For Stylus Pointers, there are three built-in options: "events on" (render and send events, the default), "events off" (render but don't send events), and "disabled" (don't render, don't send events). @@ -156,14 +114,16 @@ public: */ Q_INVOKABLE void setRenderState(unsigned int uid, const QString& renderState) const { DependencyManager::get()->setRenderState(uid, renderState.toStdString()); } + /**jsdoc * Get the most recent pick result from this Pointer. This will be updated as long as the Pointer is enabled, regardless of the render state. * @function Pointers.getPrevPickResult * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. - * @returns {PickResult} The most recent intersection result. This will be slightly different for different PickTypes. See {@link Picks.RayPickResult} and {@link Picks.StylusPickResult}. + * @returns {RayPickResult|StylusPickResult} The most recent intersection result. This will be slightly different for different PickTypes. */ Q_INVOKABLE QVariantMap getPrevPickResult(unsigned int uid) const; + /**jsdoc * Sets whether or not to use precision picking. * @function Pointers.setPrecisionPicking @@ -171,6 +131,7 @@ public: * @param {boolean} precisionPicking Whether or not to use precision picking */ Q_INVOKABLE void setPrecisionPicking(unsigned int uid, bool precisionPicking) const { DependencyManager::get()->setPrecisionPicking(uid, precisionPicking); } + /**jsdoc * Sets the length of this Pointer. No effect on Stylus Pointers. * @function Pointers.setLength @@ -178,6 +139,7 @@ public: * @param {float} length The desired length of the Pointer. */ Q_INVOKABLE void setLength(unsigned int uid, float length) const { DependencyManager::get()->setLength(uid, length); } + /**jsdoc * Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs to ignore during intersection. Not used by Stylus Pointers. * @function Pointers.setIgnoreItems @@ -185,6 +147,7 @@ public: * @param {Uuid[]} ignoreItems A list of IDs to ignore. */ Q_INVOKABLE void setIgnoreItems(unsigned int uid, const QScriptValue& ignoreEntities) const; + /**jsdoc * Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs to include during intersection, instead of intersecting with everything. Stylus * Pointers only intersect with objects in their include list. @@ -194,17 +157,19 @@ public: */ Q_INVOKABLE void setIncludeItems(unsigned int uid, const QScriptValue& includeEntities) const; + /**jsdoc * Lock a Pointer onto a specific object (overlay, entity, or avatar). Optionally, provide an offset in object-space, otherwise the Pointer will lock on to the center of the object. * Not used by Stylus Pointers. * @function Pointers.setLockEndUUID * @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}. - * @param {QUuid} objectID The ID of the object to which to lock on. + * @param {Uuid} objectID The ID of the object to which to lock on. * @param {boolean} isOverlay False for entities or avatars, true for overlays * @param {Mat4} [offsetMat] The offset matrix to use if you do not want to lock on to the center of the object. */ Q_INVOKABLE void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const { DependencyManager::get()->setLockEndUUID(uid, objectID, isOverlay, offsetMat); } + /**jsdoc * Check if a Pointer is associated with the left hand. * @function Pointers.isLeftHand @@ -212,6 +177,7 @@ public: * @returns {boolean} True if the Pointer is a Joint Ray Pointer with joint == "_CONTROLLER_LEFTHAND" or "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND", or a Stylus Pointer with hand == 0 */ Q_INVOKABLE bool isLeftHand(unsigned int uid) { return DependencyManager::get()->isLeftHand(uid); } + /**jsdoc * Check if a Pointer is associated with the right hand. * @function Pointers.isRightHand @@ -219,6 +185,7 @@ public: * @returns {boolean} True if the Pointer is a Joint Ray Pointer with joint == "_CONTROLLER_RIGHTHAND" or "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND", or a Stylus Pointer with hand == 1 */ Q_INVOKABLE bool isRightHand(unsigned int uid) { return DependencyManager::get()->isRightHand(uid); } + /**jsdoc * Check if a Pointer is associated with the system mouse. * @function Pointers.isMouse diff --git a/interface/src/raypick/RayPickScriptingInterface.h b/interface/src/raypick/RayPickScriptingInterface.h index 3795f191b3..d5e224018e 100644 --- a/interface/src/raypick/RayPickScriptingInterface.h +++ b/interface/src/raypick/RayPickScriptingInterface.h @@ -18,6 +18,30 @@ #include "PickScriptingInterface.h" +/**jsdoc + * Synonym for {@link Picks} as used for ray picks. + * + * @namespace RayPick + * + * @hifi-interface + * @hifi-client-entity + * + * @property {number} PICK_NOTHING Read-only. + * @property {number} PICK_ENTITIES Read-only. + * @property {number} PICK_OVERLAYS Read-only. + * @property {number} PICK_AVATARS Read-only. + * @property {number} PICK_HUD Read-only. + * @property {number} PICK_COARSE Read-only. + * @property {number} PICK_INCLUDE_INVISIBLE Read-only. + * @property {number} PICK_INCLUDE_NONCOLLIDABLE Read-only. + * @property {number} PICK_ALL_INTERSECTIONS Read-only. + * @property {number} INTERSECTED_NONE Read-only. + * @property {number} INTERSECTED_ENTITY Read-only. + * @property {number} INTERSECTED_OVERLAY Read-only. + * @property {number} INTERSECTED_AVATAR Read-only. + * @property {number} INTERSECTED_HUD Read-only. + */ + class RayPickScriptingInterface : public QObject, public Dependency { Q_OBJECT Q_PROPERTY(unsigned int PICK_NOTHING READ PICK_NOTHING CONSTANT) @@ -37,34 +61,167 @@ class RayPickScriptingInterface : public QObject, public Dependency { SINGLETON_DEPENDENCY public: + + /**jsdoc + * @function RayPick.createRayPick + * @param {Picks.RayPickProperties} + * @returns {number} + */ Q_INVOKABLE unsigned int createRayPick(const QVariant& properties); + + /**jsdoc + * @function RayPick.enableRayPick + * @param {number} id + */ Q_INVOKABLE void enableRayPick(unsigned int uid); + + /**jsdoc + * @function RayPick.disableRayPick + * @param {number} id + */ Q_INVOKABLE void disableRayPick(unsigned int uid); + + /**jsdoc + * @function RayPick.removeRayPick + * @param {number} id + */ Q_INVOKABLE void removeRayPick(unsigned int uid); + + /**jsdoc + * @function RayPick.getPrevRayPickResult + * @param {number} id + * @returns {RayPickResult} + */ Q_INVOKABLE QVariantMap getPrevRayPickResult(unsigned int uid); + + /**jsdoc + * @function RayPick.setPrecisionPicking + * @param {number} id + * @param {boolean} precisionPicking + */ Q_INVOKABLE void setPrecisionPicking(unsigned int uid, bool precisionPicking); + + /**jsdoc + * @function RayPick.setIgnoreItems + * @param {number} id + * @param {Uuid[]) ignoreEntities + */ Q_INVOKABLE void setIgnoreItems(unsigned int uid, const QScriptValue& ignoreEntities); + + /**jsdoc + * @function RayPick.setIncludeItems + * @param {number} id + * @param {Uuid[]) includeEntities + */ Q_INVOKABLE void setIncludeItems(unsigned int uid, const QScriptValue& includeEntities); + + /**jsdoc + * @function RayPick.isLeftHand + * @param {number} id + * @returns {boolean} + */ Q_INVOKABLE bool isLeftHand(unsigned int uid); + + /**jsdoc + * @function RayPick.isRightHand + * @param {number} id + * @returns {boolean} + */ Q_INVOKABLE bool isRightHand(unsigned int uid); + + /**jsdoc + * @function RayPick.isMouse + * @param {number} id + * @returns {boolean} + */ Q_INVOKABLE bool isMouse(unsigned int uid); public slots: + + /**jsdoc + * @function RayPick.PICK_NOTHING + * @returns {number} + */ static unsigned int PICK_NOTHING() { return PickScriptingInterface::PICK_NOTHING(); } + + /**jsdoc + * @function RayPick.PICK_ENTITIES + * @returns {number} + */ static unsigned int PICK_ENTITIES() { return PickScriptingInterface::PICK_ENTITIES(); } + + /**jsdoc + * @function RayPick.PICK_OVERLAYS + * @returns {number} + */ static unsigned int PICK_OVERLAYS() { return PickScriptingInterface::PICK_OVERLAYS(); } + + /**jsdoc + * @function RayPick.PICK_AVATARS + * @returns {number} + */ static unsigned int PICK_AVATARS() { return PickScriptingInterface::PICK_AVATARS(); } + + /**jsdoc + * @function RayPick.PICK_HUD + * @returns {number} + */ static unsigned int PICK_HUD() { return PickScriptingInterface::PICK_HUD(); } + + /**jsdoc + * @function RayPick.PICK_COARSE + * @returns {number} + */ static unsigned int PICK_COARSE() { return PickScriptingInterface::PICK_COARSE(); } + + /**jsdoc + * @function RayPick.PICK_INCLUDE_INVISIBLE + * @returns {number} + */ static unsigned int PICK_INCLUDE_INVISIBLE() { return PickScriptingInterface::PICK_INCLUDE_INVISIBLE(); } + + /**jsdoc + * @function RayPick.PICK_INCLUDE_NONCOLLIDABLE + * @returns {number} + */ static unsigned int PICK_INCLUDE_NONCOLLIDABLE() { return PickScriptingInterface::PICK_INCLUDE_NONCOLLIDABLE(); } + + /**jsdoc + * @function RayPick.PICK_ALL_INTERSECTIONS + * @returns {number} + */ static unsigned int PICK_ALL_INTERSECTIONS() { return PickScriptingInterface::PICK_ALL_INTERSECTIONS(); } + + /**jsdoc + * @function RayPick.INTERSECTED_NONE + * @returns {number} + */ static unsigned int INTERSECTED_NONE() { return PickScriptingInterface::INTERSECTED_NONE(); } + + /**jsdoc + * @function RayPick.INTERSECTED_ENTITY + * @returns {number} + */ static unsigned int INTERSECTED_ENTITY() { return PickScriptingInterface::INTERSECTED_ENTITY(); } + + /**jsdoc + * @function RayPick.INTERSECTED_OVERLAY + * @returns {number} + */ static unsigned int INTERSECTED_OVERLAY() { return PickScriptingInterface::INTERSECTED_OVERLAY(); } + + /**jsdoc + * @function RayPick.INTERSECTED_AVATAR + * @returns {number} + */ static unsigned int INTERSECTED_AVATAR() { return PickScriptingInterface::INTERSECTED_AVATAR(); } + + /**jsdoc + * @function RayPick.INTERSECTED_HUD + * @returns {number} + */ static unsigned int INTERSECTED_HUD() { return PickScriptingInterface::INTERSECTED_HUD(); } }; diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index f0a4328c2f..8d16b06995 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -89,7 +89,7 @@ public: /**jsdoc * @function Audio.setReverbOptions - * @param {} options + * @param {AudioEffectOptions} options */ Q_INVOKABLE void setReverbOptions(const AudioEffectOptions* options); diff --git a/interface/src/scripting/WalletScriptingInterface.h b/interface/src/scripting/WalletScriptingInterface.h index 9e40aad087..25955ca7a3 100644 --- a/interface/src/scripting/WalletScriptingInterface.h +++ b/interface/src/scripting/WalletScriptingInterface.h @@ -30,6 +30,14 @@ public: }; +/**jsdoc + * @namespace Wallet + * + * @hifi-interface + * @hifi-client-entity + * + * @property {number} walletStatus + */ class WalletScriptingInterface : public QObject, public Dependency { Q_OBJECT @@ -38,17 +46,53 @@ class WalletScriptingInterface : public QObject, public Dependency { public: WalletScriptingInterface(); + /**jsdoc + * @function Wallet.refreshWalletStatus + */ Q_INVOKABLE void refreshWalletStatus(); + + /**jsdoc + * @function Wallet.getWalletStatus + * @returns {number} + */ Q_INVOKABLE uint getWalletStatus() { return _walletStatus; } + + /**jsdoc + * @function Wallet.proveAvatarEntityOwnershipVerification + * @param {Uuid} entityID + */ Q_INVOKABLE void proveAvatarEntityOwnershipVerification(const QUuid& entityID); + // setWalletStatus() should never be made Q_INVOKABLE. If it were, // scripts could cause the Wallet to incorrectly report its status. void setWalletStatus(const uint& status); signals: + + /**jsdoc + * @function Wallet.walletStatusChanged + * @returns {Signal} + */ void walletStatusChanged(); + + /**jsdoc + * @function Wallet.walletNotSetup + * @returns {Signal} + */ void walletNotSetup(); + + /**jsdoc + * @function Wallet.ownershipVerificationSuccess + * @param {Uuid} entityID + * @returns {Signal} + */ void ownershipVerificationSuccess(const QUuid& entityID); + + /**jsdoc + * @function Wallet.ownershipVerificationFailed + * @param {Uuid} entityID + * @returns {Signal} + */ void ownershipVerificationFailed(const QUuid& entityID); private: diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index ab92722eef..1d06f33ec0 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -374,6 +374,8 @@ public slots: * Takes a 360 snapshot given a position of the secondary camera (which does not need to have been previously set up). * @function Window.takeSecondaryCameraSnapshot * @param {vec3} [cameraPosition] - The (x, y, z) position of the camera for the 360 snapshot + * @param {boolean} [cubemapOutputFormat=false] - If true then the snapshot is saved as a cube map image, + * otherwise is saved as an equirectangular image. * @param {string} [filename=""] - If this parameter is not given, the image will be saved as 'hifi-snap-by--YYYY-MM-DD_HH-MM-SS'. * If this parameter is "" then the image will be saved as ".jpg". * Otherwise, the image will be saved to this filename, with an appended ".jpg". diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index ba9bd21cea..2bac857a97 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -36,6 +36,14 @@ private: QUrl _URL; }; + +/**jsdoc + * @namespace Snapshot + * + * @hifi-interface + * @hifi-client-entity + */ + class Snapshot : public QObject, public Dependency { Q_OBJECT SINGLETON_DEPENDENCY @@ -50,10 +58,26 @@ public: void uploadSnapshot(const QString& filename, const QUrl& href = QUrl("")); signals: + + /**jsdoc + * @function Snapshot.snapshotLocationSet + * @param {string} location + * @returns {Signal} + */ void snapshotLocationSet(const QString& value); public slots: + + /**jsdoc + * @function Snapshot.getSnapshotsLocation + * @returns {string} + */ Q_INVOKABLE QString getSnapshotsLocation(); + + /**jsdoc + * @function Snapshot.setSnapshotsLocation + * @param {String} location + */ Q_INVOKABLE void setSnapshotsLocation(const QString& location); private slots: diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index af3189f20b..5c6a3db064 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -23,6 +23,152 @@ private: \ type _##name{ initialValue }; +/**jsdoc + * @namespace Stats + * + * @hifi-interface + * @hifi-client-entity + * @hifi-server-entity + * @hifi-assignment-client + * + * @property {boolean} expanded + * @property {boolean} timingExpanded - Read-only. + * @property {string} monospaceFont - Read-only. + * + * @property {number} serverCount - Read-only. + * @property {number} renderrate - How often the app is creating new gpu::Frames. Read-only. + * @property {number} presentrate - How often the display plugin is presenting to the device. Read-only. + * @property {number} stutterrate - How often the display device is reprojecting old frames. Read-only. + * + * @property {number} appdropped - Read-only. + * @property {number} longsubmits - Read-only. + * @property {number} longrenders - Read-only. + * @property {number} longframes - Read-only. + * + * @property {number} presentnewrate - Read-only. + * @property {number} presentdroprate - Read-only. + * @property {number} gameLoopRate - Read-only. + * @property {number} avatarCount - Read-only. + * @property {number} updatedAvatarCount - Read-only. + * @property {number} notUpdatedAvatarCount - Read-only. + * @property {number} packetInCount - Read-only. + * @property {number} packetOutCount - Read-only. + * @property {number} mbpsIn - Read-only. + * @property {number} mbpsOut - Read-only. + * @property {number} assetMbpsIn - Read-only. + * @property {number} assetMbpsOut - Read-only. + * @property {number} audioPing - Read-only. + * @property {number} avatarPing - Read-only. + * @property {number} entitiesPing - Read-only. + * @property {number} assetPing - Read-only. + * @property {number} messagePing - Read-only. + * @property {Vec3} position - Read-only. + * @property {number} speed - Read-only. + * @property {number} yaw - Read-only. + * @property {number} avatarMixerInKbps - Read-only. + * @property {number} avatarMixerInPps - Read-only. + * @property {number} avatarMixerOutKbps - Read-only. + * @property {number} avatarMixerOutPps - Read-only. + * @property {number} myAvatarSendRate - Read-only. + * + * @property {number} audioMixerInKbps - Read-only. + * @property {number} audioMixerInPps - Read-only. + * @property {number} audioMixerOutKbps - Read-only. + * @property {number} audioMixerOutPps - Read-only. + * @property {number} audioMixerKbps - Read-only. + * @property {number} audioMixerPps - Read-only. + * @property {number} audioOutboundPPS - Read-only. + * @property {number} audioSilentOutboundPPS - Read-only. + * @property {number} audioAudioInboundPPS - Read-only. + * @property {number} audioSilentInboundPPS - Read-only. + * @property {number} audioPacketLoss - Read-only. + * @property {string} audioCodec - Read-only. + * @property {string} audioNoiseGate - Read-only. + * @property {number} entityPacketsInKbps - Read-only. + * + * @property {number} downloads - Read-only. + * @property {number} downloadLimit - Read-only. + * @property {number} downloadsPending - Read-only. + * @property {string[]} downloadUrls - Read-only. + * @property {number} processing - Read-only. + * @property {number} processingPending - Read-only. + * @property {number} triangles - Read-only. + * @property {number} quads - Read-only. + * @property {number} materialSwitches - Read-only. + * @property {number} itemConsidered - Read-only. + * @property {number} itemOutOfView - Read-only. + * @property {number} itemTooSmall - Read-only. + * @property {number} itemRendered - Read-only. + * @property {number} shadowConsidered - Read-only. + * @property {number} shadowOutOfView - Read-only. + * @property {number} shadowTooSmall - Read-only. + * @property {number} shadowRendered - Read-only. + * @property {string} sendingMode - Read-only. + * @property {string} packetStats - Read-only. + * @property {string} lodStatus - Read-only. + * @property {string} timingStats - Read-only. + * @property {string} gameUpdateStats - Read-only. + * @property {number} serverElements - Read-only. + * @property {number} serverInternal - Read-only. + * @property {number} serverLeaves - Read-only. + * @property {number} localElements - Read-only. + * @property {number} localInternal - Read-only. + * @property {number} localLeaves - Read-only. + * @property {number} rectifiedTextureCount - Read-only. + * @property {number} decimatedTextureCount - Read-only. + * @property {number} gpuBuffers - Read-only. + * @property {number} gpuBufferMemory - Read-only. + * @property {number} gpuTextures - Read-only. + * @property {number} glContextSwapchainMemory - Read-only. + * @property {number} qmlTextureMemory - Read-only. + * @property {number} texturePendingTransfers - Read-only. + * @property {number} gpuTextureMemory - Read-only. + * @property {number} gpuTextureResidentMemory - Read-only. + * @property {number} gpuTextureFramebufferMemory - Read-only. + * @property {number} gpuTextureResourceMemory - Read-only. + * @property {number} gpuTextureResourcePopulatedMemory - Read-only. + * @property {number} gpuTextureExternalMemory - Read-only. + * @property {string} gpuTextureMemoryPressureState - Read-only. + * @property {number} gpuFreeMemory - Read-only. + * @property {number} gpuFrameTime - Read-only. + * @property {number} batchFrameTime - Read-only. + * @property {number} engineFrameTime - Read-only. + * @property {number} avatarSimulationTime - Read-only. + * + * + * @property {number} x + * @property {number} y + * @property {number} z + * @property {number} width + * @property {number} height + * + * @property {number} opacity + * @property {boolean} enabled + * @property {boolean} visible + * + * @property {string} state + * @property {object} anchors - Read-only. + * @property {number} baselineOffset + * + * @property {boolean} clip + * + * @property {boolean} focus + * @property {boolean} activeFocus - Read-only. + * @property {boolean} activeFocusOnTab + * + * @property {number} rotation + * @property {number} scale + * @property {number} transformOrigin + * + * @property {boolean} smooth + * @property {boolean} antialiasing + * @property {number} implicitWidth + * @property {number} implicitHeight + * + * @property {object} layer - Read-only. + */ +// Properties from x onwards are QQuickItem properties. + class Stats : public QQuickItem { Q_OBJECT HIFI_QML_DECL @@ -161,105 +307,909 @@ public slots: void forceUpdateStats() { updateStats(true); } signals: + + /**jsdoc + * Triggered when the value of the longsubmits property changes. + * @function Stats.longsubmitsChanged + * @returns {Signal} + */ void longsubmitsChanged(); + + /**jsdoc + * Triggered when the value of the longrenders property changes. + * @function Stats.longrendersChanged + * @returns {Signal} + */ void longrendersChanged(); + + /**jsdoc + * Triggered when the value of the longframes property changes. + * @function Stats.longframesChanged + * @returns {Signal} + */ void longframesChanged(); + + /**jsdoc + * Triggered when the value of the appdropped property changes. + * @function Stats.appdroppedChanged + * @returns {Signal} + */ void appdroppedChanged(); + + /**jsdoc + * Triggered when the value of the expanded property changes. + * @function Stats.expandedChanged + * @returns {Signal} + */ void expandedChanged(); + + /**jsdoc + * Triggered when the value of the timingExpanded property changes. + * @function Stats.timingExpandedChanged + * @returns {Signal} + */ void timingExpandedChanged(); + + /**jsdoc + * Triggered when the value of the serverCount property changes. + * @function Stats.serverCountChanged + * @returns {Signal} + */ void serverCountChanged(); + + /**jsdoc + * Triggered when the value of the renderrate property changes. + * @function Stats.renderrateChanged + * @returns {Signal} + */ void renderrateChanged(); + + /**jsdoc + * Triggered when the value of the presentrate property changes. + * @function Stats.presentrateChanged + * @returns {Signal} + */ void presentrateChanged(); + + /**jsdoc + * Triggered when the value of the presentnewrate property changes. + * @function Stats.presentnewrateChanged + * @returns {Signal} + */ void presentnewrateChanged(); + + /**jsdoc + * Triggered when the value of the presentdroprate property changes. + * @function Stats.presentdroprateChanged + * @returns {Signal} + */ void presentdroprateChanged(); + + /**jsdoc + * Triggered when the value of the stutterrate property changes. + * @function Stats.stutterrateChanged + * @returns {Signal} + */ void stutterrateChanged(); + + /**jsdoc + * Triggered when the value of the gameLoopRate property changes. + * @function Stats.gameLoopRateChanged + * @returns {Signal} + */ void gameLoopRateChanged(); + + /**jsdoc + * Triggered when the value of the avatarCount property changes. + * @function Stats.avatarCountChanged + * @returns {Signal} + */ void avatarCountChanged(); + + /**jsdoc + * Triggered when the value of the updatedAvatarCount property changes. + * @function Stats.updatedAvatarCountChanged + * @returns {Signal} + */ void updatedAvatarCountChanged(); + + /**jsdoc + * Triggered when the value of the notUpdatedAvatarCount property changes. + * @function Stats.notUpdatedAvatarCountChanged + * @returns {Signal} + */ void notUpdatedAvatarCountChanged(); + + /**jsdoc + * Triggered when the value of the packetInCount property changes. + * @function Stats.packetInCountChanged + * @returns {Signal} + */ void packetInCountChanged(); + + /**jsdoc + * Triggered when the value of the packetOutCount property changes. + * @function Stats.packetOutCountChanged + * @returns {Signal} + */ void packetOutCountChanged(); + + /**jsdoc + * Triggered when the value of the mbpsIn property changes. + * @function Stats.mbpsInChanged + * @returns {Signal} + */ void mbpsInChanged(); + + /**jsdoc + * Triggered when the value of the mbpsOut property changes. + * @function Stats.mbpsOutChanged + * @returns {Signal} + */ void mbpsOutChanged(); + + /**jsdoc + * Triggered when the value of the assetMbpsIn property changes. + * @function Stats.assetMbpsInChanged + * @returns {Signal} + */ void assetMbpsInChanged(); + + /**jsdoc + * Triggered when the value of the assetMbpsOut property changes. + * @function Stats.assetMbpsOutChanged + * @returns {Signal} + */ void assetMbpsOutChanged(); + + /**jsdoc + * Triggered when the value of the audioPing property changes. + * @function Stats.audioPingChanged + * @returns {Signal} + */ void audioPingChanged(); + + /**jsdoc + * Triggered when the value of the avatarPing property changes. + * @function Stats.avatarPingChanged + * @returns {Signal} + */ void avatarPingChanged(); + + /**jsdoc + * Triggered when the value of the entitiesPing property changes. + * @function Stats.entitiesPingChanged + * @returns {Signal} + */ void entitiesPingChanged(); + + /**jsdoc + * Triggered when the value of the assetPing property changes. + * @function Stats.assetPingChanged + * @returns {Signal} + */ void assetPingChanged(); + + /**jsdoc + * Triggered when the value of the messagePing property changes. + * @function Stats.messagePingChanged + * @returns {Signal} + */ void messagePingChanged(); + + /**jsdoc + * Triggered when the value of the position property changes. + * @function Stats.positionChanged + * @returns {Signal} + */ void positionChanged(); + + /**jsdoc + * Triggered when the value of the speed property changes. + * @function Stats.speedChanged + * @returns {Signal} + */ void speedChanged(); + + /**jsdoc + * Triggered when the value of the yaw property changes. + * @function Stats.yawChanged + * @returns {Signal} + */ void yawChanged(); + + /**jsdoc + * Triggered when the value of the avatarMixerInKbps property changes. + * @function Stats.avatarMixerInKbpsChanged + * @returns {Signal} + */ void avatarMixerInKbpsChanged(); + + /**jsdoc + * Triggered when the value of the avatarMixerInPps property changes. + * @function Stats.avatarMixerInPpsChanged + * @returns {Signal} + */ void avatarMixerInPpsChanged(); + + /**jsdoc + * Triggered when the value of the avatarMixerOutKbps property changes. + * @function Stats.avatarMixerOutKbpsChanged + * @returns {Signal} + */ void avatarMixerOutKbpsChanged(); + + /**jsdoc + * Triggered when the value of the avatarMixerOutPps property changes. + * @function Stats.avatarMixerOutPpsChanged + * @returns {Signal} + */ void avatarMixerOutPpsChanged(); + + /**jsdoc + * Triggered when the value of the myAvatarSendRate property changes. + * @function Stats.myAvatarSendRateChanged + * @returns {Signal} + */ void myAvatarSendRateChanged(); + + /**jsdoc + * Triggered when the value of the audioMixerInKbps property changes. + * @function Stats.audioMixerInKbpsChanged + * @returns {Signal} + */ void audioMixerInKbpsChanged(); + + /**jsdoc + * Triggered when the value of the audioMixerInPps property changes. + * @function Stats.audioMixerInPpsChanged + * @returns {Signal} + */ void audioMixerInPpsChanged(); + + /**jsdoc + * Triggered when the value of the audioMixerOutKbps property changes. + * @function Stats.audioMixerOutKbpsChanged + * @returns {Signal} + */ void audioMixerOutKbpsChanged(); + + /**jsdoc + * Triggered when the value of the audioMixerOutPps property changes. + * @function Stats.audioMixerOutPpsChanged + * @returns {Signal} + */ void audioMixerOutPpsChanged(); + + /**jsdoc + * Triggered when the value of the audioMixerKbps property changes. + * @function Stats.audioMixerKbpsChanged + * @returns {Signal} + */ void audioMixerKbpsChanged(); + + /**jsdoc + * Triggered when the value of the audioMixerPps property changes. + * @function Stats.audioMixerPpsChanged + * @returns {Signal} + */ void audioMixerPpsChanged(); + + /**jsdoc + * Triggered when the value of the audioOutboundPPS property changes. + * @function Stats.audioOutboundPPSChanged + * @returns {Signal} + */ void audioOutboundPPSChanged(); + + /**jsdoc + * Triggered when the value of the audioSilentOutboundPPS property changes. + * @function Stats.audioSilentOutboundPPSChanged + * @returns {Signal} + */ void audioSilentOutboundPPSChanged(); + + /**jsdoc + * Triggered when the value of the audioAudioInboundPPS property changes. + * @function Stats.audioAudioInboundPPSChanged + * @returns {Signal} + */ void audioAudioInboundPPSChanged(); + + /**jsdoc + * Triggered when the value of the audioSilentInboundPPS property changes. + * @function Stats.audioSilentInboundPPSChanged + * @returns {Signal} + */ void audioSilentInboundPPSChanged(); + + /**jsdoc + * Triggered when the value of the audioPacketLoss property changes. + * @function Stats.audioPacketLossChanged + * @returns {Signal} + */ void audioPacketLossChanged(); + + /**jsdoc + * Triggered when the value of the audioCodec property changes. + * @function Stats.audioCodecChanged + * @returns {Signal} + */ void audioCodecChanged(); + + /**jsdoc + * Triggered when the value of the audioNoiseGate property changes. + * @function Stats.audioNoiseGateChanged + * @returns {Signal} + */ void audioNoiseGateChanged(); + + /**jsdoc + * Triggered when the value of the entityPacketsInKbps property changes. + * @function Stats.entityPacketsInKbpsChanged + * @returns {Signal} + */ void entityPacketsInKbpsChanged(); + + /**jsdoc + * Triggered when the value of the downloads property changes. + * @function Stats.downloadsChanged + * @returns {Signal} + */ void downloadsChanged(); + + /**jsdoc + * Triggered when the value of the downloadLimit property changes. + * @function Stats.downloadLimitChanged + * @returns {Signal} + */ void downloadLimitChanged(); + + /**jsdoc + * Triggered when the value of the downloadsPending property changes. + * @function Stats.downloadsPendingChanged + * @returns {Signal} + */ void downloadsPendingChanged(); + + /**jsdoc + * Triggered when the value of the downloadUrls property changes. + * @function Stats.downloadUrlsChanged + * @returns {Signal} + */ void downloadUrlsChanged(); + + /**jsdoc + * Triggered when the value of the processing property changes. + * @function Stats.processingChanged + * @returns {Signal} + */ void processingChanged(); + + /**jsdoc + * Triggered when the value of the processingPending property changes. + * @function Stats.processingPendingChanged + * @returns {Signal} + */ void processingPendingChanged(); + + /**jsdoc + * Triggered when the value of the triangles property changes. + * @function Stats.trianglesChanged + * @returns {Signal} + */ void trianglesChanged(); + + /**jsdoc + * Triggered when the value of the quads property changes. + * @function Stats.quadsChanged + * @returns {Signal} + */ void quadsChanged(); + + /**jsdoc + * Triggered when the value of the materialSwitches property changes. + * @function Stats.materialSwitchesChanged + * @returns {Signal} + */ void materialSwitchesChanged(); + + /**jsdoc + * Triggered when the value of the itemConsidered property changes. + * @function Stats.itemConsideredChanged + * @returns {Signal} + */ void itemConsideredChanged(); + + /**jsdoc + * Triggered when the value of the itemOutOfView property changes. + * @function Stats.itemOutOfViewChanged + * @returns {Signal} + */ void itemOutOfViewChanged(); + + /**jsdoc + * Triggered when the value of the itemTooSmall property changes. + * @function Stats.itemTooSmallChanged + * @returns {Signal} + */ void itemTooSmallChanged(); + + /**jsdoc + * Triggered when the value of the itemRendered property changes. + * @function Stats.itemRenderedChanged + * @returns {Signal} + */ void itemRenderedChanged(); + + /**jsdoc + * Triggered when the value of the shadowConsidered property changes. + * @function Stats.shadowConsideredChanged + * @returns {Signal} + */ void shadowConsideredChanged(); + + /**jsdoc + * Triggered when the value of the shadowOutOfView property changes. + * @function Stats.shadowOutOfViewChanged + * @returns {Signal} + */ void shadowOutOfViewChanged(); + + /**jsdoc + * Triggered when the value of the shadowTooSmall property changes. + * @function Stats.shadowTooSmallChanged + * @returns {Signal} + */ void shadowTooSmallChanged(); + + /**jsdoc + * Triggered when the value of the shadowRendered property changes. + * @function Stats.shadowRenderedChanged + * @returns {Signal} + */ void shadowRenderedChanged(); + + /**jsdoc + * Triggered when the value of the sendingMode property changes. + * @function Stats.sendingModeChanged + * @returns {Signal} + */ void sendingModeChanged(); + + /**jsdoc + * Triggered when the value of the packetStats property changes. + * @function Stats.packetStatsChanged + * @returns {Signal} + */ void packetStatsChanged(); + + /**jsdoc + * Triggered when the value of the lodStatus property changes. + * @function Stats.lodStatusChanged + * @returns {Signal} + */ void lodStatusChanged(); + + /**jsdoc + * Triggered when the value of the serverElements property changes. + * @function Stats.serverElementsChanged + * @returns {Signal} + */ void serverElementsChanged(); + + /**jsdoc + * Triggered when the value of the serverInternal property changes. + * @function Stats.serverInternalChanged + * @returns {Signal} + */ void serverInternalChanged(); + + /**jsdoc + * Triggered when the value of the serverLeaves property changes. + * @function Stats.serverLeavesChanged + * @returns {Signal} + */ void serverLeavesChanged(); + + /**jsdoc + * Triggered when the value of the localElements property changes. + * @function Stats.localElementsChanged + * @returns {Signal} + */ void localElementsChanged(); + + /**jsdoc + * Triggered when the value of the localInternal property changes. + * @function Stats.localInternalChanged + * @returns {Signal} + */ void localInternalChanged(); + + /**jsdoc + * Triggered when the value of the localLeaves property changes. + * @function Stats.localLeavesChanged + * @returns {Signal} + */ void localLeavesChanged(); + + /**jsdoc + * Triggered when the value of the timingStats property changes. + * @function Stats.timingStatsChanged + * @returns {Signal} + */ void timingStatsChanged(); + + /**jsdoc + * Triggered when the value of the gameUpdateStats property changes. + * @function Stats.gameUpdateStatsChanged + * @returns {Signal} + */ void gameUpdateStatsChanged(); + + /**jsdoc + * Triggered when the value of the glContextSwapchainMemory property changes. + * @function Stats.glContextSwapchainMemoryChanged + * @returns {Signal} + */ void glContextSwapchainMemoryChanged(); + + /**jsdoc + * Triggered when the value of the qmlTextureMemory property changes. + * @function Stats.qmlTextureMemoryChanged + * @returns {Signal} + */ void qmlTextureMemoryChanged(); + + /**jsdoc + * Triggered when the value of the texturePendingTransfers property changes. + * @function Stats.texturePendingTransfersChanged + * @returns {Signal} + */ void texturePendingTransfersChanged(); + + /**jsdoc + * Triggered when the value of the gpuBuffers property changes. + * @function Stats.gpuBuffersChanged + * @returns {Signal} + */ void gpuBuffersChanged(); + + /**jsdoc + * Triggered when the value of the gpuBufferMemory property changes. + * @function Stats.gpuBufferMemoryChanged + * @returns {Signal} + */ void gpuBufferMemoryChanged(); + + /**jsdoc + * Triggered when the value of the gpuTextures property changes. + * @function Stats.gpuTexturesChanged + * @returns {Signal} + */ void gpuTexturesChanged(); + + /**jsdoc + * Triggered when the value of the gpuTextureMemory property changes. + * @function Stats.gpuTextureMemoryChanged + * @returns {Signal} + */ void gpuTextureMemoryChanged(); + + /**jsdoc + * Triggered when the value of the gpuTextureResidentMemory property changes. + * @function Stats.gpuTextureResidentMemoryChanged + * @returns {Signal} + */ void gpuTextureResidentMemoryChanged(); + + /**jsdoc + * Triggered when the value of the gpuTextureFramebufferMemory property changes. + * @function Stats.gpuTextureFramebufferMemoryChanged + * @returns {Signal} + */ void gpuTextureFramebufferMemoryChanged(); + + /**jsdoc + * Triggered when the value of the gpuTextureResourceMemory property changes. + * @function Stats.gpuTextureResourceMemoryChanged + * @returns {Signal} + */ void gpuTextureResourceMemoryChanged(); + + /**jsdoc + * Triggered when the value of the gpuTextureResourcePopulatedMemory property changes. + * @function Stats.gpuTextureResourcePopulatedMemoryChanged + * @returns {Signal} + */ void gpuTextureResourcePopulatedMemoryChanged(); + + /**jsdoc + * Triggered when the value of the gpuTextureExternalMemory property changes. + * @function Stats.gpuTextureExternalMemoryChanged + * @returns {Signal} + */ void gpuTextureExternalMemoryChanged(); + + /**jsdoc + * Triggered when the value of the gpuTextureMemoryPressureState property changes. + * @function Stats.gpuTextureMemoryPressureStateChanged + * @returns {Signal} + */ void gpuTextureMemoryPressureStateChanged(); + + /**jsdoc + * Triggered when the value of the gpuFreeMemory property changes. + * @function Stats.gpuFreeMemoryChanged + * @returns {Signal} + */ void gpuFreeMemoryChanged(); + + /**jsdoc + * Triggered when the value of the gpuFrameTime property changes. + * @function Stats.gpuFrameTimeChanged + * @returns {Signal} + */ void gpuFrameTimeChanged(); + + /**jsdoc + * Triggered when the value of the batchFrameTime property changes. + * @function Stats.batchFrameTimeChanged + * @returns {Signal} + */ void batchFrameTimeChanged(); + + /**jsdoc + * Triggered when the value of the engineFrameTime property changes. + * @function Stats.engineFrameTimeChanged + * @returns {Signal} + */ void engineFrameTimeChanged(); + + /**jsdoc + * Triggered when the value of the avatarSimulationTime property changes. + * @function Stats.avatarSimulationTimeChanged + * @returns {Signal} + */ void avatarSimulationTimeChanged(); + + /**jsdoc + * Triggered when the value of the rectifiedTextureCount property changes. + * @function Stats.rectifiedTextureCountChanged + * @returns {Signal} + */ void rectifiedTextureCountChanged(); + + /**jsdoc + * Triggered when the value of the decimatedTextureCount property changes. + * @function Stats.decimatedTextureCountChanged + * @returns {Signal} + */ void decimatedTextureCountChanged(); + + // QQuickItem signals. + + /**jsdoc + * Triggered when the parent item changes. + * @function Stats.parentChanged + * @param {object} parent + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the x property changes. + * @function Stats.xChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the y property changes. + * @function Stats.yChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the z property changes. + * @function Stats.zChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the width property changes. + * @function Stats.widthChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the height property changes. + * @function Stats.heightChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the opacity property changes. + * @function Stats.opacityChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the enabled property changes. + * @function Stats.enabledChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the visibleChanged property changes. + * @function Stats.visibleChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the list of visible children changes. + * @function Stats.visibleChildrenChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the state property changes. + * @function Stats.stateChanged + * @paramm {string} state + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the position and size of the rectangle containing the children changes. + * @function Stats.childrenRectChanged + * @param {Rect} childrenRect + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the baselineOffset property changes. + * @function Stats.baselineOffsetChanged + * @param {number} baselineOffset + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the clip property changes. + * @function Stats.clipChanged + * @param {boolean} clip + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the focus property changes. + * @function Stats.focusChanged + * @param {boolean} focus + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the activeFocus property changes. + * @function Stats.activeFocusChanged + * @param {boolean} activeFocus + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the activeFocusOnTab property changes. + * @function Stats.activeFocusOnTabChanged + * @param {boolean} activeFocusOnTab + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the rotation property changes. + * @function Stats.rotationChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the scaleChanged property changes. + * @function Stats.scaleChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the transformOrigin property changes. + * @function Stats.transformOriginChanged + * @param {number} transformOrigin + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the smooth property changes. + * @function Stats.smoothChanged + * @param {boolean} smooth + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the antialiasing property changes. + * @function Stats.antialiasingChanged + * @param {boolean} antialiasing + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the implicitWidth property changes. + * @function Stats.implicitWidthChanged + * @returns {Signal} + */ + + /**jsdoc + * Triggered when the value of the implicitHeight property changes. + * @function Stats.implicitHeightChanged + * @returns {Signal} + */ + + /**jsdoc + * @function Stats.windowChanged + * @param {object} window + * @returns {Signal} + */ + + + // QQuickItem functions. + + /**jsdoc + * @function Stats.grabToImage + * @param {object} callback + * @param {Size} [targetSize=0,0] + * @returns {boolean} + */ + + /**jsdoc + * @function Stats.contains + * @param {Vec2} point + * @returns {boolean} + */ + + /**jsdoc + * @function Stats.mapFromItem + * @param {object} item + */ + + /**jsdoc + * @function Stats.mapToItem + * @param {object} item + */ + + /**jsdoc + * @function Stats.mapFromGlobal + * @param {object} global + */ + + /**jsdoc + * @function Stats.mapToGlobal + * @param {object} global + */ + + /**jsdoc + * @function Stats.forceActiveFocus + * @param {number} [reason=7] + */ + + /**jsdoc + * @function Stats.nextItemInFocusChain + * @param {boolean} [forward=true] + * @returns {object} + */ + + /**jsdoc + * @function Stats.childAt + * @param {number} x + * @param {number} y + * @returns {object} + */ + + /**jsdoc + * @function Stats.update + */ + private: int _recentMaxPackets{ 0 } ; // recent max incoming voxel packets to process bool _resetRecentMaxPacketsSoon{ true }; diff --git a/libraries/audio/src/AudioEffectOptions.cpp b/libraries/audio/src/AudioEffectOptions.cpp index 9d3ce9299b..edb0ff52ae 100644 --- a/libraries/audio/src/AudioEffectOptions.cpp +++ b/libraries/audio/src/AudioEffectOptions.cpp @@ -58,6 +58,30 @@ static void setOption(QScriptValue arguments, const QString name, float defaultV variable = arguments.property(name).isNumber() ? (float)arguments.property(name).toNumber() : defaultValue; } +/**jsdoc + * @typedef {object} AudioEffectOptions.ReverbOptions + * @property {number} bandwidth + * @property {number} preDelay + * @property {number} lateDelay + * @property {number} reverbTime + * @property {number} earlyDiffusion + * @property {number} lateDiffusion + * @property {number} roomSize + * @property {number} density + * @property {number} bassMult + * @property {number} bassFreq + * @property {number} highGain + * @property {number} highFreq + * @property {number} modRate + * @property {number} modDepth + * @property {number} earlyGain + * @property {number} lateGain + * @property {number} earlyMixLeft + * @property {number} earlyMixRight + * @property {number} lateMixLeft + * @property {number} lateMixRight + * @property {number} wetDryMix + */ AudioEffectOptions::AudioEffectOptions(QScriptValue arguments) { setOption(arguments, BANDWIDTH_HANDLE, BANDWIDTH_DEFAULT, _bandwidth); setOption(arguments, PRE_DELAY_HANDLE, PRE_DELAY_DEFAULT, _preDelay); diff --git a/libraries/audio/src/AudioEffectOptions.h b/libraries/audio/src/AudioEffectOptions.h index 9a65301473..1afd4e21be 100644 --- a/libraries/audio/src/AudioEffectOptions.h +++ b/libraries/audio/src/AudioEffectOptions.h @@ -15,6 +15,38 @@ #include #include +/**jsdoc + * @class AudioEffectOptions + * @param {AudioEffectOptions.ReverbOptions} [reverbOptions=null] + * + * @hifi-interface + * @hifi-client-entity + * @hifi-server-entity + * @hifi-assignment-client + * + * @property {number} bandwidth=10000 + * @property {number} preDelay=20 + * @property {number} lateDelay=0 + * @property {number} reverbTime=2 + * @property {number} earlyDiffusion=100 + * @property {number} lateDiffusion=100 + * @property {number} roomSize=50 + * @property {number} density=100 + * @property {number} bassMult=1.5 + * @property {number} bassFreq=250 + * @property {number} highGain=-6 + * @property {number} highFreq=3000 + * @property {number} modRate=2.3 + * @property {number} modDepth=50 + * @property {number} earlyGain=0 + * @property {number} lateGain=0 + * @property {number} earlyMixLeft=20 + * @property {number} earlyMixRight=20 + * @property {number} lateMixLeft=90 + * @property {number} lateMixRight=90 + * @property {number} wetDryMix=50 + */ + class AudioEffectOptions : public QObject { Q_OBJECT diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index db38999481..7a28686f8c 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -2363,7 +2363,7 @@ glm::vec3 AvatarData::getAbsoluteJointTranslationInObjectFrame(int index) const } /**jsdoc - * @typedef MyAvatar.AttachmentData + * @typedef AttachmentData * @property {string} modelUrl * @property {string} jointName * @property {Vec3} translation diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index bbcdd3693d..62a14ec51e 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -351,7 +351,7 @@ public: class AvatarData : public QObject, public SpatiallyNestable { Q_OBJECT - // The following properties have JSDoc in MyAvatar.h. + // The following properties have JSDoc in MyAvatar.h and ScriptableAvatar.h Q_PROPERTY(glm::vec3 position READ getWorldPosition WRITE setPositionViaScript) Q_PROPERTY(float scale READ getTargetScale WRITE setTargetScale) Q_PROPERTY(float density READ getDensity) @@ -502,7 +502,7 @@ public: float getDomainLimitedScale() const; /**jsdoc - * returns the minimum scale allowed for this avatar in the current domain. + * Returns the minimum scale allowed for this avatar in the current domain. * This value can change as the user changes avatars or when changing domains. * @function MyAvatar.getDomainMinScale * @returns {number} minimum scale allowed for this avatar in the current domain. @@ -510,14 +510,14 @@ public: Q_INVOKABLE float getDomainMinScale() const; /**jsdoc - * returns the maximum scale allowed for this avatar in the current domain. + * Returns the maximum scale allowed for this avatar in the current domain. * This value can change as the user changes avatars or when changing domains. * @function MyAvatar.getDomainMaxScale * @returns {number} maximum scale allowed for this avatar in the current domain. */ Q_INVOKABLE float getDomainMaxScale() const; - // returns eye height of avatar in meters, ignoreing avatar scale. + // Returns eye height of avatar in meters, ignoring avatar scale. // if _targetScale is 1 then this will be identical to getEyeHeight; virtual float getUnscaledEyeHeight() const { return DEFAULT_AVATAR_EYE_HEIGHT; } @@ -775,7 +775,7 @@ public: * Get the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint. * @function MyAvatar.getJointRotations * @returns {Quat[]} The rotations of all joints relative to each's parent. The values are in the same order as the array - * returned by {@link MyAvatar.getJointNames}. + * returned by {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}. * @example Report the rotations of all your avatar's joints. * print(JSON.stringify(MyAvatar.getJointRotations())); */ @@ -796,7 +796,7 @@ public: * the rotation of the elbow, the hand inverse kinematics position won't end up in the right place.

* @function MyAvatar.setJointRotations * @param {Quat[]} jointRotations - The rotations for all joints in the avatar. The values are in the same order as the - * array returned by {@link MyAvatar.getJointNames}. + * array returned by {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}. * @example Set your avatar to its default T-pose then rotate its right arm.
* Avatar in T-pose * @@ -852,7 +852,7 @@ public: /**jsdoc * Get the joint index for a named joint. The joint index value is the position of the joint in the array returned by - * {@link MyAvatar.getJointNames}. + * {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}. * @function MyAvatar.getJointIndex * @param {string} name - The name of the joint. * @returns {number} The index of the joint. @@ -952,7 +952,7 @@ public: /**jsdoc * Get information about all models currently attached to your avatar. * @function MyAvatar.getAttachmentData - * @returns {MyAvatar.AttachmentData[]} Information about all models attached to your avatar. + * @returns {AttachmentData[]} Information about all models attached to your avatar. * @example Report the URLs of all current attachments. * var attachments = MyAvatar.getaAttachmentData(); * for (var i = 0; i < attachments.length; i++) { @@ -963,10 +963,10 @@ public: /**jsdoc * Set all models currently attached to your avatar. For example, if you retrieve attachment data using - * {@link MyAvatar.getAttachmentData}, make changes to it, and then want to update your avatar's attachments per the + * {@link MyAvatar.getAttachmentData} or {@link Avatar.getAttachmentData}, make changes to it, and then want to update your avatar's attachments per the * changed data. You can also remove all attachments by using setting attachmentData to null. * @function MyAvatar.setAttachmentData - * @param {MyAvatar.AttachmentData[]} attachmentData - The attachment data defining the models to have attached to your avatar. Use + * @param {AttachmentData[]} attachmentData - The attachment data defining the models to have attached to your avatar. Use * null to remove all attachments. * @example Remove a hat attachment if your avatar is wearing it. * var hatURL = "https://s3.amazonaws.com/hifi-public/tony/cowboy-hat.fbx"; @@ -989,7 +989,7 @@ public: * Nor can you use this function to attach an entity (such as a sphere or a box) to your avatar.

* @function MyAvatar.attach * @param {string} modelURL - The URL of the model to attach. Models can be .FBX or .OBJ format. - * @param {string} [jointName=""] - The name of the avatar joint (see {@link MyAvatar.getJointNames}) to attach the model + * @param {string} [jointName=""] - The name of the avatar joint (see {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}) to attach the model * to. * @param {Vec3} [translation=Vec3.ZERO] - The offset to apply to the model relative to the joint position. * @param {Quat} [rotation=Quat.IDENTITY] - The rotation to apply to the model relative to the joint orientation. diff --git a/libraries/avatars/src/AvatarHashMap.h b/libraries/avatars/src/AvatarHashMap.h index dc3f40c5d3..6747025de0 100644 --- a/libraries/avatars/src/AvatarHashMap.h +++ b/libraries/avatars/src/AvatarHashMap.h @@ -30,6 +30,15 @@ #include "AvatarData.h" +/**jsdoc + * Note: An AvatarList API is also provided for Interface and client entity scripts: it is a + * synonym for the {@link AvatarManager} API. + * + * @namespace AvatarList + * + * @hifi-assignment-client + */ + class AvatarHashMap : public QObject, public Dependency { Q_OBJECT SINGLETON_DEPENDENCY @@ -42,20 +51,24 @@ public: // Currently, your own avatar will be included as the null avatar id. /**jsdoc - * @function AvatarManager.getAvatarIdentifiers + * @function AvatarList.getAvatarIdentifiers * @returns {Uuid[]} */ Q_INVOKABLE QVector getAvatarIdentifiers(); /**jsdoc - * @function AvatarManager.getAvatarsInRange + * @function AvatarList.getAvatarsInRange * @param {Vec3} position * @param {number} range * @returns {Uuid[]} */ Q_INVOKABLE QVector getAvatarsInRange(const glm::vec3& position, float rangeMeters) const; - // No JSDod because it's documwented in AvatarManager. + /**jsdoc + * @function AvatarList.getAvatar + * @param {Uuid} avatarID + * @returns {AvatarData} + */ // Null/Default-constructed QUuids will return MyAvatar Q_INVOKABLE virtual ScriptAvatarData* getAvatar(QUuid avatarID) { return new ScriptAvatarData(getAvatarBySessionID(avatarID)); } @@ -65,21 +78,21 @@ public: signals: /**jsdoc - * @function AvatarManager.avatarAddedEvent + * @function AvatarList.avatarAddedEvent * @param {Uuid} sessionUUID * @returns {Signal} */ void avatarAddedEvent(const QUuid& sessionUUID); /**jsdoc - * @function AvatarManager.avatarRemovedEvent + * @function AvatarList.avatarRemovedEvent * @param {Uuid} sessionUUID * @returns {Signal} */ void avatarRemovedEvent(const QUuid& sessionUUID); /**jsdoc - * @function AvatarManager.avatarSessionChangedEvent + * @function AvatarList.avatarSessionChangedEvent * @param {Uuid} sessionUUID * @param {Uuid} oldSessionUUID * @returns {Signal} @@ -89,7 +102,7 @@ signals: public slots: /**jsdoc - * @function AvatarManager.isAvatarInRange + * @function AvatarList.isAvatarInRange * @param {string} position * @param {string} range * @returns {boolean} @@ -99,28 +112,28 @@ public slots: protected slots: /**jsdoc - * @function AvatarManager.sessionUUIDChanged + * @function AvatarList.sessionUUIDChanged * @param {Uuid} sessionUUID * @param {Uuid} oldSessionUUID */ void sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& oldUUID); /**jsdoc - * @function AvatarManager.processAvatarDataPacket + * @function AvatarList.processAvatarDataPacket * @param {} message * @param {} sendingNode */ void processAvatarDataPacket(QSharedPointer message, SharedNodePointer sendingNode); /**jsdoc - * @function AvatarManager.processAvatarIdentityPacket + * @function AvatarList.processAvatarIdentityPacket * @param {} message * @param {} sendingNode */ void processAvatarIdentityPacket(QSharedPointer message, SharedNodePointer sendingNode); /**jsdoc - * @function AvatarManager.processKillAvatar + * @function AvatarList.processKillAvatar * @param {} message * @param {} sendingNode */ diff --git a/libraries/graphics-scripting/src/graphics-scripting/Forward.h b/libraries/graphics-scripting/src/graphics-scripting/Forward.h index ed8e96a12f..104674eddc 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/Forward.h +++ b/libraries/graphics-scripting/src/graphics-scripting/Forward.h @@ -36,6 +36,30 @@ namespace scriptable { using ModelProviderPointer = std::shared_ptr; using WeakModelProviderPointer = std::weak_ptr; + /**jsdoc + * @typedef {object} Graphics.Material + * @property {string} name + * @property {string} model + * @property {number} opacity + * @property {number} roughness + * @property {number} metallic + * @property {number} scattering + * @property {boolean} unlit + * @propety {Vec3} emissive + * @propety {Vec3} albedo + * @property {string} emissiveMap + * @property {string} albedoMap + * @property {string} opacityMap + * @property {string} metallicMap + * @property {string} specularMap + * @property {string} roughnessMap + * @property {string} glossMap + * @property {string} normalMap + * @property {string} bumpMap + * @property {string} occlusionMap + * @property {string} lightmapMap + * @property {string} scatteringMap + */ class ScriptableMaterial { public: ScriptableMaterial() {} @@ -68,7 +92,7 @@ namespace scriptable { /**jsdoc * @typedef {object} Graphics.MaterialLayer - * @property {Material} material - This layer's material. + * @property {Graphics.Material} material - This layer's material. * @property {number} priority - The priority of this layer. If multiple materials are applied to a mesh part, only the highest priority layer is used. */ class ScriptableMaterialLayer { diff --git a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp index 20b54b02c9..6fd0017ae2 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp +++ b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp @@ -166,6 +166,17 @@ bool GraphicsScriptingInterface::updateMeshPart(scriptable::ScriptableMeshPointe scriptable::ScriptableMeshPointer GraphicsScriptingInterface::newMesh(const QVariantMap& ifsMeshData) { // TODO: this is bare-bones way for now to improvise a new mesh from the scripting side // in the future we want to support a formal C++ structure data type here instead + + /**jsdoc + * @typedef {object} Graphics.IFSData + * @property {string} [name=""] - mesh name (useful for debugging / debug prints). + * @property {string} [topology=""] + * @property {number[]} indices - vertex indices to use for the mesh faces. + * @property {Vec3[]} vertices - vertex positions (model space) + * @property {Vec3[]} [normals=[]] - vertex normals (normalized) + * @property {Vec3[]} [colors=[]] - vertex colors (normalized) + * @property {Vec2[]} [texCoords0=[]] - vertex texture coordinates (normalized) + */ QString meshName = ifsMeshData.value("name").toString(); QString topologyName = ifsMeshData.value("topology").toString(); QVector indices = buffer_helpers::variantToVector(ifsMeshData.value("indices")); diff --git a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h index b88c6345cf..1ec60c4244 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h +++ b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h @@ -46,10 +46,28 @@ public slots: */ scriptable::ScriptableModelPointer getModel(QUuid uuid); + /**jsdoc + * @function Graphics.updateModel + * @param {Uuid} id + * @param {Graphics.Model} model + * @returns {boolean} + */ bool updateModel(QUuid uuid, const scriptable::ScriptableModelPointer& model); + /**jsdoc + * @function Graphics.canUpdateModel + * @param {Uuid} id + * @param {number} [meshIndex=-1] + * @param {number} [partNumber=-1] + * @returns {boolean} + */ bool canUpdateModel(QUuid uuid, int meshIndex = -1, int partNumber = -1); + /**jsdoc + * @function Graphics.newModel + * @param {Graphics.Mesh[]} meshes + * @returns {Graphics.Model} + */ scriptable::ScriptableModelPointer newModel(const scriptable::ScriptableMeshes& meshes); /**jsdoc @@ -59,15 +77,6 @@ public slots: * @param {Graphics.IFSData} ifsMeshData Index-Faced Set (IFS) arrays used to create the new mesh. * @returns {Graphics.Mesh} the resulting Mesh / Mesh Part object */ - /**jsdoc - * @typedef {object} Graphics.IFSData - * @property {string} [name] - mesh name (useful for debugging / debug prints). - * @property {number[]} indices - vertex indices to use for the mesh faces. - * @property {Vec3[]} vertices - vertex positions (model space) - * @property {Vec3[]} [normals] - vertex normals (normalized) - * @property {Vec3[]} [colors] - vertex colors (normalized) - * @property {Vec2[]} [texCoords0] - vertex texture coordinates (normalized) - */ scriptable::ScriptableMeshPointer newMesh(const QVariantMap& ifsMeshData); #ifdef SCRIPTABLE_MESH_TODO @@ -77,6 +86,11 @@ public slots: bool updateMeshPart(scriptable::ScriptableMeshPointer mesh, scriptable::ScriptableMeshPartPointer part); #endif + /**jsdoc + * @function Graphics.exportModelToOBJ + * @param {Graphics.Model} model + * @returns {string} + */ QString exportModelToOBJ(const scriptable::ScriptableModel& in); private: diff --git a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMesh.h b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMesh.h index 62a67aa5e6..dcb1c53759 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMesh.h +++ b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMesh.h @@ -36,6 +36,10 @@ namespace scriptable { * @property {number} numIndices - Total number of vertex indices in the mesh. * @property {number} numVertices - Total number of vertices in the Mesh. * @property {number} numAttributes - Number of currently defined vertex attributes. + * @property {boolean} valid + * @property {boolean} strong + * @property {object} extents + * @property {object} bufferFormats */ class ScriptableMesh : public ScriptableMeshBase, QScriptable { Q_OBJECT diff --git a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.h b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.h index dd71d9b998..7352fcd0f6 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.h +++ b/libraries/graphics-scripting/src/graphics-scripting/ScriptableMeshPart.h @@ -12,7 +12,11 @@ namespace scriptable { /**jsdoc * @typedef {object} Graphics.MeshPart + * @property {boolean} valid * @property {number} partIndex - The part index (within the containing Mesh). + * @property {number} firstVertexIndex + * @property {number} baseVertexIndex + * @property {number} lastVertexIndex * @property {Graphics.Topology} topology - element interpretation (currently only 'triangles' is supported). * @property {string[]} attributeNames - Vertex attribute names (color, normal, etc.) * @property {number} numIndices - Number of vertex indices that this mesh part refers to. @@ -20,6 +24,8 @@ namespace scriptable { * @property {number} numFaces - Number of faces represented by the mesh part (numIndices / numVerticesPerFace). * @property {number} numVertices - Total number of vertices in the containing Mesh. * @property {number} numAttributes - Number of currently defined vertex attributes. + * @property {object} extents + * @property {object} bufferFormats */ class ScriptableMeshPart : public QObject, QScriptable { diff --git a/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.h b/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.h index ac0b7b9623..7d1ca5f560 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.h +++ b/libraries/graphics-scripting/src/graphics-scripting/ScriptableModel.h @@ -21,7 +21,7 @@ namespace scriptable { * @property {Uuid} objectID - UUID of corresponding inworld object (if model is associated) * @property {number} numMeshes - The number of submeshes contained in the model. * @property {Graphics.Mesh[]} meshes - Array of submesh references. - * @property {Object.} materialLayers - Map of materials layer lists. You can look up a material layer list by mesh part number or by material name. + * @property {Object.} materialLayers - Map of materials layer lists. You can look up a material layer list by mesh part number or by material name. * @property {string[]} materialNames - Array of all the material names used by the mesh parts of this model, in order (e.g. materialNames[0] is the name of the first mesh part's material). */ diff --git a/libraries/graphics/src/graphics/Geometry.h b/libraries/graphics/src/graphics/Geometry.h index 485542d26b..eddfdbd1b6 100755 --- a/libraries/graphics/src/graphics/Geometry.h +++ b/libraries/graphics/src/graphics/Geometry.h @@ -76,6 +76,23 @@ public: // Access vertex position value const Vec3& getPos(Index index) const { return _vertexBuffer.get(index); } + /**jsdoc + * + * + * + * + * + * + * + * + * + * + * + * + * + *
ValueDescription
0Points.
1Lines.
2Line strip.
3Triangles.
4Triangle strip.
5Quads.
6Quad strip.
+ * @typedef {number} Graphics.Topology + */ enum Topology { POINTS = 0, LINES, diff --git a/libraries/midi/src/Midi.h b/libraries/midi/src/Midi.h index f7940bbe5d..e5c44c6b7e 100644 --- a/libraries/midi/src/Midi.h +++ b/libraries/midi/src/Midi.h @@ -20,6 +20,13 @@ #include #include +/**jsdoc + * @namespace Midi + * + * @hifi-interface + * @hifi-client-entity + */ + class Midi : public QObject, public Dependency { Q_OBJECT SINGLETON_DEPENDENCY @@ -46,57 +53,135 @@ signals: void midiReset(); public slots: - // Send Raw Midi Packet to all connected devices + + /**jsdoc + * Send Raw MIDI packet to a particular device. + * @function Midi.sendRawDword + * @param {number} device - Integer device number. + * @param {number} raw - Integer (DWORD) raw MIDI message. + */ Q_INVOKABLE void sendRawDword(int device, int raw); - /// Send Raw Midi message to selected device - /// @param {int} device: device number - /// @param {int} raw: raw midi message (DWORD) - // Send Midi Message to all connected devices + /**jsdoc + * Send MIDI message to a particular device. + * @function Midi.sendMidiMessage + * @param {number} device - Integer device number. + * @param {number} channel - Integer channel number. + * @param {number} type - 0x8 is note off, 0x9 is note on (if velocity=0, note off), etc. + * @param {number} note - MIDI note number. + * @param {number} velocity - Note velocity (0 means note off). + */ Q_INVOKABLE void sendMidiMessage(int device, int channel, int type, int note, int velocity); - /// Send midi message to selected device/devices - /// @param {int} device: device number - /// @param {int} channel: channel number - /// @param {int} type: 0x8 is noteoff, 0x9 is noteon (if velocity=0, noteoff), etc - /// @param {int} note: midi note number - /// @param {int} velocity: note velocity (0 means noteoff) - // Send Midi Message to all connected devices + /**jsdoc + * Play a note on all connected devices. + * @function Midi.playMidiNote + * @param {number} status - 0x80 is note off, 0x90 is note on (if velocity=0, note off), etc. + * @param {number} note - MIDI note number. + * @param {number} velocity - Note velocity (0 means note off). + */ Q_INVOKABLE void playMidiNote(int status, int note, int velocity); - /// play a note on all connected devices - /// @param {int} status: 0x80 is noteoff, 0x90 is noteon (if velocity=0, noteoff), etc - /// @param {int} note: midi note number - /// @param {int} velocity: note velocity (0 means noteoff) - /// turn off all notes on all connected devices + /**jsdoc + * Turn off all notes on all connected devices. + * @function Midi.allNotesOff + */ Q_INVOKABLE void allNotesOff(); - /// clean up and re-discover attached devices + /**jsdoc + * Clean up and re-discover attached devices. + * @function Midi.resetDevices + */ Q_INVOKABLE void resetDevices(); - /// ask for a list of inputs/outputs + /**jsdoc + * Get a list of inputs/outputs. + * @function Midi.listMidiDevices + * @param {boolean} output + * @returns {string[]} + */ Q_INVOKABLE QStringList listMidiDevices(bool output); - /// block an input/output by name + /**jsdoc + * Block an input/output by name. + * @function Midi.blockMidiDevice + * @param {string} name + * @param {boolean} output + */ Q_INVOKABLE void blockMidiDevice(QString name, bool output); - /// unblock an input/output by name + /**jsdoc + * Unblock an input/output by name. + * @function Midi.unblockMidiDevice + * @param {string} name + * @param {boolean} output + */ Q_INVOKABLE void unblockMidiDevice(QString name, bool output); - /// repeat all incoming notes to all outputs (default disabled) + /**jsdoc + * Repeat all incoming notes to all outputs (default disabled). + * @function Midi.thruModeEnable + * @param {boolean} enable + */ Q_INVOKABLE void thruModeEnable(bool enable); - /// broadcast on all unblocked devices + + /**jsdoc + * Broadcast on all unblocked devices. + * @function Midi.broadcastEnable + * @param {boolean} enable + */ Q_INVOKABLE void broadcastEnable(bool enable); + /// filter by event types + + /**jsdoc + * @function Midi.typeNoteOffEnable + * @param {boolean} enable + */ Q_INVOKABLE void typeNoteOffEnable(bool enable); + + /**jsdoc + * @function Midi.typeNoteOnEnable + * @param {boolean} enable + */ Q_INVOKABLE void typeNoteOnEnable(bool enable); + + /**jsdoc + * @function Midi.typePolyKeyPressureEnable + * @param {boolean} enable + */ Q_INVOKABLE void typePolyKeyPressureEnable(bool enable); + + /**jsdoc + * @function Midi.typeControlChangeEnable + * @param {boolean} enable + */ Q_INVOKABLE void typeControlChangeEnable(bool enable); + + /**jsdoc + * @function Midi.typeProgramChangeEnable + * @param {boolean} enable + */ Q_INVOKABLE void typeProgramChangeEnable(bool enable); + + /**jsdoc + * @function Midi.typeChanPressureEnable + * @param {boolean} enable + */ Q_INVOKABLE void typeChanPressureEnable(bool enable); + + /**jsdoc + * @function Midi.typePitchBendEnable + * @param {boolean} enable + */ Q_INVOKABLE void typePitchBendEnable(bool enable); + + /**jsdoc + * @function Midi.typeSystemMessageEnable + * @param {boolean} enable + */ Q_INVOKABLE void typeSystemMessageEnable(bool enable); diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 8e2553779b..7832b26c96 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -32,6 +32,11 @@ const QString GET_PLACE = "/api/v1/places/%1"; /**jsdoc * The location API provides facilities related to your current location in the metaverse. * + *
Getter/Setter
+ *

You can get and set your current metaverse address by directly reading a string value from and writing a string value to + * the location object. This is an alternative to using the location.href property or this object's + * functions.

+ * * @namespace location * * @hifi-interface diff --git a/libraries/networking/src/ResourceCache.h b/libraries/networking/src/ResourceCache.h index e2df582aa3..18840cd11e 100644 --- a/libraries/networking/src/ResourceCache.h +++ b/libraries/networking/src/ResourceCache.h @@ -86,7 +86,6 @@ private: /// Wrapper to expose resources to JS/QML class ScriptableResource : public QObject { - /**jsdoc * @constructor Resource * @@ -98,12 +97,15 @@ class ScriptableResource : public QObject { * @property {string} url - URL of this resource. * @property {Resource.State} state - Current loading state. */ - + /**jsdoc + * @namespace Resource + * @variation 0 + * @property {Resource.State} State + */ Q_OBJECT Q_PROPERTY(QUrl url READ getURL) Q_PROPERTY(int state READ getState NOTIFY stateChanged) - public: /**jsdoc @@ -115,7 +117,6 @@ public: * @property {number} FINISHED - The resource has completely finished loading and is ready. * @property {number} FAILED - Downloading the resource has failed. */ - enum State { QUEUED, LOADING, diff --git a/libraries/networking/src/ResourceScriptingInterface.h b/libraries/networking/src/ResourceScriptingInterface.h index d9777e7514..cc3f12f990 100644 --- a/libraries/networking/src/ResourceScriptingInterface.h +++ b/libraries/networking/src/ResourceScriptingInterface.h @@ -17,11 +17,30 @@ #include +/**jsdoc + * @namespace Resources + * + * @hifi-interface + * @hifi-client-entity + * @hifi-server-entity + * @hifi-assignment-client + */ + class ResourceScriptingInterface : public QObject, public Dependency { Q_OBJECT public: + + /**jsdoc + * @function Resources.overrideUrlPrefix + * @param {string} prefix + * @param {string} replacement + */ Q_INVOKABLE void overrideUrlPrefix(const QString& prefix, const QString& replacement); + /**jsdoc + * @function Resources.restoreUrlPrefix + * @param {string} prefix + */ Q_INVOKABLE void restoreUrlPrefix(const QString& prefix) { overrideUrlPrefix(prefix, ""); } diff --git a/libraries/networking/src/ThreadedAssignment.h b/libraries/networking/src/ThreadedAssignment.h index 007e41a543..9372cfa667 100644 --- a/libraries/networking/src/ThreadedAssignment.h +++ b/libraries/networking/src/ThreadedAssignment.h @@ -29,13 +29,34 @@ public: void addPacketStatsAndSendStatsPacket(QJsonObject statsObject); public slots: + // JSDoc: Overridden in Agent.h. /// threaded run of assignment virtual void run() = 0; + + /**jsdoc + * @function Agent.stop + * @deprecated This function is being removed from the API. + */ Q_INVOKABLE virtual void stop() { setFinished(true); } + + /**jsdoc + * @function Agent.sendStatsPacket + * @deprecated This function is being removed from the API. + */ virtual void sendStatsPacket(); + + /**jsdoc + * @function Agent.clearQueuedCheckIns + * @deprecated This function is being removed from the API. + */ void clearQueuedCheckIns() { _numQueuedCheckIns = 0; } signals: + /**jsdoc + * @function Agent.finished + * @returns {Signal} + * @deprecated This function is being removed from the API. + */ void finished(); protected: @@ -47,6 +68,10 @@ protected: int _numQueuedCheckIns { 0 }; protected slots: + /**jsdoc + * @function Agent.domainSettingsRequestFailed + * @deprecated This function is being removed from the API. + */ void domainSettingsRequestFailed(); private slots: diff --git a/libraries/plugins/src/plugins/SteamClientPlugin.h b/libraries/plugins/src/plugins/SteamClientPlugin.h index 343ed40402..fc1b85c572 100644 --- a/libraries/plugins/src/plugins/SteamClientPlugin.h +++ b/libraries/plugins/src/plugins/SteamClientPlugin.h @@ -40,6 +40,15 @@ public: virtual int getSteamVRBuildID() = 0; }; +/**jsdoc + * @namespace Steam + * + * @hifi-interface + * @hifi-client-entity + * + * @property {boolean} running - Read-only. + */ + class SteamScriptingInterface : public QObject { Q_OBJECT @@ -49,7 +58,16 @@ public: SteamScriptingInterface(QObject* parent, SteamClientPlugin* plugin) : QObject(parent), _plugin(plugin) {} public slots: + + /**jsdoc + * @function Steam.isRunning + * @returns {boolean} + */ bool isRunning() const { return _plugin && _plugin->isRunning(); } + + /**jsdoc + * @function Steam.openInviteOverlay + */ void openInviteOverlay() const { if (_plugin) { _plugin->openInviteOverlay(); } } private: diff --git a/libraries/pointers/src/Pick.h b/libraries/pointers/src/Pick.h index 68c89a59cb..53606b154f 100644 --- a/libraries/pointers/src/Pick.h +++ b/libraries/pointers/src/Pick.h @@ -135,15 +135,29 @@ public: PickQuery(const PickFilter& filter, const float maxDistance, const bool enabled); /**jsdoc - * @namespace - * @augments Picks - * * Enum for different types of Picks and Pointers. * - * @typedef {enum} Picks.PickType + * @namespace PickType + * @variation 0 + * + * @hifi-interface + * @hifi-client-entity + * * @property {number} Ray Ray Picks intersect a ray with the nearest object in front of them, along a given direction. * @property {number} Stylus Stylus Picks provide "tapping" functionality on/into flat surfaces. */ + /**jsdoc + * + * + * + * + * + * + * + * + *
ValueDescription
{@link PickType(0)|PickType.Ray}
{@link PickType(0)|PickType.Stylus}
+ * @typedef {number} PickType + */ enum PickType { Ray = 0, Stylus, diff --git a/libraries/script-engine/src/FileScriptingInterface.h b/libraries/script-engine/src/FileScriptingInterface.h index 5cbe417130..7b833399e0 100644 --- a/libraries/script-engine/src/FileScriptingInterface.h +++ b/libraries/script-engine/src/FileScriptingInterface.h @@ -16,6 +16,15 @@ #include #include +/**jsdoc + * @namespace File + * + * @hifi-interface + * @hifi-client-entity + * @hifi-server-entity + * @hifi-assignment-client + */ + class FileScriptingInterface : public QObject { Q_OBJECT @@ -23,11 +32,41 @@ public: FileScriptingInterface(QObject* parent); public slots: + + /**jsdoc + * @function File.convertUrlToPath + * @param {string} url + * @returns {string} + */ QString convertUrlToPath(QUrl url); + + /**jsdoc + * @function File.runUnzip + * @param {string} path + * @param {string} url + * @param {boolean} autoAdd + * @param {boolean} isZip + * @param {boolean} isBlocks + */ void runUnzip(QString path, QUrl url, bool autoAdd, bool isZip, bool isBlocks); + + /**jsdoc + * @function File.getTempDir + * @returns {string} + */ QString getTempDir(); signals: + + /**jsdoc + * @function File.unzipResult + * @param {string} zipFile + * @param {string} unzipFile + * @param {boolean} autoAdd + * @param {boolean} isZip + * @param {boolean} isBlocks + * @returns {Signal} + */ void unzipResult(QString zipFile, QStringList unzipFile, bool autoAdd, bool isZip, bool isBlocks); private: diff --git a/libraries/script-engine/src/Mat4.h b/libraries/script-engine/src/Mat4.h index ceeea3ccec..288a101234 100644 --- a/libraries/script-engine/src/Mat4.h +++ b/libraries/script-engine/src/Mat4.h @@ -21,33 +21,147 @@ #include #include "RegisteredMetaTypes.h" +/**jsdoc + * @namespace Mat4 + * + * @hifi-interface + * @hifi-client-entity + * @hifi-server-entity + * @hifi-assignment-client + */ + /// Scriptable Mat4 object. Used exclusively in the JavaScript API class Mat4 : public QObject, protected QScriptable { Q_OBJECT public slots: + + /**jsdoc + * @function Mat4.multiply + * @param {Mat4} m1 + * @param {Mat4} m2 + * @returns {Mat4} + */ glm::mat4 multiply(const glm::mat4& m1, const glm::mat4& m2) const; + + /**jsdoc + * @function Mat4.createFromRotAndTrans + * @param {Quat} rot + * @param {Vec3} trans + * @returns {Mat4} + */ glm::mat4 createFromRotAndTrans(const glm::quat& rot, const glm::vec3& trans) const; + + /**jsdoc + * @function Mat4.createFromScaleRotAndTrans + * @param {Vec3} scale + * @param {Quat} rot + * @param {Vec3} trans + * @returns {Mat4} + */ glm::mat4 createFromScaleRotAndTrans(const glm::vec3& scale, const glm::quat& rot, const glm::vec3& trans) const; + + /**jsdoc + * @function Mat4.createFromColumns + * @param {Vec4} col0 + * @param {Vec4} col1 + * @param {Vec4} col2 + * @param {Vec4} col + * @returns {Mat4} + */ glm::mat4 createFromColumns(const glm::vec4& col0, const glm::vec4& col1, const glm::vec4& col2, const glm::vec4& col3) const; + + /**jsdoc + * @function Mat4.createFromArray + * @param {number[]} numbers + * @returns {Mat4} + */ glm::mat4 createFromArray(const QVector& floats) const; + + /**jsdoc + * @function Mat4.extractTranslation + * @param {Mat4} m + * @returns {Vec3} + */ glm::vec3 extractTranslation(const glm::mat4& m) const; + + /**jsdoc + * @function Mat4.extractRotation + * @param {Mat4} m + * @returns {Vec3} + */ glm::quat extractRotation(const glm::mat4& m) const; + + /**jsdoc + * @function Mat4.extractScale + * @param {Mat4} m + * @returns {Vec3} + */ glm::vec3 extractScale(const glm::mat4& m) const; + + /**jsdoc + * @function Mat4.transformPoint + * @param {Mat4} m + * @param {Vec3} point + * @returns {Vec3} + */ glm::vec3 transformPoint(const glm::mat4& m, const glm::vec3& point) const; + + /**jsdoc + * @function Mat4.transformVector + * @param {Mat4} m + * @param {Vec3} vector + * @returns {Vec3} + */ glm::vec3 transformVector(const glm::mat4& m, const glm::vec3& vector) const; + + /**jsdoc + * @function Mat4.inverse + * @param {Mat4} m + * @returns {Mat4} + */ glm::mat4 inverse(const glm::mat4& m) const; + + /**jsdoc + * @function Mat4.getFront + * @param {Mat4} m + * @returns {Vec3} + */ // redundant, calls getForward which better describes the returned vector as a direction glm::vec3 getFront(const glm::mat4& m) const { return getForward(m); } + + /**jsdoc + * @function Mat4.getForward + * @param {Mat4} m + * @returns {Vec3} + */ glm::vec3 getForward(const glm::mat4& m) const; + + /**jsdoc + * @function Mat4.getRight + * @param {Mat4} m + * @returns {Vec3} + */ glm::vec3 getRight(const glm::mat4& m) const; + + /**jsdoc + * @function Mat4.getUp + * @param {Mat4} m + * @returns {Vec3} + */ glm::vec3 getUp(const glm::mat4& m) const; + /**jsdoc + * @function Mat4.print + * @param {string} label + * @param {Mat4} m + * @param {boolean} [transpose=false] + */ void print(const QString& label, const glm::mat4& m, bool transpose = false) const; }; diff --git a/libraries/shared/src/RegisteredMetaTypes.cpp b/libraries/shared/src/RegisteredMetaTypes.cpp index a3d312b9c1..ed2a1d67eb 100644 --- a/libraries/shared/src/RegisteredMetaTypes.cpp +++ b/libraries/shared/src/RegisteredMetaTypes.cpp @@ -852,7 +852,21 @@ AnimationDetails::AnimationDetails(QString role, QUrl url, float fps, float prio running(running), currentFrame(currentFrame), allowTranslation(allowTranslation) { } - +/**jsdoc + * @typedef {object} Avatar.AnimationDetails + * @property {string} role + * @property {string} url + * @property {number} fps + * @property {number} priority + * @property {boolean} loop + * @property {boolean} hold + * @property {boolean} startAutomatically + * @property {number} firstFrame + * @property {number} lastFrame + * @property {boolean} running + * @property {number} currentFrame + * @property {boolean} allowTranslation + */ QScriptValue animationDetailsToScriptValue(QScriptEngine* engine, const AnimationDetails& details) { QScriptValue obj = engine->newObject(); obj.setProperty("role", details.role); diff --git a/libraries/task/src/task/Config.h b/libraries/task/src/task/Config.h index 36dfb35f25..ceb7e6c245 100644 --- a/libraries/task/src/task/Config.h +++ b/libraries/task/src/task/Config.h @@ -104,8 +104,17 @@ public: virtual void setPresetList(const QJsonObject& object); + /**jsdoc + * @function Render.toJSON + * @returns {string} + */ // This must be named toJSON to integrate with the global scripting JSON object Q_INVOKABLE QString toJSON() { return QJsonDocument(toJsonValue(*this).toObject()).toJson(QJsonDocument::Compact); } + + /**jsdoc + * @function Render.load + * @param {object} map + */ Q_INVOKABLE void load(const QVariantMap& map) { qObjectFromJsonValue(QJsonObject::fromVariantMap(map), *this); emit loaded(); } // Running Time measurement @@ -114,11 +123,31 @@ public: double getCPURunTime() const { return _msCPURunTime; } public slots: + + /**jsdoc + * @function Render.load + * @param {object} map + */ void load(const QJsonObject& val) { qObjectFromJsonValue(val, *this); emit loaded(); } signals: + + /**jsdoc + * @function Render.loaded + * @returns {Signal} + */ void loaded(); + + /**jsdoc + * @function Render.newStats + * @returns {Signal} + */ void newStats(); + + /**jsdoc + * @function Render.dirtyEnabled + * @returns {Signal} + */ void dirtyEnabled(); }; @@ -127,6 +156,16 @@ public: using Config = JobConfig; }; + +/**jsdoc + * @namespace Render + * + * @hifi-interface + * @hifi-client-entity + * + * @property {number} cpuRunTime - Read-only. + * @property {boolean} enabled + */ class TaskConfig : public JobConfig { Q_OBJECT public: @@ -137,8 +176,11 @@ public: TaskConfig() = default ; TaskConfig(bool enabled) : JobConfig(enabled) {} - - + /**jsdoc + * @function Render.getConfig + * @param {string} name + * @returns {object} + */ // Get a sub job config through task.getConfig(path) // where path can be: // - search for the first job named job_name traversing the the sub graph of task and jobs (from this task as root) @@ -176,6 +218,10 @@ public: JobConcept* _task; public slots: + + /**jsdoc + * @function Render.refresh + */ void refresh(); }; diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index a1d09139e3..25f0652496 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -30,6 +30,15 @@ #include +/**jsdoc + * @namespace OffscreenFlags + * + * @hifi-interface + * @hifi-client-entity + * @property {boolean} navigationFocused + * @property {boolean} navigationFocusDisabled + */ + // Needs to match the constants in resources/qml/Global.js class OffscreenFlags : public QObject { Q_OBJECT @@ -58,7 +67,17 @@ public: } signals: + + /**jsdoc + * @function OffscreenFlags.navigationFocusedChanged + * @returns {Signal} + */ void navigationFocusedChanged(); + + /**jsdoc + * @function OffscreenFlags.navigationFocusDisabledChanged + * @returns {Signal} + */ void navigationFocusDisabledChanged(); private: diff --git a/libraries/ui/src/QmlWebWindowClass.h b/libraries/ui/src/QmlWebWindowClass.h index cdc07265cd..8cf77e4286 100644 --- a/libraries/ui/src/QmlWebWindowClass.h +++ b/libraries/ui/src/QmlWebWindowClass.h @@ -11,6 +11,47 @@ #include "QmlWindowClass.h" +/**jsdoc + * @class OverlayWebWindow + * @param {OverlayWindow.Properties} [properties=null] + * + * @hifi-interface + * @hifi-client-entity + * + * @property {string} url - Read-only. + * @property {Vec2} position + * @property {Vec2} size + * @property {boolean} visible + * + * @borrows OverlayWindow.initQml as initQml + * @borrows OverlayWindow.isVisible as isVisible + * @borrows OverlayWindow.setVisible as setVisible + * @borrows OverlayWindow.getPosition as getPosition + * @borrows OverlayWindow.setPosition as setPosition + * @borrows OverlayWindow.getSize as getSize + * @borrows OverlayWindow.setSize as setSize + * @borrows OverlayWindow.setTitle as setTitle + * @borrows OverlayWindow.raise as raise + * @borrows OverlayWindow.close as close + * @borrows OverlayWindow.getEventBridge as getEventBridge + * @borrows OverlayWindow.sendToQml as sendToQml + * @borrows OverlayWindow.clearDebugWindow as clearDebugWindow + * @borrows OverlayWindow.emitScriptEvent as emitScriptEvent + * @borrows OverlayWindow.emitWebEvent as emitWebEvent + * @borrows OverlayWindow.visibleChanged as visibleChanged + * @borrows OverlayWindow.positionChanged as positionChanged + * @borrows OverlayWindow.sizeChanged as sizeChanged + * @borrows OverlayWindow.moved as moved + * @borrows OverlayWindow.resized as resized + * @borrows OverlayWindow.closed as closed + * @borrows OverlayWindow.fromQml as fromQml + * @borrows OverlayWindow.scriptEventReceived as scriptEventReceived + * @borrows OverlayWindow.webEventReceived as webEventReceived + * @borrows OverlayWindow.hasMoved as hasMoved + * @borrows OverlayWindow.hasClosed as hasClosed + * @borrows OverlayWindow.qmlToScript as qmlToScript + */ + // FIXME refactor this class to be a QQuickItem derived type and eliminate the needless wrapping class QmlWebWindowClass : public QmlWindowClass { Q_OBJECT @@ -20,11 +61,29 @@ public: static QScriptValue constructor(QScriptContext* context, QScriptEngine* engine); public slots: + + /**jsdoc + * @function OverlayWebWindow.getURL + * @returns {string} + */ QString getURL(); + /**jsdoc + * @function OverlayWebWindow.setURL + * @param {string} url + */ void setURL(const QString& url); + + /**jsdoc + * @function OverlayWebWindow.setScriptURL + * @param {string} script + */ void setScriptURL(const QString& script); signals: + /**jsdoc + * @function OverlayWebWindow.urlChanged + * @returns {Signal} + */ void urlChanged(); protected: diff --git a/libraries/ui/src/QmlWindowClass.cpp b/libraries/ui/src/QmlWindowClass.cpp index 02c9707d95..64fa27c8c6 100644 --- a/libraries/ui/src/QmlWindowClass.cpp +++ b/libraries/ui/src/QmlWindowClass.cpp @@ -87,6 +87,14 @@ QmlWindowClass::QmlWindowClass() { } +/**jsdoc + * @typedef {object} OverlayWindow.Properties + * @property {string} title + * @property {string} source + * @property {number} width + * @property {number} height + * @property {boolean} visible + */ void QmlWindowClass::initQml(QVariantMap properties) { auto offscreenUi = DependencyManager::get(); _source = properties[SOURCE_PROPERTY].toString(); diff --git a/libraries/ui/src/QmlWindowClass.h b/libraries/ui/src/QmlWindowClass.h index f274501d35..2b01c028ea 100644 --- a/libraries/ui/src/QmlWindowClass.h +++ b/libraries/ui/src/QmlWindowClass.h @@ -19,6 +19,18 @@ class QScriptEngine; class QScriptContext; +/**jsdoc + * @class OverlayWindow + * @param {OverlayWindow.Properties} [properties=null] + * + * @hifi-interface + * @hifi-client-en + * + * @property {Vec2} position + * @property {Vec2} size + * @property {boolean} visible + */ + // FIXME refactor this class to be a QQuickItem derived type and eliminate the needless wrapping class QmlWindowClass : public QObject { Q_OBJECT @@ -31,51 +43,202 @@ public: QmlWindowClass(); ~QmlWindowClass(); + /**jsdoc + * @function OverlayWindow.initQml + * @param {OverlayWindow.Properties} properties + */ Q_INVOKABLE virtual void initQml(QVariantMap properties); + QQuickItem* asQuickItem() const; public slots: + + /**jsdoc + * @function OverlayWindow.isVisible + * @returns {boolean} + */ bool isVisible(); + + /**jsdoc + * @function OverlayWindow.setVisible + * @param {boolean} visible + */ void setVisible(bool visible); + + /**jsdoc + * @function OverlayWindow.getPosition + * @returns {Vec2} + */ glm::vec2 getPosition(); + + /**jsdoc + * @function OverlayWindow.setPosition + * @param {Vec2} position + */ void setPosition(const glm::vec2& position); + + /**jsdoc + * @function OverlayWindow.setPosition + * @param {number} x + * @param {number} y + */ void setPosition(int x, int y); + + /**jsdoc + * @function OverlayWindow.getSize + * @returns {Vec2} + */ glm::vec2 getSize(); + + /**jsdoc + * @function OverlayWindow.setSize + * @param {Vec2} size + */ void setSize(const glm::vec2& size); + + /**jsdoc + * @function OverlayWindow.setSize + * @param {number} width + * @param {number} height + */ void setSize(int width, int height); + + /**jsdoc + * @function OverlayWindow.setTitle + * @param {string} title + */ void setTitle(const QString& title); + + /**jsdoc + * @function OverlayWindow.raise + */ Q_INVOKABLE void raise(); + + /**jsdoc + * @function OverlayWindow.close + */ Q_INVOKABLE void close(); + + /**jsdoc + * @function OverlayWindow.getEventBridge + * @returns {object} + */ Q_INVOKABLE QObject* getEventBridge() { return this; }; + + /**jsdoc + * @function OverlayWindow.sendToQml + * @param {object} message + */ // Scripts can use this to send a message to the QML object void sendToQml(const QVariant& message); + + /**jsdoc + * @function OverlayWindow.clearDebugWindow + */ void clearDebugWindow(); + + /**jsdoc + * @function OverlayWindow.emitScriptEvent + * @param {object} message + */ // QmlWindow content may include WebView requiring EventBridge. void emitScriptEvent(const QVariant& scriptMessage); + + /**jsdoc + * @function OverlayWindow.emitWebEvent + * @param {object} message + */ void emitWebEvent(const QVariant& webMessage); signals: + + /**jsdoc + * @function OverlayWindow.visibleChanged + * @returns {Signal} + */ void visibleChanged(); + + /**jsdoc + * @function OverlayWindow.positionChanged + * @returns {Signal} + */ void positionChanged(); + + /**jsdoc + * @function OverlayWindow.sizeChanged + * @returns {Signal} + */ void sizeChanged(); + + /**jsdoc + * @function OverlayWindow.moved + * @param {Vec2} position + * @returns {Signal} + */ void moved(glm::vec2 position); + + /**jsdoc + * @function OverlayWindow.resized + * @param {Size} size + * @returns {Signal} + */ void resized(QSizeF size); + + /**jsdoc + * @function OverlayWindow.closed + * @returns {Signal} + */ void closed(); + + /**jsdoc + * @function OverlayWindow.fromQml + * @param {object} message + * @returns {Signal} + */ // Scripts can connect to this signal to receive messages from the QML object void fromQml(const QVariant& message); + + /**jsdoc + * @function OverlayWindow.scriptEventReceived + * @param {object} message + * @returns {Signal} + */ // QmlWindow content may include WebView requiring EventBridge. void scriptEventReceived(const QVariant& message); + + /**jsdoc + * @function OverlayWindow.webEventReceived + * @param {object} message + * @returns {Signal} + */ void webEventReceived(const QVariant& message); protected slots: + + /**jsdoc + * @function OverlayWindow.hasMoved + * @param {Vec2} position + * @returns {Signal} + */ void hasMoved(QVector2D); + + /**jsdoc + * @function OverlayWindow.hasClosed + * @returns {Signal} + */ void hasClosed(); + + /**jsdoc + * @function OverlayWindow.qmlToScript + * @param {object} message + * @returns {Signal} + */ void qmlToScript(const QVariant& message); protected: diff --git a/libraries/ui/src/ui/TabletScriptingInterface.h b/libraries/ui/src/ui/TabletScriptingInterface.h index e74b846f02..f30c6de75e 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.h +++ b/libraries/ui/src/ui/TabletScriptingInterface.h @@ -44,6 +44,14 @@ class OffscreenQmlSurface; * @hifi-interface * @hifi-client-entity */ +/**jsdoc + * @namespace tabletInterface + * + * @hifi-interface + * @hifi-client-entity + * + * @deprecated This API is deprecated and will be removed. Use {@link Tablet} instead. + */ class TabletScriptingInterface : public QObject, public Dependency { Q_OBJECT public: @@ -83,6 +91,13 @@ public: * @param {string} name - Tablet name. * @returns {TabletProxy} Tablet instance. */ + /**jsdoc + * Creates or returns a new TabletProxy and returns it. + * @function tabletInterface.getTablet + * @param {string} name - Tablet name. + * @returns {TabletProxy} Tablet instance. + * @deprecated This function is deprecated and will be removed. Use {@link Tablet.getTablet} instead. + */ Q_INVOKABLE TabletProxy* getTablet(const QString& tabletId); void preloadSounds(); @@ -91,6 +106,11 @@ public: * @function Tablet.playSound * @param {Tablet.AudioEvents} sound */ + /**jsdoc + * @function tabletInterface.playSound + * @param {Tablet.AudioEvents} sound + * @deprecated This function is deprecated and will be removed. Use {@link Tablet.playSound} instead. + */ Q_INVOKABLE void playSound(TabletAudioEvents aEvent); void setToolbarMode(bool toolbarMode); @@ -108,6 +128,12 @@ signals: * @function Tablet.tabletNotification * @returns {Signal} */ + /**jsdoc + * Triggered when a tablet message or dialog is created. + * @function tabletInterface.tabletNotification + * @returns {Signal} + * @deprecated This function is deprecated and will be removed. Use {@link Tablet.tabletNotification} instead. + */ void tabletNotification(); private: diff --git a/libraries/ui/src/ui/ToolbarScriptingInterface.h b/libraries/ui/src/ui/ToolbarScriptingInterface.h index 108cf6bdd5..777eeba9dd 100644 --- a/libraries/ui/src/ui/ToolbarScriptingInterface.h +++ b/libraries/ui/src/ui/ToolbarScriptingInterface.h @@ -19,14 +19,56 @@ class QQuickItem; +/**jsdoc + * @class ToolbarButtonProxy + * + * @hifi-interface + * @hifi-client-entity + */ class ToolbarButtonProxy : public QmlWrapper { Q_OBJECT public: ToolbarButtonProxy(QObject* qmlObject, QObject* parent = nullptr); + + /**jsdoc + * @function ToolbarButtonProxy#editProperties + * @param {object} properties + */ Q_INVOKABLE void editProperties(const QVariantMap& properties); + + // QmlWrapper methods. + + /**jsdoc + * @function ToolbarButtonProxy#writeProperty + * @parm {string} propertyName + * @param {object} propertyValue + */ + + /**jsdoc + * @function ToolbarButtonProxy#writeProperties + * @param {object} properties + */ + + /**jsdoc + * @function ToolbarButtonProxy#readProperty + * @param {string} propertyName + * @returns {object} + */ + + /**jsdoc + * @function ToolbarButtonProxy#readProperties + * @param {string[]} propertyList + * @returns {object} + */ + signals: + + /**jsdoc + * @function ToolbarButtonProxy#clicked + * @returns {Signal} + */ void clicked(); protected: @@ -36,19 +78,74 @@ protected: Q_DECLARE_METATYPE(ToolbarButtonProxy*); +/**jsdoc + * @class ToolbarProxy + * + * @hifi-interface + * @hifi-client-entity + */ class ToolbarProxy : public QmlWrapper { Q_OBJECT public: ToolbarProxy(QObject* qmlObject, QObject* parent = nullptr); + + /**jsdoc + * @function ToolbarProxy#addButton + * @param {object} properties + * @returns {ToolbarButtonProxy} + */ Q_INVOKABLE ToolbarButtonProxy* addButton(const QVariant& properties); + + /**jsdoc + * @function ToolbarProxy#removeButton + * @param {string} name + */ Q_INVOKABLE void removeButton(const QVariant& name); + + + // QmlWrapper methods. + + /**jsdoc + * @function ToolbarProxy#writeProperty + * @parm {string} propertyName + * @param {object} propertyValue + */ + + /**jsdoc + * @function ToolbarProxy#writeProperties + * @param {object} properties + */ + + /**jsdoc + * @function ToolbarProxy#readProperty + * @param {string} propertyName + * @returns {object} + */ + + /**jsdoc + * @function ToolbarProxy#readProperties + * @param {string[]} propertyList + * @returns {object} + */ }; Q_DECLARE_METATYPE(ToolbarProxy*); +/**jsdoc + * @namespace Toolbars + * + * @hifi-interface + * @hifi-client-entity + */ class ToolbarScriptingInterface : public QObject, public Dependency { Q_OBJECT public: + + /**jsdoc + * @function Toolbars.getToolbar + * @param {string} toolbarID + * @returns {ToolbarProxy} + */ Q_INVOKABLE ToolbarProxy* getToolbar(const QString& toolbarId); }; diff --git a/tools/jsdoc/plugins/hifi.js b/tools/jsdoc/plugins/hifi.js index 5092e8b809..4378c2b4cb 100644 --- a/tools/jsdoc/plugins/hifi.js +++ b/tools/jsdoc/plugins/hifi.js @@ -20,6 +20,10 @@ exports.handlers = { // directories to scan for jsdoc comments var dirList = [ + '../../assignment-client/src', + '../../assignment-client/src/avatars', + '../../assignment-client/src/entities', + '../../assignment-client/src/octree', '../../interface/src', '../../interface/src/assets', '../../interface/src/audio', @@ -28,10 +32,10 @@ exports.handlers = { '../../interface/src/devices', '../../interface/src/java', '../../interface/src/networking', - '../../interface/src/ui/', - '../../interface/src/scripting', - '../../interface/src/ui/overlays', '../../interface/src/raypick', + '../../interface/src/scripting', + '../../interface/src/ui/', + '../../interface/src/ui/overlays', '../../libraries/animation/src', '../../libraries/audio-client/src', '../../libraries/audio/src', @@ -41,17 +45,22 @@ exports.handlers = { '../../libraries/controllers/src/controllers/impl/', '../../libraries/display-plugins/src/display-plugins/', '../../libraries/entities/src', + '../../libraries/graphics/src/graphics/', '../../libraries/graphics-scripting/src/graphics-scripting/', '../../libraries/input-plugins/src/input-plugins', + '../../libraries/midi/src', '../../libraries/model-networking/src/model-networking/', '../../libraries/networking/src', '../../libraries/octree/src', '../../libraries/physics/src', + '../../libraries/plugins/src/plugins', '../../libraries/pointers/src', '../../libraries/script-engine/src', '../../libraries/shared/src', '../../libraries/shared/src/shared', + '../../libraries/task/src/task', '../../libraries/trackers/src/trackers', + '../../libraries/ui/src', '../../libraries/ui/src/ui', '../../plugins/oculus/src', '../../plugins/openvr/src' @@ -106,8 +115,8 @@ exports.handlers = { // Append an Available In: table at the end of the namespace description. if (rows.length > 0) { - var table = "

Available in:" + rows.join("") + "
"; - e.doclet.description = (e.doclet.description ? e.doclet.description : "") + table; + var table = "
Available in:" + rows.join("") + "

"; + e.doclet.description = table + (e.doclet.description ? e.doclet.description : ""); } } }