-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathitkDefaultGraphTraits.h
executable file
·74 lines (58 loc) · 2.01 KB
/
itkDefaultGraphTraits.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkDefaultGraphTraits.h,v $
Language: C++
Date: $Date: 2008/11/11 03:08:24 $
Version: $Revision: 1.2 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
Portions of this code are covered under the VTK copyright.
See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __itkDefaultGraphTraits_h
#define __itkDefaultGraphTraits_h
#include <vector>
namespace itk
{
/** \class DefaultGraphTraits
* \brief Base class for all graph traits.
*
* Defines the node and edge structures. Templated over
* the edge and node weight types.
*
*/
template <typename TNodeWeight = short, typename TEdgeWeight = short>
class DefaultGraphTraits
{
public:
typedef DefaultGraphTraits Self;
struct EdgeType;
struct NodeType;
typedef NodeType* NodePointerType;
typedef EdgeType* EdgePointerType;
typedef unsigned long NodeIdentifierType;
typedef unsigned long EdgeIdentifierType;
typedef TNodeWeight NodeWeightType;
typedef TEdgeWeight EdgeWeightType;
typedef std::vector<EdgeIdentifierType> EdgeIdentifierContainerType;
struct NodeType
{
NodeIdentifierType Identifier;
EdgeIdentifierContainerType IncomingEdges;
EdgeIdentifierContainerType OutgoingEdges;
NodeWeightType Weight;
};
struct EdgeType
{
EdgeIdentifierType Identifier;
NodeIdentifierType SourceIdentifier;
NodeIdentifierType TargetIdentifier;
EdgeIdentifierType ReverseEdgeIdentifier;
EdgeWeightType Weight;
};
};
} // end namespace itk
#endif