Commit 1475c9ee authored by Thomas's avatar Thomas

import Tet : option to invert, correction of mergeFace gmap2, removing extra...

import Tet : option to invert, correction of mergeFace gmap2, removing extra createHexa in polyhedron3D
parent c658f592
......@@ -125,7 +125,7 @@ typename PFP::VEC3 vertexBorderNormal(typename PFP::MAP& map, Dart d, const type
CellMarker f(map,FACE);
FunctorStore fs(faces);
map.foreach_dart_of_oriented_vertex(d,fs);
map.foreach_dart_of_vertex(d,fs);
for(std::vector<Dart>::iterator it = faces.begin() ; it != faces.end() ; ++it)
{
......
......@@ -92,7 +92,7 @@ template <typename PFP>
bool importNodeWithELERegions(typename PFP::MAP& map, const std::string& filenameNode, const std::string& filenameELE, std::vector<std::string>& attrNames);
template <typename PFP>
bool importTet(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor = 1.0f);
bool importTet(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor = 1.0f, bool invertTetra=false);
template <typename PFP>
bool importMoka(typename PFP::MAP& the_gmap, const std::string& filename, std::vector<std::string>& attrNames);
......
......@@ -35,7 +35,7 @@ namespace Import
{
template <typename PFP>
bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor)
bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor, bool invertTetra)
{
typedef typename PFP::VEC3 VEC3;
......@@ -117,8 +117,8 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
Geom::Vec4ui pt;
oss >> pt[0];
oss >> pt[1];
oss >> pt[2];
oss >> pt[1+invertTetra];
oss >> pt[2-invertTetra];
oss >> pt[3];
//if regions are defined use this number
......
......@@ -63,7 +63,7 @@ enum { NONE, GRID, CUBE, CYLINDER, CONE, SPHERE, TORE, COMPOSED };
/**
* Unsex the Umbrella aroud a vertex, close the hole and then
* Unsex the Umbrella around a vertex, close the hole and then
* create a symetric to construct a polyedron
* @param d a dart from the vertex
*/
......
......@@ -102,8 +102,6 @@ protected:
*/
Dart HexaGrid2Topo(unsigned int nx, unsigned int ny);
Dart createHexa();
public:
/**
......
......@@ -22,6 +22,8 @@
* *
*******************************************************************************/
#include "Algo/Modelisation/polyhedron.h"
namespace CGoGN
{
......@@ -31,50 +33,18 @@ namespace Algo
namespace Modelisation
{
//TEMPORAIRE
template <typename PFP>
Dart Primitive3D<PFP>::createHexa()
{
Dart base = m_map.newFace(4, false);
Dart side1 = m_map.newFace(4, false);
m_map.sewFaces(base, side1, false);
Dart side2 = m_map.newFace(4, false);
m_map.sewFaces(m_map.phi1(base), side2, false);
m_map.sewFaces(m_map.phi_1(side1), m_map.phi1(side2), false);
Dart side3 = m_map.newFace(4, false);
m_map.sewFaces(m_map.phi1(m_map.phi1(base)), side3, false);
m_map.sewFaces(m_map.phi_1(side2), m_map.phi1(side3), false);
Dart side4 = m_map.newFace(4, false);
m_map.sewFaces(m_map.phi_1(base), side4, false);
m_map.sewFaces(m_map.phi_1(side3), m_map.phi1(side4), false);
m_map.sewFaces(m_map.phi_1(side4), m_map.phi1(side1), false);
Dart top = m_map.newFace(4, false);
m_map.sewFaces(top, m_map.phi1(m_map.phi1(side1)), false);
m_map.sewFaces(m_map.phi_1(top), m_map.phi1(m_map.phi1(side2)), false);
m_map.sewFaces(m_map.phi1(m_map.phi1(top)), m_map.phi1(m_map.phi1(side3)), false);
m_map.sewFaces(m_map.phi1(top), m_map.phi1(m_map.phi1(side4)), false);
return base;
}
template <typename PFP>
Dart Primitive3D<PFP>::HexaGrid1Topo(unsigned int nx)
{
// first cube
Dart d0 = createHexa();
Dart d0 = createHexahedron<PFP>(m_map);
m_tableVertDarts.push_back(d0);
Dart d1 = m_map.template phi<2112>(d0);
for (unsigned int i = 1; i < nx; ++i)
{
Dart d2 = createHexa();
Dart d2 = createHexahedron<PFP>(m_map);
m_tableVertDarts.push_back(d2);
m_map.sewVolumes(d1, d2, false);
d1 = m_map.template phi<2112>(d2);
......
......@@ -73,7 +73,7 @@ void trianguleFaces(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect
do
{
t.skip(fit);
fit = map.phi2_1(fit);
fit = map.phi2(map.phi_1(fit));
} while(fit != cd);
}
}
......
......@@ -365,7 +365,7 @@ public:
/*! @param d a dart of the oriented face
* @param fonct the functor
*/
bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread);
bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0);
//! Apply a functor on each dart of a cc
/*! @param d a dart of the cc
......
......@@ -477,7 +477,7 @@ bool GMap2::mergeFaces(Dart d)
beta2unsew(d) ;
beta2unsew(e) ;
GMap1::mergeCycles(d, phi1(e)) ;
GMap1::mergeCycles(e, phi1(d)) ;
GMap1::splitCycle(e, phi1(d)) ;
GMap1::deleteCycle(d) ;
return true ;
}
......
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