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
#ifndef ZIP_HPP
#define ZIP_HPP

#include "moab/Core.hpp"
#include "gen.hpp"
#include "arc.hpp"

namespace zip {
  moab::ErrorCode t_joint( moab::Tag normal_tag, 
                       const moab::EntityHandle vert0,              
                       const moab::EntityHandle vert1,                         
                       const moab::EntityHandle vert2,
                       bool debug );
/// removes the entitiy handle tri from the loaded mesh                
  moab::ErrorCode delete_degenerate_tris( moab::EntityHandle tri );
/// checks that no triangles in the moab::Range tris are degenterate. If 
/// degenerate triangles are found, they are deleted from the mesh. 
  moab::ErrorCode delete_degenerate_tris( moab::Range tris );

  moab::ErrorCode delete_adj_degenerate_tris( const moab::EntityHandle adj_vert );


/// merges two vertices by updating the entity handle of the deleted vert to the vert to 
/// keep in the correct arc. Uses MOAB function merge_entities to merge the vertices in 
/// the database. Also deletes the triangles adjacent to the merged vertices if one
/// becomes degenerate.
  moab::ErrorCode merge_verts( const moab::EntityHandle keep_vert, 
                           const moab::EntityHandle delete_vert,
                           std::vector<moab::EntityHandle> &arc0,
                           std::vector<moab::EntityHandle> &arc1 );

/// test two normal vectors to see if they point in the same direction
  moab::ErrorCode test_normals( const std::vector<moab::CartVect> norms0,<--- Function parameter 'norms0' should be passed by reference.
                            const std::vector<moab::CartVect> norms1,<--- Function parameter 'norms1' should be passed by reference.
                            std::vector<int> &inverted_tri_indices );
  moab::ErrorCode test_normals( const             moab::CartVect  norms0,
                            const             moab::CartVect  norms1 );

  moab::ErrorCode remove_inverted_tris(moab::Tag normal_tag, moab::Range tris, const bool debug );

/// tests the watertightness of all arcs in the vector-array of moab entity handles arcs
  moab::ErrorCode test_zipping( const double FACET_TOL,
                            const std::vector< std::vector<moab::EntityHandle> > arcs );<--- Function parameter 'arcs' should be passed by reference.

}

#endif