Removing some more global state

This commit is contained in:
Alexander Bock
2020-06-18 10:59:22 +02:00
parent a433ed1a72
commit e00a51d822
6 changed files with 160 additions and 204 deletions

View File

@@ -73,7 +73,7 @@ public:
* Saves all current settings, similar to saveCurrentSettingsToProfile() except the
* output is a string without writing to a file.
*/
std::string saveCurrentSettingsToProfile_string();
//std::string saveCurrentSettingsToProfile_string();
/**
* Reads in a .profile file, converts it to scene/asset equivalent syntax, and
@@ -97,26 +97,25 @@ protected:
std::string _profileBaseDirectory = "${ASSETS}";
private:
ProfileData profile;
struct AllAssetDetails {
std::vector<AssetEvent> base;
std::vector<AssetEvent> changed;
};
virtual bool usingProfile() const;
virtual std::string initialProfile() const;
virtual std::string profileBaseDirectory() const;
virtual std::vector<AssetEvent> assetEvents() const;
ProfileStruct collateBaseWithChanges();
ProfileData collateBaseWithChanges();
std::vector<AssetEvent> modifyAssetsToReflectChanges(ProfileStruct& ps);
void parseAssetFileLines(std::vector<AssetEvent>& results, ProfileStruct& ps);
std::vector<AssetEvent> modifyAssetsToReflectChanges(ProfileData& ps);
void parseAssetFileLines(std::vector<AssetEvent>& results, ProfileData& ps);
void modifyPropertiesToReflectChanges(ProfileStruct& ps);
void modifyPropertiesToReflectChanges(ProfileData& ps);
virtual std::vector<openspace::properties::Property*> changedProperties();
std::string getFullPropertyPath(openspace::properties::Property* prop);
virtual std::vector<std::string> changedPropertiesFormatted();
virtual std::string currentTimeUTC() const;
virtual interaction::NavigationHandler::NavigationState currentCameraState() const;
void addCurrentCameraToProfileFile(ProfileStruct& ps) const;
};
} // namespace openspace

View File

@@ -25,25 +25,14 @@
#ifndef __OPENSPACE_CORE___PROFILEFILE___H__
#define __OPENSPACE_CORE___PROFILEFILE___H__
#include <string>
#include <istream>
#include <fstream>
#include <functional>
#include <optional>
#include <string>
#include <variant>
#include <vector>
#include <ghoul/systemcapabilities/version.h>
namespace ghoul { class Dictionary; }
namespace ghoul::opengl { class ProgramObject; }
namespace openspace {
namespace documentation { struct Documentation; }
namespace scripting { struct LuaLibrary; }
struct ProfileStruct {
struct ProfileData {
// Version
struct Version {
int major = 0;
@@ -128,12 +117,10 @@ struct ProfileStruct {
std::vector<std::string> markNodes;
};
std::string serialize(const ProfileStruct& ps);
ProfileStruct deserialize(const std::vector<std::string>& content);
std::string serialize(const ProfileData& ps);
ProfileData deserialize(const std::vector<std::string>& content);
std::string convertToSceneFile(const ProfileStruct& ps);
ProfileStruct readFromFile(const std::string& filename);
std::string convertToSceneFile(const ProfileData& ps);
} // namespace openspace