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
daa19158
Commit
daa19158
authored
Jan 30, 2014
by
untereiner
Browse files
some changes MRDAT working again
parent
a119b8e3
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/Algo/Import/importMRDAT.h
View file @
daa19158
...
...
@@ -25,6 +25,8 @@
#ifndef __IMPORT_MR_DAT__
#define __IMPORT_MR_DAT__
#include
"Topology/generic/autoAttributeHandler.h"
namespace
CGoGN
{
...
...
@@ -97,25 +99,31 @@ public:
unsigned
int
idx
=
emb
==
v0
?
0
:
emb
==
v1
?
1
:
2
;
map
.
incCurrentLevel
()
;
Dart
dd
=
map
.
phi1
(
next
)
;
unsigned
int
oldEmb
=
map
.
template
getEmbedding
<
VERTEX
>(
dd
)
;
//
unsigned int oldEmb = map.template getEmbedding<VERTEX>(dd) ;
unsigned
int
newEmb
=
vID
[
children
[
0
]
->
indices
[
idx
]]
;
if
(
oldEmb
==
EMBNULL
)
{
//
if(oldEmb == EMBNULL)
//
{
//std::cout << "oldEmb == NULL"<< std::endl;
map
.
template
setOrbitEmbedding
<
VERTEX
>(
dd
,
newEmb
)
;
map
.
pushLevel
()
;
//needed because the darts are duplicated at each level
//and the vertex orbits are initialized at the creation of each level with wrong embedding indices
//map.pushLevel() ;
unsigned
int
cur
=
map
.
getCurrentLevel
();
//necessary because IHM2 does not allow a Stack
for
(
unsigned
int
i
=
map
.
getCurrentLevel
()
+
1
;
i
<=
map
.
getMaxLevel
();
++
i
)
{
map
.
setCurrentLevel
(
i
)
;
map
.
template
setOrbitEmbedding
<
VERTEX
>(
dd
,
newEmb
)
;
}
map
.
popLevel
()
;
}
else
{
//std::cout << "oldEmb != NULL"<< std::endl;
assert
(
oldEmb
==
newEmb
)
;
}
//map.popLevel() ;
map
.
setCurrentLevel
(
cur
);
// }
// else
// {
// //std::cout << "oldEmb != NULL"<< std::endl;
// assert(oldEmb == newEmb) ;
// }
map
.
decCurrentLevel
()
;
it
=
next
;
...
...
include/Algo/Multiresolution/IHM2/ihm2_PrimalRegular.h
View file @
daa19158
...
...
@@ -30,6 +30,8 @@
#include
"Topology/generic/traversor2.h"
#include
"Algo/Multiresolution/filter.h"
#include
"Algo/Import/importMRDAT.h"
#include
<cmath>
...
...
@@ -39,6 +41,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
MR
{
...
...
@@ -77,14 +82,19 @@ public:
void
synthesis
()
;
void
addLevelFront
();
void
import
(
Algo
::
Surface
::
Import
::
QuadTree
&
qt
);
}
;
}
// namespace
Adaptive
}
// namespace
Regular
}
// namespace Primal
}
// namespace MR
}
// namespace Surface
}
// namespace Algo
}
// namespace CGoGN
...
...
include/Algo/Multiresolution/IHM2/ihm2_PrimalRegular.hpp
View file @
daa19158
...
...
@@ -22,12 +22,16 @@
* *
*******************************************************************************/
namespace
CGoGN
{
namespace
Algo
{
namespace
Surface
{
namespace
MR
{
...
...
@@ -154,10 +158,8 @@ void IHM2<PFP>::addNewLevel(bool triQuad)
template
<
typename
PFP
>
void
IHM2
<
PFP
>::
addLevelFront
()
{
std
::
vector
<
Dart
>
irregVertices
;
irregVertices
.
reserve
(
1024
);
//look for an irregular vertex
//1. look for an irregular vertex
Dart
irregVertex
=
NIL
;
TraversorV
<
typename
PFP
::
MAP
>
tv
(
m_map
);
bool
found
=
false
;
...
...
@@ -166,13 +168,13 @@ void IHM2<PFP>::addLevelFront()
if
(
m_map
.
vertexDegree
(
d
)
!=
6
)
{
found
=
true
;
irregVert
ices
.
push_back
(
d
)
;
irregVert
ex
=
d
;
}
}
//found the number of levels
//
2.
found the number of levels
bool
finished
=
false
;
Dart
dit
=
irregVert
ices
[
0
]
;
Dart
dit
=
irregVert
ex
;
unsigned
int
nbSteps
=
0
;
do
{
...
...
@@ -191,10 +193,11 @@ void IHM2<PFP>::addLevelFront()
nbSteps
/=
2
;
++
nbLevel
;
}
m_map
.
setMaxLevel
(
nbLevel
);
m_map
.
setMaxLevel
(
nbLevel
);
std
::
cout
<<
"nb levels = "
<<
nbLevel
+
1
<<
std
::
endl
;
//3. construct the topology of the differents levels
unsigned
int
curLevel
=
nbLevel
;
do
...
...
@@ -202,7 +205,9 @@ void IHM2<PFP>::addLevelFront()
m_map
.
setCurrentLevel
(
curLevel
);
DartMarker
md
(
m_map
);
std
::
vector
<
Dart
>
visitedVertices
(
irregVertices
);
std
::
vector
<
Dart
>
visitedVertices
;
visitedVertices
.
reserve
(
1024
);
visitedVertices
.
push_back
(
irregVertex
);
std
::
cout
<<
"getCurrentLevel = "
<<
m_map
.
getCurrentLevel
()
<<
std
::
endl
;
...
...
@@ -240,7 +245,7 @@ void IHM2<PFP>::addLevelFront()
m_map
.
setDartLevel
(
m_map
.
phi2
(
fit3
),
curLevel
);
m_map
.
setDartLevel
(
m_map
.
phi1
(
m_map
.
phi2
(
fit3
)),
curLevel
);
if
(
curLevel
==
maxLevel
)
if
(
curLevel
==
m
_map
.
getM
axLevel
()
)
{
unsigned
int
id
=
m_map
.
getTriRefinementEdgeId
(
m_map
.
phi2
(
fit1
));
m_map
.
setEdgeId
(
m_map
.
phi2
(
fit1
),
id
);
...
...
@@ -256,31 +261,28 @@ void IHM2<PFP>::addLevelFront()
}
else
{
}
// if(curLevel == 2)
// {
// unsigned int id = m_map.getTriRefinementEdgeId(m_map.phi2(fit1));
// m_map.setEdgeId(m_map.phi2(fit1), id);
// m_map.setEdgeId(fit1, id);
//m_map.setEdgeId(fit1, id);
// /std::cout << "fit1 = " << fit1 << std::endl;
//std::cout << "m_map.phi2(fit1) = " << m_map.phi2(fit1) << std::endl;
// m_map.incCurrentLevel();
// m_map.setEdgeId(m_map.phi2(fit1), id);
// m_map.decCurrentLevel();
// id = m_map.getTriRefinementEdgeId(m_map.phi2(fit2));
// m_map.setEdgeId(m_map.phi2(fit2), id);
// m_map.setEdgeId(fit2, id);
//
m_map.
setEdgeId(fit2, id
);
//std::cout << "fit2 = " << fit2 << std::endl
;
//std::cout << "m_map.phi2(fit2) = " << m_map.phi2(fit2) << std::endl
;
//
m_map.
incCurrentLevel(
);
//
m_map.setEdgeId(m_map.phi2(fit2), id)
;
//
m_map.decCurrentLevel()
;
// id = m_map.getTriRefinementEdgeId(m_map.phi2(fit3));
// m_map.setEdgeId(m_map.phi2(fit3), id);
// m_map.setEdgeId(fit3, id);
//
m_map.
setEdgeId(fit3, id
);
//std::cout << "fit3 = " << fit3 << std::endl
;
//std::cout << "m_map.phi2(fit3) = " << m_map.phi2(fit3) << std::endl
;
//
}
//
m_map.
incCurrentLevel(
);
//
m_map.setEdgeId(m_map.phi2(fit3), id)
;
//
m_map.decCurrentLevel()
;
}
}
}
}
...
...
@@ -316,12 +318,33 @@ void IHM2<PFP>::synthesis()
m_map
.
incCurrentLevel
()
;
}
template
<
typename
PFP
>
void
IHM2
<
PFP
>::
import
(
Algo
::
Surface
::
Import
::
QuadTree
&
qt
)
{
std
::
cout
<<
" Create finer resolution levels.."
<<
std
::
flush
;
for
(
unsigned
int
i
=
0
;
i
<
qt
.
depth
;
++
i
)
addNewLevel
(
true
)
;
std
::
cout
<<
"..done"
<<
std
::
endl
;
std
::
cout
<<
" Embed finer resolution levels.."
<<
std
::
flush
;
m_map
.
setCurrentLevel
(
0
)
;
qt
.
embed
<
PFP
>
(
m_map
)
;
m_map
.
setCurrentLevel
(
m_map
.
getMaxLevel
())
;
std
::
cout
<<
"..done"
<<
std
::
endl
;
}
}
// namespace Regular
}
// namespace Primal
}
// namespace MR
}
// namespace Surface
}
// namespace Algo
}
// namespace CGoGN
include/Algo/Multiresolution/Map2MR/map2MR_PrimalRegular.hpp
View file @
daa19158
...
...
@@ -310,7 +310,6 @@ void Map2MR<PFP>::addLevelFront()
Dart
fit1
=
m_map
.
phi2
(
m_map
.
phi1
(
d
));
//m_map.mergeFaces(fit1) ;
// Traversor2VE<typename PFP::MAP> tve(m_map, d);
// for(Dart eit = tve.begin() ; eit != tve.end() ; eit = tve.next())
// {
...
...
include/Topology/ihmap/ihm2.hpp
View file @
daa19158
...
...
@@ -351,10 +351,13 @@ inline unsigned int ImplicitHierarchicalMap2::getTriRefinementEdgeId(Dart d)
else
if
(
id
==
1
)
return
2
;
else
if
(
id
==
2
)
{
if
(
dId
==
eId
)
return
0
;
else
return
1
;
}
//else if(id == 3)
return
0
;
}
...
...
@@ -370,11 +373,6 @@ inline unsigned int ImplicitHierarchicalMap2::getQuadRefinementEdgeId(Dart d)
return
0
;
}
inline
void
ImplicitHierarchicalMap2
::
setTriRefinementEdgeId
(
Dart
d
)
{
}
/***************************************************
* CELLS INFORMATION *
***************************************************/
...
...
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