DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
edge.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 Face;
24  class Tetrahedron;
25  class Node;
26 
27  class Edge : public Simplex<NodeKey, FaceKey>
28  {
29  bool crossing = false;
30  bool boundary = false;
31  bool interface = false;
32  public:
33  Edge(ISMesh *owner) noexcept;
34 
35  Edge(Edge&& other) noexcept;
36 
37  Edge& operator=(Edge&& other) noexcept;
38 
39  const SimplexSet<NodeKey> & node_keys() const noexcept;
40  const SimplexSet<FaceKey> & face_keys() const noexcept;
41  SimplexSet<TetrahedronKey> tet_keys() const;
42 
43  std::vector<Face*> faces() const;
44  std::vector<Tetrahedron*> tets() const;
45 
46  std::vector<Node*> nodes() const;
47 
48  vec3 get_center() const;
49 
50  bool is_crossing() noexcept;
51 
52  bool is_boundary() noexcept;
53 
54  bool is_interface() noexcept;
55 
56  double length() const;
57  double sqr_length() const;
58 
59  double length_destination() const;
60  double sqr_length_destination() const;
61 
62  EdgeKey key() const noexcept;
63  private:
64  void set_crossing(bool b);
65 
66  void set_boundary(bool b);
67 
68  void set_interface(bool b);
69 
70  friend class ISMesh;
71  };
72 }
Definition: key.h:75
A 3D double vector.
Definition: Vec3d.h:26
Definition: edge.h:27
Definition: simplex.h:33
Definition: is_mesh.h:40