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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
3b07d12b
Commit
3b07d12b
authored
Oct 05, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of cgogn:~sauvage/CGoGN
parents
6a89ea6c
c416716f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
675 additions
and
28 deletions
+675
-28
include/Algo/Geometry/voronoiDiagrams.h
include/Algo/Geometry/voronoiDiagrams.h
+9
-5
include/Algo/Geometry/voronoiDiagrams.hpp
include/Algo/Geometry/voronoiDiagrams.hpp
+75
-19
include/Algo/Selection/collector.h
include/Algo/Selection/collector.h
+175
-0
include/Algo/Selection/collector.hpp
include/Algo/Selection/collector.hpp
+416
-4
No files found.
include/Algo/Geometry/voronoiDiagrams.h
View file @
3b07d12b
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
#include <vector>
#include <vector>
#include <map>
#include <map>
#include <set>
//#include "Topology/map/map2.h"
#include "Topology/generic/traversor2.h"
#include "Topology/generic/traversor2.h"
namespace
CGoGN
namespace
CGoGN
...
@@ -45,12 +47,13 @@ public :
...
@@ -45,12 +47,13 @@ public :
~
VoronoiDiagram
();
~
VoronoiDiagram
();
const
std
::
vector
<
Dart
>&
getSeeds
(){
return
seeds
;}
const
std
::
vector
<
Dart
>&
getSeeds
(){
return
seeds
;}
virtual
void
setSeeds
(
const
std
::
vector
<
Dart
>&
);
virtual
void
setSeeds
_fromVector
(
const
std
::
vector
<
Dart
>&
);
virtual
void
set
RandomSeeds
(
unsigned
int
nbseeds
);
virtual
void
set
Seeds_random
(
unsigned
int
nbseeds
);
const
std
::
vector
<
Dart
>&
getBorder
(){
return
border
;}
const
std
::
vector
<
Dart
>&
getBorder
(){
return
border
;}
void
setCost
(
const
EdgeAttribute
<
REAL
>&
c
);
void
setCost
(
const
EdgeAttribute
<
REAL
>&
c
);
void
computeDiagram
();
Dart
computeDiagram
();
virtual
void
computeDiagram_incremental
(
unsigned
int
nbseeds
);
void
computeDistancesWithinRegion
(
Dart
seed
);
void
computeDistancesWithinRegion
(
Dart
seed
);
protected
:
protected
:
...
@@ -84,8 +87,9 @@ public :
...
@@ -84,8 +87,9 @@ public :
VertexAttribute
<
REAL
>&
a
);
VertexAttribute
<
REAL
>&
a
);
~
CentroidalVoronoiDiagram
();
~
CentroidalVoronoiDiagram
();
void
setSeeds
(
const
std
::
vector
<
Dart
>&
);
void
setSeeds_fromVector
(
const
std
::
vector
<
Dart
>&
);
void
setRandomSeeds
(
unsigned
int
nbseeds
);
void
setSeeds_random
(
unsigned
int
nbseeds
);
void
computeDiagram_incremental
(
unsigned
int
nbseeds
);
void
cumulateEnergy
();
void
cumulateEnergy
();
void
cumulateEnergyAndGradients
();
void
cumulateEnergyAndGradients
();
unsigned
int
moveSeedsOneEdgeNoCheck
();
// returns the number of seeds that did move
unsigned
int
moveSeedsOneEdgeNoCheck
();
// returns the number of seeds that did move
...
...
include/Algo/Geometry/voronoiDiagrams.hpp
View file @
3b07d12b
...
@@ -33,29 +33,48 @@ void VoronoiDiagram<PFP>::clear ()
...
@@ -33,29 +33,48 @@ void VoronoiDiagram<PFP>::clear ()
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
VoronoiDiagram
<
PFP
>::
setSeeds
(
const
std
::
vector
<
Dart
>&
s
)
void
VoronoiDiagram
<
PFP
>::
setSeeds
_fromVector
(
const
std
::
vector
<
Dart
>&
s
)
{
{
seeds
.
clear
();
seeds
.
clear
();
seeds
=
s
;
seeds
=
s
;
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
VoronoiDiagram
<
PFP
>::
set
RandomSeeds
(
unsigned
int
nseeds
)
void
VoronoiDiagram
<
PFP
>::
set
Seeds_random
(
unsigned
int
nseeds
)
{
{
seeds
.
clear
();
seeds
.
clear
();
vmReached
.
unmarkAll
();
srand
(
time
(
NULL
)
);
srand
(
time
(
NULL
)
);
unsigned
int
n
=
nseeds
;
const
unsigned
int
nbv
=
map
.
getNbCells
(
VERTEX
);
while
(
n
>
0
)
{
// TODO : correct this random init which assumes contiguous Dart table
std
::
set
<
unsigned
int
>
myVertices
;;
Dart
d
=
rand
()
%
map
.
getNbDarts
()
;
while
(
myVertices
.
size
()
<
nseeds
)
if
(
!
vmReached
.
isMarked
(
d
))
{
myVertices
.
insert
(
rand
()
%
nbv
);
}
std
::
set
<
unsigned
int
>::
iterator
it
=
myVertices
.
begin
();
unsigned
int
n
=
0
;
TraversorV
<
typename
PFP
::
MAP
>
tv
(
map
);
Dart
dit
=
tv
.
begin
();
while
(
it
!=
myVertices
.
end
())
{
while
(
n
<*
it
)
{
{
vmReached
.
mark
(
d
);
dit
=
tv
.
next
();
seeds
.
push_back
(
d
);
++
n
;
n
--
;
}
}
seeds
.
push_back
(
dit
);
it
++
;
}
// random permutation = un-sort the seeds
for
(
unsigned
int
i
=
0
;
i
<
nseeds
;
i
++
)
{
unsigned
int
j
=
i
+
rand
()
%
(
nseeds
-
i
);
Dart
d
=
seeds
[
i
];
seeds
[
i
]
=
seeds
[
j
];
seeds
[
j
]
=
d
;
}
}
}
}
...
@@ -109,13 +128,14 @@ void VoronoiDiagram<PFP>::updateVertexInFront(Dart f, float d){
...
@@ -109,13 +128,14 @@ void VoronoiDiagram<PFP>::updateVertexInFront(Dart f, float d){
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
VoronoiDiagram
<
PFP
>::
computeDiagram
()
Dart
VoronoiDiagram
<
PFP
>::
computeDiagram
()
{
{
initFrontWithSeeds
();
initFrontWithSeeds
();
Dart
e
;
while
(
!
front
.
empty
()
)
while
(
!
front
.
empty
()
)
{
{
Dart
e
=
front
.
begin
()
->
second
;
e
=
front
.
begin
()
->
second
;
float
d
=
front
.
begin
()
->
first
;
float
d
=
front
.
begin
()
->
first
;
collectVertexFromFront
(
e
);
collectVertexFromFront
(
e
);
...
@@ -136,6 +156,35 @@ void VoronoiDiagram<PFP>::computeDiagram ()
...
@@ -136,6 +156,35 @@ void VoronoiDiagram<PFP>::computeDiagram ()
}
}
}
}
}
}
return
e
;
}
template
<
typename
PFP
>
void
VoronoiDiagram
<
PFP
>::
computeDiagram_incremental
(
unsigned
int
nseeds
)
{
seeds
.
clear
();
// first seed
srand
(
time
(
NULL
)
);
unsigned
int
s
=
rand
()
%
map
.
getNbCells
(
VERTEX
);
unsigned
int
n
=
0
;
TraversorV
<
typename
PFP
::
MAP
>
tv
(
map
);
Dart
dit
=
tv
.
begin
();
while
(
n
<
s
)
{
dit
=
tv
.
next
();
++
n
;
}
seeds
.
push_back
(
dit
);
// add other seeds one by one
Dart
e
=
computeDiagram
();
for
(
unsigned
int
i
=
1
;
i
<
nseeds
;
i
++
)
{
seeds
.
push_back
(
e
);
e
=
computeDiagram
();
}
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
...
@@ -205,16 +254,23 @@ void CentroidalVoronoiDiagram<PFP>::collectVertexFromFront(Dart e){
...
@@ -205,16 +254,23 @@ void CentroidalVoronoiDiagram<PFP>::collectVertexFromFront(Dart e){
template
<
typename
PFP
>
template
<
typename
PFP
>
void
CentroidalVoronoiDiagram
<
PFP
>::
setSeeds
(
const
std
::
vector
<
Dart
>&
s
)
void
CentroidalVoronoiDiagram
<
PFP
>::
setSeeds_fromVector
(
const
std
::
vector
<
Dart
>&
s
)
{
VoronoiDiagram
<
PFP
>::
setSeeds_fromVector
(
s
);
energyGrad
.
resize
(
this
->
seeds
.
size
());
}
template
<
typename
PFP
>
void
CentroidalVoronoiDiagram
<
PFP
>::
setSeeds_random
(
unsigned
int
nseeds
)
{
{
VoronoiDiagram
<
PFP
>::
setSeeds
(
s
);
VoronoiDiagram
<
PFP
>::
setSeeds
_random
(
nseed
s
);
energyGrad
.
resize
(
this
->
seeds
.
size
());
energyGrad
.
resize
(
this
->
seeds
.
size
());
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
void
CentroidalVoronoiDiagram
<
PFP
>::
setRandomSeeds
(
unsigned
int
nseeds
)
void
CentroidalVoronoiDiagram
<
PFP
>::
computeDiagram_incremental
(
unsigned
int
nseeds
)
{
{
VoronoiDiagram
<
PFP
>::
setRandomSeeds
(
nseeds
);
VoronoiDiagram
<
PFP
>::
computeDiagram_incremental
(
nseeds
);
energyGrad
.
resize
(
this
->
seeds
.
size
());
energyGrad
.
resize
(
this
->
seeds
.
size
());
}
}
...
@@ -259,7 +315,6 @@ unsigned int CentroidalVoronoiDiagram<PFP>::moveSeedsOneEdgeNoCheck(){
...
@@ -259,7 +315,6 @@ unsigned int CentroidalVoronoiDiagram<PFP>::moveSeedsOneEdgeNoCheck(){
template
<
typename
PFP
>
template
<
typename
PFP
>
unsigned
int
CentroidalVoronoiDiagram
<
PFP
>::
moveSeedsOneEdgeCheck
(){
unsigned
int
CentroidalVoronoiDiagram
<
PFP
>::
moveSeedsOneEdgeCheck
(){
// TODO : probable bug (memoire ?) car les iterations ralentissent inexplicablement
unsigned
int
m
=
0
;
unsigned
int
m
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
this
->
seeds
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
this
->
seeds
.
size
();
i
++
)
{
{
...
@@ -334,6 +389,7 @@ typename PFP::REAL CentroidalVoronoiDiagram<PFP>::cumulateEnergyFromRoot(Dart e)
...
@@ -334,6 +389,7 @@ typename PFP::REAL CentroidalVoronoiDiagram<PFP>::cumulateEnergyFromRoot(Dart e)
template
<
typename
PFP
>
template
<
typename
PFP
>
void
CentroidalVoronoiDiagram
<
PFP
>::
cumulateEnergyAndGradientFromSeed
(
unsigned
int
numSeed
){
void
CentroidalVoronoiDiagram
<
PFP
>::
cumulateEnergyAndGradientFromSeed
(
unsigned
int
numSeed
){
// precondition : energyGrad.size() > numSeed
Dart
e
=
this
->
seeds
[
numSeed
];
Dart
e
=
this
->
seeds
[
numSeed
];
std
::
vector
<
Dart
>
v
;
std
::
vector
<
Dart
>
v
;
...
...
include/Algo/Selection/collector.h
View file @
3b07d12b
...
@@ -139,6 +139,7 @@ public:
...
@@ -139,6 +139,7 @@ public:
* collect all primitives of the connected component containing "centerDart"
* collect all primitives of the connected component containing "centerDart"
* within the sphere of radius "radius" and center "position[centerDart]"
* within the sphere of radius "radius" and center "position[centerDart]"
* (hopefully) it defines a 2-manifold (if inserting border-vertices along the border-edges)
* (hopefully) it defines a 2-manifold (if inserting border-vertices along the border-edges)
* NB : is equivalent to Collector_Vertices with CollectorCriterion_VertexWithinSphere
*/
*/
template
<
typename
PFP
>
template
<
typename
PFP
>
class
Collector_WithinSphere
:
public
Collector
<
PFP
>
class
Collector_WithinSphere
:
public
Collector
<
PFP
>
...
@@ -174,6 +175,7 @@ public:
...
@@ -174,6 +175,7 @@ public:
* collect all primitives of the connected component containing "centerDart"
* collect all primitives of the connected component containing "centerDart"
* the angle between the included vertices normal vectors and the central normal vector
* the angle between the included vertices normal vectors and the central normal vector
* stays under a given threshold
* stays under a given threshold
* NB : is equivalent to Collector_Vertices with CollectorCriterion_VertexNormalAngle
*/
*/
template
<
typename
PFP
>
template
<
typename
PFP
>
class
Collector_NormalAngle
:
public
Collector
<
PFP
>
class
Collector_NormalAngle
:
public
Collector
<
PFP
>
...
@@ -198,6 +200,105 @@ public:
...
@@ -198,6 +200,105 @@ public:
void
collectBorder
(
Dart
d
)
;
void
collectBorder
(
Dart
d
)
;
};
};
/*********************************************************
* Collector Criterions
*********************************************************/
class
CollectorCriterion
{
public
:
CollectorCriterion
()
{};
virtual
void
init
(
Dart
center
)
=
0
;
virtual
bool
isInside
(
Dart
d
)
=
0
;
};
template
<
typename
PFP
>
class
CollectorCriterion_VertexNormalAngle
:
public
CollectorCriterion
{
// tests if the angle between vertex normals is below some threshold
private
:
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
const
VertexAttribute
<
VEC3
>
&
vertexNormals
;
REAL
threshold
;
VEC3
centerNormal
;
public
:
CollectorCriterion_VertexNormalAngle
(
const
VertexAttribute
<
VEC3
>
&
n
,
REAL
th
)
:
vertexNormals
(
n
),
threshold
(
th
),
centerNormal
(
0
)
{}
void
init
(
Dart
center
)
{
centerNormal
=
vertexNormals
[
center
];}
bool
isInside
(
Dart
d
)
{
return
(
Geom
::
angle
(
centerNormal
,
vertexNormals
[
d
])
<
threshold
);
}
};
template
<
typename
PFP
>
class
CollectorCriterion_TriangleNormalAngle
:
public
CollectorCriterion
{
// tests if the angle between vertex normals is below some threshold
private
:
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
const
FaceAttribute
<
VEC3
>
&
faceNormals
;
REAL
threshold
;
VEC3
centerNormal
;
public
:
CollectorCriterion_TriangleNormalAngle
(
const
FaceAttribute
<
VEC3
>
&
n
,
REAL
th
)
:
faceNormals
(
n
),
threshold
(
th
),
centerNormal
(
0
)
{}
void
init
(
Dart
center
)
{
centerNormal
=
faceNormals
[
center
];}
bool
isInside
(
Dart
d
)
{
return
(
Geom
::
angle
(
centerNormal
,
faceNormals
[
d
])
<
threshold
);
}
};
template
<
typename
PFP
>
class
CollectorCriterion_VertexWithinSphere
:
public
CollectorCriterion
{
// tests if the distance between vertices is below some threshold
private
:
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
const
VertexAttribute
<
VEC3
>
&
vertexPositions
;
REAL
threshold
;
VEC3
centerPosition
;
public
:
CollectorCriterion_VertexWithinSphere
(
const
VertexAttribute
<
VEC3
>
&
p
,
REAL
th
)
:
vertexPositions
(
p
),
threshold
(
th
),
centerPosition
(
0
)
{}
void
init
(
Dart
center
)
{
centerPosition
=
vertexPositions
[
center
];}
bool
isInside
(
Dart
d
)
{
return
(
vertexPositions
[
d
]
-
centerPosition
).
norm
()
<
threshold
;
}
};
/*********************************************************
* Collector Vertices
*********************************************************/
/*
* collect all vertices of the connected component containing "centerDart"
* within a distance to centerDart defined by the CollectorCriterion
* (hopefully) it defines a 2-manifold (if inserting border-vertices along the border-edges)
*/
template
<
typename
PFP
>
class
Collector_Vertices
:
public
Collector
<
PFP
>
{
protected:
CollectorCriterion
&
crit
;
public:
Collector_Vertices
(
typename
PFP
::
MAP
&
m
,
CollectorCriterion
&
c
,
unsigned
int
thread
=
0
)
:
Collector
<
PFP
>
(
m
,
thread
),
crit
(
c
)
{}
void
collectAll
(
Dart
d
);
void
collectBorder
(
Dart
d
);
};
/*********************************************************
/*********************************************************
* Collector Normal Angle (Triangles)
* Collector Normal Angle (Triangles)
*********************************************************/
*********************************************************/
...
@@ -206,6 +307,7 @@ public:
...
@@ -206,6 +307,7 @@ public:
* collect all primitives of the connected component containing "centerDart"
* collect all primitives of the connected component containing "centerDart"
* the angle between the included triangles normal vectors and the central normal vector
* the angle between the included triangles normal vectors and the central normal vector
* stays under a given threshold
* stays under a given threshold
* NB : is equivalent to Collector_Triangles with CollectorCriterion_TriangleNormalAngle
*/
*/
template
<
typename
PFP
>
template
<
typename
PFP
>
class
Collector_NormalAngle_Triangles
:
public
Collector
<
PFP
>
class
Collector_NormalAngle_Triangles
:
public
Collector
<
PFP
>
...
@@ -230,6 +332,78 @@ public:
...
@@ -230,6 +332,78 @@ public:
void
collectBorder
(
Dart
d
)
;
void
collectBorder
(
Dart
d
)
;
};
};
/*********************************************************
* Collector Triangles
*********************************************************/
/*
* collect all triangles of the connected component containing "centerDart"
* within a distance to centerDart defined by the CollectorCriterion
*/
template
<
typename
PFP
>
class
Collector_Triangles
:
public
Collector
<
PFP
>
{
protected:
CollectorCriterion
&
crit
;
public:
Collector_Triangles
(
typename
PFP
::
MAP
&
m
,
CollectorCriterion
&
c
,
unsigned
int
thread
=
0
)
:
Collector
<
PFP
>
(
m
,
thread
),
crit
(
c
)
{}
void
collectAll
(
Dart
d
)
;
void
collectBorder
(
Dart
d
)
;
};
/*********************************************************
* Collector Dijkstra_Vertices
*********************************************************/
/*
* collect all primitives of the connected component containing "centerDart"
* within a distance < maxDist (the shortest path follows edges)
* the edge length is specified in edge_cost attribute
*/
template
<
typename
PFP
>
class
Collector_Dijkstra_Vertices
:
public
Collector
<
PFP
>
{
protected:
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edge_cost
;
typename
PFP
::
REAL
maxDist
;
typedef
struct
{
typename
std
::
multimap
<
float
,
Dart
>::
iterator
it
;
bool
valid
;
static
std
::
string
CGoGNnameOfType
()
{
return
"DijkstraVertexInfo"
;
}
}
DijkstraVertexInfo
;
typedef
NoMathIOAttribute
<
DijkstraVertexInfo
>
VertexInfo
;
VertexAttribute
<
VertexInfo
>
vertexInfo
;
std
::
multimap
<
float
,
Dart
>
front
;
public:
Collector_Dijkstra_Vertices
(
typename
PFP
::
MAP
&
m
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
c
,
typename
PFP
::
REAL
d
=
0
,
unsigned
int
thread
=
0
)
:
Collector
<
PFP
>
(
m
,
thread
),
edge_cost
(
c
),
maxDist
(
d
)
{
vertexInfo
=
m
.
template
addAttribute
<
VertexInfo
,
VERTEX
>(
"vertexInfo"
);
}
~
Collector_Dijkstra_Vertices
(){
this
->
map
.
removeAttribute
(
vertexInfo
);
}
inline
void
init
(
Dart
d
)
{
Collector
<
PFP
>::
init
(
d
);
front
.
clear
();}
inline
void
setMaxDistance
(
typename
PFP
::
REAL
d
)
{
maxDist
=
d
;
}
inline
typename
PFP
::
REAL
getMaxDist
()
const
{
return
maxDist
;
}
void
collectAll
(
Dart
d
);
void
collectBorder
(
Dart
d
);
};
/*********************************************************
/*********************************************************
* Collector Dijkstra
* Collector Dijkstra
*********************************************************/
*********************************************************/
...
@@ -281,6 +455,7 @@ private :
...
@@ -281,6 +455,7 @@ private :
};
};
}
// namespace Selection
}
// namespace Selection
}
// namespace Algo
}
// namespace Algo
...
...
include/Algo/Selection/collector.hpp
View file @
3b07d12b
...
@@ -402,6 +402,121 @@ void Collector_NormalAngle<PFP>::collectBorder(Dart d)
...
@@ -402,6 +402,121 @@ void Collector_NormalAngle<PFP>::collectBorder(Dart d)
this->insideVertices.clear();
this->insideVertices.clear();
}
}
/*********************************************************
* Collector Vertices
*********************************************************/
template <typename PFP>
void Collector_Vertices<PFP>::collectAll(Dart d)
{
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
crit.init(d);
this->init(d);
this->insideEdges.reserve(32);
this->insideFaces.reserve(32);
this->border.reserve(32);
CellMarkerStore<VERTEX> vm(this->map, this->m_thread); // mark the collected inside-vertices
CellMarkerStore<EDGE> em(this->map, this->m_thread); // mark the collected inside-edges + border-edges
CellMarkerStore<FACE> fm(this->map, this->m_thread); // mark the collected inside-faces + border-faces
this->insideVertices.push_back(this->centerDart);
vm.mark(this->centerDart);
unsigned int i = 0;
while (i < this->insideVertices.size())
{
Dart end = this->insideVertices[i];
Dart e = end;
do
{
if (! em.isMarked(e) || ! fm.isMarked(e)) // are both tests useful ?
{
const Dart f = this->map.phi1(e);
const Dart g = this->map.phi1(f);
if (! crit.isInside(f))
{
this->border.push_back(e); // add to border
em.mark(e);
fm.mark(e); // is it useful ?
}
else
{
if (! vm.isMarked(f))
{
this->insideVertices.push_back(f);
vm.mark(f);
}
if (! em.isMarked(e))
{
this->insideEdges.push_back(e);
em.mark(e);
}
if (! fm.isMarked(e) && crit.isInside(g))
{
this->insideFaces.push_back(e);
fm.mark(e);
}
}
}
e = this->map.phi2_1(e);
} while (e != end);
++i;
}
}
template <typename PFP>
void Collector_Vertices<PFP>::collectBorder(Dart d)
{
typedef typename PFP::VEC3 VEC3;
typedef typename PFP::REAL REAL;
crit.init(d);
this->init(d);
this->border.reserve(128);
this->insideVertices.reserve(128);
CellMarkerStore<VERTEX> vm(this->map, this->m_thread); // mark the collected inside-vertices
CellMarkerStore<EDGE> em(this->map, this->m_thread); // mark the collected inside-edges + border-edges
this->insideVertices.push_back(this->centerDart);
vm.mark(this->centerDart);
unsigned int i = 0;
while (i < this->insideVertices.size())
{
Dart end = this->insideVertices[i];
Dart e = end;
do
{
if ( ! em.isMarked(e) )
{
const Dart f = this->map.phi1(e);
if (! crit.isInside(f))
{
this->border.push_back(e); // add to border
}
else
{
if (! vm.isMarked(f))
{
this->insideVertices.push_back(f);
vm.mark(f);
}
}
em.mark(e);
}
e = this->map.phi2_1(e);
} while (e != end);
++i;
}
this->insideVertices.clear();
}
/*********************************************************
/*********************************************************
* Collector Normal Angle (Triangles)
* Collector Normal Angle (Triangles)
...
@@ -553,6 +668,307 @@ void Collector_NormalAngle_Triangles<PFP>::collectBorder(Dart d)
...
@@ -553,6 +668,307 @@ void Collector_NormalAngle_Triangles<PFP>::collectBorder(Dart d)