Commit 652fa86d authored by Lionel Untereiner's avatar Lionel Untereiner

Merge branch 'develop' of icube-forge.unistra.fr:cgogn/cgogn into develop

parents e38ed6af 6471d0c6
...@@ -9,6 +9,29 @@ SET ( CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR} ) ...@@ -9,6 +9,29 @@ SET ( CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR} )
SET ( CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/ ) SET ( CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/ )
# ====== Check GCC VERSION FOR C++11 ======
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a gcc/g++ compiler with a version at least 4.8 is needed.")
endif()
endif()
# ====== Check CLANG VERSION FOR C++11 ======
if (APPLE)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION)
if (CLANG_VERSION VERSION_LESS 3.1)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a clang compiler with a version at least 3.1 is needed !!")
endif()
endif()
# ====== Check MSVC VERSION FOR C++11 ======
if(WIN32)
if(MSVC_VERSION LESS 1800)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a microsoft compiler with a version at least 12 is needed.")
endif()
endif()
IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release")) IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release"))
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug|(.*)DEBUG") IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug|(.*)DEBUG")
...@@ -58,7 +81,6 @@ ENDIF(WIN32) ...@@ -58,7 +81,6 @@ ENDIF(WIN32)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex REQUIRED) find_package(Boost COMPONENTS regex REQUIRED)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED) find_package(GLEW REQUIRED)
# MESSAGE HERE FOR MORE EASY USER READING # MESSAGE HERE FOR MORE EASY USER READING
...@@ -98,7 +120,6 @@ SET (CGoGN_EXT_INCLUDES ...@@ -98,7 +120,6 @@ SET (CGoGN_EXT_INCLUDES
${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
) )
...@@ -108,8 +129,8 @@ SET (CGoGN_EXT_LIBS ...@@ -108,8 +129,8 @@ SET (CGoGN_EXT_LIBS
${OPENGL_LIBRARY} ${OPENGL_LIBRARY}
${GLEW_LIBRARIES} ${GLEW_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
${Boost_REGEX_LIBRARY} ${Boost_REGEX_LIBRARY}
tinyxml2
) )
IF(WIN32) IF(WIN32)
......
...@@ -3,7 +3,7 @@ English version bellow ...@@ -3,7 +3,7 @@ English version bellow
Dépendences Linux Dépendences Linux
================= =================
installer les paquets suivants: installer les paquets suivants:
cmake cmake-curses-gui cmake-qt-gui libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev cmake cmake-curses-gui cmake-qt-gui libXi-dev libXmu-dev libglew-dev libtinyxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev
Pour compiler CGoGN Pour compiler CGoGN
......
...@@ -23,7 +23,6 @@ SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not wo ...@@ -23,7 +23,6 @@ SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not wo
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex system REQUIRED) find_package(Boost COMPONENTS regex system REQUIRED)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED) find_package(GLEW REQUIRED)
find_package(Qt4 REQUIRED) find_package(Qt4 REQUIRED)
find_package(QGLViewer REQUIRED) find_package(QGLViewer REQUIRED)
...@@ -73,7 +72,6 @@ SET (EXT_INCLUDES ...@@ -73,7 +72,6 @@ SET (EXT_INCLUDES
${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${QT_INCLUDE_DIR} ${QT_INCLUDE_DIR}
${QGLVIEWER_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR}
...@@ -86,17 +84,17 @@ SET (EXT_INCLUDES ...@@ -86,17 +84,17 @@ SET (EXT_INCLUDES
SET (EXT_LIBS SET (EXT_LIBS
PythonQt PythonQt
nl nl
${QGLVIEWER_LIBRARIES}
${OPENGL_LIBRARY} ${OPENGL_LIBRARY}
${GLEW_LIBRARIES} ${GLEW_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
${Boost_SYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY} ${Boost_REGEX_LIBRARY}
${QT_LIBRARIES} ${QT_LIBRARIES}
${QGLVIEWER_LIBRARIES}
${PYTHON_LIBRARIES} ${PYTHON_LIBRARIES}
${SUITESPARSE_LIBRARIES} ${SUITESPARSE_LIBRARIES}
# ${SUPERLU_LIBRARIES} # ${SUPERLU_LIBRARIES}
tinyxml2
) )
......
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
project(CGoGN_ThirdParty) project(CGoGN_ThirdParty)
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..) SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
IF(WIN32) IF(WIN32)
...@@ -36,6 +39,7 @@ ENDIF(WIN32) ...@@ -36,6 +39,7 @@ ENDIF(WIN32)
SET (BUILD_SHARED_LIBS OFF CACHE BOOL SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"if used all library are build as shared type (.so/.dylib/.dll)") "if used all library are build as shared type (.so/.dylib/.dll)")
SET (WITH_TINYXML2 ON CACHE BOOL "get & build tinyxml2")
SET (WITH_ASSIMP OFF CACHE BOOL "build with Assimp") SET (WITH_ASSIMP OFF CACHE BOOL "build with Assimp")
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs") SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
SET (WITH_PYTHONQT ON CACHE BOOL "build PythonQt (for Schnapps)") SET (WITH_PYTHONQT ON CACHE BOOL "build PythonQt (for Schnapps)")
...@@ -67,5 +71,18 @@ IF (WITH_ASSIMP) ...@@ -67,5 +71,18 @@ IF (WITH_ASSIMP)
INSTALL (DIRECTORY Assimp/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp) INSTALL (DIRECTORY Assimp/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp)
ENDIF (WITH_ASSIMP) ENDIF (WITH_ASSIMP)
IF (WITH_TINYXML2)
ExternalProject_Add(
Tinyxml2
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2
GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git
CMAKE_CACHE_ARGS "-DCMAKE_BUILD_TYPE:string=${CMAKE_BUILD_TYPE}"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2"
BUILD_COMMAND make
INSTALL_COMMAND make install
)
INSTALL (DIRECTORY TinyXml2/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include)
FILE(GLOB_RECURSE tinyLib_files ${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2/lib/*.so.* ${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2/lib/*.a )
INSTALL (FILES ${tinyLib_files} DESTINATION ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ENDIF (WITH_TINYXML2)
\ No newline at end of file
#########################
# UPDATE VARIABLES:
# - TINYXML2_FOUND
# - TINYXML2_INCLUDE_DIR
# - TINYXML2_LIBRARY
#########################
find_path(TINYXML2_INCLUDE_DIR tinyxml2.h
HINTS $ENV{TINYXML2DIR}
PATH_SUFFIXES include
PATHS ~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr)
find_library(TINYXML2_LIBRARY tinyxml2
HINTS $ENV{TINYXML2DIR}
PATH_SUFFIXES lib64 lib
PATH_SUFFIXESS ~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TINYXML2 DEFAULT_MSG TINYXML2_LIBRARY)
mark_as_advanced(TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR)
This diff is collapsed.
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#ifndef __IMPORTSVG_H__ #ifndef __IMPORTSVG_H__
#define __IMPORTSVG_H__ #define __IMPORTSVG_H__
#include "Utils/xml.h"
namespace CGoGN namespace CGoGN
{ {
...@@ -43,16 +45,16 @@ namespace Import ...@@ -43,16 +45,16 @@ namespace Import
* @param name the name * @param name the name
* @ return true if node has the good name * @ return true if node has the good name
*/ */
bool checkXmlNode(xmlNodePtr node, const std::string& name); bool checkXmlNode(tinyxml2::XMLElement* node, const std::string& name);
template <typename PFP> template <typename PFP>
void readCoordAndStyle(xmlNode* cur_path, void readCoordAndStyle(tinyxml2::XMLElement* cur_path,
std::vector<std::vector<VEC3 > >& allPoly, std::vector<std::vector<VEC3 > >& allPoly,
std::vector<std::vector<VEC3 > >& allBrokenLines, std::vector<std::vector<VEC3 > >& allBrokenLines,
std::vector<float>& allBrokenLinesWidth); std::vector<float>& allBrokenLinesWidth);
template <typename PFP> template <typename PFP>
bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttribute<typename PFP::VEC3>& position, CellMarker<EDGE>& polygons, CellMarker<FACE>& polygonsFaces); bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttribute<typename PFP::VEC3,typename PFP::MAP>& position, CellMarker<typename PFP::MAP,EDGE>& polygons, CellMarker<typename PFP::MAP,FACE>& polygonsFaces);
/** /**
* *
......
...@@ -26,9 +26,13 @@ ...@@ -26,9 +26,13 @@
#include "Geometry/bounding_box.h" #include "Geometry/bounding_box.h"
#include "Geometry/plane_3d.h" #include "Geometry/plane_3d.h"
#include "Algo/BooleanOperator/mergeVertices.h" #include "Algo/BooleanOperator/mergeVertices.h"
#include "Algo/Topo/basic.h"
#include "Container/fakeAttribute.h" #include "Container/fakeAttribute.h"
#include <limits> #include <limits>
#include "Utils/xml.h" // just for highlighting/completion in editor
namespace CGoGN namespace CGoGN
{ {
...@@ -41,9 +45,14 @@ namespace Surface ...@@ -41,9 +45,14 @@ namespace Surface
namespace Import namespace Import
{ {
inline bool checkXmlNode(xmlNodePtr node, const std::string& name) //inline bool checkXmlNode(xmlNodePtr node, const std::string& name)
//{
// return (strcmp((char*)(node->name),(char*)(name.c_str())) == 0);
//}
inline bool checkXmlNode(tinyxml2::XMLElement* node, const std::string& name)
{ {
return (strcmp((char*)(node->name),(char*)(name.c_str())) == 0); return (strcmp(node->Name(),name.c_str()) == 0);
} }
template<typename T> template<typename T>
...@@ -206,7 +215,7 @@ void getPolygonFromSVG(std::string allcoords, std::vector<VEC3>& curPoly, bool& ...@@ -206,7 +215,7 @@ void getPolygonFromSVG(std::string allcoords, std::vector<VEC3>& curPoly, bool&
} }
template <typename PFP> template <typename PFP>
void readCoordAndStyle(xmlNode* cur_path, void readCoordAndStyle(tinyxml2::XMLElement* cur_path,
std::vector<std::vector<VEC3 > >& allPoly, std::vector<std::vector<VEC3 > >& allPoly,
std::vector<std::vector<VEC3 > >& allBrokenLines, std::vector<std::vector<VEC3 > >& allBrokenLines,
std::vector<float>& allBrokenLinesWidth) std::vector<float>& allBrokenLinesWidth)
...@@ -218,14 +227,16 @@ void readCoordAndStyle(xmlNode* cur_path, ...@@ -218,14 +227,16 @@ void readCoordAndStyle(xmlNode* cur_path,
POLYGON curPoly; POLYGON curPoly;
// CGoGNout << "--load a path--"<< CGoGNendl; // CGoGNout << "--load a path--"<< CGoGNendl;
xmlChar* prop = xmlGetProp(cur_path, BAD_CAST "d"); // xmlChar* prop = xmlGetProp(cur_path, BAD_CAST "d");
std::string allcoords((reinterpret_cast<const char*>(prop))); // std::string allcoords((reinterpret_cast<const char*>(prop)));
std::string allcoords = XMLAttribute(cur_path,"d");
getPolygonFromSVG(allcoords,curPoly,closedPoly); getPolygonFromSVG(allcoords,curPoly,closedPoly);
//check orientation : set in CCW //check orientation : set in CCW
if(curPoly.size()>2) if(curPoly.size()>2)
{ {
VEC3 v(0), v1, v2; VEC3 v(0)/*, v1, v2*/;
typename std::vector<VEC3 >::iterator it0, it1, it2; typename std::vector<VEC3 >::iterator it0, it1, it2;
it0 = curPoly.begin(); it0 = curPoly.begin();
it1 = it0+1; it1 = it0+1;
...@@ -255,8 +266,11 @@ void readCoordAndStyle(xmlNode* cur_path, ...@@ -255,8 +266,11 @@ void readCoordAndStyle(xmlNode* cur_path,
{ {
//if not : read the linewidth for further dilatation //if not : read the linewidth for further dilatation
allBrokenLines.push_back(curPoly); allBrokenLines.push_back(curPoly);
xmlChar* prop = xmlGetProp(cur_path, BAD_CAST "style");
std::string allstyle((reinterpret_cast<const char*>(prop))); // xmlChar* prop = xmlGetProp(cur_path, BAD_CAST "style");
// std::string allstyle((reinterpret_cast<const char*>(prop)));
std::string allstyle = XMLAttribute(cur_path,"style");
std::stringstream is(allstyle); std::stringstream is(allstyle);
std::string style; std::string style;
while ( std::getline( is, style, ';' ) ) while ( std::getline( is, style, ';' ) )
...@@ -274,7 +288,7 @@ void readCoordAndStyle(xmlNode* cur_path, ...@@ -274,7 +288,7 @@ void readCoordAndStyle(xmlNode* cur_path,
} }
template <typename PFP> template <typename PFP>
bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttribute<typename PFP::VEC3>& position, CellMarker<EDGE>& obstacleMark, CellMarker<FACE>& buildingMark) bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttribute<typename PFP::VEC3,typename PFP::MAP>& position, CellMarker<typename PFP::MAP,EDGE>& obstacleMark, CellMarker<typename PFP::MAP,FACE>& buildingMark)
{ {
//TODO : remove auto-intersecting faces //TODO : remove auto-intersecting faces
//TODO : handling polygons with holes //TODO : handling polygons with holes
...@@ -282,8 +296,18 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib ...@@ -282,8 +296,18 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
typedef typename PFP::VEC3 VEC3; typedef typename PFP::VEC3 VEC3;
typedef std::vector<VEC3> POLYGON; typedef std::vector<VEC3> POLYGON;
xmlDocPtr doc = xmlReadFile(filename.c_str(), NULL, 0);
xmlNodePtr map_node = xmlDocGetRootElement(doc); tinyxml2::XMLDocument doc;
tinyxml2::XMLError eResult = doc.LoadFile(filename.c_str());
if (XMLisError(eResult,"unable loading file"+filename))
return false;
tinyxml2::XMLElement* map_node = doc.RootElement();
// xmlDocPtr doc = xmlReadFile(filename.c_str(), NULL, 0);
// xmlNodePtr map_node = xmlDocGetRootElement(doc);
if (!checkXmlNode(map_node,"svg")) if (!checkXmlNode(map_node,"svg"))
{ {
...@@ -295,11 +319,11 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib ...@@ -295,11 +319,11 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
std::vector<POLYGON> allBrokenLines; std::vector<POLYGON> allBrokenLines;
std::vector<float> allBrokenLinesWidth; std::vector<float> allBrokenLinesWidth;
for (xmlNode* cur_node = map_node->children; cur_node; cur_node = cur_node->next) for (tinyxml2::XMLElement* cur_node = map_node->FirstChildElement(); cur_node; cur_node = cur_node->NextSiblingElement())
{ {
// for each layer // for each layer
if (checkXmlNode(cur_node, "g")) if (checkXmlNode(cur_node, "g"))
for (xmlNode* cur_path = cur_node->children ; cur_path; cur_path = cur_path->next) for (tinyxml2::XMLElement* cur_path = cur_node->FirstChildElement(); cur_path; cur_path = cur_path->NextSiblingElement())
{ {
if (checkXmlNode(cur_path, "path")) if (checkXmlNode(cur_path, "path"))
readCoordAndStyle<PFP>(cur_path, allPoly, allBrokenLines, allBrokenLinesWidth); readCoordAndStyle<PFP>(cur_path, allPoly, allBrokenLines, allBrokenLinesWidth);
...@@ -308,17 +332,30 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib ...@@ -308,17 +332,30 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
readCoordAndStyle<PFP>(cur_node, allPoly, allBrokenLines, allBrokenLinesWidth); readCoordAndStyle<PFP>(cur_node, allPoly, allBrokenLines, allBrokenLinesWidth);
} }
xmlFreeDoc(doc); // for (xmlNode* cur_node = map_node->children; cur_node; cur_node = cur_node->next)
// {
// // for each layer
// if (checkXmlNode(cur_node, "g"))
// for (xmlNode* cur_path = cur_node->children ; cur_path; cur_path = cur_path->next)
// {
// if (checkXmlNode(cur_path, "path"))
// readCoordAndStyle<PFP>(cur_path, allPoly, allBrokenLines, allBrokenLinesWidth);
// }
// else if (checkXmlNode(cur_node, "path"))
// readCoordAndStyle<PFP>(cur_node, allPoly, allBrokenLines, allBrokenLinesWidth);
// }
// xmlFreeDoc(doc);
std::cout << "importSVG : XML read." << std::endl; std::cout << "importSVG : XML read." << std::endl;
CellMarker<EDGE> brokenMark(map); CellMarker<typename PFP::MAP,EDGE> brokenMark(map);
EdgeAttribute<float> edgeWidth = map.template addAttribute<float, EDGE>("width"); EdgeAttribute<float,typename PFP::MAP> edgeWidth = map.template addAttribute<float, EDGE,typename PFP::MAP>("width");
// EdgeAttribute<NoMathAttribute<Geom::Plane3D<typename PFP::REAL> > > edgePlanes = map.template addAttribute<NoMathAttribute<Geom::Plane3D<typename PFP::REAL> >, EDGE>("planes"); // EdgeAttribute<NoMathAttribute<Geom::Plane3D<typename PFP::REAL> > > edgePlanes = map.template addAttribute<NoMathAttribute<Geom::Plane3D<typename PFP::REAL> >, EDGE>("planes");
EdgeAttribute<NoTypeNameAttribute<Geom::Plane3D<typename PFP::REAL> > > edgePlanes = map.template addAttribute<NoTypeNameAttribute<Geom::Plane3D<typename PFP::REAL> >, EDGE>("planes"); EdgeAttribute<NoTypeNameAttribute<Geom::Plane3D<typename PFP::REAL> >, typename PFP::MAP> edgePlanes = map.template addAttribute<NoTypeNameAttribute<Geom::Plane3D<typename PFP::REAL> >, EDGE,typename PFP::MAP>("planes");
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
//create broken lines //create broken lines
DartMarker brokenL(map); DartMarker<typename PFP::MAP> brokenL(map);
typename std::vector<POLYGON >::iterator it; typename std::vector<POLYGON >::iterator it;
std::vector<float >::iterator itW = allBrokenLinesWidth.begin(); std::vector<float >::iterator itW = allBrokenLinesWidth.begin();
...@@ -459,7 +496,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib ...@@ -459,7 +496,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
//process broken lines //process broken lines
CellMarker<EDGE> eMTreated(map) ; CellMarker<typename PFP::MAP,EDGE> eMTreated(map) ;
for (Dart d = map.begin() ; d != map.end() ; map.next(d)) for (Dart d = map.begin() ; d != map.end() ; map.next(d))
{ {
if (brokenL.isMarked(d) && !eMTreated.isMarked(d)) if (brokenL.isMarked(d) && !eMTreated.isMarked(d))
...@@ -521,7 +558,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib ...@@ -521,7 +558,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
{ {
for (Dart d = map.begin() ; d != map.end() ; map.next(d)) for (Dart d = map.begin() ; d != map.end() ; map.next(d))
{ {
if(map.isBoundaryMarked2(d)) if(map.template isBoundaryMarked<2>(d))
{ {
map.fillHole(d); map.fillHole(d);
} }
...@@ -552,14 +589,14 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib ...@@ -552,14 +589,14 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
} }
} }
map.template initAllOrbitsEmbedding<FACE>(true); Algo::Topo::initAllOrbitsEmbedding<FACE>(map,true);
for (Dart d = map.begin() ; d != map.end() ; map.next(d)) for (Dart d = map.begin() ; d != map.end() ; map.next(d))
{ {
if (!map.isBoundaryMarked2(d) && brokenL.isMarked(d)) if (!map.template isBoundaryMarked<2>(d) && brokenL.isMarked(d))
{ {
map.deleteFace(d,false); // ??? map.deleteFace(d,false);
map.deleteCycle(d); // ???
} }
} }
...@@ -567,7 +604,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib ...@@ -567,7 +604,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib
for (Dart d = map.begin() ; d != map.end() ; map.next(d)) for (Dart d = map.begin() ; d != map.end() ; map.next(d))
{ {
if (map.isBoundaryMarked2(d)) if (map.template isBoundaryMarked<2>(d))
buildingMark.mark(d); buildingMark.mark(d);
} }
......
...@@ -31,9 +31,6 @@ ...@@ -31,9 +31,6 @@
#include <vector> #include <vector>
#include <map> #include <map>
#include <libxml/encoding.h>
#include <libxml/xmlwriter.h>
#include <libxml/parser.h>
namespace CGoGN namespace CGoGN
{ {
...@@ -41,7 +38,6 @@ namespace CGoGN ...@@ -41,7 +38,6 @@ namespace CGoGN
class RegisteredBaseAttribute; class RegisteredBaseAttribute;
class AttributeContainer; class AttributeContainer;
class ContainerBrowser class ContainerBrowser
{ {
public: public:
...@@ -76,6 +72,11 @@ protected: ...@@ -76,6 +72,11 @@ protected:
*/ */
std::vector<AttributeMultiVectorGen*> m_tableAttribs; std::vector<AttributeMultiVectorGen*> m_tableAttribs;
/**
* vector of pointers to AttributeMultiVectors of MarkerBool
*/
std::vector<AttributeMultiVector<MarkerBool>*> m_tableMarkerAttribs;
/** /**
* vector of free indices in the vector of AttributeMultiVectors * vector of free indices in the vector of AttributeMultiVectors
*/ */
...@@ -161,6 +162,10 @@ public: ...@@ -161,6 +162,10 @@ public:
template <typename T> template <typename T>
AttributeMultiVector<T>* addAttribute(const std::string& attribName); AttributeMultiVector<T>* addAttribute(const std::string& attribName);
/// special version for marker
AttributeMultiVector<MarkerBool>* addMarkerAttribute(const std::string& attribName);
/** /**
* add a new attribute to the container * add a new attribute to the container
* @param typeName type of the new attribute in a string * @param typeName type of the new attribute in a string
...@@ -190,6 +195,8 @@ public: ...@@ -190,6 +195,8 @@ public:
template <typename T> template <typename T>
bool removeAttribute(const std::string& attribName); bool removeAttribute(const std::string& attribName);
bool removeMarkerAttribute(const std::string& attribName);
/** /**
* Remove an attribute (destroys data) * Remove an attribute (destroys data)
* @param index index of the attribute to remove * @param index index of the attribute to remove
...@@ -325,6 +332,7 @@ public: ...@@ -325,6 +332,7 @@ public:
*/ */
unsigned int getAttributesNames(std::vector<std::string>& names) const; unsigned int getAttributesNames(std::vector<std::string>& names) const;
/** /**
* fill a vector with attribute type names * fill a vector with attribute type names
* @param types vector of type names * @param types vector of type names
...@@ -332,6 +340,8 @@ public: ...@@ -332,6 +340,8 @@ public:
*/ */
unsigned int getAttributesTypes(std::vector<std::string>& types); unsigned int getAttributesTypes(std::vector<std::string>& types);
std::vector<AttributeMultiVector<MarkerBool>*>& getMarkerAttributes();
/************************************** /**************************************
* CONTAINER MANAGEMENT * * CONTAINER MANAGEMENT *
**************************************/ **************************************/
...@@ -381,6 +391,11 @@ public: ...@@ -381,6 +391,11 @@ public:
*/ */
void initLine(unsigned int index); void initLine(unsigned int index);
/**
* initialize all markers of a line of the container
*/
void initMarkersOfLine(unsigned int index);
/** /**
* copy the content of line src in line dst * copy the content of line src in line dst
*/ */
...@@ -442,6 +457,7 @@ public: ...@@ -442,6 +457,7 @@ public:
AttributeMultiVectorGen* getVirtualDataVector(unsigned int attrIndex); AttributeMultiVectorGen* getVirtualDataVector(unsigned int attrIndex);
/** /**
* get an AttributeMultiVector * get an AttributeMultiVector
* @param attribName name of the attribute * @param attribName name of the attribute
......
...@@ -43,6 +43,11 @@ inline void AttributeContainer::setOrbit(unsigned int orbit) ...@@ -43,6 +43,11 @@ inline void AttributeContainer::setOrbit(unsigned int orbit)
if (m_tableAttribs[i] != NULL) if (m_tableAttribs[i] != NULL)
m_tableAttribs[i]->setOrbit(orbit); m_tableAttribs[i]->setOrbit(orbit);
} }
for(unsigned int i = 0; i < m_tableMarkerAttribs.size(); ++i)
{