00001 #include <stdlib.h>
00002 #include <fstream>
00003 #include <iostream>
00004
00005 #include "Atoms.h"
00006
00007 void usage()
00008 {
00009 std::cout << "Wrong number of arguments " << std::endl
00010 << "qciToxyz qciFileName xyzFileName"<< std::endl
00011 <<std::endl;
00012 exit(1) ;
00013 }
00014
00015
00016
00017 int main(int argc, char* argv[] ){
00018
00019 if(argc != 3){ usage() ; }
00020 std::ifstream qciFile ;
00021 std::ofstream xyzFile , infoFile;
00022 std::string qciFileName(argv[1]), xyzFileName(argv[2]) ;
00023
00024 setOfAtoms atoms ;
00025
00026
00027
00028 qciFile.open(qciFileName.c_str()) ;
00029 if( ! qciFile ) {
00030 std::cerr <<" Le fichier "<<qciFileName << " n'existe pas. " <<std::endl;
00031 exit(1) ;}
00032
00033 atoms.readQCIFile(qciFile) ;
00034 qciFile.close();
00035
00036
00037
00038
00039 xyzFile.open(xyzFileName.c_str());
00040 atoms.writeXYZFile(xyzFile) ;
00041 xyzFile.close();
00042
00043 std::cout << "end of program qci2xyz"<<std::endl ;
00044 return 0;
00045 }