comparison OrthancStone/Sources/Scene2D/ArrowSceneLayer.h @ 1614:ad9b425f27ae

new class: ArrowSceneLayer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 30 Oct 2020 16:26:39 +0100
parents
children 9ac2a65d4172
comparison
equal deleted inserted replaced
1613:5f0660fe06c3 1614:ad9b425f27ae
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-2020 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 Lesser 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 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program. If not, see
19 * <http://www.gnu.org/licenses/>.
20 **/
21
22
23 #pragma once
24
25 #include "Color.h"
26 #include "ScenePoint2D.h"
27 #include "ISceneLayer.h"
28
29 #include <Compatibility.h> // For ORTHANC_OVERRIDE
30
31 namespace OrthancStone
32 {
33 class ArrowSceneLayer : public ISceneLayer
34 {
35 private:
36 ScenePoint2D a_;
37 ScenePoint2D b_;
38 Color color_;
39 double thickness_;
40 uint64_t revision_;
41 double arrowLength_; // in pixels
42 double arrowAngle_; // in radians
43
44 public:
45 ArrowSceneLayer(const ScenePoint2D& a,
46 const ScenePoint2D& b);
47
48 virtual uint64_t GetRevision() const ORTHANC_OVERRIDE
49 {
50 return revision_;
51 }
52
53 virtual ISceneLayer* Clone() const ORTHANC_OVERRIDE;
54
55 const ScenePoint2D& GetA() const
56 {
57 return a_;
58 }
59
60 const ScenePoint2D& GetB() const
61 {
62 return b_;
63 }
64
65 void SetThickness(double thickness);
66
67 double GetThickness() const
68 {
69 return thickness_;
70 }
71
72 void SetColor(const Color& color);
73
74 void SetColor(uint8_t red,
75 uint8_t green,
76 uint8_t blue)
77 {
78 SetColor(Color(red, green, blue));
79 }
80
81 const Color& GetColor() const
82 {
83 return color_;
84 }
85
86 void SetArrowLength(double length);
87
88 double GetArrowLength() const
89 {
90 return arrowLength_;
91 }
92
93 void SetArrowAngle(double angle);
94
95 double GetArrowAngle() const
96 {
97 return arrowAngle_;
98 }
99
100 virtual Type GetType() const ORTHANC_OVERRIDE
101 {
102 return Type_Arrow;
103 }
104
105 virtual void GetBoundingBox(Extent2D& target) const ORTHANC_OVERRIDE;
106 };
107 }