OSDN Git Service

Stirng.h -> eosString.h
[eos/base.git] / src / Tools / pdbUtil / pdbTrans / src / pdbTrans.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <math.h>
5
6 #define DEBUG  
7 #include "../inc/config.h"
8 #include "pdbFile.h"
9 #include "eosString.h"
10 #include "genUtil.h"
11 #ifdef CUDA
12 #include "eosCuda.h"
13 #endif
14
15 int
16 main(int argc, char* argv[])
17 {
18     pdbTransInfo info;
19     pdbFile pdb;
20     
21     init0(&info);
22     argCheck(&info, argc, argv);
23     init1(&info);
24
25 #ifdef CUDA
26         if(info.flagcudaDeviceID) {
27                 eosCudaInit(info.cudaDeviceID);
28         }
29 #endif
30
31     pdbFileRead(info.fptinFile, &pdb);
32
33         DEBUGPRINT("MatrixArraySet\n");
34
35         if(info.flagmatFile) {
36                 Matrix3D Matrix;
37
38         pdbMatrixFileRead(info.fptmatFile, Matrix);
39                 DEBUGPRINT3("Maatrix: %f %f %f \n", Matrix[0][0], Matrix[0][1], Matrix[0][2]);
40         pdbTrans(&pdb, Matrix);
41         }
42         if(info.flagRotMode) {
43                 pdbRotationFollowingEulerAngle(&pdb, info.RotMode, info.Rot1*RADIAN, info.Rot2*RADIAN, info.Rot3*RADIAN);
44         }
45
46     pdbFileWrite(info.fptoutFile, &pdb);
47         return 0;
48 }
49
50 void
51 additionalUsage()
52 {
53         pdbMatrixFileFormat(stderr);
54         fprintf(stderr, "--- Attention ---\n");
55         fprintf(stderr, "If both options of -M and -EA are set, \n");
56         fprintf(stderr, "    first, translation and rotation by -M will be performed \n");
57         fprintf(stderr, "    then,  rotation by -EA will be done.\n");
58 }
59