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
CGoGN
CGoGN
Commits
3322f3f6
Commit
3322f3f6
authored
Nov 27, 2012
by
Sylvain Thery
Browse files
Merge branch 'master' of cgogn:~jund/CGoGN
parents
9b56e839
c2671a54
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Algo/MovingObjects/particle_cell_2D_memo.h
View file @
3322f3f6
...
...
@@ -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 @
3322f3f6
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
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