COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
covise::coChoiceParam Class Reference

parameter to choose values from a list More...

#include <coChoiceParam.h>

Inheritance diagram for covise::coChoiceParam:
Inheritance graph
[legend]
Collaboration diagram for covise::coChoiceParam:
Collaboration graph
[legend]

Public Types

enum  cmpMode { CASE_SENSITIVE, CASE_INSENSITIVE, ALPHA }
 
- Public Types inherited from covise::coUifPara
typedef int Typeinfo
 
- Public Types inherited from covise::coUifElem
enum  Kind { SWITCH, PARAM, INPORT, OUTPORT }
 enum Kind: SWITCH, PARAM, INPORT, OUTPORT More...
 

Public Member Functions

 coChoiceParam (const char *name, const char *desc)
 Constructor. More...
 
virtual ~coChoiceParam ()
 Destructor : virtual in case we derive objects. More...
 
virtual int isOfType (coUifPara::Typeinfo type)
 Check the type. More...
 
virtual int paramChange ()
 handle parameter changes: called by paramCB More...
 
virtual void initialize ()
 give dafault values to Covise -> automatically called ! More...
 
virtual void print (ostream &str) const
 print this to a stream More...
 
int updateValue (int numChoices, const char *const *choice, int actChoice, cmpMode cmp=CASE_INSENSITIVE)
 
int setValue (int numChoices, const char *const *choice, int actChoice)
 set/update the value: return 0 on error More...
 
int setValue (int numChoices, const std::vector< string > &list, int actChoice)
 
int setValue (int actChoice)
 set/update the value: return 0 on error More...
 
int setValue (const char *choiceLabel)
 set/update the value by giving choice label: return 0 on error More...
 
int getValue () const
 get the value More...
 
const char * getActLabel () const
 the the name of the label of the current selection More...
 
const char * getLabel (int i) const
 get label on number given number [1...numChoices] More...
 
int getNumChoices () const
 get number of choices More...
 
virtual const char * getTypeString () const
 get the type string of this parameter More...
 
virtual const char * getValString () const
 get the value of this parameter as a string More...
 
virtual void setValString (const char *str)
 set the value of this parameter from a string More...
 
- Public Member Functions inherited from covise::coUifPara
 coUifPara (const char *name, const char *desc)
 
virtual ~coUifPara ()
 Destructor. More...
 
virtual void setActive (int isActive)
 activate / de_activate the parameter More...
 
virtual void hide ()
 Hide this port. More...
 
virtual void show ()
 Show this port. More...
 
virtual int preCompute ()
 do whatever needed before compute CB : enforce that all parameters do sth. More...
 
virtual int switchable () const
 whether this port can be switched: default is true, overload for false More...
 
virtual void enable ()
 enable More...
 
virtual void disable ()
 disable More...
 
virtual Kind kind () const
 return my type of element: returns coUifElem::PARAM More...
 
int isActive () const
 check whether this port is active More...
 
void para_error (const char *what)
 send an error message strarting with "Parameter '<name>' " More...
 
- Public Member Functions inherited from covise::coPort
 coPort (const char *name, const char *desc)
 
virtual ~coPort ()
 Destructor : virtual in case we derive objects. More...
 
virtual const char * getName () const
 get the name of this object More...
 
virtual const char * getDesc () const
 get the description of this object More...
 
int isConnected () const
 Return whether this port is connected -> valid only in compute() More...
 
void setInfo (const char *value) const
 Set the info Popup text. More...
 
- Public Member Functions inherited from covise::coUifElem
virtual ~coUifElem ()
 Destructor : virtual because we derive objects. More...
 
virtual int postCompute ()
 do whatever is needed after compute CB : pre-set to do nothing More...
 

Static Public Member Functions

static coUifPara::Typeinfo getType ()
 get my type More...
 

Private Types

enum  { MAX_CHOICE_LABELS = 256 }
 

Private Member Functions

 coChoiceParam (const coChoiceParam &)
 Copy-Constructor: NOT IMPLEMENTED. More...
 
coChoiceParamoperator= (const coChoiceParam &)
 Assignment operator: NOT IMPLEMENTED. More...
 
 coChoiceParam ()
 Default constructor: NOT IMPLEMENTED. More...
 

Private Attributes

int d_numChoices
 Port data fields. More...
 
int d_activeChoice
 
char ** d_choice
 

Static Private Attributes

static coUifPara::Typeinfo s_paraType = coUifPara::numericType("CHOICE")
 my type info More...
 
static const char * s_type = "CHOICE"
 

Additional Inherited Members

- Protected Types inherited from covise::coPort
typedef int Typeinfo
 
- Static Protected Member Functions inherited from covise::coUifPara
static Typeinfo numericType (const char *typeStr)
 
- Protected Attributes inherited from covise::coUifPara
int d_active
 
- Protected Attributes inherited from covise::coPort
char * d_name
 
char * d_desc
 
char * d_defString
 
int d_init
 

Detailed Description

parameter to choose values from a list

Member Enumeration Documentation

anonymous enum
private
Enumerator
MAX_CHOICE_LABELS 

string compare modes for update ALPHA: compare only alphanumeric characters

Enumerator
CASE_SENSITIVE 
CASE_INSENSITIVE 
ALPHA 

Constructor & Destructor Documentation

covise::coChoiceParam::coChoiceParam ( const coChoiceParam )
private

Copy-Constructor: NOT IMPLEMENTED.

covise::coChoiceParam::coChoiceParam ( )
private

Default constructor: NOT IMPLEMENTED.

coChoiceParam::coChoiceParam ( const char *  name,
const char *  desc 
)

Constructor.

Constructor

coChoiceParam::~coChoiceParam ( )
virtual

Destructor : virtual in case we derive objects.

Destructor : virtual in case we derive objects

Member Function Documentation

const char * coChoiceParam::getActLabel ( ) const

the the name of the label of the current selection

const char * coChoiceParam::getLabel ( int  i) const

get label on number given number [1...numChoices]

get label on number given number

read out the choice labels

int coChoiceParam::getNumChoices ( ) const

get number of choices

coUifPara::Typeinfo coChoiceParam::getType ( )
static

get my type

get my type

const char * coChoiceParam::getTypeString ( ) const
virtual

get the type string of this parameter

get the type string of this parameter

Implements covise::coUifPara.

const char * coChoiceParam::getValString ( ) const
virtual

get the value of this parameter as a string

get the value of this parameter as a string

Implements covise::coUifPara.

int coChoiceParam::getValue ( ) const

get the value

get the value

void coChoiceParam::initialize ( )
virtual

give dafault values to Covise -> automatically called !

give dafault values to Covise -> automatically called !

Implements covise::coUifPara.

int coChoiceParam::isOfType ( coUifPara::Typeinfo  type)
virtual

Check the type.

Check the type

Implements covise::coUifPara.

coChoiceParam& covise::coChoiceParam::operator= ( const coChoiceParam )
private

Assignment operator: NOT IMPLEMENTED.

int coChoiceParam::paramChange ( )
virtual

handle parameter changes: called by paramCB

handle parameter changes: called by paramCB

Implements covise::coUifPara.

void coChoiceParam::print ( ostream &  str) const
virtual

print this to a stream

print this to a stream

Reimplemented from covise::coUifPara.

void coChoiceParam::setValString ( const char *  str)
virtual

set the value of this parameter from a string

set the value of this parameter from a string

Implements covise::coUifPara.

int coChoiceParam::setValue ( int  numChoices,
const char *const *  choice,
int  actChoice 
)

set/update the value: return 0 on error

int covise::coChoiceParam::setValue ( int  numChoices,
const std::vector< string > &  list,
int  actChoice 
)
int coChoiceParam::setValue ( int  actChoice)

set/update the value: return 0 on error

set the value: if called after init() : update on map

int coChoiceParam::setValue ( const char *  choiceLabel)

set/update the value by giving choice label: return 0 on error

set the value: if called after init() : update on map

int coChoiceParam::updateValue ( int  numChoices,
const char *const *  choice,
int  actChoice,
cmpMode  cmp = CASE_INSENSITIVE 
)

update the value: if possible select string from current selection in new choice list return 0 on error

Member Data Documentation

int covise::coChoiceParam::d_activeChoice
private
char** covise::coChoiceParam::d_choice
private
int covise::coChoiceParam::d_numChoices
private

Port data fields.

coUifPara::Typeinfo coChoiceParam::s_paraType = coUifPara::numericType("CHOICE")
staticprivate

my type info

const char * coChoiceParam::s_type = "CHOICE"
staticprivate

Static data


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