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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
1666a619
Commit
1666a619
authored
May 28, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REAL/float
parent
70c5a48f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
CGoGN/include/Algo/Selection/collector.h
CGoGN/include/Algo/Selection/collector.h
+5
-5
CGoGN/include/Algo/Selection/collector.hpp
CGoGN/include/Algo/Selection/collector.hpp
+21
-21
No files found.
CGoGN/include/Algo/Selection/collector.h
View file @
1666a619
...
...
@@ -481,7 +481,7 @@ protected:
typedef
struct
{
typename
std
::
multimap
<
float
,
Dart
>::
iterator
it
;
typename
std
::
multimap
<
REAL
,
Dart
>::
iterator
it
;
bool
valid
;
static
std
::
string
CGoGNnameOfType
()
{
return
"DijkstraVertexInfo"
;
}
}
DijkstraVertexInfo
;
...
...
@@ -489,7 +489,7 @@ protected:
VertexAttribute
<
VertexInfo
,
MAP
>
vertexInfo
;
std
::
multimap
<
float
,
Dart
>
front
;
std
::
multimap
<
REAL
,
Dart
>
front
;
public:
Collector_Dijkstra_Vertices
(
MAP
&
m
,
const
EdgeAttribute
<
REAL
,
MAP
>&
c
,
REAL
d
=
0
)
:
...
...
@@ -532,7 +532,7 @@ protected:
typedef
struct
{
typename
std
::
multimap
<
float
,
Dart
>::
iterator
it
;
typename
std
::
multimap
<
REAL
,
Dart
>::
iterator
it
;
bool
valid
;
static
std
::
string
CGoGNnameOfType
()
{
return
"DijkstraVertexInfo"
;
}
}
DijkstraVertexInfo
;
...
...
@@ -540,7 +540,7 @@ protected:
VertexAttribute
<
VertexInfo
,
MAP
>
vertexInfo
;
std
::
multimap
<
float
,
Dart
>
front
;
std
::
multimap
<
REAL
,
Dart
>
front
;
public:
Collector_Dijkstra
(
MAP
&
m
,
const
VertexAttribute
<
VEC3
,
MAP
>&
p
,
REAL
d
=
0
)
:
...
...
@@ -563,7 +563,7 @@ public:
void
collectBorder
(
Dart
d
);
private
:
inline
float
edgeLength
(
Dart
d
);
inline
REAL
edgeLength
(
Dart
d
);
// inline Dart oppositeVertex (Dart d);
};
...
...
CGoGN/include/Algo/Selection/collector.hpp
View file @
1666a619
...
...
@@ -948,14 +948,14 @@ void Collector_Dijkstra_Vertices<PFP>::collectAll(Dart dinit)
this
->
isInsideCollected
=
true
;
CellMarkerStore
<
MAP
,
VERTEX
>
vmReached
(
this
->
map
);
vertexInfo
[
this
->
centerDart
].
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
0.0
,
this
->
centerDart
));
vertexInfo
[
this
->
centerDart
].
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
0.0
f
,
this
->
centerDart
));
vertexInfo
[
this
->
centerDart
].
valid
=
true
;
vmReached
.
mark
(
this
->
centerDart
);
while
(
!
front
.
empty
()
&&
front
.
begin
()
->
first
<
this
->
maxDist
)
{
Dart
e
=
front
.
begin
()
->
second
;
float
d
=
front
.
begin
()
->
first
;
REAL
d
=
front
.
begin
()
->
first
;
front
.
erase
(
vertexInfo
[
e
].
it
);
vertexInfo
[
e
].
valid
=
false
;
this
->
insideVertices
.
push_back
(
e
);
...
...
@@ -968,17 +968,17 @@ void Collector_Dijkstra_Vertices<PFP>::collectAll(Dart dinit)
{
if
(
vi
.
valid
)
// probably useless (because of distance test) but faster
{
float
dist
=
d
+
edge_cost
[
f
];
REAL
dist
=
d
+
edge_cost
[
f
];
if
(
dist
<
vi
.
it
->
first
)
{
front
.
erase
(
vi
.
it
);
vi
.
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
dist
,
f
));
vi
.
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
dist
,
f
));
}
}
}
else
{
vi
.
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
d
+
edge_cost
[
f
],
f
));
vi
.
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
d
+
edge_cost
[
f
],
f
));
vi
.
valid
=
true
;
vmReached
.
mark
(
f
);
}
...
...
@@ -1033,14 +1033,14 @@ void Collector_Dijkstra_Vertices<PFP>::collectBorder(Dart dinit)
init
(
dinit
);
CellMarkerStore
<
MAP
,
VERTEX
>
vmReached
(
this
->
map
);
vertexInfo
[
this
->
centerDart
].
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
0.0
,
this
->
centerDart
));
vertexInfo
[
this
->
centerDart
].
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
0.0
f
,
this
->
centerDart
));
vertexInfo
[
this
->
centerDart
].
valid
=
true
;
vmReached
.
mark
(
this
->
centerDart
);
while
(
!
front
.
empty
()
&&
front
.
begin
()
->
first
<
this
->
maxDist
)
{
Dart
e
=
front
.
begin
()
->
second
;
float
d
=
front
.
begin
()
->
first
;
REAL
d
=
front
.
begin
()
->
first
;
front
.
erase
(
vertexInfo
[
e
].
it
);
vertexInfo
[
e
].
valid
=
false
;
this
->
insideVertices
.
push_back
(
e
);
...
...
@@ -1053,17 +1053,17 @@ void Collector_Dijkstra_Vertices<PFP>::collectBorder(Dart dinit)
{
if
(
vi
.
valid
)
// probably useless (because of distance test) but faster
{
float
dist
=
d
+
edge_cost
[
f
];
REAL
dist
=
d
+
edge_cost
[
f
];
if
(
dist
<
vi
.
it
->
first
)
{
front
.
erase
(
vi
.
it
);
vi
.
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
dist
,
f
));
vi
.
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
dist
,
f
));
}
}
}
else
{
vi
.
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
d
+
edge_cost
[
f
],
f
));
vi
.
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
d
+
edge_cost
[
f
],
f
));
vi
.
valid
=
true
;
vmReached
.
mark
(
f
);
}
...
...
@@ -1107,14 +1107,14 @@ void Collector_Dijkstra<PFP>::collectAll(Dart dinit)
this
->
isInsideCollected
=
true
;
CellMarkerStore
<
MAP
,
VERTEX
>
vmReached
(
this
->
map
);
vertexInfo
[
this
->
centerDart
].
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
0.0
,
this
->
centerDart
));
vertexInfo
[
this
->
centerDart
].
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
0.0
f
,
this
->
centerDart
));
vertexInfo
[
this
->
centerDart
].
valid
=
true
;
vmReached
.
mark
(
this
->
centerDart
);
while
(
!
front
.
empty
()
&&
front
.
begin
()
->
first
<
this
->
maxDist
)
{
Dart
e
=
front
.
begin
()
->
second
;
float
d
=
front
.
begin
()
->
first
;
REAL
d
=
front
.
begin
()
->
first
;
front
.
erase
(
vertexInfo
[
e
].
it
);
vertexInfo
[
e
].
valid
=
false
;
this
->
insideVertices
.
push_back
(
e
);
...
...
@@ -1127,17 +1127,17 @@ void Collector_Dijkstra<PFP>::collectAll(Dart dinit)
{
if
(
vi
.
valid
)
// probably useless (because of distance test) but faster
{
float
dist
=
d
+
edgeLength
(
f
);
REAL
dist
=
d
+
edgeLength
(
f
);
if
(
dist
<
vi
.
it
->
first
)
{
front
.
erase
(
vi
.
it
);
vi
.
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
dist
,
f
));
vi
.
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
dist
,
f
));
}
}
}
else
{
vi
.
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
d
+
edgeLength
(
f
),
f
));
vi
.
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
d
+
edgeLength
(
f
),
f
));
vi
.
valid
=
true
;
vmReached
.
mark
(
f
);
}
...
...
@@ -1190,14 +1190,14 @@ void Collector_Dijkstra<PFP>::collectBorder(Dart dinit)
init
(
dinit
);
CellMarkerStore
<
MAP
,
VERTEX
>
vmReached
(
this
->
map
);
vertexInfo
[
this
->
centerDart
].
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
0.0
,
this
->
centerDart
));
vertexInfo
[
this
->
centerDart
].
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
0.0
f
,
this
->
centerDart
));
vertexInfo
[
this
->
centerDart
].
valid
=
true
;
vmReached
.
mark
(
this
->
centerDart
);
while
(
!
front
.
empty
()
&&
front
.
begin
()
->
first
<
this
->
maxDist
)
{
Dart
e
=
front
.
begin
()
->
second
;
float
d
=
front
.
begin
()
->
first
;
REAL
d
=
front
.
begin
()
->
first
;
front
.
erase
(
vertexInfo
[
e
].
it
);
vertexInfo
[
e
].
valid
=
false
;
this
->
insideVertices
.
push_back
(
e
);
...
...
@@ -1210,17 +1210,17 @@ void Collector_Dijkstra<PFP>::collectBorder(Dart dinit)
{
if
(
vi
.
valid
)
// probably useless (because of distance test) but faster
{
float
dist
=
d
+
edgeLength
(
f
);
REAL
dist
=
d
+
edgeLength
(
f
);
if
(
dist
<
vi
.
it
->
first
)
{
front
.
erase
(
vi
.
it
);
vi
.
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
dist
,
f
));
vi
.
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
dist
,
f
));
}
}
}
else
{
vi
.
it
=
front
.
insert
(
std
::
pair
<
float
,
Dart
>
(
d
+
edgeLength
(
f
),
f
));
vi
.
it
=
front
.
insert
(
std
::
pair
<
REAL
,
Dart
>
(
d
+
edgeLength
(
f
),
f
));
vi
.
valid
=
true
;
vmReached
.
mark
(
f
);
}
...
...
@@ -1255,7 +1255,7 @@ void Collector_Dijkstra<PFP>::collectBorder(Dart dinit)
}
template
<
typename
PFP
>
inline
float
Collector_Dijkstra
<
PFP
>::
edgeLength
(
Dart
d
)
inline
typename
PFP
::
REAL
Collector_Dijkstra
<
PFP
>::
edgeLength
(
Dart
d
)
{
typename
PFP
::
VEC3
v
=
Algo
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
this
->
map
,
d
,
this
->
position
);
return
v
.
norm
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment