Commit 0709b5d0 authored by untereiner's avatar untereiner

- improvement of import tet/hex meshes with connector element

- adding functions for quad meshes in map2
parent 4d4d3f6b
This diff is collapsed.
......@@ -203,6 +203,7 @@ bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<s
int n;
oss >> n; // type of volumes
if(!oss.good())
{
oss.clear();
......
......@@ -65,6 +65,11 @@ public:
*/
Dart deleteVertex(Dart d) ;
/**
* The attributes attached to the edges of d and phi_1(d) are kept to the new edges
*/
void mergeOppositeVertices(Dart d);
/**
* The attributes attached to the old edge are duplicated on both resulting edges
*/
......
......@@ -181,6 +181,12 @@ public:
*/
Dart deleteVertex(Dart d);
//! Merge two opposite vertices in a quadrangular face
/*! \pre Darts d MUST belong to the face of the vertices to be merged
* @param d a dart in vertex v
*/
void mergeOppositeVertices(Dart d);
//! Cut the edge of d by inserting a new vertex
/*! @param d a dart of the edge to cut
* @return a dart of the new vertex
......
......@@ -284,6 +284,26 @@ Dart Map2<MAP_IMPL>::deleteVertex(Dart d)
return res ;
}
template <typename MAP_IMPL>
void Map2<MAP_IMPL>::mergeOppositeVertices(Dart d)
{
Dart d2 = phi2(d);
Dart d_12 = phi2(this->phi_1(d));
Dart d_112 = phi2(this->phi_1(this->phi_1(d)));
Dart d12 = phi2(this->phi1(d));
phi2unsew(d2);
phi2unsew(d_12);
phi2unsew(d_112);
phi2unsew(d12);
phi2sew(d2,d12);
phi2sew(d_12,d_112);
ParentMap::deleteCycle(d);
}
template <typename MAP_IMPL>
Dart Map2<MAP_IMPL>::cutEdge(Dart d)
{
......
......@@ -142,6 +142,25 @@ Dart EmbeddedMap2::deleteVertex(Dart d)
return f ;
}
void EmbeddedMap2::mergeOppositeVertices(Dart d)
{
Dart d2 = phi2(d);
Dart d_12 = phi2(phi_1(d));
Map2::mergeOppositeVertices(d);
if(isOrbitEmbedded<VERTEX>())
{
Algo::Topo::setOrbitEmbedding<VERTEX>(*this, d_12, getEmbedding<VERTEX>(d_12)) ;
}
if(isOrbitEmbedded<EDGE>())
{
copyDartEmbedding<EDGE>(phi2(d2), d2) ;
copyDartEmbedding<EDGE>(phi2(d_12), d_12) ;
}
}
Dart EmbeddedMap2::cutEdge(Dart d)
{
Dart nd = Map2::cutEdge(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