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 all models 00023 #include "model.h" 00024 #include "modelmisc.h" 00025 #include "model2d.h" 00026 #include "model3d.h" 00027 00028 // Include all geometries 00029 #include "geom.h" 00030 #include "geomPQP.h" 00031 00032 #include "util.h" 00033 00034 #include "defs.h" 00035 00036 #define MAKE_MODEL(_m) if (is_file(path+""#_m"")) m = new _m(path); 00037 #define MAKE_GEOM(_g) if (is_file(path+""#_g"")) g = new _g(path); 00038 00039 void SetupProblem(Model *&m, Geom *&g, string path) { 00040 // Make them null initially 00041 m = NULL; 00042 g = NULL; 00043 00044 // Models from modelmisc.h 00045 MAKE_MODEL(Model1D); 00046 MAKE_MODEL(ModelND); 00047 MAKE_MODEL(ModelLinear); 00048 MAKE_MODEL(ModelNintegrator); 00049 00050 // Models from model2d.h 00051 MAKE_MODEL(Model2DPoint); 00052 MAKE_MODEL(Model2DPointCar); 00053 MAKE_MODEL(Model2DRigid); 00054 MAKE_MODEL(Model2DRigidCar); 00055 MAKE_MODEL(Model2DRigidCarForward); 00056 MAKE_MODEL(Model2DRigidCarSmooth); 00057 MAKE_MODEL(Model2DRigidCarSmoothTrailer); 00058 MAKE_MODEL(Model2DRigidCarSmooth2Trailers); 00059 MAKE_MODEL(Model2DRigidCarSmooth3Trailers); 00060 MAKE_MODEL(Model2DRigidDyncar); 00061 MAKE_MODEL(Model2DRigidDyncarNtire); 00062 MAKE_MODEL(Model2DRigidMulti); 00063 MAKE_MODEL(Model2DRigidChain); 00064 00065 // Models from model3d.h 00066 MAKE_MODEL(Model3DRigid); 00067 MAKE_MODEL(Model3DRigidMulti); 00068 MAKE_MODEL(Model3DRigidChain); 00069 MAKE_MODEL(Model3DRigidTree); 00070 00071 // Geoms from geomPQP.h 00072 MAKE_GEOM(GeomPQP2DPoint); 00073 MAKE_GEOM(GeomPQP2DRigid); 00074 MAKE_GEOM(GeomPQP2DRigidMulti); 00075 MAKE_GEOM(GeomPQP3DRigid); 00076 MAKE_GEOM(GeomPQP3DRigidMulti); 00077 00078 if (m == NULL) // Make a default Model 00079 m = new Model2DPoint(path); 00080 if (g == NULL) // Make a default Geom 00081 g = new GeomPQP2DRigid(path); 00082 00083 } 00084