ctkModuleParameterValue.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 2010 Brigham and Women's Hospital (BWH) All Rights Reserved.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =============================================================================*/
  14. #ifndef __ctkModuleParameterValue_h
  15. #define __ctkModuleParameterValue_h
  16. #include "ctkModuleDescriptionExport.h"
  17. #include "ctkModuleParameter.h"
  18. #include <QVariant>
  19. /**
  20. * \brief Single parameter value to a module, like a threshold of a filter.
  21. *
  22. * ctkModuleParameterValue describes a single parameter value to a
  23. * module. Information on the parameter type, name, flag, label,
  24. * description, channel, index, default, and constraints can be
  25. * stored.
  26. *
  27. */
  28. class CTK_MODULDESC_EXPORT ctkModuleParameterValue
  29. {
  30. public:
  31. // constructor
  32. ctkModuleParameterValue( const ctkModuleParameter& param );
  33. // set the value
  34. void setValue( const QVariant& value );
  35. // set the value to the defaut one
  36. void setDefaultValue();
  37. // get the value
  38. const QVariant& getValue() const;
  39. // get the associated ctkModuleParameter
  40. const ctkModuleParameter& parameter() const;
  41. private:
  42. QVariant value;
  43. const ctkModuleParameter& Parameter;
  44. };
  45. #endif