ITK
4.4.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Core
Common
include
itkChildTreeIterator.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
#ifndef __itkChildTreeIterator_h
19
#define __itkChildTreeIterator_h
20
21
#include "
itkTreeIteratorBase.h
"
22
23
namespace
itk
24
{
25
template
<
class
TTreeType >
26
class
ChildTreeIterator
:
public
TreeIteratorBase
< TTreeType >
27
{
28
public
:
29
31
typedef
ChildTreeIterator
Self
;
32
typedef
TreeIteratorBase< TTreeType >
Superclass
;
33
typedef
TTreeType
TreeType
;
34
typedef
typename
TTreeType::ValueType
ValueType
;
35
typedef
typename
Superclass::TreeNodeType
TreeNodeType
;
36
typedef
typename
TreeNodeType::ChildIdentifier
ChildIdentifier
;
37
typedef
typename
Superclass::NodeType
NodeType
;
38
40
ChildTreeIterator
(
TreeType
*tree,
const
TreeNodeType
*start =
NULL
);
41
43
ChildTreeIterator
(
const
TreeIteratorBase< TTreeType >
& iterator);
44
46
NodeType
GetType
()
const
;
47
49
virtual
bool
GoToChild
(
ChildIdentifier
number = 0);
50
52
virtual
bool
GoToParent
();
53
55
TreeIteratorBase< TTreeType >
*
Clone
();
56
58
Self
&
operator=
(
Superclass
& iterator)
59
{
60
if
(
this
!= &iterator)
61
{
62
Superclass::operator=
(iterator);
63
ChildTreeIterator< TTreeType >
& it =
64
static_cast<
ChildTreeIterator< TTreeType >
&
>
( iterator );
65
m_ListPosition
= it.
m_ListPosition
;
66
m_ParentNode
= it.
m_ParentNode
;
67
}
68
return
*
this
;
69
}
71
72
protected
:
73
75
const
ValueType
&
Next
();
76
78
bool
HasNext
()
const
;
79
80
private
:
81
82
mutable
ChildIdentifier
m_ListPosition
;
83
TreeNodeType
*
m_ParentNode
;
84
};
85
86
}
// end namespace itk
87
88
#ifndef ITK_MANUAL_INSTANTIATION
89
#include "itkChildTreeIterator.hxx"
90
#endif
91
92
#endif
93
Generated on Mon May 13 2013 00:46:17 for ITK by
1.8.3.1