VPTissue Reference Manual
NeighborNodes.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "Cell.h"
21 #include "Node.h"
22 #include "NeighborNodes.h"
23 #include <iostream>
24 
25 using std::ostream;
26 
27 namespace SimPT_Sim {
28 
30  : m_cell(c), m_nb1(n1), m_nb2(n2) {}
31 
33 {
34  return m_cell;
35 }
36 
38 {
39  return m_nb1;
40 }
41 
43 {
44  return m_nb2;
45 }
46 
48 {
49  return m_cell == nn.m_cell && m_nb1 == nn.m_nb1 && m_nb2 == nn.m_nb2;
50 }
51 
53 {
54  return !operator==(nn);
55 }
56 
57 ostream& operator<<(ostream& os, const NeighborNodes& n)
58 {
59  os << " {" << n.GetCell()->GetIndex() << " "
60  << n.GetNb1()->GetIndex() << " " << n.GetNb2()->GetIndex() << "}";
61  return os;
62 }
63 
64 }
bool operator==(const NeighborNodes &nn) const
Equality test.
bool operator!=(const NeighborNodes &nn) const
Inequality test.
A cell contains walls and nodes.
Definition: Cell.h:48
Node in cell wall.
Definition: Node.h:39
Cell * GetCell() const
Return the cell of this Neighbor pair.
Interface for NeighborNodes.
Namespace for the core simulator.
NeighborNodes(Cell *c=nullptr, Node *n1=nullptr, Node *n2=nullptr)
Plain constructor.
Interface for Cell.
Node * GetNb1() const
Return first node of this Neighbor pair.
Structure of neighboring nodes: two neighboring nodes from standpoint of a given cell with an orderin...
Definition: NeighborNodes.h:34
Interface for Node.
int GetIndex() const
Return the index.
Definition: Cell.h:76
Node * GetNb2() const
Return second node of this Neighbor pair.