Commit 339e3d3d authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Add CPV decimation. Replace old code.

parent 2504d16e
...@@ -39,15 +39,16 @@ namespace Decimation ...@@ -39,15 +39,16 @@ namespace Decimation
enum ApproximatorType enum ApproximatorType
{ {
A_QEM, A_QEM,
A_QEMhalfEdge, A_hQEM,
A_MidEdge, A_MidEdge,
A_HalfCollapse, A_HalfCollapse,
A_CornerCutting, A_CornerCutting,
A_TangentPredict1, A_TangentPredict1,
A_TangentPredict2, A_TangentPredict2,
A_LightfieldHalf, A_hColor
/*A_LightfieldHalf,
A_LightfieldHalf_deprecated, A_LightfieldHalf_deprecated,
A_LightfieldFull_deprecated A_LightfieldFull_deprecated*/
} ; } ;
template <typename PFP> template <typename PFP>
...@@ -102,6 +103,9 @@ public: ...@@ -102,6 +103,9 @@ public:
m_detail.resize(m_attrV.size()) ; m_detail.resize(m_attrV.size()) ;
m_app.resize(m_attrV.size()) ; m_app.resize(m_attrV.size()) ;
if (m_attrV.size() < 1)
std::cerr << "Approximator: no attributes provided" << std::endl ;
for (unsigned int i = 0 ; i < m_attrV.size() ; ++i) for (unsigned int i = 0 ; i < m_attrV.size() ; ++i)
{ {
std::stringstream aname ; std::stringstream aname ;
......
...@@ -38,113 +38,102 @@ namespace Decimation ...@@ -38,113 +38,102 @@ namespace Decimation
{ {
template <typename PFP> template <typename PFP>
class Approximator_FrameHalf : public Approximator<PFP, typename Geom::Matrix<3,3,typename PFP::REAL> > class Approximator_Color : public Approximator<PFP, typename PFP::VEC3>
{ {
public: public:
typedef typename PFP::MAP MAP ; typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ; typedef typename PFP::REAL REAL ;
typedef Geom::Matrix<3,3,REAL> MATRIX33 ; protected:
typedef Geom::Matrix<3,6,REAL> MATRIX36 ; VertexAttribute<VEC3> *m_color ;
public: public:
Approximator_FrameHalf(MAP& m, VertexAttribute<MATRIX33>& frame, Predictor<PFP, MATRIX33>* pred = NULL) : Approximator_Color(MAP& m, std::vector<VertexAttribute<VEC3>* >& attr, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, MATRIX33>(m, frame, pred) Approximator<PFP, VEC3>(m, attr, pred)
{} {
~Approximator_FrameHalf() m_color = this->m_attrV[0] ;
assert((m_color->isValid() && m_color->name() == "color") || !"Approximator_Color: the approximated attribute is not valid or not named 'color'") ;
}
~Approximator_Color()
{} {}
ApproximatorType getType() const { return A_LightfieldHalf ; }
bool init() { return true ; } ;
void approximate(Dart d) ;
} ;
template <typename PFP> ApproximatorType getType() const
class Approximator_RGBfunctionsHalf : public Approximator<PFP, typename Geom::Matrix<3,6,typename PFP::REAL> > {
{ return A_hColor ;
public: }
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
typedef Geom::Matrix<3,3,REAL> MATRIX33 ; bool init()
typedef Geom::Matrix<3,6,REAL> MATRIX36 ; {
return true ;
}
protected:
VertexAttribute<MATRIX33> m_frame ;
EdgeAttribute<MATRIX33> m_approxFrame ;
EdgeAttribute<QuadricRGBfunctions<REAL> > m_quadricRGBfunctions ;
public:
Approximator_RGBfunctionsHalf(MAP& m, VertexAttribute<MATRIX36>& rgbfunctions, Predictor<PFP, MATRIX36>* pred = NULL) :
Approximator<PFP, MATRIX36>(m, rgbfunctions, pred)
{ }
~Approximator_RGBfunctionsHalf ()
{}
ApproximatorType getType() const { return A_LightfieldHalf ; }
bool init() ;
void approximate(Dart d) ; void approximate(Dart d) ;
} ; } ;
/*
template <typename PFP> template <typename PFP>
class Approximator_Frame : public Approximator<PFP, typename Geom::Matrix<3,3,typename PFP::REAL> > class Approximator_FrameHalf : public Approximator<PFP, typename PFP::VEC3>
{ {
public: public:
typedef typename PFP::MAP MAP ; typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ; typedef typename PFP::REAL REAL ;
typedef Geom::Matrix<3,3,REAL> MATRIX33 ;
typedef Geom::Matrix<3,6,REAL> MATRIX36 ;
protected:
VertexAttribute<VEC3> m_position ;
EdgeAttribute<VEC3> m_approxPosition ;
public: public:
Approximator_Frame(MAP& m, VertexAttribute<MATRIX33>& frame, Predictor<PFP, MATRIX33>* pred = NULL) : Approximator_FrameHalf(MAP& m, std::vector<VertexAttribute<VEC3> >& attr, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, MATRIX33>(m, frame, pred) Approximator<PFP, VEC3>(m, attr, pred)
{} {}
~Approximator_Frame() ~Approximator_FrameHalf()
{} {}
ApproximatorType getType() const { return A_LightfieldFull ; }
bool init() ; ApproximatorType getType() const
{
return A_LightfieldHalf ;
}
bool init()
{
return true ;
}
void approximate(Dart d) ; void approximate(Dart d) ;
} ; } ;
template <typename PFP> template <typename PFP>
class Approximator_RGBfunctions : public Approximator<PFP, typename Geom::Matrix<3,6,typename PFP::REAL> > class Approximator_LightfieldCoefsHalf : public Approximator<PFP, typename PFP::VEC3>
{ {
public: public:
typedef typename PFP::MAP MAP ; typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ; typedef typename PFP::REAL REAL ;
typedef Geom::Matrix<3,3,REAL> MATRIX33 ;
typedef Geom::Matrix<3,6,REAL> MATRIX36 ;
protected:
VertexAttribute<MATRIX33> m_frame ;
EdgeAttribute<MATRIX33> m_approxFrame ;
EdgeAttribute<QuadricRGBfunctions<REAL> > m_quadricRGBfunctions ;
public: public:
Approximator_RGBfunctions(MAP& m, VertexAttribute<MATRIX36>& rgbfunctions, Predictor<PFP, MATRIX36>* pred = NULL) : Approximator_LightfieldCoefsHalf(MAP& m, std::vector<VertexAttribute<VEC3> >& attr, Predictor<PFP, VEC3>* pred = NULL) :
Approximator<PFP, MATRIX36>(m, rgbfunctions, pred) Approximator<PFP, VEC3>(m, attr, pred)
{ }
~Approximator_RGBfunctions()
{} {}
ApproximatorType getType() const { return A_LightfieldFull ; } ~Approximator_LightfieldCoefsHalf()
bool init() ; {}
ApproximatorType getType() const
{
return A_LightfieldHalf ;
}
bool init()
{
return true ;
}
void approximate(Dart d) ; void approximate(Dart d) ;
} ; } ;
*/
} //namespace Decimation } //namespace Decimation
} //namespace Algo } //namespace Algo
} //namespace CGoGN } //namespace CGoGN
#include "Algo/Decimation/lightfieldApproximator.hpp" #include "Algo/Decimation/colorPerVertexApproximator.hpp"
#endif #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
{
/************************************************************************************
* COLOR METRIC *
************************************************************************************/
template <typename PFP>
void Approximator_Color<PFP>::approximate(Dart d)
{
Dart dd = this->m_map.phi1(d) ;
this->m_approx[0][d] = m_color->operator[](d) ;
this->m_approx[0][d] += m_color->operator[](dd) ;
this->m_approx[0][d] /= 2 ;
}
} //namespace Decimation
} //namespace Algo
} //namespace CGoGN
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
#include "Algo/Decimation/edgeSelector.h" #include "Algo/Decimation/edgeSelector.h"
#include "Algo/Decimation/halfEdgeSelector.h" #include "Algo/Decimation/halfEdgeSelector.h"
#include "Algo/Decimation/geometryApproximator.h" #include "Algo/Decimation/geometryApproximator.h"
#include "Algo/Decimation/lightfieldApproximator.h" #include "Algo/Decimation/colorPerVertexApproximator.h"
//#include "Algo/Decimation/lightfieldApproximator_deprecated.h"
namespace CGoGN namespace CGoGN
{ {
...@@ -46,7 +47,8 @@ void decimate( ...@@ -46,7 +47,8 @@ void decimate(
ApproximatorType a, ApproximatorType a,
VertexAttribute<typename PFP::VEC3>& position, VertexAttribute<typename PFP::VEC3>& position,
unsigned int nbWantedVertices, unsigned int nbWantedVertices,
const FunctorSelect& selected = allDarts const FunctorSelect& selected = allDarts,
void (*callback_wrapper)(void*, const void*) = NULL, void *callback_object = NULL
) ; ) ;
} //namespace Decimation } //namespace Decimation
......
...@@ -34,39 +34,88 @@ namespace Decimation ...@@ -34,39 +34,88 @@ namespace Decimation
template <typename PFP> template <typename PFP>
void decimate( void decimate(
typename PFP::MAP& map, SelectorType s, ApproximatorType a, typename PFP::MAP& map, SelectorType s, ApproximatorType a,
VertexAttribute<typename PFP::VEC3>& position, unsigned int nbWantedVertices, const FunctorSelect& selected VertexAttribute<typename PFP::VEC3>& position, unsigned int nbWantedVertices, const FunctorSelect& selected,
void (*callback_wrapper)(void*, const void*), void* callback_object
) )
{ {
std::vector<ApproximatorGen<PFP>*> approximators ; std::vector<ApproximatorGen<PFP>*> approximators ;
EdgeSelector<PFP>* selector = NULL ; EdgeSelector<PFP>* selector = NULL ;
std::vector<VertexAttribute<typename PFP::VEC3>* > v_pos ;
v_pos.push_back(&position) ;
switch(a) switch(a)
{ {
case A_QEM : case A_QEM :
approximators.push_back(new Approximator_QEM<PFP>(map, position)) ; approximators.push_back(new Approximator_QEM<PFP>(map, v_pos)) ;
break ; break ;
case A_QEMhalfEdge : case A_hQEM :
approximators.push_back(new Approximator_QEMhalfEdge<PFP>(map, position)) ; approximators.push_back(new Approximator_QEMhalfEdge<PFP>(map, v_pos)) ;
break ; break ;
case A_MidEdge : case A_MidEdge :
approximators.push_back(new Approximator_MidEdge<PFP>(map, position)) ; approximators.push_back(new Approximator_MidEdge<PFP>(map, v_pos)) ;
break ; break ;
case A_CornerCutting : case A_CornerCutting :
approximators.push_back(new Approximator_CornerCutting<PFP>(map, position)) ; approximators.push_back(new Approximator_CornerCutting<PFP>(map, v_pos)) ;
break ; break ;
case A_TangentPredict1 : case A_TangentPredict1 :
approximators.push_back(new Approximator_MidEdge<PFP>(map, position)) ; approximators.push_back(new Approximator_MidEdge<PFP>(map, v_pos)) ;
break ; break ;
case A_TangentPredict2 : case A_TangentPredict2 :
approximators.push_back(new Approximator_MidEdge<PFP>(map, position)) ; approximators.push_back(new Approximator_MidEdge<PFP>(map, v_pos)) ;
break ; break ;
case A_HalfCollapse : case A_HalfCollapse :
approximators.push_back(new Approximator_HalfCollapse<PFP>(map, position)) ; approximators.push_back(new Approximator_HalfCollapse<PFP>(map, v_pos)) ;
break ;
case A_hColor :
// pos
approximators.push_back(new Approximator_HalfCollapse<PFP>(map, v_pos)) ;
// col
std::vector<VertexAttribute<typename PFP::VEC3>* > v_col ;
VertexAttribute<typename PFP::VEC3> colors = map.template getAttribute<typename PFP::VEC3, VERTEX>("color") ;
v_col.push_back(&colors) ;
approximators.push_back(new Approximator_Color<PFP>(map, v_col)) ;
break ; break ;
case A_LightfieldFull : /*case A_LightfieldHalf:
approximators.push_back(new Approximator_HalfCollapse<PFP>(map, position)) ;
// Get all frame embeddings
std::vector<VertexAttribute<PFP::VEC3>* > vertexAttributesFrame ;
VertexAttribute<PFP::VEC3> frame0 = myMap.getAttribute<PFP::VEC3, VERTEX>("frameT") ; vertexAttributesFrame.push_back(&frame0) ;
VertexAttribute<PFP::VEC3> frame1 = myMap.getAttribute<PFP::VEC3, VERTEX>("frameB") ; vertexAttributesFrame.push_back(&frame1) ;
VertexAttribute<PFP::VEC3> frame2 = myMap.getAttribute<PFP::VEC3, VERTEX>("frameN") ; vertexAttributesFrame.push_back(&frame2) ;
approximators.push_back(new Approximator_FrameHalf<PFP>(map, vertexAttributesFrame)) ; // TODO
// Get all coefficient embeddings
const unsigned int K = 200 ;
std::vector<VertexAttribute<PFP::VEC3>* > vertexAttributesCoefs ;
VertexAttribute<PFP::VEC3> *PBcoefs = new VertexAttribute<PFP::VEC3>[K] ;
for (unsigned int k = 0 ; k < K ; ++k)
{
std::stringstream s ;
s << "PBcoefs" << k ;
PBcoefs[k] = myMap.getAttribute<PFP::VEC3, VERTEX>(s.str()) ;
if (!PBcoefs[k].isValid())
break ;
vertexAttributesCoefs.push_back(&PBcoefs[k]) ;
}
const bool& sh = vertexAttributesCoefs.empty() ; // sh or pb
VertexAttribute<PFP::VEC3> *SHcoefs = new VertexAttribute<PFP::VEC3>[K] ;
for (unsigned int k = 0 ; k < K ; ++k)
{
std::stringstream s ;
s << "SHcoefs" << k ;
SHcoefs[k] = myMap.getAttribute<PFP::VEC3, VERTEX>(s.str()) ;
if (!SHcoefs[k].isValid())
break ;
vertexAttributesCoefs.push_back(&SHcoefs[k]) ;
}
approximators.push_back(new Approximator_LightfieldCoefsHalf<PFP>(map, vertexAttributesCoefs, sh)) ; // TODO
break ;
case A_LightfieldFull_deprecated :
{ {
approximators.push_back(new Approximator_QEMhalfEdge<PFP>(map, position)) ; approximators.push_back(new Approximator_QEMhalfEdge<PFP>(map, position)) ;
/* / *
PFP::TVEC3 frame[3] ; PFP::TVEC3 frame[3] ;
frame[0] = map.template getAttribute<typename PFP::VEC3, VERTEX>("frame_T") ; // Tangent 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[1] = map.template getAttribute<typename PFP::VEC3, VERTEX>("frame_B") ; // Bitangent
...@@ -87,22 +136,22 @@ void decimate( ...@@ -87,22 +136,22 @@ void decimate(
if (!colorPTM[i].isValid()) { if (!colorPTM[i].isValid()) {
CGoGNerr << "In function decimate : colorPTM[" << i << "] is not valid" << CGoGNendl ; 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,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") ; 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_Frame_deprecated<PFP>(map, frame)) ;
approximators.push_back(new Approximator_RGBfunctions<PFP>(map, RGBfunctions)) ; approximators.push_back(new Approximator_RGBfunctions_deprecated<PFP>(map, RGBfunctions)) ;
break ; break ;
} }
case A_LightfieldHalf : case A_LightfieldHalf_deprecated :
{ {
approximators.push_back(new Approximator_HalfCollapse<PFP>(map, position)) ; approximators.push_back(new Approximator_HalfCollapse<PFP>(map, position)) ;
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,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") ; 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_FrameHalf<PFP>(map, frame)) ; approximators.push_back(new Approximator_FrameHalf_deprecated<PFP>(map, frame)) ;
approximators.push_back(new Approximator_RGBfunctionsHalf<PFP>(map, RGBfunctions)) ; approximators.push_back(new Approximator_RGBfunctionsHalf_deprecated<PFP>(map, RGBfunctions)) ;
break ; break ;
} }*/
} }
switch(s) switch(s)
...@@ -128,12 +177,15 @@ void decimate( ...@@ -128,12 +177,15 @@ void decimate(
case S_MinDetail : case S_MinDetail :
selector = new EdgeSelector_MinDetail<PFP>(map, position, approximators, selected) ; selector = new EdgeSelector_MinDetail<PFP>(map, position, approximators, selected) ;
break ; break ;
case S_hLightfield : /*case S_hLightfield_deprecated :
selector = new HalfEdgeSelector_Lightfield<PFP>(map, position, approximators, selected) ; selector = new HalfEdgeSelector_Lightfield_deprecated<PFP>(map, position, approximators, selected) ;
break ; break ;*/
case S_hQEMml : case S_hQEMml :
selector = new HalfEdgeSelector_QEMml<PFP>(map, position, approximators, selected) ; selector = new HalfEdgeSelector_QEMml<PFP>(map, position, approximators, selected) ;
break ; break ;
case S_hColor :
selector = new HalfEdgeSelector_Color<PFP>(map, position, approximators, selected) ;
break ;
} }
for(typename std::vector<ApproximatorGen<PFP>*>::iterator it = approximators.begin(); it != approximators.end(); ++it) for(typename std::vector<ApproximatorGen<PFP>*>::iterator it = approximators.begin(); it != approximators.end(); ++it)
...@@ -148,11 +200,8 @@ void decimate( ...@@ -148,11 +200,8 @@ void decimate(
while(!finished) while(!finished)
{ {
// CGoGNout << "Countdown : " ; if(!selector->nextEdge(d))
// CGoGNout << std::setprecision(8) << (nbVertices - nbWantedVertices) << "\r" << CGoGNflush ; {
if(!selector->nextEdge(d)) {
// CGoGNout << CGoGNendl << "out" << CGoGNendl ;
break ; break ;
} }
...@@ -176,10 +225,14 @@ void decimate( ...@@ -176,10 +225,14 @@ void decimate(
selector->updateAfterCollapse(d2, dd2) ;// update selector selector->updateAfterCollapse(d2, dd2) ;// update selector
if(nbVertices <= nbWantedVertices) { if(nbVertices <= nbWantedVertices)
{
finished = true ; finished = true ;
// CGoGNout << CGoGNendl << "done" << CGoGNendl ;
} }
// Progress bar support
if (callback_wrapper != NULL && callback_object != NULL)
callback_wrapper(callback_object, &nbVertices) ;
} }
delete selector ; delete selector ;
......
...@@ -475,6 +475,8 @@ void EdgeSelector_QEM<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo) ...@@ -475,6 +475,8 @@ void EdgeSelector_QEM<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
REAL err = std::max(REAL(0),REAL(quad(m_positionApproximator->getApprox(d)))) ; REAL err = std::max(REAL(0),REAL(quad(m_positionApproximator->getApprox(d)))) ;
std::cout << quad(m_positionApproximator->getApprox(d)) << std::endl ;
einfo.it = edges.insert(std::make_pair(err, d)) ; einfo.it = edges.insert(std::make_pair(err, d)) ;
einfo.valid = true ; einfo.valid = true ;
} }
...@@ -1074,7 +1076,7 @@ void EdgeSelector_MinDetail<PFP>::updateEdgeInfo(Dart d, bool recompute) ...@@ -1074,7 +1076,7 @@ void EdgeSelector_MinDetail<PFP>::updateEdgeInfo(Dart d, bool recompute)
template <typename PFP> template <typename PFP>
void EdgeSelector_MinDetail<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo) void EdgeSelector_MinDetail<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
{ {
Dart dd = this->m_map.phi2(d) ; // Dart dd = this->m_map.phi2(d) ;
REAL err = REAL(0) ; REAL err = REAL(0) ;
// for(typename std::vector<ApproximatorGen<PFP>*>::iterator it = this->m_approximators.begin(); // for(typename std::vector<ApproximatorGen<PFP>*>::iterator it = this->m_approximators.begin();
......
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
} }
~Approximator_QEMhalfEdge() ~Approximator_QEMhalfEdge()
{} {}
ApproximatorType getType() const { return A_QEMhalfEdge ; } ApproximatorType getType() const { return A_hQEM ; }
bool init() ; bool init() ;
void approximate(Dart d) ; void approximate(Dart d) ;
} ; } ;
......
...@@ -86,7 +86,61 @@ public: ...@@ -86,7 +86,61 @@ public:
} ; } ;
template <typename PFP> template <typename PFP>
class HalfEdgeSelector_Lightfield : public EdgeSelector<PFP> class HalfEdgeSelector_Color : public EdgeSelector<PFP>
{
public:
typedef typename PFP::MAP MAP ;
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
private:
typedef struct
{
typename std::multimap<float,Dart>::iterator it ;
bool valid ;
static std::string CGoGNnameOfType() { return "ColorHalfEdgeInfo" ; }
} QEMhalfEdgeInfo ;
typedef NoMathIOAttribute<QEMhalfEdgeInfo> HalfEdgeInfo ;
DartAttribute<HalfEdgeInfo> halfEdgeInfo ;
VertexAttribute<VEC3> m_color ;
VertexAttribute<Quadric<REAL> > m_quadric ;
std::multimap<float,Dart> halfEdges ;