Commit 3e4dba23 authored by Sylvain Thery's avatar Sylvain Thery

restore oldi-school embnull testing algos

parent f0c76ffa
......@@ -26,8 +26,6 @@
#include "Topology/generic/dartmarker.h"
#include <vector>
#include "Algo/Modelisation/boundEmb.h"
namespace CGoGN
{
......@@ -119,9 +117,7 @@ void MarchingCube<DataType, Windowing, PFP>::deleteMesh()
template< typename DataType, template < typename D2 > class Windowing, typename PFP >
Dart MarchingCube<DataType, Windowing, PFP>::createTriEmb(unsigned int e1, unsigned int e2, unsigned int e3)
{
// L_DART d = m_map->newFace(3,false);
L_DART d = Modelisation::newFaceEmb<PFP>(*m_map,3);
L_DART d = m_map->newFace(3,false);
FunctorSetEmb<GenericMap, VERTEX> fsetemb(*m_map, e1);
m_map->template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
......@@ -926,9 +922,7 @@ void MarchingCube<DataType, Windowing, PFP>::setNeighbourSimple(L_DART d1, L_DAR
{
if (m_map->phi2(d1) != d2)
{
// m_map->sewFaces(d1,d2,false);
Modelisation::sewFaceEmb<PFP>(*m_map,d1,d2);
m_map->sewFaces(d1,d2,false);
#ifdef MC_WIDTH_EDGE_Z_EMBEDED
if (m_zslice!=NULL)
{
......@@ -945,9 +939,7 @@ void MarchingCube<DataType, Windowing, PFP>::setNeighbour(L_DART d1, L_DART d2)
{
if (m_map->phi2(d1) != d2)
{
// m_map->sewFaces(d1,d2,false);
Modelisation::sewFaceEmb<PFP>(*m_map,d1,d2);
m_map->sewFaces(d1,d2,false);
#ifdef MC_WIDTH_EDGE_Z_EMBEDED
if (m_zslice!=NULL)
{
......
......@@ -200,7 +200,8 @@ protected:
void computeCenter();
Dart grid_topo_open(unsigned int x, unsigned int y);
Dart cylinder_topo_open(unsigned int n, unsigned int z);
public:
/**
* Constructor
......@@ -239,6 +240,8 @@ public:
*/
std::vector<Dart>& getVertexDarts() { return m_tableVertDarts; }
/**
* Create a 2D grid
* quads are oriented counter-clockwise and the returned dart
......
......@@ -21,7 +21,6 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Algo/Modelisation/boundEmb.h"
namespace CGoGN
{
......@@ -45,7 +44,7 @@ Dart createPyramid(typename PFP::MAP& map, unsigned int n)
// creation of triangles around circunference and storing vertices
for (unsigned int i = 0; i < n; ++i)
{
Dart d = newFaceEmb<PFP>(map, 3);
Dart d = map.newFace(3, false);
m_tableVertDarts.push_back(d);
}
......@@ -56,17 +55,17 @@ Dart createPyramid(typename PFP::MAP& map, unsigned int n)
d = map.phi_1(d);
Dart e = m_tableVertDarts[i+1];
e = map.phi1(e);
sewFaceEmb<PFP>(map, d, e);
map.sewFaces(d, e, false);
}
//sewing the last with the first
sewFaceEmb<PFP>(map, map.phi1(m_tableVertDarts[0]), map.phi_1(m_tableVertDarts[n-1]));
map.sewFaces(map.phi1(m_tableVertDarts[0]), map.phi_1(m_tableVertDarts[n-1]), false);
//sewing the bottom face
Dart d1 = newFaceEmb<PFP>(map, n);
Dart d1 = map.newFace(n, false);
dres = d1;
for(unsigned int i = 0; i < n ; ++i)
{
sewFaceEmb<PFP>(map, m_tableVertDarts[i], d1);
map.sewFaces(m_tableVertDarts[i], d1, false);
d1 = map.phi1(d1);
}
......@@ -88,7 +87,7 @@ Dart createPrism(typename PFP::MAP& map, unsigned int n)
// creation of quads around circunference and storing vertices
for (unsigned int i = 0; i < n; ++i)
{
Dart d = newFaceEmb<PFP>(map, 4);
Dart d = map.newFace(4, false);
m_tableVertDarts.push_back(d);
}
......@@ -105,19 +104,19 @@ Dart createPrism(typename PFP::MAP& map, unsigned int n)
d = map.phi_1(d);
Dart e = m_tableVertDarts[i+1];
e = map.phi1(e);
sewFaceEmb<PFP>(map, d, e);
map.sewFaces(d, e, false);
}
//sewing the last with the first
sewFaceEmb<PFP>(map, map.phi1(m_tableVertDarts[0]), map.phi_1(m_tableVertDarts[n-1]));
map.sewFaces(map.phi1(m_tableVertDarts[0]), map.phi_1(m_tableVertDarts[n-1]), false);
//sewing the top & bottom faces
Dart d1 = newFaceEmb<PFP>(map, n);
Dart d2 = newFaceEmb<PFP>(map, n);
Dart d1 = map.newFace(n, false);
Dart d2 = map.newFace(n, false);
dres = d1;
for(unsigned int i = 0; i < n ; ++i)
{
sewFaceEmb<PFP>(map, m_tableVertDarts[i], d1);
sewFaceEmb<PFP>(map, m_tableVertDarts[n+i], d2);
map.sewFaces(m_tableVertDarts[i], d1, false);
map.sewFaces(m_tableVertDarts[n+i], d2, false);
d1 = map.phi1(d1);
d2 = map.phi_1(d2);
}
......@@ -325,8 +324,10 @@ Polyhedron<PFP>::Polyhedron(const Polyhedron<PFP>& p1, const Polyhedron<PFP>& p2
m_center = center / typename PFP::REAL(m_tableVertDarts.size());
}
template <typename PFP>
Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
Dart Polyhedron<PFP>::grid_topo_open(unsigned int x, unsigned int y)
{
if (m_kind != NONE) return m_dart;
......@@ -344,7 +345,7 @@ Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
{
for (unsigned int j = 1; j <= x; ++j)
{
Dart d = newFaceEmb<PFP>(m_map, 4);
Dart d = m_map.newFace(4, false);
m_tableVertDarts.push_back(d);
if (j == x)
m_tableVertDarts.push_back(m_map.phi1(d));
......@@ -369,7 +370,7 @@ Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
Dart d = m_tableVertDarts[pos];
Dart e = m_tableVertDarts[pos-(x+1)];
e = m_map.phi1(m_map.phi1(e));
sewFaceEmb<PFP>(m_map, d, e);
m_map.sewFaces(d, e, false);
}
if (j > 0) // sew with preceeding column
{
......@@ -378,7 +379,7 @@ Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
d = m_map.phi_1(d);
Dart e = m_tableVertDarts[pos-1];
e = m_map.phi1(e);
sewFaceEmb<PFP>(m_map, d, e);
m_map.sewFaces(d, e, false);
}
}
}
......@@ -386,13 +387,23 @@ Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
// store & return reference dart
m_dart = m_tableVertDarts[0]; // util ?
return m_dart;
}
template <typename PFP>
Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
{
if (m_kind != NONE) return m_dart;
m_dart = grid_topo_open(x,y);
m_map.closeHole(m_dart) ;
return m_dart;
}
template <typename PFP>
Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_closed, bool bottom_closed)
Dart Polyhedron<PFP>::cylinder_topo_open(unsigned int n, unsigned int z)
{
if (m_kind != NONE) return m_dart;
......@@ -400,12 +411,7 @@ Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_clo
m_nx = n;
m_nz = z;
m_bottom_closed = bottom_closed;
m_top_closed = top_closed;
int nb = (n)*(z+1);
if (bottom_closed) nb++;
if (top_closed) nb++;
int nb = (n)*(z+1)+2;
// vertice reservation
m_tableVertDarts.reserve(nb);
......@@ -415,7 +421,7 @@ Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_clo
{
for (unsigned int j = 0; j < n; ++j)
{
Dart d = newFaceEmb<PFP>(m_map, 4);
Dart d = m_map.newFace(4, false);
m_tableVertDarts.push_back(d);
}
}
......@@ -435,7 +441,7 @@ Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_clo
Dart d = m_tableVertDarts[pos];
Dart e = m_tableVertDarts[pos-n];
e = m_map.phi1(m_map.phi1(e));
sewFaceEmb<PFP>(m_map, d, e);
m_map.sewFaces(d, e, false);
}
if (j > 0) // sew with preceeding column
{
......@@ -444,7 +450,7 @@ Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_clo
d = m_map.phi_1(d);
Dart e = m_tableVertDarts[pos-1];
e = m_map.phi1(e);
sewFaceEmb<PFP>(m_map, d, e);
m_map.sewFaces(d, e, false);
}
else
{
......@@ -453,11 +459,27 @@ Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_clo
d = m_map.phi_1(d);
Dart e = m_tableVertDarts[pos+(n-1)];
e = m_map.phi1(e);
sewFaceEmb<PFP>(m_map, d, e);
m_map.sewFaces(d, e, false);
}
}
}
m_dart = m_tableVertDarts.front();
return m_dart;
}
template <typename PFP>
Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_closed, bool bottom_closed)
{
if (m_kind != NONE) return m_dart;
m_dart = cylinder_topo_open(n, z);
m_bottom_closed = bottom_closed;
m_top_closed = top_closed;
if (bottom_closed)
{
Dart d = m_tableVertDarts[0];
......@@ -490,160 +512,17 @@ Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_clo
else
m_map.closeHole(m_map.phi_1(m_tableVertDarts[n*z]));
m_dart = m_tableVertDarts.front();
// m_dart = m_tableVertDarts.front();
return m_dart;
}
// template <typename PFP>
// Dart Polyhedron<PFP>::cone_topo(int n, int z, bool bottom_closed)
// {
// if (m_kind != NONE) return m_dart;
//
// if (z>1)
// {
// if (n>4) // normal case
// {
// Dart d = cylinder_topo(n,z-1,true,bottom_closed);
// m_kind = CONE;
// m_nz = z;
// return d;
// }
// else if (n==4)
// {
// Dart d = cylinder_topo(n,z-1,true,false);
// m_kind = CONE;
// m_nz = z;
// // close bottom with one quad not three triangles
// if (bottom_closed)
// {
// Dart t= newFaceEmb(m_map, 4);
// sewFaceEmb(m_map, m_tableVertDarts[0],t);
// t=m_map.phi_1(t);
// sewFaceEmb(m_map, m_tableVertDarts[1],t);
// t=m_map.phi_1(t);
// sewFaceEmb(m_map, m_tableVertDarts[2],t);
// t=m_map.phi_1(t);
// sewFaceEmb(m_map, m_tableVertDarts[3],t);
// }
// return d;
// }
// else // n==3 (base is triangle)
// {
// Dart d = cylinder_topo(n,z-1,true,false);
// m_kind = CONE;
// m_nz = z;
// // close bottom with one triangle not three
// if (bottom_closed)
// {
// Dart t= newFaceEmb(m_map, 3);
// sewFaceEmb(m_map, d,t);
// d=nextDV(d); t=m_map.phi_1(t);
// sewFaceEmb(m_map, d,t);
// d=nextDV(d); t=m_map.phi_1(t);
// sewFaceEmb(m_map, d,t);
// }
// return d;
// }
// }
// else //z==1 only on slice
// {
// m_kind = CONE;
// m_nx = n;
// m_nz = z;
// if (n>4) // normal case
// {
// if (bottom_closed)
// m_tableVertDarts.reserve(n+2);
// else
// m_tableVertDarts.reserve(n+1);
//
// Dart ref = triangleFan_topo<PFP>(m_map,n);
// Dart d = ref;
// for (int i=0;i<n;++i)
// {
// m_tableVertDarts.push_back(d);
// d = nextDV(d);
// }
//
// if (bottom_closed)
// {
// m_bottom_closed=true;
// Dart dd = triangleFan_topo<PFP>(m_map,n);
// m_tableVertDarts.push_back(m_map.phi_1(dd));
// for (int i=0;i<n;++i)
// {
// sewFaceEmb(map, d,dd);
// d=nextDV(d);
// dd=precDV(dd);
// }
// }
//
// m_tableVertDarts.push_back(m_map.phi_1(ref));
//
// m_dart=ref;
// return ref;
// }
// else if (n==4)
// {
// m_bottom_closed=false; // because no vertex in bottom
// m_tableVertDarts.reserve(4);
//
// Dart dd = triangleFan_topo<PFP>(m_map,4);
// for (int i=0;i<4;++i)
// {
// m_tableVertDarts.push_back(dd);
// dd = nextDV(dd);
// }
// m_tableVertDarts.push_back(m_map.phi_1(dd));
//
// if (bottom_closed)
// {
// Dart t= newFaceEmb(m_map, 4);
// sewFaceEmb(map, m_tableVertDarts[0],t);
// t=m_map.phi_1(t);
// sewFaceEmb(map, m_tableVertDarts[1],t);
// t=m_map.phi_1(t);
// sewFaceEmb(map, m_tableVertDarts[2],t);
// t=m_map.phi_1(t);
// sewFaceEmb(map, m_tableVertDarts[3],t);
// }
// m_dart=dd;
// return dd;
// }
// else // n==3 (base is triangle, here we create a tetrahedron)
// {
// m_bottom_closed=false; // because no vertex in bottom
// m_tableVertDarts.reserve(4);
//
// Dart dd = triangleFan_topo<PFP>(m_map,3);
// for (int i=0;i<3;++i)
// {
// m_tableVertDarts.push_back(dd);
// dd = nextDV(dd);
// }
// m_tableVertDarts.push_back(m_map.phi_1(dd));
//
// if (bottom_closed)
// {
// Dart t= newFaceEmb(m_map, 3);
// sewFaceEmb(map, m_tableVertDarts[0],t);
// t=m_map.phi_1(t);
// sewFaceEmb(map, m_tableVertDarts[1],t);
// t=m_map.phi_1(t);
// sewFaceEmb(map, m_tableVertDarts[2],t);
// }
// m_dart=dd;
// return dd;
// }
// }
// }
template <typename PFP>
Dart Polyhedron<PFP>::cube_topo(unsigned int x, unsigned int y, unsigned int z)
{
if (m_kind != NONE) return m_dart;
m_dart = cylinder_topo(2*(x+y), z, false, false);
m_dart = cylinder_topo_open(2*(x+y), z);
m_kind = CUBE;
m_nx = x;
m_ny = y;
......@@ -655,7 +534,7 @@ Dart Polyhedron<PFP>::cube_topo(unsigned int x, unsigned int y, unsigned int z)
// we now have the 4 sides, just need to create store and sew top & bottom
// the top
Polyhedron<PFP> primTop(m_map, m_positions);
primTop.grid_topo(x,y);
primTop.grid_topo_open(x,y);
std::vector<Dart>& tableTop = primTop.getVertexDarts();
int index_side = 2*(x+y)*z;
......@@ -663,32 +542,32 @@ Dart Polyhedron<PFP>::cube_topo(unsigned int x, unsigned int y, unsigned int z)
{
Dart d = m_map.phi_1(m_tableVertDarts[index_side++]);
Dart e = tableTop[i];
sewFaceEmb(m_map, d, e);
m_map.sewFaces(d, e, false);
}
for(unsigned int i = 0; i < y; ++i)
{
Dart d = m_map.phi_1(m_tableVertDarts[index_side++]);
Dart e = tableTop[x+i*(x+1)];
sewFaceEmb(m_map, d, e);
m_map.sewFaces(d, e, false);
}
for(unsigned int i = 0; i < x; ++i)
{
Dart d = m_map.phi_1(m_tableVertDarts[index_side++]);
Dart e = tableTop[(x+1)*(y+1)-2 - i];
e = m_map.phi_1(e);
sewFaceEmb(m_map, d, e);
m_map.sewFaces(d, e, false);
}
for(unsigned int i = 0; i < y; ++i)
{
Dart d = m_map.phi_1(m_tableVertDarts[index_side++]);
Dart e = tableTop[(y-1-i)*(x+1)];
e = m_map.phi_1(e);
sewFaceEmb(m_map, d, e);
m_map.sewFaces(d, e, false);
}
// the bottom
Polyhedron<PFP> primBottom(m_map,m_positions);
primBottom.grid_topo(x,y);
primBottom.grid_topo_open(x,y);
std::vector<Dart>& tableBottom = primBottom.getVertexDarts();
index_side = 3*(x+y)+(x-1);
......@@ -696,27 +575,27 @@ Dart Polyhedron<PFP>::cube_topo(unsigned int x, unsigned int y, unsigned int z)
{
Dart d = m_tableVertDarts[(index_side--)%(2*(x+y))];
Dart e = tableBottom[i];
sewFaceEmb(m_map, d, e);
m_map.sewFaces(d, e, false);
}
for(unsigned int i = 0; i < y; ++i)
{
Dart d = m_tableVertDarts[(index_side--)%(2*(x+y))];
Dart e = tableBottom[x+i*(x+1)];
sewFaceEmb(m_map, d, e);
m_map.sewFaces(d, e, false);
}
for(unsigned int i = 0; i < x; ++i)
{
Dart d = m_tableVertDarts[(index_side--)%(2*(x+y))];
Dart e = tableBottom[(x+1)*(y+1)-2 - i];
e = m_map.phi_1(e);
sewFaceEmb(m_map, d, e);
m_map.sewFaces(d, e, false);
}
for(unsigned int i = 0; i < y; ++i)
{
Dart d = m_tableVertDarts[(index_side--)%(2*(x+y))];
Dart e = tableBottom[(y-1-i)*(x+1)];
e = m_map.phi_1(e);
sewFaceEmb(m_map, d, e);
m_map.sewFaces(d, e, false);
}
// and add new vertex in m_tableVertDarts
......@@ -753,7 +632,7 @@ Dart Polyhedron<PFP>::tore_topo(unsigned int m, unsigned int n)
Dart d = m_tableVertDarts[i];
Dart e = m_tableVertDarts[(m*n)+i];
e = m_map.phi_1(e);
sewFaceEmb<PFP>(m_map, d, e);
m_map.sewFaces(d, e);
}
// remove the last n vertex darts that are no more necessary (sewed with n first)
......@@ -781,10 +660,7 @@ void Polyhedron<PFP>::embedGrid(float x, float y, float z)
{
for(unsigned int j = 0; j <= m_nx;++j)
{
VEC3 pos(-x/2 + dx*float(j), -y/2 + dy*float(i), z);
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[i*(m_nx+1)+j];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[i*(m_nx+1)+j] ] = VEC3(-x/2 + dx*float(j), -y/2 + dy*float(i), z);
}
}
}
......@@ -812,28 +688,19 @@ void Polyhedron<PFP>::embedCylinder(float bottom_radius, float top_radius, float
float x = radius*cos(alpha*float(j));
float y = radius*sin(alpha*float(j));
VEC3 pos(x, y, -height/2 + dz*float(i));
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[i*(m_nx)+j];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[i*(m_nx)+j] ] = VEC3(x, y, -height/2 + dz*float(i));
}
}
int indexUmbrella = m_nx*(m_nz+1);
if (m_bottom_closed)
{
VEC3 pos(0.0f, 0.0f, -height/2 );
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[indexUmbrella++];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[indexUmbrella++] ] = VEC3(0.0f, 0.0f, -height/2 );
}
if (m_top_closed)
{
VEC3 pos(0.0f ,0.0f, height/2 );
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[indexUmbrella];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[indexUmbrella] ] = VEC3(0.0f, 0.0f, height/2 );
}
}
......@@ -842,47 +709,35 @@ void Polyhedron<PFP>::embedCone(float radius, float height)
{
typedef typename PFP::VEC3 VEC3 ;
if (m_kind != CONE)
if (!((m_kind == CYLINDER) && (m_top_closed)) )
{
CGoGNerr << "Warning try to embedCone something that is not a cone"<<CGoGNendl;
return;
}
float alpha = float(2.0*M_PI/m_nx);
int zcyl = m_nz-1;
float dz = height/float(m_nz);
for(unsigned int i = 0; i <= zcyl; ++i)
float dz = height/float(m_nz+1);
for( unsigned int i = 0; i <= m_nz; ++i)
{
for(unsigned int j = 0; j < m_nx; ++j)
{
float rad = radius * float(m_nz-i)/float(m_nz);
float rad = radius * float(m_nz+1-i)/float(m_nz+1);
float h = -height/2 + dz*float(i);
float x = rad*cos(alpha*float(j));
float y = rad*sin(alpha*float(j));
VEC3 pos(x, y, h);
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[i*(m_nx)+j];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[i*(m_nx)+j] ] = VEC3(x, y, h);
}
}
int indexUmbrella = m_nx*(m_nz);
int indexUmbrella = m_nx*(m_nz+1);
if (m_bottom_closed)
{
VEC3 pos(0.0f, 0.0f, -height/2 );
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[indexUmbrella++];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[indexUmbrella++] ] = VEC3(0.0f, 0.0f, -height/2 );
}
// top always closed in cone
VEC3 pos(0.0f ,0.0f, height/2.0f );
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[indexUmbrella];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[indexUmbrella] ] = VEC3(0.0f, 0.0f, height/2 );
}
template <typename PFP>
......@@ -908,24 +763,17 @@ void Polyhedron<PFP>::embedSphere(float radius)
float x = rad*cos(alpha*float(j));
float y = rad*sin(alpha*float(j));
VEC3 pos(x, y, h );
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[i*(m_nx)+j];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[i*(m_nx)+j] ] = VEC3(x, y, h );
}
}
// bottom pole
VEC3 pos(0.0f, 0.0f, -radius);
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[m_nx*(m_nz+1)];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[m_nx*(m_nz+1)] ] = VEC3(0.0f, 0.0f, -radius);
// top pole
pos = VEC3(0.0f, 0.0f, radius);
em = m_positions.insert(pos);
d = m_tableVertDarts[m_nx*(m_nz+1)+1];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[m_nx*(m_nz+1)+1] ] = VEC3(0.0f, 0.0f, radius);
}
template <typename PFP>
......@@ -950,10 +798,7 @@ void Polyhedron<PFP>::embedTore(float big_radius, float small_radius)
float r = big_radius + small_radius*cos(beta*float(j));
float x = r*cos(alpha*float(i));
float y = r*sin(alpha*float(i));
VEC3 pos(x, y, z);
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[j*(m_nx)+i];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[j*(m_nx)+i] ] = VEC3(x, y, z);
}
}
}
......@@ -981,34 +826,22 @@ void Polyhedron<PFP>::embedCube(float sx, float sy, float sz)
for (unsigned int i = 0; i < m_nx; ++i)
{
float x = float(i)*dx - sx/2.0f;
VEC3 pos(x, -sy/2.0f, z);
unsigned int em = m_positions.insert(pos);
Dart d = m_tableVertDarts[index++];
m_map.template setOrbitEmbedding<VERTEX>(d, em);
m_positions[ m_tableVertDarts[ index++ ] ] = VEC3(x, -sy/2.0f, z);
}<