Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
6b80a81e
Commit
6b80a81e
authored
Jun 21, 2013
by
Sylvain Thery
Browse files
add checkXXXDegree functions (more efficient than XXXDegree == deg)
parent
56927cbd
Changes
10
Hide whitespace changes
Inline
Side-by-side
include/Topology/gmap/gmap1.h
View file @
6b80a81e
...
...
@@ -180,6 +180,13 @@ public:
*/
unsigned
int
cycleDegree
(
Dart
d
);
//! Check the Length of a cycle (its number of oriented edges)
/*! @param d a dart of the cycle
* @param le the length to compare
* @return negative/null/positive if face degree is less/equal/greater than given degree
*/
int
checkCycleDegree
(
Dart
d
,
unsigned
int
le
)
;
/**
* check if the face of d is a triangle
* @return a boolean indicating if the face is a triangle
...
...
include/Topology/gmap/gmap1.hpp
View file @
6b80a81e
...
...
@@ -286,6 +286,20 @@ inline unsigned int GMap1::cycleDegree(Dart d)
return
count
;
}
inline
int
GMap1
::
checkCycleDegree
(
Dart
d
,
unsigned
int
degree
)
{
unsigned
int
count
=
0
;
Dart
it
=
d
;
do
{
++
count
;
it
=
phi1
(
it
)
;
}
while
((
count
<=
degree
)
&&
(
it
!=
d
))
;
return
count
-
degree
;
}
inline
bool
GMap1
::
isCycleTriangle
(
Dart
d
)
{
return
(
phi1
(
d
)
!=
d
)
&&
(
phi1
(
phi1
(
phi1
(
d
)))
==
d
)
;
...
...
include/Topology/gmap/gmap2.h
View file @
6b80a81e
...
...
@@ -287,6 +287,13 @@ public:
*/
unsigned
int
vertexDegree
(
Dart
d
)
;
//! Check number of edges of the vertex of d with given parameter
/*! @param d a dart
* @param vd degree to compare with
* @return negative/null/positive if vertex degree is less/equal/greater than given degree
*/
int
checkVertexDegree
(
Dart
d
,
unsigned
int
vd
);
//! tell if the vertex of d is on the boundary of the map
/*! @param d a dart
*/
...
...
@@ -326,6 +333,13 @@ public:
*/
unsigned
int
faceDegree
(
Dart
d
)
;
//! Check number of edges of the face of d with given parameter
/*! @param d a dart
* @param vd degree to compare with
* @return negative/null/positive if vertex degree is less/equal/greater than given degree
*/
int
checkFaceDegree
(
Dart
d
,
unsigned
int
le
);
/**
* tell if the face of d is on the boundary of the map
*/
...
...
@@ -348,6 +362,13 @@ public:
*/
unsigned
int
volumeDegree
(
Dart
d
);
//! Check number of faces of the volume of d with given parameter
/*! @param d a dart
* @param vd degree to compare with
* @return negative/null/positive if volume degree is less/equal/greater than given degree
*/
int
checkVolumeDegree
(
Dart
d
,
unsigned
int
volDeg
);
// TODO a mettre en algo
/**
* check if the mesh is triangular or not
...
...
include/Topology/gmap/gmap2.hpp
View file @
6b80a81e
...
...
@@ -187,6 +187,12 @@ inline unsigned int GMap2::faceDegree(Dart d)
return
GMap1
::
cycleDegree
(
d
)
;
}
inline
int
GMap2
::
checkFaceDegree
(
Dart
d
,
unsigned
int
le
)
{
return
GMap1
::
checkCycleDegree
(
d
,
le
)
;
}
inline
bool
GMap2
::
sameVolume
(
Dart
d
,
Dart
e
)
{
return
sameOrientedVolume
(
d
,
e
)
||
sameOrientedVolume
(
beta2
(
d
),
e
)
;
...
...
include/Topology/gmap/gmap3.h
View file @
6b80a81e
...
...
@@ -214,6 +214,15 @@ public:
*/
unsigned
int
vertexDegree
(
Dart
d
)
;
//! Check number of edges of the vertex of d with given parameter
/*! @param d a dart
* @param vd degree to compare with
* @return negative/null/positive if vertex degree is less/equal/greater than given degree
*/
int
checkVertexDegree
(
Dart
d
,
unsigned
int
vd
);
//! Tell if the vertex of d is on the boundary
/*! @param d a dart
*/
...
...
include/Topology/map/map1.h
View file @
6b80a81e
...
...
@@ -189,6 +189,13 @@ public:
*/
unsigned
int
cycleDegree
(
Dart
d
)
;
//! Check the Length of a cycle (its number of oriented edges)
/*! @param d a dart of the cycle
* @param degree the length to compare
* @return negative/null/positive if face degree is less/equal/greater than given degree
*/
int
checkCycleDegree
(
Dart
d
,
unsigned
int
degree
)
;
/**
* check if the cycle of d is a triangle
* @return a boolean indicating if the cycle is a triangle
...
...
include/Topology/map/map1.hpp
View file @
6b80a81e
...
...
@@ -231,6 +231,21 @@ inline unsigned int Map1::cycleDegree(Dart d)
return
count
;
}
inline
int
Map1
::
checkCycleDegree
(
Dart
d
,
unsigned
int
degree
)
{
unsigned
int
count
=
0
;
Dart
it
=
d
;
do
{
++
count
;
it
=
phi1
(
it
)
;
}
while
((
count
<=
degree
)
&&
(
it
!=
d
))
;
return
count
-
degree
;
}
inline
bool
Map1
::
isCycleTriangle
(
Dart
d
)
{
return
(
phi1
(
d
)
!=
d
)
&&
(
phi1
(
phi1
(
phi1
(
d
)))
==
d
)
;
...
...
include/Topology/map/map2.h
View file @
6b80a81e
...
...
@@ -333,6 +333,13 @@ public:
*/
unsigned
int
vertexDegree
(
Dart
d
)
;
//! Check number of edges of the vertex of d with given parameter
/*! @param d a dart
* @param vd degree to compare with
* @return negative/null/positive if vertex degree is less/equal/greater than given degree
*/
int
checkVertexDegree
(
Dart
d
,
unsigned
int
vd
);
//! Tell if the vertex of d is on the boundary of the map
/*! @param d a dart
*/
...
...
@@ -378,6 +385,13 @@ public:
*/
unsigned
int
faceDegree
(
Dart
d
)
;
//! Check number of edges of the face of d with given parameter
/*! @param d a dart
* @param vd degree to compare with
* @return negative/null/positive if vertex degree is less/equal/greater than given degree
*/
int
checkFaceDegree
(
Dart
d
,
unsigned
int
le
);
/**
* tell if the face of d is on the boundary of the map
*/
...
...
@@ -400,6 +414,13 @@ public:
*/
unsigned
int
volumeDegree
(
Dart
d
);
//! Check number of faces of the volume of d with given parameter
/*! @param d a dart
* @param vd degree to compare with
* @return negative/null/positive if volume degree is less/equal/greater than given degree
*/
int
checkVolumeDegree
(
Dart
d
,
unsigned
int
volDeg
);
// TODO a mettre en algo
/**
* check if the mesh is triangular or not
...
...
include/Topology/map/map2.hpp
View file @
6b80a81e
...
...
@@ -184,6 +184,13 @@ inline unsigned int Map2::faceDegree(Dart d)
return
Map1
::
cycleDegree
(
d
)
;
}
inline
int
Map2
::
checkFaceDegree
(
Dart
d
,
unsigned
int
le
)
{
return
Map1
::
checkCycleDegree
(
d
,
le
)
;
}
inline
bool
Map2
::
sameVolume
(
Dart
d
,
Dart
e
)
{
return
sameOrientedVolume
(
d
,
e
)
;
...
...
include/Topology/map/map3.h
View file @
6b80a81e
...
...
@@ -301,6 +301,15 @@ public:
*/
unsigned
int
vertexDegree
(
Dart
d
)
;
//! Check number of edges of the vertex of d with given parameter
/*! @param d a dart
* @param vd degree to compare with
* @return negative/null/positive if vertex degree is less/equal/greater than given degree
*/
int
checkVertexDegree
(
Dart
d
,
unsigned
int
vd
);
//! Compute the number of edges of the vertex of d on the boundary
/*! @param d a dart
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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