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-thickening.cc
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 "
g-map-vertex.hh
"
26
using namespace
GMap3d;
27
//******************************************************************************
28
#define DUP1(D) (getDirectInfoAsDart(D, directInfoIndex1))
29
#define DUP2(D) (getDirectInfoAsDart(D, directInfoIndex2))
30
//******************************************************************************
31
int
CGMapVertex::thickenMarkedDarts
(
int
AMarkNumber,
TCoordinate
AExtrusionCoef)
32
{
33
int
directInfoIndex1 =
getNewDirectInfo
();
34
int
directInfoIndex2 =
getNewDirectInfo
();
35
36
// Topologie:
37
int
nbThickened =
38
CGMapGeneric::thickenMarkedDarts
(AMarkNumber,
39
directInfoIndex1, directInfoIndex2);
40
41
if
(nbThickened>0)
42
{
43
// Géométrie:
44
CDynamicCoverageAll
it(
this
);
45
int
treated =
getNewMark
();
46
int
exterior =
getNewMark
();
47
48
// Marquage des brins "extérieurs" des objets épaissis
49
// (1 brin sur 2, ces objets étant toujours orientables)
50
for
(; it.
cont
(); ++it)
51
if
(!
isMarked
(*it, treated) &&
isMarked
(*it, AMarkNumber))
52
{
53
if
(!
isMarked
(
DUP1
(*it), treated))
54
{
55
halfMarkOrbit
(
DUP1
(*it),
ORBIT_CC
, exterior);
56
markOrbit
(
DUP1
(*it),
ORBIT_CC
, treated);
57
markCopy
(exterior, 2);
58
}
59
60
markOrbit
(
DUP2
(*it),
ORBIT_CC
, treated);
61
markOrbit
( *it ,
ORBIT_CC
, treated);
62
setMark
(*it, treated);
63
}
64
65
negateMaskMark
(treated);
66
67
// 1) Première passe:
68
for
(it.
reinit
(); it.
cont
(); ++it)
69
if
(
isMarked
(*it, AMarkNumber) &&
isMarked
(
DUP1
(*it), exterior) &&
70
!
isMarked
(
DUP1
(*it), treated))
71
{
72
*
findVertex
(
DUP1
(*it)) +=
73
AExtrusionCoef *
regionNormalVector
(*it, 0);
74
75
markOrbit
(
DUP1
(*it),
ORBIT_VERTEX
, treated);
76
}
77
78
// 2) Deuxième passe:
79
for
(it.
reinit
(); it.
cont
(); ++it)
80
if
(
isMarked
(*it, AMarkNumber) &&
isMarked
(
DUP1
(*it), exterior) &&
81
!
isMarked
(
DUP2
(*it), treated))
82
{
83
*
findVertex
(
DUP2
(*it)) -=
84
AExtrusionCoef *
regionNormalVector
(*it, 0);
85
86
markOrbit
(
DUP2
(*it),
ORBIT_VERTEX
, treated);
87
}
88
89
// 3) Traitement des brins isolés:
90
for
(it.
reinit
(); it.
cont
(); ++it)
91
if
(
isMarked
(*it, AMarkNumber) && !
isMarked
(
DUP1
(*it), exterior) &&
92
!
isMarked
(
DUP1
(*it), treated))
93
{
94
*
findVertex
(
DUP1
(*it)) +=
95
AExtrusionCoef *
regionNormalVector
(*it, 0);
96
97
markOrbit
(
DUP1
(*it),
ORBIT_VERTEX
, treated);
98
}
99
100
for
(it.
reinit
(); it.
cont
(); ++it)
101
if
(
isMarked
(*it, AMarkNumber) && !
isMarked
(
DUP2
(*it), exterior) &&
102
!
isMarked
(
DUP2
(*it), treated))
103
{
104
*
findVertex
(
DUP2
(*it)) -=
105
AExtrusionCoef *
regionNormalVector
(*it, 0);
106
107
markOrbit
(
DUP2
(*it),
ORBIT_VERTEX
, treated);
108
}
109
110
unmarkAll
(exterior);
freeMark
(exterior);
111
unmarkAll
(treated );
freeMark
(treated );
112
}
113
114
freeDirectInfo
(directInfoIndex1);
115
freeDirectInfo
(directInfoIndex2);
116
117
return
nbThickened;
118
}
119
//******************************************************************************
120
#undef DUP1
121
#undef DUP2
122
//******************************************************************************
lib-gmapkernel
g-map-vertex
gmv-thickening.cc
Generated on Tue Apr 9 2013 09:51:35 for Moka kernel by
1.8.2