Commit 0b827205 authored by Lionel Untereiner's avatar Lionel Untereiner

vertex split suite

parent c8942970
...@@ -74,7 +74,7 @@ void MyQT::operation(int x) ...@@ -74,7 +74,7 @@ void MyQT::operation(int x)
PFP::VEC3 c1 = Algo::Geometry::faceCentroid<PFP>(myMap, m_selected, position); PFP::VEC3 c1 = Algo::Geometry::faceCentroid<PFP>(myMap, m_selected, position);
PFP::VEC3 c2 = Algo::Geometry::faceCentroid<PFP>(myMap, m_selected2, position); PFP::VEC3 c2 = Algo::Geometry::faceCentroid<PFP>(myMap, m_selected2, position);
position[m_selected] = position[m_selected] * 0.7f + c1*0.3f; position[m_selected] = position[m_selected] * 0.7f + c1*0.3f;
position[m_selected2] = position[m_sel ected2] * 0.7f + c2*0.3f; position[m_selected2] = position[m_selected2] * 0.7f + c2*0.3f;
updateMap(); updateMap();
} }
break; break;
......
...@@ -180,13 +180,12 @@ void MyQT::operation(int x) ...@@ -180,13 +180,12 @@ void MyQT::operation(int x)
break; break;
case 10: case 10:
CGoGNout <<"split vertex"<<CGoGNendl; CGoGNout <<"split vertex"<<CGoGNendl;
if(m_selected != NIL && m_selected2 != NIL) if (!m_selecteds.empty())
{ {
PFP::VEC3 c1 = Algo::Geometry::faceCentroid<PFP>(myMap, myMap.findBoundaryFaceOfEdge(m_selected), position); Dart dit = m_selecteds.front();
PFP::VEC3 c2 = Algo::Geometry::faceCentroid<PFP>(myMap, myMap.findBoundaryFaceOfEdge(m_selected2), position); PFP::VEC3 c1 = Algo::Geometry::faceCentroid<PFP>(myMap, dit, position);
myMap.splitVertex(m_selected, m_selected2); myMap.splitVertex(m_selecteds);
position[m_selected] = position[m_selected] * 0.7f + c1*0.3f; position[dit] = position[dit] * 0.7f + c1*0.3f;
position[m_selected2] = position[m_selected2] * 0.7f + c2*0.3f;
updateMap(); updateMap();
} }
break; break;
......
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
/*! /*!
* *
*/ */
virtual void splitVertex(Dart d, Dart e); virtual void splitVertex(std::vector<Dart>& vd);
//! //!
/*! /*!
......
...@@ -137,14 +137,13 @@ public: ...@@ -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 the same vertex
* \per Darts d & e MUST belong to different volumes * \per Darts d & e MUST belong to different volumes
* \per Works only on the boundary * \per Works only on the boundary
* @param d first dart in vertex v * @param vd a vector of darts
* @param e second dart in vertex v
*/ */
virtual void splitVertex(Dart d, Dart e); virtual void splitVertex(std::vector<Dart>& vd);
//! Delete the vertex of d //! Delete the vertex of d
/*! All the volumes around the vertex are merged into one volume /*! All the volumes around the vertex are merged into one volume
......
...@@ -27,16 +27,18 @@ ...@@ -27,16 +27,18 @@
namespace CGoGN 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(vd);
if(isOrbitEmbedded(VERTEX)) if(isOrbitEmbedded(VERTEX))
{ {
embedOrbit(VERTEX, d, getEmbedding(VERTEX, d)); embedOrbit(VERTEX, d, getEmbedding(VERTEX, d));
embedNewCell(VERTEX, phi2(phi1(phi2(d)))); embedNewCell(VERTEX, d3);
copyCell(VERTEX, phi2(phi1(phi2(d))), d); copyCell(VERTEX, d3, d);
} }
if(isOrbitEmbedded(EDGE)) if(isOrbitEmbedded(EDGE))
...@@ -46,8 +48,10 @@ void EmbeddedMap3::splitVertex(Dart d, Dart e) ...@@ -46,8 +48,10 @@ void EmbeddedMap3::splitVertex(Dart d, Dart e)
if(isOrbitEmbedded(VOLUME)) if(isOrbitEmbedded(VOLUME))
{ {
embedOrbit(VOLUME, d, getEmbedding(VOLUME, d)) ; for(std::vector<Dart>::iterator it = vd.begin() ; it != vd.end() ; ++it)
embedOrbit(VOLUME, e, getEmbedding(VOLUME, e)) ; {
embedOrbit(VOLUME, *it, getEmbedding(VOLUME, *it)) ;
}
} }
} }
......
...@@ -129,11 +129,18 @@ void Map3::fillHole(Dart d) ...@@ -129,11 +129,18 @@ void Map3::fillHole(Dart d)
* Topological operations on 3-maps * Topological operations on 3-maps
*************************************************************************/ *************************************************************************/
void Map3::splitVertex(Dart d, Dart e) void Map3::splitVertex(std::vector<Dart>& vd)
{ {
assert(sameVertex(d,e)); //assert(checkPathAroundVertex(vd)) ; assert(sameVertex(d,e));
assert(!sameVolume(d,e));
//unsew the face path
for(std::vector<Dart>::iterator it = vd.begin() ; it != vd.end() ; ++it)
{
unsewVolumes(*it);
}
/*
if(isBoundaryVertex(d)) if(isBoundaryVertex(d))
{ {
unsewVolumes(d); unsewVolumes(d);
...@@ -151,6 +158,7 @@ void Map3::splitVertex(Dart d, Dart e) ...@@ -151,6 +158,7 @@ void Map3::splitVertex(Dart d, Dart e)
// Map2::splitVertex(e, ec); // Map2::splitVertex(e, ec);
// //Map2::splitFace(e, phi2(ec)); // //Map2::splitFace(e, phi2(ec));
} }
*/
} }
Dart Map3::deleteVertex(Dart d) Dart Map3::deleteVertex(Dart d)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment