Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
KennethVanhoey
CGoGN
Commits
6a284f4c
Commit
6a284f4c
authored
May 03, 2013
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~pitiot/CGoGN
parents
f6508c37
f656d2cc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
6 deletions
+38
-6
include/Algo/ImplicitHierarchicalMesh/ihm.h
include/Algo/ImplicitHierarchicalMesh/ihm.h
+6
-0
include/Algo/MovingObjects/particle_cell_2D.hpp
include/Algo/MovingObjects/particle_cell_2D.hpp
+15
-2
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
+3
-2
include/Geometry/inclusion.hpp
include/Geometry/inclusion.hpp
+1
-1
include/Geometry/orientation.hpp
include/Geometry/orientation.hpp
+1
-1
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
+12
-0
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm.h
View file @
6a284f4c
...
...
@@ -193,6 +193,12 @@ public:
*/
Dart
faceOldestDart
(
Dart
d
)
;
//! Test if dart d and e belong to the same face
/*! @param d a dart
* @param e a dart
*/
bool
sameFace
(
Dart
d
,
Dart
e
)
;
/**
* Return true if the edge of d in the current level map
* has already been subdivided to the next level
...
...
include/Algo/MovingObjects/particle_cell_2D.hpp
View file @
6a284f4c
...
...
@@ -21,6 +21,7 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
//#define DEBUG
namespace
CGoGN
{
...
...
@@ -137,7 +138,8 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
{
if
(
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
)
&&
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
this
->
m
.
phi2
(
d
),
positionAttribut
,
goal
)
&&
this
->
getOrientationEdge
(
goal
,
this
->
d
)
==
Geom
::
ALIGNED
)
)
// && this->getOrientationEdge(goal, this->d) == Geom::ALIGNED) //TODO to check / alignment orientation test pb ?
{
edgeState
(
goal
)
;
return
;
...
...
@@ -145,7 +147,6 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
while
(
this
->
getOrientationEdge
(
goal
,
this
->
m
.
phi2_1
(
this
->
d
))
!=
Geom
::
RIGHT
&&
dd_vert
!=
this
->
d
)
;
this
->
setState
(
VERTEX
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
::
move
(
goal
)
;
return
;
...
...
@@ -180,6 +181,17 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
{
#ifdef DEBUG
CGoGNout
<<
"edgeState"
<<
d
<<
CGoGNendl
;
VEC3
P
(
goal
);
VEC3
Pa
(
positionAttribut
[
d
]);
VEC3
Pb
(
positionAttribut
[
m
.
phi2
(
d
)]);
float
p
=
(
P
[
0
]
-
Pa
[
0
])
*
(
Pb
[
1
]
-
Pa
[
1
])
-
(
Pb
[
0
]
-
Pa
[
0
])
*
(
P
[
1
]
-
Pa
[
1
])
;
CGoGNout
<<
"p :"
<<
p
<<
CGoGNendl
;
float
p2
=
(
P
[
0
]
-
Pb
[
0
])
*
(
Pa
[
1
]
-
Pb
[
1
])
-
(
Pa
[
0
]
-
Pb
[
0
])
*
(
P
[
1
]
-
Pb
[
1
])
;
CGoGNout
<<
"p2 :"
<<
p2
<<
CGoGNendl
;
#endif
assert
(
goal
.
isFinite
())
;
...
...
@@ -445,3 +457,4 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
}
}
//namespaces
}
//#undef DEBUG
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
View file @
6a284f4c
...
...
@@ -42,6 +42,7 @@ std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
{
CellMarkerMemo
<
FACE
>
memo_cross
(
this
->
m
);
switch
(
this
->
getState
())
{
case
VERTEX
:
...
...
@@ -139,8 +140,8 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
do
{
if
(
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
)
&&
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
)
&&
this
->
getOrientationEdge
(
current
,
this
->
d
)
==
Geom
::
ALIGNED
)
&&
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
)
)
//
&& this->getOrientationEdge(current, this->d) == Geom::ALIGNED)
{
this
->
edgeState
(
current
,
memo_cross
)
;
...
...
include/Geometry/inclusion.hpp
View file @
6a284f4c
...
...
@@ -166,7 +166,7 @@ bool arePointsEquals(const VEC& point1, const VEC& point2)
{
VEC
v
(
point1
-
point2
);
#define PRECISION 1e-
10
#define PRECISION 1e-
5
return
v
.
norm2
()
<=
PRECISION
;
#undef PRECISION
}
...
...
include/Geometry/orientation.hpp
View file @
6a284f4c
...
...
@@ -35,7 +35,7 @@ Orientation2D testOrientation2D(const VEC3& P, const VEC3& Pa, const VEC3& Pb)
{
typedef
typename
VEC3
::
DATA_TYPE
T
;
const
T
zero
=
0.00001
;
const
T
zero
=
0.0000
0
1
;
T
p
=
(
P
[
0
]
-
Pa
[
0
])
*
(
Pb
[
1
]
-
Pa
[
1
])
-
(
Pb
[
0
]
-
Pa
[
0
])
*
(
P
[
1
]
-
Pa
[
1
])
;
...
...
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
View file @
6a284f4c
...
...
@@ -227,6 +227,18 @@ Dart ImplicitHierarchicalMap::faceOldestDart(Dart d)
return
oldest
;
}
bool
ImplicitHierarchicalMap
::
sameFace
(
Dart
d
,
Dart
e
)
{
Dart
it
=
d
;
do
{
if
(
it
==
e
)
return
true
;
it
=
phi1
(
it
)
;
}
while
(
it
!=
d
)
;
return
false
;
}
bool
ImplicitHierarchicalMap
::
edgeIsSubdivided
(
Dart
d
)
{
assert
(
m_dartLevel
[
d
]
<=
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
...
...
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