36 lines
914 B
C++
36 lines
914 B
C++
|
|
#pragma once
|
||
|
|
#include <string>
|
||
|
|
#include <regex>
|
||
|
|
#include <iostream>
|
||
|
|
#include "./Curve.hpp"
|
||
|
|
#include "Bezier.hpp"
|
||
|
|
#include "NURBS.hpp"
|
||
|
|
|
||
|
|
class CurvesLoader {
|
||
|
|
static string currentCurveType;
|
||
|
|
static vector<glm::vec3>* pointsBuffer;
|
||
|
|
|
||
|
|
static vector<NURBS*> NURBSes;
|
||
|
|
static vector<Bezier3Segments*> beziers;
|
||
|
|
|
||
|
|
static unsigned int NURBSOrder;
|
||
|
|
static NURBSType NURBS_TYPE;
|
||
|
|
static vector<float>* NURBSWeights;
|
||
|
|
|
||
|
|
static char lineHeader[128];
|
||
|
|
static char* res;
|
||
|
|
static FILE* file;
|
||
|
|
|
||
|
|
static std::smatch pieces;
|
||
|
|
static void beginCurve(string str, std::smatch pieces, std::regex regex);
|
||
|
|
static NURBS* BasicNURBS();
|
||
|
|
static NURBS* ClampedNURBS();
|
||
|
|
static NURBS* CyclicNURBS();
|
||
|
|
static void closeNURBS();
|
||
|
|
static void closeBezier();
|
||
|
|
static void closePendingCurve();
|
||
|
|
static void parseVertexData(string str);
|
||
|
|
public:
|
||
|
|
static bool loadCurves(std::string path, vector<Curve*>& curves);
|
||
|
|
};
|