#include "GeometryModifyTool.hpp" #include "GeometryQueryTool.hpp" #include "CubitMessage.hpp" #include "Body.hpp" #include "RefVolume.hpp" #include "RefFace.hpp" #include "RefEdge.hpp" #include "RefVertex.hpp" #include "InitCGMA.cpp" #include "CubitCompat.hpp" #include "DLIList.hpp" #ifndef SRCDIR # define SRCDIR . #endif int main (int argc, char **argv) { CubitStatus status = InitCGMA::initialize_cgma(); if (CUBIT_SUCCESS != status) return 1; GeometryQueryTool *gqt = GeometryQueryTool::instance(); GeometryModifyTool *gmt = GeometryModifyTool::instance(); Body* cyl = gmt->cylinder( 1.0, 1.0, 1.0, 1.0 ); DLIList child_ents; cyl->get_child_ref_entities(child_ents); std::cout << "Number of child RefEntities: " << child_ents.size() << std::endl; std::cout << "Its dimension is: " << child_ents[0]->dimension() << std::endl; RefVolume *vol = reinterpret_cast(child_ents[0]); // everything is fine until here RefEntity *bod = vol->get_body_ptr(); gqt->delete_RefEntity(bod); }