DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
node.h
1 //
2 // Deformabel Simplicial Complex (DSC) method
3 // Copyright (C) 2013 Technical University of Denmark
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // See licence.txt for a copy of the GNU General Public License.
16 
17 #pragma once
18 
19 #include "simplex.h"
20 
21 namespace is_mesh
22 {
23  class Edge;
24  class Face;
25  class Tetrahedron;
26 
27  class Node : public Simplex<Key, EdgeKey>
28  {
29  vec3 p;
30  vec3 p_new;
31  bool crossing = false;
32  bool boundary = false;
33  bool interface = false;
34  public:
35  Node(ISMesh *owner) noexcept;
36  Node(ISMesh *owner, vec3 _p) noexcept;
37 
38  Node(Node&& other) noexcept;
39 
40  Node& operator=(Node&& other) noexcept;
41 
42  const SimplexSet<EdgeKey> & edge_keys() const noexcept;
43  SimplexSet<FaceKey> face_keys() const;
44  SimplexSet<TetrahedronKey> tet_keys() const;
45 
46  std::vector<Edge*> edges() const;
47  std::vector<Face*> faces() const;
48  std::vector<Tetrahedron*> tets() const;
49 
50  const vec3 get_center() const;
51 
52  const vec3 & get_pos() const;
53 
54  const vec3 & get_destination() const;
55 
56  void set_pos(const vec3& p_);
57 
58  void set_destination(const vec3& p_);
59 
60  bool is_crossing() const noexcept;
61 
62  bool is_boundary() const noexcept;
63 
64  bool is_interface() const noexcept;
65 
66  vec3 smart_laplacian(double alpha = 1.) const;
67 
68  // return the number of clusters neighbouring tets (of a given label)
69  // (here two tets are only seen as directly connected if they share a face)
70  // if >= 2 for any label, then the vertex is non-manifold
71  int get_number_of_neighbour_tet_clusters(int label);
72 
73  NodeKey key() const noexcept;
74  private:
75  void set_crossing(bool b);
76 
77  void set_boundary(bool b);
78 
79  void set_interface(bool b);
80 
81  friend class ISMesh;
82 
83 
84  };
85 }
Definition: node.h:27
A 3D double vector.
Definition: Vec3d.h:26
Definition: simplex.h:33
Definition: key.h:68
Definition: is_mesh.h:40