MTNFile_Print.cc

Go to the documentation of this file.
00001 
00002 
00003 #include <stdio.h>
00004 #include "MTNFile.h"
00005 
00006 void
00007 MTNFile::Print()
00008 {
00009     printf("magic             : %c%c%c%c\n",
00010            magic[0], magic[1], magic[2], magic[3]);
00011     printf("name              : %s\n", GetName());
00012     printf("author            : %s\n", GetAuthor());
00013     printf("design            : %s\n", GetRobotDesign());
00014     printf("numKeyFrames      : %d\n", GetNumKeyFrames());
00015     printf("frameRate         : %d\n", GetFrameRate());
00016     printf("numJoints         : %d\n", GetNumJoints());
00017 
00018     for (int i = 0; i < GetNumJoints(); i++)
00019         printf("locator[%2d]       : %s\n", i, GetLocator(i));
00020 
00021     printf("dataType          : %d\n", GetDataType());
00022     printf("secNum3           : %d\n", (GetSection3())->sectionNum);
00023     printf("secSize3          : %d\n", (GetSection3())->sectionSize);
00024     printf("eachKeyFrameSize  : %d\n", GetEachKeyFrameSize());
00025     printf("totalKeyFrameSize : %d\n", GetTotalKeyFrameSize());
00026 
00027     for (int i = 0; i < GetNumKeyFrames() - 1; i++) {
00028         PrintKeyFrame(i);
00029         printf("i[%d] %d\n", i, GetNumInterpolate(i));
00030     }
00031     PrintKeyFrame(GetNumKeyFrames() - 1);
00032 }
00033 
00034 void
00035 MTNFile::PrintKeyFrame(int index)
00036 {
00037     int* keyFrame = (int*)GetKeyFrame(index);
00038 
00039     printf("k[%d] %d %d %d : ", index, keyFrame[0], keyFrame[1], keyFrame[2]);
00040     keyFrame += 3;
00041 
00042     for (int j = 0; j < GetNumJoints(); j++) {
00043         printf("%d ", keyFrame[j]);
00044     }
00045     printf("\n");
00046 }

Generated on Sun Dec 2 23:04:29 2007 for openSDK by  doxygen 1.3.9.1