1 |
mmeineke |
1052 |
#define _FILE_OFFSET_BITS 64 |
2 |
|
|
|
3 |
|
|
#include <stdio.h> |
4 |
|
|
#include <stdlib.h> |
5 |
|
|
#include <sys/types.h> |
6 |
|
|
#include <sys/stat.h> |
7 |
|
|
#include <string.h> |
8 |
|
|
|
9 |
|
|
#include "params.h" |
10 |
|
|
#include "tcProps.h" |
11 |
|
|
#include "readWrite.h" |
12 |
|
|
|
13 |
|
|
|
14 |
|
|
int isScanned; |
15 |
|
|
FILE* inFile; |
16 |
|
|
|
17 |
|
|
|
18 |
|
|
struct linkedPos{ |
19 |
|
|
|
20 |
|
|
fpos_t *myPos; |
21 |
|
|
double timeStamp; |
22 |
|
|
double Hmat[3][3]; |
23 |
|
|
struct linkedPos* next; |
24 |
|
|
}; |
25 |
|
|
|
26 |
|
|
struct staticPos{ |
27 |
|
|
|
28 |
|
|
fpos_t *myPos; |
29 |
|
|
double timeStamp; |
30 |
|
|
double Hmat[3][3]; |
31 |
|
|
}; |
32 |
|
|
struct staticPos* posArray; |
33 |
|
|
|
34 |
|
|
|
35 |
|
|
void closeFile( void ){ |
36 |
|
|
|
37 |
|
|
fclose( inFile ); |
38 |
|
|
} |
39 |
|
|
|
40 |
|
|
int setFrames( char* inFile ){ |
41 |
|
|
|
42 |
|
|
int nFrames = 0; |
43 |
|
|
int i,j,k; |
44 |
|
|
struct linkedPos* headPos; |
45 |
|
|
struct linkedPos* currPos; |
46 |
|
|
fpos_t *currPT; |
47 |
|
|
|
48 |
|
|
|
49 |
|
|
inFile = fopen(inName); |
50 |
|
|
if(inFile ==NULL){ |
51 |
|
|
fprintf(stderr, |
52 |
|
|
"Error opening file \"%s\"\n", |
53 |
|
|
inName); |
54 |
|
|
exit(0); |
55 |
|
|
} |
56 |
|
|
|
57 |
|
|
|
58 |
|
|
headPos = (struct linkedPos*)malloc( |
59 |
|
|
while( !feof( inFile ) ){ |
60 |
|
|
|
61 |
|
|
currPT |
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
isScanned = 1; |
66 |
|
|
return nFrames; |
67 |
|
|
} |