Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Code
Wrappers
QtWidget
otbWrapperQtWidgetParameterBase.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
=========================================================================*/
18
#include "
otbWrapperQtWidgetParameterBase.h
"
19
20
namespace
otb
21
{
22
namespace
Wrapper
23
{
24
25
QtWidgetParameterBase::QtWidgetParameterBase
(
Parameter
* param,
QtWidgetModel
* m)
26
: m_Model(m), m_Param(param)
27
{
28
}
29
30
QtWidgetParameterBase::~QtWidgetParameterBase
()
31
{
32
}
33
34
void
QtWidgetParameterBase::CreateWidget
()
35
{
36
this->
DoCreateWidget
();
37
38
// connect the update signal to this widget
39
connect(
GetModel
(), SIGNAL(UpdateGui()),
this
, SLOT(
UpdateGUI
() ) );
40
}
41
42
void
QtWidgetParameterBase::UpdateGUI
()
43
{
44
// Update the GUI
45
this->
DoUpdateGUI
();
46
47
// Emit State of the Parameter to update this paramter checkbox
48
if
(!
m_Param
->
GetMandatory
())
49
{
50
bool
state =
m_Param
->
GetActive
();
51
emit
ParameterActiveStatus
(state);
52
}
53
else
54
{
55
// Activate the Mandatory param and the Mandatory subparam in an
56
// activated Group
57
if
(
m_Param
->
GetRoot
()->GetActive())
58
{
59
emit
ParameterActiveStatus
(
true
);
60
}
61
}
62
}
63
64
void
QtWidgetParameterBase::ParameterChanged
(
const
QString& key)
65
{
66
67
}
68
69
QtWidgetModel
*
QtWidgetParameterBase::GetModel
()
70
{
71
return
m_Model
;
72
}
73
74
// Slot connected to the signal emitted the checkBox relative to
75
// current widget
76
void
QtWidgetParameterBase::SetActivationState
(
bool
value )
77
{
78
this->setEnabled(value);
79
m_Param
->
SetChecked
(value);
80
m_Param
->
SetActive
(value);
81
}
82
83
// Slot connected to the signal emitted by the Reset Button
84
void
QtWidgetParameterBase::Reset
( )
85
{
86
m_Param
->
Reset
();
87
m_Param
->
SetUserValue
(
false
);
88
m_Param
->
SetAutomaticValue
(
false
);
89
this->
UpdateGUI
();
90
}
91
}
92
}
Generated at Sun May 19 2013 01:01:50 for
Orfeo Toolbox
with
doxygen 1.8.3.1