Branch data Line data Source code
1 : : #ifndef MESHKIT_VERTEXMESHER_HPP
2 : : #define MESHKIT_VERTEXMESHER_HPP
3 : :
4 : : #include "meshkit/Types.hpp"
5 : : #include "meshkit/Error.hpp"
6 : : #include "meshkit/MeshScheme.hpp"
7 : : #include "meshkit/ModelEnt.hpp"
8 : : #include "iGeom.h"
9 : : #include "moab/Interface.hpp"
10 : : #include <vector>
11 : :
12 : : namespace MeshKit {
13 : :
14 : : class MKCore;
15 : :
16 : :
17 : : /** \class VertexMesher VertexMesher.hpp "meshkit/VertexMesher.hpp"
18 : : * \brief A simple class for meshing geometric vertices
19 : : *
20 : : * INPUT: one or more ModelEnts representing geometric vertices
21 : : * MESH TYPE(S): MBVERTEX
22 : : * OUTPUT: one mesh vertex for each ModelEnt
23 : : * DEPENDENCIES: (none)
24 : : * CONSTRAINTS: ModelEnts must be geometric vertices, i.e. with dimension() == 0
25 : : *
26 : : * This class performs the trivial task of meshing geometric vertices. Typically there will
27 : : * only be a single instance of this class, and therefore it is pointed to and managed by MKCore.
28 : : * It will also be inserted into the meshing graph during the setup phase of most edge meshers.
29 : : *
30 : : * The single instance of this class stores all the ModelEnt's representing geometric vertices,
31 : : * and after execution, an MEntSelection entry for each geometric vertex and mesh vertex pair.
32 : : */
33 : : class VertexMesher : public MeshScheme
34 : : {
35 : : public:
36 : :
37 : : //! Bare constructor
38 : : VertexMesher(MKCore *mkcore, const MEntVector &me_vec = MEntVector());
39 : :
40 : : //! Destructor
41 : : virtual ~VertexMesher();
42 : :
43 : : /** \brief Re-implemented here so we can check topological dimension of model_ent
44 : : * \param model_ent ModelEnt being added
45 : : */
46 : : virtual bool add_modelent(ModelEnt *model_ent);
47 : :
48 : : //! Setup is a no-op, but must be provided since it's pure virtual
49 : : virtual void setup_this();
50 : :
51 : : //! The only setup/execute function we need, since meshing vertices is trivial
52 : : virtual void execute_this();
53 : :
54 : :
55 : : /**\brief Get class name */
56 : 1159 : static const char* name()
57 : 1159 : { return "VertexMesher"; }
58 : :
59 : : /**\brief Function returning whether this scheme can mesh entities of t
60 : : * the specified dimension.
61 : : *\param dim entity dimension
62 : : */
63 : 160 : static bool can_mesh(iBase_EntityType dim)
64 : 160 : { return iBase_VERTEX == dim; }
65 : :
66 : : /** \brief Function returning whether this scheme can mesh the specified entity
67 : : *
68 : : * Used by MeshOpFactory to find scheme for an entity.
69 : : * \param model_ent ModelEnt being queried
70 : : * \return If true, this scheme can mesh the specified ModelEnt
71 : : */
72 : 0 : static bool can_mesh(ModelEnt *model_ent)
73 : 0 : { return canmesh_vertex(model_ent); }
74 : :
75 : : /**\brief Get list of mesh entity types that can be generated.
76 : : *\return array terminated with \c moab::MBMAXTYPE
77 : : */
78 : : static const moab::EntityType* output_types();
79 : :
80 : : /** \brief Return the mesh entity types operated on by this scheme
81 : : * \return array terminated with \c moab::MBMAXTYPE
82 : : */
83 : 0 : virtual const moab::EntityType* mesh_types_arr() const
84 : 0 : { return output_types(); }
85 : :
86 : : protected:
87 : :
88 : : private:
89 : :
90 : : //! No copy constructor, since there's only meant to be one of these
91 : : VertexMesher(const VertexMesher &);
92 : :
93 : : //! No operator=, since there's only meant to be one of these
94 : : VertexMesher &operator=(const VertexMesher &);
95 : :
96 : : //! Static variable, used in registration
97 : : static int init;
98 : : };
99 : :
100 : : }
101 : :
102 : : #endif
103 : :
104 : :
|