comparison Framework/Scene2D/InfoPanelSceneLayer.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 2d8ab34c8c91
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 "ISceneLayer.h"
25 #include "../StoneEnumerations.h"
26
27 #include <Core/Images/ImageAccessor.h>
28
29 #include <memory>
30
31 namespace OrthancStone
32 {
33 class InfoPanelSceneLayer : public ISceneLayer
34 {
35 private:
36 std::auto_ptr<Orthanc::ImageAccessor> texture_;
37 BitmapAnchor anchor_;
38 bool isLinearInterpolation_;
39
40 public:
41 InfoPanelSceneLayer(const Orthanc::ImageAccessor& texture,
42 BitmapAnchor anchor,
43 bool isLinearInterpolation);
44
45 virtual ISceneLayer* Clone() const
46 {
47 return new InfoPanelSceneLayer(*texture_, anchor_, isLinearInterpolation_);
48 }
49
50 const Orthanc::ImageAccessor& GetTexture() const
51 {
52 return *texture_;
53 }
54
55 BitmapAnchor GetAnchor() const
56 {
57 return anchor_;
58 }
59
60 bool IsLinearInterpolation() const
61 {
62 return isLinearInterpolation_;
63 }
64
65 virtual Type GetType() const
66 {
67 return Type_InfoPanel;
68 }
69
70 virtual bool GetBoundingBox(Extent2D& target) const
71 {
72 return false;
73 }
74
75 virtual uint64_t GetRevision() const
76 {
77 return 0;
78 }
79
80 static void ComputeAnchorLocation(int& x,
81 int& y,
82 BitmapAnchor anchor,
83 unsigned int textureWidth,
84 unsigned int textureHeight,
85 unsigned int canvasWidth,
86 unsigned int canvasHeight);
87 };
88 }