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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
3e757ee2
Commit
3e757ee2
authored
Jan 15, 2013
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Surface/Volume namespace in particles
parent
074a0cc7
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
372 additions
and
93 deletions
+372
-93
include/Algo/MovingObjects/particle_base.h
include/Algo/MovingObjects/particle_base.h
+24
-0
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
+51
-10
include/Algo/MovingObjects/particle_cell_2D_memo.h
include/Algo/MovingObjects/particle_cell_2D_memo.h
+6
-4
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
+51
-11
include/Algo/MovingObjects/particle_cell_2D_secured.h
include/Algo/MovingObjects/particle_cell_2D_secured.h
+9
-3
include/Algo/MovingObjects/particle_cell_2D_secured.hpp
include/Algo/MovingObjects/particle_cell_2D_secured.hpp
+47
-8
include/Algo/MovingObjects/particle_cell_2DandHalf.h
include/Algo/MovingObjects/particle_cell_2DandHalf.h
+6
-1
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
+44
-15
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.h
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.h
+6
-3
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.hpp
include/Algo/MovingObjects/particle_cell_2DandHalf_memo.hpp
+54
-11
include/Algo/MovingObjects/particle_cell_3D.h
include/Algo/MovingObjects/particle_cell_3D.h
+8
-5
include/Algo/MovingObjects/particle_cell_3D.hpp
include/Algo/MovingObjects/particle_cell_3D.hpp
+59
-17
No files found.
include/Algo/MovingObjects/particle_base.h
View file @
3e757ee2
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef PARTBASE_H
#define PARTBASE_H
...
...
include/Algo/MovingObjects/particle_cell_2D.h
View file @
3e757ee2
...
...
@@ -17,6 +17,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
MovingObjects
{
...
...
@@ -26,7 +29,7 @@ enum
}
;
template
<
typename
PFP
>
class
ParticleCell2D
:
public
ParticleBase
<
PFP
>
class
ParticleCell2D
:
public
MovingObjects
::
ParticleBase
<
PFP
>
{
public:
typedef
typename
PFP
::
MAP
MAP
;
...
...
@@ -107,12 +110,11 @@ public:
}
}
;
#include "particle_cell_2D.hpp"
}
}
}
}
#include "particle_cell_2D.hpp"
#endif
include/Algo/MovingObjects/particle_cell_2D.hpp
View file @
3e757ee2
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
namespace
CGoGN
{
namespace
Algo
{
namespace
Surface
{
namespace
MovingObjects
{
template
<
typename
PFP
>
void
ParticleCell2D
<
PFP
>::
display
()
{
...
...
@@ -65,7 +101,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
crossCell
=
CROSS_OTHER
;
if
(
Algo
::
Geometry
::
isPointOnVertex
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
if
(
Geometry
::
isPointOnVertex
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
{
this
->
setState
(
VERTEX
)
;
this
->
ParticleBase
<
PFP
>
::
move
(
goal
)
;
...
...
@@ -91,7 +127,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
//orbit with 2 edges : point on one edge
if
(
m
.
phi2_1
(
m
.
phi2_1
(
d
))
==
d
)
{
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
d
=
m
.
phi2_1
(
d
);
}
else
...
...
@@ -99,8 +135,8 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
//checking : case with 3 orthogonal darts and point on an edge
do
{
if
(
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
)
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
this
->
m
.
phi2
(
d
),
positionAttribut
,
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
)
{
edgeState
(
goal
)
;
...
...
@@ -129,7 +165,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
//displacement step
if
(
getOrientationEdge
(
goal
,
d
)
==
Geom
::
ALIGNED
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
&&
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
edgeState
(
goal
)
;
else
{
...
...
@@ -147,7 +183,7 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
#endif
assert
(
goal
.
isFinite
())
;
// assert(
Algo::
Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
// assert(Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
if
(
crossCell
==
NO_CROSS
)
{
...
...
@@ -174,13 +210,13 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
break
;
}
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
{
this
->
ParticleBase
<
PFP
>
::
move
(
positionAttribut
[
d
])
;
vertexState
(
goal
)
;
return
;
}
else
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
m
.
phi2
(
d
),
positionAttribut
,
goal
))
else
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
m
.
phi2
(
d
),
positionAttribut
,
goal
))
{
d
=
m
.
phi2
(
d
)
;
this
->
ParticleBase
<
PFP
>
::
move
(
positionAttribut
[
d
])
;
...
...
@@ -278,7 +314,7 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
assert
(
this
->
getPosition
().
isFinite
());
assert
(
goal
.
isFinite
())
;
// assert(
Algo::
Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
// assert(Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
Dart
dd
=
d
;
float
wsoe
=
getOrientationFace
(
goal
,
m
.
phi1
(
d
))
;
...
...
@@ -317,7 +353,7 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
setState
(
FACE
)
;
// m_position =
Algo::
Geometry::faceCentroid<PFP>(m,d,m_positions);
// m_position = Geometry::faceCentroid<PFP>(m,d,m_positions);
// d = m.phi1(d);
// m_position = pointInFace(d);
// faceState(current);
...
...
@@ -403,3 +439,8 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
break
;
}
}
}
}
}
//namespaces
}
include/Algo/MovingObjects/particle_cell_2D_memo.h
View file @
3e757ee2
...
...
@@ -17,6 +17,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
MovingObjects
{
...
...
@@ -52,12 +55,11 @@ public:
std
::
vector
<
Dart
>
move
(
const
VEC3
&
goal
);
}
;
#include "particle_cell_2D_memo.hpp"
}
}
}
}
#include "particle_cell_2D_memo.hpp"
#endif
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
View file @
3e757ee2
template
<
typename
PFP
>
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
namespace
CGoGN
{
namespace
Algo
{
namespace
Surface
{
namespace
MovingObjects
{
template
<
typename
PFP
>
std
::
vector
<
Dart
>
ParticleCell2DMemo
<
PFP
>::
move
(
const
VEC3
&
goal
)
{
this
->
crossCell
=
NO_CROSS
;
...
...
@@ -49,7 +84,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
memo_cross
.
mark
(
this
->
d
);
this
->
crossCell
=
CROSS_OTHER
;
if
(
Algo
::
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
->
ParticleBase
<
PFP
>::
move
(
current
)
;
...
...
@@ -76,7 +111,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
//orbit with 2 edges : point on one edge
if
(
this
->
m
.
phi2_1
(
this
->
m
.
phi2_1
(
this
->
d
))
==
this
->
d
)
{
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
else
...
...
@@ -84,8 +119,8 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
//checking : case with 3 orthogonal darts and point on an edge
do
{
if
(
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
)
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
)
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
)
{
...
...
@@ -116,7 +151,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
//displacement step
if
(
this
->
getOrientationEdge
(
current
,
this
->
d
)
==
Geom
::
ALIGNED
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
&&
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
edgeState
(
current
,
memo_cross
)
;
else
{
...
...
@@ -134,7 +169,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
#endif
assert
(
std
::
isfinite
(
current
[
0
])
&&
std
::
isfinite
(
current
[
1
])
&&
std
::
isfinite
(
current
[
2
]))
;
// assert(
Algo::
Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
// assert(Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
memo_cross
.
mark
(
this
->
d
);
if
(
this
->
crossCell
==
NO_CROSS
)
{
...
...
@@ -161,14 +196,14 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
break
;
}
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
{
this
->
ParticleBase
<
PFP
>::
move
(
this
->
positionAttribut
[
this
->
d
])
;
vertexState
(
current
,
memo_cross
)
;
return
;
}
else
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
else
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
))
{
this
->
d
=
this
->
m
.
phi2
(
this
->
d
)
;
...
...
@@ -191,7 +226,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
std
::
isfinite
(
this
->
getPosition
()[
0
])
&&
std
::
isfinite
(
this
->
getPosition
()[
1
])
&&
std
::
isfinite
(
this
->
getPosition
()[
2
]))
;
assert
(
std
::
isfinite
(
current
[
0
])
&&
std
::
isfinite
(
current
[
1
])
&&
std
::
isfinite
(
current
[
2
]))
;
// assert(
Algo::
Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
// assert(Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
memo_cross
.
mark
(
this
->
d
);
Dart
dd
=
this
->
d
;
float
wsoe
=
this
->
getOrientationFace
(
current
,
this
->
m
.
phi1
(
this
->
d
))
;
...
...
@@ -234,7 +269,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
this
->
ParticleBase
<
PFP
>::
move
(
current
);
this
->
setState
(
FACE
)
;
// m_position =
Algo::
Geometry::faceCentroid<PFP>(m,d,m_positions);
// m_position = Geometry::faceCentroid<PFP>(m,d,m_positions);
// d = m.phi1(d);
// m_position = pointInFace(d);
// faceState(current);
...
...
@@ -321,3 +356,8 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
}
}
}
}
}
//namespaces
}
include/Algo/MovingObjects/particle_cell_2D_secured.h
View file @
3e757ee2
...
...
@@ -17,6 +17,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
MovingObjects
{
...
...
@@ -50,13 +53,16 @@ public:
std
::
vector
<
Dart
>
move
(
const
VEC3
&
goal
)
;
std
::
vector
<
Dart
>
move
(
const
VEC3
&
goal
,
CellMarkerMemo
<
FACE
>&
memo_cross
)
;
}
;
#include "particle_cell_2D_secured.hpp"
}
//MovingObject
}
// Surface
}
//Algo
}
//CGoGN
#include "particle_cell_2D_secured.hpp"
#endif
include/Algo/MovingObjects/particle_cell_2D_secured.hpp
View file @
3e757ee2
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
namespace
CGoGN
{
namespace
Algo
{
namespace
Surface
{
namespace
MovingObjects
{
template
<
typename
PFP
>
std
::
vector
<
Dart
>
ParticleCell2DSecured
<
PFP
>::
move
(
const
VEC3
&
goal
)
{
...
...
@@ -48,7 +83,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
assert
(
std
::
isfinite
(
current
[
0
])
&&
std
::
isfinite
(
current
[
1
])
&&
std
::
isfinite
(
current
[
2
]))
;
this
->
crossCell
=
CROSS_OTHER
;
if
(
Algo
::
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
->
ParticleBase
<
PFP
>::
move
(
current
)
;
...
...
@@ -75,7 +110,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
//orbit with 2 edges : point on one edge
if
(
this
->
m
.
phi2_1
(
this
->
m
.
phi2_1
(
this
->
d
))
==
this
->
d
)
{
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
else
...
...
@@ -83,8 +118,8 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
//checking : case with 3 orthogonal darts and point on an edge
do
{
if
(
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
)
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
)
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
)
{
...
...
@@ -116,7 +151,7 @@ void ParticleCell2DSecured<PFP>::vertexState(const VEC3& current, CellMarkerMemo
//displacement step
if
(
this
->
getOrientationEdge
(
current
,
this
->
d
)
==
Geom
::
ALIGNED
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
&&
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
edgeState
(
current
,
memo_cross
)
;
else
{
...
...
@@ -143,7 +178,7 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F
// else
{
assert
(
std
::
isfinite
(
current
[
0
])
&&
std
::
isfinite
(
current
[
1
])
&&
std
::
isfinite
(
current
[
2
]))
;
// assert(
Algo::
Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
// assert(Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
if
(
this
->
crossCell
==
NO_CROSS
)
{
this
->
crossCell
=
CROSS_EDGE
;
...
...
@@ -169,14 +204,14 @@ void ParticleCell2DSecured<PFP>::edgeState(const VEC3& current, CellMarkerMemo<F
break
;
}
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
{
this
->
ParticleBase
<
PFP
>::
move
(
this
->
positionAttribut
[
this
->
d
])
;
vertexState
(
current
,
memo_cross
)
;
return
;
}
else
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
else
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
))
{
this
->
d
=
this
->
m
.
phi2
(
this
->
d
)
;
...
...
@@ -208,5 +243,9 @@ void ParticleCell2DSecured<PFP>::faceState(const VEC3& current, CellMarkerMemo<F
ParticleCell2DMemo
<
PFP
>::
faceState
(
current
,
memo_cross
);
}
}
}
}
}
//namespaces
}
include/Algo/MovingObjects/particle_cell_2DandHalf.h
View file @
3e757ee2
...
...
@@ -18,6 +18,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
MovingObjects
{
...
...
@@ -29,7 +32,7 @@ enum
};
template
<
typename
PFP
>
class
ParticleCell2DAndHalf
:
public
ParticleBase
class
ParticleCell2DAndHalf
:
public
MovingObjects
::
ParticleBase
{
public
:
typedef
typename
PFP
::
MAP
Map
;
...
...
@@ -102,6 +105,8 @@ public :
}
// namespace MovingObjects
}
// Surface
}
// namespace Algo
}
// namespace CGoGN
...
...
include/Algo/MovingObjects/particle_cell_2DandHalf.hpp
View file @
3e757ee2
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
//#define DEBUG
#include "Geometry/frame.h"
...
...
@@ -8,6 +32,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
MovingObjects
{
...
...
@@ -47,7 +74,7 @@ Geom::Orientation3D ParticleCell2DAndHalf<PFP>::getOrientationEdge(const VEC3& p
const
VEC3
&
endPoint
=
m_positions
[
m
.
phi1
(
d
)];
const
VEC3
&
vertexPoint
=
m_positions
[
d
];
const
VEC3
&
n1
=
Algo
::
Geometry
::
faceNormal
<
PFP
>
(
m
,
d
,
m_positions
);
const
VEC3
&
n1
=
Geometry
::
faceNormal
<
PFP
>
(
m
,
d
,
m_positions
);
//orientation relative to the plane orthogonal to the face going through the edge
return
Geom
::
testOrientation3D
(
point
,
vertexPoint
,
endPoint
,
vertexPoint
+
n1
);
...
...
@@ -60,12 +87,12 @@ typename PFP::VEC3 ParticleCell2DAndHalf<PFP>::intersectLineEdge(const VEC3& pA,
const
VEC3
&
q2
=
m_positions
[
m
.
phi1
(
d
)];
VEC3
Inter
;
VEC3
n1
=
Algo
::
Geometry
::
faceNormal
<
PFP
>
(
m
,
d
,
m_positions
);
VEC3
n1
=
Geometry
::
faceNormal
<
PFP
>
(
m
,
d
,
m_positions
);
VEC3
n
=
(
q2
-
q1
)
^
n1
;
Geom
::
intersectionLinePlane
(
pA
,
pB
-
pA
,
q1
,
n
,
Inter
)
;
Geom
::
Plane3D
<
float
>
pl
=
Algo
::
Geometry
::
facePlane
<
PFP
>
(
m
,
d
,
m_positions
);
Geom
::
Plane3D
<
float
>
pl
=
Geometry
::
facePlane
<
PFP
>
(
m
,
d
,
m_positions
);
pl
.
project
(
Inter
);
return
Inter
;
...
...
@@ -76,7 +103,7 @@ Geom::Orientation3D ParticleCell2DAndHalf<PFP>::getOrientationFace(VEC3 point, V
{
const
VEC3
&
dPoint
=
m_positions
[
d
];
VEC3
n1
=
Algo
::
Geometry
::
faceNormal
<
PFP
>
(
m
,
d
,
m_positions
);
VEC3
n1
=
Geometry
::
faceNormal
<
PFP
>
(
m
,
d
,
m_positions
);
return
Geom
::
testOrientation3D
(
point
,
sourcePoint
,
dPoint
+
n1
,
dPoint
);
}
...
...
@@ -91,7 +118,7 @@ void ParticleCell2DAndHalf<PFP>::vertexState(VEC3 goal)
crossCell
=
CROSS_OTHER
;
if
(
Algo
::
Geometry
::
isPointOnVertex
<
PFP
>
(
m
,
d
,
m_positions
,
goal
))
if
(
Geometry
::
isPointOnVertex
<
PFP
>
(
m
,
d
,
m_positions
,
goal
))
{
state
=
VERTEX
;
m_position
=
goal
;
...
...
@@ -117,7 +144,7 @@ void ParticleCell2DAndHalf<PFP>::vertexState(VEC3 goal)
//orbit with 2 edges : point on one edge
if
(
m
.
phi2_1
(
m
.
phi2_1
(
d
))
==
d
)
{
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
m_positions
,
current
))
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
m_positions
,
current
))
d
=
m
.
phi2_1
(
d
);
}
else
...
...
@@ -140,7 +167,7 @@ void ParticleCell2DAndHalf<PFP>::vertexState(VEC3 goal)
}
//displacement step
if
(
getOrientationEdge
(
goal
,
d
)
==
Geom
::
ON
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
m_positions
,
goal
))
if
(
getOrientationEdge
(
goal
,
d
)
==
Geom
::
ON
&&
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
m_positions
,
goal
))
edgeState
(
goal
);
else