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

begin triangular map feature :

- adding triangular map2
parent a4e5f521
......@@ -186,6 +186,8 @@ void MyQT::cb_Open()
// }
// SelectorDartNoBoundary<PFP::MAP> nb(myMap);
myMap.check();
m_topo_render->updateData(myMap, position, 0.8f, 0.8f, 0.8f);
m_explode_render->updateData<PFP>(myMap, position, color);
......@@ -455,6 +457,9 @@ int main(int argc, char **argv)
// Algo::Volume::Export::exportNAS<PFP>(myMap,position,"/tmp/test1.nas");
// Algo::Volume::Export::exportVTU<PFP>(myMap,position,"/tmp/test3.vtu");
}
myMap.check();
// un peu d'interface
QApplication app(argc, argv);
MyQT sqt;
......
......@@ -646,8 +646,6 @@ Dart swapGen3To2(typename PFP::MAP& map, Dart d)
Dart stop = map.phi1(map.phi2(map.phi_1(d)));
if(map.deleteEdge(d) == NIL)
{
std::cout << "boundary" << std::endl;
std::vector<Dart> edges;
Dart dbegin = map.findBoundaryFaceOfEdge(d);
Traversor3EW<typename PFP::MAP> t(map, d);
......@@ -663,11 +661,23 @@ Dart swapGen3To2(typename PFP::MAP& map, Dart d)
map.template copyDartEmbedding<VERTEX>(d, map.phi1(e)) ;
map.template copyDartEmbedding<VERTEX>(e, map.phi1(d)) ;
if (map.template isOrbitEmbedded<FACE>())
{
map.template copyDartEmbedding<FACE>(map.phi1(d), d) ;
map.template copyDartEmbedding<FACE>(map.phi1(e), e) ;
}
d = map.phi3(dbegin);
e = map.phi2(d);
map.flipEdge(d);
map.template copyDartEmbedding<VERTEX>(d, map.phi1(e)) ;
map.template copyDartEmbedding<VERTEX>(e, map.phi1(d)) ;
if (map.template isOrbitEmbedded<FACE>())
{
map.template copyDartEmbedding<FACE>(map.phi_1(d), d) ;
map.template copyDartEmbedding<FACE>(map.phi_1(e), e) ;
}
}
std::vector<Dart> edges;
......@@ -716,8 +726,6 @@ std::vector<Dart> swapGen3To2Optimized(typename PFP::MAP& map, Dart d)
Dart stop = map.phi1(map.phi2(map.phi_1(d)));
if(map.deleteEdge(d) == NIL)
{
std::cout << "boundary" << std::endl;
std::vector<Dart> edges;
Dart dbegin = map.findBoundaryFaceOfEdge(d);
Traversor3EW<typename PFP::MAP> t(map, d);
......@@ -733,11 +741,23 @@ std::vector<Dart> swapGen3To2Optimized(typename PFP::MAP& map, Dart d)
map.template copyDartEmbedding<VERTEX>(d, map.phi1(e)) ;
map.template copyDartEmbedding<VERTEX>(e, map.phi1(d)) ;
if (map.template isOrbitEmbedded<FACE>())
{
map.template copyDartEmbedding<FACE>(map.phi1(d), d) ;
map.template copyDartEmbedding<FACE>(map.phi1(e), e) ;
}
d = map.phi3(dbegin);
e = map.phi2(d);
map.flipEdge(d);
map.template copyDartEmbedding<VERTEX>(d, map.phi1(e)) ;
map.template copyDartEmbedding<VERTEX>(e, map.phi1(d)) ;
if (map.template isOrbitEmbedded<FACE>())
{
map.template copyDartEmbedding<FACE>(map.phi_1(d), d) ;
map.template copyDartEmbedding<FACE>(map.phi_1(e), e) ;
}
}
std::vector<Dart> edges;
......@@ -922,7 +942,7 @@ Dart edgeBisection(typename PFP::MAP& map, Dart d)
std::vector<Dart> edges;
do
{
if(!map.isBoundaryMarked3(dit))
if(!map.isBoundaryMarked(3,dit))
{
edges.push_back(map.phi_1(dit));
edges.push_back(map.phi_1(map.phi2(map.phi_1(edges[0]))));
......
This diff is collapsed.
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
namespace CGoGN
{
namespace Simplex
{
template <typename MAP_IMPL>
inline void Map2<MAP_IMPL>::init()
{
MAP_IMPL::addInvolution() ;
}
template <typename MAP_IMPL>
inline Map2<MAP_IMPL>::Map2() : MapCommon<MAP_IMPL>()
{
init() ;
}
template <typename MAP_IMPL>
inline std::string Map2<MAP_IMPL>::mapTypeName() const
{
return "Map2" ;
}
template <typename MAP_IMPL>
inline unsigned int Map2<MAP_IMPL>::dimension() const
{
return 2 ;
}
template <typename MAP_IMPL>
inline void Map2<MAP_IMPL>::clear(bool removeAttrib)
{
ParentMap::clear(removeAttrib) ;
if (removeAttrib)
init() ;
}
template <typename MAP_IMPL>
inline unsigned int Map2<MAP_IMPL>::getNbInvolutions() const
{
return 1;
}
template <typename MAP_IMPL>
inline unsigned int Map2<MAP_IMPL>::getNbPermutations() const
{
return 1;
}
} // namespace Simplex
} // namespace CGoGN
......@@ -78,7 +78,7 @@ Dart EmbeddedMap3::cutEdge(Dart d)
// if(isOrbitEmbedded<VERTEX>())
// {
// initOrbitEmbeddingNewCell<VERTEX>(nd) ;
// initOrbitEmbeddingOnNewCell<VERTEX>(nd) ;
// }
if(isOrbitEmbedded<EDGE>())
......@@ -236,7 +236,7 @@ void EmbeddedMap3::splitFace(Dart d, Dart e)
// if(isOrbitEmbedded<EDGE>())
// {
// initOrbitEmbeddingNewCell<EDGE>(phi_1(d)) ;
// initOrbitEmbeddingOnNewCell<EDGE>(phi_1(d)) ;
// }
if(isOrbitEmbedded<FACE2>())
......@@ -480,6 +480,12 @@ void EmbeddedMap3::splitVolume(std::vector<Dart>& vd)
}
}
// if(isOrbitEmbedded<FACE>())
// {
// Dart v = vd.front() ;
// initOrbitEmbeddingNewCell<FACE>(phi2(v));
// }
if(isOrbitEmbedded<VOLUME>())
{
Dart v = vd.front() ;
......
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