SOFA API  651e7a3a
Open source framework for multi-physics simuation
sofa::core::visual::FlagTreeItem Class Reference

#include <FlagTreeItem.h>

Classes

struct  ci_comparison
 

Protected Attributes

type::vector< std::string > m_showName
 
sofa::type::vector< std::string > m_hideName
 
tristate m_state
 
FlagTreeItemm_parent
 
sofa::type::vector< FlagTreeItem * > m_child
 

Public Member Functions

 FlagTreeItem (const std::string &showName, const std::string &hideName, FlagTreeItem *parent=nullptr)
 
const tristatestate () const
 
tristatestate ()
 
std::ostream & write (std::ostream &os) const
 
std::istream & read (std::istream &in)
 
std::istream & read (std::istream &in, const std::function< void(std::string)> &unknownFlagFunction, const std::function< void(std::string, std::string)> &incorrectLetterCaseFunction)
 
void setValue (const tristate &state)
 
void addAliasShow (const std::string &newAlias)
 
void addAliasHide (const std::string &newAlias)
 
void addAlias (sofa::type::vector< std::string > &name, const std::string &newAlias)
 
void getLabels (sofa::type::vector< std::string > &labels) const
 

Protected Member Functions

void propagateStateDown (FlagTreeItem *origin)
 
void propagateStateUp (FlagTreeItem *origin)
 

Static Protected Member Functions

static std::map< std::string, bool, ci_comparisoncreate_flagmap (FlagTreeItem *root)
 
static void create_parse_map (FlagTreeItem *root, std::map< std::string, bool, ci_comparison > &map)
 
static void read_recursive (FlagTreeItem *root, const std::map< std::string, bool, ci_comparison > &map)
 
static void write_recursive (const FlagTreeItem *root, std::string &str)
 
static READ_FLAG readFlag (std::map< std::string, bool, FlagTreeItem::ci_comparison > &parseMap, std::string flag)
 

Friends

SOFA_CORE_API friend std::ostream & operator<< (std::ostream &os, const FlagTreeItem &root)
 
SOFA_CORE_API friend std::istream & operator>> (std::istream &in, FlagTreeItem &root)
 

Attribute details

◆ m_child

sofa::type::vector<FlagTreeItem*> sofa::core::visual::FlagTreeItem::m_child
protected

◆ m_hideName

sofa::type::vector<std::string> sofa::core::visual::FlagTreeItem::m_hideName
protected

◆ m_parent

FlagTreeItem* sofa::core::visual::FlagTreeItem::m_parent
protected

◆ m_showName

type::vector<std::string> sofa::core::visual::FlagTreeItem::m_showName
protected

◆ m_state

tristate sofa::core::visual::FlagTreeItem::m_state
protected

Constructor details

◆ FlagTreeItem()

sofa::core::visual::FlagTreeItem::FlagTreeItem ( const std::string &  showName,
const std::string &  hideName,
FlagTreeItem parent = nullptr 
)

Function details

◆ addAlias()

void sofa::core::visual::FlagTreeItem::addAlias ( sofa::type::vector< std::string > &  name,
const std::string &  newAlias 
)

◆ addAliasHide()

void sofa::core::visual::FlagTreeItem::addAliasHide ( const std::string &  newAlias)

◆ addAliasShow()

void sofa::core::visual::FlagTreeItem::addAliasShow ( const std::string &  newAlias)

◆ create_flagmap()

static std::map<std::string,bool, ci_comparison> sofa::core::visual::FlagTreeItem::create_flagmap ( FlagTreeItem root)
staticprotected

◆ create_parse_map()

void sofa::core::visual::FlagTreeItem::create_parse_map ( FlagTreeItem root,
std::map< std::string, bool, ci_comparison > &  map 
)
staticprotected

◆ getLabels()

void sofa::core::visual::FlagTreeItem::getLabels ( sofa::type::vector< std::string > &  labels) const

◆ propagateStateDown()

void sofa::core::visual::FlagTreeItem::propagateStateDown ( FlagTreeItem origin)
protected

◆ propagateStateUp()

void sofa::core::visual::FlagTreeItem::propagateStateUp ( FlagTreeItem origin)
protected

◆ read() [1/2]

std::istream & sofa::core::visual::FlagTreeItem::read ( std::istream &  in)

◆ read() [2/2]

std::istream & sofa::core::visual::FlagTreeItem::read ( std::istream &  in,
const std::function< void(std::string)> &  unknownFlagFunction,
const std::function< void(std::string, std::string)> &  incorrectLetterCaseFunction 
)

◆ read_recursive()

void sofa::core::visual::FlagTreeItem::read_recursive ( FlagTreeItem root,
const std::map< std::string, bool, ci_comparison > &  map 
)
staticprotected

◆ readFlag()

FlagTreeItem::READ_FLAG sofa::core::visual::FlagTreeItem::readFlag ( std::map< std::string, bool, FlagTreeItem::ci_comparison > &  parseMap,
std::string  flag 
)
staticprotected

◆ setValue()

void sofa::core::visual::FlagTreeItem::setValue ( const tristate state)

◆ state() [1/2]

tristate& sofa::core::visual::FlagTreeItem::state ( )
inline

◆ state() [2/2]

const tristate& sofa::core::visual::FlagTreeItem::state ( ) const
inline

◆ write()

std::ostream & sofa::core::visual::FlagTreeItem::write ( std::ostream &  os) const

◆ write_recursive()

void sofa::core::visual::FlagTreeItem::write_recursive ( const FlagTreeItem root,
std::string &  str 
)
staticprotected

Enum details

◆ READ_FLAG

Enumerator
KNOWN_FLAG 
INCORRECT_LETTER_CASE 
UNKNOWN_FLAG 

Related details

◆ operator<<

SOFA_CORE_API friend std::ostream& operator<< ( std::ostream &  os,
const FlagTreeItem root 
)
friend

◆ operator>>

SOFA_CORE_API friend std::istream& operator>> ( std::istream &  in,
FlagTreeItem root 
)
friend