OTB  7.2.0
Orfeo Toolbox
otbGlROIActor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otb_GlROIActor_h
22 #define otb_GlROIActor_h
23 
24 #include "otbGlActor.h"
25 
26 #include "otbGenericRSTransform.h"
27 #include "otbImageKeywordlist.h"
28 #include "itkImageRegion.h"
29 #include "itkVector.h"
30 #include <string>
31 
32 namespace otb
33 {
34 
35 namespace gl
36 {
37 struct Mesh;
38 }
39 
40 class OTBIce_EXPORT GlROIActor
41  : public GlActor
42 {
43 public:
44  typedef GlROIActor Self;
46  typedef itk::SmartPointer<Self> Pointer;
47  typedef itk::SmartPointer<const Self> ConstPointer;
49  typedef itk::ImageRegion<2> ImageRegionType;
52  typedef itk::Vector<double,3> ColorType;
53 
54  itkNewMacro(Self);
55 
56  // Retrieve the full extent of the actor
57  void GetExtent(double & ulx, double & uly, double & lrx, double & lry) const override;
58 
59  // Update internal actor state with respect to ViewSettings
60  void ProcessViewSettings() override;
61 
62  // Heavy load/unload operations of data
63  void UpdateData() override;
64 
65  // Gl rendering of current state
66  void Render() override;
67 
68  void CreateShader() override;
69 
70  void SetUL( const PointType & );
71 
72  itkGetConstReferenceMacro(UL,PointType);
73 
74  void SetLR( const PointType & );
75 
76  itkGetConstReferenceMacro(LR,PointType);
77 
78  itkSetStringMacro(Wkt);
79  itkGetStringMacro(Wkt);
80 
81  void SetKwl(const ImageKeywordlistType & kwl);
82  itkGetConstReferenceMacro(Kwl,ImageKeywordlistType);
83 
84  itkSetMacro(Color,ColorType);
85  itkGetConstReferenceMacro(Color,ColorType);
86 
87  itkSetMacro(Alpha,double);
88  itkGetConstReferenceMacro(Alpha,double);
89 
90  itkSetMacro(Fill,bool);
91  itkGetMacro(Fill,bool);
92  itkBooleanMacro(Fill);
93 
94 protected:
95  GlROIActor();
96 
97  ~GlROIActor() override;
98 
99 private:
100  // prevent implementation
101  GlROIActor(const Self&);
102  void operator=(const Self&);
103 
104  void UpdateTransforms();
105 
106  PointType m_UL;
107  PointType m_LR;
108 
109  std::string m_Wkt;
110  ImageKeywordlistType m_Kwl;
111 
112  ColorType m_Color;
113  double m_Alpha;
115  bool m_Fill;
116 
119 
120  PointType m_VpUL;
121  PointType m_VpUR;
122  PointType m_VpLL;
123  PointType m_VpLR;
124 
126  std::unique_ptr< gl::Mesh > m_Mesh;
127 
128 }; // End class GlROIActor
129 
130 } // End namespace otb
131 
132 #endif
PointType m_VpLR
Storage and conversion for OSSIM metadata.
itk::SmartPointer< Self > Pointer
ColorType m_Color
ImageKeywordlistType m_Kwl
GlROIActor Self
Definition: otbGlROIActor.h:44
itk::ImageRegion< 2 > ImageRegionType
Definition: otbGlROIActor.h:49
otb::GenericRSTransform RSTransformType
Definition: otbGlROIActor.h:50
GlActor Superclass
Definition: otbGlROIActor.h:45
PointType m_VpUR
PointType m_VpLL
itk::Vector< double, 3 > ColorType
Definition: otbGlROIActor.h:52
ImageKeywordlist ImageKeywordlistType
Definition: otbGlROIActor.h:48
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
RSTransformType::Pointer m_ViewportToImageTransform
PointType m_VpUL
std::unique_ptr< gl::Mesh > m_Mesh
This is the class to handle generic remote sensing transform.
itk::SmartPointer< Self > Pointer
Definition: otbGlROIActor.h:46
RSTransformType::InputPointType PointType
Definition: otbGlROIActor.h:51
std::string m_Wkt
itk::Point< ScalarType, NInputDimensions > InputPointType
itk::SmartPointer< const Self > ConstPointer
Definition: otbGlROIActor.h:47
RSTransformType::Pointer m_ImageToViewportTransform