OTB  6.7.0
Orfeo Toolbox
mvdTypes.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 
22 #ifndef mvdTypes_h
23 #define mvdTypes_h
24 
25 //
26 // Configuration include.
28 #include "ConfigureMonteverdi.h"
29 
30 #include "OTBMonteverdiCoreExport.h"
31 
32 /*****************************************************************************/
33 /* INCLUDE SECTION */
34 
35 //
36 // Qt includes (sorted by alphabetic order)
38 #include <QtWidgets>
39 
40 //
41 // System includes (sorted by alphabetic order)
42 #include <exception>
43 #include <string>
44 
45 //
46 // ITK includes (sorted by alphabetic order)
47 #include <itkArray.h>
48 #include <itkImageRegion.h>
49 
50 //
51 // OTB includes (sorted by alphabetic order)
52 #include <otbCast.h>
53 #include <otbImage.h>
54 #include <otbImageFileReader.h>
55 #include <otbImageFileWriter.h>
56 #include <otbVectorImage.h>
57 
58 //
59 // Monteverdi includes (sorted by alphabetic order)
60 
61 //
62 // External classes pre-declaration.
63 namespace
64 {
65 }
66 
67 //
68 // Type definitions.
69 namespace mvd
70 {
71 
72 /*******************************************************************************/
73 /* Enumerations */
74 
75 /*******************************************************************************/
76 /* Type definitions of scalar values. */
77 
80 typedef unsigned int CountType;
81 
84 typedef Monteverdi_FLOATING_TYPE RealType;
85 
89 
93 
94 /*******************************************************************************/
95 /* Type definitions of STL realization. */
96 
99 typedef std::vector< std::string > StringVector;
100 
103 typedef std::vector< int > IntVector;
104 
107 typedef std::vector< unsigned int > UIntVector;
108 
111 typedef std::list< std::string > StringList;
112 
115 typedef std::vector< double > DoubleVector;
116 
117 /*******************************************************************************/
118 /* Type definitions of ITK realization. */
119 
123 
124 /*******************************************************************************/
125 /* Type definitions depending on dimension. */
126 
130 
134 
138 
142 
143 /*******************************************************************************/
144 /* Type definitions for scalar/mono-band images. */
145 
148 typedef
151 
154 typedef
156 
159 typedef
161 
162 /*******************************************************************************/
163 /* Type definitions for vector/multi-band images (generic internal data). */
164 
167 typedef
170 
174 
178 
182 
186 
190 
191 /*******************************************************************************/
192 /* Type definitions for application defaults. */
193 
197 
201 
204 struct PixelInfo
205 {
206  typedef std::vector< PixelInfo > Vector;
207 
209  m_Key(),
210  m_Point(),
211  m_Index(),
212  m_Pixel(),
213  m_Resolution (1),
214  m_HasPoint( false ),
215  m_HasIndex( false ),
216  m_HasPixel( false ),
217  m_HasResolution( false )
218  {
219  }
220 
221  std::string m_Key;
222 
226  unsigned int m_Resolution;
227 
228  bool m_HasPoint: 1;
229  bool m_HasIndex: 1;
230  bool m_HasPixel: 1;
232 };
233 
234 /*******************************************************************************/
235 /* Type definitions for wrapped applications */
236 
239 typedef std::map< std::string, StringVector > ApplicationsTagContainer;
240 
241 /*******************************************************************************/
242 /* Type definitions for dataset properties */
243 
246 typedef qlonglong SqlId;
247 
250 // typedef SqlId DatasetId;
251 typedef QString DatasetHash;
252 
255 typedef std::pair< std::string, std::string > PropertyType;
256 
259 typedef std::vector< PropertyType > PropertiesVector;
260 
263 typedef
264 std::pair< std::string, std::vector< PropertyType > > PropertiesVectorByCategory;
265 
268 typedef std::map< std::string, PropertiesVector > PropertiesContainer;
269 
270 /*******************************************************************************/
271 /* Type definitions for Dataset list */
272 
275 typedef QPair< QString, QString > StringPairType;
276 
279 typedef QList< StringPairType > StringPairListType;
280 
281 /*******************************************************************************/
282 template< typename T >
283 inline
284 T
285 QObjectCast( QObject * object, const QString & string = QString() )
286 {
287  T model = qobject_cast< T >( object );
288 
289  if( model!=object )
290  {
291  if( !string.isNull() )
292  qWarning() << string;
293 
294  throw std::bad_cast();
295  }
296 
297  return model;
298 }
299 
300 /*******************************************************************************/
301 } // end namespace 'mvd'
302 
303 #endif // mvdTypes_h
mvd::VectorImageFileReaderType DefaultImageFileReaderType
Definition: mvdTypes.h:200
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
qlonglong SqlId
Definition: mvdTypes.h:246
itk::VariableLengthVector< RealType > VectorPixelType
Definition: mvdTypes.h:92
Creation of an "otb" vector image which contains metadata.
T QObjectCast(QObject *object, const QString &string=QString())
Definition: mvdTypes.h:285
DefaultImageType::IndexType m_Index
Definition: mvdTypes.h:224
otb::Image< ComponentType, Monteverdi_DIMENSION > ScalarImageType
Definition: mvdTypes.h:150
itk::ImageBase< Monteverdi_DIMENSION > ImageBaseType
Definition: mvdTypes.h:141
QList< StringPairType > StringPairListType
Definition: mvdTypes.h:279
std::pair< std::string, std::vector< PropertyType > > PropertiesVectorByCategory
Definition: mvdTypes.h:264
bool m_HasIndex
Definition: mvdTypes.h:229
std::map< std::string, PropertiesVector > PropertiesContainer
Definition: mvdTypes.h:268
Reads image data.
Superclass::IndexType IndexType
std::string m_Key
Definition: mvdTypes.h:221
otb::ImageFileWriter< VectorImageType > VectorImageFileWriterType
Definition: mvdTypes.h:177
bool m_HasPoint
Definition: mvdTypes.h:228
unsigned int CountType
Definition: mvdTypes.h:80
QPair< QString, QString > StringPairType
Definition: mvdTypes.h:275
otb::ImageFileReader< VectorImageType > VectorImageFileReaderType
Definition: mvdTypes.h:173
itk::ImageRegion< Monteverdi_DIMENSION > ImageRegionType
Definition: mvdTypes.h:129
std::vector< PixelInfo > Vector
Definition: mvdTypes.h:206
mvd::VectorImageType DefaultImageType
Definition: mvdTypes.h:196
DefaultImageType::PixelType m_Pixel
Definition: mvdTypes.h:225
std::list< std::string > StringList
Definition: mvdTypes.h:111
std::vector< double > DoubleVector
Definition: mvdTypes.h:115
std::pair< std::string, std::string > PropertyType
Definition: mvdTypes.h:255
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
std::vector< int > IntVector
Definition: mvdTypes.h:103
std::vector< std::string > StringVector
Definition: mvdTypes.h:99
QString DatasetHash
Definition: mvdTypes.h:251
otb::VectorImage< ComponentType, Monteverdi_DIMENSION > VectorImageType
Definition: mvdTypes.h:169
Superclass::SizeType SizeType
itk::Array< double > ParametersType
Definition: mvdTypes.h:122
Superclass::PointType PointType
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
otb::ImageFileWriter< ScalarImageType > ScalarImageFileWriterType
Definition: mvdTypes.h:160
bool m_HasResolution
Definition: mvdTypes.h:231
Monteverdi_FLOATING_TYPE RealType
Definition: mvdTypes.h:84
RealType ComponentType
Definition: mvdTypes.h:88
DefaultImageType::PointType m_Point
Definition: mvdTypes.h:223
unsigned int m_Resolution
Definition: mvdTypes.h:226
std::map< std::string, StringVector > ApplicationsTagContainer
Definition: mvdTypes.h:239
std::vector< unsigned int > UIntVector
Definition: mvdTypes.h:107
std::vector< PropertyType > PropertiesVector
Definition: mvdTypes.h:259
otb::ImageFileReader< ScalarImageType > ScalarImageFileReaderType
Definition: mvdTypes.h:155
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
bool m_HasPixel
Definition: mvdTypes.h:230
VectorImageType::PointType PointType
Definition: mvdTypes.h:189
Writes image data to a single file with streaming process.