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
1713106d
Commit
1713106d
authored
Feb 15, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~jund/CGoGN
parents
ad78efa5
1572c7ca
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
41 deletions
+44
-41
include/Algo/BooleanOperator/mergeVertices.hpp
include/Algo/BooleanOperator/mergeVertices.hpp
+8
-5
include/Algo/Import/importSvg.hpp
include/Algo/Import/importSvg.hpp
+4
-4
include/Algo/MovingObjects/particle_cell_2D.h
include/Algo/MovingObjects/particle_cell_2D.h
+3
-3
include/Algo/MovingObjects/particle_cell_2D.hpp
include/Algo/MovingObjects/particle_cell_2D.hpp
+14
-14
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
+15
-15
No files found.
include/Algo/BooleanOperator/mergeVertices.hpp
View file @
1713106d
...
...
@@ -53,15 +53,16 @@ void mergeVertex(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& po
Dart
e1
=
map
.
alpha1
(
e
)
;
// e1 stores next dart of vertex of e
if
(
e1
==
e
)
notempty
=
false
;
// last dart of vertex of e
else
{
else
{
map
.
removeEdgeFromVertex
(
e
)
;
// detach e from its vertex
}
// Searchs where e may be inserted in the vertex of d
Dart
d1
=
d
;
do
{
if
(
CGoGN
::
Algo
::
BooleanOperator
::
isBetween
<
PFP
>
(
map
,
positions
,
e
,
d
,
map
.
alpha1
(
d
)))
break
;
if
(
isBetween
<
PFP
>
(
map
,
positions
,
e
,
d
,
map
.
alpha1
(
d
)))
break
;
d
=
map
.
alpha1
(
d
)
;
}
while
(
d
!=
d1
)
;
...
...
@@ -91,8 +92,10 @@ void mergeVertices(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>&
{
if
(
positions
[
d1
].
isNear
(
positions
[
d2
],
precision
))
{
if
(
map
.
sameVertex
(
d1
,
d2
))
std
::
cout
<<
"fusion: sameVertex"
<<
std
::
endl
;
if
(
!
map
.
sameVertex
(
d1
,
d2
))
mergeVertex
<
PFP
>
(
map
,
positions
,
d1
,
d2
,
precision
);
if
(
map
.
sameVertex
(
d1
,
d2
))
std
::
cout
<<
"fusion: sameVertex"
<<
std
::
endl
;
if
(
!
map
.
sameVertex
(
d1
,
d2
))
mergeVertex
<
PFP
>
(
map
,
positions
,
d1
,
d2
,
precision
);
}
}
}
...
...
include/Algo/Import/importSvg.hpp
View file @
1713106d
...
...
@@ -350,7 +350,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
/////////////////////////////////////////////////////////////////////////////////////////////
// Merge near vertices
Algo
::
BooleanOperator
::
mergeVertices
<
PFP
>
(
map
,
position
,
1
);
BooleanOperator
::
mergeVertices
<
PFP
>
(
map
,
position
,
1
);
std
::
cout
<<
"importSVG : Merging of vertices."
<<
std
::
endl
;
/////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -521,7 +521,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
{
for
(
Dart
d
=
map
.
begin
()
;
d
!=
map
.
end
()
;
map
.
next
(
d
))
{
if
(
map
.
isBoundaryMarked
(
d
))
if
(
map
.
isBoundaryMarked
2
(
d
))
{
map
.
fillHole
(
d
);
}
...
...
@@ -557,7 +557,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
for
(
Dart
d
=
map
.
begin
()
;
d
!=
map
.
end
()
;
map
.
next
(
d
))
{
if
(
!
map
.
isBoundaryMarked
(
d
)
&&
brokenL
.
isMarked
(
d
))
if
(
!
map
.
isBoundaryMarked
2
(
d
)
&&
brokenL
.
isMarked
(
d
))
{
map
.
deleteFace
(
d
,
false
);
}
...
...
@@ -567,7 +567,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
for
(
Dart
d
=
map
.
begin
()
;
d
!=
map
.
end
()
;
map
.
next
(
d
))
{
if
(
map
.
isBoundaryMarked
(
d
))
if
(
map
.
isBoundaryMarked
2
(
d
))
buildingMark
.
mark
(
d
);
}
...
...
include/Algo/MovingObjects/particle_cell_2D.h
View file @
1713106d
...
...
@@ -29,7 +29,7 @@ enum
}
;
template
<
typename
PFP
>
class
ParticleCell2D
:
public
MovingObjects
::
ParticleBase
<
PFP
>
class
ParticleCell2D
:
public
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
{
public:
typedef
typename
PFP
::
MAP
MAP
;
...
...
@@ -46,7 +46,7 @@ public:
unsigned
int
crossCell
;
ParticleCell2D
(
MAP
&
map
,
Dart
belonging_cell
,
const
VEC3
&
pos
,
const
TAB_POS
&
tabPos
)
:
ParticleBase
<
PFP
>
(
pos
),
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
(
pos
),
m
(
map
),
positionAttribut
(
tabPos
),
d
(
belonging_cell
),
...
...
@@ -105,7 +105,7 @@ public:
else
{
// TODO Des petits pas répétés peuvent faire sortir de la cellule actuelle
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
}
}
}
;
...
...
include/Algo/MovingObjects/particle_cell_2D.hpp
View file @
1713106d
...
...
@@ -104,7 +104,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
if
(
Geometry
::
isPointOnVertex
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
{
this
->
setState
(
VERTEX
)
;
this
->
ParticleBase
<
PFP
>
::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
::
move
(
goal
)
;
return
;
}
else
...
...
@@ -147,7 +147,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
this
->
setState
(
VERTEX
)
;
this
->
ParticleBase
<
PFP
>
::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
::
move
(
goal
)
;
return
;
}
}
...
...
@@ -212,19 +212,19 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
))
{
this
->
ParticleBase
<
PFP
>
::
move
(
positionAttribut
[
d
])
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
::
move
(
positionAttribut
[
d
])
;
vertexState
(
goal
)
;
return
;
}
else
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
m
.
phi2
(
d
),
positionAttribut
,
goal
))
{
d
=
m
.
phi2
(
d
)
;
this
->
ParticleBase
<
PFP
>
::
move
(
positionAttribut
[
d
])
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
::
move
(
positionAttribut
[
d
])
;
vertexState
(
goal
)
;
return
;
}
this
->
ParticleBase
<
PFP
>
::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>
::
move
(
goal
)
;
}
template
<
typename
PFP
>
...
...
@@ -341,16 +341,16 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
d
=
m
.
phi1
(
d
)
;
break
;
case
Geom
::
ALIGNED
:
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
edgeState
(
goal
)
;
return
;
case
Geom
::
RIGHT
:
this
->
ParticleBase
<
PFP
>::
move
(
intersectLineEdge
(
goal
,
this
->
getPosition
(),
d
))
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
intersectLineEdge
(
goal
,
this
->
getPosition
(),
d
))
;
edgeState
(
goal
,
Geom
::
RIGHT
)
;
return
;
}
}
while
(
d
!=
dd
)
;
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
setState
(
FACE
)
;
// m_position = Geometry::faceCentroid<PFP>(m,d,m_positions);
...
...
@@ -387,19 +387,19 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
break
;
case
Geom
::
ALIGNED
:
// CGoGNout << "pic" << CGoGNendl;
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
edgeState
(
goal
)
;
return
;
case
Geom
::
RIGHT
:
// CGoGNout << "smthg went bad(2) " << m_position << CGoGNendl;
this
->
ParticleBase
<
PFP
>::
move
(
intersectLineEdge
(
goal
,
this
->
getPosition
(),
d
))
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
intersectLineEdge
(
goal
,
this
->
getPosition
(),
d
))
;
// CGoGNout << " " << m_position << CGoGNendl;
edgeState
(
goal
,
Geom
::
RIGHT
)
;
return
;
}
}
while
(
d
!=
dd
)
;
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
setState
(
FACE
)
;
return
;
}
...
...
@@ -409,7 +409,7 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
switch
(
getOrientationEdge
(
goal
,
d
))
{
case
Geom
::
LEFT
:
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
setState
(
FACE
)
;
;
break
;
...
...
@@ -428,12 +428,12 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
if
(
wsoe
==
Geom
::
ALIGNED
)
{
d
=
m
.
phi1
(
d
)
;
//to check
this
->
ParticleBase
<
PFP
>::
move
(
positionAttribut
[
d
])
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
positionAttribut
[
d
])
;
vertexState
(
goal
)
;
}
else
{
this
->
ParticleBase
<
PFP
>::
move
(
intersectLineEdge
(
goal
,
this
->
getPosition
(),
d
))
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
intersectLineEdge
(
goal
,
this
->
getPosition
(),
d
))
;
edgeState
(
goal
,
Geom
::
RIGHT
)
;
}
break
;
...
...
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
View file @
1713106d
...
...
@@ -59,7 +59,7 @@ std::vector<Dart> ParticleCell2DMemo<PFP>::move(const VEC3& goal)
return
memo_cross
.
get_markedCells
();
}
else
this
->
ParticleBase
<
PFP
>::
move
(
goal
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
goal
)
;
std
::
vector
<
Dart
>
res
;
res
.
push_back
(
this
->
d
);
...
...
@@ -87,7 +87,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
if
(
Geometry
::
isPointOnVertex
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
{
this
->
setState
(
VERTEX
)
;
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
return
;
}
else
...
...
@@ -130,7 +130,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<FA
this
->
d
=
this
->
m
.
phi2_1
(
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
)
;
return
;
}
...
...
@@ -199,7 +199,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
if
(
!
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
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
)
;
return
;
}
...
...
@@ -207,12 +207,12 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<FACE
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
))
{
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
)
;
return
;
}
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
}
template
<
typename
PFP
>
...
...
@@ -253,20 +253,20 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
this
->
d
=
this
->
m
.
phi1
(
this
->
d
)
;
break
;
case
Geom
::
ALIGNED
:
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
edgeState
(
current
,
memo_cross
)
;
return
;
case
Geom
::
RIGHT
:
// CGoGNout << "smthg went bad " << m_position << " " << current << CGoGNendl;
// CGoGNout << "d1 " << m_positions[d] << " d2 " << m_positions[m.phi1(d)] << CGoGNendl;
this
->
ParticleBase
<
PFP
>::
move
(
this
->
intersectLineEdge
(
current
,
this
->
getPosition
(),
this
->
d
))
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
this
->
intersectLineEdge
(
current
,
this
->
getPosition
(),
this
->
d
))
;
// CGoGNout << " " << m_position << CGoGNendl;
edgeState
(
current
,
memo_cross
,
Geom
::
RIGHT
)
;
return
;
}
}
while
(
this
->
d
!=
dd
)
;
this
->
ParticleBase
<
PFP
>::
move
(
current
);
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
);
this
->
setState
(
FACE
)
;
// m_position = Geometry::faceCentroid<PFP>(m,d,m_positions);
...
...
@@ -303,19 +303,19 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
break
;
case
Geom
::
ALIGNED
:
// CGoGNout << "pic" << CGoGNendl;
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
edgeState
(
current
,
memo_cross
)
;
return
;
case
Geom
::
RIGHT
:
// CGoGNout << "smthg went bad(2) " << m_position << CGoGNendl;
this
->
ParticleBase
<
PFP
>::
move
(
this
->
intersectLineEdge
(
current
,
this
->
getPosition
(),
this
->
d
))
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
this
->
intersectLineEdge
(
current
,
this
->
getPosition
(),
this
->
d
))
;
// CGoGNout << " " << m_position << CGoGNendl;
edgeState
(
current
,
memo_cross
,
Geom
::
RIGHT
)
;
return
;
}
}
while
(
this
->
d
!=
dd
)
;
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
setState
(
FACE
)
;
return
;
}
...
...
@@ -325,7 +325,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
switch
(
this
->
getOrientationEdge
(
current
,
this
->
d
))
{
case
Geom
::
LEFT
:
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
setState
(
FACE
)
;
;
break
;
...
...
@@ -345,12 +345,12 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<FACE
{
this
->
d
=
this
->
m
.
phi1
(
this
->
d
)
;
//to check
this
->
ParticleBase
<
PFP
>::
move
(
this
->
positionAttribut
[
this
->
d
])
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
this
->
positionAttribut
[
this
->
d
])
;
vertexState
(
current
,
memo_cross
)
;
}
else
{
this
->
ParticleBase
<
PFP
>::
move
(
this
->
intersectLineEdge
(
current
,
this
->
getPosition
(),
this
->
d
))
;
this
->
Algo
::
MovingObjects
::
ParticleBase
<
PFP
>::
move
(
this
->
intersectLineEdge
(
current
,
this
->
getPosition
(),
this
->
d
))
;
edgeState
(
current
,
memo_cross
,
Geom
::
RIGHT
)
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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