vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AP_LSystem::LSystem Class Referenceabstract

#include <lsystem.h>

Inheritance diagram for AP_LSystem::LSystem:
AP_LSystem::AbstractLSystem AP_LSystem::Abstract0LSystem AP_LSystem::AbstractkLSystem AP_LSystem::D0LSystem AP_LSystem::ParD0LSystem AP_LSystem::ParStoch0LSystem AP_LSystem::Par2LSystem

Public Member Functions

 LSystem (AbstractFile *)
 
 LSystem (const LSystem &)
 
 ~LSystem ()
 
LSystemoperator= (const LSystem &)
 
virtual void loadFromFile (AbstractFile *file)
 
unsigned int wordLength ()
 
virtual void transcribeSubSystems ()
 
virtual LongStringtranslate ()
 
virtual void processCutSymbol ()
 
- Public Member Functions inherited from AP_LSystem::AbstractLSystem
 AbstractLSystem ()
 
 AbstractLSystem (const AbstractLSystem &c)
 
virtual boost::shared_ptr
< AbstractLSystem
clone () const =0
 
AbstractLSystemoperator= (const AbstractLSystem &c)
 
unsigned int getIteration () const
 

Protected Member Functions

virtual void setAxiom (std::string &)
 
virtual void addRule (std::string *)
 
virtual void addHomomorphism (std::string *)
 
virtual void processPredecessor (Rule &, string *, string::iterator &)=0
 
virtual void processRuleSuccessor (Rule &, string *, string::iterator &)=0
 
virtual void processHomomorphismSuccessor (Rule &, string *, string::iterator &)=0
 
virtual bool nextIteration ()
 
virtual bool transcribe (multimap< char, Rule > &rules)
 
virtual multimap< char, Rule >
::iterator * 
selectRule (multimap< char, Rule >::iterator &begin, multimap< char, Rule >::iterator &end, LongString *word, unsigned int &pos, double *parameters)
 
virtual void generateSuccessor (LongString *word, multimap< char, Rule >::iterator &rule, double *params)
 

Protected Attributes

LongStringm_Word
 
multimap< char, Rulem_Rules
 
multimap< char, Rulem_Homomorphisms
 
vector< string > m_SubSystemsFilenames
 
vector< LongString * > m_SubSystemsWords
 
string m_Ignore
 
- Protected Attributes inherited from AP_LSystem::AbstractLSystem
std::string m_Name
 name of L-system More...
 
unsigned int m_Iteration
 number of processed iterations More...
 

Constructor & Destructor Documentation

LSystem::LSystem ( AbstractFile file)

Constructor

LSystem::LSystem ( const LSystem c)

Copy constructor

LSystem::~LSystem ( )

Destructor

Member Function Documentation

void LSystem::addHomomorphism ( std::string *  )
protectedvirtual

Add homomorphism and convert it to instance of Rule class

Implements AP_LSystem::AbstractLSystem.

void LSystem::addRule ( std::string *  )
protectedvirtual

Add rule and convert it to instance of Rule class

Implements AP_LSystem::AbstractLSystem.

void LSystem::generateSuccessor ( LongString word,
multimap< char, Rule >::iterator &  rule,
double *  params 
)
protectedvirtual

Generates a successor of module by recurrent appending of rule's static strings and evaluated expressions.

Parameters
wordstrings will bee appended to this word
ruleselected rule
paramsparameter values for expressions evaluation
void LSystem::loadFromFile ( AbstractFile file)
virtual

Load L-system from file

Parameters
fileof L-system as instance of

Implements AP_LSystem::AbstractLSystem.

bool LSystem::nextIteration ( )
protectedvirtual

Transcription process with rules

Returns
true if succeeded

Implements AP_LSystem::AbstractLSystem.

LSystem & LSystem::operator= ( const LSystem c)

Assignment operator

void LSystem::processCutSymbol ( )
virtual
virtual void AP_LSystem::LSystem::processHomomorphismSuccessor ( Rule ,
string *  ,
string::iterator &   
)
protectedpure virtual
virtual void AP_LSystem::LSystem::processPredecessor ( Rule ,
string *  ,
string::iterator &   
)
protectedpure virtual
virtual void AP_LSystem::LSystem::processRuleSuccessor ( Rule ,
string *  ,
string::iterator &   
)
protectedpure virtual
multimap< char, Rule >::iterator * LSystem::selectRule ( multimap< char, Rule >::iterator &  begin,
multimap< char, Rule >::iterator &  end,
LongString word,
unsigned int &  pos,
double *  parameters 
)
protectedvirtual

This method is called during each transcription. It selects one or no rule from union of rules that have common predecessor. The selection procedure depends on type of L-system.

Parameters
beginiterator to range of rules
enditerator to range of rules
wordword that is currently processed
posposition of current predecessor in word
parametersarray of parameters for transcription. Only double type.
Returns
pointer to iterator to rule that was selected. Returns NULL if no rule was selected.

Reimplemented in AP_LSystem::ParStoch0LSystem, and AP_LSystem::Par2LSystem.

void LSystem::setAxiom ( std::string &  )
protectedvirtual

Set axiom. Inicialize word.

Implements AP_LSystem::AbstractLSystem.

bool LSystem::transcribe ( multimap< char, Rule > &  rules)
protectedvirtual

This method provides a transcription funkcionality. It substitutes all modules in word by their successors.

Parameters
rulescontainer with rules
Returns
true if succeeded

Reimplemented in AP_LSystem::D0LSystem.

void LSystem::transcribeSubSystems ( )
virtual
LongString * LSystem::translate ( )
virtual

Translate a word to final form and get it.

Returns
word as LongString

Implements AP_LSystem::AbstractLSystem.

unsigned int AP_LSystem::LSystem::wordLength ( )
inline

Member Data Documentation

multimap<char, Rule> AP_LSystem::LSystem::m_Homomorphisms
protected
string AP_LSystem::LSystem::m_Ignore
protected
multimap<char, Rule> AP_LSystem::LSystem::m_Rules
protected
vector<string> AP_LSystem::LSystem::m_SubSystemsFilenames
protected
vector< LongString *> AP_LSystem::LSystem::m_SubSystemsWords
protected
LongString* AP_LSystem::LSystem::m_Word
protected

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