importSvg.h 3.14 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*******************************************************************************
* 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                                        *
*                                                                              *
*******************************************************************************/

Thomas's avatar
Thomas committed
25
26
27
#ifndef __IMPORTSVG_H__
#define __IMPORTSVG_H__

Sylvain Thery's avatar
Sylvain Thery committed
28
29
#include "Utils/xml.h"

Thomas's avatar
Thomas committed
30
31
32
33
34
35
namespace CGoGN
{

namespace Algo
{

36
37
38
namespace Surface
{

Thomas's avatar
Thomas committed
39
40
41
42
43
44
45
46
47
namespace Import
{

/**
 * check if an xml node has a given name
 * @param node the xml node
 * @param name the name
 * @ return true if node has the good name
 */
Sylvain Thery's avatar
Sylvain Thery committed
48
bool checkXmlNode(tinyxml2::XMLElement* node, const std::string& name);
Thomas's avatar
Thomas committed
49

50
template <typename PFP>
Sylvain Thery's avatar
Sylvain Thery committed
51
void readCoordAndStyle(tinyxml2::XMLElement* cur_path,
52
53
54
55
		std::vector<std::vector<VEC3 > >& allPoly,
		std::vector<std::vector<VEC3 > >& allBrokenLines,
		std::vector<float>& allBrokenLinesWidth);

Thomas's avatar
Thomas committed
56
template <typename PFP>
Sylvain Thery's avatar
Sylvain Thery committed
57
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);
Thomas's avatar
Thomas committed
58

untereiner's avatar
ihm3    
untereiner committed
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
 *
 */

template <typename PFP>
bool readSVG(const std::string& filename, std::vector<std::vector<typename PFP::VEC3 > > &allPoly);

template <typename PFP>
bool importBB(const std::string& filename, std::vector<Geom::BoundingBox<typename PFP::VEC3> > &bb);

template <typename PFP>
bool importSVG(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames);

Pierre Kraemer's avatar
Pierre Kraemer committed
72
} // namespace Import
Thomas's avatar
Thomas committed
73

74
75
}

Pierre Kraemer's avatar
Pierre Kraemer committed
76
} // namespace Algo
Thomas's avatar
Thomas committed
77

Pierre Kraemer's avatar
Pierre Kraemer committed
78
} // namespace CGoGN
Thomas's avatar
Thomas committed
79
80
81
82

#include "Algo/Import/importSvg.hpp"

#endif