Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
4883f7a5
Commit
4883f7a5
authored
May 03, 2013
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~jund/CGoGN
Conflicts: Apps/Tuto/tuto5.cpp README.TXT
parents
5c96e88a
bfd7705b
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
262 additions
and
176 deletions
+262
-176
README.TXT
README.TXT
+1
-7
apps_cmake.txt
apps_cmake.txt
+2
-0
include/Algo/Geometry/inclusion.hpp
include/Algo/Geometry/inclusion.hpp
+9
-14
include/Algo/Modelisation/subdivision.h
include/Algo/Modelisation/subdivision.h
+5
-1
include/Algo/Modelisation/subdivision.hpp
include/Algo/Modelisation/subdivision.hpp
+8
-8
include/Algo/MovingObjects/particle_base.h
include/Algo/MovingObjects/particle_base.h
+0
-5
include/Algo/MovingObjects/particle_cell_2D.h
include/Algo/MovingObjects/particle_cell_2D.h
+7
-5
include/Algo/MovingObjects/particle_cell_2D.hpp
include/Algo/MovingObjects/particle_cell_2D.hpp
+2
-1
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
+24
-5
include/Algo/MovingObjects/particle_cell_2D_secured.hpp
include/Algo/MovingObjects/particle_cell_2D_secured.hpp
+6
-6
include/Algo/MovingObjects/particle_cell_2DandHalf.h
include/Algo/MovingObjects/particle_cell_2DandHalf.h
+8
-6
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
+44
-36
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.h
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.h
+11
-9
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.hpp
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.hpp
+114
-72
include/Geometry/plane_3d.hpp
include/Geometry/plane_3d.hpp
+2
-1
include/Utils/Qt/qtQGLV.h
include/Utils/Qt/qtQGLV.h
+5
-0
src/Utils/Qt/qtQGLV.cpp
src/Utils/Qt/qtQGLV.cpp
+14
-0
No files found.
README.TXT
View file @
4883f7a5
...
@@ -6,12 +6,7 @@ cmake libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev q
...
@@ -6,12 +6,7 @@ cmake libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev q
Pour compiler CGoGN:
Pour compiler CGoGN:
- on compile d'abord les bibliothèques annexes :
- aller dans ThirdParty, cd build, taper "cmake .", puis make ( avec -j x si vous avez x core sur votre machine) suivi de make install
cd CGoGN/ThirdParty/build
cmake ..
make (-j x si vous avez x cores)
make install
On peut fixer certaines option pour ne pas tout compiler (cf le README.TXT dans ThirdParty)
On peut fixer certaines option pour ne pas tout compiler (cf le README.TXT dans ThirdParty)
...
@@ -54,7 +49,6 @@ install the following packages:
...
@@ -54,7 +49,6 @@ install the following packages:
ccmake libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev
ccmake libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev
To compile CGoGN:
To compile CGoGN:
- first compile third-party libraries:
- first compile third-party libraries:
cd CGoGN/ThirdParty/build
cd CGoGN/ThirdParty/build
...
...
apps_cmake.txt
View file @
4883f7a5
...
@@ -33,6 +33,7 @@ find_package(ZLIB REQUIRED)
...
@@ -33,6 +33,7 @@ find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
find_package(GLEW REQUIRED)
find_package(SuiteSparse REQUIRED)
find_package(SuiteSparse REQUIRED)
find_package(QGLViewer REQUIRED)
IF (DEFINED ASSERTON)
IF (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
...
@@ -63,6 +64,7 @@ SET (COMMON_LIBS
...
@@ -63,6 +64,7 @@ SET (COMMON_LIBS
${Boost_REGEX_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_THREAD_LIBRARY}
${SUITESPARSE_LIBRARIES}
${SUITESPARSE_LIBRARIES}
${QGLVIEWER_LIBRARIES}
)
)
#optionnal libs
#optionnal libs
...
...
include/Algo/Geometry/inclusion.hpp
View file @
4883f7a5
...
@@ -133,14 +133,13 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const VertexAttribute
...
@@ -133,14 +133,13 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const VertexAttribute
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
bool
inside
=
true
;
std
::
list
<
Dart
>
visitedFaces
;
// Faces that are traversed
std
::
list
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
push_back
(
d
);
// Start with the face of d
visitedFaces
.
push_back
(
d
);
// Start with the face of d
std
::
list
<
Dart
>::
iterator
face
;
std
::
list
<
Dart
>::
iterator
face
;
VEC3
N
;
VEC3
N
;
DartMarkerStore
mark
(
map
);
// Lock a marker
DartMarkerStore
mark
(
map
);
// Lock a marker
for
(
face
=
visitedFaces
.
begin
();
inside
&&
face
!=
visitedFaces
.
end
();
++
face
)
for
(
face
=
visitedFaces
.
begin
();
face
!=
visitedFaces
.
end
();
++
face
)
{
{
if
(
!
mark
.
isMarked
(
*
face
))
if
(
!
mark
.
isMarked
(
*
face
))
{
{
...
@@ -149,10 +148,10 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const VertexAttribute
...
@@ -149,10 +148,10 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const VertexAttribute
if
(
CCW
)
if
(
CCW
)
{
{
if
(
o3d
==
Geom
::
OVER
)
if
(
o3d
==
Geom
::
OVER
)
inside
=
false
;
return
false
;
}
}
else
if
(
o3d
==
Geom
::
UNDER
)
else
if
(
o3d
==
Geom
::
UNDER
)
inside
=
false
;
return
false
;
Dart
dNext
=
*
face
;
Dart
dNext
=
*
face
;
do
do
...
@@ -166,8 +165,7 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const VertexAttribute
...
@@ -166,8 +165,7 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const VertexAttribute
}
}
}
}
//if the point is in the volume there is an odd number of intersection with all faces with any direction
return
true
;
return
inside
;
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
...
@@ -176,8 +174,6 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const VertexAttribute<t
...
@@ -176,8 +174,6 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const VertexAttribute<t
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
REAL
REAL
;
bool
inside
=
true
;
Geom
::
Plane3D
<
REAL
>
pl
=
Geometry
::
facePlane
<
PFP
>
(
map
,
d
,
position
);
Geom
::
Plane3D
<
REAL
>
pl
=
Geometry
::
facePlane
<
PFP
>
(
map
,
d
,
position
);
Geom
::
Orientation3D
o3d
=
pl
.
orient
(
point
);
Geom
::
Orientation3D
o3d
=
pl
.
orient
(
point
);
if
(
o3d
==
Geom
::
ON
)
if
(
o3d
==
Geom
::
ON
)
...
@@ -193,12 +189,12 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const VertexAttribute<t
...
@@ -193,12 +189,12 @@ bool isPointInConvexFace(typename PFP::MAP& map, Dart d, const VertexAttribute<t
if
(
CCW
)
if
(
CCW
)
{
{
if
(
o3d
==
Geom
::
UNDER
)
if
(
o3d
==
Geom
::
UNDER
)
inside
=
false
;
return
false
;
}
}
else
if
(
o3d
==
Geom
::
OVER
)
else
if
(
o3d
==
Geom
::
OVER
)
inside
=
false
;
return
false
;
}
}
return
insid
e
;
return
tru
e
;
}
}
return
false
;
return
false
;
...
@@ -212,7 +208,6 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const VertexAttribute
...
@@ -212,7 +208,6 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const VertexAttribute
// CGoGNout << "point " << point << "d " << d << "faceDeg " << map.faceDegree(d) << CGoGNendl;
// CGoGNout << "point " << point << "d " << d << "faceDeg " << map.faceDegree(d) << CGoGNendl;
bool
convex
=
true
;
Geom
::
Orientation2D
o2d
;
Geom
::
Orientation2D
o2d
;
Traversor2FV
<
typename
PFP
::
MAP
>
tfv
(
map
,
d
)
;
Traversor2FV
<
typename
PFP
::
MAP
>
tfv
(
map
,
d
)
;
...
@@ -222,13 +217,13 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const VertexAttribute
...
@@ -222,13 +217,13 @@ bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const VertexAttribute
if
(
CCW
)
if
(
CCW
)
{
{
if
(
o2d
==
Geom
::
RIGHT
)
if
(
o2d
==
Geom
::
RIGHT
)
convex
=
false
;
return
false
;
}
}
else
if
(
o2d
==
Geom
::
LEFT
)
else
if
(
o2d
==
Geom
::
LEFT
)
return
false
;
return
false
;
}
}
return
convex
;
return
true
;
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
...
...
include/Algo/Modelisation/subdivision.h
View file @
4883f7a5
...
@@ -105,8 +105,12 @@ template <typename PFP>
...
@@ -105,8 +105,12 @@ template <typename PFP>
void
LoopSubdivision
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
;
void
LoopSubdivision
(
typename
PFP
::
MAP
&
map
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
)
;
/**
* Cut 1 face of degree n in 2n+1 faces (cut 2 times each edge and "insert" a face in the middle)
* @param size indicates where to cut edges, its value must stay between 0 and 0.5 excluded
*/
template
<
typename
PFP
,
typename
EMBV
,
typename
EMB
>
template
<
typename
PFP
,
typename
EMBV
,
typename
EMB
>
void
TwoNPlusOneSubdivision
(
typename
PFP
::
MAP
&
map
,
EMBV
&
attributs
)
;
void
TwoNPlusOneSubdivision
(
typename
PFP
::
MAP
&
map
,
EMBV
&
attributs
,
float
size
=
1.0
f
/
3.0
f
)
;
/**
/**
* Doo-Sabin subdivision scheme
* Doo-Sabin subdivision scheme
...
...
include/Algo/Modelisation/subdivision.hpp
View file @
4883f7a5
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
* *
* *
*******************************************************************************/
*******************************************************************************/
#include "Algo/Geometry/basic.h"
#include "Algo/Geometry/centroid.h"
#include "Algo/Geometry/centroid.h"
#include "Topology/generic/autoAttributeHandler.h"
#include "Topology/generic/autoAttributeHandler.h"
...
@@ -450,16 +451,13 @@ void LoopSubdivision(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>
...
@@ -450,16 +451,13 @@ void LoopSubdivision(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>
}
}
template
<
typename
PFP
,
typename
EMBV
,
typename
EMB
>
template
<
typename
PFP
,
typename
EMBV
,
typename
EMB
>
void
TwoNPlusOneSubdivision
(
typename
PFP
::
MAP
&
map
,
EMBV
&
attributs
)
void
TwoNPlusOneSubdivision
(
typename
PFP
::
MAP
&
map
,
EMBV
&
attributs
,
float
size
)
{
{
CellMarker
<
EDGE
>
m0
(
map
);
CellMarker
<
EDGE
>
m0
(
map
);
CellMarker
<
FACE
>
m1
(
map
);
CellMarker
<
FACE
>
m1
(
map
);
std
::
vector
<
Dart
>
dOrig
;
std
::
vector
<
Dart
>
dOrig
;
m0
.
unmarkAll
();
m1
.
unmarkAll
();
//first pass cut edge
//first pass cut edge
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
{
...
@@ -481,9 +479,9 @@ void TwoNPlusOneSubdivision(typename PFP::MAP& map, EMBV& attributs)
...
@@ -481,9 +479,9 @@ void TwoNPlusOneSubdivision(typename PFP::MAP& map, EMBV& attributs)
EMB
e1
=
attributs
[
d
];
EMB
e1
=
attributs
[
d
];
EMB
e2
=
attributs
[
map
.
phi1
(
d
)];
EMB
e2
=
attributs
[
map
.
phi1
(
d
)];
map
.
cutEdge
(
d
);
map
.
cutEdge
(
d
);
attributs
[
map
.
phi1
(
d
)]
=
e1
*
2.0
f
/
3.0
f
+
e2
/
3.0
f
;
attributs
[
map
.
phi1
(
d
)]
=
e1
*
(
1.0
f
-
size
)
+
e2
*
size
;
map
.
cutEdge
(
map
.
phi1
(
d
));
map
.
cutEdge
(
map
.
phi1
(
d
));
attributs
[
map
.
phi1
(
map
.
phi1
(
d
))]
=
e2
*
2.0
f
/
3.0
f
+
e1
/
3.0
f
;
attributs
[
map
.
phi1
(
map
.
phi1
(
d
))]
=
e2
*
(
1.0
f
-
size
)
+
e1
*
size
;
m0
.
mark
(
d
);
m0
.
mark
(
d
);
m0
.
mark
(
map
.
phi1
(
d
));
m0
.
mark
(
map
.
phi1
(
d
));
m0
.
mark
(
map
.
template
phi
<
11
>(
d
));
m0
.
mark
(
map
.
template
phi
<
11
>(
d
));
...
@@ -496,14 +494,16 @@ void TwoNPlusOneSubdivision(typename PFP::MAP& map, EMBV& attributs)
...
@@ -496,14 +494,16 @@ void TwoNPlusOneSubdivision(typename PFP::MAP& map, EMBV& attributs)
// //second pass create corner face
// //second pass create corner face
for
(
std
::
vector
<
Dart
>::
iterator
it
=
dOrig
.
begin
();
it
!=
dOrig
.
end
();
++
it
)
for
(
std
::
vector
<
Dart
>::
iterator
it
=
dOrig
.
begin
();
it
!=
dOrig
.
end
();
++
it
)
{
{
EMB
c
=
Geometry
::
faceCentroid
<
PFP
>
(
map
,
*
it
,
attributs
);
//
EMB c = Geometry::faceCentroid<PFP>(map,*it,attributs);
Dart
dd
=
*
it
;
Dart
dd
=
*
it
;
do
do
{
{
map
.
splitFace
(
map
.
phi1
(
dd
),
map
.
phi_1
(
dd
));
map
.
splitFace
(
map
.
phi1
(
dd
),
map
.
phi_1
(
dd
));
map
.
cutEdge
(
map
.
phi1
(
dd
));
map
.
cutEdge
(
map
.
phi1
(
dd
));
mCorner
.
mark
(
map
.
phi2
(
map
.
phi1
(
dd
)));
mCorner
.
mark
(
map
.
phi2
(
map
.
phi1
(
dd
)));
attributs
[
map
.
template
phi
<
11
>(
dd
)]
=
c
*
2.0
/
3.0
f
+
attributs
[
dd
]
/
3.0
f
;
// attributs[map.template phi<11>(dd)] = c*(1.0-size)+ attributs[dd]*size;
attributs
[
map
.
template
phi
<
11
>(
dd
)]
=
attributs
[
dd
]
+
Geometry
::
vectorOutOfDart
<
PFP
>
(
map
,
dd
,
attributs
)
-
Geometry
::
vectorOutOfDart
<
PFP
>
(
map
,
map
.
phi_1
(
dd
),
attributs
);
dd
=
map
.
phi1
(
map
.
phi1
(
map
.
phi1
(
map
.
phi2
(
map
.
phi1
(
dd
)))));
dd
=
map
.
phi1
(
map
.
phi1
(
map
.
phi1
(
map
.
phi2
(
map
.
phi1
(
dd
)))));
}
while
(
!
mCorner
.
isMarked
(
dd
));
}
while
(
!
mCorner
.
isMarked
(
dd
));
}
}
...
...
include/Algo/MovingObjects/particle_base.h
View file @
4883f7a5
...
@@ -33,9 +33,6 @@ namespace CGoGN
...
@@ -33,9 +33,6 @@ namespace CGoGN
namespace
Algo
namespace
Algo
{
{
namespace
Surface
{
namespace
MovingObjects
namespace
MovingObjects
{
{
...
@@ -82,8 +79,6 @@ public:
...
@@ -82,8 +79,6 @@ public:
}
// namespace Algo
}
// namespace Algo
}
}
// namespace CGoGN
}
// namespace CGoGN
#endif
#endif
include/Algo/MovingObjects/particle_cell_2D.h
View file @
4883f7a5
...
@@ -23,13 +23,15 @@ namespace Surface
...
@@ -23,13 +23,15 @@ namespace Surface
namespace
MovingObjects
namespace
MovingObjects
{
{
#ifndef PARTCELL25D_H
enum
enum
{
{
NO_CROSS
,
CROSS_EDGE
,
CROSS_OTHER
NO_CROSS
,
CROSS_EDGE
,
CROSS_OTHER
}
;
}
;
#endif
template
<
typename
PFP
>
template
<
typename
PFP
>
class
ParticleCell2D
:
public
ParticleBase
<
PFP
>
class
ParticleCell2D
:
public
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
{
{
public:
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
MAP
;
...
@@ -110,10 +112,10 @@ public:
...
@@ -110,10 +112,10 @@ public:
}
}
}
;
}
;
}
}
//MovingObjects
}
}
//Surface
}
}
//Algo
}
}
//CGoGN
#include "particle_cell_2D.hpp"
#include "particle_cell_2D.hpp"
...
...
include/Algo/MovingObjects/particle_cell_2D.hpp
View file @
4883f7a5
...
@@ -193,7 +193,8 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
...
@@ -193,7 +193,8 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
else
else
crossCell
=
CROSS_OTHER
;
crossCell
=
CROSS_OTHER
;
if
(
sideOfEdge
==
Geom
::
ALIGNED
)
sideOfEdge
=
getOrientationEdge
(
goal
,
d
)
;
if
(
sideOfEdge
==
Geom
::
ALIGNED
)
sideOfEdge
=
getOrientationEdge
(
goal
,
d
)
;
switch
(
sideOfEdge
)
switch
(
sideOfEdge
)
{
{
...
...
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
View file @
4883f7a5
...
@@ -41,7 +41,6 @@ std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
...
@@ -41,7 +41,6 @@ std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
if
(
!
Geom
::
arePointsEquals
(
goal
,
this
->
getPosition
()))
if
(
!
Geom
::
arePointsEquals
(
goal
,
this
->
getPosition
()))
{
{
CellMarkerMemo
<
FACE
>
memo_cross
(
this
->
m
);
CellMarkerMemo
<
FACE
>
memo_cross
(
this
->
m
);
memo_cross
.
mark
(
this
->
d
);
switch
(
this
->
getState
())
switch
(
this
->
getState
())
{
{
...
@@ -55,7 +54,6 @@ std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
...
@@ -55,7 +54,6 @@ std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
faceState
(
goal
,
memo_cross
)
;
faceState
(
goal
,
memo_cross
)
;
break
;
break
;
}
}
return
memo_cross
.
get_markedCells
();
return
memo_cross
.
get_markedCells
();
}
}
else
else
...
@@ -69,9 +67,30 @@ std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
...
@@ -69,9 +67,30 @@ std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
template
<
typename
PFP
>
template
<
typename
PFP
>
std
::
vector
<
Dart
>
ParticleCell2DMemo
<
PFP
>::
move
(
const
VEC3
&
goal
,
CellMarkerMemo
<
FACE
>&
memo_cross
)
std
::
vector
<
Dart
>
ParticleCell2DMemo
<
PFP
>::
move
(
const
VEC3
&
goal
,
CellMarkerMemo
<
FACE
>&
memo_cross
)
{
{
memo_cross
.
mark
(
this
->
d
);
this
->
crossCell
=
NO_CROSS
;
this
->
move
(
goal
,
memo_cross
);
if
(
!
Geom
::
arePointsEquals
(
goal
,
this
->
getPosition
()))
return
memo_cross
.
get_markedCells
();
{
switch
(
this
->
getState
())
{
case
VERTEX
:
vertexState
(
goal
,
memo_cross
)
;
break
;
case
EDGE
:
edgeState
(
goal
,
memo_cross
)
;
break
;
case
FACE
:
faceState
(
goal
,
memo_cross
)
;
break
;
}
return
memo_cross
.
get_markedCells
();
}
else
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
std
::
vector
<
Dart
>
res
;
res
.
push_back
(
this
->
d
);
return
res
;
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
...
...
include/Algo/MovingObjects/particle_cell_2D_secured.hpp
View file @
4883f7a5
...
@@ -58,7 +58,7 @@ std::vector<Dart> ParticleCell2DSecured<PFP>::move(const VEC3& goal)
...
@@ -58,7 +58,7 @@ std::vector<Dart> ParticleCell2DSecured<PFP>::move(const VEC3& goal)
return
memo_cross
.
get_markedCells
();
return
memo_cross
.
get_markedCells
();
}
}
else
else
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
std
::
vector
<
Dart
>
res
;
std
::
vector
<
Dart
>
res
;
res
.
push_back
(
this
->
d
);
res
.
push_back
(
this
->
d
);
...
@@ -86,7 +86,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
...
@@ -86,7 +86,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
if
(
Geometry
::
isPointOnVertex
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
if
(
Geometry
::
isPointOnVertex
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
{
{
this
->
setState
(
VERTEX
)
;
this
->
setState
(
VERTEX
)
;
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
return
;
return
;
}
}
else
else
...
@@ -130,7 +130,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
...
@@ -130,7 +130,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
while
(
this
->
getOrientationEdge
(
current
,
this
->
m
.
phi2_1
(
this
->
d
))
!=
Geom
::
RIGHT
&&
dd_vert
!=
this
->
d
)
;
}
while
(
this
->
getOrientationEdge
(
current
,
this
->
m
.
phi2_1
(
this
->
d
))
!=
Geom
::
RIGHT
&&
dd_vert
!=
this
->
d
)
;
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
setState
(
VERTEX
)
;
this
->
setState
(
VERTEX
)
;
return
;
return
;
}
}
...
@@ -207,7 +207,7 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F
...
@@ -207,7 +207,7 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
{
{
this
->
ParticleBase
<
PFP
>::
move
(
this
->
positionAttribut
[
this
->
d
])
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
this
->
positionAttribut
[
this
->
d
])
;
vertexState
(
current
,
memo_cross
)
;
vertexState
(
current
,
memo_cross
)
;
return
;
return
;
}
}
...
@@ -215,12 +215,12 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F
...
@@ -215,12 +215,12 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
))
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
))
{
{
this
->
d
=
this
->
m
.
phi2
(
this
->
d
)
;
this
->
d
=
this
->
m
.
phi2
(
this
->
d
)
;
this
->
ParticleBase
<
PFP
>::
move
(
this
->
positionAttribut
[
this
->
d
])
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
this
->
positionAttribut
[
this
->
d
])
;
vertexState
(
current
,
memo_cross
)
;
vertexState
(
current
,
memo_cross
)
;
return
;
return
;
}
}
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
}
}
}
}
...
...
include/Algo/MovingObjects/particle_cell_2DandHalf.h
View file @
4883f7a5
#ifndef PARTCELL_H
#ifndef PARTCELL
25D
_H
#define PARTCELL_H
#define PARTCELL
25D
_H
#include "Algo/MovingObjects/particle_base.h"
#include "Algo/MovingObjects/particle_base.h"
...
@@ -24,15 +24,17 @@ namespace Surface
...
@@ -24,15 +24,17 @@ namespace Surface
namespace
MovingObjects
namespace
MovingObjects
{
{
#ifndef PARTCELL_H
enum
enum
{
{
NO_CROSS
,
NO_CROSS
,
CROSS_EDGE
,
CROSS_EDGE
,
CROSS_OTHER
CROSS_OTHER
};
};
#endif
template
<
typename
PFP
>
template
<
typename
PFP
>
class
ParticleCell2DAndHalf
:
public
MovingObjects
::
ParticleBase
class
ParticleCell2DAndHalf
:
public
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
{
{
public
:
public
:
typedef
typename
PFP
::
MAP
Map
;
typedef
typename
PFP
::
MAP
Map
;
...
@@ -56,7 +58,7 @@ public :
...
@@ -56,7 +58,7 @@ public :
{}
{}
ParticleCell2DAndHalf
(
Map
&
map
,
Dart
belonging_cell
,
VEC3
pos
,
const
TAB_POS
&
tabPos
)
:
ParticleCell2DAndHalf
(
Map
&
map
,
Dart
belonging_cell
,
VEC3
pos
,
const
TAB_POS
&
tabPos
)
:
ParticleBase
(
pos
),
m
(
map
),
m_positions
(
tabPos
),
d
(
belonging_cell
),
lastCrossed
(
belonging_cell
),
state
(
FACE
),
crossCell
(
NO_CROSS
),
distance
(
0
)
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
(
pos
),
m
(
map
),
m_positions
(
tabPos
),
d
(
belonging_cell
),
lastCrossed
(
belonging_cell
),
state
(
FACE
),
crossCell
(
NO_CROSS
),
distance
(
0
)
{}
{}
Dart
getCell
()
{
return
d
;
}
Dart
getCell
()
{
return
d
;
}
...
@@ -88,7 +90,7 @@ public :
...
@@ -88,7 +90,7 @@ public :
{
{
distance
=
0
;
distance
=
0
;
crossCell
=
NO_CROSS
;
crossCell
=
NO_CROSS
;
if
(
!
Geom
::
arePointsEquals
(
newCurrent
,
m_position
))
if
(
!
Geom
::
arePointsEquals
(
newCurrent
,
this
->
getPosition
()
))
{
{
switch
(
state
)
{
switch
(
state
)
{
case
VERTEX
:
vertexState
(
newCurrent
);
break
;
case
VERTEX
:
vertexState
(
newCurrent
);
break
;
...
@@ -99,7 +101,7 @@ public :
...
@@ -99,7 +101,7 @@ public :
// display();
// display();
}
}
else
else
m_position
=
newCurrent
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
newCurrent
)
;
}
}
};
};
...
...
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
View file @
4883f7a5
...
@@ -114,14 +114,14 @@ void ParticleCell2DAndHalf<PFP>::vertexState(VEC3 goal)
...
@@ -114,14 +114,14 @@ void ParticleCell2DAndHalf<PFP>::vertexState(VEC3 goal)
#ifdef DEBUG
#ifdef DEBUG
CGoGNout
<<
"vertexState"
<<
d
<<
CGoGNendl
;
CGoGNout
<<
"vertexState"
<<
d
<<
CGoGNendl
;
#endif
#endif
assert
(
go
la
.
isf
inite
())
;
assert
(
go
al
.
isF
inite
())
;
crossCell
=
CROSS_OTHER
;
crossCell
=
CROSS_OTHER
;
if
(
Geometry
::
isPointOnVertex
<
PFP
>
(
m
,
d
,
m_positions
,
goal
))
if
(
Geometry
::
isPointOnVertex
<
PFP
>
(
m
,
d
,
m_positions
,
goal
))
{
{
state
=
VERTEX
;