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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
90f72548
Commit
90f72548
authored
Oct 10, 2011
by
Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modif gmap2 pas de sameOrientedVertex ajout sameVolume
parent
f09570dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
19 deletions
+33
-19
include/Topology/gmap/gmap2.h
include/Topology/gmap/gmap2.h
+2
-7
src/Topology/gmap/gmap2.cpp
src/Topology/gmap/gmap2.cpp
+31
-12
No files found.
include/Topology/gmap/gmap2.h
View file @
90f72548
...
...
@@ -246,19 +246,14 @@ public:
* Return or set various topological information
*************************************************************************/
//@{
//! Test if dart d and e belong to the same oriented vertex
/*! @param d a dart
* @param e a dart
*/
bool
sameOrientedVertex
(
Dart
d
,
Dart
e
);
//! Test if dart d and e belong to the same vertex
/*! @param d a dart
* @param e a dart
*/
bool
sameVertex
(
Dart
d
,
Dart
e
);
bool
sameVolume
(
Dart
d
,
Dart
e
);
/**
* compute the number of edges of the vertex of d
*/
...
...
src/Topology/gmap/gmap2.cpp
View file @
90f72548
...
...
@@ -48,7 +48,7 @@ void GMap2::deleteFace(Dart d)
void
GMap2
::
splitVertex
(
Dart
d
,
Dart
e
)
{
assert(same
Oriented
Vertex(d, e));
assert
(
sameVertex
(
d
,
e
));
Dart
dd
=
phi2
(
d
)
;
Dart
ee
=
phi2
(
e
)
;
GMap1
::
cutEdge
(
dd
);
// Cut the edge of dd (make a new edge)
...
...
@@ -272,7 +272,7 @@ void GMap2::extractTrianglePair(Dart d)
void
GMap2
::
insertTrianglePair
(
Dart
d
,
Dart
v1
,
Dart
v2
)
{
assert(v1 != v2 && same
Oriented
Vertex(v1, v2)) ;
assert
(
v1
!=
v2
&&
sameVertex
(
v1
,
v2
))
;
assert
(
isFaceTriangle
(
d
)
&&
phi2
(
phi1
(
d
))
==
phi1
(
d
)
&&
phi2
(
phi_1
(
d
))
==
phi_1
(
d
))
;
Dart
e
=
phi2
(
d
)
;
if
(
e
!=
d
)
...
...
@@ -426,28 +426,47 @@ void GMap2::closeMap(DartMarker& marker)
* Return or set various topological information
*************************************************************************/
bool GMap2::same
Oriented
Vertex(Dart d, Dart e)
bool
GMap2
::
sameVertex
(
Dart
d
,
Dart
e
)
{
Dart
dNext
=
d
;
// Foreach dart dNext in the vertex of d
do
{
if (dNext == e
)
// Test equality with e
if
(
dNext
==
e
||
beta2
(
dNext
)
==
e
)
// Test equality with e
return
true
;
dNext
=
alpha1
(
dNext
);
}
while
(
dNext
!=
d
);
return
false
;
// None is equal to e => vertices are distinct
}
bool GMap2::sameV
ertex
(Dart d, Dart e)
bool
GMap2
::
sameV
olume
(
Dart
d
,
Dart
e
)
{
Dart dNext = d; // Foreach dart dNext in the vertex of d
do
DartMarkerStore
mark
(
*
this
);
// Lock a marker
bool
found
=
false
;
// Last functor return value
std
::
list
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
push_back
(
d
);
// Start with the face of d
std
::
list
<
Dart
>::
iterator
face
;
// For every face added to the list
for
(
face
=
visitedFaces
.
begin
();
!
found
&&
face
!=
visitedFaces
.
end
();
++
face
)
{
if (dNext == e || beta2(dNext) == e) // Test equality with e
return true;
dNext = alpha1(dNext);
} while (dNext != d);
return false; // None is equal to e => vertices are distinct
if
(
!
mark
.
isMarked
(
*
face
))
// Face has not been visited yet
{
Dart
dNext
=
*
face
;
do
{
if
(
dNext
==
e
||
beta0
(
dNext
)
==
e
)
return
true
;
mark
.
mark
(
dNext
);
// Mark
Dart
adj
=
phi2
(
dNext
);
// Get adjacent face
if
(
adj
!=
dNext
&&
!
mark
.
isMarked
(
adj
))
visitedFaces
.
push_back
(
adj
);
// Add it
dNext
=
phi1
(
dNext
);
}
while
(
dNext
!=
*
face
);
}
}
return
false
;
}
unsigned
int
GMap2
::
vertexDegree
(
Dart
d
)
...
...
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