Hugintrunk
0.1
|
Namespaces | |
ShuntingYard | |
Classes | |
struct | ParseVar |
struct to save parsed variables and optional image numbers More... | |
Typedefs | |
typedef std::map< std::string, double > | ConstantMap |
typedef std::vector< ParseVar > | ParseVarVec |
Functions | |
bool | ParseExpression (const std::string &expression, double &result, const ConstantMap &constants, std::string &error) |
parse complete expression in 2 steps More... | |
void | ParseSingleVar (ParseVarVec &varVec, const std::string &s, std::ostream &errorStream) |
void | ParseVariableString (ParseVarVec &parseVec, const std::string &input, std::ostream &errorStream, void(*func)(ParseVarVec &, const std::string &, std::ostream &)) |
parse complete variables string More... | |
bool | UpdateSingleVar (HuginBase::Panorama &pano, const Parser::ParseVar &parseVar, const Parser::ConstantMap &constants, size_t imgNr, std::ostream &statusStream, std::ostream &errorStream) |
bool | CalculateConstant (HuginBase::Panorama &pano, const Parser::ParseVar &parseVar, Parser::ConstantMap &constants, std::ostream &statusStream, std::ostream &errorStream) |
IMPEX bool | ParseVarNumber (const std::string &s, Parser::ParseVar &var) |
parse string s and store result in ParseVar var More... | |
IMPEX void | PanoParseExpression (HuginBase::Panorama &pano, const std::string &expression, std::ostream &statusStream=std::cout, std::ostream &errorStream=std::cerr) |
parses the given expression and apply the changes to the Panorama More... | |
typedef std::map<std::string, double> Parser::ConstantMap |
Definition at line 43 of file ParseExp.cpp.
typedef std::vector<ParseVar> Parser::ParseVarVec |
Definition at line 48 of file ParseExp.h.
bool Parser::CalculateConstant | ( | HuginBase::Panorama & | pano, |
const Parser::ParseVar & | parseVar, | ||
Parser::ConstantMap & | constants, | ||
std::ostream & | statusStream, | ||
std::ostream & | errorStream | ||
) |
Definition at line 740 of file ParseExp.cpp.
References Parser::ParseVar::expression, HuginBase::SrcPanoImage::getHeight(), HuginBase::Panorama::getImage(), HuginBase::SrcPanoImage::getWidth(), ParseExpression(), and Parser::ParseVar::varname.
IMPEX void Parser::PanoParseExpression | ( | HuginBase::Panorama & | pano, |
const std::string & | expression, | ||
std::ostream & | statusStream = std::cout , |
||
std::ostream & | errorStream = std::cerr |
||
) |
parses the given expression and apply the changes to the Panorama
Referenced by main(), ImageVariablesExpressionDialog::OnTest(), and PanoCommand::UpdateVariablesByParseExpression::processPanorama().
bool Parser::ParseExpression | ( | const std::string & | expression, |
double & | result, | ||
const ConstantMap & | constants, | ||
std::string & | error | ||
) |
parse complete expression in 2 steps
Definition at line 580 of file ParseExp.cpp.
References Parser::ShuntingYard::ClearQueue(), Parser::ShuntingYard::ConvertToRPN(), Parser::ShuntingYard::EvaluateRPN(), M_PI, Parser::ShuntingYard::RemoveWhiteSpaces(), and hugin_utils::tolower().
Referenced by CalculateConstant(), and UpdateSingleVar().
void Parser::ParseSingleVar | ( | ParseVarVec & | varVec, |
const std::string & | s, | ||
std::ostream & | errorStream | ||
) |
Definition at line 657 of file ParseExp.cpp.
References Parser::ParseVar::expression, Parser::ParseVar::flag, ParseVarNumber(), and hugin_utils::StrTrim().
IMPEX void Parser::ParseVariableString | ( | ParseVarVec & | parseVec, |
const std::string & | input, | ||
std::ostream & | errorStream, | ||
void(*)(ParseVarVec &, const std::string &, std::ostream &) | func | ||
) |
parse complete variables string
Definition at line 699 of file ParseExp.cpp.
References hugin_utils::SplitString().
Referenced by main().
IMPEX bool Parser::ParseVarNumber | ( | const std::string & | s, |
Parser::ParseVar & | var | ||
) |
parse string s and store result in ParseVar var
Referenced by ParseSingleLinkVar(), ParseSingleOptVar(), and ParseSingleVar().
bool Parser::UpdateSingleVar | ( | HuginBase::Panorama & | pano, |
const Parser::ParseVar & | parseVar, | ||
const Parser::ConstantMap & | constants, | ||
size_t | imgNr, | ||
std::ostream & | statusStream, | ||
std::ostream & | errorStream | ||
) |
Definition at line 709 of file ParseExp.cpp.
References Parser::ParseVar::expression, HuginBase::SrcPanoImage::getHeight(), HuginBase::Panorama::getImage(), HuginBase::SrcPanoImage::getVar(), HuginBase::SrcPanoImage::getWidth(), ParseExpression(), HuginBase::Panorama::updateVariable(), and Parser::ParseVar::varname.