diff --git a/include/Algo/Decimation/edgeSelector.h b/include/Algo/Decimation/edgeSelector.h index d3313984640750151674ffa00f23daa0e961afc6..299c884db983bc9e0a9f40dac86f20f923d13c97 100644 --- a/include/Algo/Decimation/edgeSelector.h +++ b/include/Algo/Decimation/edgeSelector.h @@ -120,7 +120,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "LengthEdgeInfo" ; } } LengthEdgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; @@ -183,7 +183,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "QEMedgeInfo" ; } } QEMedgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; VertexAttribute > quadric ; @@ -235,7 +235,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "QEMedgeInfo" ; } } QEMedgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; VertexAttribute > quadric ; @@ -288,7 +288,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "NormalAreaEdgeInfo" ; } } NormalAreaEdgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; EdgeAttribute > edgeMatrix ; @@ -342,7 +342,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "CurvatureEdgeInfo" ; } } CurvatureEdgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; Geom::BoundingBox bb ; REAL radius ; @@ -442,7 +442,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "CurvatureTensorEdgeInfo" ; } } CurvatureTensorEdgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; EdgeAttribute edgeangle ; @@ -500,7 +500,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "MinDetailEdgeInfo" ; } } MinDetailEdgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; @@ -551,7 +551,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "ColorNaiveEdgeInfo" ; } } ColorNaiveedgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; VertexAttribute > m_quadric ; @@ -613,7 +613,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "GeomColOptGradEdgeInfo" ; } } ColorNaiveedgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; VertexAttribute > m_quadric ; @@ -695,7 +695,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "QEMextColorEdgeInfo" ; } } QEMextColorEdgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; VertexAttribute > m_quadric ; diff --git a/include/Algo/Decimation/halfEdgeSelector.h b/include/Algo/Decimation/halfEdgeSelector.h index 75e7913279ec80c5f5e814b84f08769525ae3584..fdb5952ead774a19ba76445f15e28862fe648b1b 100644 --- a/include/Algo/Decimation/halfEdgeSelector.h +++ b/include/Algo/Decimation/halfEdgeSelector.h @@ -57,7 +57,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "QEMhalfEdgeInfo" ; } } QEMhalfEdgeInfo ; - typedef NoMathIOAttribute HalfEdgeInfo ; + typedef NoTypeNameAttribute HalfEdgeInfo ; DartAttribute halfEdgeInfo ; VertexAttribute > quadric ; @@ -113,7 +113,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "QEMextColorHalfEdgeInfo" ; } } QEMextColorHalfEdgeInfo ; - typedef NoMathIOAttribute HalfEdgeInfo ; + typedef NoTypeNameAttribute HalfEdgeInfo ; DartAttribute halfEdgeInfo ; VertexAttribute > m_quadric ; @@ -200,7 +200,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "ColorExperimentalHalfEdgeInfo" ; } } QEMextColorHalfEdgeInfo ; - typedef NoMathIOAttribute HalfEdgeInfo ; + typedef NoTypeNameAttribute HalfEdgeInfo ; DartAttribute halfEdgeInfo ; VertexAttribute > m_quadric ; diff --git a/include/Algo/Decimation/simplifMesh.h b/include/Algo/Decimation/simplifMesh.h index 20be0f1c3febb973776503cba0fb9c75f20af98c..8b2b1a2671302a6db36f773e516c83289a53a204 100644 --- a/include/Algo/Decimation/simplifMesh.h +++ b/include/Algo/Decimation/simplifMesh.h @@ -298,7 +298,7 @@ private: typedef typename std::multimap::iterator CRIT_IT; - typedef NoMathIONameAttribute CRIT_IT_ATT; + typedef NoTypeNameAttribute CRIT_IT_ATT; // attribut d'arĂȘte AutoAttributeHandler m_edgeEmb; diff --git a/include/Algo/DecimationVolumes/edgeSelector.h b/include/Algo/DecimationVolumes/edgeSelector.h index aaadf1a38c7f72ef03d209c05a65f3e78f1baa69..f4aac066e813236a757c85ce10f02055d25e9c6c 100644 --- a/include/Algo/DecimationVolumes/edgeSelector.h +++ b/include/Algo/DecimationVolumes/edgeSelector.h @@ -101,7 +101,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "LengthEdgeInfo" ; } } LengthEdgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; @@ -151,7 +151,7 @@ private: bool valid ; static std::string CGoGNnameOfType() { return "SG98edgeInfo" ; } } SG98edgeInfo ; - typedef NoMathIOAttribute EdgeInfo ; + typedef NoTypeNameAttribute EdgeInfo ; EdgeAttribute edgeInfo ; diff --git a/include/Algo/Geometry/centroid.h b/include/Algo/Geometry/centroid.h index e36af8576684a7bca0d6a7ada900915298eb44e1..ad00416037793e267c2cbb4feace0caafbddeee6 100644 --- a/include/Algo/Geometry/centroid.h +++ b/include/Algo/Geometry/centroid.h @@ -26,7 +26,6 @@ #define __ALGO_GEOMETRY_CENTROID_H__ #include "Geometry/basic.h" -#include "Topology/generic/attribops.h" namespace CGoGN { diff --git a/include/Algo/Geometry/feature.h b/include/Algo/Geometry/feature.h index 47abea2da03f047f8d007ca757a35f1e4feef1da..52aa1152bb8685dd0eca3dec73bc49efa05ca7c8 100644 --- a/include/Algo/Geometry/feature.h +++ b/include/Algo/Geometry/feature.h @@ -47,7 +47,7 @@ enum typedef struct { Dart d ; float w ; } e0point ; typedef struct { e0point p1 ; e0point p2 ; unsigned char type ; } e0segment ; -typedef NoMathIONameAttribute ridgeSegment ; +typedef NoTypeNameAttribute ridgeSegment ; template void featureEdgeDetection( diff --git a/include/Algo/Geometry/voronoiDiagrams.h b/include/Algo/Geometry/voronoiDiagrams.h index 2deb033167b9b2383cd10f6fa62568113c05036a..d512b04391156a69ab2f99bff08b03bd46957a02 100644 --- a/include/Algo/Geometry/voronoiDiagrams.h +++ b/include/Algo/Geometry/voronoiDiagrams.h @@ -34,7 +34,7 @@ protected : Dart pathOrigin; static std::string CGoGNnameOfType() { return "VoronoiVertexInfo" ; } } VoronoiVertexInfo ; - typedef NoMathIOAttribute VertexInfo ; + typedef NoTypeNameAttribute VertexInfo ; typename PFP::MAP& map; const EdgeAttribute& edgeCost; // weights on the graph edges diff --git a/include/Algo/Import/importMRDAT.hpp b/include/Algo/Import/importMRDAT.hpp index bcb91a0adbcabffe6ba54a0b01cc166e681b5b99..a84f26ee4c8bbc77e71415735db3bdb72cecbbc3 100644 --- a/include/Algo/Import/importMRDAT.hpp +++ b/include/Algo/Import/importMRDAT.hpp @@ -192,7 +192,7 @@ bool importMRDAT(typename PFP::MAP& map, const std::string& filename, std::vecto std::cout << " Create base level mesh.." << std::flush ; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents") ; + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents") ; DartMarkerNoUnmark m(map) ; unsigned nbf = qt.roots.size() ; diff --git a/include/Algo/Import/importMSH.hpp b/include/Algo/Import/importMSH.hpp index 3607c3b2896d3710975859678f4264ecb5a1c269..cca58c69dcfab0eb1e9d9d43afab8e8dbf1e4956 100644 --- a/include/Algo/Import/importMSH.hpp +++ b/include/Algo/Import/importMSH.hpp @@ -49,7 +49,7 @@ bool importMSH(typename PFP::MAP& map, const std::string& filename, std::vector< AttributeContainer& container = map.template getAttributeContainer() ; unsigned int m_nbVertices = 0, m_nbVolumes = 0; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); //open file std::ifstream fp(filename.c_str(), std::ios::in); diff --git a/include/Algo/Import/importMesh.hpp b/include/Algo/Import/importMesh.hpp index e5b3345756c49f64c996df2a378fc346a2806288..2b1785e3a09361d2143099c037d5f51b22329a16 100644 --- a/include/Algo/Import/importMesh.hpp +++ b/include/Algo/Import/importMesh.hpp @@ -42,7 +42,7 @@ namespace Import template bool importMesh(typename PFP::MAP& map, MeshTablesSurface& mts) { - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); unsigned nbf = mts.getNbFaces(); int index = 0; @@ -159,7 +159,7 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector template bool importMeshSAsV(typename PFP::MAP& map, MeshTablesSurface& mts) { - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); unsigned nbf = mts.getNbFaces(); int index = 0; @@ -273,7 +273,7 @@ namespace Import template bool importMeshSToV(typename PFP::MAP& map, Surface::Import::MeshTablesSurface& mts, float dist) { - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); unsigned nbf = mts.getNbFaces(); int index = 0; // buffer for tempo faces (used to remove degenerated edges) @@ -379,7 +379,7 @@ bool importMeshSToV(typename PFP::MAP& map, Surface::Import::MeshTablesSurface

bool importMeshSurfToVol(typename PFP::MAP& map, Surface::Import::MeshTablesSurface& mts, float scale, unsigned int nbStage) { - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map); unsigned nbf = mts.getNbFaces(); int index = 0; // buffer for tempo faces (used to remove degenerated edges) @@ -508,7 +508,7 @@ bool importMeshSurfToVol(typename PFP::MAP& map, Surface::Import::MeshTablesSurf template bool importMesh(typename PFP::MAP& map, MeshTablesVolume& mtv) { - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); return false; } diff --git a/include/Algo/Import/importNAS.hpp b/include/Algo/Import/importNAS.hpp index e0f3f10353aaaf46ae352f40f0c706f3f3c626ed..dc16d057eddbe4bc78ca11d168471282bf8cf1a5 100644 --- a/include/Algo/Import/importNAS.hpp +++ b/include/Algo/Import/importNAS.hpp @@ -76,7 +76,7 @@ bool importNAS(typename PFP::MAP& map, const std::string& filename, std::vector< AttributeContainer& container = map.template getAttributeContainer() ; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); //open file std::ifstream fp(filename.c_str(), std::ios::in); diff --git a/include/Algo/Import/importNodeEle.hpp b/include/Algo/Import/importNodeEle.hpp index 7f8e4dac84efc7adcb4cd3b70ad554dd0a967110..46fef001676fd61f0406233619921fb7e41db10d 100644 --- a/include/Algo/Import/importNodeEle.hpp +++ b/include/Algo/Import/importNodeEle.hpp @@ -50,7 +50,7 @@ bool importNodeWithELERegions(typename PFP::MAP& map, const std::string& filenam AttributeContainer& container = map.template getAttributeContainer() ; unsigned int m_nbVertices = 0, m_nbFaces = 0, m_nbEdges = 0, m_nbVolumes = 0; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); //open file std::ifstream fnode(filenameNode.c_str(), std::ios::in); diff --git a/include/Algo/Import/importObjEle.hpp b/include/Algo/Import/importObjEle.hpp index 6f725edca2096dcf54eab437ba72307ea1d0171a..22c26e2edab0671847c5eda7e822e260e8f08da6 100644 --- a/include/Algo/Import/importObjEle.hpp +++ b/include/Algo/Import/importObjEle.hpp @@ -49,7 +49,7 @@ bool importOFFWithELERegions(typename PFP::MAP& map, const std::string& filename unsigned int m_nbVertices = 0, m_nbFaces = 0, m_nbEdges = 0, m_nbVolumes = 0; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); // open files std::ifstream foff(filenameOFF.c_str(), std::ios::in); diff --git a/include/Algo/Import/importObjTex.hpp b/include/Algo/Import/importObjTex.hpp index 36de0bbb766964128901efed41809864e1f553ad..8d8f812092fee324312cb53b42f6136aaf24a6ed 100644 --- a/include/Algo/Import/importObjTex.hpp +++ b/include/Algo/Import/importObjTex.hpp @@ -673,9 +673,9 @@ bool OBJModel::import( const std::string& filename, std::vector fsetemb(m_map); - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(m_map, "incidents"); - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecNormIndPerVertex(m_map, "incidentsN"); - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecTCIndPerVertex(m_map, "incidentsTC"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(m_map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecNormIndPerVertex(m_map, "incidentsN"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecTCIndPerVertex(m_map, "incidentsTC"); unsigned int currentGroup = 0; diff --git a/include/Algo/Import/importSvg.hpp b/include/Algo/Import/importSvg.hpp index fb92cf136087b7839ee9b8ecf80eb7f41281693f..a2a8e738bfdfd54db009c60611fcbd4d36d33bf3 100644 --- a/include/Algo/Import/importSvg.hpp +++ b/include/Algo/Import/importSvg.hpp @@ -314,8 +314,8 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib CellMarker brokenMark(map); EdgeAttribute edgeWidth = map.template addAttribute("width"); - EdgeAttribute > > edgePlanes = map.template addAttribute >, EDGE>("planes"); - +// EdgeAttribute > > edgePlanes = map.template addAttribute >, EDGE>("planes"); + EdgeAttribute > > edgePlanes = map.template addAttribute >, EDGE>("planes"); ///////////////////////////////////////////////////////////////////////////////////////////// //create broken lines DartMarker brokenL(map); diff --git a/include/Algo/Import/importTet.hpp b/include/Algo/Import/importTet.hpp index ecb3f686fa11646f1ed0aef7267399dd51416b08..db80304b6a58ccab40c2c46d2511266c1d3c98f9 100644 --- a/include/Algo/Import/importTet.hpp +++ b/include/Algo/Import/importTet.hpp @@ -49,7 +49,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector< AttributeContainer& container = map.template getAttributeContainer() ; unsigned int m_nbVertices = 0, m_nbVolumes = 0; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); //open file std::ifstream fp(filename.c_str(), std::ios::in); diff --git a/include/Algo/Import/importTs.hpp b/include/Algo/Import/importTs.hpp index c1b545324c0a21fba5223adc062eb2029b3da816..b7abb99a966ca1be8935be492a17081228db6be1 100644 --- a/include/Algo/Import/importTs.hpp +++ b/include/Algo/Import/importTs.hpp @@ -54,7 +54,7 @@ bool importTs(typename PFP::MAP& map, const std::string& filename, std::vector() ; unsigned int m_nbVertices = 0, m_nbVolumes = 0; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); // open file std::ifstream fp(filename.c_str(), std::ios::in); diff --git a/include/Algo/Import/importVBGZ.hpp b/include/Algo/Import/importVBGZ.hpp index 5d96a86e5e1aca2c6098abb38469b7458f4f85e5..54aa20081dfc91db144f7c448a33ef7c70ca1ba7 100644 --- a/include/Algo/Import/importVBGZ.hpp +++ b/include/Algo/Import/importVBGZ.hpp @@ -48,7 +48,7 @@ bool importVBGZ(typename PFP::MAP& map, const std::string& filename, std::vector AttributeContainer& container = map.template getAttributeContainer() ; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); //open file igzstream fs(filename.c_str(), std::ios::in|std::ios::binary); diff --git a/include/Algo/Import/importVTU.hpp b/include/Algo/Import/importVTU.hpp index 4d2966391d93ee0ad5c6680732f1e66e3bf19b91..5d2062bbf57dfd5bd7815d1982da6d0e73710eda 100644 --- a/include/Algo/Import/importVTU.hpp +++ b/include/Algo/Import/importVTU.hpp @@ -53,7 +53,7 @@ bool importVTU(typename PFP::MAP& map, const std::string& filename, std::vector< AttributeContainer& container = map.template getAttributeContainer() ; - VertexAutoAttribute< NoMathIONameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); + VertexAutoAttribute< NoTypeNameAttribute< std::vector > > vecDartsPerVertex(map, "incidents"); xmlDocPtr doc = xmlReadFile(filename.c_str(), NULL, 0); xmlNodePtr vtu_node = xmlDocGetRootElement(doc); diff --git a/include/Algo/Modelisation/triangulation.h b/include/Algo/Modelisation/triangulation.h index 206f21a8d4938d999a5928a02adf418348574272..e1abb807b9f11039623c21c803cf28a22d2cda4d 100644 --- a/include/Algo/Modelisation/triangulation.h +++ b/include/Algo/Modelisation/triangulation.h @@ -58,7 +58,7 @@ protected: // multiset typedef for simple writing typedef std::multiset< VertexPoly,VertexPoly> VPMS; typedef typename VPMS::iterator VMPSITER; - typedef NoMathIONameAttribute EarAttr ; + typedef NoTypeNameAttribute EarAttr ; class VertexPoly { diff --git a/include/Algo/Selection/collector.h b/include/Algo/Selection/collector.h index 250482ba173c027cee49d33b6cae5607a309e5ff..10265280354aadac7e2f4dfde809e00850492e7f 100644 --- a/include/Algo/Selection/collector.h +++ b/include/Algo/Selection/collector.h @@ -436,7 +436,7 @@ protected: bool valid ; static std::string CGoGNnameOfType() { return "DijkstraVertexInfo" ; } } DijkstraVertexInfo ; - typedef NoMathIOAttribute VertexInfo ; + typedef NoTypeNameAttribute VertexInfo ; VertexAttribute vertexInfo ; @@ -483,7 +483,7 @@ protected: bool valid ; static std::string CGoGNnameOfType() { return "DijkstraVertexInfo" ; } } DijkstraVertexInfo ; - typedef NoMathIOAttribute VertexInfo ; + typedef NoTypeNameAttribute VertexInfo ; VertexAttribute vertexInfo ; diff --git a/include/Container/attributeContainer.h b/include/Container/attributeContainer.h index a4acb3e66008d12d547715bf6019cdccc8f2e698..867e034b600629b4f80a377b06c9a16e4c2a6a1e 100644 --- a/include/Container/attributeContainer.h +++ b/include/Container/attributeContainer.h @@ -404,112 +404,13 @@ public: template void setData(unsigned int attrIndex, unsigned int eltIndex, const T& data); - /************************************** - * ARITHMETIC OPERATIONS * - **************************************/ - - /** - * Toggle an attribute to process - * @param index index of attribute - */ - void toggleProcess(unsigned int index); - - /** - * Toggle an attribute to process - * @param index index of attribute - */ - void toggleNoProcess(unsigned int index); - - /** - * copy process attributes of line j in line i - * @param i line to modify - * @param j line to copy to i - */ - void affect(unsigned int i, unsigned int j); - - /** - * add process attributes of line j to line i - * @param i line to modify - * @param j line to add to i - */ - void add(unsigned int i, unsigned int j); - - /** - * sub process attributes of line j from line i - * @param i line to modify - * @param j line to sub from i - */ - void sub(unsigned int i, unsigned int j); - - /** - * multiy process attributes of line j by a scalar - * @param i line to multiply - * @param alpha scalar - */ - void mult(unsigned int i, double alpha); - - /** - * multiy process attributes of line j by a scalar - * @param i line to multiply - * @param alpha scalar - */ - void div(unsigned int i, double alpha); - /** - * interpole process attributes A_res = alpha*A_i + (1-alpha)*A_j - * @param res result line - * @param i first line - * @param j second line - * @param alpha coefficient of interpolation - */ - void lerp(unsigned res, unsigned int i, unsigned int j, double alpha); /************************************** * SAVE & LOAD * **************************************/ -protected: -// /** -// * load xmlpart of container -// */ -// bool loadXmlHB(xmlNodePtr node); - - /** - * load xmlpart of container - */ -// bool loadXmlBWF(xmlNodePtr node); - - /** - * load xmlpart of container - */ -// bool loadXmlAN(xmlNodePtr node, unsigned int nbb); - - /** - * load xmlpart of container - */ -// bool loadXmlDL(xmlNodePtr node); - public: - /** - * save Xml file - * @param writer a xmlTextWriterPtr obj - * @param id the id to save - */ -// void saveXml(xmlTextWriterPtr writer, unsigned int id); - - /** - * get id from xml node - * @param node the node of container node of xml tree - * @return the value of id of the node - */ -// static unsigned int getIdXmlNode(xmlNodePtr node); - - /** - * load from xml node - * @param node the node of container node of xml tree - */ -// bool loadXml(xmlNodePtr node); - /** * save binary file * @param fs a file stream diff --git a/include/Container/attributeContainer.hpp b/include/Container/attributeContainer.hpp index 935cd9557ce19f2149a5f6d9db7b6edb7c5d672f..7f42ea68908e1e801a4d5e3250bb07c78077c48f 100644 --- a/include/Container/attributeContainer.hpp +++ b/include/Container/attributeContainer.hpp @@ -396,76 +396,4 @@ inline void AttributeContainer::setData(unsigned int attrIndex, unsigned int elt atm->operator[](eltIndex) = data; } -/************************************** - * ARITHMETIC OPERATIONS * - **************************************/ - -inline void AttributeContainer::toggleProcess(unsigned int index) -{ - assert(index < m_tableAttribs.size() || !"toggleProcess: attribute index out of bounds"); - assert(m_tableAttribs[index] != NULL || !"toggleProcess: attribute does not exist"); - m_tableAttribs[index]->toggleProcess(); -} - -inline void AttributeContainer::toggleNoProcess(unsigned int index) -{ - assert(index < m_tableAttribs.size() || !"toggleNoProcess: attribute index out of bounds"); - assert(m_tableAttribs[index] != NULL || !"toggleNoProcess: attribute does not exist"); - m_tableAttribs[index]->toggleNoProcess(); -} - -inline void AttributeContainer::affect(unsigned int i, unsigned int j) -{ - for (std::vector::iterator it = m_tableAttribs.begin(); it!= m_tableAttribs.end(); ++it) - { - if (*it != NULL) - (*it)->affect(i, j); - } -} - -inline void AttributeContainer::add(unsigned int i, unsigned int j) -{ - for (std::vector::iterator it = m_tableAttribs.begin(); it!= m_tableAttribs.end(); ++it) - { - if ((*it) != NULL) - (*it)->add(i, j); - } -} - -inline void AttributeContainer::sub(unsigned int i, unsigned int j) -{ - for (std::vector::iterator it = m_tableAttribs.begin(); it!= m_tableAttribs.end(); ++it) - { - if ((*it) != NULL) - (*it)->sub(i, j); - } -} - -inline void AttributeContainer::mult(unsigned int i, double alpha) -{ - for (std::vector::iterator it = m_tableAttribs.begin(); it!= m_tableAttribs.end(); ++it) - { - if ((*it) != NULL) - (*it)->mult(i, alpha); - } -} - -inline void AttributeContainer::div(unsigned int i, double alpha) -{ - for (std::vector::iterator it = m_tableAttribs.begin(); it!= m_tableAttribs.end(); ++it) - { - if ((*it) != NULL) - (*it)->div(i, alpha); - } -} - -inline void AttributeContainer::lerp(unsigned res, unsigned int i, unsigned int j, double alpha) -{ - for (std::vector::iterator it = m_tableAttribs.begin(); it!= m_tableAttribs.end(); ++it) - { - if ((*it) != NULL) - (*it)->lerp(res, i, j, alpha); - } -} - } // namespace CGoGN diff --git a/include/Container/attributeMultiVector.h b/include/Container/attributeMultiVector.h index 4d842466e8de46c2fab30253b441471fbdc6301a..7011b58fc32f6555d96628d4d2e649d1ba15680c 100644 --- a/include/Container/attributeMultiVector.h +++ b/include/Container/attributeMultiVector.h @@ -159,54 +159,11 @@ public: virtual void overwrite(unsigned int src_b, unsigned int src_id, unsigned int dst_b, unsigned int dst_id) = 0; - /************************************** - * ARITHMETIC OPERATIONS * - **************************************/ - - void toggleProcess(); - - void toggleNoProcess(); - - bool toProcess(); - - /** - * copy attribute j on i - */ - virtual void affect(unsigned int i, unsigned int j) = 0; - - /** - * add attribute j to i - */ - virtual void add(unsigned int i, unsigned int j) = 0; - - /** - * sub attribute j from i - */ - virtual void sub(unsigned int i, unsigned int j) = 0; - - /** - * multiply attribute i by alpha - */ - virtual void mult(unsigned int i, double alpha) = 0; - - /** - * divide attribute i by alpha - */ - virtual void div(unsigned int i, double alpha) = 0; - - /** - * interpolate attribute i and j in res (with alpha coefficient) - */ - virtual void lerp(unsigned res, unsigned int i, unsigned int j, double alpha) = 0; /************************************** * SAVE & LOAD * **************************************/ - virtual std::string output(unsigned int i) = 0; - - virtual void input(unsigned int i,const std::string& st) = 0; - virtual void saveBin(CGoGNostream& fs, unsigned int id) = 0; static unsigned int loadBinInfos(CGoGNistream& fs, std::string& name, std::string& type); @@ -318,19 +275,6 @@ public: * SAVE & LOAD * **************************************/ - /** - * export en string d'un element - * @param i index de l'element a sortie - */ - std::string output(unsigned int i); - - /** - * import d'un element depuis une string - * @param i index de l'element a importer - * @param st string contenant l'element a importer - */ - void input(unsigned int i,const std::string& st); - /** * Sauvegarde binaire * @param fs filestream diff --git a/include/Container/attributeMultiVector.hpp b/include/Container/attributeMultiVector.hpp index 8668aac8591e2416660a0eee00b0df36f2ab0f37..042f0e8fca00851fe26b9e1aa1ed26eee340aed7 100644 --- a/include/Container/attributeMultiVector.hpp +++ b/include/Container/attributeMultiVector.hpp @@ -85,25 +85,6 @@ inline unsigned int AttributeMultiVectorGen::getBlockSize() return _BLOCKSIZE_ ; } -/************************************** - * ARITHMETIC OPERATIONS * - **************************************/ - -inline void AttributeMultiVectorGen::toggleProcess() -{ - m_toProcess = true; -} - -inline void AttributeMultiVectorGen::toggleNoProcess() -{ - m_toProcess = false; -} - -inline bool AttributeMultiVectorGen::toProcess() -{ - return m_toProcess; -} - /***************************************************************************************************/ /***************************************************************************************************/ @@ -321,82 +302,11 @@ void AttributeMultiVector::overwrite(unsigned int src_b, unsigned int src_id, m_tableData[dst_b][dst_id] = m_tableData[src_b][src_id]; } -/************************************** - * ARITHMETIC OPERATIONS * - **************************************/ - -template -void AttributeMultiVector::affect(unsigned int i, unsigned int j) -{ - if (m_toProcess) - m_tableData[i/_BLOCKSIZE_][i%_BLOCKSIZE_] = m_tableData[j/_BLOCKSIZE_][j%_BLOCKSIZE_]; -} - -template -void AttributeMultiVector::add(unsigned int i, unsigned int j) -{ - if (m_toProcess) - m_tableData[i/_BLOCKSIZE_][i%_BLOCKSIZE_] += m_tableData[j/_BLOCKSIZE_][j%_BLOCKSIZE_]; -} - -template -void AttributeMultiVector::sub(unsigned int i, unsigned int j) -{ - if (m_toProcess) - m_tableData[i/_BLOCKSIZE_][i%_BLOCKSIZE_] -= m_tableData[j/_BLOCKSIZE_][j%_BLOCKSIZE_]; -} - -template -void AttributeMultiVector::mult(unsigned int i, double alpha) -{ - if (m_toProcess) - m_tableData[i/_BLOCKSIZE_][i%_BLOCKSIZE_] *= alpha; -} - -template -void AttributeMultiVector::div(unsigned int i, double alpha) -{ - if (m_toProcess) - m_tableData[i/_BLOCKSIZE_][i%_BLOCKSIZE_] /= alpha; -} - -template -void AttributeMultiVector::lerp(unsigned res, unsigned int i, unsigned int j, double alpha) -{ - if (m_toProcess) - { - T v1 = m_tableData[i/_BLOCKSIZE_][i%_BLOCKSIZE_]; - T v2 = m_tableData[j/_BLOCKSIZE_][j%_BLOCKSIZE_]; - - v1 *= alpha; - v2 *= 1.0 - alpha; - v1 += v2; - m_tableData[res/_BLOCKSIZE_][res%_BLOCKSIZE_] = v1; - - CGoGNout << "LERP " << m_tableData[i/_BLOCKSIZE_][i%_BLOCKSIZE_] << " & " << m_tableData[j/_BLOCKSIZE_][j%_BLOCKSIZE_]; - CGoGNout << " = " << m_tableData[res/_BLOCKSIZE_][res%_BLOCKSIZE_] << CGoGNendl; - } -} /************************************** * SAVE & LOAD * **************************************/ -template -std::string AttributeMultiVector::output(unsigned int i) -{ - std::stringstream ss; - ss << m_tableData[i / _BLOCKSIZE_][i % _BLOCKSIZE_]; - return ss.str(); -} - -template -void AttributeMultiVector::input(unsigned int i,const std::string& st) -{ - std::stringstream ss(st); - ss >> m_tableData[i / _BLOCKSIZE_][i % _BLOCKSIZE_]; -} - template void AttributeMultiVector::saveBin(CGoGNostream& fs, unsigned int id) { diff --git a/include/Container/fakeAttribute.h b/include/Container/fakeAttribute.h index f6327a2151a72ce8edac975e9c684f1e7717ebcb..300767b125263296e571a00c6f3f127e45bbd80c 100644 --- a/include/Container/fakeAttribute.h +++ b/include/Container/fakeAttribute.h @@ -30,170 +30,20 @@ namespace CGoGN { -/** - * Ajoute tout ce qu'il faut a un type (std::string par exemple) - * qui n'a pas les operateurs += -= *= /= .. - * pour qu'il soit utilisable (ca compile!) - */ -template -class NoMathAttribute : public T -{ -public: - NoMathAttribute() : T() {} - NoMathAttribute(int i) : T() {} - - NoMathAttribute(const T& att): T(att) {} - NoMathAttribute& operator = (const T& fa) { return *this = NoMathAttribute(fa); } - - void operator += (const NoMathAttribute& fa) {} - void operator -= (const NoMathAttribute& fa) {} - void operator *= (double v) {} - void operator /= (double v) {} - T operator *(double v) const { return T(); } - - static std::string CGoGNnameOfType() { return nameOfType(T()); } -}; - -template -NoMathAttribute operator*(T /*a*/, const NoMathAttribute& /*v*/) -{ - return T(); -} - -/** - * Ajoute tout ce qu'il faut a un type (std::string par exemple) - * qui n'a pas les operateurs += -= *= /= - * ni la possibilité d'ajouter une fonction CGoGNnameOfType (std::vector<> par exemple) - * pour qu'il soit utilisable (ca compile!) - */ -template -class NoMathNameAttribute : public T -{ -public: - NoMathNameAttribute() : T() {} - NoMathNameAttribute(int /*i*/) : T() {} - - NoMathNameAttribute(const T& att): T(att) {} - NoMathNameAttribute& operator = (const T& fa) { return *this = NoMathNameAttribute(fa); } - - void operator += (const NoMathNameAttribute& /*fa*/) {} - void operator -= (const NoMathNameAttribute& /*fa*/) {} - void operator *= (double /*v*/) {} - void operator /= (double /*v*/) {} - T operator *(double v) const {return T();} - - static std::string CGoGNnameOfType() { return ""; } -}; - /** * Ajoute tout ce qu'il faut a un type * qui n'a pas de nom * pour qu'il soit utilisable (ca compile!) */ template -class NoNameAttribute : public T -{ -public: - NoNameAttribute() : T() {} - NoNameAttribute(int /*i*/) : T() {} - - NoNameAttribute(const T& att) : T(att) {} - NoNameAttribute& operator = (const T& fa) { return *this = NoNameAttribute(fa); } - - static std::string CGoGNnameOfType() { return ""; } -}; - -/** - * Ajoute tout ce qu'il faut a un type - * qui n'a pas les operateurs << et >> - * pour qu'il soit utilisable (ca compile!) - */ -template -class NoIOAttribute : public T +class NoTypeNameAttribute : public T { public: - NoIOAttribute() : T() {} - NoIOAttribute(int /*i*/) : T() {} - - NoIOAttribute(const T& att) : T(att) {} - NoIOAttribute& operator = (const T& fa) { return *this = NoIOAttribute(fa); } - - friend std::ostream& operator<<( std::ostream &out, const NoIOAttribute& /*fa*/ ) { return out ; } - friend const std::istream& operator>>( const std::istream &in, NoIOAttribute& /*fa*/ ) { return in ; } - - static std::string CGoGNnameOfType() { return nameOfType(T()); } -}; - -/** - * Ajoute tout ce qu'il faut a un type - * qui n'a pas de nom ni les operateurs << et >> - * pour qu'il soit utilisable (ca compile!) - */ -template -class NoNameIOAttribute : public T -{ -public: - NoNameIOAttribute() : T() {} - NoNameIOAttribute(int /*i*/) : T() {} - - NoNameIOAttribute(const T& att) : T(att) {} - NoNameIOAttribute& operator = (const T& fa) { return *this = NoNameIOAttribute(fa); } - - friend std::ostream& operator<<( std::ostream &out, const NoNameIOAttribute& /*fa*/ ) { return out ; } - friend const std::istream& operator>>( const std::istream &in, NoNameIOAttribute& /*fa*/ ) { return in ; } - - static std::string CGoGNnameOfType() { return ""; } -}; - -/** - * Ajoute tout ce qu'il faut a un type (std::string par exemple) - * qui n'a pas les operateurs += -= *= /= et << , >> - * pour qu'il soit utilisable (ca compile!) - */ -template -class NoMathIOAttribute : public T -{ -public: - NoMathIOAttribute() : T() {} - NoMathIOAttribute(int /*i*/) : T() {} - - NoMathIOAttribute(const T& att): T(att) {} - NoMathIOAttribute& operator = (const T& fa) { return *this = NoMathIOAttribute(fa); } - - friend std::ostream& operator<<( std::ostream &out, const NoMathIOAttribute& /*fa*/ ) { return out ; } - friend const std::istream& operator>>( const std::istream &in, NoMathIOAttribute& /*fa*/ ) { return in ; } - - void operator += (const NoMathIOAttribute& /*fa*/) {} - void operator -= (const NoMathIOAttribute& /*fa*/) {} - void operator *= (double /*v*/) {} - void operator /= (double /*v*/) {} - - static std::string CGoGNnameOfType() { return nameOfType(T());} -}; - -/** - * Ajoute tout ce qu'il faut a un type (std::string par exemple) - * qui n'a pas les operateurs += -= *= /= et << , >> - * ni la possibilité d'ajouter une fonction CGoGNnameOfType (std::vector<> par exemple) - * pour qu'il soit utilisable (ca compile!) - */ -template -class NoMathIONameAttribute: public T -{ -public: - NoMathIONameAttribute() : T() {} - NoMathIONameAttribute(int /*i*/) : T() {} - - NoMathIONameAttribute(const T& att) : T(att) {} - NoMathIONameAttribute& operator = (const T& fa) { return *this = NoMathIONameAttribute(fa); } - - friend std::ostream& operator<<( std::ostream &out, const NoMathIONameAttribute& /*fa*/ ) { return out ; } - friend const std::istream& operator>>( const std::istream &in, NoMathIONameAttribute& /*fa*/ ) { return in ; } + NoTypeNameAttribute() : T() {} + NoTypeNameAttribute(int /*i*/) : T() {} - void operator += (const NoMathIONameAttribute& /*fa*/) {} - void operator -= (const NoMathIONameAttribute& /*fa*/) {} - void operator *= (double /*v*/) {} - void operator /= (double /*v*/) {} + NoTypeNameAttribute(const T& att) : T(att) {} + NoTypeNameAttribute& operator = (const T& fa) { return *this = NoTypeNameAttribute(fa); } static std::string CGoGNnameOfType() { return ""; } }; diff --git a/include/Topology/generic/attribops.h b/include/Topology/generic/attribops.h deleted file mode 100644 index be7354a1cbda3ac5477d87e4d1751d546cde4a77..0000000000000000000000000000000000000000 --- a/include/Topology/generic/attribops.h +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* -* 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 ATTRIBOPS_H_ -#define ATTRIBOPS_H_ - -#include "Utils/cgognStream.h" - -namespace CGoGN -{ - -namespace AttribOps -{ - - -template -struct lerpStruct -{ - static X apply( X u, X v, double a) - { - return u*a + v*(1.0-a); - } -}; - -template -struct lerpStruct -{ - static typename PFP::EVERTEX apply(typename PFP::EVERTEX u, typename PFP::EVERTEX v, double a) - { - CGoGNout << "Static Lerp"<< CGoGNendl; - typename PFP::EVERTEX ec; - ec.lerp(u,v,a); - return ec; - } -}; - - -template < typename X, typename PFP> -X lerp( X u, X v, double a ) -{ - CGoGNout << "function Lerp"<< CGoGNendl; - return lerpStruct< X, PFP >::apply( u,v,a ); -} - - - -template -struct zeroStruct -{ - static X apply() - { - return X(0); - } -}; - -template -struct zeroStruct -{ - static typename PFP::EVERTEX apply() - { - typename PFP::EVERTEX ev; - ev.zero(); - return ev; - } -}; - - -template < typename X, typename PFP> -X zero() -{ - return zeroStruct< X, PFP >::apply(); -} - - -} // end namespace -} - - - - -#endif /* ATTRIBOPS_H_ */ diff --git a/include/Topology/generic/attributeHandler.h b/include/Topology/generic/attributeHandler.h index 63e1c04691d9edfadb8b9f5692752381bcb9c11c..648e3dd1f63ee70835402c9757e5a19dd6cba5b0 100644 --- a/include/Topology/generic/attributeHandler.h +++ b/include/Topology/generic/attributeHandler.h @@ -29,6 +29,7 @@ #include #include "Topology/generic/genericmap.h" +#include "Container/fakeAttribute.h" namespace CGoGN { @@ -230,6 +231,7 @@ public: DartAttribute& operator=(const AttributeHandler& ah) { this->AttributeHandler::operator=(ah); return *this; } }; + /** * shortcut class for Vertex Attribute (Handler) */ @@ -246,6 +248,7 @@ public: VertexAttribute& operator=(const AttributeHandler& ah) { this->AttributeHandler::operator=(ah); return *this; } }; + /** * shortcut class for Edge Attribute (Handler) */ @@ -259,6 +262,7 @@ public: EdgeAttribute& operator=(const AttributeHandler& ah) { this->AttributeHandler::operator=(ah); return *this; } }; + /** * shortcut class for Face Attribute (Handler) */ @@ -273,6 +277,7 @@ public: FaceAttribute& operator=(const AttributeHandler& ah) { this->AttributeHandler::operator=(ah); return *this; } }; + /** * shortcut class for Volume Attribute (Handler) */ diff --git a/include/Topology/generic/autoAttributeHandler.h b/include/Topology/generic/autoAttributeHandler.h index e271a0b19c2326916ef2bea95e7c5285d6330f38..5ce1d2ea7e59c3200527e0509d0fb5259cd3efb7 100644 --- a/include/Topology/generic/autoAttributeHandler.h +++ b/include/Topology/generic/autoAttributeHandler.h @@ -31,40 +31,6 @@ namespace CGoGN { -///** -// * Class that creates an access-table to an attribute -// * that is added especially. The attribute is removed when -// * the AutoAttributeHandler object is destroyed -// */ -//template -//class AutoAttributeHandler : public AttributeHandler -//{ -//public: -// /** -// * constructor -// * @param m the map -// * @param orbit the orbit of map -// * @param nameAttr the name of attribute -// * @param nameType the name of type of attribute -// */ -// AutoAttributeHandler(AttribMap& m, const std::string& nameAttr = "") -// { -// this->m_map = &m ; -// if(!m.isOrbitEmbedded()) -// m.addEmbedding() ; -// AttributeMultiVector* amv = this->m_map->m_attribs[ORBIT].template addAttribute(nameAttr) ; -// this->m_attrib = amv ; -// this->valid = true ; -// this->registerInMap() ; -// } -// -// ~AutoAttributeHandler() -// { -// if (this->valid) -// reinterpret_cast(this->m_map)->removeAttribute(*this) ; -// } -//} ; - /** * shortcut class for Dart AutoAttribute (Handler) @@ -191,6 +157,7 @@ public: } }; + } // namespace CGoGN #endif diff --git a/src/Container/attributeContainer.cpp b/src/Container/attributeContainer.cpp index b8b7a590ef6c0c0f6305a62da4f117d4fab9e569..20bf7062b5a23a37f6591dd5afe9a4a638966b11 100644 --- a/src/Container/attributeContainer.cpp +++ b/src/Container/attributeContainer.cpp @@ -748,10 +748,10 @@ void AttributeContainer::copyFrom(const AttributeContainer& cont) ptr->setIndex(m_tableAttribs.size()); ptr->setNbBlocks(cont.m_tableAttribs[i]->getNbBlocks()); ptr->copy(cont.m_tableAttribs[i]); - if (cont.m_tableAttribs[i]->toProcess()) - ptr->toggleProcess(); - else - ptr->toggleNoProcess(); + // if (cont.m_tableAttribs[i]->toProcess()) + // ptr->toggleProcess(); + // else + // ptr->toggleNoProcess(); m_tableAttribs.push_back(ptr); } }