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
David Cazier
CGoGN
Commits
3dd929f4
Commit
3dd929f4
authored
Feb 21, 2012
by
Pierre Kraemer
Browse files
MRDAT import OK + closeMap returns number of holes
parent
7596ab32
Changes
11
Hide whitespace changes
Inline
Side-by-side
include/Algo/Import/importMRDAT.h
View file @
3dd929f4
...
...
@@ -76,10 +76,6 @@ public:
{
if
(
isSubdivided
())
{
unsigned
int
emb0
=
vID
[
children
[
0
]
->
indices
[
0
]]
;
unsigned
int
emb1
=
vID
[
children
[
0
]
->
indices
[
1
]]
;
unsigned
int
emb2
=
vID
[
children
[
0
]
->
indices
[
2
]]
;
Dart
d0
=
map
.
phi1
(
d
)
;
Dart
d1
,
d2
;
if
(
CCW
)
...
...
@@ -93,9 +89,40 @@ public:
d2
=
map
.
phi_1
(
d
)
;
}
map
.
incCurrentLevel
()
;
map
.
embedOrbit
(
VERTEX
,
map
.
phi1
(
d0
),
emb0
)
;
map
.
embedOrbit
(
VERTEX
,
map
.
phi1
(
d1
),
emb1
)
;
map
.
embedOrbit
(
VERTEX
,
map
.
phi1
(
d2
),
emb2
)
;
unsigned
int
emb0
=
vID
[
children
[
0
]
->
indices
[
0
]]
;
unsigned
int
e0
=
map
.
getEmbedding
(
VERTEX
,
map
.
phi2
(
d0
))
;
if
(
!
cm
.
isMarked
(
map
.
phi2
(
d0
)))
{
assert
(
e0
==
EMBNULL
)
;
map
.
embedOrbit
(
VERTEX
,
map
.
phi2
(
d0
),
emb0
)
;
cm
.
mark
(
map
.
phi2
(
d0
))
;
}
else
assert
(
e0
==
emb0
)
;
unsigned
int
emb1
=
vID
[
children
[
0
]
->
indices
[
1
]]
;
unsigned
int
e1
=
map
.
getEmbedding
(
VERTEX
,
map
.
phi2
(
d1
))
;
if
(
!
cm
.
isMarked
(
map
.
phi2
(
d1
)))
{
assert
(
e1
==
EMBNULL
)
;
map
.
embedOrbit
(
VERTEX
,
map
.
phi2
(
d1
),
emb1
)
;
cm
.
mark
(
map
.
phi2
(
d1
))
;
}
else
assert
(
e1
==
emb1
)
;
unsigned
int
emb2
=
vID
[
children
[
0
]
->
indices
[
2
]]
;
unsigned
int
e2
=
map
.
getEmbedding
(
VERTEX
,
map
.
phi2
(
d2
))
;
if
(
!
cm
.
isMarked
(
map
.
phi2
(
d2
)))
{
assert
(
e2
==
EMBNULL
)
;
map
.
embedOrbit
(
VERTEX
,
map
.
phi2
(
d2
),
emb2
)
;
cm
.
mark
(
map
.
phi2
(
d2
))
;
}
else
assert
(
e2
==
emb2
)
;
map
.
decCurrentLevel
()
;
Dart
t0
=
map
.
phi_1
(
d
)
;
...
...
@@ -121,6 +148,11 @@ public:
children
[
3
]
->
embed
(
map
,
t3
,
vID
,
cm
,
!
CCW
)
;
map
.
decCurrentLevel
()
;
}
else
{
if
(
map
.
getCurrentLevel
()
<
map
.
getMaxLevel
())
std
::
cout
<<
"adaptive !!!!!!!"
<<
std
::
endl
;
}
}
void
print
()
...
...
include/Algo/Import/importMRDAT.hpp
View file @
3dd929f4
...
...
@@ -235,14 +235,27 @@ bool importMRDAT(typename PFP::MAP& map, const std::string& filename, std::vecto
for
(
unsigned
int
i
=
0
;
i
<
depth
;
++
i
)
map
.
addNewLevel
(
false
)
;
map
.
setCurrentLevel
(
0
)
;
map
.
setCurrentLevel
(
0
)
;
qt
.
embed
(
map
,
verticesID
)
;
map
.
setCurrentLevel
(
map
.
getMaxLevel
())
;
for
(
unsigned
int
l
=
0
;
l
<=
map
.
getMaxLevel
();
++
l
)
TraversorV
<
typename
PFP
::
MAP
>
tv
(
map
,
allDarts
,
true
)
;
for
(
Dart
d
=
tv
.
begin
();
d
!=
tv
.
end
();
d
=
tv
.
next
())
{
map
.
setCurrentLevel
(
l
)
;
map
.
check
()
;
unsigned
int
vertexLevel
=
map
.
getDartLevel
(
d
)
;
if
(
vertexLevel
>
0
&&
vertexLevel
<
map
.
getMaxLevel
())
{
map
.
pushLevel
()
;
map
.
setCurrentLevel
(
vertexLevel
)
;
unsigned
int
emb
=
map
.
getEmbedding
(
VERTEX
,
d
)
;
for
(
unsigned
int
i
=
vertexLevel
+
1
;
i
<=
map
.
getMaxLevel
();
++
i
)
{
map
.
setCurrentLevel
(
i
)
;
map
.
embedOrbit
(
VERTEX
,
d
,
emb
)
;
}
map
.
popLevel
()
;
}
}
return
true
;
...
...
include/Algo/Import/importMesh.hpp
View file @
3dd929f4
...
...
@@ -121,8 +121,8 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
if
(
nbBoundaryEdges
>
0
)
{
map
.
closeMap
();
CGoGNout
<<
"Map closed ("
<<
nbBoundaryEdges
<<
" boundary edges)"
<<
CGoGNendl
;
unsigned
int
nbH
=
map
.
closeMap
();
CGoGNout
<<
"Map closed ("
<<
nbBoundaryEdges
<<
" boundary edges
/ "
<<
nbH
<<
" holes
)"
<<
CGoGNendl
;
// ensure bijection between topo and embedding
map
.
bijectiveOrbitEmbedding
(
VERTEX
);
}
...
...
@@ -130,7 +130,6 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
return
true
;
}
template
<
typename
PFP
>
bool
importMeshSToV
(
typename
PFP
::
MAP
&
map
,
MeshTablesSurface
<
PFP
>&
mts
,
float
dist
)
{
...
...
include/Topology/gmap/gmap2.h
View file @
3dd929f4
...
...
@@ -449,8 +449,9 @@ public:
//! Close the map removing topological holes: DO NOT USE, only for import/creation algorithm
/*! Add faces to the map that close every existing hole.
* These faces are marked as boundary.
* @return the number of closed holes
*/
void
closeMap
();
unsigned
int
closeMap
();
//@}
};
...
...
include/Topology/gmap/gmap3.h
View file @
3dd929f4
...
...
@@ -338,8 +338,9 @@ public:
//! Close the map removing topological holes: DO NOT USE, only for import/creation algorithm
/*! Add volumes to the map that close every existing hole.
* These faces are marked as boundary.
* @return the number of closed holes
*/
void
closeMap
();
unsigned
int
closeMap
();
};
}
// namespace CGoGN
...
...
include/Topology/map/map2.h
View file @
3dd929f4
...
...
@@ -456,8 +456,9 @@ public:
//! Close the map removing topological holes: DO NOT USE, only for import/creation algorithm
/*! Add faces to the map that close every existing hole.
* These faces are marked as boundary.
* @return the number of closed holes
*/
void
closeMap
();
unsigned
int
closeMap
();
//@}
};
...
...
include/Topology/map/map3.h
View file @
3dd929f4
...
...
@@ -366,8 +366,9 @@ public:
//! Close the map removing topological holes: DO NOT USE, only for import/creation algorithm
/*! Add volumes to the map that close every existing hole.
* These faces are marked as boundary.
* @return the number of closed holes
*/
void
closeMap
();
unsigned
int
closeMap
();
//@}
};
...
...
src/Topology/gmap/gmap2.cpp
View file @
3dd929f4
...
...
@@ -896,14 +896,19 @@ unsigned int GMap2::closeHole(Dart d, bool forboundary)
return
countEdges
;
}
void
GMap2
::
closeMap
()
unsigned
int
GMap2
::
closeMap
()
{
// Search the map for topological holes (fix points of phi2)
unsigned
int
nb
=
0
;
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
d
))
{
if
(
beta2
(
d
)
==
d
)
{
++
nb
;
closeHole
(
d
);
}
}
return
nb
;
}
}
// namespace CGoGN
src/Topology/gmap/gmap3.cpp
View file @
3dd929f4
...
...
@@ -937,14 +937,19 @@ unsigned int GMap3::closeHole(Dart d, bool forboundary)
return
count
;
}
void
GMap3
::
closeMap
()
unsigned
int
GMap3
::
closeMap
()
{
// Search the map for topological holes (fix points of beta3)
unsigned
int
nb
=
0
;
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
d
))
{
if
(
beta3
(
d
)
==
d
)
{
++
nb
;
closeHole
(
d
);
}
}
return
nb
;
}
}
// namespace CGoGN
src/Topology/map/map2.cpp
View file @
3dd929f4
...
...
@@ -853,14 +853,19 @@ unsigned int Map2::closeHole(Dart d, bool forboundary)
return
countEdges
;
}
void
Map2
::
closeMap
()
unsigned
int
Map2
::
closeMap
()
{
// Search the map for topological holes (fix points of phi2)
unsigned
int
nb
=
0
;
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
d
))
{
if
(
phi2
(
d
)
==
d
)
{
++
nb
;
closeHole
(
d
);
}
}
return
nb
;
}
}
// namespace CGoGN
src/Topology/map/map3.cpp
View file @
3dd929f4
...
...
@@ -922,14 +922,19 @@ unsigned int Map3::closeHole(Dart d, bool forboundary)
return
count
;
}
void
Map3
::
closeMap
()
unsigned
int
Map3
::
closeMap
()
{
// Search the map for topological holes (fix points of phi3)
unsigned
int
nb
=
0
;
for
(
Dart
d
=
begin
();
d
!=
end
();
next
(
d
))
{
if
(
phi3
(
d
)
==
d
)
{
++
nb
;
closeHole
(
d
);
}
}
return
nb
;
}
}
// namespace CGoGN
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