Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
a3219fc5
Commit
a3219fc5
authored
Dec 02, 2011
by
Pierre Kraemer
Browse files
correction sewFaces dans embeddedMap2
parent
b70a54c5
Changes
6
Hide whitespace changes
Inline
Side-by-side
include/Algo/Import/importMesh.hpp
View file @
a3219fc5
...
...
@@ -38,15 +38,13 @@ namespace Import
template
<
typename
PFP
>
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
MeshTablesSurface
<
PFP
>&
mts
)
{
typedef
typename
PFP
::
VEC3
VEC3
;
AutoAttributeHandler
<
NoMathIONameAttribute
<
std
::
vector
<
Dart
>
>
>
vecDartsPerVertex
(
map
,
VERTEX
,
"incidents"
);
unsigned
nbf
=
mts
.
getNbFaces
();
int
index
=
0
;
// buffer for tempo faces (used to remove degenerated edges)
std
::
vector
<
unsigned
int
>
edgesBuffer
;
edgesBuffer
.
reserve
(
8
);
edgesBuffer
.
reserve
(
16
);
DartMarkerNoUnmark
m
(
map
)
;
...
...
@@ -79,7 +77,6 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
{
unsigned
int
em
=
edgesBuffer
[
j
];
// get embedding
map
.
embedOrbit
(
VERTEX
,
d
,
em
)
;
// map.setDartEmbedding(VERTEX, d, em); // associate to dart
vecDartsPerVertex
[
em
].
push_back
(
d
);
// store incident darts for fast adjacency reconstruction
d
=
map
.
phi1
(
d
);
}
...
...
@@ -124,9 +121,8 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
{
map
.
closeMap
();
CGoGNout
<<
"Map closed ("
<<
nbnm
<<
" boundary edges)"
<<
CGoGNendl
;
// ensure bijection between topo a embedding
// ensure bijection between topo a
nd
embedding
map
.
bijectiveOrbitEmbedding
(
VERTEX
);
}
return
true
;
...
...
include/Topology/gmap/embeddedGMap2.h
View file @
a3219fc5
...
...
@@ -101,7 +101,7 @@ public:
* 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
*/
virtual
void
sewFaces
(
Dart
d
,
Dart
e
,
bool
withBoundary
=
true
)
;
virtual
void
sewFaces
(
Dart
d
,
Dart
e
,
bool
withBoundary
=
true
)
;
/**
* The attributes attached to the vertices of the old edge of d are duplicated on the vertices of both resulting edges
...
...
src/Topology/gmap/embeddedGMap2.cpp
View file @
a3219fc5
...
...
@@ -295,28 +295,22 @@ void EmbeddedGMap2::sewFaces(Dart d, Dart e, bool withBoundary)
{
// for fixed point construction (import & primitives)
if
(
!
withBoundary
)
return
GMap2
::
sewFaces
(
d
,
e
,
false
)
;
unsigned
int
vEmb1
=
EMBNULL
;
unsigned
int
vEmb2
=
EMBNULL
;
if
(
isOrbitEmbedded
(
VERTEX
))
{
vEmb1
=
getEmbedding
(
VERTEX
,
d
)
;
vEmb2
=
getEmbedding
(
VERTEX
,
phi1
(
d
))
;
GMap2
::
sewFaces
(
d
,
e
,
false
)
;
return
;
}
GMap2
::
sewFaces
(
d
,
e
,
true
)
;
if
(
isOrbitEmbedded
(
VERTEX
))
{
embedOrbit
(
VERTEX
,
d
,
vEmb1
)
;
embedOrbit
(
VERTEX
,
e
,
vEmb2
)
;
embedOrbit
(
VERTEX
,
d
,
getEmbedding
(
VERTEX
,
d
)
)
;
embedOrbit
(
VERTEX
,
e
,
getEmbedding
(
VERTEX
,
beta0
(
d
))
)
;
}
if
(
isOrbitEmbedded
(
EDGE
))
{
vEmb1
=
getEmbedding
(
EDGE
,
d
)
;
embedOrbit
(
EDGE
,
e
,
vEmb1
)
;
embedOrbit
(
EDGE
,
e
,
getEmbedding
(
EDGE
,
d
))
;
}
}
...
...
src/Topology/gmap/gmap2.cpp
View file @
a3219fc5
...
...
@@ -705,6 +705,16 @@ bool GMap2::check()
}
CGoGNout
<<
"Check: topology ok"
<<
CGoGNendl
;
std
::
cout
<<
"nb vertex orbits"
<<
getNbOrbits
(
VERTEX
)
<<
std
::
endl
;
std
::
cout
<<
"nb vertex cells"
<<
m_attribs
[
VERTEX
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb edge orbits"
<<
getNbOrbits
(
EDGE
)
<<
std
::
endl
;
std
::
cout
<<
"nb edge cells"
<<
m_attribs
[
EDGE
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb face orbits"
<<
getNbOrbits
(
FACE
)
<<
std
::
endl
;
std
::
cout
<<
"nb face cells"
<<
m_attribs
[
FACE
].
size
()
<<
std
::
endl
;
return
true
;
}
...
...
src/Topology/map/embeddedMap2.cpp
View file @
a3219fc5
...
...
@@ -259,8 +259,11 @@ bool EmbeddedMap2::flipBackEdge(Dart d)
void
EmbeddedMap2
::
sewFaces
(
Dart
d
,
Dart
e
,
bool
withBoundary
)
{
// if (!withBoundary)
// return Map2::sewFaces(d, e, false) ;
if
(
!
withBoundary
)
{
Map2
::
sewFaces
(
d
,
e
,
false
)
;
return
;
}
Map2
::
sewFaces
(
d
,
e
,
withBoundary
)
;
...
...
src/Topology/map/map2.cpp
View file @
a3219fc5
...
...
@@ -28,65 +28,6 @@
namespace
CGoGN
{
/*! @name Boundary marker management
* Function used to merge boundary faces properly
*************************************************************************/
//void Map2::mergeBoundaryFaces(Dart dd, Dart ee)
//{
// if (ee != phi_1(dd))
// phi1sew(ee, phi_1(dd)) ;
// if (dd != phi_1(ee))
// phi1sew(dd, phi_1(ee)) ;
// deleteCycle(dd);
//}
//void Map2::mergeFaceWithBoundary(Dart d)
//{
// std::vector<Dart> storeForLinkVertex;
// std::vector<Dart> storeForLinkFace;
//
// Dart it = d ;
// do // foreach vertex/edge of face
// {
// Dart e = phi2(it) ;
// if(isBoundaryMarked(e)) // check if connection by edge
// {
// storeForLinkFace.push_back(it);
// storeForLinkFace.push_back(e);
// }
// else
// {
// Dart f = findBoundaryEdgeOfVertex(alpha1(it)); // check if connection by vertex
// if (f != it)
// {
// storeForLinkVertex.push_back(phi_1(it));
// storeForLinkVertex.push_back(phi_1(f));
// }
// }
// it = phi1(it) ;
// } while (it != d) ;
//
// // merge by vertices
// while (!storeForLinkVertex.empty())
// {
// Dart a = storeForLinkVertex.back() ;
// storeForLinkVertex.pop_back() ;
// Dart b = storeForLinkVertex.back() ;
// storeForLinkVertex.pop_back() ;
// phi1sew(a, b);
// }
// //merge by faces
// while (!storeForLinkFace.empty())
// {
// Dart a = storeForLinkVertex.back() ;
// storeForLinkVertex.pop_back() ;
// Dart b = storeForLinkVertex.back() ;
// storeForLinkVertex.pop_back() ;
// mergeBoundaryFaces(a, b);
// }
//}
/*! @name Generator and Deletor
* To generate or delete faces in a 2-map
*************************************************************************/
...
...
@@ -694,6 +635,7 @@ bool Map2::check()
if
(
phi2
(
d1
)
==
d
)
CGoGNout
<<
"Check: (warning) dangling edge"
<<
CGoGNendl
;
}
for
(
Dart
d
=
Map2
::
begin
();
d
!=
Map2
::
end
();
Map2
::
next
(
d
))
{
if
(
!
m
.
isMarked
(
d
))
// phi1 a au moins un antécédent ?
...
...
@@ -702,7 +644,18 @@ bool Map2::check()
return
false
;
}
}
CGoGNout
<<
"Check: topology ok"
<<
CGoGNendl
;
std
::
cout
<<
"nb vertex orbits"
<<
getNbOrbits
(
VERTEX
)
<<
std
::
endl
;
std
::
cout
<<
"nb vertex cells"
<<
m_attribs
[
VERTEX
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb edge orbits"
<<
getNbOrbits
(
EDGE
)
<<
std
::
endl
;
std
::
cout
<<
"nb edge cells"
<<
m_attribs
[
EDGE
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb face orbits"
<<
getNbOrbits
(
FACE
)
<<
std
::
endl
;
std
::
cout
<<
"nb face cells"
<<
m_attribs
[
FACE
].
size
()
<<
std
::
endl
;
return
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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