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
KennethVanhoey
CGoGN
Commits
f9dac96f
Commit
f9dac96f
authored
Oct 27, 2011
by
Thomas
Browse files
ajout fctions g-cartes
parent
750381ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
View file @
f9dac96f
...
...
@@ -167,10 +167,10 @@ void ParticleCell2DAndHalf<PFP>::edgeState(VEC3 current, Geom::Orientation3D sid
faceState
(
current
);
return
;
case
Geom
::
OVER
:
{
//transform the displacement into the new entered face
VEC3
displ
=
current
-
m_position
;
VEC3
edge
=
Algo
::
Geom
::
vectorOutOfDart
<
PFP
>
(
m
,
m
.
phi2
(
d
),
m_positions
);
VEC3
edge
=
Algo
::
Geom
etry
::
vectorOutOfDart
<
PFP
>
(
m
,
m
.
phi2
(
d
),
m_positions
);
edge
.
normalize
();
VEC3
n
=
Algo
::
Geometry
::
faceNormal
<
PFP
>
(
m
,
m
.
phi2
(
d
),
m_positions
);
current
=
m_position
+
((
displ
^
n
)
*
displ
.
norm
());
...
...
@@ -178,6 +178,7 @@ void ParticleCell2DAndHalf<PFP>::edgeState(VEC3 current, Geom::Orientation3D sid
d
=
m
.
phi1
(
m
.
phi2
(
d
));
faceState
(
current
);
return
;
}
default
:
state
=
EDGE
;
}
...
...
@@ -311,12 +312,13 @@ void ParticleCell2DAndHalf<PFP>::faceState(VEC3 current)
default
:
if
(
wsoe
==
Geom
::
ON
)
{
d
=
m
.
phi1
(
d
);
//to check
m_position
=
m_positions
[
d
];
vertexState
(
current
);
std
::
cout
<<
__FILE__
<<
" to uncomment and check"
<<
std
::
endl
;
// d = m.phi1(d); //to check
// m_position = m_positions[d];
//
// vertexState(current);
}
else
//
else
{
// CGoGNout << "wsoe : " << wsoe << CGoGNendl;
// CGoGNout << "current " << current << " " << m_position << CGoGNendl;
...
...
include/Topology/gmap/gmap2.h
View file @
f9dac96f
...
...
@@ -246,12 +246,28 @@ public:
* Return or set various topological information
*************************************************************************/
//! Test if dart d and e belong to the same oriented vertex
/*! @param d a dart
* @param e a dart
*/
bool
sameOrientedVertex
(
Dart
d
,
Dart
e
);
//! Test if dart d and e belong to the same vertex
/*! @param d a dart
* @param e a dart
*/
bool
sameVertex
(
Dart
d
,
Dart
e
);
//! Test if dart d and e belong to the same oriented volume
/*! @param d a dart
* @param e a dart
*/
bool
sameOrientedVolume
(
Dart
d
,
Dart
e
);
//! Test if dart d and e belong to the same volume
/*! @param d a dart
* @param e a dart
*/
bool
sameVolume
(
Dart
d
,
Dart
e
);
/**
...
...
src/Topology/gmap/gmap2.cpp
View file @
f9dac96f
...
...
@@ -426,6 +426,19 @@ void GMap2::closeMap(DartMarker& marker)
* Return or set various topological information
*************************************************************************/
bool
GMap2
::
sameOrientedVertex
(
Dart
d
,
Dart
e
)
{
Dart
dNext
=
d
;
// Foreach dart dNext in the vertex of d
do
{
if
(
dNext
==
e
)
// Test equality with e
return
true
;
dNext
=
alpha1
(
dNext
);
}
while
(
dNext
!=
d
);
return
false
;
// None is equal to e => vertices are distinct
}
bool
GMap2
::
sameVertex
(
Dart
d
,
Dart
e
)
{
Dart
dNext
=
d
;
// Foreach dart dNext in the vertex of d
...
...
@@ -438,6 +451,37 @@ bool GMap2::sameVertex(Dart d, Dart e)
return
false
;
// None is equal to e => vertices are distinct
}
bool
GMap2
::
sameOrientedVolume
(
Dart
d
,
Dart
e
)
{
DartMarkerStore
mark
(
*
this
);
// Lock a marker
bool
found
=
false
;
// Last functor return value
std
::
list
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
push_back
(
d
);
// Start with the face of d
std
::
list
<
Dart
>::
iterator
face
;
// For every face added to the list
for
(
face
=
visitedFaces
.
begin
();
!
found
&&
face
!=
visitedFaces
.
end
();
++
face
)
{
if
(
!
mark
.
isMarked
(
*
face
))
// Face has not been visited yet
{
Dart
dNext
=
*
face
;
do
{
if
(
dNext
==
e
)
return
true
;
mark
.
mark
(
dNext
);
// Mark
Dart
adj
=
phi2
(
dNext
);
// Get adjacent face
if
(
adj
!=
dNext
&&
!
mark
.
isMarked
(
adj
))
visitedFaces
.
push_back
(
adj
);
// Add it
dNext
=
phi1
(
dNext
);
}
while
(
dNext
!=
*
face
);
}
}
return
false
;
}
bool
GMap2
::
sameVolume
(
Dart
d
,
Dart
e
)
{
DartMarkerStore
mark
(
*
this
);
// Lock a marker
...
...
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