Commit b636d120 authored by untereiner's avatar untereiner

Merge cgogn:~vanhoey/CGoGN

Conflicts:
	CMakeLists.txt
parents 4d0c2298 62aec045
Pour utiliser Eclipse (testé avec la version Helios, Galileo & Indigo)
English version bellow
*** English version below ***
Pour utiliser Eclipse (testé avec la version Helios, Galileo, Indigo & Juno)
* Configurer un projet dans Eclipse :
- Faire un nouveau projet C++
- Choisir Makefile project -> Empty Project
......@@ -31,8 +31,8 @@ Projet X -> Properties -> Project references : cocher le projet dont il dépend.
Afin d'éviter qu'Eclipse ne rejette les syntaxes Qt (les includes de Qt, les Q_OBJECT, les callbacks) :
- Télécharger le plugin Qt "eclipse-integration" http://qt.nokia.com/developer/eclipse-integration/
- Décompresser l'archive et copier son contenu dans le répertoire d'installation d'Eclipse (plugins et features)
- Relancer Eclipse au moins une fois avec l'option --clean (relecture des répertoires locaux)
Normalement, dans Window->Preferences de Eclipse, Qt apparait dans le menu.
- Relancer Eclipse au moins une fois avec l'option "-clean" (relecture des répertoires locaux)
Normalement, dans Window --> Preferences de Eclipse, Qt apparait dans le menu.
- Y ajouter le répertoire de Qt (/usr/bin sur Debian/Ubuntu) et le répertoire d'include (/usr/include/qt4).
Ensuite, pour chaque projet, ajouter les includes suivants dans Properties -> C/C++ general -> Paths and Symbols
parmi les includes de C++ :
......@@ -63,7 +63,7 @@ Dans Preferences -> Shaders Preferences, on peut désormais configurer certaines
ENGLISH VERSION
=========================================================================================
To use Eclipse (tested with version Helios, Galileo & Indigo)
To use Eclipse (tested with version Helios, Galileoi, Indigo & Juno)
* Setting up a project in Eclipse:
- Make a new C + + project
......@@ -84,18 +84,18 @@ In the project properties:
Tutorial: Build / Apps / Tutorial (compiles tutorials)
etc. ..
This added to the directory of CGoGN a .project. and .cproject files.
This adds a .project. and .cproject files to the CGoGN directory.
* Inter-dependencies projects and autocompletion
If the project X depends on another project, then:
* Project inter-dependencies and autocompletion
If project X depends on another project, then:
Project X -> Properties -> Project references: check the project which it depends.
* Qt dependencies:
To avoid Eclipse rejects the Qt syntax (the Qt includes the Q_OBJECT, callbacks):
To avoid Eclipse rejecting the Qt syntax (includes, Q_OBJECT, callbacks):
- Download the Qt plugin "eclipse-integration" http://qt.nokia.com/developer/eclipse-integration/
- Unzip the archive and copy its contents into the installation directory of Eclipse (plugins and features)
- Restart Eclipse at least once with the - clean (proofreading local directories)
Normally in Window-> Preferences of Eclipse, Qt appears in the menu.
- Restart Eclipse at least once with the "-clean" (proofreading local directories)
Normally in Window --> Preferences of Eclipse, Qt appears in the menu.
- Add the Qt directory (/ usr / bin on Debian / Ubuntu) and the directory include (/ usr/include/qt4).
Then, for each project, add the following includes in Properties -> C / C + + general -> Paths and Symbols
among the C + + includes:
......
......@@ -39,14 +39,17 @@ namespace Decimation
enum ApproximatorType
{
A_QEM,
A_QEMhalfEdge,
A_MidEdge,
A_HalfCollapse,
A_CornerCutting,
A_TangentPredict1,
A_TangentPredict2,
A_LightfieldHalf,
A_LightfieldFull
A_ColorNaive,
A_ColorQEMext,
A_Lightfield,
// note: the following "h" prefix means that half-edges are prioritized instead of edges.
A_hHalfCollapse,
A_hQEM
// A_hLightfieldHalf,
} ;
template <typename PFP>
......@@ -65,8 +68,10 @@ public:
{}
virtual ~ApproximatorGen()
{}
virtual const std::string& getApproximatedAttributeName() const = 0 ;
virtual const std::string& getApproximatedAttributeName(unsigned int index = 0) const = 0 ;
// virtual std::vector<std::string> getApproximatedAttributeNames() const = 0 ;
virtual ApproximatorType getType() const = 0 ;
virtual unsigned int getNbApproximated() const = 0 ;
virtual bool init() = 0 ;
virtual void approximate(Dart d) = 0 ;
virtual void saveApprox(Dart d) = 0 ;
......@@ -87,52 +92,95 @@ public:
protected:
Predictor<PFP, T>* m_predictor ;
VertexAttribute<T>& m_attrV ; // vertex attribute to be approximated
EdgeAttribute<T> m_approx ; // attribute to store approximation result
EdgeAttribute<T> m_detail ; // attribute to store detail information for reconstruction
T m_app ;
std::vector<VertexAttribute<T>* > m_attrV ; // vertex attributes to be approximated
std::vector<EdgeAttribute<T> > m_approx ; // attributes to store approximation result
std::vector<EdgeAttribute<T> > m_detail ; // attributes to store detail information for reconstruction
std::vector<T> m_app ;
public:
Approximator(MAP& m, VertexAttribute<T>& a, Predictor<PFP, T>* predictor) :
ApproximatorGen<PFP>(m), m_predictor(predictor), m_attrV(a)
Approximator(MAP& m, std::vector<VertexAttribute<T>* > va, Predictor<PFP, T> * predictor) :
ApproximatorGen<PFP>(m), m_predictor(predictor), m_attrV(va)
{
std::stringstream aname ;
aname << "approx_" << m_attrV.name() ;
m_approx = this->m_map.template addAttribute<T, EDGE>(aname.str()) ;
if(m_predictor) // if a predictor is associated to the approximator
{ // create an attribute to store the detail needed for reconstruction
std::stringstream dname ;
dname << "detail_" << m_attrV.name() ;
m_detail = this->m_map.template addAttribute<T, EDGE>(dname.str()) ;
const unsigned int& size = m_attrV.size() ;
assert(size > 0 || !"Approximator: no attributes provided") ;
m_approx.resize(size) ;
m_detail.resize(size) ;
m_app.resize(size) ;
for (unsigned int i = 0 ; i < size ; ++i)
{
if (!m_attrV[i]->isValid())
std::cerr << "Approximator Warning: attribute number " << i << " is not valid" << std::endl ;
std::stringstream aname ;
aname << "approx_" << m_attrV[i]->name() ;
m_approx[i] = this->m_map.template addAttribute<T, EDGE>(aname.str()) ;
if(m_predictor) // if predictors are associated to the approximator
{ // create attributes to store the details needed for reconstruction
std::stringstream dname ;
dname << "detail_" << m_attrV[i]->name() ;
m_detail[i] = this->m_map.template addAttribute<T, EDGE>(dname.str()) ;
}
}
}
virtual ~Approximator()
{
this->m_map.template removeAttribute(m_approx) ;
if(m_predictor)
this->m_map.template removeAttribute(m_detail) ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
{
this->m_map.template removeAttribute(m_approx[i]) ;
if(m_predictor)
this->m_map.template removeAttribute(m_detail[i]) ;
}
}
const std::string& getApproximatedAttributeName(unsigned int index = 0) const
{
return m_attrV[index]->name() ;
}
const std::string& getApproximatedAttributeName() const
// std::vector<std::string> getApproximatedAttributeNames() const
// {
// std::vector<std::string> names ;
// names.resize(m_attrV.size()) ;
// for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
// names[i] = m_attrV[i]->name() ;
//
// return names ;
// }
unsigned int getNbApproximated() const
{
return m_attrV.name() ;
return m_attrV.size() ;
}
void saveApprox(Dart d)
{
m_app = m_approx[d] ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
m_app[i] = m_approx[i][d] ;
}
void affectApprox(Dart d)
{
m_attrV[d] = m_app ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
m_attrV[i]->operator[](d) = m_app[i] ;
}
const T& getApprox(Dart d, unsigned int index = 0) const
{
return m_approx[index][d] ;
}
const T& getApprox(Dart d) const
std::vector<T> getAllApprox(Dart d) const
{
return m_approx[d] ;
std::vector<T> res ;
res.resize(m_attrV.size()) ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
res[i] = m_approx[i][d] ;
return res ;
}
const Predictor<PFP, T>* getPredictor() const
......@@ -140,18 +188,38 @@ public:
return m_predictor ;
}
const T& getDetail(Dart d) const
const T& getDetail(Dart d, unsigned int index = 0) const
{
assert(m_predictor || !"Trying to get detail on a non-predictive scheme") ;
return m_detail[index][d] ;
}
std::vector<T> getAllDetail(Dart d) const
{
assert(m_predictor || !"Trying to get detail on a non-predictive scheme") ;
return m_detail[d] ;
std::vector<T> res ;
res.resize(m_attrV.size()) ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
res[i] = m_detail[i][d] ;
return res ;
}
void setDetail(Dart d, unsigned int index, T& val)
{
assert(m_predictor || !"Trying to set detail on a non-predictive scheme") ;
m_detail[index][d] = val ;
}
void setDetail(Dart d, T& val)
void setDetail(Dart d, std::vector<T>& val)
{
assert(m_predictor || !"Trying to set detail on a non-predictive scheme") ;
m_detail[d] = val ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
m_detail[index][d] = val[i] ;
}
// // TODO works only for vector types !!
// REAL detailMagnitude(Dart d)
// {
......@@ -162,13 +230,17 @@ public:
void addDetail(Dart d, double amount, bool sign, typename PFP::MATRIX33* detailTransform)
{
assert(m_predictor || !"Trying to add detail on a non-predictive scheme") ;
T det = m_detail[d] ;
if(detailTransform)
det = (*detailTransform) * det ;
det *= amount ;
if(!sign)
det *= REAL(-1) ;
m_attrV[d] += det ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
{
T det = m_detail[i][d] ;
if(detailTransform)
det = (*detailTransform) * det ;
det *= amount ;
if(!sign)
det *= REAL(-1) ;
m_attrV[i]->operator[](d) += det ;
}
}
} ;
......
/*******************************************************************************
* 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 __COLOR_APPROXIMATOR_H__
#define __COLOR_APPROXIMATOR_H__
#include "Algo/Decimation/approximator.h"
#include "Topology/generic/mapBrowser.h"
namespace CGoGN
{
namespace Algo
{
namespace Decimation
{
template <typename PFP>
class Approximator_ColorNaive : public Approximator<PFP, typename PFP::VEC3>
{
public:
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
protected:
VertexAttribute<VEC3> m_position ;
EdgeAttribute<VEC3> m_approxposition ;
VertexAttribute<VEC3> *m_color ;
public:
Approximator_ColorNaive(MAP& m, std::vector<VertexAttribute<VEC3>* >& attr, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, attr, pred)
{
m_color = this->m_attrV[0] ;
}
~Approximator_ColorNaive()
{}
ApproximatorType getType() const
{
return A_ColorNaive ;
}
bool init()
{
assert(m_color->isValid() || !"Approximator_ColorNaive: the approximated attribute is not valid") ;
m_position = this->m_map.template getAttribute<VEC3, VERTEX>("position") ;
assert(m_position.isValid() || !"Approximator_ColorNaive::init: the position attribute is not valid") ;
m_approxposition = this->m_map.template getAttribute<VEC3, EDGE>("approx_position") ;
assert(m_approxposition.isValid() || !"Approximator_ColorNaive::init: the approx_position attribute is not valid") ;
return m_color->isValid() && m_position.isValid() && m_approxposition.isValid() ;
}
void approximate(Dart d) ;
} ;
template <typename PFP>
class Approximator_ColorQEMext : public Approximator<PFP, typename PFP::VEC3>
{
public:
typedef typename PFP::MAP MAP ;
typedef typename PFP::REAL REAL ;
typedef typename PFP::VEC3 VEC3 ;
typedef Geom::Vector<6,REAL> VEC6 ;
protected:
VertexAttribute<QuadricNd<REAL,6> > m_quadric ;
VertexAttribute<VEC3> *m_position ;
VertexAttribute<VEC3> *m_color ;
public:
Approximator_ColorQEMext(MAP& m, std::vector<VertexAttribute<VEC3>* >& attr, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, VEC3>(m, attr, pred)
{
assert(attr.size() > 1 || !"Approximator_ColorQEMext: there are not sufficient attributes provided") ;
m_position = this->m_attrV[0] ;
m_color = this->m_attrV[1] ;
}
~Approximator_ColorQEMext()
{}
ApproximatorType getType() const
{
return A_ColorQEMext ;
}
bool init() ;
void approximate(Dart d) ;
} ;
} //namespace Decimation
} //namespace Algo
} //namespace CGoGN
#include "Algo/Decimation/colorPerVertexApproximator.hpp"
#endif
/*******************************************************************************
* 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 Algo
{
namespace Decimation
{
/************************************************************************************
* NAIVE COLOR METRIC *
************************************************************************************/
template <typename PFP>
void Approximator_ColorNaive<PFP>::approximate(Dart d)
{
Dart dd = this->m_map.phi1(d) ;
const VEC3& p1 = m_position.operator[](d) ;
const VEC3& p2 = m_position.operator[](dd) ;
const VEC3& p = m_approxposition.operator[](d) ;
const VEC3& edge = p2 - p1 ;
const REAL& ratio = std::max(std::min(((p - p1) * edge) / edge.norm2(),REAL(1)),REAL(0)) ;
this->m_approx[0][d] = m_color->operator[](d)*ratio + m_color->operator[](dd)*(1-ratio) ;
}
/************************************************************************************
* EXTENDED QUADRIC ERROR METRIC *
************************************************************************************/
template <typename PFP>
bool Approximator_ColorQEMext<PFP>::init()
{
m_quadric = this->m_map.template getAttribute<QuadricNd<REAL,6>, VERTEX>("QEMext-quadric") ;
// Does not require to be valid (if it is not, altenatives will be used).
if(this->m_predictor)
{
return false ;
}
return m_position->isValid() && m_color->isValid() ;
}
template <typename PFP>
void Approximator_ColorQEMext<PFP>::approximate(Dart d)
{
MAP& m = this->m_map ;
// get some darts
Dart dd = m.phi2(d) ;
QuadricNd<REAL,6> q1, q2 ;
if(!m_quadric.isValid()) // if the selector is not QEM, compute local error quadrics
{
// compute the error quadric associated to v1
Dart it = d ;
do
{
VEC6 p0,p1,p2 ;
for (unsigned int i = 0 ; i < 3 ; ++i)
{
p0[i] = this->m_attrV[0]->operator[](it)[i] ;
p0[i+3] = this->m_attrV[1]->operator[](it)[i] ;
p1[i] = this->m_attrV[0]->operator[](m.phi1(it))[i] ;
p1[i+3] = this->m_attrV[1]->operator[](m.phi1(it))[i] ;
p2[i] = this->m_attrV[0]->operator[](m.phi_1(it))[i] ;
p2[i+3] = this->m_attrV[1]->operator[](m.phi_1(it))[i] ;
}
QuadricNd<REAL,6> q(p0,p1,p2) ;
q1 += q ;
it = m.phi2_1(it) ;
} while(it != d) ;
// compute the error quadric associated to v2
it = dd ;
do
{
VEC6 p0,p1,p2 ;
for (unsigned int i = 0 ; i < 3 ; ++i)
{
p0[i] = this->m_attrV[0]->operator[](it)[i] ;
p0[i+3] = this->m_attrV[1]->operator[](it)[i] ;
p1[i] = this->m_attrV[0]->operator[](m.phi1(it))[i] ;
p1[i+3] = this->m_attrV[1]->operator[](m.phi1(it))[i] ;
p2[i] = this->m_attrV[0]->operator[](m.phi_1(it))[i] ;
p2[i+3] = this->m_attrV[1]->operator[](m.phi_1(it))[i] ;
}
QuadricNd<REAL,6> q(p0,p1,p2) ;
q2 += q ;
it = m.phi2_1(it) ;
} while(it != dd) ;
}
else // if the selector is QEM, use the error quadrics computed by the selector
{
q1 = m_quadric[d] ;
q2 = m_quadric[dd] ;
}
QuadricNd<REAL,6> quad ;
quad += q1 ; // compute the sum of the
quad += q2 ; // two vertices quadrics
VEC6 res ;
bool opt = quad.findOptimizedVec(res) ; // try to compute an optimized position for the contraction of this edge
if(!opt)
{
VEC6 p1, p2 ;
for (unsigned int i = 0 ; i < 3; ++i)
{
p1[i] = this->m_attrV[0]->operator[](d)[i] ; // let the new vertex lie
p1[i+3] = this->m_attrV[1]->operator[](d)[i] ; // on either one
p2[i] = this->m_attrV[0]->operator[](dd)[i] ; // of the two
p2[i+3] = this->m_attrV[1]->operator[](dd)[i] ; // endpoints
}
VEC6 p12 = (p1 + p2) / 2.0f ; // or the middle of the edge
REAL e1 = quad(p1) ;
REAL e2 = quad(p2) ;
REAL e12 = quad(p12) ;
REAL minerr = std::min(std::min(e1, e2), e12) ; // consider only the one for
if(minerr == e12)
res = p12 ; // which the error is minimal
else if(minerr == e1)
res = p1 ;
else
res = p2 ;
}
// copy res into m_approx
for (unsigned int i = 0 ; i < 3 ; ++i)
{
this->m_approx[0][d][i] = res[i] ;
this->m_approx[1][d][i] = res[i+3] ;
}
}
} //namespace Decimation
} //namespace Algo
} //namespace CGoGN
......@@ -28,6 +28,7 @@
#include "Algo/Decimation/edgeSelector.h"
#include "Algo/Decimation/halfEdgeSelector.h"
#include "Algo/Decimation/geometryApproximator.h"
#include "Algo/Decimation/colorPerVertexApproximator.h"
#include "Algo/Decimation/lightfieldApproximator.h"
namespace CGoGN
......@@ -44,9 +45,10 @@ void decimate(
typename PFP::MAP& map,
SelectorType s,
ApproximatorType a,
VertexAttribute<typename PFP::VEC3>& position,
std::vector<VertexAttribute<typename PFP::VEC3> *>& position,
unsigned int nbWantedVertices,
const FunctorSelect& selected = allDarts
const FunctorSelect& selected = allDarts,
void (*callback_wrapper)(void*, const void*) = NULL, void *callback_object = NULL
) ;
} //namespace Decimation
......
......@@ -34,75 +34,106 @@ namespace Decimation
template <typename PFP>
void decimate(
typename PFP::MAP& map, SelectorType s, ApproximatorType a,
VertexAttribute<typename PFP::VEC3>& position, unsigned int nbWantedVertices, const FunctorSelect& selected
std::vector<VertexAttribute<typename PFP::VEC3>* >& attribs, unsigned int nbWantedVertices, const FunctorSelect& selected,
void (*callback_wrapper)(void*, const void*), void* callback_object
)
{
assert(attribs.size() >= 1 || !"Decimate: not enough attribs provided") ;
assert(attribs[0]->name() == "position" || !"Decimate: first attribute is not position") ;
VertexAttribute<typename PFP::VEC3> position = *(attribs[0]) ;
std::vector<ApproximatorGen<PFP>*> approximators ;
EdgeSelector<PFP>* selector = NULL ;
std::vector<VertexAttribute<typename PFP::VEC3>* > *v_approx = NULL ;
switch(a)
{
case A_QEM :
approximators.push_back(new Approximator_QEM<PFP>(map, position)) ;
break ;
case A_QEMhalfEdge :
approximators.push_back(new Approximator_QEMhalfEdge<PFP>(map, position)) ;
approximators.push_back(new Approximator_QEM<PFP>(map, attribs)) ;
break ;
case A_MidEdge :
approximators.push_back(new Approximator_MidEdge<PFP>(map, position)) ;
approximators.push_back(new Approximator_MidEdge<PFP>(map, attribs)) ;
break ;
case A_CornerCutting :
approximators.push_back(new Approximator_CornerCutting<PFP>(map, position)) ;
approximators.push_back(new Approximator_CornerCutting<PFP>(map, attribs)) ;
break ;
case A_TangentPredict1 :
approximators.push_back(new Approximator_MidEdge<PFP>(map, position)) ;
approximators.push_back(new Approximator_MidEdge<PFP>(map, attribs)) ;
break ;
case A_TangentPredict2 :
approximators.push_back(new Approximator_MidEdge<PFP>(map, position)) ;
approximators.push_back(new Approximator_MidEdge<PFP>(map, attribs)) ;
break ;
case A_HalfCollapse :
approximators.push_back(new Approximator_HalfCollapse<PFP>(map, position)) ;
case A_hHalfCollapse :
approximators.push_back(new Approximator_HalfCollapse<PFP>(map, attribs)) ;
break ;
case A_LightfieldFull :
case A_ColorNaive :
{
approximators.push_back(new Approximator_QEMhalfEdge<PFP>(map, position)) ;
/*
PFP::TVEC3 frame[3] ;
frame[0] = map.template getAttribute<typename PFP::VEC3, VERTEX>("frame_T") ; // Tangent
frame[1] = map.template getAttribute<typename PFP::VEC3, VERTEX>("frame_B") ; // Bitangent
frame[2] = map.template getAttribute<typename PFP::VEC3, VERTEX>("frame_N") ; // Normal
for (unsigned int i = 0 ; i < 3 ; ++i)
if (!frame[i].isValid()) {
CGoGNerr << "In function decimate : frame[" << i << "] is not valid" << CGoGNendl ;
}
VertexAttribute<typename PFP::VEC3> colorPTM[6] ;
colorPTM[0] = map.template getAttribute<typename PFP::VEC3, VERTEX>("colorPTM_a") ;
colorPTM[1] = map.template getAttribute<typename PFP::VEC3, VERTEX>("colorPTM_b") ;
colorPTM[2] = map.template getAttribute<typename PFP::VEC3, VERTEX>("colorPTM_c") ;
colorPTM[3] = map.template getAttribute<typename PFP::VEC3, VERTEX>("colorPTM_d") ;
colorPTM[4] = map.template getAttribute<typename PFP::VEC3, VERTEX>("colorPTM_e") ;
colorPTM[5] = map.template getAttribute<typename PFP::VEC3, VERTEX>("colorPTM_f") ;
for (unsigned int i = 0 ; i < 6 ; ++i)
if (!colorPTM[i].isValid()) {
CGoGNerr << "In function decimate : colorPTM[" << i << "] is not valid" << CGoGNendl ;
}
*/
VertexAttribute<Geom::Matrix<3,3,typename PFP::REAL> > frame = map.template getAttribute<Geom::Matrix<3,3,typename PFP::REAL>, VERTEX>("frame") ;
VertexAttribute<Geom::Matrix<3,6,typename PFP::REAL> > RGBfunctions = map.template getAttribute<Geom::Matrix<3,6,typename PFP::REAL>, VERTEX>("colorPTM") ;
approximators.push_back(new Approximator_Frame<PFP>(map, frame)) ;
approximators.push_back(new Approximator_RGBfunctions<PFP>(map, RGBfunctions)) ;
break ;
v_approx = new std::vector<VertexAttribute<typename PFP::VEC3>* >[2] ;
// pos
v_approx[0].push_back(attribs[0]) ;
approximators.push_back(new Approximator_QEM<PFP>(map, v_approx[0])) ;
// col
assert(attribs.size() >= 2 || !