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_TreesDistance{
00044 public:
00045 static string usage()
00046 {
00047 system("clear") ;
00048 return
00049 "=================================\n"
00050 "TARIS-TreesDistance (" __DATE__ ")\n"
00051 "=================================\n"
00052 "\n"
00053 "Returns the distance between two trees that have been previously generated\n"
00054 "with the TARIS-BuildTree program\n"
00055 "\n"
00056 "Syntax:\n"
00057 " $ TARIS-TreesDistance file1 file2\n"
00058 "\n"
00059 "Required parameters:\n"
00060 " file1\n"
00061 " This is the name of the first tree in gml format\n"
00062 " file2\n"
00063 " This is the name of the second tree in gml format\n"
00064 "\n"
00065 "For example:\n"
00066 "\n"
00067 " $ TARIS-BuildTree -c file1.cube -o file1.gml\n"
00068 " $ TARIS-BuildTree -c file2.cube -o file2.gml\n"
00069 " $ TARIS-TreesDistance file1.gml file2.gml\n"
00070 "\n"
00071 "Authors:\n"
00072 " Nestor F. Aguirre, Ray M. Marin and Edgar E. Daza\n"
00073 " Universidad Nacional de Colombia\n"
00074 ;
00075 }
00076
00077 static int main( int argc, char **argv )
00078 {
00079
00080 if( argc == 3 ){
00081
00082 string gmlFileName1 = argv[1] ;
00083 string gmlFileName2 = argv[2] ;
00084
00085 Tree tree1 ;
00086 tree1.load( gmlFileName1 ) ;
00087
00088 Tree tree2 ;
00089 tree2.load( gmlFileName2 ) ;
00090
00091 cout << "DISTANCE IS: " << Tree::distance( tree1, tree2 ) << endl ;
00092
00093 }else{
00094 cout << usage() << endl ;
00095 }
00096
00097 return EXIT_SUCCESS;
00098 }
00099 };
00100
00101 }
00102
00103 int main( int argc, char **argv )
00104 {
00105 return Programs::TARIS_TreesDistance::main( argc, argv ) ;
00106 }