00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifdef HAVE_CONFIG_H
00021 #include <config.h>
00022 #endif
00023
00024 #include <iostream>
00025 #include <cstdlib>
00026 using namespace std;
00027
00028 #include <HyperSurface.h>
00029 #include <Surface.h>
00030 #include <TarisApplication.h>
00031 #include <Tree.h>
00032 #include <vector>
00033
00034 namespace Programs{
00035
00043 class TARIS_BuildTree{
00044 public:
00045 static string usage()
00046 {
00047 system("clear") ;
00048 return
00049 "=============================\n"
00050 "TARIS-BuildTree (" __DATE__ ")\n"
00051 "=============================\n"
00052 "\n"
00053 "Produces files in GML format containing the information that allows \n"
00054 "to visualize the corresponding molecule's tree, taking as parameters \n"
00055 "the .cube file, the initial cutoff, the final cutoff and the step-size\n"
00056 "for the scan \n"
00057 "\n"
00058 "Syntax:\n"
00059 " $ TARIS-BuildTree -c file [PARAMETERS]\n"
00060 "\n"
00061 "Required parameters:\n"
00062 " -c file\n"
00063 " This is the name of the cube file containing the electrostatic\n"
00064 " potential data\n"
00065 "\n"
00066 "Optional parameters:\n"
00067 " -b cutoffBegin\n"
00068 " Initial cutoff for the scan\n"
00069 " (default=-0.1)\n"
00070 " -e cutoffEnd\n"
00071 " Final cutoff for the scan\n"
00072 " (default=-0.07)\n"
00073 " -s stepSize\n"
00074 " Step-size for the scan\n"
00075 " (default=-0.005)\n"
00076 " -o output\n"
00077 " Name of the gml output file\n"
00078 " (default=screen)\n"
00079 "\n"
00080 "For example:\n"
00081 " $ TARIS-BuildTree -c file.cube -o file.gml\n"
00082 "\n"
00083 "Authors:\n"
00084 " Nestor F. Aguirre, Ray M. Marin and Edgar E. Daza\n"
00085 " Universidad Nacional de Colombia\n"
00086 ;
00087 }
00088
00089 static int main( int argc, char **argv )
00090 {
00091
00092 if( argc > 1 ){
00093
00094 string cubeFileName = TarisApplication::extractParameter( argc, argv, "-c" ) ;
00095 double cutoffBegin = atof( TarisApplication::extractParameter( argc, argv, "-b", "-0.1" ) ) ;
00096 double cutoffEnd = atof( TarisApplication::extractParameter( argc, argv, "-e", "-0.07" ) ) ;
00097 double stepSize = atof( TarisApplication::extractParameter( argc, argv, "-s", "0.005" ) ) ;
00098 string outputFileName = TarisApplication::extractParameter( argc, argv, "-o", "screen" ) ;
00099
00100 HyperSurface hs ;
00101 hs.load( cubeFileName ) ;
00102
00103 Tree output = hs.buildAreaTree( cutoffBegin, cutoffEnd, stepSize ) ;
00104
00105 Tree::print( output, cout ) ;
00106
00107 if( outputFileName != "screen" ){
00108 output.save( outputFileName.c_str() ) ;
00109 }else{
00110 cout << "---------------" << endl ;
00111 cout << "GML FILE" << endl ;
00112 cout << "---------------" << endl ;
00113 cout << endl ;
00114 output.save( &cout ) ;
00115 }
00116
00117 }else{
00118 cout << usage() << endl ;
00119 }
00120
00121 return EXIT_SUCCESS;
00122 }
00123 };
00124
00125 }
00126
00127 int main( int argc, char **argv )
00128 {
00129 return Programs::TARIS_BuildTree::main( argc, argv ) ;
00130 }