Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Cazier
CGoGN
Commits
c2671a54
Commit
c2671a54
authored
Nov 27, 2012
by
Jund Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
particleMemo: using references instead of pointers
parent
d2c82ad7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
15 deletions
+42
-15
include/Algo/MovingObjects/particle_cell_2D_memo.h
include/Algo/MovingObjects/particle_cell_2D_memo.h
+5
-5
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
+37
-10
No files found.
include/Algo/MovingObjects/particle_cell_2D_memo.h
View file @
c2671a54
...
...
@@ -42,14 +42,14 @@ public:
}
void
vertexState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
*
memo_cross
)
;
void
vertexState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
&
memo_cross
)
;
void
edgeState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
*
memo_cross
,
Geom
::
Orientation2D
sideOfEdge
=
Geom
::
ALIGNED
)
;
void
edgeState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
&
memo_cross
,
Geom
::
Orientation2D
sideOfEdge
=
Geom
::
ALIGNED
)
;
void
faceState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
*
memo_cross
)
;
void
faceState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
&
memo_cross
)
;
void
move
(
const
VEC3
&
goal
,
CellMarkerMemo
<
FACE
>
*
memo_cross
)
;
std
::
vector
<
Dart
>
get_me
mo
(
const
VEC3
&
goal
)
;
std
::
vector
<
Dart
>
move
(
const
VEC3
&
goal
)
;
std
::
vector
<
Dart
>
mo
ve
(
const
VEC3
&
goal
,
CellMarkerMemo
<
FACE
>&
memo_cross
)
;
}
;
#include "particle_cell_2D_memo.hpp"
...
...
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
View file @
c2671a54
template
<
typename
PFP
>
void
ParticleCell2DMemo
<
PFP
>::
move
(
const
VEC3
&
goal
,
CellMarkerMemo
<
FACE
>
*
memo_cross
)
std
::
vector
<
Dart
>
ParticleCell2DMemo
<
PFP
>::
move
(
const
VEC3
&
goal
)
{
this
->
crossCell
=
NO_CROSS
;
if
(
!
Geom
::
arePointsEquals
(
goal
,
this
->
getPosition
()))
{
CellMarkerMemo
<
FACE
>
memo_cross
(
this
->
m
);
memo_cross
.
mark
(
this
->
d
);
switch
(
this
->
getState
())
{
case
VERTEX
:
...
...
@@ -16,28 +19,52 @@ void ParticleCell2DMemo<PFP>::move(const VEC3& goal, CellMarkerMemo<FACE> * memo
faceState
(
goal
,
memo_cross
)
;
break
;
}
return
memo_cross
.
get_markedCells
();
}
else
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
std
::
vector
<
Dart
>
res
;
res
.
push_back
(
this
->
d
);
return
res
;
}
template
<
typename
PFP
>
std
::
vector
<
Dart
>
ParticleCell2DMemo
<
PFP
>::
get_me
mo
(
const
VEC3
&
goal
)
std
::
vector
<
Dart
>
ParticleCell2DMemo
<
PFP
>::
mo
ve
(
const
VEC3
&
goal
,
CellMarkerMemo
<
FACE
>&
memo_cross
)
{
CellMarkerMemo
<
FACE
>
memo_cross
(
this
->
m
);
memo_cross
.
mark
(
this
->
d
);
this
->
move
(
goal
,
&
memo_cross
);
this
->
crossCell
=
NO_CROSS
;
if
(
!
Geom
::
arePointsEquals
(
goal
,
this
->
getPosition
()))
{
switch
(
this
->
getState
())
{
case
VERTEX
:
vertexState
(
goal
,
memo_cross
)
;
break
;
case
EDGE
:
edgeState
(
goal
,
memo_cross
)
;
break
;
case
FACE
:
faceState
(
goal
,
memo_cross
)
;
break
;
}
}
else
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
return
memo_cross
.
get_markedCells
();
}
template
<
typename
PFP
>
void
ParticleCell2DMemo
<
PFP
>::
vertexState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
*
memo_cross
)
void
ParticleCell2DMemo
<
PFP
>::
vertexState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
&
memo_cross
)
{
#ifdef DEBUG
CGoGNout
<<
"vertexState"
<<
this
->
d
<<
CGoGNendl
;
#endif
assert
(
std
::
isfinite
(
current
[
0
])
&&
std
::
isfinite
(
current
[
1
])
&&
std
::
isfinite
(
current
[
2
]))
;
(
*
memo_cross
)
.
mark
(
this
->
d
);
memo_cross
.
mark
(
this
->
d
);
this
->
crossCell
=
CROSS_OTHER
;
if
(
Algo
::
Geometry
::
isPointOnVertex
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
...
...
@@ -119,7 +146,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
}
template
<
typename
PFP
>
void
ParticleCell2DMemo
<
PFP
>::
edgeState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
*
memo_cross
,
Geom
::
Orientation2D
sideOfEdge
)
void
ParticleCell2DMemo
<
PFP
>::
edgeState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
&
memo_cross
,
Geom
::
Orientation2D
sideOfEdge
)
{
#ifdef DEBUG
CGoGNout
<<
"edgeState"
<<
this
->
d
<<
CGoGNendl
;
...
...
@@ -127,7 +154,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
assert
(
std
::
isfinite
(
current
[
0
])
&&
std
::
isfinite
(
current
[
1
])
&&
std
::
isfinite
(
current
[
2
]))
;
// assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
(
*
memo_cross
)
.
mark
(
this
->
d
);
memo_cross
.
mark
(
this
->
d
);
if
(
this
->
crossCell
==
NO_CROSS
)
{
this
->
crossCell
=
CROSS_EDGE
;
...
...
@@ -173,7 +200,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
}
template
<
typename
PFP
>
void
ParticleCell2DMemo
<
PFP
>::
faceState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
*
memo_cross
)
void
ParticleCell2DMemo
<
PFP
>::
faceState
(
const
VEC3
&
current
,
CellMarkerMemo
<
FACE
>
&
memo_cross
)
{
#ifdef DEBUG
CGoGNout
<<
"faceState"
<<
this
->
d
<<
CGoGNendl
;
...
...
@@ -184,7 +211,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
&&
std
::
isfinite
(
this
->
getPosition
()[
2
]))
;
assert
(
std
::
isfinite
(
current
[
0
])
&&
std
::
isfinite
(
current
[
1
])
&&
std
::
isfinite
(
current
[
2
]))
;
// assert(Algo::Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
(
*
memo_cross
)
.
mark
(
this
->
d
);
memo_cross
.
mark
(
this
->
d
);
Dart
dd
=
this
->
d
;
float
wsoe
=
this
->
getOrientationFace
(
current
,
this
->
m
.
phi1
(
this
->
d
))
;
...
...
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