Orfeo Toolbox  3.16
otbWrapperQtWidgetParameterFactory.cxx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
19 
20 #include "otbWrapperParameter.h"
22 
24 
46 
47 namespace otb
48 {
49 namespace Wrapper
50 {
51 
52 template <class TParameterType, class TQtWidget>
54 {
55 public:
56 
57  static bool CanCreate( Parameter* param )
58  {
59  return dynamic_cast<TParameterType *>(param) != 0;
60  }
61 
63  {
64  QtWidgetParameterBase* widget = 0;
65  TParameterType* specificParam = dynamic_cast<TParameterType *>(param);
66 
67  if (specificParam)
68  {
69  widget = new TQtWidget(specificParam, model);
70  }
71  return widget;
72  }
73 };
74 
76 {
77 }
78 
80 {
81 }
82 
85 {
86  QtWidgetParameterBase* widget = 0;
87 
88 #define CREATEWIDGET( ParameterType, WidgetType ) \
89  else if ( QtWidgetParameterGenericFactory<ParameterType, WidgetType>::CanCreate(param) ) \
90  { \
91  widget = QtWidgetParameterGenericFactory<ParameterType, WidgetType>::Create(param, model); \
92  }
93 
94  if (0) {}
117 
118 #undef CREATEWIDGET
119 
120  if (widget)
121  {
122  widget->CreateWidget();
123  widget->UpdateGUI();
124  }
125 
126  return widget;
127 
128 
129 }
130 
131 
132 }
133 }

Generated at Sun May 26 2013 01:01:59 for Orfeo Toolbox with doxygen 1.8.3.1