Showing the changes to libraries/script-engine/src/ModelScriptingInterface.h (1 of 6 files). Show all
Unified · Split
| @@ -17,6 +17,7 @@ · 16 unmodified lines | |||
| 17 | #include <QScriptValue> | 17 | #include <QScriptValue> |
| 18 | #include <OBJWriter.h> | 18 | #include <OBJWriter.h> |
| 19 | #include <model/Geometry.h> | 19 | #include <model/Geometry.h> |
| 20 | #include "MeshProxy.h" | ||
| 20 | 21 | ||
| 21 | using MeshPointer = std::shared_ptr<model::Mesh>; | 22 | using MeshPointer = std::shared_ptr<model::Mesh>; |
| 22 | 23 | ||
| @@ -25,30 +26,12 @@ class ModelScriptingInterface : public QObject { · 2 unmodified lines | |||
| 25 | 26 | ||
| 26 | public: | 27 | public: |
| 27 | ModelScriptingInterface(QObject* parent); | 28 | ModelScriptingInterface(QObject* parent); |
| 28 | }; | ||
| 29 | |||
| 30 | class MeshProxy : public QObject { | ||
| 31 | Q_OBJECT | ||
| 32 | |||
| 33 | public: | ||
| 34 | MeshProxy(MeshPointer mesh); | ||
| 35 | // MeshProxy(const MeshProxy& meshProxy) { _mesh = meshProxy.getMeshPointer(); } | ||
| 36 | ~MeshProxy(); | ||
| 37 | |||
| 38 | MeshPointer getMeshPointer() const { return _mesh; } | ||
| 39 | 29 | ||
| 40 | Q_INVOKABLE int getNumVertices() const { return _mesh->getNumVertices(); } | 30 | Q_INVOKABLE QString meshToOBJ(MeshProxy* const &in); |
| 41 | |||
| 42 | protected: | ||
| 43 | MeshPointer _mesh; | ||
| 44 | }; | 31 | }; |
| 45 | 32 | ||
| 46 | |||
| 47 | Q_DECLARE_METATYPE(MeshProxy*); | ||
| 48 | |||
| 49 | |||
| 50 | QScriptValue meshToScriptValue(QScriptEngine* engine, MeshProxy* const &in); | 33 | QScriptValue meshToScriptValue(QScriptEngine* engine, MeshProxy* const &in); |
| 51 | // QScriptValue meshToScriptValue(QScriptEngine* engine, const MeshPointer& in); | ||
| 52 | void meshFromScriptValue(const QScriptValue& value, MeshProxy* &out); | 34 | void meshFromScriptValue(const QScriptValue& value, MeshProxy* &out); |
| 53 | 35 | ||
| 36 | |||
| 54 | #endif // hifi_ModelScriptingInterface_h | 37 | #endif // hifi_ModelScriptingInterface_h |