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
Hurstel
CGoGN
Commits
3bb52406
Commit
3bb52406
authored
Feb 01, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout Map2::deleteVertex
parent
11e22924
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
1 deletion
+92
-1
Apps/Examples/miniTest.cpp
Apps/Examples/miniTest.cpp
+16
-0
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
+11
-0
include/Topology/generic/embeddedMap2.h
include/Topology/generic/embeddedMap2.h
+7
-0
include/Topology/generic/embeddedMap2.hpp
include/Topology/generic/embeddedMap2.hpp
+33
-0
include/Topology/map/map2.h
include/Topology/map/map2.h
+7
-0
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
+1
-1
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+17
-0
No files found.
Apps/Examples/miniTest.cpp
View file @
3bb52406
...
...
@@ -552,6 +552,22 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
break
;
}
case
'v'
:
{
srand
(
time
(
NULL
))
;
unsigned
int
nbDarts
=
myMap
.
getNbDarts
()
;
unsigned
int
r
=
rand
()
%
nbDarts
;
Dart
d
(
r
)
;
if
(
myMap
.
isDartValid
(
d
))
{
myMap
.
deleteVertex
(
d
)
;
updateVBOprimitives
(
Algo
::
Render
::
VBO
::
TRIANGLES
|
Algo
::
Render
::
VBO
::
LINES
|
Algo
::
Render
::
VBO
::
POINTS
)
;
updateVBOdata
(
Algo
::
Render
::
VBO
::
POSITIONS
|
Algo
::
Render
::
VBO
::
NORMALS
)
;
topo_render
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
)
;
}
}
case
'x'
:
{
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
"export.off"
)
;
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
View file @
3bb52406
...
...
@@ -153,6 +153,17 @@ void coarsenFace(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
{
assert
(
map
.
getDartLevel
(
d
)
<=
map
.
getCurrentLevel
()
||
!
"Access to a dart introduced after current level"
)
;
assert
(
map
.
faceIsSubdividedOnce
(
d
)
||
!
"Trying to coarsen a non-subdivided face or a more than once subdivided face"
)
;
unsigned
int
cur
=
map
.
getCurrentLevel
()
;
Dart
fit
=
d
;
do
{
map
.
setCurrentLevel
(
cur
+
1
)
;
map
.
removeVertex
(
map
.
phi1
(
map
.
phi1
(
fit
)))
;
map
.
setCurrentLevel
(
cur
)
;
fit
=
map
.
phi1
(
fit
)
;
}
while
(
fit
!=
d
)
;
}
}
//namespace IHM
...
...
include/Topology/generic/embeddedMap2.h
View file @
3bb52406
...
...
@@ -50,6 +50,13 @@ public:
*/
virtual
void
splitVertex
(
Dart
d
,
Dart
e
)
;
/**
* Nothing has to be done for the vertices
* Nothing has to be done for the edges
* The attributes attached to the face of d are kept on the resulting face
*/
virtual
bool
deleteVertex
(
Dart
d
)
;
/**
* No attribute is attached to the new vertex
* The attributes attached to the old edge are duplicated on both resulting edges
...
...
include/Topology/generic/embeddedMap2.hpp
View file @
3bb52406
...
...
@@ -77,6 +77,39 @@ void EmbeddedMap2<MAP2>::splitVertex(Dart d, Dart e)
}
}
template
<
typename
MAP2
>
bool
EmbeddedMap2
<
MAP2
>::
deleteVertex
(
Dart
d
)
{
if
(
MAP2
::
isOrbitEmbedded
(
VERTEX_ORBIT
))
{
Dart
vit
=
d
;
do
{
unsigned
int
vEmb
=
MAP2
::
getDartEmbedding
(
VERTEX_ORBIT
,
MAP2
::
phi2
(
vit
))
;
if
(
vEmb
!=
EMBNULL
)
MAP2
::
setDartEmbedding
(
VERTEX_ORBIT
,
MAP2
::
phi1
(
vit
),
vEmb
)
;
vit
=
MAP2
::
alpha1
(
vit
)
;
}
while
(
vit
!=
d
)
;
}
Dart
f
=
MAP2
::
phi1
(
d
)
;
unsigned
int
fEmb
=
EMBNULL
;
if
(
MAP2
::
isOrbitEmbedded
(
FACE_ORBIT
))
{
fEmb
=
MAP2
::
getEmbedding
(
d
,
FACE_ORBIT
)
;
}
if
(
MAP2
::
deleteVertex
(
d
))
{
if
(
MAP2
::
isOrbitEmbedded
(
FACE_ORBIT
))
{
MAP2
::
embedOrbit
(
FACE_ORBIT
,
f
,
fEmb
)
;
}
return
true
;
}
return
false
;
}
template
<
typename
MAP2
>
void
EmbeddedMap2
<
MAP2
>::
cutEdge
(
Dart
d
)
{
...
...
include/Topology/map/map2.h
View file @
3bb52406
...
...
@@ -118,6 +118,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/Algo/ImplicitHierarchicalMesh/ihm.cpp
View file @
3bb52406
...
...
@@ -107,7 +107,7 @@ unsigned int ImplicitHierarchicalMap::faceLevel(Dart d)
++
nbSubd
;
// is treated here
it
=
phi1
(
it
)
;
}
while
(
m_edgeId
[
it
]
==
eId
)
;
//fLevel -= (unsigned int)(log2(nbSubd)) ;
PB WINDOWS log2 n'existe pas sous Visual 2010 !!
// fLevel -= (unsigned int)(log2(nbSubd)) ; //
PB WINDOWS log2 n'existe pas sous Visual 2010 !!
fLevel
-=
(
unsigned
int
)(
log
((
double
)
nbSubd
)
/
log
(
2.0
))
;
m_curLevel
=
cur
;
...
...
src/Topology/map/map2.cpp
View file @
3bb52406
...
...
@@ -56,6 +56,23 @@ void Map2::splitVertex(Dart d, Dart e)
phi2sew
(
phi1
(
dd
),
phi1
(
ee
));
// Sew the two faces along the new edge
}
bool
Map2
::
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
)
;
Map1
::
deleteFace
(
d
)
;
return
true
;
}
void
Map2
::
cutEdge
(
Dart
d
)
{
Map1
::
cutEdge
(
d
);
// Cut the edge of 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