Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Pitiot
CGoGN
Commits
d0555531
Commit
d0555531
authored
Aug 20, 2012
by
Sylvain Thery
Browse files
Made Collector thread safe
parent
9c4f8a7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Algo/Selection/collector.h
View file @
d0555531
...
...
@@ -53,6 +53,7 @@ protected:
typedef
typename
PFP
::
REAL
REAL
;
typename
PFP
::
MAP
&
map
;
unsigned
int
m_thread
;
Dart
centerDart
;
...
...
@@ -62,7 +63,7 @@ protected:
std
::
vector
<
Dart
>
border
;
public:
Collector
(
typename
PFP
::
MAP
&
m
);
Collector
(
typename
PFP
::
MAP
&
m
,
unsigned
int
thread
=
0
);
inline
void
init
(
Dart
d
)
{
...
...
@@ -122,9 +123,8 @@ template <typename PFP>
class
Collector_OneRing
:
public
Collector
<
PFP
>
{
public:
Collector_OneRing
(
typename
PFP
::
MAP
&
m
)
:
Collector
<
PFP
>
(
m
)
{}
Collector_OneRing
(
typename
PFP
::
MAP
&
m
,
unsigned
int
thread
=
0
)
:
Collector
<
PFP
>
(
m
,
thread
)
{}
void
collectAll
(
Dart
d
);
void
collectBorder
(
Dart
d
);
};
...
...
@@ -145,11 +145,10 @@ protected:
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
;
typename
PFP
::
REAL
radius
;
typename
PFP
::
REAL
area
;
unsigned
int
m_thread
;
public:
Collector_WithinSphere
(
typename
PFP
::
MAP
&
m
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
,
typename
PFP
::
REAL
r
=
0
,
unsigned
int
thread
=
0
)
:
Collector
<
PFP
>
(
m
),
Collector
<
PFP
>
(
m
,
thread
),
position
(
p
),
radius
(
r
),
area
(
0
),
...
...
@@ -188,8 +187,9 @@ public:
typename
PFP
::
MAP
&
m
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
p
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
n
,
typename
PFP
::
REAL
a
)
:
Collector
<
PFP
>
(
m
),
position
(
p
),
normal
(
n
),
angleThreshold
(
a
)
typename
PFP
::
REAL
a
,
unsigned
int
thread
=
0
)
:
Collector
<
PFP
>
(
m
,
thread
),
position
(
p
),
normal
(
n
),
angleThreshold
(
a
)
{}
inline
void
setAngleThreshold
(
typename
PFP
::
REAL
a
)
{
angleThreshold
=
a
;
}
inline
typename
PFP
::
REAL
getAngleThreshold
()
const
{
return
angleThreshold
;
}
...
...
include/Algo/Selection/collector.hpp
View file @
d0555531
...
...
@@ -39,7 +39,7 @@ namespace Selection
*********************************************************/
template
<
typename
PFP
>
Collector
<
PFP
>::
Collector
(
typename
PFP
::
MAP
&
m
)
:
map
(
m
)
Collector
<
PFP
>::
Collector
(
typename
PFP
::
MAP
&
m
,
unsigned
int
thread
)
:
map
(
m
),
m_thread
(
thread
)
{}
template
<
typename
PFP
>
...
...
@@ -295,9 +295,9 @@ void Collector_NormalAngle<PFP>::collectAll(Dart d)
this
->
insideFaces
.
reserve
(
32
);
this
->
border
.
reserve
(
32
);
CellMarkerStore
<
VERTEX
>
vm
(
this
->
map
);
// mark the collected inside-vertices
CellMarkerStore
<
EDGE
>
em
(
this
->
map
);
// mark the collected inside-edges + border-edges
CellMarkerStore
<
FACE
>
fm
(
this
->
map
);
// mark the collected inside-faces + border-faces
CellMarkerStore
<
VERTEX
>
vm
(
this
->
map
,
m_thread
);
// mark the collected inside-vertices
CellMarkerStore
<
EDGE
>
em
(
this
->
map
,
m_thread
);
// mark the collected inside-edges + border-edges
CellMarkerStore
<
FACE
>
fm
(
this
->
map
,
m_thread
);
// mark the collected inside-faces + border-faces
this
->
insideVertices
.
push_back
(
this
->
centerDart
);
vm
.
mark
(
this
->
centerDart
);
...
...
@@ -360,8 +360,8 @@ void Collector_NormalAngle<PFP>::collectBorder(Dart d)
this
->
border
.
reserve
(
128
);
this
->
insideVertices
.
reserve
(
128
);
CellMarkerStore
<
VERTEX
>
vm
(
this
->
map
);
// mark the collected inside-vertices
CellMarkerStore
<
EDGE
>
em
(
this
->
map
);
// mark the collected inside-edges + border-edges
CellMarkerStore
<
VERTEX
>
vm
(
this
->
map
,
m_thread
);
// mark the collected inside-vertices
CellMarkerStore
<
EDGE
>
em
(
this
->
map
,
m_thread
);
// mark the collected inside-edges + border-edges
this
->
insideVertices
.
push_back
(
this
->
centerDart
);
vm
.
mark
(
this
->
centerDart
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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