ITK
4.3.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Core
Common
include
itkTreeContainer.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 __itkTreeContainer_h
19
#define __itkTreeContainer_h
20
21
#include "
itkTreeContainerBase.h
"
22
#include "
itkPreOrderTreeIterator.h
"
23
24
namespace
itk
25
{
37
template
<
class
TValueType >
38
class
TreeContainer
:
public
TreeContainerBase
< TValueType >
39
{
40
public
:
41
43
typedef
TreeContainerBase< TValueType >
Superclass
;
44
typedef
TreeContainer< TValueType >
Self
;
45
typedef
SmartPointer< Self >
Pointer
;
46
typedef
SmartPointer< const Self >
ConstPointer
;
47
typedef
TValueType
ValueType
;
48
typedef
TreeNode< ValueType >
TreeNodeType
;
49
51
typedef
TreeIteratorBase< Self >
IteratorType
;
52
typedef
PreOrderTreeIterator< Self >
PreOrderIteratorType
;
53
55
itkNewMacro(
Self
);
56
58
itkTypeMacro(
TreeContainer
,
TreeContainerBase
);
59
61
TreeContainer
(
int
defaultChildrenCount);
62
64
TreeContainer
(
TreeContainer< TValueType >
& tree);
65
67
virtual
bool
SetRoot
(
const
TValueType element);
68
70
bool
SetRoot
(
IteratorType
& pos);
71
73
virtual
bool
SetRoot
(
TreeNode< TValueType >
*node);
74
76
bool
Contains
(
const
TValueType element);
77
79
int
Count
()
const
;
80
82
bool
IsLeaf
(
const
TValueType element);
83
85
bool
IsRoot
(
const
TValueType element);
86
88
bool
Clear
();
89
91
bool
operator==
(
TreeContainer< TValueType >
& tree);
92
94
bool
Swap
(
IteratorType
& v,
IteratorType
& w);
95
97
const
TreeNodeType
*
GetRoot
()
const
{
return
m_Root
.
GetPointer
(); }
98
100
bool
Add
(
const
TValueType child,
const
TValueType parent);
101
103
const
TreeNodeType
*
GetNode
(TValueType val)
const
;
104
105
protected
:
106
107
TreeContainer
();
108
virtual
~TreeContainer
();
109
110
typename
TreeNodeType::Pointer
m_Root
;
111
112
int
m_DefaultChildrenCount
;
113
114
void
PrintSelf
(std::ostream & os,
Indent
indent)
const
;
115
};
116
}
// namespace itk
117
118
#ifndef ITK_MANUAL_INSTANTIATION
119
#include "itkTreeContainer.hxx"
120
#endif
121
122
#endif
123
Generated on Sun Dec 9 2012 01:29:07 for ITK by
1.8.2