Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/PolylineSceneLayer.h @ 584:434ceeb0bcab
layers: InfoPanel, Polyline, Texture
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 19 Apr 2019 17:36:00 +0200 |
parents | |
children | 500c3f70b6c2 |
comparison
equal
deleted
inserted
replaced
583:f9ac154c5a63 | 584:434ceeb0bcab |
---|---|
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-2019 Osimis S.A., Belgium | |
6 * | |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "ColorSceneLayer.h" | |
25 #include "ScenePoint2D.h" | |
26 | |
27 #include <vector> | |
28 | |
29 namespace OrthancStone | |
30 { | |
31 class PolylineSceneLayer : public ColorSceneLayer | |
32 { | |
33 public: | |
34 typedef std::vector<ScenePoint2D> Chain; | |
35 | |
36 private: | |
37 std::vector<Chain> chains_; | |
38 std::vector<bool> closed_; | |
39 double thickness_; | |
40 | |
41 public: | |
42 PolylineSceneLayer() : | |
43 thickness_(1.0) | |
44 { | |
45 } | |
46 | |
47 virtual ISceneLayer* Clone() const; | |
48 | |
49 void SetThickness(double thickness); | |
50 | |
51 double GetThickness() const | |
52 { | |
53 return thickness_; | |
54 } | |
55 | |
56 void Copy(const PolylineSceneLayer& from); | |
57 | |
58 void Reserve(size_t countChains); | |
59 | |
60 void AddChain(const Chain& chain, | |
61 bool isClosed); | |
62 | |
63 size_t GetChainsCount() const | |
64 { | |
65 return chains_.size(); | |
66 } | |
67 | |
68 const Chain& GetChain(size_t i) const; | |
69 | |
70 bool IsClosedChain(size_t i) const; | |
71 | |
72 virtual Type GetType() const | |
73 { | |
74 return Type_Polyline; | |
75 } | |
76 | |
77 virtual bool GetBoundingBox(Extent2D& target) const; | |
78 | |
79 virtual uint64_t GetRevision() const | |
80 { | |
81 return 0; | |
82 } | |
83 }; | |
84 } |