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
Etienne Schmitt
CGoGN
Commits
911bd5a6
Commit
911bd5a6
authored
Dec 09, 2011
by
Pierre Kraemer
Browse files
Merge cgogn:~jund/CGoGN
parents
244f3699
4d1c5303
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/Algo/Geometry/volume.hpp
View file @
911bd5a6
...
...
@@ -24,6 +24,7 @@
#include
"Topology/generic/traversorCell.h"
#include
"Algo/Geometry/centroid.h"
#include
"Algo/Modelisation/tetrahedralization.h"
namespace
CGoGN
{
...
...
@@ -61,7 +62,7 @@ typename PFP::REAL convexPolyhedronVolume(typename PFP::MAP& map, Dart d, const
{
typedef
typename
PFP
::
VEC3
VEC3
;
if
(
map
.
isVolume
Tetrahedron
(
d
))
if
(
Modelisation
::
Tetrahedralization
::
is
Tetrahedron
<
PFP
>
(
map
,
d
))
return
tetrahedronVolume
<
PFP
>
(
map
,
d
,
position
)
;
else
{
...
...
include/Algo/Modelisation/tetrahedralization.hpp
View file @
911bd5a6
...
...
@@ -57,8 +57,7 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d)
template
<
typename
PFP
>
bool
isTetrahedron
(
typename
PFP
::
MAP
&
the_map
,
Dart
d
)
{
DartMarkerStore
mark
(
*
the_map
);
// Lock a marker
bool
isTetrahedron
=
true
;
// Last return value
DartMarkerStore
mark
(
the_map
);
// Lock a marker
std
::
list
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
push_back
(
d
);
...
...
@@ -67,50 +66,38 @@ bool isTetrahedron(typename PFP::MAP& the_map, Dart d)
int
nbFaces
=
0
;
// Count the faces
//Test the number of faces end its valency
for
(
faces
=
visitedFaces
.
begin
()
;
isTetrahedron
&&
faces
!=
visitedFaces
.
end
()
;
++
faces
)
for
(
faces
=
visitedFaces
.
begin
()
;
faces
!=
visitedFaces
.
end
()
;
++
faces
)
{
Dart
dc
=
*
faces
;
//if this dart is not marked
if
(
!
mark
.
isMarked
(
dc
))
{
//increase the number of faces
nbFaces
++
;
if
(
nbFaces
>
4
)
//too much faces
return
false
;
//test the valency of this face
if
(
dc
!=
the_map
.
phi1
(
the_map
.
phi1
(
the_map
.
phi1
(
dc
))))
isTetrahedron
=
false
;
else
return
false
;
//mark the face and push adjacent faces
Dart
d1
=
dc
;
for
(
unsigned
int
i
=
0
;
i
<
3
;
++
i
)
{
//mark them
mark
.
markOrbit
(
DART
,
dc
);
mark
.
mark
(
d1
);
//if phi2 not marked
if
(
!
mark
.
markOrbit
(
DART
,
the_map
.
phi2
(
dc
)))
visitedFaces
.
push_back
(
the_map
.
phi2
(
dc
));
//increase the number of faces
nbFaces
++
;
//too much faces
if
(
nbFaces
>
4
)
isTetrahedron
=
false
;
// or count the size of the face
else
{
mark
.
markOrbit
(
DART
,
the_map
.
phi1
(
dc
));
//if phi12 not marked
if
(
!
mark
.
markOrbit
(
DART
,
the_map
.
phi2
(
the_map
.
phi1
(
dc
))))
visitedFaces
.
push_back
(
the_map
.
phi2
(
the_map
.
phi1
(
dc
)));
mark
.
markOrbit
(
DART
,
the_map
.
phi_1
(
dc
));
//if phi_12 not marked
if
(
!
mark
.
markOrbit
(
DART
,
the_map
.
phi2
(
the_map
.
phi_1
(
dc
))))
visitedFaces
.
push_back
(
the_map
.
phi2
(
the_map
.
phi_1
(
dc
)));
}
Dart
d2
=
the_map
.
phi2
(
d1
);
if
(
!
mark
.
isMarked
(
d2
))
visitedFaces
.
push_back
(
d2
);
d1
=
the_map
.
phi1
(
dc
);
}
}
}
//nettoyage
mark
.
unmarkAll
();
return
isTetrahedron
;
return
true
;
}
/************************************************************************************************
...
...
@@ -272,8 +259,8 @@ void swap4To4(typename PFP::MAP& map, Dart d)
map
.
unsewVolumes
(
d
);
map
.
unsewVolumes
(
map
.
phi2
(
map
.
phi3
(
dd
)));
Algo
::
Modelisation
::
Tetrahedron
::
swap2To2
<
PFP
>
(
map
,
dd
);
Algo
::
Modelisation
::
Tetrahedron
::
swap2To2
<
PFP
>
(
map
,
e
);
Algo
::
Modelisation
::
Tetrahedr
alizati
on
::
swap2To2
<
PFP
>
(
map
,
dd
);
Algo
::
Modelisation
::
Tetrahedr
alizati
on
::
swap2To2
<
PFP
>
(
map
,
e
);
//sew middle darts so that they do not cross
map
.
sewVolumes
(
d
,
map
.
phi2
(
map
.
phi3
(
e
)));
...
...
include/Algo/MovingObjects/particle_base.h
View file @
911bd5a6
...
...
@@ -39,12 +39,17 @@ class ParticleBase
/**
* @param newPosition new position to reach
*/
bool
move
(
VEC3
position
)
virtual
bool
move
(
VEC3
position
)
{
m_position
=
position
;
return
true
;
}
virtual
unsigned
int
getState
()
{
return
0
;
}
VEC3
getPosition
()
{
return
m_position
;
}
};
...
...
include/Algo/MovingObjects/particle_cell_2D.h
View file @
911bd5a6
...
...
@@ -80,7 +80,7 @@ public :
{
return
state
;
}
void
move
(
const
VEC3
&
newCurrent
)
{
crossCell
=
NO_CROSS
;
...
...
include/Algo/MovingObjects/particle_cell_2DandHalf.h
View file @
911bd5a6
...
...
@@ -74,7 +74,7 @@ public :
{
return
state
;
}
void
move
(
const
VEC3
&
newCurrent
)
{
crossCell
=
NO_CROSS
;
...
...
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