ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkNodePair.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef itkNodePair_h
20 #define itkNodePair_h
21 
22 #include <utility>
23 
24 namespace itk
25 {
32 template<typename TNode, typename TOutputPixel>
33 class NodePair : private std::pair< TNode, TOutputPixel >
34  {
35 public:
36  typedef NodePair Self;
37  typedef std::pair< TNode, TOutputPixel > Superclass;
38 
39  typedef TNode NodeType;
40  typedef TOutputPixel OutputPixelType;
41 
43  NodePair( const TNode& iNode, const TOutputPixel& iValue ) :
44  Superclass( iNode, iValue ) {}
45  NodePair( const Self& iPair ) : Superclass( iPair ) {}
46 
47  void operator = ( const Self& iPair )
48  {
49  this->first = iPair.first;
50  this->second = iPair.second;
51  }
52 
53  void SetValue( const TOutputPixel& iValue )
54  {
55  this->second = iValue;
56  }
57  const TOutputPixel & GetValue() const
58  {
59  return this->second;
60  }
61  TOutputPixel & GetValue()
62  {
63  return this->second;
64  }
65  void SetNode( const TNode& iNode )
66  {
67  this->first = iNode;
68  }
69  const TNode & GetNode() const
70  {
71  return this->first;
72  }
73  TNode & GetNode()
74  {
75  return this->first;
76  }
77 
78  bool operator < ( const Self& iRight ) const
79  {
80  return this->second < iRight.second;
81  }
82 
83  bool operator > ( const Self& iRight ) const
84  {
85  return this->second > iRight.second;
86  }
87 
88  bool operator <= ( const Self& iRight ) const
89  {
90  return this->second <= iRight.second;
91  }
92 
93  bool operator >= ( const Self& iRight ) const
94  {
95  return this->second >= iRight.second;
96  }
97  };
98 
99 }
100 #endif // itkFastMarchingTraits_h
Represents a Node and its associated value (front value)
Definition: itkNodePair.h:33
TOutputPixel & GetValue()
Definition: itkNodePair.h:61
NodePair(const TNode &iNode, const TOutputPixel &iValue)
Definition: itkNodePair.h:43
bool operator<=(const Self &iRight) const
Definition: itkNodePair.h:88
const TOutputPixel & GetValue() const
Definition: itkNodePair.h:57
const TNode & GetNode() const
Definition: itkNodePair.h:69
void SetValue(const TOutputPixel &iValue)
Definition: itkNodePair.h:53
NodePair(const Self &iPair)
Definition: itkNodePair.h:45
bool operator<(const Self &iRight) const
Definition: itkNodePair.h:78
void SetNode(const TNode &iNode)
Definition: itkNodePair.h:65
void operator=(const Self &iPair)
Definition: itkNodePair.h:47
bool operator>=(const Self &iRight) const
Definition: itkNodePair.h:93
TNode & GetNode()
Definition: itkNodePair.h:73
bool operator>(const Self &iRight) const
Definition: itkNodePair.h:83
NodePair Self
Definition: itkNodePair.h:36
std::pair< TNode, TOutputPixel > Superclass
Definition: itkNodePair.h:37
TOutputPixel OutputPixelType
Definition: itkNodePair.h:40
TNode NodeType
Definition: itkNodePair.h:39