Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CGoGN
CGoGN
Commits
584a38ff
Commit
584a38ff
authored
Nov 10, 2011
by
Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
suppr cutSpike, nettoyage embeddedGmap
parent
86cc07a8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
204 additions
and
332 deletions
+204
-332
include/Topology/gmap/embeddedGMap2.h
include/Topology/gmap/embeddedGMap2.h
+15
-15
include/Topology/gmap/embeddedGMap3.h
include/Topology/gmap/embeddedGMap3.h
+15
-41
include/Topology/gmap/gmap3.h
include/Topology/gmap/gmap3.h
+0
-5
src/Topology/gmap/embeddedGMap2.cpp
src/Topology/gmap/embeddedGMap2.cpp
+78
-77
src/Topology/gmap/embeddedGMap3.cpp
src/Topology/gmap/embeddedGMap3.cpp
+96
-132
src/Topology/gmap/gmap3.cpp
src/Topology/gmap/gmap3.cpp
+0
-62
No files found.
include/Topology/gmap/embeddedGMap2.h
View file @
584a38ff
...
...
@@ -54,7 +54,7 @@ public:
// * No attribute is attached to the new edge
// * The attributes attached to the face of dart d are kept on the resulting face
// */
//
virtual void linkVertices(Dart d, Dart e) ;
virtual
void
linkVertices
(
Dart
d
,
Dart
e
)
;
/**
* No attribute is attached to the new vertex
...
...
@@ -62,10 +62,10 @@ public:
*/
virtual
void
cutEdge
(
Dart
d
)
;
//
/**
//
* The attributes attached to the edge of d are kept on the resulting edge
//
*/
//
virtual void uncutEdge(Dart d) ;
/**
* The attributes attached to the edge of d are kept on the resulting edge
*/
virtual
void
uncutEdge
(
Dart
d
)
;
/**
* Check if the edge of d can be collapsed or not based on some topological conditions
...
...
@@ -91,17 +91,17 @@ public:
*/
virtual
bool
flipBackEdge
(
Dart
d
)
;
//
/**
//
* The attributes attached to the vertex of dart d are kept on the resulting vertex
//
* The attributes attached to the face of dart d are overwritten on the face of dart e
//
*/
//
virtual void insertEdgeInVertex(Dart d, Dart e);
/**
* The attributes attached to the vertex of dart d are kept on the resulting vertex
* The attributes attached to the face of dart d are overwritten on the face of dart e
*/
virtual
void
insertEdgeInVertex
(
Dart
d
,
Dart
e
);
//
/**
//
* The attributes attached to the vertex of dart d are kept on the resulting vertex
//
* The attributes attached to the face of dart d are overwritten on the face of dart e
//
*/
//
virtual void removeEdgeFromVertex(Dart d);
/**
* The attributes attached to the vertex of dart d are kept on the resulting vertex
* The attributes attached to the face of dart d are overwritten on the face of dart e
*/
virtual
void
removeEdgeFromVertex
(
Dart
d
);
/**
* The attributes attached to the vertices of the edge of d are kept on the vertices of the resulting edge
...
...
include/Topology/gmap/embeddedGMap3.h
View file @
584a38ff
...
...
@@ -39,6 +39,11 @@ class EmbeddedGMap3 : public GMap3
public:
typedef
GMap3
TOPO_MAP
;
//! Cut the edge of d
/*! @param d a dart of the edge to cut
*/
virtual
void
cutEdge
(
Dart
d
);
/**
* The attributes attached to the vertices of the edge of d are kept on the vertices of the resulting edge
* The attributes attached to the edge of d are kept on the resulting edge
...
...
@@ -53,6 +58,14 @@ public:
*/
virtual
void
unsewFaces
(
Dart
d
);
//! Split a face inserting an edge between two vertices
/*! \pre Dart d and e should belong to the same face and be distinct
* @param d dart of first vertex
* @param e dart of second vertex
* @return the dart of the new edge lying in the vertex of d after the cut
*/
virtual
void
splitFace
(
Dart
d
,
Dart
e
);
/**
* The attributes attached to the vertices of the vertices of the face of d are kept on the vertices of the resulting face
* The attributes attached to the edges of the face of d are kept on the resulting face
...
...
@@ -67,50 +80,11 @@ public:
*/
virtual
void
unsewVolumes
(
Dart
d
);
//!
/*!
*
/**
* The attributes attached to the volume of the old volume of d are kept on the resulting volume
*/
virtual
bool
mergeVolumes
(
Dart
d
);
//! Split a face inserting an edge between two vertices
/*! \pre Dart d and e should belong to the same face and be distinct
* @param d dart of first vertex
* @param e dart of second vertex
* @return the dart of the new edge lying in the vertex of d after the cut
*/
virtual
void
splitFace
(
Dart
d
,
Dart
e
);
//! Cut the edge of d
/*! @param d a dart of the edge to cut
*/
virtual
void
cutEdge
(
Dart
d
);
// //!
// /*!
// *
// */
// virtual Dart cutSpike(Dart d);
// //! Collapse an edge (that is deleted) possibly merging its vertices
// /*! If delDegenerateFaces is true, the method checks that no degenerate
// * faces are build (faces with less than 3 edges). If it occurs the faces
// * are deleted and the adjacencies are updated (see deleteIfDegenerated).
// * \warning This may produce two distinct vertices if the edge
// * was the only link between two border faces
// * @param d a dart in the deleted edge
// * @param delDegenerateFaces a boolean (default to true)
// */
// virtual int collapseEdge(Dart d, bool delDegenerateFaces = true,
// bool delDegenerateVolumes = true);
// //!
// /*!
// *
// */
// virtual void collapseFace(Dart d, bool delDegenerateFaces = true,
// bool delDegenerateVolumes = true);
virtual
unsigned
int
closeHole
(
Dart
d
);
virtual
void
closeMap
(
DartMarker
&
marker
);
...
...
include/Topology/gmap/gmap3.h
View file @
584a38ff
...
...
@@ -115,11 +115,6 @@ public:
*/
virtual
void
splitFace
(
Dart
d
,
Dart
e
);
//! Unsew the "ear" of the vertex of d
/*! @param d a dart
*/
virtual
Dart
cutSpike
(
Dart
d
);
//! Sew two oriented volumes along their faces.
/*! The oriented faces should not be phi3-linked and have the same length
* @param d a dart of the first volume
...
...
src/Topology/gmap/embeddedGMap2.cpp
View file @
584a38ff
...
...
@@ -70,23 +70,25 @@ bool EmbeddedGMap2::deleteVertex(Dart d)
return
false
;
}
//void EmbeddedGMap2::linkVertices(Dart d, Dart e)
//{
// Dart dNext = phi1(d) ;
//
// GMap2::linkVertices(d,e);
//
// if (isOrbitEmbedded(VERTEX))
// {
// copyDartEmbedding(VERTEX, phi_1(e), d) ;
// copyDartEmbedding(VERTEX, phi_1(d), e) ;
// }
//
// if (isOrbitEmbedded(FACE))
// {
// embedOrbit(FACE, dNext, getEmbedding(FACE, dNext)) ;
// }
//}
void
EmbeddedGMap2
::
linkVertices
(
Dart
d
,
Dart
e
)
{
Dart
dNext
=
phi1
(
d
)
;
GMap2
::
linkVertices
(
d
,
e
);
if
(
isOrbitEmbedded
(
VERTEX
))
{
copyDartEmbedding
(
VERTEX
,
phi_1
(
e
),
d
)
;
copyDartEmbedding
(
VERTEX
,
beta2
(
phi_1
(
e
)),
d
)
;
copyDartEmbedding
(
VERTEX
,
phi_1
(
d
),
e
)
;
copyDartEmbedding
(
VERTEX
,
beta2
(
phi_1
(
d
)),
e
)
;
}
if
(
isOrbitEmbedded
(
FACE
))
{
embedOrbit
(
FACE
,
dNext
,
getEmbedding
(
FACE
,
dNext
))
;
}
}
void
EmbeddedGMap2
::
cutEdge
(
Dart
d
)
{
...
...
@@ -113,18 +115,16 @@ void EmbeddedGMap2::cutEdge(Dart d)
}
}
//void EmbeddedGMap2::uncutEdge(Dart d)
//{
// bool doSomethg = (d != phi2(d)) ;
//
// GMap2::uncutEdge(d) ;
//
// if(doSomethg)
// {
// if(isOrbitEmbedded(EDGE))
// copyDartEmbedding(EDGE, phi2(d), d) ;
// }
//}
void
EmbeddedGMap2
::
uncutEdge
(
Dart
d
)
{
bool
doSomethg
=
(
d
!=
phi2
(
d
))
;
GMap2
::
uncutEdge
(
d
)
;
if
(
doSomethg
)
if
(
isOrbitEmbedded
(
EDGE
))
embedOrbit
(
EDGE
,
d
,
getEmbedding
(
EDGE
,
d
))
;
}
bool
EmbeddedGMap2
::
edgeCanCollapse
(
Dart
d
)
{
...
...
@@ -247,54 +247,55 @@ bool EmbeddedGMap2::flipBackEdge(Dart d)
return
false
;
}
//void EmbeddedGMap2::insertEdgeInVertex(Dart d, Dart e)
//{
// GMap2::insertEdgeInVertex(d, e);
//
// if (isOrbitEmbedded(VERTEX))
// {
// copyDartEmbedding(VERTEX, e, d) ;
// }
//
// if (isOrbitEmbedded(FACE))
// {
// if(!sameFace(d,e))
// {
// embedNewCell(FACE, e);
// copyCell(FACE, e, d) ;
// }
// else
// {
// embedOrbit(FACE, d, getEmbedding(FACE, d)) ;
// }
// }
//}
//void EmbeddedGMap2::removeEdgeFromVertex(Dart d)
//{
// Dart dPrev = alpha_1(d);
//
// GMap2::removeEdgeFromVertex(d);
//
// if (isOrbitEmbedded(VERTEX))
// {
// embedNewCell(VERTEX, d);
// copyCell(VERTEX, d, dPrev);
// }
//
// if (isOrbitEmbedded(FACE))
// {
// if(!sameFace(d, dPrev))
// {
// embedNewCell(FACE, d);
// copyCell(FACE, d, dPrev) ;
// }
// else
// {
// embedOrbit(FACE, d, getEmbedding(FACE, d)) ;
// }
// }
//}
void
EmbeddedGMap2
::
insertEdgeInVertex
(
Dart
d
,
Dart
e
)
{
GMap2
::
insertEdgeInVertex
(
d
,
e
);
if
(
isOrbitEmbedded
(
VERTEX
))
{
copyDartEmbedding
(
VERTEX
,
e
,
d
)
;
copyDartEmbedding
(
VERTEX
,
beta2
(
e
),
d
)
;
}
if
(
isOrbitEmbedded
(
FACE
))
{
if
(
!
sameFace
(
d
,
e
))
{
embedNewCell
(
FACE
,
e
);
copyCell
(
FACE
,
e
,
d
)
;
}
else
{
embedOrbit
(
FACE
,
d
,
getEmbedding
(
FACE
,
d
))
;
}
}
}
void
EmbeddedGMap2
::
removeEdgeFromVertex
(
Dart
d
)
{
Dart
dPrev
=
alpha_1
(
d
);
GMap2
::
removeEdgeFromVertex
(
d
);
if
(
isOrbitEmbedded
(
VERTEX
))
{
embedNewCell
(
VERTEX
,
d
);
copyCell
(
VERTEX
,
d
,
dPrev
);
}
if
(
isOrbitEmbedded
(
FACE
))
{
if
(
!
sameFace
(
d
,
dPrev
))
{
embedNewCell
(
FACE
,
d
);
copyCell
(
FACE
,
d
,
dPrev
)
;
}
else
{
embedOrbit
(
FACE
,
d
,
getEmbedding
(
FACE
,
d
))
;
}
}
}
void
EmbeddedGMap2
::
sewFaces
(
Dart
d
,
Dart
e
)
{
...
...
src/Topology/gmap/embeddedGMap3.cpp
View file @
584a38ff
...
...
@@ -30,6 +30,58 @@
namespace
CGoGN
{
void
EmbeddedGMap3
::
cutEdge
(
Dart
d
)
{
GMap3
::
cutEdge
(
d
);
if
(
isOrbitEmbedded
(
EDGE
))
{
Dart
nd
=
phi1
(
d
);
embedNewCell
(
EDGE
,
nd
);
copyCell
(
EDGE
,
nd
,
d
);
unsigned
int
vEmb
=
getEmbedding
(
EDGE
,
d
);
embedOrbit
(
EDGE
,
d
,
vEmb
);
}
if
(
isOrbitEmbedded
(
FACE
))
{
Dart
f
=
d
;
do
{
Dart
nd
=
phi1
(
f
);
unsigned
int
fEmb
=
getEmbedding
(
FACE
,
f
);
embedOrbit
(
FACE
,
nd
,
fEmb
);
Dart
f2
=
phi2
(
nd
);
if
(
f2
!=
nd
)
{
Dart
nd2
=
phi2
(
f
);
unsigned
int
fEmb2
=
getEmbedding
(
FACE
,
f2
);
embedOrbit
(
FACE
,
nd2
,
fEmb2
);
}
f
=
alpha2
(
f
);
}
while
(
f
!=
d
);
}
if
(
isOrbitEmbedded
(
VOLUME
))
{
Dart
f
=
d
;
do
{
Dart
nd
=
phi1
(
f
);
copyDartEmbedding
(
VOLUME
,
nd
,
f
);
copyDartEmbedding
(
VOLUME
,
beta1
(
nd
),
f
);
copyDartEmbedding
(
VOLUME
,
beta2
(
nd
),
f
);
copyDartEmbedding
(
VOLUME
,
beta1
(
beta2
(
nd
)),
f
);
f
=
alpha2
(
f
);
}
while
(
f
!=
d
);
}
}
void
EmbeddedGMap3
::
sewFaces
(
Dart
d
,
Dart
e
)
{
GMap3
::
sewFaces
(
d
,
e
);
...
...
@@ -96,6 +148,50 @@ void EmbeddedGMap3::unsewFaces(Dart d)
}
}
void
EmbeddedGMap3
::
splitFace
(
Dart
d
,
Dart
e
)
{
GMap3
::
splitFace
(
d
,
e
);
if
(
isOrbitEmbedded
(
VERTEX
))
{
unsigned
int
vEmb
=
getEmbedding
(
VERTEX
,
d
);
embedOrbit
(
VERTEX
,
phi2
(
phi_1
(
d
)),
vEmb
);
vEmb
=
getEmbedding
(
VERTEX
,
e
);
embedOrbit
(
VERTEX
,
phi2
(
phi_1
(
e
)),
vEmb
);
}
if
(
isOrbitEmbedded
(
FACE
))
{
embedNewCell
(
FACE
,
phi2
(
phi_1
(
d
)));
copyCell
(
FACE
,
phi2
(
phi_1
(
d
)),
d
);
copyDartEmbedding
(
FACE
,
phi_1
(
d
),
d
);
copyDartEmbedding
(
FACE
,
beta0
(
phi_1
(
d
)),
beta0
(
d
));
copyDartEmbedding
(
FACE
,
beta3
(
phi_1
(
d
)),
beta3
(
d
));
copyDartEmbedding
(
FACE
,
beta3
(
beta0
(
phi_1
(
d
))),
beta3
(
beta0
(
d
)));
}
if
(
isOrbitEmbedded
(
VOLUME
))
{
copyDartEmbedding
(
VOLUME
,
phi_1
(
d
),
d
);
copyDartEmbedding
(
VOLUME
,
beta0
(
phi_1
(
d
)),
beta0
(
d
));
copyDartEmbedding
(
VOLUME
,
phi2
(
phi_1
(
d
)),
d
);
copyDartEmbedding
(
VOLUME
,
beta0
(
phi2
(
phi_1
(
d
))),
beta0
(
d
));
if
(
phi3
(
d
)
!=
d
)
{
Dart
d3
=
phi3
(
d
);
copyDartEmbedding
(
VOLUME
,
phi1
(
d3
),
d3
);
copyDartEmbedding
(
VOLUME
,
beta0
(
phi1
(
d3
)),
beta0
(
d3
));
copyDartEmbedding
(
VOLUME
,
phi2
(
phi1
(
d3
)),
d3
);
copyDartEmbedding
(
VOLUME
,
beta0
(
phi2
(
phi1
(
d3
))),
beta0
(
d3
));
}
}
}
void
EmbeddedGMap3
::
sewVolumes
(
Dart
d
,
Dart
e
)
{
//topological sewing
...
...
@@ -197,138 +293,6 @@ bool EmbeddedGMap3::mergeVolumes(Dart d)
return
false
;
}
void
EmbeddedGMap3
::
splitFace
(
Dart
d
,
Dart
e
)
{
GMap3
::
splitFace
(
d
,
e
);
if
(
isOrbitEmbedded
(
VERTEX
))
{
unsigned
int
vEmb
=
getEmbedding
(
VERTEX
,
d
);
embedOrbit
(
VERTEX
,
phi2
(
phi_1
(
d
)),
vEmb
);
vEmb
=
getEmbedding
(
VERTEX
,
e
);
embedOrbit
(
VERTEX
,
phi2
(
phi_1
(
e
)),
vEmb
);
}
if
(
isOrbitEmbedded
(
FACE
))
{
embedNewCell
(
FACE
,
phi2
(
phi_1
(
d
)));
copyCell
(
FACE
,
phi2
(
phi_1
(
d
)),
d
);
copyDartEmbedding
(
FACE
,
phi_1
(
d
),
d
);
copyDartEmbedding
(
FACE
,
beta0
(
phi_1
(
d
)),
beta0
(
d
));
copyDartEmbedding
(
FACE
,
beta3
(
phi_1
(
d
)),
beta3
(
d
));
copyDartEmbedding
(
FACE
,
beta3
(
beta0
(
phi_1
(
d
))),
beta3
(
beta0
(
d
)));
}
if
(
isOrbitEmbedded
(
VOLUME
))
{
copyDartEmbedding
(
VOLUME
,
phi_1
(
d
),
d
);
copyDartEmbedding
(
VOLUME
,
beta0
(
phi_1
(
d
)),
beta0
(
d
));
copyDartEmbedding
(
VOLUME
,
phi2
(
phi_1
(
d
)),
d
);
copyDartEmbedding
(
VOLUME
,
beta0
(
phi2
(
phi_1
(
d
))),
beta0
(
d
));
if
(
phi3
(
d
)
!=
d
)
{
Dart
d3
=
phi3
(
d
);
copyDartEmbedding
(
VOLUME
,
phi1
(
d3
),
d3
);
copyDartEmbedding
(
VOLUME
,
beta0
(
phi1
(
d3
)),
beta0
(
d3
));
copyDartEmbedding
(
VOLUME
,
phi2
(
phi1
(
d3
)),
d3
);
copyDartEmbedding
(
VOLUME
,
beta0
(
phi2
(
phi1
(
d3
))),
beta0
(
d3
));
}
}
}
void
EmbeddedGMap3
::
cutEdge
(
Dart
d
)
{
GMap3
::
cutEdge
(
d
);
if
(
isOrbitEmbedded
(
EDGE
))
{
Dart
nd
=
phi1
(
d
);
embedNewCell
(
EDGE
,
nd
);
copyCell
(
EDGE
,
nd
,
d
);
unsigned
int
vEmb
=
getEmbedding
(
EDGE
,
d
);
embedOrbit
(
EDGE
,
d
,
vEmb
);
}
if
(
isOrbitEmbedded
(
FACE
))
{
Dart
f
=
d
;
do
{
Dart
nd
=
phi1
(
f
);
unsigned
int
fEmb
=
getEmbedding
(
FACE
,
f
);
embedOrbit
(
FACE
,
nd
,
fEmb
);
Dart
f2
=
phi2
(
nd
);
if
(
f2
!=
nd
)
{
Dart
nd2
=
phi2
(
f
);
unsigned
int
fEmb2
=
getEmbedding
(
FACE
,
f2
);
embedOrbit
(
FACE
,
nd2
,
fEmb2
);
}
f
=
alpha2
(
f
);
}
while
(
f
!=
d
);
}
if
(
isOrbitEmbedded
(
VOLUME
))
{
// Dart f = d;
// do
// {
// unsigned int fEmb2 = getEmbedding(VOLUME, d);
// embedOrbit(VOLUME, d, fEmb2);
// f = alpha2(f);
// } while(f != d);
Dart
f
=
d
;
do
{
Dart
nd
=
phi1
(
f
);
copyDartEmbedding
(
VOLUME
,
nd
,
f
);
copyDartEmbedding
(
VOLUME
,
beta1
(
nd
),
f
);
copyDartEmbedding
(
VOLUME
,
beta2
(
nd
),
f
);
copyDartEmbedding
(
VOLUME
,
beta1
(
beta2
(
nd
)),
f
);
// Dart nd2 = beta2(nd);
// if(f!=nd2)
// {
// copyDartEmbedding(VOLUME, nd2, f);
// copyDartEmbedding(VOLUME, beta0(nd2), f);
// }
f
=
alpha2
(
f
);
}
while
(
f
!=
d
);
}
}
//int EmbeddedGMap3::collapseEdge(Dart d, bool delDegenerateFaces,
// bool delDegenerateVolumes)
//{
// int nbCol = GMap3::collapseEdge(d,delDegenerateFaces,delDegenerateVolumes);
//
// return nbCol;
//}
//void EmbeddedGMap3::collapseFace(Dart d, bool delDegenerateFaces,
// bool delDegenerateVolumes)
//{
// GMap3::collapseFace(d,delDegenerateFaces,delDegenerateVolumes);
//
//// if(isOrbitEmbedded(VERTEX))
//// {
//// embedOrbit(VERTEX,dsave,vEmb);
//// }
//}
//TODO collapseVolume
unsigned
int
EmbeddedGMap3
::
closeHole
(
Dart
d
)
{
unsigned
int
nbE
=
GMap3
::
closeHole
(
d
);
...
...
src/Topology/gmap/gmap3.cpp
View file @
584a38ff
...
...
@@ -135,68 +135,6 @@ void GMap3::splitFace(Dart d, Dart e)
}
}
Dart
GMap3
::
cutSpike
(
Dart
d
)
{
Dart
e
=
d
;
int
nb
=
0
;
Dart
dNew
;
int
tet
=
0
;
//count the valence of the vertex
do
{
nb
++
;
e
=
phi1
(
phi2
(
e
));
}
while
(
nb
<
3
&&
e
!=
d
);
if
(
nb
<
3
)
{
CGoGNout
<<
"Warning : cannot cut 2 volumes without creating a degenerated face "
<<
CGoGNendl
;
return
d
;
}
else
{
//triangulate around the vertex
do
{
if
(
phi1
(
phi1
(
phi1
(
e
)))
!=
e
)
{
splitFace
(
phi_1
(
e
),
phi1
(
e
));
//CGoGNout << "split" << CGoGNendl;
}
else
tet
++
;
e
=
phi1
(
phi2
(
e
));
}
while
(
e
!=
d
);
// CGoGNout << "#tet= " << tet << CGoGNendl;
// CGoGNout << "#nb= " << nb << CGoGNendl;
//si toute ces faces ne sont pas triangulaires (on insere une face)
if
(
tet
!=
nb
)
{
//CGoGNout << "new face" << CGoGNendl;
dNew
=
newFace
(
nb
);
Dart
d3
=
newFace
(
nb
);
sewVolumes
(
dNew
,
d3
);
//sew a face following the triangles
Dart
dTurn
=
dNew
;
do
{
Dart
d1
=
phi1
(
e
);
Dart
dSym
=
phi2
(
d1
);
phi2unsew
(
d1
);
phi2sew
(
dTurn
,
d1
);
phi2sew
(
phi3
(
dTurn
),
dSym
);