VPTissue Reference Manual
Edge.h
Go to the documentation of this file.
1 #ifndef EDGE_H_INCLUDED
2 #define EDGE_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include <iosfwd>
23 
24 namespace SimPT_Sim {
25 
26 class Node;
27 
31 class Edge
32 {
33 public:
35  Edge(Node* f = nullptr, Node* s = nullptr)
36  : m_first(f), m_second(s) {}
37 
39  bool operator==(const Edge& e) const
40  {
41  return ((m_first == e.m_first && m_second == e.m_second) || (m_first == e.m_second && m_second == e.m_first));
42  }
43 
45  Node* GetFirst() const
46  {
47  return m_first;
48  }
49 
51  Node* GetSecond() const
52  {
53  return m_second;
54  }
55 
57  bool IsFixed() const;
58 
60  std::ostream& Print(std::ostream& os) const;
61 
62 private:
63  Node* m_first;
64  Node* m_second;
65 };
66 
67 inline std::ostream& operator<<(std::ostream& os, const Edge& e)
68 {
69  e.Print(os);
70  return os;
71 }
72 
73 }
74 
75 #endif //end_of_include_guard
76 
77 
78 
bool IsFixed() const
Query whether edge is fixed.
Definition: Edge.cpp:31
Node in cell wall.
Definition: Node.h:39
Namespace for the core simulator.
An Edge connects two nodes and is ambidextrous.
Definition: Edge.h:31
Edge(Node *f=nullptr, Node *s=nullptr)
Construct edge using two node pointers.
Definition: Edge.h:35
Node * GetFirst() const
Get the first node of the edge.
Definition: Edge.h:45
bool operator==(const Edge &e) const
Ambidextrous equivalence.
Definition: Edge.h:39
std::ostream & Print(std::ostream &os) const
Insert the edge in an output stream.
Definition: Edge.cpp:36
Node * GetSecond() const
Get the second node of the edge.
Definition: Edge.h:51