-
Notifications
You must be signed in to change notification settings - Fork 17
/
BatchSimulateManager.h
65 lines (63 loc) · 1.41 KB
/
BatchSimulateManager.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
64
65
#include "Algorithm/cloth/definations.h"
#include <QString>
#include <vector>
#include "Algorithm/tinyxml/tinyxml.h"
#include "Algorithm/tinyxml/tinystr.h"
#include <QDir>
#include <QFileInfo>
struct BatchSimulateManager
{
enum BatchSimPhase{ INIT, SIM1, SIM2, ENDGAME };
BatchSimulateManager()
{
m_poseRoot = "./data/Mocap/poses/";
m_shapeXml = "./data/spring/sprint_femal.smpl.xml";
m_maxBodyNum = 1000;
m_timerIntervals = 5000;
m_curPatternId = 0;
m_maxShapeNum = 0;
m_batchSimMode = ldp::BatchSimNotInit;
init();
}
void recordPoseFiles()
{
QDir poseDir(m_poseRoot);
poseDir.setNameFilters(QStringList("*.xml"));
m_poseFiles = poseDir.entryList();
}
void init()
{
m_shapeElm = nullptr;
m_phase = BatchSimPhase::INIT;
m_shapeIter = m_shapeInd = 0;
}
void finish()
{
init();
m_batchSimMode = ldp::BatchSimNotInit;
m_patternXmls.clear();
m_poseFiles.clear();
m_maxShapeNum = 0;
m_curPatternId = 0;
m_shapeDoc.Clear();
m_outputDoc.Clear();
}
QString m_saveRootPath;
std::vector<int> m_shapeIndexes;
QStringList m_patternXmls;
QStringList m_poseFiles;
QString m_poseRoot;
QString m_shapeXml;
QString m_posePath;
TiXmlDocument m_outputDoc;
TiXmlDocument m_shapeDoc;
TiXmlElement* m_shapeElm;
int m_shapeIter;
int m_curPatternId;
int m_shapeInd;
int m_maxBodyNum;
int m_maxShapeNum;
int m_timerIntervals;
ldp::BatchSimulateMode m_batchSimMode ;
BatchSimPhase m_phase;
};