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
0b827205
Commit
0b827205
authored
May 16, 2012
by
Lionel Untereiner
Browse files
vertex split suite
parent
c8942970
Changes
6
Hide whitespace changes
Inline
Side-by-side
Apps/Tuto/tuto_oper2.cpp
View file @
0b827205
...
...
@@ -74,7 +74,7 @@ void MyQT::operation(int x)
PFP
::
VEC3
c1
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
PFP
::
VEC3
c2
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected2
,
position
);
position
[
m_selected
]
=
position
[
m_selected
]
*
0.7
f
+
c1
*
0.3
f
;
position
[
m_selected2
]
=
position
[
m_sel
ected2
]
*
0.7
f
+
c2
*
0.3
f
;
position
[
m_selected2
]
=
position
[
m_selected2
]
*
0.7
f
+
c2
*
0.3
f
;
updateMap
();
}
break
;
...
...
Apps/Tuto/tuto_oper3.cpp
View file @
0b827205
...
...
@@ -180,13 +180,12 @@ void MyQT::operation(int x)
break
;
case
10
:
CGoGNout
<<
"split vertex"
<<
CGoGNendl
;
if
(
m_selected
!=
NIL
&&
m_selected2
!=
NIL
)
if
(
!
m_selected
s
.
empty
()
)
{
PFP
::
VEC3
c1
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
myMap
.
findBoundaryFaceOfEdge
(
m_selected
),
position
);
PFP
::
VEC3
c2
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
myMap
.
findBoundaryFaceOfEdge
(
m_selected2
),
position
);
myMap
.
splitVertex
(
m_selected
,
m_selected2
);
position
[
m_selected
]
=
position
[
m_selected
]
*
0.7
f
+
c1
*
0.3
f
;
position
[
m_selected2
]
=
position
[
m_selected2
]
*
0.7
f
+
c2
*
0.3
f
;
Dart
dit
=
m_selecteds
.
front
();
PFP
::
VEC3
c1
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
dit
,
position
);
myMap
.
splitVertex
(
m_selecteds
);
position
[
dit
]
=
position
[
dit
]
*
0.7
f
+
c1
*
0.3
f
;
updateMap
();
}
break
;
...
...
include/Topology/map/embeddedMap3.h
View file @
0b827205
...
...
@@ -41,7 +41,7 @@ public:
/*!
*
*/
virtual
void
splitVertex
(
Dart
d
,
Dart
e
);
virtual
void
splitVertex
(
std
::
vector
<
Dart
>&
vd
);
//!
/*!
...
...
include/Topology/map/map3.h
View file @
0b827205
...
...
@@ -137,14 +137,13 @@ public:
*************************************************************************/
//@{
//! Split the vertex
//! Split the vertex
along a permutation of faces
/*! \per Darts d & e MUST belong to the same vertex
* \per Darts d & e MUST belong to different volumes
* \per Works only on the boundary
* @param d first dart in vertex v
* @param e second dart in vertex v
* @param vd a vector of darts
*/
virtual
void
splitVertex
(
Dart
d
,
Dart
e
);
virtual
void
splitVertex
(
std
::
vector
<
Dart
>&
vd
);
//! Delete the vertex of d
/*! All the volumes around the vertex are merged into one volume
...
...
src/Topology/map/embeddedMap3.cpp
View file @
0b827205
...
...
@@ -27,16 +27,18 @@
namespace
CGoGN
{
void
EmbeddedMap3
::
splitVertex
(
Dart
d
,
Dart
e
)
void
EmbeddedMap3
::
splitVertex
(
std
::
vector
<
Dart
>&
vd
)
{
Dart
d
=
vd
.
front
();
Dart
d3
=
phi2
(
phi3
(
d
));
Map3
::
splitVertex
(
d
,
e
);
Map3
::
splitVertex
(
v
d
);
if
(
isOrbitEmbedded
(
VERTEX
))
{
embedOrbit
(
VERTEX
,
d
,
getEmbedding
(
VERTEX
,
d
));
embedNewCell
(
VERTEX
,
phi2
(
phi1
(
phi2
(
d
)))
);
copyCell
(
VERTEX
,
phi2
(
phi1
(
phi2
(
d
)))
,
d
);
embedNewCell
(
VERTEX
,
d3
);
copyCell
(
VERTEX
,
d3
,
d
);
}
if
(
isOrbitEmbedded
(
EDGE
))
...
...
@@ -46,8 +48,10 @@ void EmbeddedMap3::splitVertex(Dart d, Dart e)
if
(
isOrbitEmbedded
(
VOLUME
))
{
embedOrbit
(
VOLUME
,
d
,
getEmbedding
(
VOLUME
,
d
))
;
embedOrbit
(
VOLUME
,
e
,
getEmbedding
(
VOLUME
,
e
))
;
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
()
;
it
!=
vd
.
end
()
;
++
it
)
{
embedOrbit
(
VOLUME
,
*
it
,
getEmbedding
(
VOLUME
,
*
it
))
;
}
}
}
...
...
src/Topology/map/map3.cpp
View file @
0b827205
...
...
@@ -129,11 +129,18 @@ void Map3::fillHole(Dart d)
* Topological operations on 3-maps
*************************************************************************/
void
Map3
::
splitVertex
(
Dart
d
,
Dart
e
)
void
Map3
::
splitVertex
(
std
::
vector
<
Dart
>&
vd
)
{
assert
(
sameVertex
(
d
,
e
));
assert
(
!
sameVolume
(
d
,
e
));
//assert(checkPathAroundVertex(vd)) ; assert(sameVertex(d,e));
//unsew the face path
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
()
;
it
!=
vd
.
end
()
;
++
it
)
{
unsewVolumes
(
*
it
);
}
/*
if(isBoundaryVertex(d))
{
unsewVolumes(d);
...
...
@@ -151,6 +158,7 @@ void Map3::splitVertex(Dart d, Dart e)
// Map2::splitVertex(e, ec);
// //Map2::splitFace(e, phi2(ec));
}
*/
}
Dart
Map3
::
deleteVertex
(
Dart
d
)
...
...
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