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
David Cazier
CGoGN
Commits
059b23c9
Commit
059b23c9
authored
Feb 02, 2011
by
Pierre Kraemer
Browse files
deleteVertex pour les 2-G-cartes
parent
3bb52406
Changes
4
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/miniTest.cpp
View file @
059b23c9
...
...
@@ -26,7 +26,7 @@
#include
"Utils/glutwin_atb.h"
#include
"Topology/map/map2.h"
#include
"Topology/
g
map/
g
map2.h"
#include
"Topology/generic/embeddedMap2.h"
#include
"Geometry/matrix.h"
...
...
@@ -49,7 +49,7 @@ using namespace CGoGN ;
struct
PFP
{
// definition of the map
typedef
EmbeddedMap2
<
Map2
>
MAP
;
typedef
EmbeddedMap2
<
G
Map2
>
MAP
;
// definition of the type of real value
typedef
float
REAL
;
...
...
@@ -552,7 +552,6 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
break
;
}
case
'v'
:
{
srand
(
time
(
NULL
))
;
...
...
@@ -566,6 +565,8 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
updateVBOdata
(
Algo
::
Render
::
VBO
::
POSITIONS
|
Algo
::
Render
::
VBO
::
NORMALS
)
;
topo_render
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
)
;
}
glutPostRedisplay
()
;
break
;
}
case
'x'
:
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
View file @
059b23c9
...
...
@@ -160,7 +160,7 @@ void coarsenFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
do
{
map
.
setCurrentLevel
(
cur
+
1
)
;
map
.
remov
eVertex
(
map
.
phi1
(
map
.
phi1
(
fit
)))
;
map
.
delet
eVertex
(
map
.
phi1
(
map
.
phi1
(
fit
)))
;
map
.
setCurrentLevel
(
cur
)
;
fit
=
map
.
phi1
(
fit
)
;
}
while
(
fit
!=
d
)
;
...
...
include/Topology/gmap/gmap2.h
View file @
059b23c9
...
...
@@ -100,6 +100,13 @@ public:
*/
virtual
void
splitVertex
(
Dart
d
,
Dart
e
);
//! Delete the vertex of d (works only for internal vertices)
/*! All the faces around the vertex are merged into one face
* @param d a dart of the vertex to delete
* @return true if the deletion has been executed, false otherwise
*/
virtual
bool
deleteVertex
(
Dart
d
)
;
//! Cut the edge of d and its opposite edge if it exists
/*! @param d a dart of the edge to cut
*/
...
...
src/Topology/gmap/gmap2.cpp
View file @
059b23c9
...
...
@@ -56,6 +56,23 @@ void GMap2::splitVertex(Dart d, Dart e)
phi2sew
(
phi1
(
dd
),
phi1
(
ee
));
// Sew the two faces along the new edge
}
bool
GMap2
::
deleteVertex
(
Dart
d
)
{
if
(
isBoundaryVertex
(
d
))
return
false
;
Dart
vit
=
d
;
do
{
Dart
f
=
phi_1
(
phi2
(
vit
))
;
phi1sew
(
vit
,
f
)
;
vit
=
alpha1
(
vit
)
;
}
while
(
vit
!=
d
)
;
GMap1
::
deleteFace
(
d
)
;
return
true
;
}
void
GMap2
::
cutEdge
(
Dart
d
)
{
GMap1
::
cutEdge
(
d
);
// Cut the edge of d
...
...
@@ -396,7 +413,7 @@ bool GMap2::isBoundaryVertex(Dart d)
{
if
(
beta2
(
dNext
)
==
dNext
)
return
true
;
dNext
=
alpha1
(
d
)
;
dNext
=
alpha1
(
d
Next
)
;
}
while
(
dNext
!=
d
)
;
return
false
;
}
...
...
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