#ifndef HELIX_IO_H
#define HELIX_IO_H

#include "SETTINGS.h"

using namespace std;

/**
 * Writes multiset of superhelix params into a big file
 * \param strands The vector of superhelix vectors (one internal vector per strand)
 * \param roots The vector of root points
 * \param startTans The vector of starting tangents
 * \param filename The filepath to write to
 */
bool writeMultSupHelixStrand(const vector<vector<superHelix>>& strands, 
                          const vector<VEC3>& roots, const vector<VEC3>& startTans, const char* filename);

/**
 * Writes a single set of superhelix params into a big file
 * \param helixSegment The vector of superhelix vectors (one internal vector per strand)
 * \param root The vector of root points
 * \param startTanget The vector of starting tangents
 * \param filename The filepath to write to
 */
bool writeBasicSupHelixStrand(const vector<superHelix>& helixParams, 
                            const VEC3& root, const VEC3& startTangent, const char* filename);

/**
 * Reads multiset of superhelix params into strands, roots, and tans
 */
bool readMultSupHelixStrand(const char* filename, vector<vector<superHelix>>& strands,
                          vector<VEC3>& roots, vector<VEC3>& tans);

/**
 * Reads single set of superhelix params into strands, roots, and tans
 */
bool readBasicSupHelixStrand(const char* filename, vector<superHelix>& strand,
                          VEC3& root, VEC3& tan);

/**
 * Writes multiset of local superhelix params into a big file
 * \param strands The vector of superhelix vectors (one internal vector per strand)
 * \param roots The vector of root points
 * \param startFrames The vector of starting frames
 * \param filename The filepath to write to
 */
bool writeMultLocalSupHelixStrand(const vector<vector<superHelix>>& strands, 
                          const vector<VEC3>& roots, const vector<MATRIX3>& startFrames, const char* filename);

/**
 * Writes a single set of superhelix params into a big file
 * \param helixSegment The vector of superhelix vectors (one internal vector per strand)
 * \param root The vector of root points
 * \param startFrames The vector of starting frames
 * \param filename The filepath to write to
 */
bool writeBasicLocalSupHelixStrand(const vector<superHelix>& helixParams, 
                            const VEC3& root, const MATRIX3& startFrame, const char* filename);

/**
 * Reads multiset of superhelix params into strands, roots, and tans
 */
bool readMultLocalSupHelixStrand(const char* filename, vector<vector<superHelix>>& strands,
                          vector<VEC3>& roots, vector<MATRIX3>& frames);

/**
 * Reads single set of superhelix params into strands, roots, and tans
 */
bool readBasicLocalSupHelixStrand(const char* filename, vector<superHelix>& strand,
                          VEC3& root, MATRIX3& frame);

#endif