mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-07 20:09:58 -05:00
Added task code for conversion to ascii
This commit is contained in:
@@ -362,6 +362,15 @@ public:
|
||||
static void saveScriptKeyframeAscii(timestamps times,
|
||||
datamessagestructures::ScriptMessage& sm, std::ofstream& file);
|
||||
|
||||
/**
|
||||
* Reads header information from a session recording file
|
||||
*
|
||||
* \param stream reference to ifstream that contains the session recording file data
|
||||
* \param readLen_chars number of characters to be read, which may be the expected
|
||||
* length of the header line, or an arbitrary number of characters within it
|
||||
*/
|
||||
static std::string readHeaderElement(std::ifstream& stream, size_t readLen_chars);
|
||||
|
||||
private:
|
||||
enum class RecordedType {
|
||||
Camera = 0,
|
||||
|
||||
@@ -51,4 +51,11 @@ T prevKeyframeObj(unsigned int index, const std::vector<T>& keyframeContainer) {
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T readFromPlayback(std::ifstream& stream) {
|
||||
T res;
|
||||
stream.read(reinterpret_cast<char*>(&res), sizeof(T));
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define __OPENSPACE_CORE___CONVERTRECFORMATTASK___H__
|
||||
|
||||
#include <openspace/util/task.h>
|
||||
#include <openspace/interaction/sessionrecording.h>
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
@@ -38,7 +39,7 @@ namespace {
|
||||
constexpr const char* KeyOutFilePath = "OutputFilePath";
|
||||
}
|
||||
|
||||
namespace openspace {
|
||||
namespace openspace::interaction {
|
||||
|
||||
class ConvertRecFormatTask : public Task {
|
||||
public:
|
||||
@@ -51,19 +52,23 @@ public:
|
||||
std::string description() override;
|
||||
void perform(const Task::ProgressCallback& progressCallback) override;
|
||||
static documentation::Documentation documentation();
|
||||
void convert();
|
||||
SessionRecording::RecordedDataMode ConvertRecFormatTask::formatType();
|
||||
|
||||
private:
|
||||
void convertToAscii();
|
||||
void convertToBinary();
|
||||
|
||||
std::string addFileSuffix(const std::string& filePath, const std::string& suffix);
|
||||
std::string _inFilePath;
|
||||
std::string _outFilePath;
|
||||
std::ifstream _iFile;
|
||||
std::ifstream _oFile;
|
||||
std::ofstream _oFile;
|
||||
|
||||
std::string _valueFunctionLua;
|
||||
|
||||
SessionRecording sr;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
} // namespace openspace::interaction
|
||||
|
||||
#endif //__OPENSPACE_CORE___CONVERTRECFORMATTASK___H__
|
||||
|
||||
Reference in New Issue
Block a user