2
// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
3
// All rights reserved.
5
// This file is part of the Carve CSG Library (http://carve-csg.com/)
7
// This file may be used under the terms of the GNU General Public
8
// License version 2.0 as published by the Free Software Foundation
9
// and appearing in the file LICENSE.GPL2 included in the packaging of
12
// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
13
// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
14
// A PARTICULAR PURPOSE.
20
#include <carve/carve.hpp>
22
#include <carve/polyhedron_base.hpp>
28
typedef std::unordered_set<carve::mesh::MeshSet<3>::vertex_t *> VSet;
29
typedef std::unordered_set<carve::mesh::MeshSet<3>::face_t *> FSet;
31
typedef std::set<carve::mesh::MeshSet<3>::vertex_t *> VSetSmall;
32
typedef std::set<csg::V2> V2SetSmall;
33
typedef std::set<carve::mesh::MeshSet<3>::face_t *> FSetSmall;
35
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, VSetSmall> VVSMap;
36
typedef std::unordered_map<carve::mesh::MeshSet<3>::edge_t *, VSetSmall> EVSMap;
37
typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, VSetSmall> FVSMap;
39
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, FSetSmall> VFSMap;
40
typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, V2SetSmall> FV2SMap;
42
typedef std::unordered_map<
43
carve::mesh::MeshSet<3>::edge_t *,
44
std::vector<carve::mesh::MeshSet<3>::vertex_t *> > EVVMap;
46
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *,
47
std::vector<carve::mesh::MeshSet<3>::edge_t *> > VEVecMap;
50
class LoopEdges : public std::unordered_map<V2, std::list<FaceLoop *> > {
51
typedef std::unordered_map<V2, std::list<FaceLoop *> > super;
54
void addFaceLoop(FaceLoop *fl);
55
void sortFaceLoopLists();
56
void removeFaceLoop(FaceLoop *fl);
65
static inline std::ostream &operator<<(std::ostream &o, const carve::csg::detail::FSet &s) {
67
for (carve::csg::detail::FSet::const_iterator i = s.begin(); i != s.end(); ++i) {
68
o << sep << *i; sep=",";