ModelParamBase is a persistent ModelComponent parameter base class. More...
#include <Component/ModelParamBase.H>
Public Member Functions | |
Constructors and Destructors | |
ModelParamBase (const ParamFlag flags) | |
Constructor. | |
virtual | ~ModelParamBase () |
Destructor. | |
Basic access functions | |
virtual std::string | getName () const =0 |
get the parameter's name | |
virtual std::string | getNameWithSpaces () const |
get the parameter's name with spaces separating words | |
virtual std::string | getValString () const =0 |
Get current value as a string (must be implemented by derived classes). | |
virtual bool | setValString (const std::string &textval)=0 |
Set the parameter value from a textual representation, notify client of the change. | |
virtual void | getValGeneric (RefHolder &ref) const =0 |
Get the current value through a dynamically-typed RefHolder. | |
virtual bool | setValGeneric (const RefHolder &ref)=0 |
Set the current value through a dynamically-typed RefHolder, notify client of the change. | |
bool | allowsOnlineChanges () const |
Check whether this param is allowed to have its value changed while the model is active. | |
void | setInactive (bool v) |
Change the param's active/inactive setting. | |
bool | getInactive () const |
Check the param's active/inactive setting. | |
void | setHidden (bool v) |
Change the param's hidden/visible setting. | |
bool | getHidden () const |
Check the param's hidden/visible setting. | |
Input/Output functions | |
virtual void | printout (std::ostream &s, const std::string &prefix="") const =0 |
Print out our name and contents, mostly for debugging. | |
virtual void | writeTo (ParamMap &pmap) const =0 |
Write parameter value to ParamMap. | |
virtual void | readFrom (const ParamMap &pmap, const bool noerr=true)=0 |
Get parameter value from ParamMap, notify client of the value change. |
ModelParamBase is a persistent ModelComponent parameter base class.
Various model parameter types can be derived from this base, see the NModelParam and OModelParam template class definitions. ModelParamBase is persistent in the sense that it can be saved/loaded into a ParamMap, which itself provides disk save/load capabilities. ModelParamBase is intended to be used as a data member in a ModelComponent (or derived) object. ModelComponent provides an interface by which ModelParamBase derivatives may also be tuned via command-line options.
Definition at line 94 of file ModelParamBase.H.
ModelParamBase::ModelParamBase | ( | const ParamFlag | flags | ) |
Constructor.
flags | Will be checked for ALLOW_ONLINE_CHANGES to set up our return value from allowsOnlineChanges() appropriately. |
Definition at line 96 of file ModelParamBase.C.
ModelParamBase::~ModelParamBase | ( | ) | [virtual] |
Destructor.
Definition at line 101 of file ModelParamBase.C.
bool ModelParamBase::allowsOnlineChanges | ( | ) | const [inline] |
Check whether this param is allowed to have its value changed while the model is active.
Definition at line 143 of file ModelParamBase.H.
References ALLOW_ONLINE_CHANGES.
Referenced by PrefsWindow::addPrefsForComponent().
bool ModelParamBase::getHidden | ( | ) | const [inline] |
Check the param's hidden/visible setting.
Definition at line 155 of file ModelParamBase.H.
References MP_HIDDEN.
bool ModelParamBase::getInactive | ( | ) | const [inline] |
Check the param's active/inactive setting.
Definition at line 149 of file ModelParamBase.H.
References MP_INACTIVE.
virtual std::string ModelParamBase::getName | ( | ) | const [pure virtual] |
get the parameter's name
Implemented in NModelParam< T >, OModelParam< T >, NModelParam< PixRGB< byte > >, NModelParam< unsigned long >, NModelParam< double >, NModelParam< std::string >, NModelParam< VisualFeature >, NModelParam< float >, NModelParam< int >, NModelParam< unsigned int >, NModelParam< byte >, NModelParam< PyramidType >, NModelParam< bool >, NModelParam< SimTime >, NModelParam< uint >, OModelParam< ShapeEstimatorMode >, OModelParam< SVChanLevels >, OModelParam< PixRGB< byte > >, OModelParam< OpticalFlowType >, OModelParam< ContourChannelDynamicsType >, OModelParam< FpuPrecision >, OModelParam< unsigned long >, OModelParam< ShapeEstimatorSmoothMethod >, OModelParam< double >, OModelParam< ByteCount >, OModelParam< ColorComputeType >, OModelParam< Location >, OModelParam< std::string >, OModelParam< BitObjectDrawMode >, OModelParam< in_addr >, OModelParam< float >, OModelParam< VisualObjectMatchAlgo >, OModelParam< FrameRange >, OModelParam< int >, OModelParam< Rectangle >, OModelParam< unsigned int >, OModelParam< ResizeSpec >, OModelParam< Range< double > >, OModelParam< ContourChannelFilterStyle >, OModelParam< string >, OModelParam< FpuRoundingMode >, OModelParam< byte >, OModelParam< short int >, OModelParam< size_t >, OModelParam< VideoFormat >, OModelParam< LevelSpec >, OModelParam< IORtype >, OModelParam< RasterFileFormat >, OModelParam< ErrorStrategy >, OModelParam< MapCombineType >, OModelParam< MaxNormType >, OModelParam< bool >, OModelParam< PixPerDeg >, OModelParam< uint >, OModelParam< Dims >, OModelParam< SimTime >, OModelParam< OrientComputeType >, OModelParam< ContourConnectionType >, OModelParam< Point2D< int > >, and OModelParam< Point2D< float > >.
Referenced by getNameWithSpaces(), and EnvVisualCortexBase::paramChanged().
std::string ModelParamBase::getNameWithSpaces | ( | ) | const [virtual] |
get the parameter's name with spaces separating words
This function decodes the CamelCase string that is typically returned by getName() into space-separated words, using some heuristics to figure out where to place word boundaries. It is not guaranteed to be perfectly accurate in finding word boundaries; this result is only intended for user-interface display to the end user and should not be relied on for programmatic usage.
Definition at line 104 of file ModelParamBase.C.
References camelCaseToSpaces(), and getName().
virtual void ModelParamBase::getValGeneric | ( | RefHolder & | ref | ) | const [pure virtual] |
Get the current value through a dynamically-typed RefHolder.
Implemented in NModelParam< T >, OModelParam< T >, NModelParam< PixRGB< byte > >, NModelParam< unsigned long >, NModelParam< double >, NModelParam< std::string >, NModelParam< VisualFeature >, NModelParam< float >, NModelParam< int >, NModelParam< unsigned int >, NModelParam< byte >, NModelParam< PyramidType >, NModelParam< bool >, NModelParam< SimTime >, NModelParam< uint >, OModelParam< ShapeEstimatorMode >, OModelParam< SVChanLevels >, OModelParam< PixRGB< byte > >, OModelParam< OpticalFlowType >, OModelParam< ContourChannelDynamicsType >, OModelParam< FpuPrecision >, OModelParam< unsigned long >, OModelParam< ShapeEstimatorSmoothMethod >, OModelParam< double >, OModelParam< ByteCount >, OModelParam< ColorComputeType >, OModelParam< Location >, OModelParam< std::string >, OModelParam< BitObjectDrawMode >, OModelParam< in_addr >, OModelParam< float >, OModelParam< VisualObjectMatchAlgo >, OModelParam< FrameRange >, OModelParam< int >, OModelParam< Rectangle >, OModelParam< unsigned int >, OModelParam< ResizeSpec >, OModelParam< Range< double > >, OModelParam< ContourChannelFilterStyle >, OModelParam< string >, OModelParam< FpuRoundingMode >, OModelParam< byte >, OModelParam< short int >, OModelParam< size_t >, OModelParam< VideoFormat >, OModelParam< LevelSpec >, OModelParam< IORtype >, OModelParam< RasterFileFormat >, OModelParam< ErrorStrategy >, OModelParam< MapCombineType >, OModelParam< MaxNormType >, OModelParam< bool >, OModelParam< PixPerDeg >, OModelParam< uint >, OModelParam< Dims >, OModelParam< SimTime >, OModelParam< OrientComputeType >, OModelParam< ContourConnectionType >, OModelParam< Point2D< int > >, and OModelParam< Point2D< float > >.
virtual std::string ModelParamBase::getValString | ( | ) | const [pure virtual] |
Get current value as a string (must be implemented by derived classes).
Implemented in NModelParam< T >, OModelParam< T >, NModelParam< PixRGB< byte > >, NModelParam< unsigned long >, NModelParam< double >, NModelParam< std::string >, NModelParam< VisualFeature >, NModelParam< float >, NModelParam< int >, NModelParam< unsigned int >, NModelParam< byte >, NModelParam< PyramidType >, NModelParam< bool >, NModelParam< SimTime >, NModelParam< uint >, OModelParam< ShapeEstimatorMode >, OModelParam< SVChanLevels >, OModelParam< PixRGB< byte > >, OModelParam< OpticalFlowType >, OModelParam< ContourChannelDynamicsType >, OModelParam< FpuPrecision >, OModelParam< unsigned long >, OModelParam< ShapeEstimatorSmoothMethod >, OModelParam< double >, OModelParam< ByteCount >, OModelParam< ColorComputeType >, OModelParam< Location >, OModelParam< std::string >, OModelParam< BitObjectDrawMode >, OModelParam< in_addr >, OModelParam< float >, OModelParam< VisualObjectMatchAlgo >, OModelParam< FrameRange >, OModelParam< int >, OModelParam< Rectangle >, OModelParam< unsigned int >, OModelParam< ResizeSpec >, OModelParam< Range< double > >, OModelParam< ContourChannelFilterStyle >, OModelParam< string >, OModelParam< FpuRoundingMode >, OModelParam< byte >, OModelParam< short int >, OModelParam< size_t >, OModelParam< VideoFormat >, OModelParam< LevelSpec >, OModelParam< IORtype >, OModelParam< RasterFileFormat >, OModelParam< ErrorStrategy >, OModelParam< MapCombineType >, OModelParam< MaxNormType >, OModelParam< bool >, OModelParam< PixPerDeg >, OModelParam< uint >, OModelParam< Dims >, OModelParam< SimTime >, OModelParam< OrientComputeType >, OModelParam< ContourConnectionType >, OModelParam< Point2D< int > >, and OModelParam< Point2D< float > >.
Referenced by ModelParamAuxImpl::printout(), ModelParamAuxImpl::readFrom(), CmdlineOptionManager::requestOption(), and ModelParamAuxImpl::writeTo().
virtual void ModelParamBase::printout | ( | std::ostream & | s, | |
const std::string & | prefix = "" | |||
) | const [pure virtual] |
Print out our name and contents, mostly for debugging.
Implemented in NModelParam< T >, OModelParam< T >, NModelParam< PixRGB< byte > >, NModelParam< unsigned long >, NModelParam< double >, NModelParam< std::string >, NModelParam< VisualFeature >, NModelParam< float >, NModelParam< int >, NModelParam< unsigned int >, NModelParam< byte >, NModelParam< PyramidType >, NModelParam< bool >, NModelParam< SimTime >, NModelParam< uint >, OModelParam< ShapeEstimatorMode >, OModelParam< SVChanLevels >, OModelParam< PixRGB< byte > >, OModelParam< OpticalFlowType >, OModelParam< ContourChannelDynamicsType >, OModelParam< FpuPrecision >, OModelParam< unsigned long >, OModelParam< ShapeEstimatorSmoothMethod >, OModelParam< double >, OModelParam< ByteCount >, OModelParam< ColorComputeType >, OModelParam< Location >, OModelParam< std::string >, OModelParam< BitObjectDrawMode >, OModelParam< in_addr >, OModelParam< float >, OModelParam< VisualObjectMatchAlgo >, OModelParam< FrameRange >, OModelParam< int >, OModelParam< Rectangle >, OModelParam< unsigned int >, OModelParam< ResizeSpec >, OModelParam< Range< double > >, OModelParam< ContourChannelFilterStyle >, OModelParam< string >, OModelParam< FpuRoundingMode >, OModelParam< byte >, OModelParam< short int >, OModelParam< size_t >, OModelParam< VideoFormat >, OModelParam< LevelSpec >, OModelParam< IORtype >, OModelParam< RasterFileFormat >, OModelParam< ErrorStrategy >, OModelParam< MapCombineType >, OModelParam< MaxNormType >, OModelParam< bool >, OModelParam< PixPerDeg >, OModelParam< uint >, OModelParam< Dims >, OModelParam< SimTime >, OModelParam< OrientComputeType >, OModelParam< ContourConnectionType >, OModelParam< Point2D< int > >, and OModelParam< Point2D< float > >.
virtual void ModelParamBase::readFrom | ( | const ParamMap & | pmap, | |
const bool | noerr = true | |||
) | [pure virtual] |
Get parameter value from ParamMap, notify client of the value change.
noerr | will not generate an error message if the parameter does not exist in ParamMap. |
Implemented in NModelParam< T >, OModelParam< T >, NModelParam< PixRGB< byte > >, NModelParam< unsigned long >, NModelParam< double >, NModelParam< std::string >, NModelParam< VisualFeature >, NModelParam< float >, NModelParam< int >, NModelParam< unsigned int >, NModelParam< byte >, NModelParam< PyramidType >, NModelParam< bool >, NModelParam< SimTime >, NModelParam< uint >, OModelParam< ShapeEstimatorMode >, OModelParam< SVChanLevels >, OModelParam< PixRGB< byte > >, OModelParam< OpticalFlowType >, OModelParam< ContourChannelDynamicsType >, OModelParam< FpuPrecision >, OModelParam< unsigned long >, OModelParam< ShapeEstimatorSmoothMethod >, OModelParam< double >, OModelParam< ByteCount >, OModelParam< ColorComputeType >, OModelParam< Location >, OModelParam< std::string >, OModelParam< BitObjectDrawMode >, OModelParam< in_addr >, OModelParam< float >, OModelParam< VisualObjectMatchAlgo >, OModelParam< FrameRange >, OModelParam< int >, OModelParam< Rectangle >, OModelParam< unsigned int >, OModelParam< ResizeSpec >, OModelParam< Range< double > >, OModelParam< ContourChannelFilterStyle >, OModelParam< string >, OModelParam< FpuRoundingMode >, OModelParam< byte >, OModelParam< short int >, OModelParam< size_t >, OModelParam< VideoFormat >, OModelParam< LevelSpec >, OModelParam< IORtype >, OModelParam< RasterFileFormat >, OModelParam< ErrorStrategy >, OModelParam< MapCombineType >, OModelParam< MaxNormType >, OModelParam< bool >, OModelParam< PixPerDeg >, OModelParam< uint >, OModelParam< Dims >, OModelParam< SimTime >, OModelParam< OrientComputeType >, OModelParam< ContourConnectionType >, OModelParam< Point2D< int > >, and OModelParam< Point2D< float > >.
void ModelParamBase::setHidden | ( | bool | v | ) | [inline] |
Change the param's hidden/visible setting.
Definition at line 152 of file ModelParamBase.H.
References MP_HIDDEN.
void ModelParamBase::setInactive | ( | bool | v | ) | [inline] |
Change the param's active/inactive setting.
Definition at line 146 of file ModelParamBase.H.
References MP_INACTIVE.
Referenced by NeoBrain::NeoBrain(), EnvSaliencyMap::paramChanged(), and EnvSegmenterColorRegion::paramChanged().
virtual bool ModelParamBase::setValGeneric | ( | const RefHolder & | ref | ) | [pure virtual] |
Set the current value through a dynamically-typed RefHolder, notify client of the change.
Implemented in NModelParam< T >, OModelParam< T >, NModelParam< PixRGB< byte > >, NModelParam< unsigned long >, NModelParam< double >, NModelParam< std::string >, NModelParam< VisualFeature >, NModelParam< float >, NModelParam< int >, NModelParam< unsigned int >, NModelParam< byte >, NModelParam< PyramidType >, NModelParam< bool >, NModelParam< SimTime >, NModelParam< uint >, OModelParam< ShapeEstimatorMode >, OModelParam< SVChanLevels >, OModelParam< PixRGB< byte > >, OModelParam< OpticalFlowType >, OModelParam< ContourChannelDynamicsType >, OModelParam< FpuPrecision >, OModelParam< unsigned long >, OModelParam< ShapeEstimatorSmoothMethod >, OModelParam< double >, OModelParam< ByteCount >, OModelParam< ColorComputeType >, OModelParam< Location >, OModelParam< std::string >, OModelParam< BitObjectDrawMode >, OModelParam< in_addr >, OModelParam< float >, OModelParam< VisualObjectMatchAlgo >, OModelParam< FrameRange >, OModelParam< int >, OModelParam< Rectangle >, OModelParam< unsigned int >, OModelParam< ResizeSpec >, OModelParam< Range< double > >, OModelParam< ContourChannelFilterStyle >, OModelParam< string >, OModelParam< FpuRoundingMode >, OModelParam< byte >, OModelParam< short int >, OModelParam< size_t >, OModelParam< VideoFormat >, OModelParam< LevelSpec >, OModelParam< IORtype >, OModelParam< RasterFileFormat >, OModelParam< ErrorStrategy >, OModelParam< MapCombineType >, OModelParam< MaxNormType >, OModelParam< bool >, OModelParam< PixPerDeg >, OModelParam< uint >, OModelParam< Dims >, OModelParam< SimTime >, OModelParam< OrientComputeType >, OModelParam< ContourConnectionType >, OModelParam< Point2D< int > >, and OModelParam< Point2D< float > >.
virtual bool ModelParamBase::setValString | ( | const std::string & | textval | ) | [pure virtual] |
Set the parameter value from a textual representation, notify client of the change.
Implemented in NModelParam< T >, OModelParam< T >, NModelParam< PixRGB< byte > >, NModelParam< unsigned long >, NModelParam< double >, NModelParam< std::string >, NModelParam< VisualFeature >, NModelParam< float >, NModelParam< int >, NModelParam< unsigned int >, NModelParam< byte >, NModelParam< PyramidType >, NModelParam< bool >, NModelParam< SimTime >, NModelParam< uint >, OModelParam< ShapeEstimatorMode >, OModelParam< SVChanLevels >, OModelParam< PixRGB< byte > >, OModelParam< OpticalFlowType >, OModelParam< ContourChannelDynamicsType >, OModelParam< FpuPrecision >, OModelParam< unsigned long >, OModelParam< ShapeEstimatorSmoothMethod >, OModelParam< double >, OModelParam< ByteCount >, OModelParam< ColorComputeType >, OModelParam< Location >, OModelParam< std::string >, OModelParam< BitObjectDrawMode >, OModelParam< in_addr >, OModelParam< float >, OModelParam< VisualObjectMatchAlgo >, OModelParam< FrameRange >, OModelParam< int >, OModelParam< Rectangle >, OModelParam< unsigned int >, OModelParam< ResizeSpec >, OModelParam< Range< double > >, OModelParam< ContourChannelFilterStyle >, OModelParam< string >, OModelParam< FpuRoundingMode >, OModelParam< byte >, OModelParam< short int >, OModelParam< size_t >, OModelParam< VideoFormat >, OModelParam< LevelSpec >, OModelParam< IORtype >, OModelParam< RasterFileFormat >, OModelParam< ErrorStrategy >, OModelParam< MapCombineType >, OModelParam< MaxNormType >, OModelParam< bool >, OModelParam< PixPerDeg >, OModelParam< uint >, OModelParam< Dims >, OModelParam< SimTime >, OModelParam< OrientComputeType >, OModelParam< ContourConnectionType >, OModelParam< Point2D< int > >, and OModelParam< Point2D< float > >.
Referenced by ModelParamAuxImpl::readFrom(), and CmdlineOptionManager::requestOption().
virtual void ModelParamBase::writeTo | ( | ParamMap & | pmap | ) | const [pure virtual] |
Write parameter value to ParamMap.
Implemented in NModelParam< T >, OModelParam< T >, NModelParam< PixRGB< byte > >, NModelParam< unsigned long >, NModelParam< double >, NModelParam< std::string >, NModelParam< VisualFeature >, NModelParam< float >, NModelParam< int >, NModelParam< unsigned int >, NModelParam< byte >, NModelParam< PyramidType >, NModelParam< bool >, NModelParam< SimTime >, NModelParam< uint >, OModelParam< ShapeEstimatorMode >, OModelParam< SVChanLevels >, OModelParam< PixRGB< byte > >, OModelParam< OpticalFlowType >, OModelParam< ContourChannelDynamicsType >, OModelParam< FpuPrecision >, OModelParam< unsigned long >, OModelParam< ShapeEstimatorSmoothMethod >, OModelParam< double >, OModelParam< ByteCount >, OModelParam< ColorComputeType >, OModelParam< Location >, OModelParam< std::string >, OModelParam< BitObjectDrawMode >, OModelParam< in_addr >, OModelParam< float >, OModelParam< VisualObjectMatchAlgo >, OModelParam< FrameRange >, OModelParam< int >, OModelParam< Rectangle >, OModelParam< unsigned int >, OModelParam< ResizeSpec >, OModelParam< Range< double > >, OModelParam< ContourChannelFilterStyle >, OModelParam< string >, OModelParam< FpuRoundingMode >, OModelParam< byte >, OModelParam< short int >, OModelParam< size_t >, OModelParam< VideoFormat >, OModelParam< LevelSpec >, OModelParam< IORtype >, OModelParam< RasterFileFormat >, OModelParam< ErrorStrategy >, OModelParam< MapCombineType >, OModelParam< MaxNormType >, OModelParam< bool >, OModelParam< PixPerDeg >, OModelParam< uint >, OModelParam< Dims >, OModelParam< SimTime >, OModelParam< OrientComputeType >, OModelParam< ContourConnectionType >, OModelParam< Point2D< int > >, and OModelParam< Point2D< float > >.