00001 //---------------------------------------------------------------------- 00002 // The Motion Strategy Library (MSL) 00003 //---------------------------------------------------------------------- 00004 // 00005 // Copyright (c) 1998-2000 Iowa State University and Steve LaValle. 00006 // All Rights Reserved. 00007 // 00008 // Permission to use, copy, and distribute this software and its 00009 // documentation is hereby granted free of charge, provided that 00010 // (1) it is not a component of a commercial product, and 00011 // (2) this notice appears in all copies of the software and 00012 // related documentation. 00013 // 00014 // Iowa State University and the author make no representations 00015 // about the suitability or fitness of this software for any purpose. 00016 // It is provided "as is" without express or implied warranty. 00017 //---------------------------------------------------------------------- 00018 00019 #include <math.h> 00020 #include <stdlib.h> 00021 00022 #include <LEDA/file.h> 00023 #include <LEDA/array.h> 00024 #include <LEDA/list.h> 00025 #include <LEDA/matrix.h> 00026 #include <LEDA/point.h> 00027 #include <LEDA/polygon.h> 00028 #include <LEDA/stream.h> 00029 #include <LEDA/string.h> 00030 #include <LEDA/vector.h> 00031 #include <LEDA/graph.h> 00032 #include <LEDA/d3_point.h> 00033 #include <LEDA/window.h> 00034 #include <LEDA/menu.h> 00035 00036 // Include all models 00037 #include "model.h" 00038 #include "modelmisc.h" 00039 #include "model2d.h" 00040 #include "model3d.h" 00041 00042 // Include all geometries 00043 #include "geom.h" 00044 #include "geomPQP.h" 00045 00046 #include "defs.h" 00047 00048 #include <LEDA/REDEFINE_NAMES.h> 00049 00050 void SetupProblem(Model *&m, Geom *&g, string path) { 00051 // Make them null initially 00052 m = NULL; 00053 g = NULL; 00054 00055 // Models from modelmisc.h 00056 if (is_file(path+"Model1D")) 00057 m = new Model1D(path); 00058 if (is_file(path+"ModelLinear")) 00059 m = new ModelLinear(path); 00060 if (is_file(path+"ModelND")) 00061 m = new ModelND(path); 00062 if (is_file(path+"ModelNintegrator")) 00063 m = new ModelNintegrator(path); 00064 00065 // Models from model2d.h 00066 if (is_file(path+"Model2DPoint")) 00067 m = new Model2DPoint(path); 00068 if (is_file(path+"Model2DPointCar")) 00069 m = new Model2DPointCar(path); 00070 if (is_file(path+"Model2DRigid")) 00071 m = new Model2DRigid(path); 00072 if (is_file(path+"Model2DRigidCar")) 00073 m = new Model2DRigidCar(path); 00074 if (is_file(path+"Model2DRigidCarForward")) 00075 m = new Model2DRigidCarForward(path); 00076 if (is_file(path+"Model2DRigidCarSmooth")) 00077 m = new Model2DRigidCarSmooth(path); 00078 if (is_file(path+"Model2DRigidCarSmoothTrailer")) 00079 m = new Model2DRigidCarSmoothTrailer(path); 00080 if (is_file(path+"Model2DRigidCarSmooth2Trailers")) 00081 m = new Model2DRigidCarSmooth2Trailers(path); 00082 if (is_file(path+"Model2DRigidCarSmooth3Trailers")) 00083 m = new Model2DRigidCarSmooth3Trailers(path); 00084 if (is_file(path+"Model2DRigidCarSmooth3Trailers")) 00085 m = new Model2DRigidCarSmooth3Trailers(path); 00086 if (is_file(path+"Model2DRigidDyncar")) 00087 m = new Model2DRigidDyncar(path); 00088 if (is_file(path+"Model2DRigidDyncarNtire")) 00089 m = new Model2DRigidDyncarNtire(path); 00090 if (is_file(path+"Model2DRigidMulti")) 00091 m = new Model2DRigidMulti(path); 00092 if (is_file(path+"Model2DRigidChain")) 00093 m = new Model2DRigidChain(path); 00094 00095 // Models from model3d.h 00096 if (is_file(path+"Model3DRigid")) 00097 m = new Model3DRigid(path); 00098 if (is_file(path+"Model3DRigidMulti")) 00099 m = new Model3DRigidMulti(path); 00100 if (is_file(path+"Model3DRigidChain")) 00101 m = new Model3DRigidChain(path); 00102 if (is_file(path+"Model3DRigidTree")) 00103 m = new Model3DRigidTree(path); 00104 00105 // Geoms from geom.h 00106 if (is_file(path+"GeomLedaPolygonal")) 00107 g = new GeomLedaPolygonal(path); 00108 if (is_file(path+"GeomLedaPolygonalRigid")) 00109 g = new GeomLedaPolygonalRigid(path); 00110 00111 // Geoms from geomPQP.h 00112 if (is_file(path+"GeomPQP2DPoint")) 00113 g = new GeomPQP2DPoint(path); 00114 if (is_file(path+"GeomPQP2DRigid")) 00115 g = new GeomPQP2DRigid(path); 00116 if (is_file(path+"GeomPQP2DRigidMulti")) 00117 g = new GeomPQP2DRigidMulti(path); 00118 if (is_file(path+"GeomPQP3DRigid")) 00119 g = new GeomPQP3DRigid(path); 00120 if (is_file(path+"GeomPQP3DRigidMulti")) 00121 g = new GeomPQP3DRigidMulti(path); 00122 00123 if (m == NULL) // Make a default Model 00124 m = new Model2DPoint(path); 00125 if (g == NULL) // Make a default Geom 00126 g = new GeomLedaPolygonal(path); 00127 00128 } 00129 00130 00131 00132 #include <LEDA/UNDEFINE_NAMES.h>