123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #pragma once
- #include "lib3mf_implicit.hpp"
- #include "OptiTrackPoint.hpp"
- #include "SteamVRTrackPoint.hpp"
- #include "ActionPoint.hpp"
- #include "TrackSystemSettingsStructs.hpp"
- #include "OpenScadRenderer.hpp"
- #include "enums.hpp"
- #include <string>
- #include <nlohmann/json.hpp>
- struct steamVrTrackPointJson {
- float point[3];
- float normal[3];
- };
- using json = nlohmann::json;
- class ProjectStore {
- public:
-
- ProjectStore();
-
- ~ProjectStore();
-
- void loadMesh(std::string meshFile);
-
- bool loadProject(std::string projectFile);
-
- bool saveProject();
-
- bool saveProject(std::string projectFile);
-
- bool exportProject(std::string path, ExportSettings settings);
-
- bool isProjectOpen();
-
- void closeProject();
-
- bool isModified();
-
- void projectModified();
-
-
- TrackPoint* getTrackPointById(int id, ActiveTrackingSystem activeTrackingSystem);
-
- void addTrackPoint(osg::Vec3 point, osg::Vec3 normal, ActiveTrackingSystem activeTrackingSystem);
-
- int getCount(ActiveTrackingSystem activeTrackingSystem);
-
- void removeTrackPoint(int id, ActiveTrackingSystem activeTrackingSystem);
-
-
- void updateNormalModifier(osg::Vec3 modifier);
-
- osg::Vec3 getNormalModifier();
-
-
- std::vector<OptiTrackPoint*> getOptiTrackPoints();
-
- void updateOptiTrackSettings(OptiTrackSettings optiTrackSettings);
-
- OptiTrackSettings getOptiTrackSettings();
-
-
- std::vector<SteamVRTrackPoint*> getSteamVRTrackPoints();
-
- void updateSteamVRTrackSettings(SteamVRTrackSettings steamVrTrackSettings);
-
- SteamVRTrackSettings getSteamVRTrackSettings();
-
-
- std::vector<ActionPoint*> getActionPoints();
-
- void updateActionPointSettings(ActionPointSettings actionPointSettings);
-
- ActionPointSettings getActionPointSettings();
-
- unsigned int actionPointIdentifierInUse(std::string candidate, int current);
- private:
- bool _projectLoaded;
- bool _projectModified;
- Lib3MF::PWrapper _wrapper;
- Lib3MF::PModel _project;
- std::string _projectFile;
- std::vector<OptiTrackPoint*> _optiTrackPoints;
- std::vector<SteamVRTrackPoint*> _steamVrTrackPoints;
- std::vector<ActionPoint*> _actionPoints;
- OptiTrackSettings _optiTrackSettings = OptiTrackSettings {OPTITRACK_DEFAULT_LENGTH, OPTITRACK_DEFAULT_RADIUS};
- EMFTrackSettings _emfTrackSettings;
- SteamVRTrackSettings _steamVrTrackSettings = SteamVRTrackSettings {STEAMVR_DEFAULT_LENGTH};
- ActionPointSettings _actionPointSettings = ActionPointSettings {ACTIONPOINT_DEFAULT_IDENFIFIER};
- osg::Vec3 _normalModifier = osg::Vec3(0.0f, 0.0f, 0.0f);
- void load3mfLib();
- void reset();
- void render3MFMesh();
- void updateMetaData();
- void loadMetaData();
- std::vector<float> osgVecToStdVec(osg::Vec3f input);
- osg::Vec3f stdVecToOsgVec(std::vector<float> input);
- };
|