cgma
sheet.cpp
Go to the documentation of this file.
00001 
00009 #include "GeometryModifyTool.hpp"
00010 #include "GeometryModifyEngine.hpp"
00011 #include "GeometryQueryTool.hpp"
00012 #include "ModelQueryEngine.hpp"
00013 #include "Body.hpp"
00014 #include "RefFace.hpp"
00015 #include "CubitObserver.hpp"
00016 #include "InitCGMA.hpp"
00017 #include "DLIList.hpp"
00018 
00019 #include <typeinfo>
00020 
00021 int test_sheet_query( GeometryModifyEngine* engine );
00022 
00023 // main program - initialize, then send to proper function
00024 int main (int argc, char **argv)
00025 {
00026   CubitStatus result = InitCGMA::initialize_cgma();
00027   if (CUBIT_SUCCESS != result) return 1;
00028   
00029   DLIList<GeometryModifyEngine*> gme_list;
00030   GeometryModifyTool::instance()->get_gme_list(gme_list);
00031 
00032   int exit_val = 0;
00033   for (int i = 0; i < gme_list.size(); ++i)
00034     exit_val += test_sheet_query( gme_list[i] );
00035 
00036   return exit_val;
00037 }
00038 
00039 
00040 int test_sheet_query( GeometryModifyEngine* engine )
00041 {
00042   Body *sphere = 0, *sheet = 0;
00043   
00044   sphere = GeometryModifyTool::instance()->sphere( 1.0 );
00045   if (!sphere) {
00046     fprintf(stderr,"Sphere creation failed for engine (%s)\n", 
00047       typeid(*engine).name());
00048     return 1;
00049   }
00050 
00051   sheet = GeometryModifyTool::instance()->planar_sheet( 
00052     CubitVector(0,0,0), CubitVector(1,0,0), 
00053     CubitVector(1,1,0), CubitVector(0,1,0) );
00054   if (!sheet) {
00055     fprintf(stderr,"Planar sheet creation failed for engine (%s)\n", 
00056       typeid(*engine).name());
00057     return 1;
00058   }
00059   
00060   if (sphere->is_sheet_body()) {
00061     fprintf(stderr,"Solid sphere reported as sheet body (%s).\n", 
00062       typeid(*engine).name());
00063     return 1;
00064   }
00065   
00066   if (!sheet->is_sheet_body()) {
00067     fprintf(stderr,"Planar sheet reported as non-sheet body (%s).\n", 
00068       typeid(*engine).name());
00069     return 1;
00070   }
00071   
00072   printf("Success (%s)\n",typeid(*engine).name());
00073   return 0;
00074 }
00075 
00076     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines