1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "meshkit/CopyGeom.hpp"
#include "meshkit/MKCore.hpp"
#include "meshkit/SizingFunction.hpp"
#include "meshkit/RegisterMeshOp.hpp"
#include "meshkit/LocalSet.hpp"
#include "meshkit/ModelEnt.hpp"

#include "iMesh_extensions.h"
#include "MBCN.h"


namespace MeshKit
{
// static registration of this  mesh scheme
moab::EntityType CopyGeom_tps[] = { moab::MBVERTEX,
                                    moab::MBEDGE,
                                    moab::MBTRI,
                                    moab::MBHEX,
                                    moab::MBMAXTYPE};
const moab::EntityType* CopyGeom::output_types()
{ return CopyGeom_tps; }

CopyGeom::CopyGeom(MKCore *mkcore, const MEntVector &me_vec)
: MeshScheme(mkcore, me_vec),
  igeomImpl(mkcore->igeom_instance())
{
  m_x[0] = 0.0;
  m_x[1] = 0.0;
  m_x[2] = 0.0;
}

CopyGeom::~CopyGeom()
{}

bool CopyGeom::add_modelent(ModelEnt *model_ent)
{
  return MeshOp::add_modelent(model_ent);
}

void CopyGeom::setup_this()
{}

void CopyGeom::execute_this()
{
  for (MEntSelection::iterator mit = mentSelection.begin();
       mit != mentSelection.end(); mit++) {<--- Prefer prefix ++/-- operators for non-primitive types.
    ModelEnt *me = mit->first;
    iBase_EntityHandle ent = reinterpret_cast<iBase_EntityHandle>(
      me->geom_handle());
    iBase_EntityHandle tmp;
    IBERRCHK(igeomImpl->copyEnt(ent, tmp), *igeomImpl);
    IBERRCHK(igeomImpl->moveEnt(tmp, m_x[0], m_x[1], m_x[2]), *igeomImpl);
  }
}

// set the target location - m_x
void CopyGeom::set_location(const Vector<3> &dx)
{
  m_x = dx;
}

void CopyGeom::tag_copied_sets(const char **tag_names, const char **tag_vals,
                               const int num_tags)
{
  // TODO:
}

} // namespace MeshKit