Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
439c9150
Commit
439c9150
authored
Jun 25, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more compacting functions
parent
d66a6841
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
2 deletions
+64
-2
include/Container/holeblockref.h
include/Container/holeblockref.h
+2
-0
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+18
-2
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+44
-0
No files found.
include/Container/holeblockref.h
View file @
439c9150
...
...
@@ -189,6 +189,8 @@ public:
void
saveBin
(
CGoGNostream
&
fs
);
bool
loadBin
(
CGoGNistream
&
fs
);
unsigned
int
*
getTableFree
(
unsigned
int
&
nb
)
{
nb
=
m_nbfree
;
return
m_tableFree
;}
};
}
// namespace CGoGN
...
...
include/Topology/generic/genericmap.h
View file @
439c9150
...
...
@@ -431,14 +431,30 @@ public:
/**
* compact the map
* @warning the quickTraversals needs to be updated
* @param topoOnly compact only the topo ?
*/
void
compact
(
bool
topoOnly
=
false
)
;
/**
* compact a container (and update embedding attribute of topo)
* @param orbit orbit of container to compact
* @param frag minimum fragmentation value for compacting (default value 1.0 mean always compact)s
*/
void
compactOrbitContainer
(
unsigned
int
orbit
,
float
frag
=
1.0
);
/**
* @brief compact if containers are fragmented.
* @warning the quickTraversals needs to be updated
* @param frag if fragmentation (filling) of containers inferior to frag then compact
* @param topoOnly compact only the topo ?
*/
void
compactIfNeeded
(
float
frag
,
bool
topoOnly
=
false
)
;
/**
* test if containers are fragmented
* ~1.0 no need to compact
* ~0.0 need to compact
* ~1.0
(full filled)
no need to compact
* ~0.0
(lots of holes)
need to compact
*/
inline
float
fragmentation
(
unsigned
int
orbit
);
...
...
src/Topology/generic/genericmap.cpp
View file @
439c9150
...
...
@@ -450,6 +450,50 @@ void GenericMap::compact(bool topoOnly)
}
}
void
GenericMap
::
compactOrbitContainer
(
unsigned
int
orbit
,
float
frag
)
{
std
::
vector
<
unsigned
int
>
oldnew
;
if
(
isOrbitEmbedded
(
orbit
)
&&
(
fragmentation
(
orbit
)
<
frag
))
{
m_attribs
[
orbit
].
compact
(
oldnew
);
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
unsigned
int
&
idx
=
m_embeddings
[
orbit
]
->
operator
[](
i
);
unsigned
int
jdx
=
oldnew
[
idx
];
if
(
jdx
!=
0xffffffff
)
idx
=
jdx
;
}
}
}
void
GenericMap
::
compactIfNeeded
(
float
frag
,
bool
topoOnly
)
{
if
(
fragmentation
(
DART
)
<
frag
)
compactTopo
();
if
(
topoOnly
)
return
;
std
::
vector
<
unsigned
int
>
oldnew
;
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
if
((
orbit
!=
DART
)
&&
(
isOrbitEmbedded
(
orbit
))
&&
(
fragmentation
(
orbit
)
<
frag
))
{
m_attribs
[
orbit
].
compact
(
oldnew
);
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
unsigned
int
&
idx
=
m_embeddings
[
orbit
]
->
operator
[](
i
);
unsigned
int
jdx
=
oldnew
[
idx
];
if
(
jdx
!=
0xffffffff
)
idx
=
jdx
;
}
}
}
}
void
GenericMap
::
dumpCSV
()
const
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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