JunkBox_Win_Lib
1.5.3
Loading...
Searching...
No Matches
NiFileTool.h
Go to the documentation of this file.
1
#pragma once
2
3
4
#include "
WinTools.h
"
5
6
#include "
NiJTextTool.h
"
7
#include "
NiBVHTool.h
"
8
#include "
NiVMDTool.h
"
9
10
12
// Kinect, Xtion 以外のファイルI/O のデバイスを扱う基本クラス
13
//
14
// JText, BVH, VMD
15
//
16
17
namespace
jbxwl
{
18
19
using namespace
jbxl;
20
21
22
class
CNiFileTool
23
{
24
public
:
25
CNiFileTool
(
void
) {
init_data
();}
26
CNiFileTool
(
NiSDK_Lib
lib) {
init_data
();
init
(lib);}
27
28
virtual
~CNiFileTool
(
void
);
29
30
void
free_data
(
void
);
31
void
clear_data
(
void
);
32
33
private
:
34
NiSDK_Lib
m_lib
;
35
BOOL
m_enable_wfile
;
// 一時ファイルに書き込み可能
36
FILE*
m_wfp
;
37
FILE*
m_rfp
;
38
39
protected
:
40
void
init
(
NiSDK_Lib
lib);
41
void
init_data
(
void
);
42
43
BOOL
open_wfile
(LPCTSTR fname, BOOL force);
44
BOOL
open_rfile
(LPCTSTR fname);
45
void
close_wfile
(
void
);
46
void
close_rfile
(
void
);
47
48
void
write_header
(FILE* fp=NULL);
49
50
public
:
51
// Frame Data
52
int
frame_start
;
53
int
frame_ptr
;
54
55
NiFrameData
*
frames_data
;
56
int
frames_num
;
57
58
int
frame_timer
;
59
unsigned
short
lap_timer
;
60
double
time_scale
;
61
62
double
playback_time
;
63
int
playback_fps
;
64
65
public
:
66
CNiJTextTool
*
JTXT_Tool
;
67
CNiVMDTool
*
VMD_Tool
;
68
CNiBVHTool
*
BVH_Tool
;
69
70
public
:
71
CBaseFrameTool
*
frameTool
;
72
73
// Joints Text
74
int
readJTextFile
(LPCTSTR fname);
75
BOOL
writeJTextData
(FILE* fp, Vector<double>* pos, Quaternion<double>* rot,
double
* agl, BOOL mrr,
NiSDK_Lib
lib=
NiSDK_Default
);
76
77
BOOL
saveJTextfromFile
(LPCTSTR tempf, LPCTSTR fname, BOOL force);
78
BOOL
writeTempJText
(Vector<double>* pos, Quaternion<double>* rot,
double
* agl, BOOL mrr,
NiSDK_Lib
lib=
NiSDK_Default
);
79
80
// BVH
81
int
readBVHFile
(LPCTSTR fname);
82
BOOL
saveBVHfromFile
(LPCTSTR tempf, LPCTSTR fname,
BVHSaveParam
param);
83
BOOL
writeBVHFile
(LPCTSTR fname,
BVHSaveParam
param);
84
85
// VMD
86
int
readVMDFile
(LPCTSTR fname);
87
BOOL
saveVMDfromFile
(LPCTSTR tempf, LPCTSTR fname);
88
89
public
:
90
// Frame Data
91
void
clearFrameData
(
void
);
92
93
BOOL
startFrame
(
int
start=0);
94
BOOL
nextFrame
(BOOL next=TRUE);
95
void
setFrame
(
int
frame);
96
BOOL
resetFrame
(
void
) {
return
startFrame
();}
97
98
public
:
99
//
100
virtual
void
Vector2Quaternion
(Vector<double>* vt, Quaternion<double>* qt) {}
101
102
// Joints
103
void
clearStartPosition
(
void
) {
startPos
.init(1.0);}
104
void
clearJointsData
(
void
);
105
106
void
getJointsDataSeq
(BOOL mirror,
int
frame=-1);
107
108
109
Vector<double>
startPos
;
110
Vector<double>
currentPos
;
111
112
Vector<double>
posVect
[
NI_TOTAL_JOINT_NUM
];
113
Quaternion<double>
rotQuat
[
NI_TOTAL_JOINT_NUM
];
114
};
115
116
117
}
// namespace
118
NiBVHTool.h
NiJTextTool.h
NI_TOTAL_JOINT_NUM
#define NI_TOTAL_JOINT_NUM
Definition
NiJointsTool.h:14
NiVMDTool.h
WinTools.h
jbxwl::CBaseFrameTool
Definition
NiJointsTool.h:280
jbxwl::CNiBVHTool
Definition
NiBVHTool.h:26
jbxwl::CNiFileTool
Definition
NiFileTool.h:23
jbxwl::CNiFileTool::frameTool
CBaseFrameTool * frameTool
Definition
NiFileTool.h:71
jbxwl::CNiFileTool::init
void init(NiSDK_Lib lib)
Definition
NiFileTool.cpp:93
jbxwl::CNiFileTool::~CNiFileTool
virtual ~CNiFileTool(void)
Definition
NiFileTool.cpp:13
jbxwl::CNiFileTool::setFrame
void setFrame(int frame)
Definition
NiFileTool.cpp:525
jbxwl::CNiFileTool::CNiFileTool
CNiFileTool(NiSDK_Lib lib)
Definition
NiFileTool.h:26
jbxwl::CNiFileTool::frames_num
int frames_num
Definition
NiFileTool.h:56
jbxwl::CNiFileTool::m_enable_wfile
BOOL m_enable_wfile
Definition
NiFileTool.h:35
jbxwl::CNiFileTool::VMD_Tool
CNiVMDTool * VMD_Tool
Definition
NiFileTool.h:67
jbxwl::CNiFileTool::time_scale
double time_scale
Definition
NiFileTool.h:60
jbxwl::CNiFileTool::readBVHFile
int readBVHFile(LPCTSTR fname)
Definition
NiFileTool.cpp:248
jbxwl::CNiFileTool::writeTempJText
BOOL writeTempJText(Vector< double > *pos, Quaternion< double > *rot, double *agl, BOOL mrr, NiSDK_Lib lib=NiSDK_Default)
Definition
NiFileTool.cpp:237
jbxwl::CNiFileTool::posVect
Vector< double > posVect[NI_TOTAL_JOINT_NUM]
Definition
NiFileTool.h:112
jbxwl::CNiFileTool::write_header
void write_header(FILE *fp=NULL)
Definition
NiFileTool.cpp:129
jbxwl::CNiFileTool::CNiFileTool
CNiFileTool(void)
Definition
NiFileTool.h:25
jbxwl::CNiFileTool::lap_timer
unsigned short lap_timer
Definition
NiFileTool.h:59
jbxwl::CNiFileTool::m_lib
NiSDK_Lib m_lib
Definition
NiFileTool.h:34
jbxwl::CNiFileTool::saveBVHfromFile
BOOL saveBVHfromFile(LPCTSTR tempf, LPCTSTR fname, BVHSaveParam param)
Definition
NiFileTool.cpp:276
jbxwl::CNiFileTool::frame_start
int frame_start
Definition
NiFileTool.h:52
jbxwl::CNiFileTool::clearStartPosition
void clearStartPosition(void)
Definition
NiFileTool.h:103
jbxwl::CNiFileTool::startFrame
BOOL startFrame(int start=0)
Definition
NiFileTool.cpp:540
jbxwl::CNiFileTool::nextFrame
BOOL nextFrame(BOOL next=TRUE)
Definition
NiFileTool.cpp:556
jbxwl::CNiFileTool::startPos
Vector< double > startPos
Definition
NiFileTool.h:109
jbxwl::CNiFileTool::m_rfp
FILE * m_rfp
Definition
NiFileTool.h:37
jbxwl::CNiFileTool::rotQuat
Quaternion< double > rotQuat[NI_TOTAL_JOINT_NUM]
Definition
NiFileTool.h:113
jbxwl::CNiFileTool::readVMDFile
int readVMDFile(LPCTSTR fname)
Definition
NiFileTool.cpp:484
jbxwl::CNiFileTool::Vector2Quaternion
virtual void Vector2Quaternion(Vector< double > *vt, Quaternion< double > *qt)
Definition
NiFileTool.h:100
jbxwl::CNiFileTool::writeJTextData
BOOL writeJTextData(FILE *fp, Vector< double > *pos, Quaternion< double > *rot, double *agl, BOOL mrr, NiSDK_Lib lib=NiSDK_Default)
Definition
NiFileTool.cpp:204
jbxwl::CNiFileTool::clearJointsData
void clearJointsData(void)
Definition
NiFileTool.cpp:631
jbxwl::CNiFileTool::open_wfile
BOOL open_wfile(LPCTSTR fname, BOOL force)
Definition
NiFileTool.cpp:107
jbxwl::CNiFileTool::clear_data
void clear_data(void)
Definition
NiFileTool.cpp:40
jbxwl::CNiFileTool::clearFrameData
void clearFrameData(void)
Definition
NiFileTool.cpp:609
jbxwl::CNiFileTool::free_data
void free_data(void)
Definition
NiFileTool.cpp:25
jbxwl::CNiFileTool::open_rfile
BOOL open_rfile(LPCTSTR fname)
Definition
NiFileTool.cpp:138
jbxwl::CNiFileTool::JTXT_Tool
CNiJTextTool * JTXT_Tool
Definition
NiFileTool.h:66
jbxwl::CNiFileTool::close_rfile
void close_rfile(void)
Definition
NiFileTool.cpp:163
jbxwl::CNiFileTool::playback_fps
int playback_fps
Definition
NiFileTool.h:63
jbxwl::CNiFileTool::frame_timer
int frame_timer
Definition
NiFileTool.h:58
jbxwl::CNiFileTool::init_data
void init_data(void)
Definition
NiFileTool.cpp:64
jbxwl::CNiFileTool::BVH_Tool
CNiBVHTool * BVH_Tool
Definition
NiFileTool.h:68
jbxwl::CNiFileTool::close_wfile
void close_wfile(void)
Definition
NiFileTool.cpp:152
jbxwl::CNiFileTool::currentPos
Vector< double > currentPos
Definition
NiFileTool.h:110
jbxwl::CNiFileTool::getJointsDataSeq
void getJointsDataSeq(BOOL mirror, int frame=-1)
Definition
NiFileTool.cpp:642
jbxwl::CNiFileTool::saveVMDfromFile
BOOL saveVMDfromFile(LPCTSTR tempf, LPCTSTR fname)
Definition
NiFileTool.cpp:513
jbxwl::CNiFileTool::writeBVHFile
BOOL writeBVHFile(LPCTSTR fname, BVHSaveParam param)
Definition
NiFileTool.cpp:289
jbxwl::CNiFileTool::saveJTextfromFile
BOOL saveJTextfromFile(LPCTSTR tempf, LPCTSTR fname, BOOL force)
Definition
NiFileTool.cpp:222
jbxwl::CNiFileTool::readJTextFile
int readJTextFile(LPCTSTR fname)
Definition
NiFileTool.cpp:177
jbxwl::CNiFileTool::frames_data
NiFrameData * frames_data
Definition
NiFileTool.h:55
jbxwl::CNiFileTool::m_wfp
FILE * m_wfp
Definition
NiFileTool.h:36
jbxwl::CNiFileTool::resetFrame
BOOL resetFrame(void)
Definition
NiFileTool.h:96
jbxwl::CNiFileTool::frame_ptr
int frame_ptr
Definition
NiFileTool.h:53
jbxwl::CNiFileTool::playback_time
double playback_time
Definition
NiFileTool.h:62
jbxwl::CNiJTextTool
Definition
NiJTextTool.h:16
jbxwl::CNiVMDTool
Definition
NiVMDTool.h:111
jbxwl
Definition
ContrastDLG.h:23
jbxwl::NiSDK_Lib
NiSDK_Lib
Definition
NiToolWin.h:35
jbxwl::NiSDK_Default
@ NiSDK_Default
Definition
NiToolWin.h:36
NiFrameData
Definition
NiJointsTool.h:171
jbxwl::BVHSaveParam
Definition
NiBVHTool.h:13
WinNiLib
NiFileTool.h
Generated on Sat Oct 12 2024 19:43:15 for JunkBox_Win_Lib by
1.11.0