diff --git a/Apps/Examples/texturesExample.cpp b/Apps/Examples/texturesExample.cpp index c6f59c9a6c8f470fc3dd2d0d771b905e41cf4d8f..6cca1c16a520cd9d51ceaea50b5e4959c71206ed 100644 --- a/Apps/Examples/texturesExample.cpp +++ b/Apps/Examples/texturesExample.cpp @@ -1,18 +1,40 @@ -/* - * texturesExample.cpp - * - * Created on: Jul 21, 2011 - * Author: thery - */ +/******************************************************************************* +* 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 * +* * +*******************************************************************************/ #include "texturesExample.h" #include "Algo/Geometry/boundingbox.h" #include "Algo/Modelisation/polyhedron.h" TexView::TexView(): -m_render(NULL), m_positionVBO(NULL), m_texcoordVBO(NULL), m_texture(NULL), m_shader(NULL),m_modeMask(false),m_fileName("") -{ -} + m_render(NULL), + m_positionVBO(NULL), + m_texcoordVBO(NULL), + m_texture(NULL), + m_shader(NULL), + m_modeMask(false), + m_fileName("") +{} TexView::~TexView() { @@ -205,7 +227,7 @@ int main(int argc, char**argv) PFP::MAP& m = tv.myMap; VertexAttribute position = m.addAttribute("position"); - AttributeHandler texcoord = m.addAttribute("texcoord"); + VertexAttribute texcoord = m.addAttribute("texcoord"); #define NB 96 diff --git a/Apps/Tuto/tp_master.cpp b/Apps/Tuto/tp_master.cpp index 7a1ced12530d1904bd44a2e15b311dadbb0f85ea..8d54a469a535380942241e578b5012953134df02 100644 --- a/Apps/Tuto/tp_master.cpp +++ b/Apps/Tuto/tp_master.cpp @@ -62,9 +62,9 @@ typedef PFP::VEC3 Point3D; // Variables pour la gestion des plongements // handler d'attribut de position par sommet -AttributeHandler position; +VertexAttribute position; // handler d'attribut de normale par sommet -VertexAttribute normal; +VertexAttribute normal; /// Fonctions a connaitre: diff --git a/Apps/Tuto/tuto2.cpp b/Apps/Tuto/tuto2.cpp index a9b9cbe30e86093d829f4c4f0afac8bef7405a87..61b5e45fcf0824500910f010576ffae7a72f66e5 100644 --- a/Apps/Tuto/tuto2.cpp +++ b/Apps/Tuto/tuto2.cpp @@ -80,7 +80,7 @@ void MyQT::createMap() // example of attribute on face // here for example we store the number of edges of faces at construction - AttributeHandler side = myMap.addAttribute("nb_sides"); + FaceAttribute side = myMap.addAttribute("nb_sides"); side[d1] = 3; side[d2] = 4; diff --git a/Apps/Tuto/tuto_mt.cpp b/Apps/Tuto/tuto_mt.cpp index cb72f9ec167d1d8fff27c3a07fc913d291e11b45..91f1e3b47b6953b7f852034b0aabbc6fba23eeb0 100644 --- a/Apps/Tuto/tuto_mt.cpp +++ b/Apps/Tuto/tuto_mt.cpp @@ -60,8 +60,8 @@ struct PFP: public PFP_STANDARD PFP::MAP myMap; // attribute handlers -AttributeHandler position; -AttributeHandler normal; +VertexAttribute position; +VertexAttribute normal; // open file void MyQT::cb_Open() @@ -86,10 +86,10 @@ void MyQT::cb_Open() } // recuper l'attribut pour la position des points (créé lors de l'import) - position = myMap.getAttribute(VERTEX, attrNames[0]) ; + position = myMap.getAttribute(attrNames[0]) ; if (!normal.isValid()) - normal = myMap.addAttribute(VERTEX, "normal"); + normal = myMap.addAttribute("normal"); Algo::Geometry::computeNormalVertices(myMap, position, normal) ; @@ -107,7 +107,7 @@ void MyQT::cb_Open() void MyQT::cb_New() { if (!position.isValid()) - position = myMap.addAttribute(VERTEX, "position"); + position = myMap.addAttribute("position"); // create a sphere Algo::Modelisation::Polyhedron prim(myMap, position); @@ -115,7 +115,7 @@ void MyQT::cb_New() prim.embedSphere(10.0f); if (!normal.isValid()) - normal = myMap.addAttribute(VERTEX, "normal"); + normal = myMap.addAttribute("normal"); Algo::Geometry::computeNormalVertices(myMap, position, normal) ; @@ -332,7 +332,7 @@ public: void MyQT::menu_slot1() { // cree un handler pour les normales aux sommets - AttributeHandler normal2 = myMap.addAttribute(VERTEX, "normal2"); + VertexAttribute normal2 = myMap.addAttribute("normal2"); // ajout de 4 threads pour les markers myMap.addThreadMarker(4); @@ -346,7 +346,7 @@ void MyQT::menu_slot1() // parallelisation de boucle sans resultat calculFunctor1 tf1(myMap,position,normal); - Algo::Parallel::foreach_orbit(myMap,VERTEX, tf1,4); + Algo::Parallel::foreach_orbit(myMap, VERTEX, tf1,4); CGoGNout << "ok:"<< CGoGNendl; // parallelisation de boucle avec resultats stockes @@ -355,7 +355,7 @@ void MyQT::menu_slot1() std::vector > lengthp; LengthEdgeFunctor tflef(myMap,position); // le foncteur // on lance l'algo parallelise (4 threads, buffer de 16384 brins par thread) - Algo::Parallel::foreach_orbit_res< PFP,std::pair >(myMap,EDGE, tflef, 4 , 16384,lengthp); + Algo::Parallel::foreach_orbit_res< PFP,std::pair >(myMap, EDGE, tflef, 4 , 16384,lengthp); // on calcule la somme des resultats std::pair le = Algo::Parallel::sumPairResult(lengthp); CGoGNout << "length :" < position; - AttributeHandler colorDarts; + DartAttribute colorDarts; SelectorDartNoBoundary nb; diff --git a/Apps/Tuto/tuto_orbits.cpp b/Apps/Tuto/tuto_orbits.cpp index 6139a57071169912e4947beb0d611af3eba5f700..02fed74e76c605cbc2cdba644f0b221ad9b71673 100644 --- a/Apps/Tuto/tuto_orbits.cpp +++ b/Apps/Tuto/tuto_orbits.cpp @@ -38,7 +38,7 @@ MAP myMap; VertexAttribute position ; -AttributeHandler middleDarts; +DartAttribute middleDarts; void MyQT::text_onoff(bool x) @@ -170,7 +170,7 @@ void MyQT::cb_mousePress(int button, int x, int y) m_clicked = m_render_topo->picking(myMap, x,y, nb); if (m_clicked != Dart::nil()) { - unsigned int orbs[9] = {VERTEX,EDGE,FACE,VOLUME,PFP::MAP::ORBIT_IN_PARENT(VERTEX),PFP::MAP::ORBIT_IN_PARENT(EDGE),PFP::MAP::ORBIT_IN_PARENT(FACE),PFP::MAP::ORBIT_IN_PARENT2(VERTEX),PFP::MAP::ORBIT_IN_PARENT2(EDGE)}; + unsigned int orbs[9] = {VERTEX,EDGE,FACE,VOLUME,PFP::MAP::VERTEX_OF_PARENT,PFP::MAP::EDGE_OF_PARENT,PFP::MAP::FACE_OF_PARENT,PFP::MAP::VERTEX_OF_PARENT2,PFP::MAP::EDGE_OF_PARENT2}; m_selected.clear(); // easy way to traverse darts of orbit @@ -182,14 +182,12 @@ void MyQT::cb_mousePress(int button, int x, int y) } } - template void MyQT::init_att_orb(AttributeHandlerGen* attg) { - int i=0; + unsigned int i = 0; TraversorCell tra(myMap); -// AttributeHandler* attx = reinterpret_cast< AttributeHandler* >(attg); AttributeHandler* att = static_cast< AttributeHandler* >(attg); for (Dart d = tra.begin(); d != tra.end(); d = tra.next()) @@ -208,35 +206,24 @@ void MyQT::initMap() prim.hexaGrid_topo(nb,nb,nb); prim.embedHexaGrid(1.0f,1.0f,1.0f); - AttributeHandler att0 = myMap.addAttribute("vertex"); - m_att_orbits[0] = new AttributeHandler(att0); - init_att_orb(m_att_orbits[0]); - + m_att_orbits[0] = new AttributeHandler(myMap.addAttribute("vertex")); m_att_orbits[1] = new AttributeHandler(myMap.addAttribute("edge")); m_att_orbits[2] = new AttributeHandler(myMap.addAttribute("face")); m_att_orbits[3] = new AttributeHandler(myMap.addAttribute("volume")); - m_att_orbits[4] = new AttributeHandler(myMap.addAttribute("vertex2")); - m_att_orbits[5] = new AttributeHandler(myMap.addAttribute("edge2")); - m_att_orbits[6] = new AttributeHandler(myMap.addAttribute("face2")); - m_att_orbits[7] = new AttributeHandler(myMap.addAttribute("vertex1")); - m_att_orbits[8] = new AttributeHandler(myMap.addAttribute("face1")); - - + m_att_orbits[4] = new AttributeHandler(myMap.addAttribute("vertex2")); + m_att_orbits[5] = new AttributeHandler(myMap.addAttribute("edge2")); + m_att_orbits[6] = new AttributeHandler(myMap.addAttribute("face2")); + m_att_orbits[7] = new AttributeHandler(myMap.addAttribute("vertex1")); + m_att_orbits[8] = new AttributeHandler(myMap.addAttribute("face1")); + init_att_orb(m_att_orbits[0]); init_att_orb(m_att_orbits[1]); - init_att_orb(m_att_orbits[2]); - init_att_orb(m_att_orbits[3]); - init_att_orb(m_att_orbits[4]); - init_att_orb(m_att_orbits[5]); - init_att_orb(m_att_orbits[6]); - init_att_orb(m_att_orbits[7]); - init_att_orb(m_att_orbits[8]); middleDarts = myMap.addAttribute("middle"); diff --git a/include/Algo/Decimation/approximator.h b/include/Algo/Decimation/approximator.h index 3857d5eb1dbdfd556b4219fdfa5737626b1354e6..a2443aa79f585c0f7722990ce6684f77af89f6fe 100644 --- a/include/Algo/Decimation/approximator.h +++ b/include/Algo/Decimation/approximator.h @@ -87,13 +87,13 @@ public: protected: Predictor* m_predictor ; - AttributeHandler& m_attrV ; // vertex attribute to be approximated - AttributeHandler m_approx ; // attribute to store approximation result - AttributeHandler m_detail ; // attribute to store detail information for reconstruction + VertexAttribute& m_attrV ; // vertex attribute to be approximated + EdgeAttribute m_approx ; // attribute to store approximation result + EdgeAttribute m_detail ; // attribute to store detail information for reconstruction T m_app ; public: - Approximator(MAP& m, AttributeHandler& a, Predictor* predictor) : + Approximator(MAP& m, VertexAttribute& a, Predictor* predictor) : ApproximatorGen(m), m_predictor(predictor), m_attrV(a) { std::stringstream aname ; diff --git a/include/Algo/Decimation/decimation.hpp b/include/Algo/Decimation/decimation.hpp index 4f35c408057dfd72ec2063e4f7784294041d8862..91b350475dc324e14ea9eea1b39b790e79797a6e 100644 --- a/include/Algo/Decimation/decimation.hpp +++ b/include/Algo/Decimation/decimation.hpp @@ -68,28 +68,28 @@ void decimate( approximators.push_back(new Approximator_QEMhalfEdge(map, position)) ; /* PFP::TVEC3 frame[3] ; - frame[0] = map.template getAttribute(VERTEX, "frame_T") ; // Tangent - frame[1] = map.template getAttribute(VERTEX, "frame_B") ; // Bitangent - frame[2] = map.template getAttribute(VERTEX, "frame_N") ; // Normal + frame[0] = map.template getAttribute("frame_T") ; // Tangent + frame[1] = map.template getAttribute("frame_B") ; // Bitangent + frame[2] = map.template getAttribute("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 ; } - AttributeHandler colorPTM[6] ; - colorPTM[0] = map.template getAttribute(VERTEX, "colorPTM_a") ; - colorPTM[1] = map.template getAttribute(VERTEX, "colorPTM_b") ; - colorPTM[2] = map.template getAttribute(VERTEX, "colorPTM_c") ; - colorPTM[3] = map.template getAttribute(VERTEX, "colorPTM_d") ; - colorPTM[4] = map.template getAttribute(VERTEX, "colorPTM_e") ; - colorPTM[5] = map.template getAttribute(VERTEX, "colorPTM_f") ; + VertexAttribute colorPTM[6] ; + colorPTM[0] = map.template getAttribute("colorPTM_a") ; + colorPTM[1] = map.template getAttribute("colorPTM_b") ; + colorPTM[2] = map.template getAttribute("colorPTM_c") ; + colorPTM[3] = map.template getAttribute("colorPTM_d") ; + colorPTM[4] = map.template getAttribute("colorPTM_e") ; + colorPTM[5] = map.template getAttribute("colorPTM_f") ; for (unsigned int i = 0 ; i < 6 ; ++i) if (!colorPTM[i].isValid()) { CGoGNerr << "In function decimate : colorPTM[" << i << "] is not valid" << CGoGNendl ; } */ - AttributeHandler, VERTEX> frame = map.template getAttribute, VERTEX>("frame") ; - AttributeHandler, VERTEX> RGBfunctions = map.template getAttribute, VERTEX>("colorPTM") ; + VertexAttribute > frame = map.template getAttribute, VERTEX>("frame") ; + VertexAttribute > RGBfunctions = map.template getAttribute, VERTEX>("colorPTM") ; approximators.push_back(new Approximator_Frame(map, frame)) ; approximators.push_back(new Approximator_RGBfunctions(map, RGBfunctions)) ; break ; @@ -97,8 +97,8 @@ void decimate( case A_LightfieldHalf : { approximators.push_back(new Approximator_HalfCollapse(map, position)) ; - AttributeHandler, VERTEX> frame = map.template getAttribute, VERTEX>("frame") ; - AttributeHandler, VERTEX> RGBfunctions = map.template getAttribute, VERTEX>("colorPTM") ; + VertexAttribute > frame = map.template getAttribute, VERTEX>("frame") ; + VertexAttribute > RGBfunctions = map.template getAttribute, VERTEX>("colorPTM") ; approximators.push_back(new Approximator_FrameHalf(map, frame)) ; approximators.push_back(new Approximator_RGBfunctionsHalf(map, RGBfunctions)) ; break ; diff --git a/include/Algo/Decimation/edgeSelector.h b/include/Algo/Decimation/edgeSelector.h index 86da0a5936d61707d63ee2e6f4dc32e2807be22d..4b007d37d25b218dfad7e84a76c9b4199641cb42 100644 --- a/include/Algo/Decimation/edgeSelector.h +++ b/include/Algo/Decimation/edgeSelector.h @@ -111,7 +111,7 @@ private: } LengthEdgeInfo ; typedef NoMathIOAttribute EdgeInfo ; - AttributeHandler edgeInfo ; + EdgeAttribute edgeInfo ; std::multimap edges ; typename std::multimap::iterator cur ; @@ -154,8 +154,8 @@ private: } QEMedgeInfo ; typedef NoMathIOAttribute EdgeInfo ; - AttributeHandler edgeInfo ; - AttributeHandler, VERTEX> quadric ; + EdgeAttribute edgeInfo ; + VertexAttribute > quadric ; Quadric tmpQ ; std::multimap edges ; @@ -203,8 +203,8 @@ private: } QEMedgeInfo ; typedef NoMathIOAttribute EdgeInfo ; - AttributeHandler edgeInfo ; - AttributeHandler, VERTEX> quadric ; + EdgeAttribute edgeInfo ; + VertexAttribute > quadric ; std::multimap edges ; typename std::multimap::iterator cur ; @@ -256,7 +256,7 @@ private: REAL radius ; VertexAttribute normal ; - AttributeHandler edgeInfo ; + EdgeAttribute edgeInfo ; EdgeAttribute edgeangle ; VertexAttribute kmax ; VertexAttribute kmin ; @@ -347,7 +347,7 @@ private: } MinDetailEdgeInfo ; typedef NoMathIOAttribute EdgeInfo ; - AttributeHandler edgeInfo ; + EdgeAttribute edgeInfo ; std::multimap edges ; typename std::multimap::iterator cur ; diff --git a/include/Algo/Decimation/geometryApproximator.h b/include/Algo/Decimation/geometryApproximator.h index 88ee0d22c5097db525418b5850db7437759ff66b..8793560203856fc0c864177a40168b84f416ef2b 100644 --- a/include/Algo/Decimation/geometryApproximator.h +++ b/include/Algo/Decimation/geometryApproximator.h @@ -45,7 +45,7 @@ public: typedef typename PFP::REAL REAL ; protected: - AttributeHandler, VERTEX> m_quadric ; + VertexAttribute > m_quadric ; public: Approximator_QEM(MAP& m, VertexAttribute& pos, Predictor* pred = NULL) : @@ -67,7 +67,7 @@ public: typedef typename PFP::REAL REAL ; protected: - AttributeHandler, VERTEX> m_quadric ; + VertexAttribute > m_quadric ; public: Approximator_QEMhalfEdge(MAP& m, VertexAttribute& pos, Predictor* pred = NULL) : diff --git a/include/Algo/Decimation/halfEdgeSelector.h b/include/Algo/Decimation/halfEdgeSelector.h index 8cdd65e222abeb07c567c0298753c0ea17d9ef95..26794b0d99784de86c7b739e58e1f11157835d7f 100644 --- a/include/Algo/Decimation/halfEdgeSelector.h +++ b/include/Algo/Decimation/halfEdgeSelector.h @@ -53,8 +53,8 @@ private: } QEMhalfEdgeInfo ; typedef NoMathIOAttribute HalfEdgeInfo ; - AttributeHandler halfEdgeInfo ; - AttributeHandler, VERTEX> quadric ; + DartAttribute halfEdgeInfo ; + VertexAttribute > quadric ; std::multimap halfEdges ; typename std::multimap::iterator cur ; @@ -105,11 +105,11 @@ private: } LightfieldHalfEdgeInfo ; typedef NoMathIOAttribute HalfEdgeInfo ; - AttributeHandler m_frame ; + VertexAttribute m_frame ; - AttributeHandler halfEdgeInfo ; - AttributeHandler, VERTEX> quadric ; - AttributeHandler, EDGE> quadricRGBfunctions ; + DartAttribute halfEdgeInfo ; + VertexAttribute > quadric ; + EdgeAttribute > quadricRGBfunctions ; std::multimap halfEdges ; typename std::multimap::iterator cur ; diff --git a/include/Algo/Decimation/lightfieldApproximator.h b/include/Algo/Decimation/lightfieldApproximator.h index 478e07e3fbd5c0009ca7d15701a66d7963810130..b4551e8bdfa6ee76401a3b62cdf5f65de18bb33b 100644 --- a/include/Algo/Decimation/lightfieldApproximator.h +++ b/include/Algo/Decimation/lightfieldApproximator.h @@ -49,7 +49,7 @@ public: typedef Geom::Matrix<3,6,REAL> MATRIX36 ; public: - Approximator_FrameHalf(MAP& m, AttributeHandler& frame, Predictor* pred = NULL) : + Approximator_FrameHalf(MAP& m, VertexAttribute& frame, Predictor* pred = NULL) : Approximator(m, frame, pred) {} ~Approximator_FrameHalf() @@ -71,12 +71,12 @@ public: typedef Geom::Matrix<3,6,REAL> MATRIX36 ; protected: - AttributeHandler m_frame ; - AttributeHandler m_approxFrame ; - AttributeHandler, EDGE> m_quadricRGBfunctions ; + VertexAttribute m_frame ; + EdgeAttribute m_approxFrame ; + EdgeAttribute> m_quadricRGBfunctions ; public: - Approximator_RGBfunctionsHalf(MAP& m, AttributeHandler& rgbfunctions, Predictor* pred = NULL) : + Approximator_RGBfunctionsHalf(MAP& m, VertexAttribute& rgbfunctions, Predictor* pred = NULL) : Approximator(m, rgbfunctions, pred) { } ~Approximator_RGBfunctionsHalf () @@ -102,7 +102,7 @@ protected: EdgeAttribute m_approxPosition ; public: - Approximator_Frame(MAP& m, AttributeHandler& frame, Predictor* pred = NULL) : + Approximator_Frame(MAP& m, VertexAttribute& frame, Predictor* pred = NULL) : Approximator(m, frame, pred) {} ~Approximator_Frame() @@ -124,12 +124,12 @@ public: typedef Geom::Matrix<3,6,REAL> MATRIX36 ; protected: - AttributeHandler m_frame ; - AttributeHandler m_approxFrame ; - AttributeHandler, EDGE> m_quadricRGBfunctions ; + VertexAttribute m_frame ; + EdgeAttribute m_approxFrame ; + EdgeAttribute> m_quadricRGBfunctions ; public: - Approximator_RGBfunctions(MAP& m, AttributeHandler& rgbfunctions, Predictor* pred = NULL) : + Approximator_RGBfunctions(MAP& m, VertexAttribute& rgbfunctions, Predictor* pred = NULL) : Approximator(m, rgbfunctions, pred) { } ~Approximator_RGBfunctions() diff --git a/include/Algo/Decimation/predictor.h b/include/Algo/Decimation/predictor.h index 6e9f36e7405249e1ef95ff278a6ad3bd4c6bed21..03ae2cf01b20d8754b6f67fecd19a9e520fa1fcd 100644 --- a/include/Algo/Decimation/predictor.h +++ b/include/Algo/Decimation/predictor.h @@ -75,11 +75,11 @@ public: typedef typename PFP::REAL REAL ; protected: - AttributeHandler& m_attrV ; // vertex attribute to be predicted + VertexAttribute& m_attrV ; // vertex attribute to be predicted std::vector m_predict ; // prediction results public: - Predictor(MAP& m, AttributeHandler& p) : + Predictor(MAP& m, VertexAttribute& p) : PredictorGen(m), m_attrV(p) {} diff --git a/include/Algo/DecimationVolumique/approximator.h b/include/Algo/DecimationVolumique/approximator.h index d52e0472cba75405c1f491d48e4866951a6cc3ab..afab75a69a89126581767df574391140bb4405b0 100644 --- a/include/Algo/DecimationVolumique/approximator.h +++ b/include/Algo/DecimationVolumique/approximator.h @@ -30,13 +30,13 @@ public: protected: MAP& m_map ; - typename PFP::TVEC3& m_position; + VertexAttribute& m_position; CGoGN::Algo::DecimationVolumique::Selector* m_selector; // VEC3 m_approx; public: - Approximator(MAP& m, typename PFP::TVEC3& pos): + Approximator(MAP& m, VertexAttribute& pos): m_map(m), m_position(pos) {} @@ -48,7 +48,6 @@ public: virtual void approximate(CGoGN::Algo::DecimationVolumique::Operator *op) = 0; }; - template class Approximator_Centroid : public Approximator { @@ -57,8 +56,8 @@ public: typedef typename PFP::VEC3 VEC3 ; typedef typename PFP::REAL REAL; - Approximator_Centroid(MAP& m, AttributeHandler& pos): - Approximator(m,pos) + Approximator_Centroid(MAP& m, VertexAttribute& pos): + Approximator(m, pos) {} ApproximatorType getType() { return A_Centroid; } @@ -67,9 +66,11 @@ public: } ; -} //end namespace DecimationVolumique -} //end namespace Algo -} //end namespace CGoGN +} // namespace DecimationVolumique + +} // namespace Algo + +} // namespace CGoGN #include "Algo/DecimationVolumique/approximator.hpp" diff --git a/include/Algo/DecimationVolumique/selector.h b/include/Algo/DecimationVolumique/selector.h index b74c85697797958fec12ec747f1269d01d950708..c720b2cfadb64457e2099bbeb7aef544a6d0b30a 100644 --- a/include/Algo/DecimationVolumique/selector.h +++ b/include/Algo/DecimationVolumique/selector.h @@ -259,7 +259,7 @@ private: typedef NoMathIOAttribute EdgeInfo ; - AttributeHandler edgeInfo ; + EdgeAttribute edgeInfo ; std::multimap edges ; typename std::multimap::iterator cur ; diff --git a/include/Algo/Filtering/average.h b/include/Algo/Filtering/average.h index 5044f018100e12dcd6cad9bf129bca55ddcf6728..41dad21cd8ae99bbe0c587040cb4d8a0dd109814 100644 --- a/include/Algo/Filtering/average.h +++ b/include/Algo/Filtering/average.h @@ -40,8 +40,8 @@ enum neighborhood { INSIDE = 1, BORDER = 2 }; template void filterAverageAttribute_OneRing( typename PFP::MAP& map, - const AttributeHandler& attIn, - AttributeHandler& attOut, + const VertexAttribute& attIn, + VertexAttribute& attOut, int neigh, const FunctorSelect& select = allDarts) { @@ -86,8 +86,8 @@ void filterAverageAttribute_OneRing( template void filterAverageVertexAttribute_WithinSphere( typename PFP::MAP& map, - const AttributeHandler& attIn, - AttributeHandler& attOut, + const VertexAttribute& attIn, + VertexAttribute& attOut, int neigh, VertexAttribute& position, typename PFP::REAL radius, @@ -128,8 +128,8 @@ void filterAverageVertexAttribute_WithinSphere( template void filterAverageEdgeAttribute_WithinSphere( typename PFP::MAP& map, - const AttributeHandler& attIn, - AttributeHandler& attOut, + const EdgeAttribute& attIn, + EdgeAttribute& attOut, int neigh, VertexAttribute& position, typename PFP::REAL radius, @@ -156,8 +156,8 @@ void filterAverageEdgeAttribute_WithinSphere( template void filterAverageFaceAttribute_WithinSphere( typename PFP::MAP& map, - const AttributeHandler& attIn, - AttributeHandler& attOut, + const FaceAttribute& attIn, + FaceAttribute& attOut, int neigh, VertexAttribute& position, typename PFP::REAL radius, diff --git a/include/Algo/Filtering/functors.h b/include/Algo/Filtering/functors.h index 28437fd46b4c812b8bfe38e6c04e0cdf7fed7ec8..54c9426536fdffc189b4b55ae6acd88f897e3b07 100644 --- a/include/Algo/Filtering/functors.h +++ b/include/Algo/Filtering/functors.h @@ -66,7 +66,7 @@ class FunctorAverageOnSphereBorder : public FunctorMap typedef typename PFP::VEC3 VEC3; protected: - const AttributeHandler& attr ; + const VertexAttribute& attr ; const VertexAttribute& position ; VEC3 center; typename PFP::REAL radius; diff --git a/include/Algo/Geometry/feature.h b/include/Algo/Geometry/feature.h index b019c9f6be5bdf6904a99e752d487b1fe925ab9c..37a7ef187c07d2b716d2ab68e81f474e32b0ae08 100644 --- a/include/Algo/Geometry/feature.h +++ b/include/Algo/Geometry/feature.h @@ -109,7 +109,7 @@ bool isTriangleRegular(typename PFP::MAP& map, Dart d, const VertexAttribute void initRidgeSegments( typename PFP::MAP& map, - AttributeHandler& ridge_segments, + FaceAttribute& ridge_segments, const FunctorSelect& select = allDarts, unsigned int thread = 0) ; @@ -119,7 +119,7 @@ void computeRidgeLines( CellMarker& regularMarker, const VertexAttribute& vertex_gradient, const VertexAttribute& K, - AttributeHandler& ridge_segments, + FaceAttribute& ridge_segments, const FunctorSelect& select = allDarts, unsigned int thread = 0) ; @@ -129,7 +129,7 @@ void ridgeLines( Dart d, const VertexAttribute& K, const VertexAttribute& vertex_gradient, - AttributeHandler& ridge_segments) ; + FaceAttribute& ridge_segments) ; template void computeExtremalities() ; @@ -138,7 +138,7 @@ template void computeSingularTriangle( typename PFP::MAP& map, CellMarker& regularMarker, - AttributeHandler& ridge_segments, + FaceAttribute& ridge_segments, const FunctorSelect& select = allDarts, unsigned int thread = 0) ; @@ -147,7 +147,7 @@ void singularTriangle( typename PFP::MAP& map, Dart d, CellMarker& regularMarker, - AttributeHandler& ridge_segments) ; + FaceAttribute& ridge_segments) ; template bool isEdgeInTriangle(typename PFP::MAP& map, Dart edge, Dart triangle) ; diff --git a/include/Algo/Geometry/feature.hpp b/include/Algo/Geometry/feature.hpp index ac051f62bb33fa917c475ec51cbf1b23453d34c9..3225fe20cf6555f3c75c4962afbcf8d7e4b631fb 100644 --- a/include/Algo/Geometry/feature.hpp +++ b/include/Algo/Geometry/feature.hpp @@ -58,7 +58,7 @@ void featureEdgeDetection( featureEdge.mark(d) ; } -// map.template removeAttribute(fNormal) ; +// map.removeAttribute(fNormal) ; } template @@ -238,7 +238,7 @@ bool isTriangleRegular(typename PFP::MAP& map, Dart d, const VertexAttribute void initRidgeSegments( typename PFP::MAP& map, - AttributeHandler& ridge_segments, + FaceAttribute& ridge_segments, const FunctorSelect& select, unsigned int thread) { @@ -253,7 +253,7 @@ void computeRidgeLines( CellMarker& regularMarker, const VertexAttribute& vertex_gradient, const VertexAttribute& K, - AttributeHandler& ridge_segments, + FaceAttribute& ridge_segments, const FunctorSelect& select, unsigned int thread) { @@ -271,7 +271,7 @@ void ridgeLines( Dart d, const VertexAttribute& K, const VertexAttribute& vertex_gradient, - AttributeHandler& ridge_segments) + FaceAttribute& ridge_segments) { typedef typename PFP::REAL REAL ; typedef typename PFP::VEC3 VEC3 ; @@ -349,7 +349,7 @@ template void computeSingularTriangle( typename PFP::MAP& map, CellMarker& regularMarker, - AttributeHandler& ridge_segments, + FaceAttribute& ridge_segments, const FunctorSelect& select, unsigned int thread) { @@ -366,7 +366,7 @@ void singularTriangle( typename PFP::MAP& map, Dart d, CellMarker& regularMarker, - AttributeHandler& ridge_segments) + FaceAttribute& ridge_segments) { int nbPoint = 0 ; diff --git a/include/Algo/Geometry/laplacian.h b/include/Algo/Geometry/laplacian.h index 34535ba513f87a01b33a541228751ffb8dcc2ff4..e5ec4f922fe7740ad1a1ab9587f48bbc8012ba38 100644 --- a/include/Algo/Geometry/laplacian.h +++ b/include/Algo/Geometry/laplacian.h @@ -40,7 +40,7 @@ template ATTR_TYPE computeLaplacianTopoVertex( typename PFP::MAP& map, Dart d, - const AttributeHandler& attr) ; + const VertexAttribute& attr) ; template ATTR_TYPE computeLaplacianCotanVertex( @@ -48,13 +48,13 @@ ATTR_TYPE computeLaplacianCotanVertex( Dart d, const EdgeAttribute& edgeWeight, const VertexAttribute& vertexArea, - const AttributeHandler& attr) ; + const VertexAttribute& attr) ; template void computeLaplacianTopoVertices( typename PFP::MAP& map, - const AttributeHandler& attr, - AttributeHandler& laplacian, + const VertexAttribute& attr, + VertexAttribute& laplacian, const FunctorSelect& select = allDarts) ; template @@ -62,8 +62,8 @@ void computeLaplacianCotanVertices( typename PFP::MAP& map, const EdgeAttribute& edgeWeight, const VertexAttribute& vertexArea, - const AttributeHandler& attr, - AttributeHandler& laplacian, + const VertexAttribute& attr, + VertexAttribute& laplacian, const FunctorSelect& select = allDarts) ; template diff --git a/include/Algo/Geometry/laplacian.hpp b/include/Algo/Geometry/laplacian.hpp index ea6ec247af5deae1fe5c4193460ce9543b1a9416..2392f31d892ab02c4b6b7280ace8a8580f8c1e32 100644 --- a/include/Algo/Geometry/laplacian.hpp +++ b/include/Algo/Geometry/laplacian.hpp @@ -39,7 +39,7 @@ template ATTR_TYPE computeLaplacianTopoVertex( typename PFP::MAP& map, Dart d, - const AttributeHandler& attr) + const VertexAttribute& attr) { ATTR_TYPE l(0) ; ATTR_TYPE value = attr[d] ; @@ -62,7 +62,7 @@ ATTR_TYPE computeLaplacianCotanVertex( Dart d, const EdgeAttribute& edgeWeight, const VertexAttribute& vertexArea, - const AttributeHandler& attr) + const VertexAttribute& attr) { ATTR_TYPE l(0) ; typename PFP::REAL vArea = vertexArea[d] ; @@ -84,8 +84,8 @@ ATTR_TYPE computeLaplacianCotanVertex( template void computeLaplacianTopoVertices( typename PFP::MAP& map, - const AttributeHandler& attr, - AttributeHandler& laplacian, + const VertexAttribute& attr, + VertexAttribute& laplacian, const FunctorSelect& select) { TraversorV t(map, select) ; @@ -98,8 +98,8 @@ void computeLaplacianCotanVertices( typename PFP::MAP& map, const EdgeAttribute& edgeWeight, const VertexAttribute& vertexArea, - const AttributeHandler& attr, - AttributeHandler& laplacian, + const VertexAttribute& attr, + VertexAttribute& laplacian, const FunctorSelect& select) { TraversorV t(map, select) ; diff --git a/include/Algo/ImplicitHierarchicalMesh/ihm.h b/include/Algo/ImplicitHierarchicalMesh/ihm.h index f0c19172f6de2825e3321f51a9ac56da663b65f0..958c05cb846853d0b8ef3f79b503d551c38b20ec 100644 --- a/include/Algo/ImplicitHierarchicalMesh/ihm.h +++ b/include/Algo/ImplicitHierarchicalMesh/ihm.h @@ -47,8 +47,8 @@ private: unsigned int m_maxLevel ; unsigned int m_idCount ; - AttributeHandler m_dartLevel ; - AttributeHandler m_edgeId ; + DartAttribute m_dartLevel ; + DartAttribute m_edgeId ; AttributeMultiVector* m_nextLevelCell[NB_ORBITS] ; diff --git a/include/Algo/ImplicitHierarchicalMesh/ihm3.h b/include/Algo/ImplicitHierarchicalMesh/ihm3.h index 254acf55319b743d3087115edfa54bc3fcfc7f51..b2f9df88d0087d49593a0043316a339d0ac2d199 100644 --- a/include/Algo/ImplicitHierarchicalMesh/ihm3.h +++ b/include/Algo/ImplicitHierarchicalMesh/ihm3.h @@ -48,9 +48,9 @@ public: unsigned int m_edgeIdCount ; unsigned int m_faceIdCount; - AttributeHandler m_dartLevel ; - AttributeHandler m_edgeId ; - AttributeHandler m_faceId ; + DartAttribute m_dartLevel ; + DartAttribute m_edgeId ; + DartAttribute m_faceId ; AttributeMultiVector* m_nextLevelCell[NB_ORBITS] ; diff --git a/include/Algo/Import/AHEMImporter.hpp b/include/Algo/Import/AHEMImporter.hpp index e054f18568f2a9bc35f6de0550a880a41e53cdac..a2cc962de5afd9edb481e9aa84d00b0566ffd169 100644 --- a/include/Algo/Import/AHEMImporter.hpp +++ b/include/Algo/Import/AHEMImporter.hpp @@ -216,30 +216,24 @@ void AHEMImporter::LoadMesh() } } - template void AHEMImporter::LoadTopology() { // Allocate vertices - AttributeContainer& vxContainer = map->getAttributeContainer(VERTEX); - + AttributeContainer& vxContainer = map->template getAttributeContainer(); verticesId = new unsigned int[hdr.meshHdr.vxCount]; for(unsigned int i = 0 ; i < hdr.meshHdr.vxCount ; i++) verticesId[i] = vxContainer.insertLine(); - - // Ensure vertices are created by querying the position attribute - AttributeHandler position = map->template getAttribute(VERTEX, "position") ; + VertexAttribute position = map->template getAttribute("position") ; if (!position.isValid()) - position = map->template addAttribute(VERTEX, "position") ; - - + position = map->template addAttribute("position") ; // Read faces stream and create faces [only intra-face links] @@ -279,7 +273,6 @@ void AHEMImporter::LoadTopology() heId++; } - // last HE addedHE[heId].d = d; @@ -292,13 +285,11 @@ void AHEMImporter::LoadTopology() batch = (char*)ix; } - // Sort the HE for fast retrieval std::sort(addedHE, addedHE + hdr.meshHdr.heCount); - // Sew faces [inter-face links] for(unsigned int i = 0 ; i < hdr.meshHdr.heCount ; i++) @@ -310,16 +301,13 @@ void AHEMImporter::LoadTopology() } } - - template void AHEMImporter::LoadPosition(AHEMAttributeDescriptor* posDescr) { - AttributeHandler position = map->template getAttribute(VERTEX, "position") ; + VertexAttribute position = map->template getAttribute("position") ; if (!position.isValid()) - position = map->template addAttribute(VERTEX, "position") ; - + position = map->template addAttribute("position") ; f.seekg(posDescr->fileStartOffset, std::ios_base::beg); f.read(buffer, posDescr->attributeChunkSize); @@ -333,8 +321,6 @@ void AHEMImporter::LoadPosition(AHEMAttributeDescriptor* posDescr) } } - - template bool AHEMImporter::LoadAttribute(unsigned int attrIx, const char* attrName, const AttributeImporter* imp) { @@ -343,13 +329,11 @@ bool AHEMImporter::LoadAttribute(unsigned int attrIx, const char* attrName, AHEMAttributeDescriptor* ad = attrDesc + attrIx; - // Fill buffer from file data f.seekg(ad->fileStartOffset, std::ios_base::beg); f.read(buffer, ad->attributeChunkSize); - // Import attribute imp->ImportAttribute(*map, verticesId, facesId, &hdr, attrName, ad, buffer); @@ -357,8 +341,6 @@ bool AHEMImporter::LoadAttribute(unsigned int attrIx, const char* attrName, return true; } - - template bool AHEMImporter::LoadAttribute(const GUID& semantic, const char* attrName) { @@ -381,13 +363,11 @@ bool AHEMImporter::LoadAttribute(const GUID& semantic, const char* attrName AttributeImporter* imp = impList[0]; - // Fill buffer from file data f.seekg(ad->fileStartOffset, std::ios_base::beg); f.read(buffer, ad->attributeChunkSize); - // Import attribute imp->ImportAttribute(*map, verticesId, facesId, &hdr, name, ad, buffer); @@ -395,7 +375,6 @@ bool AHEMImporter::LoadAttribute(const GUID& semantic, const char* attrName return true; } - template void AHEMImporter::LoadAllAttributes(bool* status) { @@ -411,14 +390,12 @@ void AHEMImporter::LoadAllAttributes(bool* status) } } - template unsigned int AHEMImporter::GetAttributesNum() { return hdr.attributesChunkNumber; } - template void AHEMImporter::GetAttribute(AHEMAttributeDescriptor** ad, char** attrName, unsigned int ix) { @@ -434,7 +411,6 @@ void AHEMImporter::GetAttribute(AHEMAttributeDescriptor** ad, char** attrNa } } - template unsigned int AHEMImporter::FindAttribute(const GUID& semantic) { @@ -445,8 +421,6 @@ unsigned int AHEMImporter::FindAttribute(const GUID& semantic) return ATTRIBUTE_NOTFOUND; } - - template std::vector*> AHEMImporter::FindImporters(const GUID& attrSemanticId) { @@ -457,12 +431,9 @@ std::vector*> AHEMImporter::FindImport if(ix == ATTRIBUTE_NOTFOUND) return ret; - return FindImporters(attrDesc + ix); } - - template std::vector*> AHEMImporter::FindImporters(const AHEMAttributeDescriptor* ad) { @@ -475,12 +446,10 @@ std::vector*> AHEMImporter::FindImport return ret; } - } // namespace Import } // namespace Algo } // namespace CGoGN - #include "Algo/Import/AHEMImporterDefAttr.hpp" diff --git a/include/Algo/Import/AHEMImporterDefAttr.hpp b/include/Algo/Import/AHEMImporterDefAttr.hpp index 4ae30440e277d13860321353a8150a0e6ac20dfd..46cc902e0d9f71b7fc130ef13ddd3ca718b4bf4e 100644 --- a/include/Algo/Import/AHEMImporterDefAttr.hpp +++ b/include/Algo/Import/AHEMImporterDefAttr.hpp @@ -34,14 +34,12 @@ namespace Algo namespace Import { - template bool UniversalLoader::Handleable(const AHEMAttributeDescriptor* ad) const { return AttrTypeLoader::Handleable(ad); } - template void UniversalLoader::ImportAttribute( MapType& map, const unsigned int* verticesId, @@ -74,15 +72,13 @@ void UniversalLoader::ImportAttribute( MapType& map, } } - template void UniversalLoader::UnpackOnVertex(MapType& map, const unsigned int* verticesId, const AHEMHeader* hdr, const char* attrName, const void* buffer) const { - AttributeHandler attr = map.template getAttribute(VERTEX, attrName); + VertexAttribute attr = map.template getAttribute(attrName); if (!attr.isValid()) - attr = map.template addAttribute(VERTEX, attrName); - + attr = map.template addAttribute(attrName); char* p = (char*)buffer; @@ -93,17 +89,14 @@ void UniversalLoader::UnpackOnVertex(MapType& map, cons } } - template void UniversalLoader:: UnpackOnFace(MapType& map, const Dart* facesId, const AHEMHeader* hdr, const char* attrName, const void* buffer) const { - AttributeHandler attr = map.template getAttribute(FACE, attrName); + FaceAttribute attr = map.template getAttribute, FACE(attrName); if (!attr.isValid()) attr = map.template addAttribute(FACE, attrName); - - char* p = (char*)buffer; for(unsigned int i = 0 ; i < hdr->meshHdr.faceCount ; i++) @@ -113,16 +106,13 @@ void UniversalLoader:: UnpackOnFace(MapType& map, const } } - template void UniversalLoader:: UnpackOnHE(MapType& map, const Dart* facesId, const AHEMHeader* hdr, const char* attrName, const void* buffer) const { - AttributeHandler attr = map.template getAttribute(DART, attrName); + DartAttribute attr = map.template getAttribute(attrName); if (!attr.isValid()) - attr = map.template addAttribute(DART, attrName); - - + attr = map.template addAttribute(attrName); char* p = (char*)buffer; @@ -141,15 +131,13 @@ void UniversalLoader:: UnpackOnHE(MapType& map, const D } } - template void UniversalLoader:: UnpackOnHEFC(MapType& map, const Dart* facesId, const AHEMHeader* hdr, const char* attrName, const void* buffer) const { - AttributeHandler attr = map.template getAttribute(DART, attrName); + DartAttribute attr = map.template getAttribute(attrName); if (!attr.isValid()) - attr = map.template addAttribute(DART, attrName); - + attr = map.template addAttribute(attrName); char* p = (char*)buffer; @@ -167,9 +155,6 @@ void UniversalLoader:: UnpackOnHEFC(MapType& map, const } } - - - /* * Final-glue code for universal parsing of * [float, float, float] -> Geom::Vector<3, float> @@ -177,8 +162,6 @@ void UniversalLoader:: UnpackOnHEFC(MapType& map, const * * Works with UniversalLoader */ - - class Vec3FloatLoader { public: @@ -198,9 +181,6 @@ public: }; - - - /* * Final-glue code for universal parsing of * [float]^16 -> Geom::Matrix<4, 4, float> (column-major order / OpenGL-style) @@ -208,8 +188,6 @@ public: * * Works with UniversalLoader */ - - class Mat44FloatLoader { public: @@ -251,8 +229,6 @@ public: } }; - - } // namespace Import } // namespace Algo diff --git a/include/Algo/Import/importMoka.hpp b/include/Algo/Import/importMoka.hpp index d1474504669ef1e17c9017a8e9e762bdf4c04673..675c9576c73e1f21eea20b0de5ceb3c8c30f7219 100644 --- a/include/Algo/Import/importMoka.hpp +++ b/include/Algo/Import/importMoka.hpp @@ -70,10 +70,10 @@ bool importMoka(typename PFP::MAP& gmap, const std::string& filename, std::vecto // ignore 2nd line std::getline (fp, ligne); - AttributeHandler att_beta0 = gmap.template getAttribute("beta0"); - AttributeHandler att_beta1 = gmap.template getAttribute("beta1"); - AttributeHandler att_beta2 = gmap.template getAttribute("beta2"); - AttributeHandler att_beta3 = gmap.template getAttribute("beta3"); + DartAttribute att_beta0 = gmap.template getAttribute("beta0"); + DartAttribute att_beta1 = gmap.template getAttribute("beta1"); + DartAttribute att_beta2 = gmap.template getAttribute("beta2"); + DartAttribute att_beta3 = gmap.template getAttribute("beta3"); std::map map_dart_emb; diff --git a/include/Algo/Import/importSvg.hpp b/include/Algo/Import/importSvg.hpp index 97f1c63cd6334548f32dde76b7b93f1ada0eb9dc..1e925789e63f60c8a74f96bce843beb9c7625eda 100644 --- a/include/Algo/Import/importSvg.hpp +++ b/include/Algo/Import/importSvg.hpp @@ -344,8 +344,8 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib } CellMarker brokenMark(map); - AttributeHandler edgeWidth = map.template addAttribute("width"); - AttributeHandler >, EDGE> edgePlanes = map.template addAttribute >, EDGE>("planes"); + EdgeAttribute edgeWidth = map.template addAttribute("width"); + EdgeAttribute > > edgePlanes = map.template addAttribute >, EDGE>("planes"); ///////////////////////////////////////////////////////////////////////////////////////////// //create broken lines diff --git a/include/Algo/LinearSolving/basic.h b/include/Algo/LinearSolving/basic.h index 0afe5fa05eef516b61febe0aa693ef68055b5bc2..bca942111fa4d2cd0db7fb4e215291ac0110843d 100644 --- a/include/Algo/LinearSolving/basic.h +++ b/include/Algo/LinearSolving/basic.h @@ -65,9 +65,9 @@ template void setupVariables( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler& index, + const VertexAttribute& index, CellMarker& lm, - const AttributeHandler& attr) + const VertexAttribute& attr) { FunctorMeshToSolver_Scalar fmts(s, index, lm, attr) ; m.template foreach_orbit(fmts) ; @@ -77,9 +77,9 @@ template void setupVariables( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler& index, + const VertexAttribute& index, CellMarker& lm, - const AttributeHandler& attr, + const VertexAttribute& attr, unsigned int coord) { FunctorMeshToSolver_Vector fmts(s, index, lm, attr, coord) ; @@ -104,8 +104,8 @@ template void addRowsRHS_Equality( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, const VertexAttribute& weight) { FunctorEquality_PerVertexWeight_Scalar ec(s, index, attr, weight) ; @@ -116,8 +116,8 @@ template void addRowsRHS_Equality( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, float weight) { FunctorEquality_UniformWeight_Scalar ec(s, index, attr, weight) ; @@ -128,8 +128,8 @@ template void addRowsRHS_Equality( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, const VertexAttribute& weight, unsigned int coord) { @@ -141,8 +141,8 @@ template void addRowsRHS_Equality( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, float weight, unsigned int coord) { @@ -158,7 +158,7 @@ template void addRows_Laplacian_Topo( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler index) + const VertexAttribute index) { FunctorLaplacianTopo flt(m, s, index) ; m.template foreach_orbit(flt) ; @@ -168,8 +168,8 @@ template void addRowsRHS_Laplacian_Topo( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler index, - const AttributeHandler& attr) + const VertexAttribute index, + const VertexAttribute& attr) { FunctorLaplacianTopoRHS_Scalar flt(m, s, index, attr) ; m.template foreach_orbit(flt) ; @@ -179,8 +179,8 @@ template void addRowsRHS_Laplacian_Topo( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler index, - const AttributeHandler& attr, + const VertexAttribute index, + const VertexAttribute& attr, unsigned int coord) { FunctorLaplacianTopoRHS_Vector flt(m, s, index, attr, coord) ; @@ -195,7 +195,7 @@ template void addRows_Laplacian_Cotan( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler index, + const VertexAttribute index, const EdgeAttribute& edgeWeight, const VertexAttribute& vertexArea) { @@ -207,10 +207,10 @@ template void addRowsRHS_Laplacian_Cotan( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler index, + const VertexAttribute index, const EdgeAttribute& edgeWeight, const VertexAttribute& vertexArea, - const AttributeHandler& attr) + const VertexAttribute& attr) { FunctorLaplacianCotanRHS_Scalar flc(m, s, index, edgeWeight, vertexArea, attr) ; m.template foreach_orbit(flc) ; @@ -220,10 +220,10 @@ template void addRowsRHS_Laplacian_Cotan( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler index, + const VertexAttribute index, const EdgeAttribute& edgeWeight, const VertexAttribute& vertexArea, - const AttributeHandler& attr, + const VertexAttribute& attr, unsigned int coord) { FunctorLaplacianCotanRHS_Vector flc(m, s, index, edgeWeight, vertexArea, attr, coord) ; @@ -268,8 +268,8 @@ template void getResult( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler index, - AttributeHandler& attr) + const VertexAttribute index, + VertexAttribute& attr) { FunctorSolverToMesh_Scalar fstm(s, index, attr) ; m.template foreach_orbit(fstm) ; @@ -279,8 +279,8 @@ template void getResult( typename PFP::MAP& m, LinearSolver* s, - const AttributeHandler index, - AttributeHandler& attr, + const VertexAttribute index, + VertexAttribute& attr, unsigned int coord) { FunctorSolverToMesh_Vector fstm(s, index, attr, coord) ; diff --git a/include/Algo/LinearSolving/matrixSetup.h b/include/Algo/LinearSolving/matrixSetup.h index c7e2db82278e6d9d9db7f1b7020551e5c3453c60..c10573fc9d88d547d00db8922f17aed5f09f3829 100644 --- a/include/Algo/LinearSolving/matrixSetup.h +++ b/include/Algo/LinearSolving/matrixSetup.h @@ -40,15 +40,15 @@ class FunctorEquality_PerVertexWeight_Scalar : public FunctorType { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; - const AttributeHandler& attrTable ; + const VertexAttribute& indexTable ; + const VertexAttribute& attrTable ; const VertexAttribute& weightTable ; public: FunctorEquality_PerVertexWeight_Scalar( LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, const VertexAttribute& weight ) : solver(s), indexTable(index), attrTable(attr), weightTable(weight) {} @@ -69,15 +69,15 @@ class FunctorEquality_UniformWeight_Scalar : public FunctorType { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; - const AttributeHandler& attrTable ; + const VertexAttribute& indexTable ; + const VertexAttribute& attrTable ; float weight ; public: FunctorEquality_UniformWeight_Scalar( LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, float w ) : solver(s), indexTable(index), attrTable(attr), weight(w) {} @@ -102,16 +102,16 @@ class FunctorEquality_PerVertexWeight_Vector : public FunctorType { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; - const AttributeHandler& attrTable ; + const VertexAttribute& indexTable ; + const VertexAttribute& attrTable ; const VertexAttribute& weightTable ; unsigned int coord ; public: FunctorEquality_PerVertexWeight_Vector( LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, const VertexAttribute& weight, unsigned int c ) : solver(s), indexTable(index), attrTable(attr), weightTable(weight), coord(c) @@ -133,16 +133,16 @@ class FunctorEquality_UniformWeight_Vector : public FunctorType { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; - const AttributeHandler& attrTable ; + const VertexAttribute& indexTable ; + const VertexAttribute& attrTable ; float weight ; unsigned int coord ; public: FunctorEquality_UniformWeight_Vector( LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, float w, unsigned int c ) : solver(s), indexTable(index), attrTable(attr), weight(w), coord(c) @@ -168,7 +168,7 @@ class FunctorLaplacianTopo : public FunctorMap { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; + const VertexAttribute& indexTable ; public: typedef typename PFP::MAP MAP ; @@ -177,7 +177,7 @@ public: FunctorLaplacianTopo( MAP& m, LinearSolver* s, - const AttributeHandler& index + const VertexAttribute& index ) : FunctorMap(m), solver(s), indexTable(index) {} @@ -209,8 +209,8 @@ class FunctorLaplacianTopoRHS_Scalar : public FunctorMap { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; - const AttributeHandler& attrTable ; + const VertexAttribute& indexTable ; + const VertexAttribute& attrTable ; public: typedef typename PFP::MAP MAP ; @@ -219,8 +219,8 @@ public: FunctorLaplacianTopoRHS_Scalar( MAP& m, LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr + const VertexAttribute& index, + const VertexAttribute& attr ) : FunctorMap(m), solver(s), indexTable(index), attrTable(attr) {} @@ -252,8 +252,8 @@ class FunctorLaplacianTopoRHS_Vector : public FunctorMap { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; - const AttributeHandler& attrTable ; + const VertexAttribute& indexTable ; + const VertexAttribute& attrTable ; unsigned int coord ; public: @@ -263,8 +263,8 @@ public: FunctorLaplacianTopoRHS_Vector( MAP& m, LinearSolver* s, - const AttributeHandler& index, - const AttributeHandler& attr, + const VertexAttribute& index, + const VertexAttribute& attr, unsigned int c ) : FunctorMap(m), solver(s), indexTable(index), attrTable(attr), coord(c) {} @@ -297,7 +297,7 @@ class FunctorLaplacianCotan : public FunctorMap { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; + const VertexAttribute& indexTable ; const EdgeAttribute& edgeWeight ; const VertexAttribute& vertexArea ; @@ -308,7 +308,7 @@ public: FunctorLaplacianCotan( MAP& m, LinearSolver* s, - const AttributeHandler& index, + const VertexAttribute& index, const EdgeAttribute& eWeight, const VertexAttribute& vArea ) : FunctorMap(m), solver(s), indexTable(index), edgeWeight(eWeight), vertexArea(vArea) @@ -346,10 +346,10 @@ class FunctorLaplacianCotanRHS_Scalar : public FunctorMap { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; + const VertexAttribute& indexTable ; const EdgeAttribute& edgeWeight ; const VertexAttribute& vertexArea ; - const AttributeHandler& attrTable ; + const VertexAttribute& attrTable ; public: typedef typename PFP::MAP MAP ; @@ -358,10 +358,10 @@ public: FunctorLaplacianCotanRHS_Scalar( MAP& m, LinearSolver* s, - const AttributeHandler& index, + const VertexAttribute& index, const EdgeAttribute& eWeight, const VertexAttribute& vArea, - const AttributeHandler& attr + const VertexAttribute& attr ) : FunctorMap(m), solver(s), indexTable(index), edgeWeight(eWeight), vertexArea(vArea), attrTable(attr) {} @@ -394,10 +394,10 @@ class FunctorLaplacianCotanRHS_Vector : public FunctorMap { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; + const VertexAttribute& indexTable ; const EdgeAttribute& edgeWeight ; const VertexAttribute& vertexArea ; - const AttributeHandler& attrTable ; + const VertexAttribute& attrTable ; unsigned int coord ; public: @@ -407,10 +407,10 @@ public: FunctorLaplacianCotanRHS_Vector( MAP& m, LinearSolver* s, - const AttributeHandler& index, + const VertexAttribute& index, const EdgeAttribute& eWeight, const VertexAttribute& vArea, - const AttributeHandler& attr, + const VertexAttribute& attr, unsigned int c ) : FunctorMap(m), solver(s), indexTable(index), edgeWeight(eWeight), vertexArea(vArea), attrTable(attr), coord(c) {} diff --git a/include/Algo/LinearSolving/variablesSetup.h b/include/Algo/LinearSolving/variablesSetup.h index 3e2f89298a55c18d8c5886f9657f7c9ba5a65982..0c41e8e0b287d521fb6abaf3be6a47364e7e8c6d 100644 --- a/include/Algo/LinearSolving/variablesSetup.h +++ b/include/Algo/LinearSolving/variablesSetup.h @@ -36,17 +36,17 @@ class FunctorMeshToSolver_Scalar : public FunctorType { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; + const VertexAttribute& indexTable ; CellMarker& lockingMarker ; - const AttributeHandler& attrTable ; + const VertexAttribute& attrTable ; bool lockedVertices ; public: FunctorMeshToSolver_Scalar( LinearSolver* s, - const AttributeHandler& index, + const VertexAttribute& index, CellMarker& lm, - const AttributeHandler& attr + const VertexAttribute& attr ) : solver(s), indexTable(index), lockingMarker(lm), attrTable(attr), lockedVertices(false) {} @@ -68,18 +68,18 @@ class FunctorMeshToSolver_Vector : public FunctorType { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; + const VertexAttribute& indexTable ; CellMarker& lockingMarker ; - const AttributeHandler& attrTable ; + const VertexAttribute& attrTable ; unsigned int coord ; bool lockedVertices ; public: FunctorMeshToSolver_Vector( LinearSolver* s, - const AttributeHandler& index, + const VertexAttribute& index, CellMarker& lm, - const AttributeHandler& attr, + const VertexAttribute& attr, unsigned int c ) : solver(s), indexTable(index), lockingMarker(lm), attrTable(attr), coord(c), lockedVertices(false) {} @@ -102,14 +102,14 @@ class FunctorSolverToMesh_Scalar : public FunctorType { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; - AttributeHandler& attrTable ; + const VertexAttribute& indexTable ; + VertexAttribute& attrTable ; public: FunctorSolverToMesh_Scalar( LinearSolver* s, - const AttributeHandler& index, - AttributeHandler& attr + const VertexAttribute& index, + VertexAttribute& attr ) : solver(s), indexTable(index), attrTable(attr) {} @@ -125,15 +125,15 @@ class FunctorSolverToMesh_Vector : public FunctorType { protected: LinearSolver* solver ; - const AttributeHandler& indexTable ; - AttributeHandler& attrTable ; + const VertexAttribute& indexTable ; + VertexAttribute& attrTable ; unsigned int coord ; public: FunctorSolverToMesh_Vector( LinearSolver* s, - const AttributeHandler& index, - AttributeHandler& attr, + const VertexAttribute& index, + VertexAttribute& attr, unsigned int c ) : solver(s), indexTable(index), attrTable(attr), coord(c) {} diff --git a/include/Algo/MC/marchingcube.h b/include/Algo/MC/marchingcube.h index c455e9f690e391b555e542f67dd61a9884e39c8e..71dc36fe57ed0c30baf158cbbcf3ce30291cf7dd 100644 --- a/include/Algo/MC/marchingcube.h +++ b/include/Algo/MC/marchingcube.h @@ -255,7 +255,7 @@ public: */ Geom::Vec3f boundMax() const { return m_Image->boundMax(); } - void removeFacesOfBoundary(AttributeHandler& boundVertices, unsigned int frameWidth); + void removeFacesOfBoundary(VertexAttribute& boundVertices, unsigned int frameWidth); void recalPoints(const Geom::Vec3f& origin); }; diff --git a/include/Algo/MC/marchingcube.hpp b/include/Algo/MC/marchingcube.hpp index 4fb835f7ae5242452078fd59fe1c5ca7dfddefb6..e2f71b1a37dde0e7c29df92b4e45ce58b1194b3a 100644 --- a/include/Algo/MC/marchingcube.hpp +++ b/include/Algo/MC/marchingcube.hpp @@ -1109,7 +1109,7 @@ void MarchingCube::createLocalFaces(const unsigned cha } template< typename DataType, template < typename D2 > class Windowing, typename PFP > -void MarchingCube::removeFacesOfBoundary(AttributeHandler& boundVertices, unsigned int frameWidth) +void MarchingCube::removeFacesOfBoundary(VertexAttribute& boundVertices, unsigned int frameWidth) { float xmin = frameWidth; float xmax = m_Image->getWidthX() - frameWidth -1; diff --git a/include/Algo/Modelisation/subdivision.hpp b/include/Algo/Modelisation/subdivision.hpp index 6c78443ea7442a8637de8747cdc798163f65e9e4..ea1c9169f0eb56d75462810d91aa1c98ad37fd62 100644 --- a/include/Algo/Modelisation/subdivision.hpp +++ b/include/Algo/Modelisation/subdivision.hpp @@ -520,28 +520,28 @@ void TwoNPlusOneSubdivision(typename PFP::MAP& map, EMBV& attributs, const Funct template void reverseOrientation(typename PFP::MAP& map) { - AttributeHandler emb0(&map, map.template getEmbeddingAttributeVector()) ; + DartAttribute emb0(&map, map.template getEmbeddingAttributeVector()) ; if(emb0.isValid()) { - AttributeHandler new_emb0 = map.template addAttribute("new_EMB_0") ; + DartAttribute new_emb0 = map.template addAttribute("new_EMB_0") ; for(Dart d = map.begin(); d != map.end(); map.next(d)) new_emb0[d] = emb0[map.phi1(d)] ; map.template swapAttributes(emb0, new_emb0) ; - map.template removeAttribute(new_emb0) ; + map.removeAttribute(new_emb0) ; } - AttributeHandler phi1 = map.template getAttribute("phi1") ; - AttributeHandler phi_1 = map.template getAttribute("phi_1") ; + DartAttribute phi1 = map.template getAttribute("phi1") ; + DartAttribute phi_1 = map.template getAttribute("phi_1") ; map.template swapAttributes(phi1, phi_1) ; } //template //void computeDual(typename PFP::MAP& map, const FunctorSelect& selected) //{ -// AttributeHandler phi1 = map.template getAttribute(DART, "phi1") ; -// AttributeHandler phi_1 = map.template getAttribute(DART, "phi_1") ; -// AttributeHandler new_phi1 = map.template addAttribute(DART, "new_phi1") ; -// AttributeHandler new_phi_1 = map.template addAttribute(DART, "new_phi_1") ; +// DartAttribute phi1 = map.template getAttribute("phi1") ; +// DartAttribute phi_1 = map.template getAttribute("phi_1") ; +// DartAttribute new_phi1 = map.template addAttribute("new_phi1") ; +// DartAttribute new_phi_1 = map.template addAttribute("new_phi_1") ; // // for(Dart d = map.begin(); d != map.end(); map.next(d)) // { @@ -553,8 +553,8 @@ void reverseOrientation(typename PFP::MAP& map) // map.template swapAttributes(phi1, new_phi1) ; // map.template swapAttributes(phi_1, new_phi_1) ; // -// map.template removeAttribute(new_phi1) ; -// map.template removeAttribute(new_phi_1) ; +// map.removeAttribute(new_phi1) ; +// map.removeAttribute(new_phi_1) ; // // map.swapEmbeddingContainers(VERTEX, FACE) ; // @@ -584,19 +584,19 @@ inline double sqrt3_K(unsigned int n) } //template -//void Sqrt3Subdivision(typename PFP::MAP& map, typename PFP::TVEC3& position, const FunctorSelect& selected) +//void Sqrt3Subdivision(typename PFP::MAP& map, VertexAttribute& position, const FunctorSelect& selected) //{ // typedef typename PFP::VEC3 VEC3 ; // typedef typename PFP::REAL REAL ; // -// AttributeHandler positionF = map.template getAttribute(FACE, "position") ; +// FaceAttribute positionF = map.template getAttribute("position") ; // if(!positionF.isValid()) -// positionF = map.template addAttribute(FACE, "position") ; +// positionF = map.template addAttribute("position") ; // Algo::Geometry::computeCentroidFaces(map, position, positionF) ; // // computeDual(map, selected); // -// AttributeHandler tmp = position ; +// VertexAttribute tmp = position ; // position = positionF ; // positionF = tmp ; // diff --git a/include/Algo/Render/GL2/topo3Render.h b/include/Algo/Render/GL2/topo3Render.h index 5eceefb277e725a9e0a9595cb6ca2b67f76b40b2..5772c48dc61b39fbad8023abecbbeb3f3b5f5433 100644 --- a/include/Algo/Render/GL2/topo3Render.h +++ b/include/Algo/Render/GL2/topo3Render.h @@ -122,14 +122,13 @@ protected: /** * attribute index to get easy correspondence dart/color */ - AttributeHandler m_attIndex; + DartAttribute m_attIndex; /** * save colors */ void pushColors(); - /** * restore colors */ @@ -299,7 +298,7 @@ public: * @param good the selector */ template - void computeDartMiddlePositions(typename PFP::MAP& map, AttributeHandler& posExpl, const FunctorSelect& good = allDarts); + void computeDartMiddlePositions(typename PFP::MAP& map, DartAttribute& posExpl, const FunctorSelect& good = allDarts); /** * render to svg struct diff --git a/include/Algo/Render/GL2/topo3Render.hpp b/include/Algo/Render/GL2/topo3Render.hpp index 2287882596d859a82bc14aba798771248b58eb1a..c29793de36a305fe91579b156295512e39713a84 100644 --- a/include/Algo/Render/GL2/topo3Render.hpp +++ b/include/Algo/Render/GL2/topo3Render.hpp @@ -523,7 +523,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const VertexAttribute } template -void Topo3Render::computeDartMiddlePositions(typename PFP::MAP& map, AttributeHandler& posExpl, const FunctorSelect& good) +void Topo3Render::computeDartMiddlePositions(typename PFP::MAP& map, DartAttribute& posExpl, const FunctorSelect& good) { m_vbo0->bind(); typename PFP::VEC3* positionsPtr = reinterpret_cast(glMapBuffer(GL_ARRAY_BUFFER, GL_READ_ONLY)); @@ -615,13 +615,13 @@ void Topo3Render::computeDartMiddlePositions(typename PFP::MAP& map, AttributeHa // } // // // debut phi1 -// AutoAttributeHandler fv1(map, DART); +// DartAutoAttribute fv1(map); // // fin phi1 -// AutoAttributeHandler fv11(map, DART); +// DartAutoAttribute fv11(map); // // // phi2 -// AutoAttributeHandler fv2(map, DART); -// AutoAttributeHandler fv2x(map, DART); +// DartAutoAttribute fv2(map); +// DartAutoAttribute fv2x(map); // // m_vbo4->bind(); // glBufferData(GL_ARRAY_BUFFER, 2*m_nbDarts*sizeof(VEC3), 0, GL_STREAM_DRAW); diff --git a/include/Algo/Render/GL2/topoRender.h b/include/Algo/Render/GL2/topoRender.h index e349d78d5a41ea137b5b362b75447532c5994640..dc05bd30011ac9e1e2f788783250bd42213a7665 100644 --- a/include/Algo/Render/GL2/topoRender.h +++ b/include/Algo/Render/GL2/topoRender.h @@ -106,7 +106,7 @@ protected: /** * attribut d'index dans le VBO */ - AttributeHandler m_attIndex; + DartAttribute m_attIndex; Utils::ShaderSimpleColor* m_shader1; Utils::ShaderColorPerVertex* m_shader2; diff --git a/include/Topology/generic/mapBrowser.h b/include/Topology/generic/mapBrowser.h index 98c504edb94f61e457d49f627263a2078b849764..92ac92f4ab2e58cf0adb6a74894e9530e9d73d72 100644 --- a/include/Topology/generic/mapBrowser.h +++ b/include/Topology/generic/mapBrowser.h @@ -81,9 +81,9 @@ protected: MAP& m_map ; // The table attributes of links storing the linking - // The boolean autoAttribute is set if this attribut is managed by the browser + // The boolean autoAttribute is set if this attribute is managed by the browser bool autoAttribute ; - AttributeHandler m_links ; + DartAttribute m_links ; Dart m_first ; Dart m_end ; @@ -95,7 +95,7 @@ public: m_links = m.template addAttribute("") ; } - MapBrowserLinked(MAP& m, AttributeHandler& links) : + MapBrowserLinked(MAP& m, DartAttribute& links) : m_map(m), autoAttribute(false), m_links(links), m_first(NIL), m_end(NIL) { } @@ -103,7 +103,7 @@ public: ~MapBrowserLinked() { if (autoAttribute) - m_map.template removeAttribute(m_links) ; + m_map.removeAttribute(m_links) ; } void clear()