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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
192f8eaf
Commit
192f8eaf
authored
Jun 02, 2013
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Begin Implicit vertex attributes in ihm3
parent
4887cf73
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
279 additions
and
255 deletions
+279
-255
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+10
-3
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+51
-10
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+30
-15
include/Algo/MovingObjects/particle_base.h
include/Algo/MovingObjects/particle_base.h
+1
-1
include/Algo/MovingObjects/particle_cell_3D.h
include/Algo/MovingObjects/particle_cell_3D.h
+13
-9
include/Algo/MovingObjects/particle_cell_3D.hpp
include/Algo/MovingObjects/particle_cell_3D.hpp
+72
-72
include/Algo/Multiresolution/Map3MR/Masks/lerp.h
include/Algo/Multiresolution/Map3MR/Masks/lerp.h
+9
-1
include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h
include/Algo/Multiresolution/Map3MR/Masks/mcCrackenJoy.h
+38
-133
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp
+48
-3
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+7
-8
No files found.
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
192f8eaf
...
...
@@ -162,6 +162,11 @@ public:
void
deleteVertexSubdividedFace
(
Dart
d
);
//@}
void
setVertexVertexFunctor
(
FunctorType
*
f
)
{
vertexVertexFunctor
=
f
;
}
void
setEdgeVertexFunctor
(
FunctorType
*
f
)
{
edgeVertexFunctor
=
f
;
}
void
setFaceVertexFunctor
(
FunctorType
*
f
)
{
faceVertexFunctor
=
f
;
}
void
setVolumeVertexFunctor
(
FunctorType
*
f
)
{
volumeVertexFunctor
=
f
;
}
void
computeVertexVertexFunctor
(
Dart
d
)
{
(
*
vertexVertexFunctor
)(
d
);
}
void
computeEdgeVertexFunctor
(
Dart
d
)
{
(
*
edgeVertexFunctor
)(
d
);
}
void
computeFaceVertexFunctor
(
Dart
d
)
{
(
*
faceVertexFunctor
)(
d
);
}
...
...
@@ -373,7 +378,8 @@ public:
virtual
bool
foreach_dart_of_face2
(
Dart
d
,
FunctorType
&
f
,
unsigned
int
thread
=
0
);
//@}
template
<
unsigned
int
ORBIT
>
unsigned
int
getEmbedding
(
Dart
d
);
}
;
template
<
typename
T
,
unsigned
int
ORBIT
>
...
...
@@ -398,9 +404,9 @@ public:
return
AttributeHandler
<
T
,
ORBIT
>::
isValid
()
;
}
T
&
operator
[](
Dart
d
)
;
virtual
T
&
operator
[](
Dart
d
)
;
const
T
&
operator
[](
Dart
d
)
const
;
virtual
const
T
&
operator
[](
Dart
d
)
const
;
T
&
operator
[](
unsigned
int
a
)
{
...
...
@@ -411,6 +417,7 @@ public:
{
return
AttributeHandler
<
T
,
ORBIT
>::
operator
[](
a
)
;
}
}
;
template
<
typename
T
>
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
192f8eaf
...
...
@@ -601,6 +601,25 @@ inline unsigned int ImplicitHierarchicalMap3::edgeLevel(Dart d)
return
r
;
}
template
<
unsigned
int
ORBIT
>
inline
unsigned
int
ImplicitHierarchicalMap3
::
getEmbedding
(
Dart
d
)
{
unsigned
int
nbSteps
=
m_curLevel
-
vertexInsertionLevel
(
d
);
unsigned
int
index
=
EmbeddedMap3
::
getEmbedding
<
ORBIT
>
(
d
);
unsigned
int
step
=
0
;
while
(
step
<
nbSteps
)
{
step
++
;
unsigned
int
next
=
m_nextLevelCell
[
ORBIT
]
->
operator
[](
index
);
index
=
next
;
//if(next != EMBNULL) index = next;
//else break;
}
return
index
;
}
/***************************************************
* ATTRIBUTE HANDLER *
...
...
@@ -613,14 +632,20 @@ T& AttributeHandler_IHM<T, ORBIT>::operator[](Dart d)
assert
(
m
->
m_dartLevel
[
d
]
<=
m
->
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
assert
(
m
->
vertexInsertionLevel
(
d
)
<=
m
->
m_curLevel
||
!
"Access to the embedding of a vertex inserted after current level"
)
;
unsigned
int
orbit
=
this
->
getOrbit
()
;
std
::
cout
<<
std
::
endl
<<
"vertexInsertionLevel["
<<
d
<<
"] = "
<<
m
->
vertexInsertionLevel
(
d
)
<<
"
\t
"
;
unsigned
int
nbSteps
=
m
->
m_curLevel
-
m
->
vertexInsertionLevel
(
d
)
;
unsigned
int
index
=
m
->
getEmbedding
<
ORBIT
>
(
d
)
;
unsigned
int
index
=
m
->
EmbeddedMap3
::
getEmbedding
<
ORBIT
>
(
d
)
;
// std::cout << " m->vertexInsertionLevel(d) = " << m->vertexInsertionLevel(d) << std::endl;
// std::cout << "m_curLevel = " << m->m_curLevel << std::endl;
// std::cout << " nbSteps = " << nbSteps << std::endl;
// std::cout << "index EmbMap3 = " << index << std::endl;
if
(
index
==
EMBNULL
)
{
index
=
m
->
setOrbitEmbeddingOnNewCell
<
ORBIT
>
(
d
)
;
m
->
m_nextLevelCell
[
orbit
]
->
operator
[](
index
)
=
EMBNULL
;
m
->
m_nextLevelCell
[
ORBIT
]
->
operator
[](
index
)
=
EMBNULL
;
}
AttributeContainer
&
cont
=
m
->
getAttributeContainer
<
ORBIT
>
()
;
...
...
@@ -628,17 +653,24 @@ T& AttributeHandler_IHM<T, ORBIT>::operator[](Dart d)
while
(
step
<
nbSteps
)
{
step
++
;
unsigned
int
nextIdx
=
m
->
m_nextLevelCell
[
orbit
]
->
operator
[](
index
)
;
unsigned
int
nextIdx
=
m
->
m_nextLevelCell
[
ORBIT
]
->
operator
[](
index
)
;
if
(
nextIdx
==
EMBNULL
)
{
nextIdx
=
m
->
newCell
<
ORBIT
>
()
;
m
->
copyCell
<
ORBIT
>
(
nextIdx
,
index
)
;
m
->
m_nextLevelCell
[
orbit
]
->
operator
[](
index
)
=
nextIdx
;
m
->
m_nextLevelCell
[
orbit
]
->
operator
[](
nextIdx
)
=
EMBNULL
;
m
->
m_nextLevelCell
[
ORBIT
]
->
operator
[](
index
)
=
nextIdx
;
m
->
m_nextLevelCell
[
ORBIT
]
->
operator
[](
nextIdx
)
=
EMBNULL
;
cont
.
refLine
(
index
)
;
}
index
=
nextIdx
;
}
std
::
cout
<<
"emb = "
<<
index
<<
std
::
endl
;
// std::cout << "index IHM = " << index << std::endl;
// if(index != EMBNULL)
// std::cout << " emb = " << this->m_attrib->operator[](index) << std::endl << std::endl;
return
this
->
m_attrib
->
operator
[](
index
);
}
...
...
@@ -649,21 +681,30 @@ const T& AttributeHandler_IHM<T, ORBIT>::operator[](Dart d) const
assert
(
m
->
m_dartLevel
[
d
]
<=
m
->
m_curLevel
||
!
"Access to a dart introduced after current level"
)
;
assert
(
m
->
vertexInsertionLevel
(
d
)
<=
m
->
m_curLevel
||
!
"Access to the embedding of a vertex inserted after current level"
)
;
unsigned
int
orbit
=
this
->
getOrbit
()
;
unsigned
int
nbSteps
=
m
->
m_curLevel
-
m
->
vertexInsertionLevel
(
d
)
;
unsigned
int
index
=
m
->
getEmbedding
<
ORBIT
>
(
d
)
;
unsigned
int
index
=
m
->
EmbeddedMap3
::
getEmbedding
<
ORBIT
>
(
d
)
;
// std::cout << "(const) m->vertexInsertionLevel(d) = " << m->vertexInsertionLevel(d) << std::endl;
// std::cout << "(const) m_curLevel = " << m->m_curLevel << std::endl;
// std::cout << "(const) nbSteps = " << nbSteps << std::endl;
// std::cout << "(const) index EmbMap3 = " << index << std::endl;
unsigned
int
step
=
0
;
while
(
step
<
nbSteps
)
{
step
++
;
unsigned
int
next
=
m
->
m_nextLevelCell
[
orbit
]
->
operator
[](
index
)
;
if
(
next
!=
EMBNULL
)
index
=
next
;
unsigned
int
next
Idx
=
m
->
m_nextLevelCell
[
ORBIT
]
->
operator
[](
index
)
;
if
(
next
Idx
!=
EMBNULL
)
index
=
nextIdx
;
else
break
;
}
// if(index != EMBNULL)
// std::cout << "(const) emb = " << this->m_attrib->operator[](index) << std::endl << std::endl;
return
this
->
m_attrib
->
operator
[](
index
);
}
}
//namespace IHM
}
// Volume
}
//namespace Algo
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
192f8eaf
...
...
@@ -65,8 +65,8 @@ void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
map.setFaceId(EDGE, d) ; //mise a jour de l'id de face sur chaque brin de chaque moitie d'arete
map.setFaceId(EDGE, dd) ;
position[map.phi1(d)] = (p1 + p2) * typename PFP::REAL(0.5) ;
//
map.computeEdgeVertexFunctor(map.phi1(d));
//
position[map.phi1(d)] = (p1 + p2) * typename PFP::REAL(0.5) ;
map.computeEdgeVertexFunctor(map.phi1(d));
map.setCurrentLevel(cur) ;
}
...
...
@@ -121,8 +121,8 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
Dart dd = map.phi1(old) ;
Dart e = map.phi1(map.phi1(dd)) ;
map.splitFace(dd, e) ; // insert a new edge
//
unsigned int id = map.getNewEdgeId() ;
//
map.setEdgeId(map.phi_1(dd), id, EDGE) ; // set the edge id of the inserted edge to the next available id
unsigned int id = map.getNewEdgeId() ;
map.setEdgeId(map.phi_1(dd), id, EDGE) ; // set the edge id of the inserted edge to the next available id
unsigned int idface = map.getFaceId(old);
map.setFaceId(dd, idface, FACE) ;
...
...
@@ -131,8 +131,8 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
dd = e ;
e = map.phi1(map.phi1(dd)) ;
map.splitFace(dd, e) ;
//
id = map.getNewEdgeId() ;
//
map.setEdgeId(map.phi_1(dd), id, EDGE) ;
id = map.getNewEdgeId() ;
map.setEdgeId(map.phi_1(dd), id, EDGE) ;
map.setFaceId(dd, idface, FACE) ;
map.setFaceId(e, idface, FACE) ;
...
...
@@ -140,8 +140,8 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
dd = e ;
e = map.phi1(map.phi1(dd)) ;
map.splitFace(dd, e) ;
//
id = map.getNewEdgeId() ;
//
map.setEdgeId(map.phi_1(dd), id, EDGE) ;
id = map.getNewEdgeId() ;
map.setEdgeId(map.phi_1(dd), id, EDGE) ;
map.setFaceId(dd, idface, FACE) ;
map.setFaceId(e, idface, FACE) ;
...
...
@@ -202,8 +202,7 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
id = map.getNewEdgeId() ;
map.setEdgeId(ne2, id, EDGE) ;
position[map.phi1(ne)] = p ;
//map.computeFaceVertexFunctor(map.phi1(ne));
//position[map.phi1(ne)] = p ;
dd = map.phi1(map.phi1(map.phi1(map.phi1(ne)))) ;
while(dd != ne)
...
...
@@ -227,6 +226,9 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
dd = map.phi2(map.phi1(dd));
}
while(dd != ne);
map.computeFaceVertexFunctor(map.phi1(ne));
//position[map.phi1(ne)] = p ;
}
map.setCurrentLevel(cur) ;
...
...
@@ -353,14 +355,14 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
//Second step : deconnect each corner, close each hole, subdivide each new face into 3
for (std::vector<Dart>::iterator edge = oldEdges.begin(); edge != oldEdges.end(); ++edge)
{
Dart e = *edge;
std::vector<Dart> v ;
do
{
v.push_back(map.phi1(map.phi1(e)));
v.push_back(map.phi1(e));
v.push_back(map.phi1(map.phi1(e)));
e = map.phi2(map.phi_1(e));
}
...
...
@@ -378,7 +380,7 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
Dart ne = map.phi1(map.phi1(old)) ;
map.cutEdge(ne);
position[map.phi1(ne)] = volCenter; //plonger a la fin de la boucle ????
//
position[map.phi1(ne)] = volCenter; //plonger a la fin de la boucle ????
centralDart = map.phi1(ne);
newEdges.push_back(ne);
newEdges.push_back(map.phi1(ne));
...
...
@@ -403,12 +405,11 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
}
while(dd != stop);
//map.computeVertexVertexFunctor(e);
}
map.deleteVolume(map.phi3(map.phi2(map.phi1(oldEdges.front()))));
//map.computerVolumeVertexFunctor(oldEdges.front());
//Third step : 3-sew internal faces
for (std::vector<std::pair<Dart,Dart> >::iterator it = subdividedfaces.begin(); it != subdividedfaces.end(); ++it)
{
...
...
@@ -445,6 +446,20 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
}
}
// std::cout << map.getCurrentLevel() << std::endl;
// //Second step : deconnect each corner, close each hole, subdivide each new face into 3
for (std::vector<Dart>::iterator edge = oldEdges.begin(); edge != oldEdges.end(); ++edge)
{
Dart e = *edge;
//std::cout << "emb ? " << map.template getEmbedding<VERTEX>(e) << std::endl;
//if(map.template getEmbedding<VERTEX>(e) == EMBNULL)
map.computeVertexVertexFunctor(e);
//std::cout << "emb = " << map.template getEmbedding<VERTEX>(e) << " / dartlevel = " << map.getDartLevel(e) << std::endl;
}
std::cout << std::endl;
map.computerVolumeVertexFunctor(centralDart);
map.setCurrentLevel(cur) ;
return centralDart; //subdividedfaces.begin()->first;
...
...
include/Algo/MovingObjects/particle_base.h
View file @
192f8eaf
...
...
@@ -41,7 +41,7 @@ namespace MovingObjects
template
<
typename
PFP
>
class
ParticleBase
{
pr
ivate
:
pr
otected
:
typename
PFP
::
VEC3
m_position
;
unsigned
int
m_state
;
...
...
include/Algo/MovingObjects/particle_cell_3D.h
View file @
192f8eaf
#ifndef PARTCELL_H
#define PARTCELL_H
#include "particle_base.h"
#include "
Algo/MovingObjects/
particle_base.h"
#include "Algo/Geometry/inclusion.h"
#include "Geometry/intersection.h"
...
...
@@ -31,12 +31,12 @@ enum {
};
template
<
typename
PFP
>
class
ParticleCell3D
:
public
Algo
::
MovingObjects
::
ParticleBase
class
ParticleCell3D
:
public
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
{
public
:
typedef
typename
PFP
::
MAP
Map
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
VertexAttribute
<
typename
PFP
::
VEC3
>
TAB_POS
;
typedef
VertexAttribute
<
VEC3
>
TAB_POS
;
Map
&
m
;
...
...
@@ -55,7 +55,11 @@ public :
{}
ParticleCell3D
(
Map
&
map
,
Dart
belonging_cell
,
VEC3
pos
,
const
TAB_POS
&
tabPos
)
:
Algo
::
MovingObjects
::
ParticleBase
(
pos
),
m
(
map
),
position
(
tabPos
),
d
(
belonging_cell
),
state
(
3
)
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
(
pos
),
m
(
map
),
position
(
tabPos
),
d
(
belonging_cell
),
state
(
3
)
{
m_positionFace
=
pointInFace
(
d
);
}
...
...
@@ -107,7 +111,7 @@ public :
{
crossCell
=
NO_CROSS
;
if
(
!
Geom
::
arePointsEquals
(
newCurrent
,
m_position
))
if
(
!
Geom
::
arePointsEquals
(
newCurrent
,
this
->
getPosition
()
))
{
switch
(
state
)
{
case
VERTEX
:
vertexState
(
newCurrent
);
break
;
...
...
@@ -121,10 +125,10 @@ public :
}
};
}
}
}
}
}
//MovingObjects
}
//Volume
}
//Algo
}
//CGoGN
#include "particle_cell_3D.hpp"
...
...
include/Algo/MovingObjects/particle_cell_3D.hpp
View file @
192f8eaf
...
...
@@ -42,22 +42,22 @@ namespace MovingObjects
template <typename PFP>
void ParticleCell3D<PFP>::display()
{
// std::cout << "position : " << m_position << std::endl;
// std::cout << "position : " <<
this->
m_position << std::endl;
}
template <typename PFP>
typename PFP::VEC3 ParticleCell3D<PFP>::pointInFace(Dart d)
{
return Algo::Surface::Geometry::faceCentroid<PFP>(m,d,position);
// const VEC3& p1(m_positions[d]);
// const VEC3& p1(
this->
m_positions[d]);
// Dart dd=m.phi1(d);
// const VEC3& p2(m_positions[dd]);
// const VEC3& p2(
this->
m_positions[dd]);
// dd=m.phi1(dd);
// VEC3& p3(m_positions[dd]);
// VEC3& p3(
this->
m_positions[dd]);
//
// while(Geom::testOrientation2D(p3,p1,p2)==Geom::ALIGNED) {
// dd = m.phi1(dd);
// p3 = m_positions[dd];
// p3 =
this->
m_positions[dd];
// }
//
// CGoGNout << "pointInFace " << (p1+p3)*0.5f << CGoGNendl;
...
...
@@ -365,8 +365,8 @@ void ParticleCell3D<PFP>::vertexState(const VEC3& current)
VEC3 som = position[d];
if(Geom::arePointsEquals(current, m_position)) {
m_position =
m_positionFace = som;
if(Geom::arePointsEquals(current,
this->
m_position)) {
this->m_position = this->
m_positionFace = som;
state = VERTEX;
return;
}
...
...
@@ -442,8 +442,8 @@ void ParticleCell3D<PFP>::vertexState(const VEC3& current)
std::cout << "numerical rounding ?" << std::endl;
d = dd;
m_position = pointInFace(d);
m_positionFace =
m_position;
this->
m_position = pointInFace(d);
this->m_positionFace = this->
m_position;
volumeState(current);
return;
}
...
...
@@ -453,9 +453,9 @@ void ParticleCell3D<PFP>::vertexState(const VEC3& current)
if(wsof!=0)
{
m_position = pointInFace(d);
this->
m_position = pointInFace(d);
d = nextNonPlanar(d);
m_positionFace = pointInFace(d);
this->
m_positionFace = pointInFace(d);
volumeState(current);
}
else
...
...
@@ -470,7 +470,7 @@ template <typename PFP>
void ParticleCell3D<PFP>::edgeState(const VEC3& current)
{
#ifdef DEBUG
std::cout << "edgeState" << d << " " << m_position << std::endl;
std::cout << "edgeState" << d << " " <<
this->
m_position << std::endl;
#endif
...
...
@@ -521,9 +521,9 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
if(wsof==-1) {
m_position = pointInFace(d);
this->
m_position = pointInFace(d);
d = nextNonPlanar(m.phi1(d));
m_positionFace = pointInFace(d);
this->
m_positionFace = pointInFace(d);
volumeState(current);
return;
}
...
...
@@ -532,7 +532,7 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
if(isOnHalfEdge(current,d))
if (isOnHalfEdge(current,m.phi3(d))) {
state=2;
m_position =
m_positionFace = current;
this->m_position = this->
m_positionFace = current;
}
else {
d=m.phi1(d);
...
...
@@ -543,7 +543,7 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
}
}
else {
m_positionFace =
m_position;
this->m_positionFace = this->
m_position;
d=m.phi1(d);
faceState(current,wsof);
}
...
...
@@ -565,13 +565,13 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
if (wsof==Geom::OVER) {
d = m.phi3(d);
d = nextNonPlanar(d);
m_positionFace = pointInFace(d);
this->
m_positionFace = pointInFace(d);
volumeState(current);
return;
}
else if(wsof==Geom::UNDER) {
d = nextNonPlanar(d);
m_positionFace = pointInFace(d);
this->
m_positionFace = pointInFace(d);
volumeState(current);
return;
}
...
...
@@ -579,9 +579,9 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
VEC3 norm = Algo::Surface::Geometry::faceNormal<PFP>(m,d,position);
Dart dd=d;
if(isLeftL1DFace(current,d,m_positionFace,norm)!=Geom::UNDER) {
if(isLeftL1DFace(current,d,
this->
m_positionFace,norm)!=Geom::UNDER) {
d = m.phi_1(d);
while(isLeftL1DFace(current,d,m_positionFace,norm)!=Geom::UNDER && dd!=d)
while(isLeftL1DFace(current,d,
this->
m_positionFace,norm)!=Geom::UNDER && dd!=d)
d = m.phi_1(d);
if(dd==d) {
...
...
@@ -590,29 +590,29 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
switch (whichSideOfEdge(current,d)) {
case Geom::OVER : d=m.phi_1(d);
break;
case Geom::ON :m_position = current;
case Geom::ON :
this->
m_position = current;
state = EDGE;
return;
default :
Geom::Plane3D<typename PFP::REAL> pl = Algo::Surface::Geometry::facePlane<PFP>(m,d,position);
VEC3 p3 = pl.normal()+m_position;
Geom::Plane3D<typename PFP::REAL> plOrtho(m_position,current,p3);
VEC3 p3 = pl.normal()+
this->
m_position;
Geom::Plane3D<typename PFP::REAL> plOrtho(
this->
m_position,current,p3);
VEC3 e(position[m.phi1(d)]-position[d]);
Geom::intersectionPlaneRay(plOrtho,
m_position,current-m_position,
m_position);
Geom::intersectionPlaneRay(plOrtho,
this->m_position,current-this->m_position,this->
m_position);
edgeState(current);
return;
}
} while(d!=dd);
m_position =
m_positionFace = current;
this->m_position = this->
m_positionFace = current;
state = FACE;
return;
}
}
else {
while(isRightDFace(current,d,m_positionFace,norm) && m.phi1(d)!=dd)
while(isRightDFace(current,d,
this->
m_positionFace,norm) && m.phi1(d)!=dd)
d = m.phi1(d);
if(m.phi_1(d)==dd) {
...
...
@@ -623,22 +623,22 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
case Geom::OVER :
d=m.phi_1(d);
break;
case Geom::ON :m_position = current;
case Geom::ON :
this->
m_position = current;
state = EDGE;
return;
default :
Geom::Plane3D<typename PFP::REAL> pl = Algo::Surface::Geometry::facePlane<PFP>(m,d,position);
VEC3 p3 = pl.normal()+m_position;
Geom::Plane3D<typename PFP::REAL> plOrtho(m_position,current,p3);
VEC3 p3 = pl.normal()+
this->
m_position;
Geom::Plane3D<typename PFP::REAL> plOrtho(
this->
m_position,current,p3);
VEC3 e(position[m.phi1(d)]-position[d]);
Geom::intersectionPlaneRay(plOrtho,
m_position,current-m_position,
m_position);
Geom::intersectionPlaneRay(plOrtho,
this->m_position,current-this->m_position,this->
m_position);
edgeState(current);
return;
}
}while(d!=dd);
m_position =
m_positionFace = current;
this->m_position = this->
m_positionFace = current;
state = FACE;
return;
}
...
...
@@ -648,22 +648,22 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
switch (whichSideOfEdge(current,d))
{
case Geom::OVER :
m_position =
m_positionFace = current;
this->m_position = this->
m_positionFace = current;
state = FACE;
break;
case Geom::ON :
m_position =
m_positionFace = current;
this->m_position = this->
m_positionFace = current;
state = EDGE;
break;
default :
Geom::Plane3D<typename PFP::REAL> pl = Algo::Surface::Geometry::facePlane<PFP>(m,d,position);
VEC3 p3 = pl.normal()+m_position;
Geom::Plane3D<typename PFP::REAL> plOrtho(m_position,current,p3);
VEC3 p3 = pl.normal()+
this->
m_position;
Geom::Plane3D<typename PFP::REAL> plOrtho(
this->
m_position,current,p3);
VEC3 e(position[m.phi1(d)]-position[d]);
Geom::intersectionPlaneRay(plOrtho,
m_position,current-m_position,
m_position);
Geom::intersectionPlaneRay(plOrtho,
this->m_position,current-this->m_position,this->
m_position);
m_positionFace =
m_position;
this->m_positionFace = this->
m_position;
edgeState(current);
}
...
...
@@ -686,13 +686,13 @@ void ParticleCell3D<PFP>::volumeState(const VEC3& current)
Dart dd=d;
bool particularcase=false;
Geom::Orientation3D testLeft = isLeftL1DVol(current,d,
m_positionFace,
m_position);
Geom::Orientation3D testLeft = isLeftL1DVol(current,d,
this->m_positionFace,this->
m_position);
if(testLeft!=Geom::UNDER) {
d = m.phi_1(d);
while(dd!=d && isLeftL1DVol(current,d,
m_positionFace,
m_position)!=Geom::UNDER)
while(dd!=d && isLeftL1DVol(current,d,
this->m_positionFace,this->
m_position)!=Geom::UNDER)
d = m.phi_1(d);
if(dd==d)
...
...
@@ -700,26 +700,26 @@ void ParticleCell3D<PFP>::volumeState(const VEC3& current)
}
else {
testRight = isRightDVol(current,d,
m_positionFace,
m_position);
testRight = isRightDVol(current,d,
this->m_positionFace,this->
m_position);
while(testRight!=Geom::OVER && dd!=m.phi1(d)) {
d = m.phi1(d);
testRight = isRightDVol(current,d,
m_positionFace,
m_position);
testRight = isRightDVol(current,d,
this->m_positionFace,this->
m_position);
}
if(testLeft==0 && dd==m.phi1(d))
particularcase=true;
}
if(particularcase) //(
m_position,
m_positionFace,c) presque alignés et si c est proche de la face
if(particularcase) //(
this->m_position,this->
m_positionFace,c) presque alignés et si c est proche de la face
//aucun des "above" sur les dart ne va donner de résultats concluant (proche de 0 pour tous)
{
if(isnan(current[0]) || isnan(current[1]) || isnan(current[2]))
{
std::cout << __FILE__ << " " << __LINE__ << " NaN !" << std::endl;
display();
m_position = current;
this->
m_position = current;
return;
}
...
...
@@ -727,9 +727,9 @@ void ParticleCell3D<PFP>::volumeState(const VEC3& current)
return;
}
Geom::Orientation3D testAbove = isAbove(current,d,m_position);
Geom::Orientation3D testAbove = isAbove(current,d,
this->
m_position);
if(testAbove!=Geom::UNDER || (testRight==Geom::ON && isAbove(current,m.phi_1(d),m_position)!=Geom::UNDER)) {
if(testAbove!=Geom::UNDER || (testRight==Geom::ON && isAbove(current,m.phi_1(d),
this->
m_position)!=Geom::UNDER)) {
if(testAbove==Geom::OVER || whichSideOfFace(current,d)==Geom::UNDER) {
...
...
@@ -749,7 +749,7 @@ void ParticleCell3D<PFP>::volumeState(const VEC3& current)
}
}
m_positionFace = pointInFace(d);
this->
m_positionFace = pointInFace(d);
}
}
} while(above);
...
...
@@ -757,28 +757,28 @@ void ParticleCell3D<PFP>::volumeState(const VEC3& current)
Geom::Orientation3D wsof = whichSideOfFace(current,d);
if(wsof==Geom::UNDER) {
m_position = current;
this->
m_position = current;
state = VOLUME;
}