-
Notifications
You must be signed in to change notification settings - Fork 1
/
ASFParser.h
63 lines (47 loc) · 1.14 KB
/
ASFParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _ASF_PARSER_H_
#define _ASF_PARSER_H_
#include "MotionParser.h"
#include "Character.h"
#include <glm/common.hpp>
#include <vector>
#include <string>
#include <sstream>
#include <map>
namespace MotionParser {
class ASFParser
{
public:
ASFParser();
~ASFParser();
void ReadASF(std::string);
Character* Create_Character();
inline const std::map<std::string, BoneNode*>& GetBoneNameMap()
{
return bone_name_map_;
}
private:
bool ReadFileContent();
// subroutine of ReadASF()
void Parse_Header();
void Parse_Root();
void Parse_BoneData();
void Determine_DOF_Types();
void Create_Bone_Name_Map();
void Parse_Hierarchy();
void FetchRelation(std::stringstream&, std::vector<BoneNode*>&, BoneNode* parent = nullptr);
void CleanUpLimitString(std::string&);
void PrintHierarchy();
std::stringstream ss_;
std::string path_;
std::string file_content_;
std::string documentation_;
std::string version_;
std::string name_;
bool have_root_;
Root* root_info_;
std::vector<BoneData*> bone_datas_;
std::vector<BoneNode*> bone_nodes_;
std::map<std::string, BoneNode*> bone_name_map_;
};
#endif
}