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
868dac79
Commit
868dac79
authored
Dec 16, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merges
parent
2d3d9fcd
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
195 additions
and
229 deletions
+195
-229
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+3
-3
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+0
-2
include/Topology/map/map1.hpp
include/Topology/map/map1.hpp
+0
-2
include/Topology/map/map2.h
include/Topology/map/map2.h
+1
-1
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+0
-1
include/Topology/map/map3.hpp
include/Topology/map/map3.hpp
+0
-1
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+30
-49
src/Topology/gmap/gmap0.cpp
src/Topology/gmap/gmap0.cpp
+11
-11
src/Topology/gmap/gmap1.cpp
src/Topology/gmap/gmap1.cpp
+19
-20
src/Topology/gmap/gmap2.cpp
src/Topology/gmap/gmap2.cpp
+25
-28
src/Topology/gmap/gmap3.cpp
src/Topology/gmap/gmap3.cpp
+31
-32
src/Topology/map/map1.cpp
src/Topology/map/map1.cpp
+19
-21
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+25
-26
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+31
-32
No files found.
include/Topology/generic/genericmap.h
View file @
868dac79
...
...
@@ -301,8 +301,8 @@ protected:
AttributeMultiVector
<
Dart
>*
addRelation
(
const
std
::
string
&
name
)
;
/**
* Get
a
ttributeMultivector pointer of a relation attribute
* @param
anem name of
relation
* Get
A
ttributeMultivector pointer of a relation attribute
* @param
name name of the
relation
* @return the attribute multi-vector pointer
*/
AttributeMultiVector
<
Dart
>*
getRelation
(
const
std
::
string
&
name
);
...
...
@@ -388,7 +388,7 @@ public:
/**
* update topo relation after compacting the container:
*/
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
=
0
;
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
=
0
;
/**
* compact the map
...
...
include/Topology/generic/genericmap.hpp
View file @
868dac79
...
...
@@ -218,6 +218,4 @@ inline AttributeMultiVector<Dart>* GenericMap::getRelation(const std::string& na
return
amv
;
}
}
//namespace CGoGN
include/Topology/map/map1.hpp
View file @
868dac79
...
...
@@ -62,8 +62,6 @@ inline void Map1::update_topo_shortcuts()
m_phi_1
=
getRelation
(
"phi_1"
);
}
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
include/Topology/map/map2.h
View file @
868dac79
...
...
@@ -65,7 +65,7 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
...
...
include/Topology/map/map2.hpp
View file @
868dac79
...
...
@@ -54,7 +54,6 @@ inline void Map2::clear(bool removeAttrib)
init
()
;
}
inline
void
Map2
::
update_topo_shortcuts
()
{
Map1
::
update_topo_shortcuts
();
...
...
include/Topology/map/map3.hpp
View file @
868dac79
...
...
@@ -52,7 +52,6 @@ inline void Map3::clear(bool removeAttrib)
init
()
;
}
inline
void
Map3
::
update_topo_shortcuts
()
{
Map2
::
update_topo_shortcuts
();
...
...
src/Topology/generic/genericmap.cpp
View file @
868dac79
...
...
@@ -305,8 +305,6 @@ void GenericMap::removeThreadMarker(unsigned int nb)
* SAVE & LOAD *
****************************************/
bool
GenericMap
::
saveMapBin
(
const
std
::
string
&
filename
)
{
CGoGNostream
fs
(
filename
.
c_str
(),
std
::
ios
::
out
|
std
::
ios
::
binary
);
...
...
@@ -318,28 +316,25 @@ bool GenericMap::saveMapBin(const std::string& filename)
// Entete
char
*
buff
=
new
char
[
256
];
for
(
int
i
=
0
;
i
<
256
;
++
i
)
for
(
int
i
=
0
;
i
<
256
;
++
i
)
buff
[
i
]
=
char
(
255
);
const
char
*
cgogn
=
"CGoGN_Map"
;
memcpy
(
buff
,
cgogn
,
10
);
memcpy
(
buff
,
cgogn
,
10
);
std
::
string
mt
=
mapTypeName
();
const
char
*
mtc
=
mt
.
c_str
();
memcpy
(
buff
+
32
,
mtc
,
mt
.
size
()
+
1
);
unsigned
int
*
buffi
=
reinterpret_cast
<
unsigned
int
*>
(
buff
+
64
);
memcpy
(
buff
+
32
,
mtc
,
mt
.
size
()
+
1
);
unsigned
int
*
buffi
=
reinterpret_cast
<
unsigned
int
*>
(
buff
+
64
);
*
buffi
=
NB_ORBITS
;
fs
.
write
(
reinterpret_cast
<
const
char
*>
(
buff
),
256
);
delete
buff
;
// save all attribs
for
(
unsigned
int
i
=
0
;
i
<
NB_ORBITS
;
++
i
)
{
m_attribs
[
i
].
saveBin
(
fs
,
i
);
}
for
(
unsigned
int
i
=
0
;
i
<
NB_ORBITS
;
++
i
)
m_attribs
[
i
].
saveBin
(
fs
,
i
);
return
true
;
}
bool
GenericMap
::
loadMapBin
(
const
std
::
string
&
filename
)
{
...
...
@@ -365,7 +360,7 @@ bool GenericMap::loadMapBin(const std::string& filename)
}
// Check map type
buff_str
=
std
::
string
(
buff
+
32
);
buff_str
=
std
::
string
(
buff
+
32
);
std
::
string
localType
=
this
->
mapTypeName
();
...
...
@@ -373,12 +368,12 @@ bool GenericMap::loadMapBin(const std::string& filename)
if
(
fileType
!=
localType
)
{
CGoGNerr
<<
"Not possible to load "
<<
fileType
<<
" into "
<<
localType
<<
" object"
<<
CGoGNendl
;
CGoGNerr
<<
"Not possible to load "
<<
fileType
<<
" into "
<<
localType
<<
" object"
<<
CGoGNendl
;
return
false
;
}
// Check max nb orbit
unsigned
int
*
ptr_nbo
=
reinterpret_cast
<
unsigned
int
*>
(
buff
+
64
);
unsigned
int
*
ptr_nbo
=
reinterpret_cast
<
unsigned
int
*>
(
buff
+
64
);
unsigned
int
nbo
=
*
ptr_nbo
;
if
(
nbo
!=
NB_ORBITS
)
{
...
...
@@ -387,7 +382,7 @@ bool GenericMap::loadMapBin(const std::string& filename)
}
// load attrib container
for
(
unsigned
int
i
=
0
;
i
<
NB_ORBITS
;
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
NB_ORBITS
;
++
i
)
{
unsigned
int
id
=
AttributeContainer
::
loadBinId
(
fs
);
m_attribs
[
id
].
loadBin
(
fs
);
...
...
@@ -395,14 +390,12 @@ bool GenericMap::loadMapBin(const std::string& filename)
// retrieve m_embeddings (from m_attribs[DART]
update_m_emb_afterLoad
();
// recursive call from real type of map (for topo relation attributes pointers) down to GenericMap (
for Marker_cleaning & pointers)
// recursive call from real type of map (for topo relation attributes pointers) down to GenericMap (for Marker_cleaning & pointers)
update_topo_shortcuts
();
return
true
;
}
void
GenericMap
::
update_m_emb_afterLoad
()
{
// get container of dart orbit
...
...
@@ -415,21 +408,18 @@ void GenericMap::update_m_emb_afterLoad()
// check if there are EMB_X attributes
for
(
unsigned
int
i
=
0
;
i
<
listeNames
.
size
();
++
i
)
{
std
::
string
sub
=
listeNames
[
i
].
substr
(
0
,
listeNames
[
i
].
size
()
-
1
);
std
::
string
sub
=
listeNames
[
i
].
substr
(
0
,
listeNames
[
i
].
size
()
-
1
);
if
(
sub
==
"EMB_"
)
{
unsigned
int
orb
=
listeNames
[
i
][
4
]
-
'0'
;
// easy atoi computation for one char;
AttributeMultiVector
<
unsigned
int
>*
amv
=
cont
.
getDataVector
<
unsigned
int
>
(
i
);
m_embeddings
[
orb
]
=
amv
;
}
}
}
void
GenericMap
::
update_topo_shortcuts
()
{
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
AttributeContainer
&
cont
=
m_attribs
[
orbit
];
...
...
@@ -440,32 +430,28 @@ void GenericMap::update_topo_shortcuts()
for
(
unsigned
int
i
=
0
;
i
<
listeNames
.
size
();
++
i
)
{
std
::
string
sub
=
listeNames
[
i
].
substr
(
0
,
5
);
std
::
string
sub
=
listeNames
[
i
].
substr
(
0
,
5
);
if
(
sub
==
"Mark_"
)
{
// get thread number
unsigned
int
thread
=
listeNames
[
i
][
5
]
-
'0'
;
if
(
listeNames
[
i
].
size
()
>
6
)
// thread number is >9
if
(
listeNames
[
i
].
size
()
>
6
)
// thread number is >9
thread
=
10
*
thread
+
listeNames
[
i
][
6
]
-
'0'
;
AttributeMultiVector
<
Mark
>*
amvMark
=
cont
.
getDataVector
<
Mark
>
(
i
);
m_markTables
[
orbit
][
thread
]
=
amvMark
;
if
((
orbit
==
DART
)
&&
(
thread
==
0
))
// for Marker of dart of thread O keep the boundary marker
if
((
orbit
==
DART
)
&&
(
thread
==
0
))
// for Marker of dart of thread O keep the boundary marker
{
Mark
m
(
m_boundaryMarker
);
m
.
invert
();
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
{
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
amvMark
->
operator
[](
i
).
unsetMark
(
m
);
}
}
else
// for others clear all
{
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
{
for
(
unsigned
int
i
=
cont
.
begin
();
i
!=
cont
.
end
();
cont
.
next
(
i
))
amvMark
->
operator
[](
i
).
clear
();
}
}
}
}
...
...
@@ -474,38 +460,36 @@ void GenericMap::update_topo_shortcuts()
void
GenericMap
::
dumpAttributesAndMarkers
()
{
for
(
unsigned
int
i
=
0
;
i
<
NB_ORBITS
;
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
NB_ORBITS
;
++
i
)
{
std
::
vector
<
std
::
string
>
names
;
names
.
reserve
(
32
);
//just t
p
limit reallocation
names
.
reserve
(
32
);
//just t
o
limit reallocation
m_attribs
[
i
].
getAttributesNames
(
names
);
unsigned
int
nb
=
names
.
size
();
if
(
nb
>
0
)
if
(
nb
>
0
)
{
CGoGNout
<<
"ORBIT "
<<
i
<<
CGoGNendl
;
CGoGNout
<<
"ORBIT "
<<
i
<<
CGoGNendl
;
std
::
vector
<
std
::
string
>
types
;
types
.
reserve
(
nb
);
m_attribs
[
i
].
getAttributesTypes
(
types
);
for
(
unsigned
int
j
=
0
;
j
<
nb
;
++
j
)
{
CGoGNout
<<
" "
<<
j
<<
" : "
<<
types
[
j
]
<<
" "
<<
names
[
j
]
<<
CGoGNendl
;
}
for
(
unsigned
int
j
=
0
;
j
<
nb
;
++
j
)
CGoGNout
<<
" "
<<
j
<<
" : "
<<
types
[
j
]
<<
" "
<<
names
[
j
]
<<
CGoGNendl
;
}
}
CGoGNout
<<
"RESERVED MARKERS "
<<
CGoGNendl
;
for
(
unsigned
int
i
=
0
;
i
<
NB_ORBITS
;
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
NB_ORBITS
;
++
i
)
{
for
(
unsigned
int
j
=
0
;
j
<
NB_THREAD
;
++
j
)
for
(
unsigned
int
j
=
0
;
j
<
NB_THREAD
;
++
j
)
{
MarkSet
ms
=
m_marksets
[
i
][
j
];
if
(
!
ms
.
isClear
())
{
CGoGNout
<<
"Orbit "
<<
i
<<
" thread "
<<
j
<<
" : "
;
CGoGNout
<<
"Orbit "
<<
i
<<
" thread "
<<
j
<<
" : "
;
Mark
m
(
1
);
for
(
unsigned
i
=
0
;
i
<
Mark
::
getNbMarks
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
Mark
::
getNbMarks
();
++
i
)
{
if
(
ms
.
testMark
(
m
))
CGoGNout
<<
m
.
getMarkVal
()
<<
", "
;
CGoGNout
<<
m
.
getMarkVal
()
<<
", "
;
m
.
setMarkVal
(
m
.
getMarkVal
()
<<
1
);
}
CGoGNout
<<
CGoGNendl
;
...
...
@@ -514,7 +498,6 @@ void GenericMap::dumpAttributesAndMarkers()
}
}
void
GenericMap
::
compact
()
{
std
::
vector
<
unsigned
int
>
oldnew
;
...
...
@@ -526,11 +509,11 @@ void GenericMap::compact()
{
m_attribs
[
orbit
].
compact
(
oldnew
);
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
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
)
&&
(
jdx
!=
idx
))
if
((
jdx
!=
0xffffffff
)
&&
(
jdx
!=
idx
))
idx
=
jdx
;
}
}
...
...
@@ -832,5 +815,3 @@ void GenericMap::boundaryUnmarkAll()
//
// return true ;
//}
src/Topology/gmap/gmap0.cpp
View file @
868dac79
...
...
@@ -27,6 +27,17 @@
namespace
CGoGN
{
void
GMap0
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
Dart
&
d
=
m_beta0
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
/*! @name Constructors and Destructors
* To generate or delete edges in a 0-G-map
*************************************************************************/
...
...
@@ -45,15 +56,4 @@ void GMap0::deleteEdge(Dart d)
deleteDart
(
d
);
}
void
GMap0
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
Dart
&
d
=
m_beta0
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
// namespace CGoGN
src/Topology/gmap/gmap1.cpp
View file @
868dac79
...
...
@@ -27,6 +27,25 @@
namespace
CGoGN
{
void
GMap1
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_beta0
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
/*! @name Constructors and Destructors
* To generate or delete faces in a 1-G-map
*************************************************************************/
...
...
@@ -75,24 +94,4 @@ void GMap1::deleteFace(Dart d)
deleteEdge
(
d
);
}
void
GMap1
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_beta0
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
}
// namespace CGoGN
src/Topology/gmap/gmap2.cpp
View file @
868dac79
...
...
@@ -28,6 +28,31 @@
namespace
CGoGN
{
void
GMap2
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_beta0
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta2
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
/*! @name Generator and Deletor
* To generate or delete faces in a 2-G-map
*************************************************************************/
...
...
@@ -895,32 +920,4 @@ void GMap2::closeMap()
}
}
void
GMap2
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_beta0
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta2
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
}
// namespace CGoGN
src/Topology/gmap/gmap3.cpp
View file @
868dac79
...
...
@@ -28,6 +28,37 @@
namespace
CGoGN
{
void
GMap3
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_beta0
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta2
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta3
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
/*! @name Generator and Deletor
* To generate or delete volumes in a 3-G-map
*************************************************************************/
...
...
@@ -916,36 +947,4 @@ void GMap3::closeMap()
}
}
inline
void
GMap3
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_beta0
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta2
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_beta3
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
}
// namespace CGoGN
src/Topology/map/map1.cpp
View file @
868dac79
...
...
@@ -27,6 +27,25 @@
namespace
CGoGN
{
void
Map1
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_phi1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_phi_1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
/*! @name Generator and Deletor
* To generate or delete faces in a 1-map
*************************************************************************/
...
...
@@ -84,25 +103,4 @@ void Map1::reverseCycle(Dart d)
phi1sew
(
e
,
d
)
;
// Sew the last edge
}
void
Map1
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_phi1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_phi_1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
}
// namespace CGoGN
src/Topology/map/map2.cpp
View file @
868dac79
...
...
@@ -28,6 +28,31 @@
namespace
CGoGN
{
void
Map2
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_phi1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_phi_1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_phi2
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
/*! @name Generator and Deletor
* To generate or delete faces in a 2-map
*************************************************************************/
...
...
@@ -776,30 +801,4 @@ void Map2::closeMap()
}
}
void
Map2
::
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
{
for
(
unsigned
int
i
=
m_attribs
[
DART
].
begin
();
i
!=
m_attribs
[
DART
].
end
();
m_attribs
[
DART
].
next
(
i
))
{
{
Dart
&
d
=
m_phi1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_phi_1
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
{
Dart
&
d
=
m_phi2
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}