Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Toolbox/UnionOfRectangles.h @ 1875:b896f20d24ca
added UnionOfRectangles algorithm
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 11 Jan 2022 19:59:40 +0100 |
parents | |
children | 07964689cb0b |
comparison
equal
deleted
inserted
replaced
1874:08f2476e8f5e | 1875:b896f20d24ca |
---|---|
1 /** | |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium | |
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
7 * | |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU Lesser General Public License | |
10 * as published by the Free Software Foundation, either version 3 of | |
11 * the License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * Lesser General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU Lesser General Public | |
19 * License along with this program. If not, see | |
20 * <http://www.gnu.org/licenses/>. | |
21 **/ | |
22 | |
23 | |
24 #pragma once | |
25 | |
26 #include "Extent2D.h" | |
27 #include "../Scene2D/ScenePoint2D.h" | |
28 | |
29 #include <list> | |
30 | |
31 | |
32 namespace OrthancStone | |
33 { | |
34 /** | |
35 * This implementation closely follows "Finding the Contour of a | |
36 * Union of Iso-Oriented Rectangles" by Lipski and Preparata (1980), | |
37 * as well as Section 8.5 (pages 340-348) of "Computational Geometry | |
38 * - An Introduction" by Preparata and Ian Shamos (1985). | |
39 **/ | |
40 class UnionOfRectangles : public boost::noncopyable | |
41 { | |
42 private: | |
43 enum Operation | |
44 { | |
45 Operation_Insert, | |
46 Operation_Delete | |
47 }; | |
48 | |
49 enum Status | |
50 { | |
51 Status_Full, | |
52 Status_Partial, | |
53 Status_Empty | |
54 }; | |
55 | |
56 class Payload; | |
57 class Factory; | |
58 class Visitor; | |
59 | |
60 class VerticalSide; | |
61 class HorizontalJunction; | |
62 | |
63 UnionOfRectangles(); // Pure static class | |
64 | |
65 public: | |
66 static void Apply(std::list< std::vector<ScenePoint2D> >& contours, | |
67 const std::list<Extent2D>& rectangles); | |
68 }; | |
69 } |