From 3fcc2d3fa5d344a3f66cd40f979e021e56a89b92 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 14 Nov 2016 13:52:16 -0800 Subject: [PATCH] Add jsdoc to Clipboard --- .../scripting/ClipboardScriptingInterface.h | 51 ++++++++++++++++--- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/interface/src/scripting/ClipboardScriptingInterface.h b/interface/src/scripting/ClipboardScriptingInterface.h index 4737a194df..3c10475242 100644 --- a/interface/src/scripting/ClipboardScriptingInterface.h +++ b/interface/src/scripting/ClipboardScriptingInterface.h @@ -13,6 +13,9 @@ #include +/**jsdoc + * @namespace Clipboard + */ class ClipboardScriptingInterface : public QObject { Q_OBJECT public: @@ -21,13 +24,47 @@ public: signals: void readyToImport(); -public slots: - glm::vec3 getContentsDimensions(); /// returns the overall dimensions of everything on the blipboard - float getClipboardContentsLargestDimension(); /// returns the largest dimension of everything on the clipboard - bool importEntities(const QString& filename); - bool exportEntities(const QString& filename, const QVector& entityIDs); - bool exportEntities(const QString& filename, float x, float y, float z, float s); - QVector pasteEntities(glm::vec3 position); +public: + /**jsdoc + * @function Clipboard.getContentsDimensions + * @return {Vec3} The extents of the contents held in the clipboard. + */ + Q_INVOKABLE glm::vec3 getContentsDimensions(); + + /**jsdoc + * Compute largest dimension of the extents of the contents held in the clipboard + * @function Clipboard.getClipboardContentsLargestDimension + * @return {float} The largest dimension computed. + */ + Q_INVOKABLE float getClipboardContentsLargestDimension(); + + /**jsdoc + * Import entities from a .json file containing entity data into the clipboard. + * You can generate * a .json file using {Clipboard.exportEntities}. + * @function Clipboard.importEntities + * @param {string} filename Filename of file to import. + * @return {bool} True if the import was succesful, otherwise false. + */ + Q_INVOKABLE bool importEntities(const QString& filename); + + /**jsdoc + * Export the entities listed in `entityIDs` to the file `filename` + * @function Clipboard.exportEntities + * @param {string} filename Path to the file to export entities to. + * @param {EntityID[]} entityIDs IDs of entities to export. + * @return {bool} True if the export was succesful, otherwise false. + */ + Q_INVOKABLE bool exportEntities(const QString& filename, const QVector& entityIDs); + Q_INVOKABLE bool exportEntities(const QString& filename, float x, float y, float z, float s); + + /**jsdoc + * Paste the contents of the clipboard into the world. + * @function Clipboard.pasteEntities + * @param {Vec3} position Position to paste clipboard at. + * @return {EntityID[]} Array of entity IDs for the new entities that were + * created as a result of the paste operation. + */ + Q_INVOKABLE QVector pasteEntities(glm::vec3 position); }; #endif // hifi_ClipboardScriptingInterface_h