Commit 34bf64a2 authored by untereiner's avatar untereiner

Merge cgogn:~cgogn/CGoGN

Conflicts:
	include/Algo/Render/GL2/topo3Render.h
parents 9ea79e65 bfceabf5
...@@ -149,6 +149,17 @@ void MyQT::operation(int x) ...@@ -149,6 +149,17 @@ void MyQT::operation(int x)
m_selected=NIL; m_selected=NIL;
} }
break; break;
case 9:
CGoGNout <<"delete face"<<CGoGNendl;
if (m_selected != NIL)
{
myMap.deleteFace(m_selected);
updateMap();
m_selected=NIL;
m_selected2=NIL;
}
break;
default: default:
break; break;
} }
...@@ -325,6 +336,11 @@ void MyQT::cb_keyPress(int keycode) ...@@ -325,6 +336,11 @@ void MyQT::cb_keyPress(int keycode)
void MyQT::svg() void MyQT::svg()
{ {
if (m_selected!=NIL)
m_render_topo->setDartColor(m_selected,0.8f,0.0f,0.0f);
if (m_selected2!=NIL)
m_render_topo->setDartColor(m_selected2,0.0f,0.8f,0.0f);
std::string filename = selectFileSave("snapshot file", ".", "(*.svg)"); std::string filename = selectFileSave("snapshot file", ".", "(*.svg)");
m_render_topo->svgout2D(filename, modelViewMatrix(),projectionMatrix()); m_render_topo->svgout2D(filename, modelViewMatrix(),projectionMatrix());
} }
......
...@@ -94,6 +94,11 @@ ...@@ -94,6 +94,11 @@
<string>mergeFace</string> <string>mergeFace</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>deleteFace</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item> <item>
......
/*******************************************************************************
* 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 *
* *
*******************************************************************************/
#ifndef __DECIMATION_BASIC_H_
#define __DECIMATION_BASIC_H_
namespace CGoGN
{
namespace Algo
{
namespace Decimation
{
template <typename PFP>
bool edgeCanCollapse(typename PFP::MAP& map, Dart d, AttributeHandler<unsigned int>& valences)
{
Dart dd = map.phi2(d);
Dart dp = map.phi_1(d);
Dart ddp = map.phi_1(dd);
// Check valency conditions
unsigned int val_vd = valences[d];
unsigned int val_vdd = valences[dd];
unsigned int val_vd1 = valences[dp];
unsigned int val_vdd1 = valences[ddp];
if(val_vd + val_vdd < 8 || val_vd + val_vdd > 11 || val_vd1 < 5 || val_vdd1 < 5)
return false;
// Check vertex sharing condition
unsigned int vu1[32]; // pas de vector mais un tableau (find a la main, mais pas d'allocation par reserve)
val_vd -= 3; // evite le -3 dans la boucle
val_vdd -= 3;
Dart vit1 = map.phi2_1(map.phi2_1(d));
for (unsigned int i = 0; i< val_vd; ++i)
{
unsigned int ve = map.getEmbedding(map.phi2(vit1),VERTEX);
vu1[i] = ve;
vit1 = map.phi2_1(vit1);
}
val_vd--; // pour le parcours avec while >=0
Dart vit2 = map.phi2_1(map.phi2_1(dd));
for (unsigned int i = 0; i< val_vdd; ++i)
{
unsigned int ve = map.getEmbedding(map.phi2(vit2),VERTEX);
int j = val_vd;
while ( j>=0)
{
if (vu1[j] == ve)
return false;
--j;
}
vit2 = map.phi2_1(vit2);
}
return true;
}
template <typename PFP>
bool edgeCanCollapse(typename PFP::MAP& map, Dart d)
{
Dart dd = map.phi2(d);
Dart dp = map.phi_1(d);
Dart ddp = map.phi_1(dd);
// Check valency conditions
int val_vd = 0 ;
Dart tmp = d ;
do { ++val_vd ; tmp = map.phi2_1(tmp) ; } while(tmp != d) ;
int val_vdd = 0 ;
tmp = dd ;
do { ++val_vdd ; tmp = map.phi2_1(tmp) ; } while(tmp != dd) ;
int val_vdp = 0 ;
tmp = dp ;
do { ++val_vdp ; tmp = map.phi2_1(tmp) ; } while(tmp != dp) ;
int val_vddp = 0 ;
tmp = ddp ;
do { ++val_vddp ; tmp = map.phi2_1(tmp) ; } while(tmp != ddp) ;
if(val_vd + val_vdd < 8 || val_vd + val_vdd > 11 || val_vdp < 5 || val_vddp < 5)
return false;
// Check vertex sharing condition
unsigned int vu1[32]; // pas de vector mais un tableau (find a la main, mais pas d'allocation par reserve)
val_vd -= 3; // evite le -3 dans la boucle
val_vdd -= 3;
Dart vit1 = map.phi2_1(map.phi2_1(d));
for (int i = 0; i < val_vd; ++i)
{
unsigned int ve = map.getEmbedding(map.phi2(vit1),VERTEX);
vu1[i] = ve;
vit1 = map.phi2_1(vit1);
}
val_vd--; // pour le parcours avec while >=0
Dart vit2 = map.phi2_1(map.phi2_1(dd));
for (int i = 0; i < val_vdd; ++i)
{
unsigned int ve = map.getEmbedding(map.phi2(vit2),VERTEX);
int j = val_vd;
while (j >= 0)
{
if (vu1[j] == ve)
return false;
--j;
}
vit2 = map.phi2_1(vit2);
}
return true;
}
} // namespace Decimation
} // namespace Algo
} // namespace CGoGN
#endif
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
#include "Utils/img3D_IO.h" #include "Utils/img3D_IO.h"
#ifdef WITH_ZINRI
#include "Zinrimage.h" #include "Zinrimage.h"
#endif
namespace CGoGN namespace CGoGN
{ {
...@@ -121,11 +123,12 @@ protected: ...@@ -121,11 +123,12 @@ protected:
*/ */
//bool correct(const gmtl::Vec3i& _V); //bool correct(const gmtl::Vec3i& _V);
#ifdef WITH_ZINRI
/** /**
* internal inrimage prt * internal inrimage prt
*/ */
PTRINRIMAGE mImage; PTRINRIMAGE mImage;
#endif
public: public:
......
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
#include <math.h> #include <math.h>
#include <typeinfo> #include <typeinfo>
#include "Utils/img3D_IO.h"
#include "Zinrimage.h"
namespace CGoGN namespace CGoGN
{ {
...@@ -177,6 +174,7 @@ void Image<DataType>::loadVox(char *filename) ...@@ -177,6 +174,7 @@ void Image<DataType>::loadVox(char *filename)
m_Alloc=true; m_Alloc=true;
} }
#ifdef WITH_QT
template< typename DataType > template< typename DataType >
bool Image<DataType>::loadPNG3D(const char* filename) bool Image<DataType>::loadPNG3D(const char* filename)
{ {
...@@ -199,8 +197,9 @@ bool Image<DataType>::loadPNG3D(const char* filename) ...@@ -199,8 +197,9 @@ bool Image<DataType>::loadPNG3D(const char* filename)
return true; return true;
} }
#endif
#ifdef WITH_ZINRI
template< typename DataType > template< typename DataType >
bool Image<DataType>::loadInrgz(const char* filename) bool Image<DataType>::loadInrgz(const char* filename)
{ {
...@@ -230,7 +229,7 @@ bool Image<DataType>::loadInrgz(const char* filename) ...@@ -230,7 +229,7 @@ bool Image<DataType>::loadInrgz(const char* filename)
return true; return true;
} }
#endif
...@@ -472,9 +471,52 @@ Image<DataType>* Image<DataType>::Blur3() ...@@ -472,9 +471,52 @@ Image<DataType>* Image<DataType>::Blur3()
return newImg; return newImg;
} }
//template<typename DataType>
//void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32radius)
//{
// // compute the width of the sphere for memory allocation
// int i32Width = 2*_i32radius + 1;
// // squared radius
// float fRad2 = (float)(_i32radius*_i32radius);
//
// // memory allocation
// // difficult to know how many voxels before computing,
// // so the reserve for the BB
// table.reserve(i32Width*i32Width*i32Width);
// table.clear();
//
// // scan all the BB of the sphere
// for (int z = -_i32radius; z<=_i32radius; z++)
// {
// for (int y = -_i32radius; y<=_i32radius; y++)
// {
// for (int x = -_i32radius; x<=_i32radius; x++)
// {
// Geom::Vec3f v((float)x,(float)y,(float)z);
// float fLength = v.norm2();
// // if inside the sphere
// if (fLength<=fRad2)
// {
// // the the index of the voxel
// int index = z * m_WXY + y * m_WX + x;
// table.push_back(index);
// }
// }
// }
// }
//}
template<typename DataType> template<typename DataType>
void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32radius) void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32radius)
{ {
float smin = std::min(m_SX, std::min(m_SY,m_SZ));
float xs = m_SX/smin;
float ys = m_SY/smin;
float zs = m_SZ/smin;
// compute the width of the sphere for memory allocation // compute the width of the sphere for memory allocation
int i32Width = 2*_i32radius + 1; int i32Width = 2*_i32radius + 1;
// squared radius // squared radius
...@@ -493,7 +535,7 @@ void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32ra ...@@ -493,7 +535,7 @@ void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32ra
{ {
for (int x = -_i32radius; x<=_i32radius; x++) for (int x = -_i32radius; x<=_i32radius; x++)
{ {
Geom::Vec3f v((float)x,(float)y,(float)z); Geom::Vec3f v(float(x)*xs,float(y)*ys,float(z)*zs);
float fLength = v.norm2(); float fLength = v.norm2();
// if inside the sphere // if inside the sphere
if (fLength<=fRad2) if (fLength<=fRad2)
...@@ -507,6 +549,7 @@ void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32ra ...@@ -507,6 +549,7 @@ void Image<DataType>::createMaskOffsetSphere(std::vector<int>& table, int _i32ra
} }
} }
template<typename DataType> template<typename DataType>
float Image<DataType>::computeCurvatureCount(const DataType *ptrVox, const std::vector<int>& sphere, DataType val) float Image<DataType>::computeCurvatureCount(const DataType *ptrVox, const std::vector<int>& sphere, DataType val)
{ {
......
...@@ -189,14 +189,7 @@ protected: ...@@ -189,14 +189,7 @@ protected:
void setNeighbour(L_DART d1, L_DART d2); void setNeighbour(L_DART d1, L_DART d2);
L_DART createTriEmb(unsigned int e1, unsigned int e2, unsigned int e3) { L_DART createTriEmb(unsigned int e1, unsigned int e2, unsigned int e3);
L_DART d = m_map->newFace(3);
//TODO change this which work only with 2-maps
m_map->setDartEmbedding(VERTEX,d,e1); d = m_map->phi1(d);
m_map->setDartEmbedding(VERTEX,d,e2); d = m_map->phi1(d);
m_map->setDartEmbedding(VERTEX,d,e3); d = m_map->phi1(d);
return d;
}
public: public:
/** /**
...@@ -261,7 +254,7 @@ public: ...@@ -261,7 +254,7 @@ public:
void removeFacesOfBoundary(AttributeHandler<unsigned char>& boundVertices, unsigned int frameWidth); void removeFacesOfBoundary(AttributeHandler<unsigned char>& boundVertices, unsigned int frameWidth);
void recalPoints(); void recalPoints(const Geom::Vec3f& origin);
}; };
......
...@@ -100,6 +100,29 @@ void MarchingCube<DataType, Windowing, PFP>::deleteMesh() ...@@ -100,6 +100,29 @@ 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);
//TODO change this which work only with 2-maps
// m_map->setDartEmbedding(VERTEX,d,e1); d = m_map->phi1(d);
// m_map->setDartEmbedding(VERTEX,d,e2); d = m_map->phi1(d);
// m_map->setDartEmbedding(VERTEX,d,e3); d = m_map->phi1(d);
FunctorSetEmb<GenericMap> fsetemb(*m_map, VERTEX, e1);
m_map->foreach_dart_of_orbit(PFP::MAP::ORBIT_IN_PARENT(VERTEX), d, fsetemb);
d = m_map->phi1(d);
fsetemb.changeEmb(e2);
m_map->foreach_dart_of_orbit(PFP::MAP::ORBIT_IN_PARENT(VERTEX), d, fsetemb);
d = m_map->phi1(d);
fsetemb.changeEmb(e3);
m_map->foreach_dart_of_orbit(PFP::MAP::ORBIT_IN_PARENT(VERTEX), d, fsetemb);
d = m_map->phi1(d);
return d;
}
template< typename DataType, template < typename D2 > class Windowing, typename PFP > template< typename DataType, template < typename D2 > class Windowing, typename PFP >
void MarchingCube<DataType, Windowing, PFP>::simpleMeshing() void MarchingCube<DataType, Windowing, PFP>::simpleMeshing()
{ {
...@@ -120,7 +143,7 @@ void MarchingCube<DataType, Windowing, PFP>::simpleMeshing() ...@@ -120,7 +143,7 @@ void MarchingCube<DataType, Windowing, PFP>::simpleMeshing()
// compute value to transform points directly to final system coordinate // compute value to transform points directly to final system coordinate
// m_fOrigin = typename PFP::VEC3((float)(m_Image->getOrigin()[0]),(float)(m_Image->getOrigin()[1]),(float)(m_Image->getOrigin()[2])); m_fOrigin = typename PFP::VEC3((float)(m_Image->getOrigin()[0]),(float)(m_Image->getOrigin()[1]),(float)(m_Image->getOrigin()[2]));
m_fScal[0] = m_Image->getVoxSizeX(); m_fScal[0] = m_Image->getVoxSizeX();
m_fScal[1] = m_Image->getVoxSizeY(); m_fScal[1] = m_Image->getVoxSizeY();
...@@ -483,7 +506,9 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_1(DataType *vox, const ...@@ -483,7 +506,9 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_1(DataType *vox, const
unsigned int lVertTable[12]; unsigned int lVertTable[12];
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f); // typename PFP::VEC3 vPos(float(_lX) , float(_lY) , float(_lZ) );
// typename PFP::VEC3 vPos(float(_lX) + 0.5f, float(_lY) + 0.5f, (float)_lZ + 0.5f);
typename PFP::VEC3 vPos(_lX, _lY, _lZ);
// create the new vertices // create the new vertices
...@@ -545,8 +570,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_2(DataType *vox, const ...@@ -545,8 +570,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_2(DataType *vox, const
return; return;
unsigned int lVertTable[12]; unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ); typename PFP::VEC3 vPos(_lX, _lY, _lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
// create the new vertices // create the new vertices
int lX = _lX; int lX = _lX;
...@@ -603,8 +627,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_3(DataType *vox, const ...@@ -603,8 +627,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_3(DataType *vox, const
return; return;
unsigned int lVertTable[12]; unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ); typename PFP::VEC3 vPos(_lX, _lY, _lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
// create the new vertices // create the new vertices
int lX = _lX; int lX = _lX;
...@@ -659,8 +682,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_4(DataType *vox, const ...@@ -659,8 +682,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_4(DataType *vox, const
return; return;
unsigned int lVertTable[12]; unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ); typename PFP::VEC3 vPos(_lX, _lY, _lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
// create the new vertices // create the new vertices
int lX = _lX; int lX = _lX;
...@@ -718,8 +740,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_5(DataType *vox, const ...@@ -718,8 +740,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_5(DataType *vox, const
return; return;
unsigned int lVertTable[12]; unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ); typename PFP::VEC3 vPos(_lX, _lY, _lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
// create the new vertices // create the new vertices
int lX = _lX; int lX = _lX;
...@@ -775,8 +796,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_6(DataType *vox, const ...@@ -775,8 +796,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_6(DataType *vox, const
return; return;
unsigned int lVertTable[12]; unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ); typename PFP::VEC3 vPos(_lX, _lY, _lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
// create the new vertices // create the new vertices
int lX = _lX+1; int lX = _lX+1;
...@@ -837,8 +857,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_7(DataType *vox, const ...@@ -837,8 +857,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_7(DataType *vox, const
return; return;
unsigned int lVertTable[12]; unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ); typename PFP::VEC3 vPos(_lX, _lY, _lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
// create the new vertices // create the new vertices
int lX = _lX+1; int lX = _lX+1;
...@@ -899,8 +918,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_8(DataType *vox, const ...@@ -899,8 +918,7 @@ void MarchingCube<DataType, Windowing, PFP>::createFaces_8(DataType *vox, const
return; return;
unsigned int lVertTable[12]; unsigned int lVertTable[12];
// typename PFP::VEC3 vPos((float)_lX , (float)_lY, (float)_lZ); typename PFP::VEC3 vPos(_lX, _lY, _lZ);
typename PFP::VEC3 vPos((float)_lX + 0.5f, (float)_lY + 0.5f, (float)_lZ + 0.5f);
// create the new vertices // create the new vertices
int lX = _lX+1; int lX = _lX+1;
...@@ -953,14 +971,14 @@ template< typename DataType, template < typename D2 > class Windowing, typename ...@@ -953,14 +971,14 @@ template< typename DataType, template < typename D2 > class Windowing, typename
void MarchingCube<DataType, Windowing, PFP>::setNeighbourSimple(L_DART d1, L_DART d2) void MarchingCube<DataType, Windowing, PFP>::setNeighbourSimple(L_DART d1, L_DART d2)
{ {
if (m_map->phi2(d1) != d2) if (m_map->phi2(d1) != d2)
m_map->sewFaces(d1,d2); m_map->sewFaces(d1,d2,false);
} }
template< typename DataType, template < typename D2 > class Windowing, typename PFP > template< typename DataType, template < typename D2 > class Windowing, typename PFP >
void MarchingCube<DataType, Windowing, PFP>::setNeighbour(L_DART d1, L_DART d2) void MarchingCube<DataType, Windowing, PFP>::setNeighbour(L_DART d1, L_DART d2)
{ {
if (m_map->phi2(d1) != d2) if (m_map->phi2(d1) != d2)
m_map->sewFaces(d1,d2); m_map->sewFaces(d1,d2,false);
} }
template< typename DataType, template < typename D2 > class Windowing, typename PFP > template< typename DataType, template < typename D2 > class Windowing, typename PFP >
...@@ -1241,7 +1259,7 @@ void MarchingCube<DataType, Windowing, PFP>::removeFacesOfBoundary(AttributeHand ...@@ -1241,7 +1259,7 @@ void MarchingCube<DataType, Windowing, PFP>::removeFacesOfBoundary(AttributeHand
} }
template< typename DataType, template < typename D2 > class Windowing, typename PFP > template< typename DataType, template < typename D2 > class Windowing, typename PFP >
void MarchingCube<DataType, Windowing, PFP>::recalPoints() void MarchingCube<DataType, Windowing, PFP>::recalPoints(const Geom::Vec3f& origin)
{ {
for(unsigned int i=m_positions.begin(); i != m_positions.end(); m_positions.next(i)) for(unsigned int i=m_positions.begin(); i != m_positions.end(); m_positions.next(i))
...@@ -1251,7 +1269,7 @@ void MarchingCube<DataType, Windowing, PFP>::recalPoints() ...@@ -1251,7 +1269,7 @@ void MarchingCube<DataType, Windowing, PFP>::recalPoints()
P[0] = P[0] * m_fScal[0]; P[0] = P[0] * m_fScal[0];
P[1] = P[1] * m_fScal[1]; P[1] = P[1] * m_fScal[1];
P[2] = P[2] * m_fScal[2]; P[2] = P[2] * m_fScal[2];
P+=origin;
} }
} }
......
...@@ -302,8 +302,8 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec ...@@ -302,8 +302,8 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
attributs[e] += attributs[f]; attributs[e] += attributs[f];
attributs[e] *= 0.5; attributs[e] *= 0.5;
travE.mark(d) ; travE.skip(d) ;
travE.mark(e) ; travE.skip(e) ;
} }
//2. split faces - quadrangule faces //2. split faces - quadrangule faces
...@@ -318,7 +318,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec ...@@ -318,7 +318,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
Dart ne = map.phi2(map.phi_1(dd)) ; Dart ne = map.phi2(map.phi_1(dd)) ;
map.cutEdge(ne) ; map.cutEdge(ne) ;
travF.mark(dd) ; travF.skip(dd) ;
attributs[map.phi1(ne)] = center; attributs[map.phi1(ne)] = center;
...@@ -327,11 +327,11 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec ...@@ -327,11 +327,11 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
{ {
Dart tmp = map.phi1(ne) ; Dart tmp = map.phi1(ne) ;
map.splitFace(tmp, dd) ; map.splitFace(tmp, dd) ;
travF.mark(tmp) ; travF.skip(tmp) ;
dd = map.phi1(map.phi1(dd)) ; dd = map.phi1(map.phi1(dd)) ;
} }
travF.mark(ne) ; travF.skip(ne) ;
} }
//3. create inside volumes //3. create inside volumes
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "Geometry/vector_gen.h" #include "Geometry/vector_gen.h"
#include "Utils/vbo.h" #include "Utils/vbo.h"
#include "Utils/svg.h"
// forward // forward
namespace CGoGN { namespace Utils { class ShaderSimpleColor; } } namespace CGoGN { namespace Utils { class ShaderSimpleColor; } }
...@@ -83,6 +84,11 @@ protected: ...@@ -83,6 +84,11 @@ protected:
*/ */
GLuint m_nbDarts; GLuint m_nbDarts;