MeshKit  1.0
CopyGeom.cpp
Go to the documentation of this file.
00001 #include "meshkit/CopyGeom.hpp"
00002 #include "meshkit/MKCore.hpp"
00003 #include "meshkit/SizingFunction.hpp"
00004 #include "meshkit/RegisterMeshOp.hpp"
00005 #include "meshkit/LocalSet.hpp"
00006 #include "meshkit/ModelEnt.hpp"
00007 
00008 #include "iMesh_extensions.h"
00009 #include "MBCN.h"
00010 
00011 
00012 namespace MeshKit
00013 {
00014 // static registration of this  mesh scheme
00015 moab::EntityType CopyGeom_tps[] = { moab::MBVERTEX,
00016                                     moab::MBEDGE,
00017                                     moab::MBTRI,
00018                                     moab::MBHEX,
00019                                     moab::MBMAXTYPE};
00020 const moab::EntityType* CopyGeom::output_types()
00021 { return CopyGeom_tps; }
00022 
00023 CopyGeom::CopyGeom(MKCore *mkcore, const MEntVector &me_vec)
00024 : MeshScheme(mkcore, me_vec),
00025   igeomImpl(mkcore->igeom_instance())
00026 {
00027   m_x[0] = 0.0;
00028   m_x[1] = 0.0;
00029   m_x[2] = 0.0;
00030 }
00031 
00032 CopyGeom::~CopyGeom()
00033 {}
00034 
00035 bool CopyGeom::add_modelent(ModelEnt *model_ent)
00036 {
00037   return MeshOp::add_modelent(model_ent);
00038 }
00039 
00040 void CopyGeom::setup_this()
00041 {}
00042 
00043 void CopyGeom::execute_this()
00044 {
00045   for (MEntSelection::iterator mit = mentSelection.begin();
00046        mit != mentSelection.end(); mit++) {
00047     ModelEnt *me = mit->first;
00048     iBase_EntityHandle ent = reinterpret_cast<iBase_EntityHandle>(
00049       me->geom_handle());
00050     iBase_EntityHandle tmp;
00051     IBERRCHK(igeomImpl->copyEnt(ent, tmp), *igeomImpl);
00052     IBERRCHK(igeomImpl->moveEnt(tmp, m_x[0], m_x[1], m_x[2]), *igeomImpl);
00053   }
00054 }
00055 
00056 // set the target location - m_x
00057 void CopyGeom::set_location(const Vector<3> &dx)
00058 {
00059   m_x = dx;
00060 }
00061 
00062 void CopyGeom::tag_copied_sets(const char **tag_names, const char **tag_vals,
00063                                const int num_tags)
00064 {
00065   // TODO:
00066 }
00067 
00068 } // namespace MeshKit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines