Moka kernel
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
gmv-inline.icc
Go to the documentation of this file.
1
/*
2
* lib-gmapkernel : Un noyau de 3-G-cartes et des opérations.
3
* Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4
* http://www.sic.sp2mi.univ-poitiers.fr/
5
* Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6
* guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7
*
8
* This file is part of lib-gmapkernel
9
*
10
* This program is free software: you can redistribute it and/or modify
11
* it under the terms of the GNU Lesser General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
19
*
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
*/
23
24
//******************************************************************************
25
#include "
geometry.hh
"
26
//******************************************************************************
27
namespace
GMap3d
28
{
29
//******************************************************************************
30
INLINE
31
void
CGMapVertex::empty
()
32
{
33
CGMap::empty
();
34
35
setOrbitUsed
(
ORBIT_VERTEX
);
36
}
37
//******************************************************************************
38
INLINE
39
CDart
*
CGMapVertex::newDart
()
40
{
41
return
new
CDartVertex
(
FMaskMarks
);
42
}
43
//******************************************************************************
44
INLINE
45
void
CGMapVertex::delDart
(
CDart
* ADart)
46
{
47
assert(ADart != NULL);
48
49
delete
static_cast<
CDartVertex
*
>
(ADart);
50
}
51
//******************************************************************************
52
INLINE
53
CDart
*
CGMapVertex::addMapDart
()
54
{
55
return
CGMapGeneric::addMapDart
();
56
}
57
//******************************************************************************
58
INLINE
59
CDartVertex
*
CGMapVertex::addMapDart
(
const
CVertex
& AVertex)
60
{
61
CDartVertex
* dart =
static_cast<
CDartVertex
*
>
(
CGMapGeneric::addMapDart
());
62
setVertex
(dart, AVertex);
63
return
dart;
64
}
65
//******************************************************************************
66
INLINE
67
TCoordinate
CGMapVertex::getBurstCoef
(
int
ADim)
const
68
{
69
assert(ADim>=0 && ADim<=3);
70
71
return
FBurstCoef[ADim];
72
}
73
//******************************************************************************
74
INLINE
75
void
CGMapVertex::setBurstCoef
(
int
ADim,
TCoordinate
ACoef)
76
{
77
assert(ADim >=0 && ADim <=3);
78
assert(ACoef>=0 && ACoef<=1);
79
80
FBurstCoef[ADim]= ACoef;
81
}
82
//******************************************************************************
83
INLINE
84
CAttributeVertex
*
CGMapVertex::findVertex
(
CDart
* ADart)
85
{
86
assert(ADart!=NULL);
87
88
return
static_cast<
CAttributeVertex
*
>
89
(
getAttribute
(ADart,
ORBIT_VERTEX
,
ATTRIBUTE_VERTEX
));
90
}
91
//******************************************************************************
92
INLINE
93
CAttributeVertex
*
CGMapVertex::getVertex
(
CDart
* ADart)
const
94
{
95
assert(ADart!=NULL);
96
97
return
static_cast<
CAttributeVertex
*
>
98
(ADart->
getAttribute
(
ORBIT_VERTEX
,
ATTRIBUTE_VERTEX
));
99
}
100
//******************************************************************************
101
INLINE
102
void
CGMapVertex::setVertex
(
CDart
* ADart,
const
CVertex
& AVertex)
103
{
104
assert(ADart!=NULL);
105
assert(
findVertex
(ADart)==NULL);
106
107
addAttribute
(ADart,
ORBIT_VERTEX
,
new
CAttributeVertex
(AVertex));
108
}
109
//******************************************************************************
110
INLINE
111
void
CGMapVertex::setVertex
(
CDart
* ADart,
CAttributeVertex
* AVertex)
112
{
113
assert(ADart!=NULL);
114
assert(AVertex!=NULL);
115
assert(
findVertex
(ADart)==NULL);
116
117
addAttribute
(ADart,
ORBIT_VERTEX
, AVertex);
118
}
119
//******************************************************************************
120
INLINE
121
void
CGMapVertex::updateVertex
(
CDart
* ADart,
const
CVertex
& AVertex)
122
{
123
assert(ADart!=NULL);
124
125
CAttributeVertex
* vertex =
findVertex
(ADart);
126
127
if
(vertex==NULL)
128
addAttribute
(ADart,
ORBIT_VERTEX
,
new
CAttributeVertex
(AVertex));
129
else
130
*vertex = AVertex;
131
}
132
//******************************************************************************
133
INLINE
134
void
CGMapVertex::delVertex
(
CDart
* ADart)
135
{
136
assert(ADart!=NULL);
137
138
deleteAttribute
(ADart,
ORBIT_VERTEX
,
ATTRIBUTE_VERTEX
);
139
}
140
//******************************************************************************
141
INLINE
142
CAttributeVertex
*
CGMapVertex::removeVertex
(
CDart
* ADart)
143
{
144
assert(ADart!=NULL);
145
146
return
147
static_cast<
CAttributeVertex
*
>
(
removeAttribute
(ADart,
ORBIT_VERTEX
,
148
ATTRIBUTE_VERTEX
));
149
}
150
//******************************************************************************
151
INLINE
152
CVertex
&
CGMapVertex::getBurstVertex
(
CDart
* ADart)
const
153
{
154
assert(ADart!=NULL);
155
return
(static_cast<CDartVertex *>(ADart))->getBurstVertex();
156
}
157
//------------------------------------------------------------------------------
158
INLINE
159
void
CGMapVertex::setBurstVertex
(
CDart
* ADart,
const
CVertex
& AVertex)
160
{
161
assert(ADart!=NULL);
162
static_cast<
CDartVertex
*
>
(ADart)->
setBurstVertex
(AVertex);
163
}
164
//******************************************************************************
165
INLINE
166
CVertex
CGMapVertex::computeBurstExtremity
(
CDart
* ADart)
const
167
{
168
if
(
isFree0
(ADart))
169
return
getBurstVertex
(ADart);
170
171
TCoordinate
k0 = FBurstCoef[0];
172
173
CVertex
& v1 =
getBurstVertex
( ADart );
174
CVertex
& v2 =
getBurstVertex
(
alpha0
(ADart));
175
176
// v1 + k0 * (v2-v1) / 2
177
178
k0 /= 2;
179
180
return
k0*v2 + (1-k0)*v1;
181
}
182
//******************************************************************************
183
INLINE
184
CAttributeVertex
*
185
CGMapVertex::getDirectInfoAsAttributeVertex
(
CDart
* ADart,
186
int
ADirectInfoIndex)
const
187
{
188
assert(ADart!=NULL);
189
return
static_cast<
CAttributeVertex
*
>
(ADart->
getDirectInfo
(ADirectInfoIndex));
190
}
191
//******************************************************************************
192
INLINE
193
CVertex
*
194
CGMapVertex::getDirectInfoAsVertex
(
CDart
* ADart,
int
ADirectInfoIndex)
const
195
{
196
assert(ADart!=NULL);
197
return
static_cast<
CVertex
*
>
(ADart->
getDirectInfo
(ADirectInfoIndex));
198
}
199
//******************************************************************************
200
INLINE
201
TCoordinate
*
202
CGMapVertex::getDirectInfoAsCoord
(
CDart
* ADart,
int
ADirectInfoIndex)
const
203
{
204
assert(ADart!=NULL);
205
return
static_cast<
TCoordinate
*
>
(ADart->
getDirectInfo
(ADirectInfoIndex));
206
}
207
//******************************************************************************
208
}
// namespace GMap3d
209
//******************************************************************************
lib-gmapkernel
g-map-vertex
gmv-inline.icc
Generated on Tue Apr 9 2013 09:51:35 for Moka kernel by
1.8.2