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
82d8876f
Commit
82d8876f
authored
Dec 14, 2011
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout fonction compact dans generic_map
+ test_compact dans Test
parent
639d734d
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
248 additions
and
10 deletions
+248
-10
Apps/Examples/Tests/CMakeLists.txt
Apps/Examples/Tests/CMakeLists.txt
+4
-0
Apps/Examples/clipping.cpp
Apps/Examples/clipping.cpp
+2
-5
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+17
-5
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+10
-0
include/Topology/gmap/gmap0.h
include/Topology/gmap/gmap0.h
+2
-0
include/Topology/gmap/gmap1.h
include/Topology/gmap/gmap1.h
+2
-0
include/Topology/gmap/gmap2.h
include/Topology/gmap/gmap2.h
+2
-0
include/Topology/gmap/gmap3.h
include/Topology/gmap/gmap3.h
+2
-0
include/Topology/map/map1.h
include/Topology/map/map1.h
+2
-0
include/Topology/map/map2.h
include/Topology/map/map2.h
+2
-0
include/Topology/map/map3.h
include/Topology/map/map3.h
+2
-0
src/Container/attributeContainer.cpp
src/Container/attributeContainer.cpp
+1
-0
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+31
-0
src/Topology/gmap/gmap0.cpp
src/Topology/gmap/gmap0.cpp
+11
-0
src/Topology/gmap/gmap1.cpp
src/Topology/gmap/gmap1.cpp
+19
-0
src/Topology/gmap/gmap2.cpp
src/Topology/gmap/gmap2.cpp
+28
-0
src/Topology/gmap/gmap3.cpp
src/Topology/gmap/gmap3.cpp
+32
-0
src/Topology/map/map1.cpp
src/Topology/map/map1.cpp
+21
-0
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+26
-0
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+32
-0
No files found.
Apps/Examples/Tests/CMakeLists.txt
View file @
82d8876f
...
...
@@ -35,6 +35,10 @@ add_executable( Geom_intersectionD ./Geom_intersection.cpp)
target_link_libraries
(
Geom_intersectionD
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
add_executable
(
test_compactD ./test_compact.cpp
)
target_link_libraries
(
test_compactD
${
CGoGN_LIBS_D
}
${
CGoGN_EXT_LIBS
}
)
IF
(
WITH_QT
)
QT4_WRAP_CPP
(
concave_rendering_moc concave_rendering.h
)
...
...
Apps/Examples/clipping.cpp
View file @
82d8876f
...
...
@@ -793,11 +793,8 @@ void Clipping::importMesh(std::string& filename)
{
std
::
vector
<
std
::
string
>
attrNames
;
std
::
string
extension
;
size_t
pos
;
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
extension
=
filename
.
substr
(
pos
);
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
if
(
extension
==
std
::
string
(
".tet"
))
{
...
...
Apps/Examples/viewer.cpp
View file @
82d8876f
...
...
@@ -184,13 +184,25 @@ void Viewer::importMesh(std::string& filename)
{
myMap
.
clear
(
true
)
;
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
if
(
extension
==
std
::
string
(
".map"
))
{
myMap
.
loadMapBin
(
filename
);
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
}
else
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
std
::
vector
<
std
::
string
>
attrNames
;
if
(
!
Algo
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
}
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
POINTS
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
)
;
...
...
include/Topology/generic/genericmap.h
View file @
82d8876f
...
...
@@ -385,6 +385,16 @@ public:
*/
void
dumpAttributesAndMarkers
();
/**
* update topo relation after compacting the container:
*/
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
)
=
0
;
/**
* compact the map
*/
void
compact
();
/****************************************
* DARTS TRAVERSALS *
****************************************/
...
...
include/Topology/gmap/gmap0.h
View file @
82d8876f
...
...
@@ -54,6 +54,8 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
include/Topology/gmap/gmap1.h
View file @
82d8876f
...
...
@@ -53,6 +53,8 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
include/Topology/gmap/gmap2.h
View file @
82d8876f
...
...
@@ -53,6 +53,8 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
include/Topology/gmap/gmap3.h
View file @
82d8876f
...
...
@@ -53,6 +53,8 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
include/Topology/map/map1.h
View file @
82d8876f
...
...
@@ -59,6 +59,8 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
include/Topology/map/map2.h
View file @
82d8876f
...
...
@@ -65,6 +65,8 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
include/Topology/map/map3.h
View file @
82d8876f
...
...
@@ -67,6 +67,8 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
src/Container/attributeContainer.cpp
View file @
82d8876f
...
...
@@ -203,6 +203,7 @@ void AttributeContainer::compact(std::vector<unsigned int>& mapOldNew)
}
++
nbb
;
mapOldNew
.
clear
();
mapOldNew
.
reserve
(
nbe
);
// now get the holes
...
...
src/Topology/generic/genericmap.cpp
View file @
82d8876f
...
...
@@ -514,6 +514,37 @@ void GenericMap::dumpAttributesAndMarkers()
}
}
void
GenericMap
::
compact
()
{
std
::
vector
<
unsigned
int
>
oldnew
;
// compacting the orbits attributes
for
(
unsigned
int
orbit
=
0
;
orbit
<
NB_ORBITS
;
++
orbit
)
{
if
((
orbit
!=
DART
)
&&
(
isOrbitEmbedded
(
orbit
)))
{
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
)
&&
(
jdx
!=
idx
))
idx
=
jdx
;
}
}
}
//compacting the topo
m_attribs
[
DART
].
compact
(
oldnew
);
// update topo relations: recurvise call from real map down to generic
compactTopoRelations
(
oldnew
);
// dumpAttributesAndMarkers();
}
/****************************************
* DARTS TRAVERSALS *
****************************************/
...
...
src/Topology/gmap/gmap0.cpp
View file @
82d8876f
...
...
@@ -45,4 +45,15 @@ 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 @
82d8876f
...
...
@@ -75,5 +75,24 @@ 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 @
82d8876f
...
...
@@ -895,4 +895,32 @@ 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 @
82d8876f
...
...
@@ -916,4 +916,36 @@ 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 @
82d8876f
...
...
@@ -84,4 +84,25 @@ 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 @
82d8876f
...
...
@@ -776,4 +776,30 @@ 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
;
}
}
}
}
// namespace CGoGN
src/Topology/map/map3.cpp
View file @
82d8876f
...
...
@@ -821,4 +821,36 @@ void Map3::closeMap()
}
}
void
Map3
::
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
;
}
{
Dart
&
d
=
m_phi3
->
operator
[](
i
);
Dart
e
=
Dart
(
oldnew
[
d
.
index
]);
if
(
d
!=
e
)
d
=
e
;
}
}
}
}
// namespace CGoGN
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