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
d0555531
Commit
d0555531
authored
Aug 20, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made Collector thread safe
parent
9c4f8a7c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
include/Algo/Selection/collector.h
include/Algo/Selection/collector.h
+8
-8
include/Algo/Selection/collector.hpp
include/Algo/Selection/collector.hpp
+6
-6
No files found.
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
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