-
Notifications
You must be signed in to change notification settings - Fork 23
/
PlanarPartition.h
80 lines (63 loc) · 2.27 KB
/
PlanarPartition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
Copyright (c) 2009-2022,
Ken Arroyo Ohori [email protected]
Hugo Ledoux [email protected]
Martijn Meijers [email protected]
All rights reserved.
This file is part of pprepair: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Licensees holding a valid commercial license may use this file in
accordance with the commercial license agreement provided with
the software.
This file 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.
*/
#ifndef PLANARPARTITION_H
#define PLANARPARTITION_H
#include "IOWorker.h"
class PlanarPartition {
public:
// Constructors and destructors, initialisation
PlanarPartition();
~PlanarPartition();
// Operations
bool addToTriangulation(const char *file, unsigned int schemaIndex = 0);
bool tagTriangulation();
bool makeAllHolesValid();
bool addAllowedHole(Point p);
bool addAllowedHoles(const char *file);
bool splitRegions(double ratio);
bool checkValidity();
bool repairTrianglesByNumberOfNeighbours(bool alsoUniverse);
bool repairTrianglesByAbsoluteMajority(bool alsoUniverse);
bool repairTrianglesByLongestBoundary(bool alsoUniverse);
bool repairRegionsByLongestBoundary(bool alsoUniverse);
bool repairRegionsByRandomNeighbour(bool alsoUniverse);
bool repairByPriorityList(const char *file);
bool repairEdgeMatching(const char *file);
bool matchSchemata();
bool reconstructPolygons(bool removeVertices = false);
bool exportPolygons(const char *file, bool withProvenance);
bool exportTriangulation(const char *file, bool withNumberOfTags, bool withFields, bool withProvenance);
void printInfo();
private: // Comment to have access to the triangulation and other data structures from outside
// Internal states
enum State {
CREATED,
TRIANGULATED,
TAGGED,
REPAIRED,
RECONSTRUCTED
};
State state;
// I/O handler
IOWorker io;
// Generated stuff
Triangulation triangulation;
TaggingVector edgesToTag;
std::vector<std::pair<PolygonHandle *, Polygon> > outputPolygons;
};
#endif