JunkBox_Win_Lib 1.5.3
|
#include <NiFileTool.h>
Public Member Functions | |
CNiFileTool (void) | |
CNiFileTool (NiSDK_Lib lib) | |
virtual | ~CNiFileTool (void) |
void | free_data (void) |
void | clear_data (void) |
int | readJTextFile (LPCTSTR fname) |
BOOL | writeJTextData (FILE *fp, Vector< double > *pos, Quaternion< double > *rot, double *agl, BOOL mrr, NiSDK_Lib lib=NiSDK_Default) |
BOOL | saveJTextfromFile (LPCTSTR tempf, LPCTSTR fname, BOOL force) |
BOOL | writeTempJText (Vector< double > *pos, Quaternion< double > *rot, double *agl, BOOL mrr, NiSDK_Lib lib=NiSDK_Default) |
int | readBVHFile (LPCTSTR fname) |
BOOL | saveBVHfromFile (LPCTSTR tempf, LPCTSTR fname, BVHSaveParam param) |
BOOL | writeBVHFile (LPCTSTR fname, BVHSaveParam param) |
int | readVMDFile (LPCTSTR fname) |
BOOL | saveVMDfromFile (LPCTSTR tempf, LPCTSTR fname) |
void | clearFrameData (void) |
BOOL | startFrame (int start=0) |
BOOL | nextFrame (BOOL next=TRUE) |
void | setFrame (int frame) |
BOOL | resetFrame (void) |
virtual void | Vector2Quaternion (Vector< double > *vt, Quaternion< double > *qt) |
void | clearStartPosition (void) |
void | clearJointsData (void) |
void | getJointsDataSeq (BOOL mirror, int frame=-1) |
Public Attributes | |
int | frame_start |
int | frame_ptr |
NiFrameData * | frames_data |
int | frames_num |
int | frame_timer |
unsigned short | lap_timer |
double | time_scale |
double | playback_time |
int | playback_fps |
CNiJTextTool * | JTXT_Tool |
CNiVMDTool * | VMD_Tool |
CNiBVHTool * | BVH_Tool |
CBaseFrameTool * | frameTool |
Vector< double > | startPos |
Vector< double > | currentPos |
Vector< double > | posVect [NI_TOTAL_JOINT_NUM] |
Quaternion< double > | rotQuat [NI_TOTAL_JOINT_NUM] |
Protected Member Functions | |
void | init (NiSDK_Lib lib) |
void | init_data (void) |
BOOL | open_wfile (LPCTSTR fname, BOOL force) |
BOOL | open_rfile (LPCTSTR fname) |
void | close_wfile (void) |
void | close_rfile (void) |
void | write_header (FILE *fp=NULL) |
Private Attributes | |
NiSDK_Lib | m_lib |
BOOL | m_enable_wfile |
FILE * | m_wfp |
FILE * | m_rfp |
Definition at line 22 of file NiFileTool.h.
|
inline |
Definition at line 25 of file NiFileTool.h.
References CNiFileTool::init_data().
|
inline |
Definition at line 26 of file NiFileTool.h.
References CNiFileTool::init(), and CNiFileTool::init_data().
|
virtual |
Definition at line 13 of file NiFileTool.cpp.
References CNiFileTool::free_data().
void clear_data | ( | void | ) |
Definition at line 40 of file NiFileTool.cpp.
References CNiFileTool::clearFrameData(), CNiFileTool::clearJointsData(), CNiFileTool::clearStartPosition(), CNiFileTool::close_rfile(), CNiFileTool::close_wfile(), CNiFileTool::frame_ptr, CNiFileTool::frame_start, CNiFileTool::frame_timer, CNiFileTool::frames_data, CNiFileTool::frames_num, CNiFileTool::lap_timer, CNiFileTool::playback_fps, CNiFileTool::playback_time, and CNiFileTool::time_scale.
Referenced by CNiFileTool::free_data().
void clearFrameData | ( | void | ) |
Definition at line 609 of file NiFileTool.cpp.
References CNiFileTool::BVH_Tool, CNiBVHTool::clear_data(), CNiJTextTool::clear_data(), CNiVMDTool::clear_data(), CNiFileTool::frame_ptr, CNiFileTool::frames_data, CNiFileTool::frames_num, CNiFileTool::frameTool, CNiFileTool::JTXT_Tool, and CNiFileTool::VMD_Tool.
Referenced by CNiFileTool::clear_data(), CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), and CNiFileTool::readVMDFile().
void clearJointsData | ( | void | ) |
Definition at line 631 of file NiFileTool.cpp.
References CNiFileTool::currentPos, NI_TOTAL_JOINT_NUM, CNiFileTool::posVect, and CNiFileTool::rotQuat.
Referenced by CNiFileTool::clear_data(), and CNiFileTool::init_data().
|
inline |
Definition at line 103 of file NiFileTool.h.
References CNiFileTool::startPos.
Referenced by CNiFileTool::clear_data(), and CNiFileTool::init_data().
|
protected |
Definition at line 163 of file NiFileTool.cpp.
References CNiFileTool::m_rfp.
Referenced by CNiFileTool::clear_data(), CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), and CNiFileTool::readVMDFile().
|
protected |
Definition at line 152 of file NiFileTool.cpp.
References CNiFileTool::m_enable_wfile, and CNiFileTool::m_wfp.
Referenced by CNiFileTool::clear_data(), and CNiFileTool::writeBVHFile().
void free_data | ( | void | ) |
Definition at line 25 of file NiFileTool.cpp.
References CNiFileTool::BVH_Tool, CNiFileTool::clear_data(), CNiFileTool::JTXT_Tool, and CNiFileTool::VMD_Tool.
Referenced by CNiFileTool::~CNiFileTool().
void getJointsDataSeq | ( | BOOL | mirror, |
int | frame = -1 ) |
Definition at line 642 of file NiFileTool.cpp.
References CNiFileTool::frame_ptr, CNiFileTool::frames_data, CNiFileTool::frameTool, CBaseFrameTool::getJointsData(), NiFrameData::jdat, NiFrameData::jnum, NiJointData::joint, NI_TOTAL_JOINT_NUM, NiMirrorJointNum, CNiFileTool::playback_fps, CNiFileTool::posVect, NiJointData::quat, CNiFileTool::rotQuat, CNiFileTool::setFrame(), and NiJointData::vect.
|
protected |
Definition at line 93 of file NiFileTool.cpp.
References CNiFileTool::BVH_Tool, CNiFileTool::frameTool, CNiFileTool::JTXT_Tool, CNiFileTool::m_lib, and CNiFileTool::VMD_Tool.
Referenced by CNiFileTool::CNiFileTool().
|
protected |
Definition at line 64 of file NiFileTool.cpp.
References CNiFileTool::BVH_Tool, CNiFileTool::clearJointsData(), CNiFileTool::clearStartPosition(), CNiFileTool::frame_ptr, CNiFileTool::frame_start, CNiFileTool::frame_timer, CNiFileTool::frames_data, CNiFileTool::frames_num, CNiFileTool::JTXT_Tool, CNiFileTool::lap_timer, CNiFileTool::m_enable_wfile, CNiFileTool::m_lib, CNiFileTool::m_rfp, CNiFileTool::m_wfp, jbxwl::NiSDK_None, CNiFileTool::playback_fps, CNiFileTool::playback_time, CNiFileTool::time_scale, and CNiFileTool::VMD_Tool.
Referenced by CNiFileTool::CNiFileTool(), and CNiFileTool::CNiFileTool().
BOOL nextFrame | ( | BOOL | next = TRUE | ) |
Definition at line 556 of file NiFileTool.cpp.
References CNiFileTool::frame_ptr, CNiFileTool::frame_timer, CNiFileTool::frames_data, CNiFileTool::frames_num, jbxwl::GetMsecondsLapTimer(), CNiFileTool::lap_timer, and CNiFileTool::time_scale.
|
protected |
Definition at line 138 of file NiFileTool.cpp.
References CNiFileTool::m_rfp.
Referenced by CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), and CNiFileTool::readVMDFile().
|
protected |
Definition at line 107 of file NiFileTool.cpp.
References jbxwl::file_exist_t(), IDS_STR_ASK_OVERWRITE, IDS_STR_WARN, CNiFileTool::m_enable_wfile, CNiFileTool::m_wfp, and jbxwl::MessageBoxDLG().
Referenced by CNiFileTool::writeBVHFile().
int readBVHFile | ( | LPCTSTR | fname | ) |
Definition at line 248 of file NiFileTool.cpp.
References CNiFileTool::BVH_Tool, CNiFileTool::clearFrameData(), CNiFileTool::close_rfile(), CNiFileTool::frames_data, CNiFileTool::frames_num, CNiFileTool::frameTool, CBaseFrameTool::getFramesData(), CBaseFrameTool::getFramesNumber(), CNiBVHTool::getPlayBackFPS(), CNiFileTool::m_rfp, NiFrameData::msec, CNiFileTool::open_rfile(), CNiFileTool::playback_fps, CNiFileTool::playback_time, and CNiBVHTool::readFile().
int readJTextFile | ( | LPCTSTR | fname | ) |
Definition at line 177 of file NiFileTool.cpp.
References CNiFileTool::clearFrameData(), CNiFileTool::close_rfile(), CNiFileTool::frames_data, CNiFileTool::frames_num, CNiFileTool::frameTool, CBaseFrameTool::getFramesData(), CBaseFrameTool::getFramesNumber(), CBaseFrameTool::getPlayBackFPS(), CNiFileTool::JTXT_Tool, CNiFileTool::m_rfp, NiFrameData::msec, CNiFileTool::open_rfile(), CNiFileTool::playback_fps, CNiFileTool::playback_time, and CNiJTextTool::readFile().
Referenced by CNiFileTool::saveBVHfromFile().
int readVMDFile | ( | LPCTSTR | fname | ) |
Definition at line 484 of file NiFileTool.cpp.
References CNiFileTool::clearFrameData(), CNiFileTool::close_rfile(), CNiFileTool::frames_data, CNiFileTool::frames_num, CNiFileTool::frameTool, CNiVMDTool::getFramesData(), CNiVMDTool::getFramesNumber(), CBaseFrameTool::getPlayBackFPS(), CNiFileTool::m_rfp, NiFrameData::msec, CNiFileTool::open_rfile(), CNiFileTool::playback_fps, CNiFileTool::playback_time, CNiVMDTool::readFile(), and CNiFileTool::VMD_Tool.
|
inline |
Definition at line 96 of file NiFileTool.h.
References CNiFileTool::startFrame().
BOOL saveBVHfromFile | ( | LPCTSTR | tempf, |
LPCTSTR | fname, | ||
BVHSaveParam | param ) |
Definition at line 276 of file NiFileTool.cpp.
References CNiFileTool::readJTextFile(), BVHSaveParam::scale, and CNiFileTool::writeBVHFile().
BOOL saveJTextfromFile | ( | LPCTSTR | tempf, |
LPCTSTR | fname, | ||
BOOL | force ) |
Definition at line 222 of file NiFileTool.cpp.
References jbxwl::copyFileWithCounter(), jbxwl::file_exist_t(), IDS_STR_ASK_OVERWRITE, IDS_STR_WARN, and jbxwl::MessageBoxDLG().
BOOL saveVMDfromFile | ( | LPCTSTR | tempf, |
LPCTSTR | fname ) |
Definition at line 513 of file NiFileTool.cpp.
void setFrame | ( | int | frame | ) |
Definition at line 525 of file NiFileTool.cpp.
References CNiFileTool::frame_ptr, CNiFileTool::frame_start, and CNiFileTool::frames_num.
Referenced by CNiFileTool::getJointsDataSeq(), and CNiFileTool::startFrame().
BOOL startFrame | ( | int | start = 0 | ) |
Definition at line 540 of file NiFileTool.cpp.
References CNiFileTool::frame_timer, CNiFileTool::frames_data, CNiFileTool::frames_num, jbxwl::GetMsecondsTimer(), CNiFileTool::lap_timer, CNiFileTool::setFrame(), and CNiFileTool::time_scale.
Referenced by CNiFileTool::resetFrame().
|
inlinevirtual |
Definition at line 100 of file NiFileTool.h.
Referenced by CNiFileTool::writeBVHFile().
|
protected |
Definition at line 129 of file NiFileTool.cpp.
References CNiFileTool::JTXT_Tool, CNiFileTool::m_wfp, and CNiJTextTool::writeHeader().
BOOL writeBVHFile | ( | LPCTSTR | fname, |
BVHSaveParam | param ) |
Definition at line 289 of file NiFileTool.cpp.
References BVH_SAVE_FORMAT_NI, BVH_SAVE_FORMAT_QAV, BVH_SAVE_FORMAT_SL, jbxwl::BVHJoint2NiJointNum(), CNiFileTool::close_wfile(), BVHSaveParam::divtm, BVHSaveParam::format, BVHSaveParam::fps, CNiFileTool::frameTool, CBaseFrameTool::getFramesNumber(), CBaseFrameTool::getJointsData(), CBaseFrameTool::getJointsNumber(), CBaseFrameTool::getPlayBackTime(), jbxwl::getQAvBVHOffset(), NiJointData::joint, CNiFileTool::m_wfp, jbxwl::makeBVH_NiHierarchy(), jbxwl::makeBVH_QAvHierarchy(), jbxwl::makeBVH_SLHierarchy(), NI_TOTAL_JOINT_NUM, CNiFileTool::open_wfile(), NiJointData::quat, BVHSaveParam::recalc, BVHSaveParam::scale, jbxwl::setBVHJointName(), jbxwl::ts2mbs(), NiJointData::vect, and CNiFileTool::Vector2Quaternion().
Referenced by CNiFileTool::saveBVHfromFile().
BOOL writeJTextData | ( | FILE * | fp, |
Vector< double > * | pos, | ||
Quaternion< double > * | rot, | ||
double * | agl, | ||
BOOL | mrr, | ||
NiSDK_Lib | lib = NiSDK_Default ) |
Definition at line 204 of file NiFileTool.cpp.
References jbxwl::GetMsecondsTimer(), CNiFileTool::JTXT_Tool, CNiFileTool::m_lib, jbxwl::NiSDK_Default, CNiJTextTool::setJntAngl(), CNiJTextTool::setPosVect(), CNiJTextTool::setRotQuat(), and CNiJTextTool::writeCurrentData().
Referenced by CNiFileTool::writeTempJText().
BOOL writeTempJText | ( | Vector< double > * | pos, |
Quaternion< double > * | rot, | ||
double * | agl, | ||
BOOL | mrr, | ||
NiSDK_Lib | lib = NiSDK_Default ) |
Definition at line 237 of file NiFileTool.cpp.
References CNiFileTool::m_wfp, and CNiFileTool::writeJTextData().
CNiBVHTool* BVH_Tool |
Definition at line 68 of file NiFileTool.h.
Referenced by CNiFileTool::clearFrameData(), CNiFileTool::free_data(), CNiFileTool::init(), CNiFileTool::init_data(), and CNiFileTool::readBVHFile().
Vector<double> currentPos |
Definition at line 110 of file NiFileTool.h.
Referenced by CNiFileTool::clearJointsData().
int frame_ptr |
Definition at line 53 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::clearFrameData(), CNiFileTool::getJointsDataSeq(), CNiFileTool::init_data(), CNiFileTool::nextFrame(), and CNiFileTool::setFrame().
int frame_start |
Definition at line 52 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::init_data(), and CNiFileTool::setFrame().
int frame_timer |
Definition at line 58 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::init_data(), CNiFileTool::nextFrame(), and CNiFileTool::startFrame().
NiFrameData* frames_data |
Definition at line 55 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::clearFrameData(), CNiFileTool::getJointsDataSeq(), CNiFileTool::init_data(), CNiFileTool::nextFrame(), CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), CNiFileTool::readVMDFile(), and CNiFileTool::startFrame().
int frames_num |
Definition at line 56 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::clearFrameData(), CNiFileTool::init_data(), CNiFileTool::nextFrame(), CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), CNiFileTool::readVMDFile(), CNiFileTool::setFrame(), and CNiFileTool::startFrame().
CBaseFrameTool* frameTool |
Definition at line 71 of file NiFileTool.h.
Referenced by CNiFileTool::clearFrameData(), CNiFileTool::getJointsDataSeq(), CNiFileTool::init(), CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), CNiFileTool::readVMDFile(), and CNiFileTool::writeBVHFile().
CNiJTextTool* JTXT_Tool |
Definition at line 66 of file NiFileTool.h.
Referenced by CNiFileTool::clearFrameData(), CNiFileTool::free_data(), CNiFileTool::init(), CNiFileTool::init_data(), CNiFileTool::readJTextFile(), CNiFileTool::write_header(), and CNiFileTool::writeJTextData().
unsigned short lap_timer |
Definition at line 59 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::init_data(), CNiFileTool::nextFrame(), and CNiFileTool::startFrame().
|
private |
Definition at line 35 of file NiFileTool.h.
Referenced by CNiFileTool::close_wfile(), CNiFileTool::init_data(), and CNiFileTool::open_wfile().
|
private |
Definition at line 34 of file NiFileTool.h.
Referenced by CNiFileTool::init(), CNiFileTool::init_data(), and CNiFileTool::writeJTextData().
|
private |
Definition at line 37 of file NiFileTool.h.
Referenced by CNiFileTool::close_rfile(), CNiFileTool::init_data(), CNiFileTool::open_rfile(), CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), and CNiFileTool::readVMDFile().
|
private |
Definition at line 36 of file NiFileTool.h.
Referenced by CNiFileTool::close_wfile(), CNiFileTool::init_data(), CNiFileTool::open_wfile(), CNiFileTool::write_header(), CNiFileTool::writeBVHFile(), and CNiFileTool::writeTempJText().
int playback_fps |
Definition at line 63 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::getJointsDataSeq(), CNiFileTool::init_data(), CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), and CNiFileTool::readVMDFile().
double playback_time |
Definition at line 62 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::init_data(), CNiFileTool::readBVHFile(), CNiFileTool::readJTextFile(), and CNiFileTool::readVMDFile().
Vector<double> posVect[NI_TOTAL_JOINT_NUM] |
Definition at line 112 of file NiFileTool.h.
Referenced by CNiFileTool::clearJointsData(), and CNiFileTool::getJointsDataSeq().
Quaternion<double> rotQuat[NI_TOTAL_JOINT_NUM] |
Definition at line 113 of file NiFileTool.h.
Referenced by CNiFileTool::clearJointsData(), and CNiFileTool::getJointsDataSeq().
Vector<double> startPos |
Definition at line 109 of file NiFileTool.h.
Referenced by CNiFileTool::clearStartPosition().
double time_scale |
Definition at line 60 of file NiFileTool.h.
Referenced by CNiFileTool::clear_data(), CNiFileTool::init_data(), CNiFileTool::nextFrame(), and CNiFileTool::startFrame().
CNiVMDTool* VMD_Tool |
Definition at line 67 of file NiFileTool.h.
Referenced by CNiFileTool::clearFrameData(), CNiFileTool::free_data(), CNiFileTool::init(), CNiFileTool::init_data(), and CNiFileTool::readVMDFile().