$extrastylesheet
Olena
User documentation 2.1
An Image Processing Platform
Milena
Getting started
API Reference Manual
All Classes
Examples
Demos
Publications
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
graph_window_base.hh
1
// Copyright (C) 2008, 2009, 2012 EPITA Research and Development
2
// Laboratory (LRDE)
3
//
4
// This file is part of Olena.
5
//
6
// Olena is free software: you can redistribute it and/or modify it under
7
// the terms of the GNU General Public License as published by the Free
8
// Software Foundation, version 2 of the License.
9
//
10
// Olena is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// General Public License for more details.
14
//
15
// You should have received a copy of the GNU General Public License
16
// along with Olena. If not, see <http://www.gnu.org/licenses/>.
17
//
18
// As a special exception, you may use this file as part of a free
19
// software project without restriction. Specifically, if other files
20
// instantiate templates or use macros or inline functions from this
21
// file, or you compile this file and link it with other files to produce
22
// an executable, this file does not by itself cause the resulting
23
// executable to be covered by the GNU General Public License. This
24
// exception does not however invalidate any other reasons why the
25
// executable file might be covered by the GNU General Public License.
26
27
#ifndef MLN_CORE_INTERNAL_GRAPH_WINDOW_BASE_HH
28
# define MLN_CORE_INTERNAL_GRAPH_WINDOW_BASE_HH
29
30
# include <mln/core/concept/window.hh>
31
35
36
namespace
mln
37
{
38
45
template
<
typename
P,
typename
E>
46
class
graph_window_base
:
public
Window
<E>
47
{
48
typedef
graph_window_base<P, E>
self_
;
49
50
public
:
54
typedef
P
site
;
55
56
// FIXME: This is a dummy value.
57
typedef
void
dpsite
;
59
63
bool
is_empty
()
const
;
65
bool
is_centered
()
const
;
67
// FIXME: We should define this more precisely.
68
bool
is_symmetric
()
const
;
71
/* FIXME: This method returns a dummy value (0), since the delta
72
of a window on a graph/line_graph
73
74
1. is not constant (line graph edges/graph vertices are not necessarily
75
aligned on a regular grid);
76
77
2. depends on the underlying line_graph/graph, too.
78
79
It raises another question: should delta() be part of the
80
concept ``Window''? */
81
unsigned
delta
()
const
;
83
self_
&
sym
();
84
86
bool
is_neighbable_
()
const
;
88
90
bool
is_valid
()
const
;
91
92
protected
:
93
graph_window_base
();
94
};
95
96
97
# ifndef MLN_INCLUDE_ONLY
98
99
100
101
template
<
typename
P,
typename
E>
102
inline
103
graph_window_base<P,E>::graph_window_base
()
104
{
105
}
106
107
template
<
typename
P,
typename
E>
108
inline
109
bool
110
graph_window_base<P,E>::is_empty
()
const
111
{
112
return
false
;
113
}
114
115
template
<
typename
P,
typename
E>
116
inline
117
bool
118
graph_window_base<P,E>::is_centered
()
const
119
{
120
return
false
;
121
}
122
123
template
<
typename
P,
typename
E>
124
inline
125
bool
126
graph_window_base<P,E>::is_symmetric
()
const
127
{
128
return
true
;
129
}
130
131
template
<
typename
P,
typename
E>
132
inline
133
unsigned
134
graph_window_base<P,E>::delta
()
const
135
{
136
// Dummy value (see the interface of the method above).
137
return
0;
138
}
139
140
template
<
typename
P,
typename
E>
141
inline
142
graph_window_base<P,E>&
143
graph_window_base<P,E>::sym
()
144
{
145
return
*
this
;
146
}
147
148
template
<
typename
P,
typename
E>
149
inline
150
bool
151
graph_window_base<P,E>::is_neighbable_
()
const
152
{
153
return
true
;
154
}
155
156
template
<
typename
P,
typename
E>
157
inline
158
bool
159
graph_window_base<P,E>::is_valid
()
const
160
{
161
return
true
;
162
}
163
164
165
166
# endif // !MLN_INCLUDE_ONLY
167
168
}
// end of namespace mln
169
170
#endif // ! MLN_CORE_INTERNAL_GRAPH_WINDOW_BASE_HH
mln
core
internal
graph_window_base.hh
Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)