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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
b066d4a5
Commit
b066d4a5
authored
Feb 11, 2014
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deplacement fonctions .cpp -> .hpp
parent
7594d4f2
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
3183 additions
and
3411 deletions
+3183
-3411
include/Topology/generic/mapMono.h
include/Topology/generic/mapMono.h
+2
-0
include/Topology/generic/mapMono.hpp
include/Topology/generic/mapMono.hpp
+25
-0
include/Topology/generic/mapMulti.h
include/Topology/generic/mapMulti.h
+2
-0
include/Topology/gmap/embeddedGMap2.h
include/Topology/gmap/embeddedGMap2.h
+3
-3
include/Topology/gmap/embeddedGMap3.h
include/Topology/gmap/embeddedGMap3.h
+3
-3
include/Topology/gmap/gmap0.h
include/Topology/gmap/gmap0.h
+0
-4
include/Topology/gmap/gmap0.hpp
include/Topology/gmap/gmap0.hpp
+23
-3
include/Topology/gmap/gmap1.h
include/Topology/gmap/gmap1.h
+0
-8
include/Topology/gmap/gmap1.hpp
include/Topology/gmap/gmap1.hpp
+38
-4
include/Topology/gmap/gmap2.h
include/Topology/gmap/gmap2.h
+0
-2
include/Topology/gmap/gmap2.hpp
include/Topology/gmap/gmap2.hpp
+998
-7
include/Topology/gmap/gmap3.h
include/Topology/gmap/gmap3.h
+0
-2
include/Topology/gmap/gmap3.hpp
include/Topology/gmap/gmap3.hpp
+1017
-3
include/Topology/map/map1.h
include/Topology/map/map1.h
+0
-8
include/Topology/map/map1.hpp
include/Topology/map/map1.hpp
+52
-6
include/Topology/map/map2.h
include/Topology/map/map2.h
+7
-10
include/Topology/map/map2.hpp
include/Topology/map/map2.hpp
+976
-0
include/Topology/map/map3.h
include/Topology/map/map3.h
+0
-2
src/Topology/gmap/embeddedGMap2.cpp
src/Topology/gmap/embeddedGMap2.cpp
+3
-3
src/Topology/gmap/embeddedGMap3.cpp
src/Topology/gmap/embeddedGMap3.cpp
+4
-4
src/Topology/gmap/gmap0.cpp
src/Topology/gmap/gmap0.cpp
+0
-59
src/Topology/gmap/gmap1.cpp
src/Topology/gmap/gmap1.cpp
+0
-101
src/Topology/gmap/gmap2.cpp
src/Topology/gmap/gmap2.cpp
+0
-1017
src/Topology/gmap/gmap3.cpp
src/Topology/gmap/gmap3.cpp
+0
-1048
src/Topology/map/map1.cpp
src/Topology/map/map1.cpp
+0
-87
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+30
-1027
No files found.
include/Topology/generic/mapMono.h
View file @
b066d4a5
...
...
@@ -88,6 +88,8 @@ protected:
template
<
int
I
>
inline
void
involutionUnsew
(
Dart
d
);
inline
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/****************************************
* DARTS TRAVERSALS *
****************************************/
...
...
include/Topology/generic/mapMono.hpp
View file @
b066d4a5
...
...
@@ -126,6 +126,31 @@ inline void MapMono::involutionUnsew(Dart d)
(
*
m_involution
[
I
])[
e
.
index
]
=
e
;
}
inline
void
MapMono
::
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
))
{
for
(
unsigned
int
j
=
0
;
j
<
m_permutation
.
size
();
++
j
)
{
Dart
d
=
(
*
m_permutation
[
j
])[
i
];
if
(
d
.
index
!=
oldnew
[
d
.
index
])
(
*
m_permutation
[
j
])[
i
]
=
Dart
(
oldnew
[
d
.
index
]);
}
for
(
unsigned
int
j
=
0
;
j
<
m_permutation_inv
.
size
();
++
j
)
{
Dart
d
=
(
*
m_permutation_inv
[
j
])[
i
];
if
(
d
.
index
!=
oldnew
[
d
.
index
])
(
*
m_permutation_inv
[
j
])[
i
]
=
Dart
(
oldnew
[
d
.
index
]);
}
for
(
unsigned
int
j
=
0
;
j
<
m_involution
.
size
();
++
j
)
{
Dart
d
=
(
*
m_involution
[
j
])[
i
];
if
(
d
.
index
!=
oldnew
[
d
.
index
])
(
*
m_involution
[
j
])[
i
]
=
Dart
(
oldnew
[
d
.
index
]);
}
}
}
/****************************************
* DARTS TRAVERSALS *
****************************************/
...
...
include/Topology/generic/mapMulti.h
View file @
b066d4a5
...
...
@@ -151,6 +151,8 @@ protected:
template
<
int
I
>
inline
void
involutionUnsew
(
Dart
d
);
inline
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/****************************************
* MR CONTAINER MANAGEMENT *
****************************************/
...
...
include/Topology/gmap/embeddedGMap2.h
View file @
b066d4a5
...
...
@@ -34,12 +34,12 @@ namespace CGoGN
* Class of 2-dimensional G-maps
* with managed embeddings
*/
class
EmbeddedGMap2
:
public
GMap2
class
EmbeddedGMap2
:
public
GMap2
<
MapMono
>
{
public:
typedef
GMap2
TOPO_MAP
;
typedef
GMap2
<
MapMono
>
TOPO_MAP
;
static
const
unsigned
int
DIMENSION
=
2
;
static
const
unsigned
int
DIMENSION
=
TOPO_MAP
::
DIMENSION
;
/**
* create a new face with managed embeddings
...
...
include/Topology/gmap/embeddedGMap3.h
View file @
b066d4a5
...
...
@@ -34,12 +34,12 @@ namespace CGoGN
* Class of 3-dimensional G-maps
* with managed embeddings
*/
class
EmbeddedGMap3
:
public
GMap3
class
EmbeddedGMap3
:
public
GMap3
<
MapMono
>
{
public:
typedef
GMap3
TOPO_MAP
;
typedef
GMap3
<
MapMono
>
TOPO_MAP
;
static
const
unsigned
int
DIMENSION
=
3
;
static
const
unsigned
int
DIMENSION
=
TOPO_MAP
::
DIMENSION
;
/*!
*
...
...
include/Topology/gmap/gmap0.h
View file @
b066d4a5
...
...
@@ -55,14 +55,10 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
virtual
Dart
newDart
();
Dart
beta0
(
const
Dart
d
)
const
;
void
beta0sew
(
Dart
d
,
Dart
e
);
...
...
include/Topology/gmap/gmap0.hpp
View file @
b066d4a5
...
...
@@ -73,19 +73,39 @@ inline void GMap0<MAP>::update_topo_shortcuts()
template
<
class
MAP
>
inline
Dart
GMap0
<
MAP
>::
beta0
(
Dart
d
)
const
{
return
MAP
::
getInvolution
<
0
>
(
d
);
return
MAP
::
template
getInvolution
<
0
>(
d
);
}
template
<
class
MAP
>
inline
void
GMap0
<
MAP
>::
beta0sew
(
Dart
d
,
Dart
e
)
{
MAP
::
involutionSew
<
0
>
(
d
,
e
);
MAP
::
template
involutionSew
<
0
>(
d
,
e
);
}
template
<
class
MAP
>
inline
void
GMap0
<
MAP
>::
beta0unsew
(
Dart
d
)
{
MAP
::
involutionUnsew
<
0
>
(
d
);
MAP
::
template
involutionUnsew
<
0
>(
d
);
}
/*! @name Constructors and Destructors
* To generate or delete edges in a 0-G-map
*************************************************************************/
template
<
class
MAP
>
Dart
GMap0
<
MAP
>::
newEdge
()
{
Dart
d1
=
this
->
newDart
();
Dart
d2
=
this
->
newDart
();
beta0sew
(
d1
,
d2
);
return
d1
;
}
template
<
class
MAP
>
void
GMap0
<
MAP
>::
deleteEdge
(
Dart
d
)
{
this
->
deleteDart
(
beta0
(
d
));
this
->
deleteDart
(
d
);
}
/*! @name Cell Functors
...
...
include/Topology/gmap/gmap1.h
View file @
b066d4a5
...
...
@@ -54,8 +54,6 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
@@ -94,12 +92,6 @@ public:
*/
Dart
newCycle
(
unsigned
int
nbEdges
);
//! Create an new face for boundary (marked)
/*! @param nbEdges the number of edges
* @return return a dart of the face
*/
// Dart newBoundaryCycle(unsigned int nbEdges);
//! Delete a face erasing all its darts
/*! @param d a dart of the face
*/
...
...
include/Topology/gmap/gmap1.hpp
View file @
b066d4a5
...
...
@@ -71,7 +71,7 @@ inline void GMap1<MAP>::update_topo_shortcuts()
template
<
class
MAP
>
inline
Dart
GMap1
<
MAP
>::
beta1
(
Dart
d
)
const
{
return
MAP
::
getInvolution
<
1
>
(
d
);
return
MAP
::
template
getInvolution
<
1
>(
d
);
}
template
<
class
MAP
>
...
...
@@ -105,7 +105,7 @@ inline Dart GMap1<MAP>::phi1(Dart d) const
template
<
class
MAP
>
inline
Dart
GMap1
<
MAP
>::
phi_1
(
Dart
d
)
const
{
return
beta0
(
beta1
(
d
))
;
return
this
->
beta0
(
beta1
(
d
))
;
}
template
<
class
MAP
>
...
...
@@ -143,13 +143,47 @@ inline Dart GMap1<MAP>::alpha_1(Dart d) const
template
<
class
MAP
>
inline
void
GMap1
<
MAP
>::
beta1sew
(
Dart
d
,
Dart
e
)
{
MAP
::
involutionSew
<
1
>
(
d
,
e
);
MAP
::
template
involutionSew
<
1
>(
d
,
e
);
}
template
<
class
MAP
>
inline
void
GMap1
<
MAP
>::
beta1unsew
(
Dart
d
)
{
MAP
::
involutionUnsew
<
1
>
(
d
);
MAP
::
template
involutionUnsew
<
1
>(
d
);
}
/*! @name Constructors and Destructors
* To generate or delete faces in a 1-G-map
*************************************************************************/
template
<
class
MAP
>
Dart
GMap1
<
MAP
>::
newCycle
(
unsigned
int
nbEdges
)
{
assert
(
nbEdges
>
0
||
!
"Cannot create a face with no edge"
)
;
Dart
d0
=
ParentMap
::
newEdge
();
// create the first edge
Dart
dp
=
this
->
beta0
(
d0
);
// store an extremity
for
(
unsigned
int
i
=
1
;
i
<
nbEdges
;
++
i
)
{
Dart
di
=
ParentMap
::
newEdge
();
// create the next edge
beta1sew
(
dp
,
di
);
dp
=
this
->
beta0
(
di
);
// change the preceding
}
beta1sew
(
dp
,
d0
);
// sew the last with the first
return
d0
;
}
template
<
class
MAP
>
void
GMap1
<
MAP
>::
deleteCycle
(
Dart
d
)
{
Dart
e
=
phi1
(
d
);
while
(
e
!=
d
)
{
Dart
f
=
phi1
(
e
);
this
->
deleteEdge
(
e
);
e
=
f
;
}
this
->
deleteEdge
(
d
);
}
/*! @name Topological Operators
...
...
include/Topology/gmap/gmap2.h
View file @
b066d4a5
...
...
@@ -61,8 +61,6 @@ 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.hpp
View file @
b066d4a5
This diff is collapsed.
Click to expand it.
include/Topology/gmap/gmap3.h
View file @
b066d4a5
...
...
@@ -67,8 +67,6 @@ 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.hpp
View file @
b066d4a5
This diff is collapsed.
Click to expand it.
include/Topology/map/map1.h
View file @
b066d4a5
...
...
@@ -59,8 +59,6 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
@@ -107,12 +105,6 @@ public:
*/
Dart
newCycle
(
unsigned
int
nbEdges
)
;
//! Create an new face for boundary (marked)
/*! @param nbEdges the number of edges
* @return return a dart of the face
*/
// Dart newBoundaryCycle(unsigned int nbEdges);
//! Delete an oriented face erasing all its darts
/*! @param d a dart of the face
*/
...
...
include/Topology/map/map1.hpp
View file @
b066d4a5
...
...
@@ -127,6 +127,33 @@ inline void Map1<MAP>::phi1unsew(Dart d)
MAP
::
permutationUnsew
<
0
>
(
d
);
}
/*! @name Generator and Deletor
* To generate or delete faces in a 1-map
*************************************************************************/
template
<
class
MAP
>
Dart
Map1
<
MAP
>::
newCycle
(
unsigned
int
nbEdges
)
{
assert
(
nbEdges
>
0
||
!
"Cannot create a face with no edge"
)
;
Dart
d
=
this
->
newDart
()
;
// Create the first edge
for
(
unsigned
int
i
=
1
;
i
<
nbEdges
;
++
i
)
Map1
<
MAP
>::
cutEdge
(
d
)
;
// Subdivide nbEdges-1 times this edge
return
d
;
}
template
<
class
MAP
>
void
Map1
<
MAP
>::
deleteCycle
(
Dart
d
)
{
Dart
e
=
phi1
(
d
)
;
while
(
e
!=
d
)
{
Dart
f
=
phi1
(
e
)
;
this
->
deleteDart
(
e
)
;
e
=
f
;
}
this
->
deleteDart
(
d
)
;
}
/*! @name Topological Operators
* Topological operations on 1-maps
*************************************************************************/
...
...
@@ -134,14 +161,14 @@ inline void Map1<MAP>::phi1unsew(Dart d)
template
<
class
MAP
>
inline
Dart
Map1
<
MAP
>::
cutEdge
(
Dart
d
)
{
Dart
e
=
MAP
::
newDart
()
;
// Create a new dart
Dart
e
=
this
->
newDart
()
;
// Create a new dart
phi1sew
(
d
,
e
)
;
// Insert dart e between d and phi1(d)
if
(
this
->
isBoundaryMarked2
(
d
))
MAP
::
boundaryMark2
(
e
);
this
->
boundaryMark2
(
e
);
if
(
MAP
::
isBoundaryMarked3
(
d
))
MAP
::
boundaryMark3
(
e
);
if
(
this
->
isBoundaryMarked3
(
d
))
this
->
boundaryMark3
(
e
);
return
e
;
}
...
...
@@ -151,14 +178,14 @@ inline void Map1<MAP>::uncutEdge(Dart d)
{
Dart
d1
=
phi1
(
d
)
;
phi1unsew
(
d
)
;
// Dart d is linked to the successor of its successor
MAP
::
deleteDart
(
d1
)
;
// Dart d1 is erased
this
->
deleteDart
(
d1
)
;
// Dart d1 is erased
}
template
<
class
MAP
>
inline
void
Map1
<
MAP
>::
collapseEdge
(
Dart
d
)
{
phi1unsew
(
phi_1
(
d
))
;
// Dart before d is linked to its successor
MAP
::
deleteDart
(
d
)
;
// Dart d is erased
this
->
deleteDart
(
d
)
;
// Dart d is erased
}
template
<
class
MAP
>
...
...
@@ -184,6 +211,25 @@ inline void Map1<MAP>::linkCycles(Dart d, Dart e)
phi1sew
(
phi_1
(
d
),
phi_1
(
e
))
;
// phi1sew between the 2 new inserted darts
}
template
<
class
MAP
>
void
Map1
<
MAP
>::
reverseCycle
(
Dart
d
)
{
Dart
e
=
phi1
(
d
)
;
// Dart e is the first edge of the new face
if
(
e
==
d
)
return
;
// Only one edge: nothing to do
if
(
phi1
(
e
)
==
d
)
return
;
// Only two edges: nothing to do
phi1unsew
(
d
)
;
// Detach e from the face of d
Dart
dNext
=
phi1
(
d
)
;
// While the face of d contains more than two edges
while
(
dNext
!=
d
)
{
phi1unsew
(
d
)
;
// Unsew the edge after d
phi1sew
(
e
,
dNext
)
;
// Sew it after e (thus in reverse order)
dNext
=
phi1
(
d
)
;
}
phi1sew
(
e
,
d
)
;
// Sew the last edge
}
/*! @name Topological Queries
* Return or set various topological information
*************************************************************************/
...
...
include/Topology/map/map2.h
View file @
b066d4a5
...
...
@@ -73,8 +73,6 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
@@ -116,8 +114,7 @@ protected:
void
phi2unsew
(
Dart
d
);
public:
void
rdfi
(
Dart
t
,
DartMarker
&
m1
,
DartMarker
&
m2
);
// void rdfi(Dart t, DartMarker& m1, DartMarker& m2);
//void propagateDartRelation(Dart d) ;
...
...
@@ -352,12 +349,6 @@ public:
*/
Dart
findBoundaryEdgeOfVertex
(
Dart
d
)
const
;
/**
* find the dart of edge that belong to the boundary
* return NIL if the face is not on the boundary
*/
Dart
findBoundaryEdgeOfFace
(
Dart
d
)
const
;
//! Test if dart d and e belong to the same edge
/*! @param d a dart
* @param e a dart
...
...
@@ -398,6 +389,12 @@ public:
*/
bool
isBoundaryFace
(
Dart
d
)
const
;
/**
* find the dart of edge that belong to the boundary
* return NIL if the face is not on the boundary
*/
Dart
findBoundaryEdgeOfFace
(
Dart
d
)
const
;
//! Test if dart d and e belong to the same oriented volume
/*! @param d a dart
* @param e a dart
...
...
include/Topology/map/map2.hpp
View file @
b066d4a5
This diff is collapsed.
Click to expand it.
include/Topology/map/map3.h
View file @
b066d4a5
...
...
@@ -81,8 +81,6 @@ public:
virtual
void
update_topo_shortcuts
();
virtual
void
compactTopoRelations
(
const
std
::
vector
<
unsigned
int
>&
oldnew
);
/*! @name Basic Topological Operators
* Access and Modification
*************************************************************************/
...
...
src/Topology/gmap/embeddedGMap2.cpp
View file @
b066d4a5
...
...
@@ -582,13 +582,13 @@ bool EmbeddedGMap2::check()
CGoGNout
<<
"Check: embedding ok"
<<
CGoGNendl
;
std
::
cout
<<
"nb vertex orbits : "
<<
getNbOrbits
<
VERTEX
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb vertex orbits : "
<<
getNbOrbits
<
EmbeddedGMap2
,
VERTEX
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb vertex cells : "
<<
m_attribs
[
VERTEX
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb edge orbits : "
<<
getNbOrbits
<
EDGE
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb edge orbits : "
<<
getNbOrbits
<
EmbeddedGMap2
,
EDGE
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb edge cells : "
<<
m_attribs
[
EDGE
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb face orbits : "
<<
getNbOrbits
<
FACE
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb face orbits : "
<<
getNbOrbits
<
EmbeddedGMap2
,
FACE
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb face cells : "
<<
m_attribs
[
FACE
].
size
()
<<
std
::
endl
;
return
true
;
...
...
src/Topology/gmap/embeddedGMap3.cpp
View file @
b066d4a5
...
...
@@ -461,16 +461,16 @@ bool EmbeddedGMap3::check()
CGoGNout
<<
"Check: embedding ok"
<<
CGoGNendl
;
std
::
cout
<<
"nb vertex orbits : "
<<
getNbOrbits
<
VERTEX
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb vertex orbits : "
<<
getNbOrbits
<
EmbeddedGMap3
,
VERTEX
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb vertex cells : "
<<
m_attribs
[
VERTEX
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb edge orbits : "
<<
getNbOrbits
<
EDGE
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb edge orbits : "
<<
getNbOrbits
<
EmbeddedGMap3
,
EDGE
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb edge cells : "
<<
m_attribs
[
EDGE
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb face orbits : "
<<
getNbOrbits
<
FACE
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb face orbits : "
<<
getNbOrbits
<
EmbeddedGMap3
,
FACE
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb face cells : "
<<
m_attribs
[
FACE
].
size
()
<<
std
::
endl
;
std
::
cout
<<
"nb volume orbits : "
<<
getNbOrbits
<
VOLUME
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb volume orbits : "
<<
getNbOrbits
<
EmbeddedGMap3
,
VOLUME
>
()
<<
std
::
endl
;
std
::
cout
<<
"nb volume cells : "
<<
m_attribs
[
VOLUME
].
size
()
<<
std
::
endl
;
return
true
;
...
...
src/Topology/gmap/gmap0.cpp
deleted
100644 → 0
View file @
7594d4f2
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Topology/gmap/gmap0.h"
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
*************************************************************************/
Dart
GMap0
::
newEdge
()
{
Dart
d1
=
newDart
();
Dart
d2
=
newDart
();
beta0sew
(
d1
,
d2
);
return
d1
;
}
void
GMap0
::
deleteEdge
(
Dart
d
)
{
deleteDart
(
beta0
(
d
));
deleteDart
(
d
);
}
}
// namespace CGoGN
src/Topology/gmap/gmap1.cpp
deleted
100644 → 0
View file @
7594d4f2
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Topology/gmap/gmap1.h"
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
*************************************************************************/
Dart
GMap1
::
newCycle
(
unsigned
int
nbEdges
)
{
assert
(
nbEdges
>
0
||
!
"Cannot create a face with no edge"
)
;
Dart
d0
=
GMap0
::
newEdge
();
// create the first edge
Dart
dp
=
beta0
(
d0
);
// store an extremity
for
(
unsigned
int
i
=
1
;
i
<
nbEdges
;
++
i
)
{
Dart
di
=
GMap0
::
newEdge
();
// create the next edge
beta1sew
(
dp
,
di
);
dp
=
beta0
(
di
);
// change the preceding
}
beta1sew
(
dp
,
d0
);
// sew the last with the first
return
d0
;
}
//Dart GMap1::newBoundaryCycle(unsigned int nbEdges)
//{
// assert(nbEdges > 0 || !"Cannot create a face with no edge") ;
//