Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::Param Class Reference

This class Param provides generic support for parameters. More...

#include <Utils/Param.hh>

+ Inheritance diagram for BIAS::Param:
+ Collaboration diagram for BIAS::Param:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
bool * AddParamBool (const std::string &name, const std::string &help, bool deflt=false, char cmdshort=0, int Group=GRP_NOSHOW)
 
double * AddParamDouble (const std::string &name, const std::string &help, double deflt=0.0, double min=-DBL_MAX, double max=DBL_MAX, char cmdshort=0, int Group=GRP_NOSHOW)
 
int * AddParamEnum (const std::string &name, const std::string &help, const std::vector< std::string > &enums, const int deflt=0, const std::vector< int > *IDs=NULL, const char cmdshort=0, const int Group=GRP_NOSHOW)
 
int * AddParamInt (const std::string &name, const std::string &help, int deflt=0, int min=std::numeric_limits< int >::min(), int max=std::numeric_limits< int >::max(), char cmdshort=0, int Group=GRP_NOSHOW)
 For all adding routines: More...
 
std::string * AddParamString (const std::string &name, const std::string &help, std::string deflt="", char cmdshort=0, int Group=GRP_NOSHOW)
 
BIAS::Vector< double > * AddParamVecDbl (const std::string &name, const std::string &help, const BIAS::Vector< double > &deflt, char cmdshort=0, int Group=GRP_NOSHOW)
 
Add a parameter that expects a string on command line

like "<value0> <value1> <value2> ..."
A vector of double must be given as default vector! More...

 
BIAS::Vector< double > * AddParamVecDbl (const std::string &name, const std::string &help, const std::string &deflt, char cmdshort=0, int Group=GRP_NOSHOW)
 
The same as above, but default is given by a string,

syntax is as at command line "v_0 v_1 v_2", don't set empty string, cause the length is determined also by the number of values More...

 
BIAS::Vector< int > * AddParamVecInt (const std::string &name, const std::string &help, const BIAS::Vector< int > &deflt, char cmdshort=0, int Group=GRP_NOSHOW)
 
 Add a parameter that expects a string on command line

like "<value0> <value1> <value2> ..."
A vector of integer must be given a default vector! More...

 
BIAS::Vector< int > * AddParamVecInt (const std::string &name, const std::string &help, const std::string &deflt, char cmdshort=0, int Group=GRP_NOSHOW)
 
The same as other AddParamVecInt(), but default is given by a string,

syntax is as at command line "v_0 v_1 v_2". More...

 
bool CheckParam (const std::string &name)
 Check if parameter has already been added. More...
 
void ClearAllParams ()
 empties internal datastructures More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
void DisableDestructorWarning ()
 
Uses this just before end of your program to avoid error from

destructor. More...

 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
int GetFreeGroupID ()
 returns unused group id More...
 
int GetGroupID (const std::string &name)
 returns group id of parameter with name More...
 
int GetGroupIDForGroupName (const std::string &name)
 
std::string GetGroupName (const int group_id)
 gets the name of a group More...
 
bool * GetParamBool (const std::string &name) const
 
bool * GetParamBoolByIndex (const int i) const
 Get a Param-value by Index. More...
 
double * GetParamDouble (const std::string &name) const
 
double * GetParamDoubleByIndex (const int i) const
 Get a Param-value by Index. More...
 
int * GetParamEnum (const std::string &name) const
 
int * GetParamInt (const std::string &name) const
 
int * GetParamIntByIndex (const int i) const
 Get a Param-value by Index. More...
 
std::string * GetParamString (const std::string &name) const
 
std::string * GetParamStringByIndex (const int i) const
 Get a Param-value by Index. More...
 
BIAS::Vector< double > * GetParamVecDbl (const std::string &name) const
 
BIAS::Vector< int > * GetParamVecInt (const std::string &name) const
 
int GetSizeOfLongestParamName ()
 returns the size of the longest param name not marked as enhanced or hidden More...
 
int GetSizeOfLongestParamValueString ()
 returns the size of the longest param value string not marked as enhanced or hidden More...
 
bool GetWriteFlag ()
 
bool IsUsedGroupID (const int group_id)
 returns if the group id is used More...
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
 Param (bool DisableDestructorWarning=false)
 
int ParseCommandLine (int &argc, char *argv[])
 scan command line arguments for valid parameters More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
int ReadParameter (const std::string &filename)
 read values for parameters from file More...
 
int ReadParameterXML (const std::string &filename)
 read values for parameters from xml-file More...
 
int RegisterCallbackObject (const std::string &name, ParamCallbackInterface *obj)
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void SetDefaults ()
 sets all entries to their initially (AddParam) given default values More...
 
int SetEnhancedFlag (const std::string &name, bool enhanced)
 if a parametr is marked as enhanced, it is hidden from the naive user More...
 
int SetGroupName (const int group_id, const std::string &name)
 sets the name for a group More...
 
int SetHiddenFlag (const std::string &name, bool hidden)
 if a parametr is marked as hidden, it is obsolete and hidden for all users, use this for parameters overwritten by caller class More...
 
bool * SetParamBool (const std::string &name, const bool &value)
 
double * SetParamDouble (const std::string &name, const double &value)
 
int * SetParamEnum (const std::string &name, const int &value)
 set the enum to the ID 'value' More...
 
int * SetParamEnum (const std::string &name, const std::string &value)
 set the enum to the ID corresponding to the string 'value' More...
 
int SetParameterWriteToFile (const std::string &name, bool writeToFile)
 
int * SetParamInt (const std::string &name, const int &value)
 
std::string * SetParamString (const std::string &name, const std::string &value)
 
BIAS::Vector< double > * SetParamVecDbl (const std::string &name, const BIAS::Vector< double > &value)
 
BIAS::Vector< int > * SetParamVecInt (const std::string &name, const BIAS::Vector< int > &value)
 
virtual int SetRangeInt (const std::string &name, const int min, const int max)
 
Set [Min,Max] as new range, especially usefull in derived class

PramGUI More...

 
int SetShortCommand (const std::string &name, const char cmd)
 Add a short commandline switch to an existing parameter. More...
 
void SetWriteOptions (bool indent, bool comments, bool enhanced)
 
void ShowData (std::ostream &os=std::cout, int grp=GRP_ALL, bool showenhanced=true)
 print all data in group grp including current values to os if grp = GRP_ALL, print all values if showenhanced = false, parameters marked as enhanced are not shown More...
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
std::vector< int > UniqueSortedGroups ()
 Returns a vector of all group IDs (unique) in ascending order. More...
 
int UpdateParameter (int &argc, char *argv[], const std::string &default_filename)
 update all arguments from command line and parameter file More...
 
void Usage (std::ostream &os=std::cout)
 print Help-Information to stdout More...
 
int WriteParameter (const std::string &filename)
 store complete set of parameter in file if write_comments is set, alo the help strings are written to the file if show_enhanced is set, also parameters marked as enhanced are written More...
 
int WriteParameterXML (const std::string &filename)
 
int WriteRunMe (const std::string &filename)
 
writes complete command line including program name and

unknown command line options, no defaults, no params read from file More...

 
virtual ~Param ()
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static int ParseListFile (const std::string &ListFileName, std::vector< std::string > &LinesInFile)
 Extracts lines from passed file. More...
 
static void SetGlobalDebugLevel (long int lev)
 

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
std::map< const std::string,
BIAS::ParamTypeBase * > & 
GetParamMap ()
 
const std::map< const
std::string,
BIAS::ParamTypeBase * > & 
GetParamMap () const
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 
std::vector< std::string > ArgV_
 
bool DestructorWarning_
 
std::vector< std::string > GroupNames_
 
struct optionlongopts
 
bool WriteComments_
 
bool WriteEnhanced_
 
bool WriteFlagSet_
 
bool WriteIndent_
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

This class Param provides generic support for parameters.

This is the documentation for the BIAS::Param and the BIAS::ParamGUI classes.

Philosophy

The idea behind the Param object is a common class to register all program parameters in. These parameters can be set from the command line, read and written to a file or be edited in a graphical interface that is programmed using the wxWidgets framework toolkit.

Usage

There are the following seven parameter types:

At first you create your instance of the Param oder ParamGUI object in your application. Afterwards you register your parameters by using the AddParam... methods corresponding to each of the types above:

The methods are

Each method has the parameters name, a help-string, a default-value, a short-command and a group ID as parameters. The name must be unique! An error is displayed if you add a new parameter with an already existing name. The help-string should describe the command in a short way. If you use the short-command, the parameter can be set at the command line with -<short-command> additionally to –<parameter-name>. Using the group ID you can put parameters of similar meaning in single groups, which is useful for visualization. The first four parameter types come along with standard default values. For the vector types you must provide an initial vector when adding a new parameter. When setting new vectors later in your program, the vector must be of the size given by the initial one. Using the method ParseCommandLine you can set the values for the registered parameters from the command line. Also you can use the default parameters 'readconfig' and 'writeconfig' to read or write a configuration from/to a file.

In your program you can use the GetParam... and SetParam... methods to receive a pointer to the data or to set new values for the parameters.

The GUI

The BIAS::ParamGUI class is derived from the BIAS::Param class and provides the four methods

GetPanel, GetDialog, GetNotebook and GetFrame.

The GetPanel method returns a pointer to a wxPanel where the widgets for the parameters belonging to the given group are placed.

The GetNotebook method returns a pointer to a wxNotebook where on each notebook page is placed a panel with the parameters of one group.

These two can be placed in your GUI application as you like to. If you want a standalone frame with the notebook inside you use the GetFrame method.

The GetFrame method returns a pointer to a wxFrame in which a wxNotebook with all groups of parameters is embedded.

Why pointers?

A big question about this object is why pointers are returned by the Add-, Get- and Set-methods. Well, is it wanted, that the data is only stored at one location and that is the Param object, so if you are interested in a value, you get the pointer to it.

Internals

Classes:

BIAS::ParamTypeBase | +– BIAS::ParamTypeInt | +– BIAS::ParamTypeBool | +– BIAS::ParamTypeString | +– BIAS::ParamTypeDouble | +– BIAS::ParamTypeVecDbl | +– BIAS::ParamTypeVecInt | +– BIAS::ParamTypeEnum

BIAS::Param | +– BIAS::ParamGUI

STL maps:

In BIAS::Param the main data struct holding the parameter data is a STL map. The key-value-pairs are of the type string,ParamTypeBase*.

The key-string holds the name of the parameter which is also stored in the parameter type class.

The ParamTypeEnum class holds another STL map with key of type string and value of type int. This is used for easier name->number translation.

In the GUI class also has a STL map of type unsigned int,struct ItemAndWidget to map event IDs to the corresponding control widget and parameter data.

Author
Jan-Friso Evers-Senne, Matthias Dunda

Note about bool: bool options can be used on the cmdl as follow: -b -> result in "true" –bool=true -> result in "true" –bool=<any other="" string>=""> -> result in "false" –bool <any string>=""> -> Not allowed.

Examples:
ExampleAbsoluteOrientation.cpp, ExampleAutoCalib.cpp, ExampleBlobDetectorLevelSet.cpp, ExampleCalcRelativeTransform.cpp, ExampleCameraPath2Vrml.cpp, ExampleCannyEdge.cpp, ExampleColorNCC.cpp, ExampleCylinderMapping.cpp, ExampleGenSynthMatches.cpp, ExampleGenSynthMatchesRig.cpp, ExampleLogPolarMapping.cpp, ExampleMatchDataBase.cpp, ExampleMDCamToShm.cpp, ExampleMultipleDepthWarp.cpp, ExampleMultisampleBlit.cpp, ExampleParam.cpp, ExamplePlainPerPixelProcessing.cpp, ExampleProjectionMapping.cpp, ExamplePyramidImage.cpp, ExampleRectification.cpp, ExampleTemplateSpecializedBatch.cpp, ExampleTFT.cpp, ExampleTrackerBase.cpp, ExampleTransformToCartesian.cpp, ExampleVideoServer.cpp, ExampleXB3Rectification.cpp, ParamGUISample1.cpp, ParamGUISample3.cpp, and ProjectionError.cpp.

Definition at line 231 of file Param.hh.

Constructor & Destructor Documentation

Param::Param ( bool  DisableDestructorWarning = false)
explicit

Definition at line 74 of file Param.cpp.

Param::~Param ( )
virtual

Definition at line 107 of file Param.cpp.

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

bool * Param::AddParamBool ( const std::string &  name,
const std::string &  help,
bool  deflt = false,
char  cmdshort = 0,
int  Group = GRP_NOSHOW 
)
double * Param::AddParamDouble ( const std::string &  name,
const std::string &  help,
double  deflt = 0.0,
double  min = -DBL_MAX,
double  max = DBL_MAX,
char  cmdshort = 0,
int  Group = GRP_NOSHOW 
)
int * Param::AddParamEnum ( const std::string &  name,
const std::string &  help,
const std::vector< std::string > &  enums,
const int  deflt = 0,
const std::vector< int > *  IDs = NULL,
const char  cmdshort = 0,
const int  Group = GRP_NOSHOW 
)
@param enums holds all enumeration names.
Parameters
IDscan be a pointer to a vector of integers. It must have the same size as 'enums' and gives each name a number, which must be unique! If NULL the enums are numbered from 0 to enums.size()-1
Author
mdunda 03 2004
Examples:
ExampleAbsoluteOrientation.cpp, ExampleCylinderMapping.cpp, ExampleParam.cpp, and ExampleRectification.cpp.

Definition at line 468 of file Param.cpp.

References BIAS::ParamTypeEnum::default_, BIAS::ParamTypeBase::Group_, BIAS::ParamTypeBase::Help_, BIAS::ParamTypeEnum::Map_, BIAS::ParamTypeBase::Name_, BIAS::ParamTypeBase::ShortCmd_, BIAS::ParamTypeEnum::value_, and BIAS::ParamTypeBase::WriteToFile_.

int * Param::AddParamInt ( const std::string &  name,
const std::string &  help,
int  deflt = 0,
int  min = std::numeric_limits<int>::min(),
int  max = std::numeric_limits<int>::max(),
char  cmdshort = 0,
int  Group = GRP_NOSHOW 
)

For all adding routines:

Parameters
nameis the unique identifier of the parameter
helpis a help or 'tooltip' string for that parameter
defltis a default value for that parameter. Note that not every parameter type has a default at compile time!
cmdshortis a short command option for the command line
Groupis a number to group some parameters for visualization, e.g. all matchers are in group 1, all trackers are in group 37 etc. When printing to screen, you can limit the output to a group of interest. The default is 0 - no special group.
Author
mdunda 03 2004
Examples:
ExampleAbsoluteOrientation.cpp, ExampleAutoCalib.cpp, ExampleBlobDetectorLevelSet.cpp, ExampleCannyEdge.cpp, ExampleColorNCC.cpp, ExampleMDCamToShm.cpp, ExampleMultisampleBlit.cpp, ExampleParam.cpp, ExamplePlainPerPixelProcessing.cpp, ExampleProjectionMapping.cpp, ExamplePyramidImage.cpp, ParamGUISample1.cpp, ParamGUISample2.cpp, ParamGUISample3.cpp, and ProjectionError.cpp.

Definition at line 276 of file Param.cpp.

References BIAS::ParamTypeInt::default_, BIAS::ParamTypeBase::Group_, BIAS::ParamTypeBase::Help_, BIAS::ParamTypeInt::max_, BIAS::ParamTypeInt::min_, BIAS::ParamTypeBase::Name_, BIAS::ParamTypeBase::ShortCmd_, BIAS::ParamTypeInt::value_, and BIAS::ParamTypeBase::WriteToFile_.

Referenced by BIAS::MatchDataBase::_AddParameter(), BIAS::GenSynthMatches::_AddParameter(), and BIAS::GenSynthMatchesRig::AddParameters_().

std::string * Param::AddParamString ( const std::string &  name,
const std::string &  help,
std::string  deflt = "",
char  cmdshort = 0,
int  Group = GRP_NOSHOW 
)
BIAS::Vector< double > * Param::AddParamVecDbl ( const std::string &  name,
const std::string &  help,
const BIAS::Vector< double > &  deflt,
char  cmdshort = 0,
int  Group = GRP_NOSHOW 
)

Add a parameter that expects a string on command line

like "<value0> <value1> <value2> ..."
A vector of double must be given as default vector!

Examples:
ExampleCameraPath2Vrml.cpp, ExampleColorNCC.cpp, ExampleParam.cpp, and ExampleProjectionMapping.cpp.

Definition at line 378 of file Param.cpp.

References BIAS::ParamTypeVecDbl::default_, BIAS::ParamTypeBase::Group_, BIAS::ParamTypeBase::Help_, BIAS::ParamTypeBase::Name_, BIAS::ParamTypeBase::ShortCmd_, BIAS::ParamTypeVecDbl::value_, and BIAS::ParamTypeBase::WriteToFile_.

Referenced by BIAS::GenSynthMatches::_AddParameter().

BIAS::Vector< double > * Param::AddParamVecDbl ( const std::string &  name,
const std::string &  help,
const std::string &  deflt,
char  cmdshort = 0,
int  Group = GRP_NOSHOW 
)

The same as above, but default is given by a string,

syntax is as at command line "v_0 v_1 v_2", don't set empty string, cause the length is determined also by the number of values

Author
Daniel Grest, July 2005

Definition at line 401 of file Param.cpp.

References TNT::Vector< T >::newsize().

BIAS::Vector< int > * Param::AddParamVecInt ( const std::string &  name,
const std::string &  help,
const BIAS::Vector< int > &  deflt,
char  cmdshort = 0,
int  Group = GRP_NOSHOW 
)

 Add a parameter that expects a string on command line

like "<value0> <value1> <value2> ..."
A vector of integer must be given a default vector!

Examples:
ExampleBlobDetectorLevelSet.cpp, and ExampleParam.cpp.

Definition at line 423 of file Param.cpp.

References BIAS::ParamTypeVecInt::default_, BIAS::ParamTypeBase::Group_, BIAS::ParamTypeBase::Help_, BIAS::ParamTypeBase::Name_, BIAS::ParamTypeBase::ShortCmd_, BIAS::ParamTypeVecInt::value_, and BIAS::ParamTypeBase::WriteToFile_.

BIAS::Vector< int > * Param::AddParamVecInt ( const std::string &  name,
const std::string &  help,
const std::string &  deflt,
char  cmdshort = 0,
int  Group = GRP_NOSHOW 
)

The same as other AddParamVecInt(), but default is given by a string,

syntax is as at command line "v_0 v_1 v_2".

Don't set empty string, cause the length is determined also by the number of values

Author
Daniel Grest, July 2005

Definition at line 446 of file Param.cpp.

References TNT::Vector< T >::newsize().

bool Param::CheckParam ( const std::string &  name)

Check if parameter has already been added.

Examples:
ExampleColorNCC.cpp.

Definition at line 527 of file Param.cpp.

Referenced by BIAS::MatchDataBase::_AddParameter(), BIAS::GenSynthMatches::_AddParameter(), and BIAS::GenSynthMatchesRig::AddParameters_().

void Param::ClearAllParams ( )

empties internal datastructures

Definition at line 1899 of file Param.cpp.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

void BIAS::Param::DisableDestructorWarning ( )
inline

Uses this just before end of your program to avoid error from

destructor.

Author
evers
Examples:
ExampleColorNCC.cpp, ExampleCylinderMapping.cpp, ExampleGenSynthMatches.cpp, ExampleGenSynthMatchesRig.cpp, ExampleMDCamToShm.cpp, ExamplePyramidImage.cpp, and ExampleTrackerBase.cpp.

Definition at line 513 of file Param.hh.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

int Param::GetFreeGroupID ( )
static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

int Param::GetGroupID ( const std::string &  name)

returns group id of parameter with name

Author
woelk

Definition at line 1430 of file Param.cpp.

Referenced by BIAS::MatchDataBase::_AddParameter(), BIAS::GenSynthMatches::_AddParameter(), and BIAS::GenSynthMatchesRig::AddParameters_().

int Param::GetGroupIDForGroupName ( const std::string &  name)
Author
evers

Definition at line 1440 of file Param.cpp.

std::string Param::GetGroupName ( const int  group_id)

gets the name of a group

Author
woelk

Definition at line 1465 of file Param.cpp.

Referenced by BIAS::ParamGUI::GetNotebook().

bool * Param::GetParamBool ( const std::string &  name) const
bool * Param::GetParamBoolByIndex ( const int  i) const

Get a Param-value by Index.

Running-time is O(n). Grouping and other features are unsupported by this function.

Author
Stefan Goerrissen, 09/2008

Definition at line 576 of file Param.cpp.

double * Param::GetParamDouble ( const std::string &  name) const
double * Param::GetParamDoubleByIndex ( const int  i) const

Get a Param-value by Index.

Running-time is O(n). Grouping and other features are unsupported by this function.

Author
Stefan Goerrissen, 09/2008

Definition at line 555 of file Param.cpp.

int * Param::GetParamEnum ( const std::string &  name) const
Examples:
ExampleCylinderMapping.cpp.

Definition at line 712 of file Param.cpp.

int * Param::GetParamInt ( const std::string &  name) const
int * Param::GetParamIntByIndex ( const int  i) const

Get a Param-value by Index.

Running-time is O(n). Grouping and other features are unsupported by this function.

Author
Stefan Goerrissen, 09/2008

Definition at line 534 of file Param.cpp.

std::map< const std::string, BIAS::ParamTypeBase * > & Param::GetParamMap ( )
protected

Definition at line 1885 of file Param.cpp.

Referenced by BIAS::ParamGUI::GetPanel().

const std::map< const std::string, BIAS::ParamTypeBase * > & Param::GetParamMap ( ) const
protected

Definition at line 1891 of file Param.cpp.

std::string * Param::GetParamString ( const std::string &  name) const
std::string * Param::GetParamStringByIndex ( const int  i) const

Get a Param-value by Index.

Running-time is O(n). Grouping and other features are unsupported by this function.

Author
Stefan Goerrissen, 09/2008

Definition at line 597 of file Param.cpp.

BIAS::Vector< double > * Param::GetParamVecDbl ( const std::string &  name) const
BIAS::Vector< int > * Param::GetParamVecInt ( const std::string &  name) const
Examples:
ExampleBlobDetectorLevelSet.cpp.

Definition at line 696 of file Param.cpp.

int Param::GetSizeOfLongestParamName ( )

returns the size of the longest param name not marked as enhanced or hidden

Author
woelk 10/2004

Definition at line 1502 of file Param.cpp.

int Param::GetSizeOfLongestParamValueString ( )

returns the size of the longest param value string not marked as enhanced or hidden

Author
woelk 10/2004

Definition at line 1516 of file Param.cpp.

bool BIAS::Param::GetWriteFlag ( )
inline

Definition at line 383 of file Param.hh.

bool Param::IsUsedGroupID ( const int  group_id)

returns if the group id is used

Author
woelk

Definition at line 1496 of file Param.cpp.

Referenced by BIAS::GenSynthMatches::_AddParameter(), and BIAS::GenSynthMatchesRig::AddParameters_().

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
int Param::ParseCommandLine ( int &  argc,
char *  argv[] 
)

scan command line arguments for valid parameters

argv is reordered according to getopt() all no recognized arguments

are at the end. Return value is optind from getopt(), the index of the next not recognized argument. Sometimes, the function however returns negative values. ?

Todo:
document concept of return value of ParseCommandLine Reads parameter from file if argument –readconfig is given.
Author
evers

this delete let the program bail out. but it realy should be deleted

Examples:
ExampleAbsoluteOrientation.cpp, ExampleBlobDetectorLevelSet.cpp, ExampleCalcRelativeTransform.cpp, ExampleCameraPath2Vrml.cpp, ExampleColorNCC.cpp, ExampleCylinderMapping.cpp, ExampleGenSynthMatches.cpp, ExampleGenSynthMatchesRig.cpp, ExampleLogPolarMapping.cpp, ExampleMDCamToShm.cpp, ExampleParam.cpp, ExampleProjectionMapping.cpp, ExamplePyramidImage.cpp, ExampleRectification.cpp, ExampleTFT.cpp, ExampleVideoServer.cpp, ParamGUISample2.cpp, and ProjectionError.cpp.

Definition at line 1028 of file Param.cpp.

References option::has_arg, and option::name.

Referenced by BIAS::IOUtils::ParseCommandLineEvalHelp().

int Param::ParseListFile ( const std::string &  ListFileName,
std::vector< std::string > &  LinesInFile 
)
static

Extracts lines from passed file.

The specified file is expected to contain a list of entries. Those entries are assumed to be seperated by newlines.

Parameters
ListFileNameRoutine tries to open file with this name.
LinesInFileresult of line extraction.
Returns
-1 if file could not be opened.
0 all good.
Examples:
ExampleMixtureOfGaussians.cpp.

Definition at line 1853 of file Param.cpp.

Referenced by BIAS::IOUtils::LoadImageList(), and BIAS::BVWXMainFrame::LoadImages().

void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

int Param::ReadParameter ( const std::string &  filename)

read values for parameters from file

Examples:
ExampleAutoCalib.cpp, ExampleGenSynthMatches.cpp, ExampleGenSynthMatchesRig.cpp, and ExampleTFT.cpp.

Definition at line 1219 of file Param.cpp.

int Param::ReadParameterXML ( const std::string &  filename)
int Param::RegisterCallbackObject ( const std::string &  name,
ParamCallbackInterface obj 
)
Author
evers
Examples:
ParamGUISample1.cpp, and ParamGUISample3.cpp.

Definition at line 1813 of file Param.cpp.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

void Param::SetDefaults ( )

sets all entries to their initially (AddParam) given default values

Definition at line 1806 of file Param.cpp.

int Param::SetEnhancedFlag ( const std::string &  name,
bool  enhanced 
)

if a parametr is marked as enhanced, it is hidden from the naive user

Definition at line 957 of file Param.cpp.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

int Param::SetGroupName ( const int  group_id,
const std::string &  name 
)
int Param::SetHiddenFlag ( const std::string &  name,
bool  hidden 
)

if a parametr is marked as hidden, it is obsolete and hidden for all users, use this for parameters overwritten by caller class

Definition at line 970 of file Param.cpp.

bool * Param::SetParamBool ( const std::string &  name,
const bool &  value 
)

Definition at line 757 of file Param.cpp.

double * Param::SetParamDouble ( const std::string &  name,
const double &  value 
)

Definition at line 802 of file Param.cpp.

int * Param::SetParamEnum ( const std::string &  name,
const int &  value 
)

set the enum to the ID 'value'

Definition at line 917 of file Param.cpp.

int * Param::SetParamEnum ( const std::string &  name,
const std::string &  value 
)

set the enum to the ID corresponding to the string 'value'

Definition at line 890 of file Param.cpp.

int Param::SetParameterWriteToFile ( const std::string &  name,
bool  writeToFile 
)

Definition at line 944 of file Param.cpp.

int * Param::SetParamInt ( const std::string &  name,
const int &  value 
)

Definition at line 729 of file Param.cpp.

std::string * Param::SetParamString ( const std::string &  name,
const std::string &  value 
)

Definition at line 779 of file Param.cpp.

BIAS::Vector< double > * Param::SetParamVecDbl ( const std::string &  name,
const BIAS::Vector< double > &  value 
)

Definition at line 830 of file Param.cpp.

BIAS::Vector< int > * Param::SetParamVecInt ( const std::string &  name,
const BIAS::Vector< int > &  value 
)

Definition at line 860 of file Param.cpp.

int Param::SetRangeInt ( const std::string &  name,
const int  min,
const int  max 
)
virtual

Set [Min,Max] as new range, especially usefull in derived class

PramGUI

Definition at line 1825 of file Param.cpp.

References BIAS::ParamTypeInt::max_, and BIAS::ParamTypeInt::min_.

int Param::SetShortCommand ( const std::string &  name,
const char  cmd 
)

Add a short commandline switch to an existing parameter.

Useful for readconfig/writeconfig.

Author
evers
Examples:
ExampleVideoServer.cpp.

Definition at line 1841 of file Param.cpp.

void BIAS::Param::SetWriteOptions ( bool  indent,
bool  comments,
bool  enhanced 
)
inline
void Param::ShowData ( std::ostream &  os = std::cout,
int  grp = GRP_ALL,
bool  showenhanced = true 
)

print all data in group grp including current values to os if grp = GRP_ALL, print all values if showenhanced = false, parameters marked as enhanced are not shown

Examples:
ExampleAutoCalib.cpp, and ExampleParam.cpp.

Definition at line 121 of file Param.cpp.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

vector< int > Param::UniqueSortedGroups ( )

Returns a vector of all group IDs (unique) in ascending order.

Only parameters are with WriteToFile_ = true are considered.

Author
woelk 03 2004

Definition at line 1483 of file Param.cpp.

Referenced by BIAS::ParamGUI::GetNotebook().

int Param::UpdateParameter ( int &  argc,
char *  argv[],
const std::string &  default_filename 
)

update all arguments from command line and parameter file

  1. reads parameter from default file
  2. if –readconfig is given on commandline, reads parameter from this file
  3. evaluates parameter given on command line

Command line arguments take precedence over arguments from parameter file. Parameter from parameter file specified with –readconfig=fname take precedencor over parameter read from default_filename. If no parameterfile is found, the defaults are written to default_name.

Author
woelk 09/2004
Examples:
ExampleTrackerBase.cpp.

Definition at line 985 of file Param.cpp.

void Param::Usage ( std::ostream &  os = std::cout)
int Param::WriteParameter ( const std::string &  filename)

store complete set of parameter in file if write_comments is set, alo the help strings are written to the file if show_enhanced is set, also parameters marked as enhanced are written

Author
??
Examples:
ExampleAutoCalib.cpp, ExampleGenSynthMatches.cpp, ExampleGenSynthMatchesRig.cpp, and ExampleTFT.cpp.

Definition at line 1531 of file Param.cpp.

int Param::WriteParameterXML ( const std::string &  filename)
int Param::WriteRunMe ( const std::string &  filename)

writes complete command line including program name and

unknown command line options, no defaults, no params read from file

Definition at line 1773 of file Param.cpp.

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::vector<std::string> BIAS::Param::ArgV_
protected

Definition at line 547 of file Param.hh.

bool BIAS::Param::DestructorWarning_
protected

Definition at line 550 of file Param.hh.

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

std::vector<std::string> BIAS::Param::GroupNames_
protected

Definition at line 548 of file Param.hh.

Referenced by BIAS::ParamGUI::GetNotebook().

struct option* BIAS::Param::longopts
protected

Definition at line 549 of file Param.hh.

bool BIAS::Param::WriteComments_
protected

Definition at line 553 of file Param.hh.

bool BIAS::Param::WriteEnhanced_
protected

Definition at line 554 of file Param.hh.

bool BIAS::Param::WriteFlagSet_
protected

Definition at line 555 of file Param.hh.

bool BIAS::Param::WriteIndent_
protected

Definition at line 552 of file Param.hh.


The documentation for this class was generated from the following files: