ITK
4.13.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Core
Common
include
itkOctreeNode.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 itkOctreeNode_h
19
#define itkOctreeNode_h
20
#include "
itkMacro.h
"
21
namespace
itk
22
{
23
enum
LeafIdentifier
{
ZERO
= 0,
ONE
= 1,
TWO
= 2,
THREE
= 3,
FOUR
= 4,
FIVE
= 5,
SIX
= 6,
SEVEN
= 7 };
24
25
// Forward reference because of circular dependencies
26
class
ITK_FORWARD_EXPORT
OctreeNodeBranch
;
27
class
ITK_FORWARD_EXPORT
OctreeBase
;
28
45
class
ITKCommon_EXPORT
OctreeNode
46
{
47
public
:
48
54
OctreeNode
();
55
59
virtual
~
OctreeNode
();
60
68
OctreeNode
& GetChild(
const
enum
LeafIdentifier
ChildID)
const
;
69
70
OctreeNode
& GetChild(
const
enum
LeafIdentifier
ChildID);
80
long
int
GetColor()
const
;
81
88
void
SetColor(
int
NodeColor);
89
95
void
SetBranch(
OctreeNodeBranch
*NewBranch);
96
101
bool
IsNodeColored()
const
;
102
103
inline
void
SetParentOctree(
OctreeBase
*parent)
104
{
105
m_Parent = parent;
106
}
107
108
protected
:
109
110
private
:
115
void
RemoveChildren();
116
120
OctreeNodeBranch
*m_Branch;
121
OctreeBase
* m_Parent;
122
};
123
124
class
ITKCommon_EXPORT
OctreeNodeBranch
125
{
126
public
:
127
OctreeNodeBranch
() {}
128
OctreeNodeBranch
(
OctreeBase
*parent)
129
{
130
for
(
int
i = 0; i < 8; i++ )
131
{
132
m_Leaves[i].SetParentOctree(parent);
133
}
134
}
135
136
inline
OctreeNode
*
GetLeaf
(
enum
LeafIdentifier
LeafID)
137
{
138
return
&m_Leaves[LeafID];
139
}
140
141
private
:
142
OctreeNode
m_Leaves[8];
143
};
144
}
//End of itk Namespace
145
#endif
/* itkOctreeNode_h */
itk::SEVEN
Definition:
itkOctreeNode.h:23
itk::SIX
Definition:
itkOctreeNode.h:23
itk::OctreeBase
Provides non-templated access to templated instances of Octree.
Definition:
itkOctree.h:54
itk::FOUR
Definition:
itkOctreeNode.h:23
itk::LeafIdentifier
LeafIdentifier
Definition:
itkOctreeNode.h:23
itk::OctreeNodeBranch::OctreeNodeBranch
OctreeNodeBranch(OctreeBase *parent)
Definition:
itkOctreeNode.h:128
itkMacro.h
itk::FIVE
Definition:
itkOctreeNode.h:23
itk::OctreeNode
A data structure representing a node in an Octree.
Definition:
itkOctreeNode.h:45
itk::THREE
Definition:
itkOctreeNode.h:23
itk::OctreeNodeBranch::GetLeaf
OctreeNode * GetLeaf(enum LeafIdentifier LeafID)
Definition:
itkOctreeNode.h:136
itk::ONE
Definition:
itkOctreeNode.h:23
itk::ZERO
Definition:
itkOctreeNode.h:23
itk::OctreeNodeBranch::OctreeNodeBranch
OctreeNodeBranch()
Definition:
itkOctreeNode.h:127
itk::TWO
Definition:
itkOctreeNode.h:23
itk::OctreeNodeBranch
Definition:
itkOctreeNode.h:124
Generated on Tue Dec 19 2017 04:42:39 for ITK by
1.8.5