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
KennethVanhoey
CGoGN
Commits
b73e64da
Commit
b73e64da
authored
Feb 08, 2012
by
Pierre Kraemer
Browse files
add initMR function to be called by MRmaps classes at construction
parent
366ba117
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/Topology/generic/genericmap.h
View file @
b73e64da
...
...
@@ -113,22 +113,22 @@ protected:
#endif
/**
* container for m
r-darts that store indices in attribs[DART] for each level
* container for m
ultiresolution darts
*/
AttributeContainer
m_mrattribs
;
/**
* pointer to
indices mvectors
(one for each level)
* pointer
s
to
attributes that store indices in m_attribs[DART]
(one for each level)
*/
std
::
vector
<
AttributeMultiVector
<
unsigned
int
>*
>
m_mrDarts
;
/**
* pointer
s
to
mvector of
levels
* pointer to
attribute that stores darts insertion
levels
*/
AttributeMultiVector
<
unsigned
char
>*
m_mrLevels
;
AttributeMultiVector
<
unsigned
int
>*
m_mrLevels
;
/**
* current level
of
multiresoltion
* current level
in
multiresol
u
tion
map
*/
unsigned
int
m_mrCurrentLevel
;
...
...
@@ -146,6 +146,11 @@ public:
virtual
std
::
string
mapTypeName
()
=
0
;
/**
* initialize the multiresolution attribute container
*/
void
initMR
()
;
/**
* Clear the map
* @param removeAttrib
...
...
include/Topology/generic/genericmap.hpp
View file @
b73e64da
...
...
@@ -67,7 +67,7 @@ inline unsigned int GenericMap::getMaxLevel()
inline
unsigned
int
GenericMap
::
getDartLevel
(
Dart
d
)
{
return
m_mrLevels
->
operator
[](
d
.
index
)
;
return
m_mrLevels
->
operator
[](
d
.
index
)
;
}
/****************************************
...
...
src/Topology/generic/genericmap.cpp
View file @
b73e64da
...
...
@@ -90,16 +90,6 @@ GenericMap::GenericMap() : m_nbThreads(1)
#ifndef CGoGN_FORCE_MR
m_isMultiRes
=
false
;
#endif
if
(
m_isMultiRes
)
{
m_mrDarts
.
reserve
(
16
)
;
m_mrLevelStack
.
reserve
(
16
)
;
m_mrLevels
=
m_mrattribs
.
addAttribute
<
unsigned
char
>
(
"MRLevel"
)
;
addLevel
()
;
setCurrentLevel
(
0
)
;
}
}
GenericMap
::~
GenericMap
()
...
...
@@ -132,6 +122,21 @@ GenericMap::~GenericMap()
}
}
void
GenericMap
::
initMR
()
{
m_isMultiRes
=
true
;
m_mrattribs
.
clear
(
true
)
;
m_mrDarts
.
clear
()
;
m_mrDarts
.
reserve
(
16
)
;
m_mrLevelStack
.
clear
()
;
m_mrLevelStack
.
reserve
(
16
)
;
m_mrLevels
=
m_mrattribs
.
addAttribute
<
unsigned
int
>
(
"MRLevel"
)
;
addLevel
()
;
setCurrentLevel
(
0
)
;
}
void
GenericMap
::
clear
(
bool
removeAttrib
)
{
if
(
removeAttrib
)
...
...
@@ -154,15 +159,7 @@ void GenericMap::clear(bool removeAttrib)
}
if
(
m_isMultiRes
)
{
m_mrattribs
.
clear
(
true
)
;
m_mrDarts
.
clear
()
;
m_mrLevels
=
m_mrattribs
.
addAttribute
<
unsigned
char
>
(
"MRLevel"
)
;
addLevel
()
;
setCurrentLevel
(
0
)
;
m_mrLevelStack
.
clear
()
;
}
initMR
()
;
}
/****************************************
...
...
@@ -551,7 +548,7 @@ void GenericMap::update_topo_shortcuts()
std
::
string
sub
=
names
[
i
].
substr
(
0
,
7
);
if
(
sub
==
"MRLevel"
)
m_mrLevels
=
m_mrattribs
.
getDataVector
<
unsigned
char
>
(
i
);
m_mrLevels
=
m_mrattribs
.
getDataVector
<
unsigned
int
>
(
i
);
if
(
sub
==
"MRdart_"
)
{
...
...
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