OpendTect  7.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EnumDef Class Reference

Holds data pertinent to a certain enum. It does not know the enum values themselves, but treat them as integers. More...

Inheritance diagram for EnumDef:
[legend]

Public Member Functions

 EnumDef ()
 
 EnumDef (const char *nm, const char *s[], short nrs=0)
 
void add (const char *key, const uiString &, int enumval, const char *iconfile)
 
int convert (const char *txt) const
 
const char * convert (int idx) const
 
int getEnumValForIndex (int) const
 
const char * getIconFileForIndex (int idx) const
 
const char * getKeyForIndex (int i) const
 
uiString getUiStringForIndex (int i) const
 
int indexOf (const char *s) const
 
int indexOf (int enumval) const
 
bool isValidKey (const char *) const
 
bool isValidName (const char *key) const
 
const BufferStringSetkeys () const
 
void remove (const char *key)
 
void setIconFileForIndex (int idx, const char *)
 
void setUiStringForIndex (int, const uiString &)
 
int size () const
 
const uiStringSetstrings () const
 
bool validIdx (int idx) const
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=nullptr)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
virtual BufferString getName () const
 
bool getNameFromPar (const IOPar &)
 
const name_typename () const override
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual void setName (const char *nm)
 
- Public Member Functions inherited from ObjectWithName
virtual ~ObjectWithName ()
 
bool hasName (const char *nm) const
 
bool hasName (const name_type &nm) const
 
void putNameInPar (IOPar &) const
 

Protected Member Functions

void fillUiStrings ()
 

Protected Attributes

TypeSet< int > enums_
 
BufferStringSet iconfiles_
 
BufferStringSet keys_
 
uiStringSet uistrings_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Additional Inherited Members

- Public Types inherited from ObjectWithName
typedef OD::String name_type
 

Detailed Description

Holds data pertinent to a certain enum. It does not know the enum values themselves, but treat them as integers.

In most cases, the inherited EnumDefImpl<ENUM> is used, but a stand-alone EnumDef can be used if one wants to use combinations of enums that are not available as EnumDefImpl.

A stand-alone EnumDef can be created as follows to create a combo box with all enums in Stats::Type without the average.

EnumDef def = Stats::TypeDef();
def.remove( def.getKey(Stats::Average) );
new uiComboBox( this, def );
Holds data pertinent to a certain enum. It does not know the enum values themselves,...
Definition: enums.h:41
void remove(const char *key)
Combo box.
Definition: uicombobox.h:30
@ Average
Definition: stattype.h:21

<>

Constructor & Destructor Documentation

◆ EnumDef() [1/2]

EnumDef::EnumDef ( )

◆ EnumDef() [2/2]

EnumDef::EnumDef ( const char *  nm,
const char *  s[],
short  nrs = 0 
)

Member Function Documentation

◆ add()

void EnumDef::add ( const char *  key,
const uiString ,
int  enumval,
const char *  iconfile 
)

◆ convert() [1/2]

int EnumDef::convert ( const char *  txt) const
inline

◆ convert() [2/2]

const char* EnumDef::convert ( int  idx) const
inline

◆ fillUiStrings()

void EnumDef::fillUiStrings ( )
protected

◆ getEnumValForIndex()

int EnumDef::getEnumValForIndex ( int  ) const

◆ getIconFileForIndex()

const char* EnumDef::getIconFileForIndex ( int  idx) const

◆ getKeyForIndex()

const char* EnumDef::getKeyForIndex ( int  i) const

◆ getUiStringForIndex()

uiString EnumDef::getUiStringForIndex ( int  i) const

◆ indexOf() [1/2]

int EnumDef::indexOf ( const char *  s) const

◆ indexOf() [2/2]

int EnumDef::indexOf ( int  enumval) const

◆ isValidKey()

bool EnumDef::isValidKey ( const char *  ) const

◆ isValidName()

bool EnumDef::isValidName ( const char *  key) const
inline

◆ keys()

const BufferStringSet& EnumDef::keys ( ) const
inline

◆ remove()

void EnumDef::remove ( const char *  key)

◆ setIconFileForIndex()

void EnumDef::setIconFileForIndex ( int  idx,
const char *   
)

◆ setUiStringForIndex()

void EnumDef::setUiStringForIndex ( int  ,
const uiString  
)

◆ size()

int EnumDef::size ( ) const

◆ strings()

const uiStringSet& EnumDef::strings ( ) const
inline

◆ validIdx()

bool EnumDef::validIdx ( int  idx) const

Member Data Documentation

◆ enums_

TypeSet<int> EnumDef::enums_
protected

◆ iconfiles_

BufferStringSet EnumDef::iconfiles_
protected

◆ keys_

BufferStringSet EnumDef::keys_
protected

◆ uistrings_

uiStringSet EnumDef::uistrings_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024