Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
f39b9964
Commit
f39b9964
authored
14 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Adding a numerical parameter
parent
25845a4a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Core/otbWrapperNumericalParameter.h
+114
-0
114 additions, 0 deletions
Code/Core/otbWrapperNumericalParameter.h
with
114 additions
and
0 deletions
Code/Core/otbWrapperNumericalParameter.h
0 → 100644
+
114
−
0
View file @
f39b9964
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbWrapperNumericalParameter_h
#define __otbWrapperNumericalParameter_h
#include
"otbWrapperParameter.h"
#include
"itkNumericTraits.h"
namespace
otb
{
namespace
Wrapper
{
/** \class NumericalParameter
* \brief This class represents a numerical parameter
*/
template
<
typename
T
>
NumericalParameter
:
public
Parameter
{
public:
/** Standard class typedef */
typedef
NumericalParameter
Self
;
typedef
itk
::
LightObject
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Defining ::New() static method */
itkNewMacro
(
Self
);
/** RTTI support */
itkTypeMacro
(
NumericalParameter
,
otb
::
Wrapper
::
Parameter
);
/** Typedef of the scalar type */
typedef
T
ScalarType
;
/** Implement the reset method (replace value by default value) */
virtual
void
Reset
()
{
m_Value
=
m_DefaultValue
;
}
/** Set the value */
itkSetMacro
(
Value
,
ScalarType
);
/** Get the value */
itkGetMacro
(
Value
,
ScalarType
);
/** Set the default value */
itkSetMacro
(
DefaultValue
,
ScalarType
);
/** Get the default value */
itkGetMacro
(
DefaultValue
,
ScalarType
);
/** Set the minimum value */
itkSetMacro
(
MinimumValue
,
ScalarType
);
/** Get the minimum value */
itkGetMacro
(
MinimumValue
,
ScalarType
);
/** Set the maximum value */
itkSetMacro
(
MaximumValue
,
ScalarType
);
/** Get the maximum value */
itkGetMacro
(
MaximumValue
,
ScalarType
);
protected
:
/** Constructor */
NumericalParameter
()
:
m_Value
(
itk
::
NumericTraits
<
T
>::
Zero
()),
m_DefaultValue
(
itk
::
NumericTraits
<
T
>::
Zero
()),
m_MinimumValue
(
itk
::
NumericTraits
<
T
>::
min
()),
m_MaximumValue
(
itk
::
NumericTraits
<
T
>::
max
())
{}
/** Destructor */
virtual
~
NumericalParameter
()
{}
private
:
NumericalParameter
(
const
Parameter
&
);
//purposely not implemented
void
operator
=
(
const
Parameter
&
);
//purposely not implemented
/** Value */
ScalarType
m_Value
;
/** Default value (when appliable) */
ScalarType
m_DefaultValue
;
/** Minimum value */
ScalarType
m_MinimumValue
;
/** Maximum value */
ScalarType
m_MaximumValue
;
};
// End class Numerical Parameter
}
// End namespace Wrapper
}
// End namespace otb
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment