Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hurstel
CGoGN
Commits
b5d8570a
Commit
b5d8570a
authored
Apr 03, 2013
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming a namespace for volumetric decimation
parent
d5ff9c22
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
465 additions
and
42 deletions
+465
-42
include/Algo/DecimationVolumes/approximator.h
include/Algo/DecimationVolumes/approximator.h
+3
-3
include/Algo/DecimationVolumes/decimator.h
include/Algo/DecimationVolumes/decimator.h
+3
-3
include/Algo/DecimationVolumes/decimator.hpp
include/Algo/DecimationVolumes/decimator.hpp
+5
-5
include/Algo/DecimationVolumes/edgeSelector.h
include/Algo/DecimationVolumes/edgeSelector.h
+3
-3
include/Algo/DecimationVolumes/edgeSelector.hpp
include/Algo/DecimationVolumes/edgeSelector.hpp
+3
-3
include/Algo/DecimationVolumes/geometryApproximator.h
include/Algo/DecimationVolumes/geometryApproximator.h
+3
-3
include/Algo/DecimationVolumes/geometryApproximator.hpp
include/Algo/DecimationVolumes/geometryApproximator.hpp
+3
-3
include/Algo/DecimationVolumes/operator.h
include/Algo/DecimationVolumes/operator.h
+3
-3
include/Algo/DecimationVolumes/operator.hpp
include/Algo/DecimationVolumes/operator.hpp
+3
-3
include/Algo/DecimationVolumes/selector.h
include/Algo/DecimationVolumes/selector.h
+3
-3
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
+9
-9
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
+1
-1
include/Algo/Multiresolution/Map3MR/map3MR_PM.h
include/Algo/Multiresolution/Map3MR/map3MR_PM.h
+125
-0
include/Algo/Multiresolution/Map3MR/map3MR_PM.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PM.hpp
+298
-0
No files found.
include/Algo/DecimationVolumes/approximator.h
View file @
b5d8570a
...
...
@@ -37,7 +37,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
enum
ApproximatorType
...
...
@@ -144,9 +144,9 @@ public:
};
}
// namespace Decimation
Volumes
}
// namespace Decimation
}
}
// namespace Volume
}
// namespace Algo
...
...
include/Algo/DecimationVolumes/decimator.h
View file @
b5d8570a
...
...
@@ -39,7 +39,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
template
<
typename
PFP
>
...
...
@@ -51,9 +51,9 @@ void decimate(
unsigned
int
percentWantedVertices
);
}
//namespace Decimation
Volumes
}
//namespace Decimation
}
}
//namesapce Volume
}
//namespace Algo
...
...
include/Algo/DecimationVolumes/decimator.hpp
View file @
b5d8570a
...
...
@@ -31,7 +31,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
template
<
typename
PFP
>
...
...
@@ -56,10 +56,10 @@ void decimate(typename PFP::MAP& map, SelectorType s, ApproximatorType a,
switch
(
s
)
{
case
S_MapOrder
:
selector
=
new
Algo
::
DecimationVolumes
::
EdgeSelector_MapOrder
<
PFP
>
(
map
,
position
,
approximators
)
;
selector
=
new
Algo
::
Volume
::
Decimation
::
EdgeSelector_MapOrder
<
PFP
>
(
map
,
position
,
approximators
)
;
break
;
case
S_Random
:
selector
=
new
Algo
::
DecimationVolumes
::
EdgeSelector_Random
<
PFP
>
(
map
,
position
,
approximators
)
;
selector
=
new
Algo
::
Volume
::
Decimation
::
EdgeSelector_Random
<
PFP
>
(
map
,
position
,
approximators
)
;
break
;
default:
CGoGNout
<<
"not yet implemented"
<<
CGoGNendl
;
...
...
@@ -122,9 +122,9 @@ void decimate(typename PFP::MAP& map, SelectorType s, ApproximatorType a,
delete
(
*
it
)
;
}
}
//namespace Decimation
Volumes
}
//namespace Decimation
}
}
//namespace Volume
}
//namespace Algo
...
...
include/Algo/DecimationVolumes/edgeSelector.h
View file @
b5d8570a
...
...
@@ -15,7 +15,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
/*
...
...
@@ -186,9 +186,9 @@ public:
}
//end namespace Decimation
Volumes
}
//end namespace Decimation
}
}
//namespace Volume
}
//end namespace Algo
...
...
include/Algo/DecimationVolumes/edgeSelector.hpp
View file @
b5d8570a
...
...
@@ -35,7 +35,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
/************************************************************************************
* MAP ORDER *
...
...
@@ -323,7 +323,7 @@ void EdgeSelector_SG98<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
// einfo.valid = true ;
}
}
//end namespace Decimation
Volumique
}
}
//end namespace Decimation
}
//namespace Volume
}
//end namespace Algo
}
//end namespace CGoGN
include/Algo/DecimationVolumes/geometryApproximator.h
View file @
b5d8570a
...
...
@@ -36,7 +36,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
template
<
typename
PFP
>
...
...
@@ -78,9 +78,9 @@ public:
}
;
}
//namespace Decimation
Volumes
}
//namespace Decimation
}
}
//namespace Volume
}
//namespace Algo
...
...
include/Algo/DecimationVolumes/geometryApproximator.hpp
View file @
b5d8570a
...
...
@@ -34,7 +34,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
/************************************************************************************
...
...
@@ -122,9 +122,9 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d)
// }
}
}
//end namespace Decimation
Volumes
}
//end namespace Decimation
}
}
//namespace Volume
}
//end namespace Algo
...
...
include/Algo/DecimationVolumes/operator.h
View file @
b5d8570a
...
...
@@ -37,7 +37,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
enum
OperatorType
...
...
@@ -179,9 +179,9 @@ public:
};
}
//end namespace Decimation
Volumes
}
//end namespace Decimation
}
}
//namespace Volume
}
//end namespace Algo
...
...
include/Algo/DecimationVolumes/operator.hpp
View file @
b5d8570a
...
...
@@ -31,7 +31,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
/************************************************************************************
...
...
@@ -161,9 +161,9 @@ void OperatorList<PFP>::refine(VertexAttribute<typename PFP::VEC3>& position)
}
}
//end namespace Decimation
Volumes
}
//end namespace Decimation
}
}
//namespace Volume
}
//end namespace Algo
...
...
include/Algo/DecimationVolumes/selector.h
View file @
b5d8570a
...
...
@@ -13,7 +13,7 @@ namespace Algo
namespace
Volume
{
namespace
Decimation
Volumes
namespace
Decimation
{
enum
SelectorType
...
...
@@ -62,9 +62,9 @@ public:
virtual
void
updateWithoutCollapse
()
=
0
;
};
}
//end namespace Decimation
Volumes
}
//end namespace Decimation
}
}
//namespace Volume
}
//end namespace Algo
...
...
include/Algo/Multiresolution/Map2MR/map2MR_PM.h
View file @
b5d8570a
...
...
@@ -65,14 +65,14 @@ private:
bool
m_initOk
;
Algo
::
Decimation
::
EdgeSelector
<
PFP
>*
m_selector
;
std
::
vector
<
Algo
::
Decimation
::
ApproximatorGen
<
PFP
>*>
m_approximators
;
std
::
vector
<
Algo
::
Decimation
::
PredictorGen
<
PFP
>*>
m_predictors
;
Algo
::
Surface
::
Decimation
::
EdgeSelector
<
PFP
>*
m_selector
;
std
::
vector
<
Algo
::
Surface
::
Decimation
::
ApproximatorGen
<
PFP
>*>
m_approximators
;
std
::
vector
<
Algo
::
Surface
::
Decimation
::
PredictorGen
<
PFP
>*>
m_predictors
;
Algo
::
Decimation
::
Approximator
<
PFP
,
VEC3
>*
m_positionApproximator
;
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP
,
VEC3
,
EDGE
>*
m_positionApproximator
;
std
::
vector
<
Filter
*>
synthesisFilters
;
std
::
vector
<
Filter
*>
analysisFilters
;
std
::
vector
<
Algo
::
MR
::
Filter
*>
synthesisFilters
;
std
::
vector
<
Algo
::
MR
::
Filter
*>
analysisFilters
;
public:
Map2MR_PM
(
MAP
&
map
,
VertexAttribute
<
VEC3
>&
position
);
...
...
@@ -80,7 +80,7 @@ public:
~
Map2MR_PM
();
//create a progressive mesh (a coarser level)
void
createPM
(
Algo
::
Decimation
::
SelectorType
s
,
Algo
::
Decimation
::
ApproximatorType
a
)
;
void
createPM
(
Algo
::
Surface
::
Decimation
::
SelectorType
s
,
Algo
::
Surface
::
Decimation
::
ApproximatorType
a
)
;
void
addNewLevel
(
unsigned
int
percentWantedVertices
);
...
...
@@ -94,8 +94,8 @@ public:
bool
initOk
()
{
return
m_initOk
;
}
void
addSynthesisFilter
(
Filter
*
f
)
{
synthesisFilters
.
push_back
(
f
)
;
}
void
addAnalysisFilter
(
Filter
*
f
)
{
analysisFilters
.
push_back
(
f
)
;
}
void
addSynthesisFilter
(
Algo
::
MR
::
Filter
*
f
)
{
synthesisFilters
.
push_back
(
f
)
;
}
void
addAnalysisFilter
(
Algo
::
MR
::
Filter
*
f
)
{
analysisFilters
.
push_back
(
f
)
;
}
void
clearSynthesisFilters
()
{
synthesisFilters
.
clear
()
;
}
void
clearAnalysisFilters
()
{
analysisFilters
.
clear
()
;
}
...
...
include/Algo/Multiresolution/Map2MR/map2MR_PM.hpp
View file @
b5d8570a
...
...
@@ -123,7 +123,7 @@ void Map2MR_PM<PFP>::createPM(Algo::Surface::Decimation::SelectorType s, Algo::S
if
(
!
(
*
it
)
->
init
())
m_initOk
=
false
;
if
((
*
it
)
->
getApproximatedAttributeName
()
==
"position"
)
m_positionApproximator
=
reinterpret_cast
<
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP
,
VEC3
>*>
(
*
it
)
;
m_positionApproximator
=
reinterpret_cast
<
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP
,
VEC3
,
EDGE
>*>
(
*
it
)
;
}
CGoGNout
<<
"..done"
<<
CGoGNendl
;
...
...
include/Algo/Multiresolution/Map3MR/map3MR_PM.h
0 → 100644
View file @
b5d8570a
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __MAP3MR_PM__
#define __MAP3MR_PM__
#include "Topology/map/embeddedMap3.h"
#include "Topology/generic/traversorCell.h"
#include "Topology/generic/traversor3.h"
#include "Container/attributeContainer.h"
#include "Algo/DecimationVolumes/selector.h"
#include "Algo/DecimationVolumes/edgeSelector.h"
#include "Algo/DecimationVolumes/geometryApproximator.h"
#include "Algo/Multiresolution/filter.h"
namespace
CGoGN
{
namespace
Algo
{
namespace
Volume
{
namespace
MR
{
template
<
typename
PFP
>
class
Map3MR_PM
{
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
private:
MAP
&
m_map
;
VertexAttribute
<
VEC3
>&
m_position
;
bool
m_initOk
;
Algo
::
Volume
::
Decimation
::
EdgeSelector
<
PFP
>*
m_selector
;
std
::
vector
<
Algo
::
Volume
::
Decimation
::
ApproximatorGen
<
PFP
>*>
m_approximators
;
std
::
vector
<
Algo
::
Volume
::
Decimation
::
PredictorGen
<
PFP
>*>
m_predictors
;
Algo
::
Volume
::
Decimation
::
Approximator
<
PFP
,
VEC3
>*
m_positionApproximator
;
std
::
vector
<
Filter
*>
synthesisFilters
;
std
::
vector
<
Filter
*>
analysisFilters
;
public:
Map3MR_PM
(
MAP
&
map
,
VertexAttribute
<
VEC3
>&
position
);
~
Map3MR_PM
();
//create a progressive mesh (a coarser level)
void
createPM
(
Algo
::
Volume
::
Decimation
::
SelectorType
s
,
Algo
::
Volume
::
Decimation
::
ApproximatorType
a
)
;
void
addNewLevel
(
unsigned
int
percentWantedVertices
);
void
collapseEdge
(
Dart
d
);
//coarsen the mesh -> analysis
void
coarsen
()
;
//refine the mesh -> synthesis
void
refine
()
;
bool
initOk
()
{
return
m_initOk
;
}
void
addSynthesisFilter
(
Filter
*
f
)
{
synthesisFilters
.
push_back
(
f
)
;
}
void
addAnalysisFilter
(
Filter
*
f
)
{
analysisFilters
.
push_back
(
f
)
;
}
void
clearSynthesisFilters
()
{
synthesisFilters
.
clear
()
;
}
void
clearAnalysisFilters
()
{
analysisFilters
.
clear
()
;
}
/**
* Given the vertex of d in the current level,
* return a dart of from the vertex of the current level
*/
Dart
vertexOrigin
(
Dart
d
)
;
// /**
// * Return the level of the vertex of d in the current level map
// */
// unsigned int vertexLevel(Dart d);
}
;
}
// namespace Multiresolution
}
// namespace Surface
}
// namespace Algo
}
// namespace CGoGN
#include "Algo/Multiresolution/Map3MR/map3MR_PM.hpp"
#endif
include/Algo/Multiresolution/Map3MR/map3MR_PM.hpp
0 → 100644
View file @
b5d8570a
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Container/attributeMultiVector.h"
namespace
CGoGN
{
namespace
Algo
{
namespace
Volume
{
namespace
MR
{
template
<
typename
PFP
>
Map3MR_PM
<
PFP
>::
Map3MR_PM
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
:
m_map
(
map
),
m_position
(
position
)
{
}
template
<
typename
PFP
>
Map3MR_PM
<
PFP
>::~
Map3MR_PM
()
{
if
(
m_selector
)
delete
m_selector
;
for
(
typename
std
::
vector
<
Algo
::
Volume
::
Decimation
::
ApproximatorGen
<
PFP
>*>::
iterator
it
=
m_approximators
.
begin
();
it
!=
m_approximators
.
end
();
++
it
)
delete
(
*
it
)
;
for
(
typename
std
::
vector
<
Algo
::
Volume
::
Decimation
::
PredictorGen
<
PFP
>*>::
iterator
it
=
m_predictors
.
begin
();
it
!=
m_predictors
.
end
();
++
it
)
delete
(
*
it
)
;
}
template
<
typename
PFP
>
void
Map3MR_PM
<
PFP
>::
createPM
(
Algo
::
Volume
::
Decimation
::
SelectorType
s
,
Algo
::
Volume
::
Decimation
::
ApproximatorType
a
)
{
CGoGNout
<<
" creating approximator and predictor.."
<<
CGoGNflush
;
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*
>
pos_v
;
pos_v
.
push_back
(
&
m_position
)
;
switch
(
a
)
{
case
Algo
::
Volume
::
Decimation
::
A_QEM
:
{
m_approximators
.
push_back
(
new
Algo
::
Volume
::
Decimation
::
Approximator_QEM
<
PFP
>
(
m_map
,
pos_v
))
;
break
;
}
case
Algo
::
Volume
::
Decimation
::
A_MidEdge
:
{
m_approximators
.
push_back
(
new
Algo
::
Volume
::
Decimation
::
Approximator_MidEdge
<
PFP
>
(
m_map
,
pos_v
))
;
break
;
}
case
Algo
::
Volume
::
Decimation
::
A_hHalfCollapse
:
{
Algo
::
Volume
::
Decimation
::
Predictor_HalfCollapse
<
PFP
>*
pred
=
new
Algo
::
Volume
::
Decimation
::
Predictor_HalfCollapse
<
PFP
>
(
m_map
,
m_position
)
;
m_predictors
.
push_back
(
pred
)
;
m_approximators
.
push_back
(
new
Algo
::
Volume
::
Decimation
::
Approximator_HalfCollapse
<
PFP
>
(
m_map
,
pos_v
,
pred
))
;
break
;
}
}
CGoGNout
<<
"..done"
<<
CGoGNendl
;
CGoGNout
<<
" creating selector.."
<<
CGoGNflush
;
switch
(
s
)
{
case
Algo
::
Volume
::
Decimation
::
S_MapOrder
:
{
m_selector
=
new
Algo
::
Volume
::
Decimation
::
EdgeSelector_MapOrder
<
PFP
>
(
m_map
,
m_position
,
m_approximators
)
;
break
;
}
case
Algo
::
Volume
::
Decimation
::
S_Random
:
{
m_selector
=
new
Algo
::
Volume
::
Decimation
::
EdgeSelector_Random
<
PFP
>
(
m_map
,
m_position
,
m_approximators
)
;
break
;
}
case
Algo
::
Volume
::
Decimation
::
S_EdgeLength
:
{
m_selector
=
new
Algo
::
Volume
::
Decimation
::
EdgeSelector_Length
<
PFP
>
(
m_map
,
m_position
,
m_approximators
)
;
break
;
}
}
CGoGNout
<<
"..done"
<<
CGoGNendl
;
m_initOk
=
true
;
CGoGNout
<<
" initializing approximators.."
<<
CGoGNflush
;
for
(
typename
std
::
vector
<
Algo
::
Volume
::
Decimation
::
ApproximatorGen
<
PFP
>*>::
iterator
it
=
m_approximators
.
begin
();
it
!=
m_approximators
.
end
();
++
it
)
{
if
(
!
(
*
it
)
->
init
())
m_initOk
=
false
;
if
((
*
it
)
->
getApproximatedAttributeName
()
==
"position"
)
m_positionApproximator
=
reinterpret_cast
<
Algo
::
Volume
::
Decimation
::
Approximator
<
PFP
,
VEC3
>*>
(
*
it
)
;
}
CGoGNout
<<
"..done"
<<
CGoGNendl
;
CGoGNout
<<
" initializing predictors.."
<<
CGoGNflush
;
for
(
typename
std
::
vector
<
Algo
::
Volume
::
Decimation
::
PredictorGen
<
PFP
>*>::
iterator
it
=
m_predictors
.
begin
();
it
!=
m_predictors
.
end
();
++
it
)
if
(
!
(
*
it
)
->
init
())
m_initOk
=
false
;
CGoGNout
<<
"..done"
<<
CGoGNendl
;
}
template
<
typename
PFP
>
void
Map3MR_PM
<
PFP
>::
addNewLevel
(
unsigned
int
percentWantedVertices
)
{
unsigned
int
nbVertices
=
m_map
.
template
getNbOrbits
<
VERTEX
>()
;
unsigned
int
nbWantedVertices
=
nbVertices
*
percentWantedVertices
/
100
;
unsigned
int
nbDeletedVertex
=
0
;
unsigned
int
percentWantedPerLevel
=
50
;
//unsigned int nbWantedPerLevel = nbWantedVertices * percentWantedPerLevel / 100 ;
unsigned
int
nbWantedPerLevel
=
nbVertices
*
percentWantedPerLevel
/
100
;
CGoGNout
<<
" initializing selector.."
<<
CGoGNflush
;
m_initOk
=
m_selector
->
init
()
;
CGoGNout
<<
"..done"
<<
CGoGNendl
;
std
::
vector
<
Dart
>
edges
;
edges
.
reserve
(
nbWantedPerLevel
);
std
::
cout
<<
"stops at : "
<<
nbWantedPerLevel
<<
std
::
endl
;
DartMarkerStore
me
(
m_map
);
//mark edges not to collapse
bool
finished
=
false
;
Dart
d
;
while
(
!
finished
)
{
if
(
!
m_selector
->
nextEdge
(
d
))
break
;
if
(
!
me
.
isMarked
(
d
))
{
//Mark le 1 voisinage
Dart
dt
=
d
;
do
{
Traversor3VE
<
typename
PFP
::
MAP
>
tf
(
m_map
,
dt
)
;
for
(
Dart
it
=
tf
.
begin
();
it
!=
tf
.
end
();
it
=
tf
.
next
())
{
me
.
markOrbit
<
EDGE
>
(
it
);
me
.
markOrbit
<
EDGE
>
(
m_map
.
phi1
(
it
));
}
dt
=
m_map
.
phi1
(
dt
);
}
while
(
dt
!=
d
);
Traversor3VE
<
typename
PFP
::
MAP
>
tf
(
m_map
,
m_map
.
phi_1
(
m_map
.
phi2
(
d
)))
;
for
(
Dart
it
=
tf
.
begin
();
it
!=
tf
.
end
();
it
=
tf
.
next
())
{
me
.
markOrbit
<
EDGE
>
(
it
);
me
.
markOrbit
<
EDGE
>
(
m_map
.
phi1
(
it
));
}
++
nbDeletedVertex
;
edges
.
push_back
(
d
);
}
m_selector
->
updateWithoutCollapse
();
if
(
nbDeletedVertex
>=
nbWantedPerLevel
)
finished
=
true
;
}
std
::
cout
<<
"nbDeletedVertices : "
<<
nbDeletedVertex
<<
std
::
endl
;
if
(
!
edges
.
empty
())
{
//create the new level
m_map
.
addLevelFront
();
m_map
.
setCurrentLevel
(
0
);
AttributeContainer
&
attribs
=
m_map
.
getMRAttributeContainer
();
AttributeMultiVector
<
unsigned
int
>*
attribLevel
=
m_map
.
getMRLevelAttributeVector
();
AttributeMultiVector
<
unsigned
int
>*
attribDarts
=
m_map
.
getMRDartAttributeVector
(
0
);
for
(
unsigned
int
i
=
attribs
.
begin
();
i
!=
attribs
.
end
();
attribs
.
next
(
i
))
{
if
((
*
attribDarts
)[
i
]
==
MRNULL
)
++
(
*
attribLevel
)[
i
];
}
for
(
std
::
vector
<
Dart
>::
iterator
it
=
edges
.
begin
()
;
it
!=
edges
.
end
()
;
++
it
)
{
collapseEdge
(
*
it
);
}
}
//m_map.printMR();
}