Developer Documentation
VSI::Context Class Reference

#include <Plugin-VSI/parser/context.hh>

Public Member Functions

 Context (LoggingInterface *_loggingInterface, PythonInterface *_pythonInterface)
 Constructor. More...
 
 ~Context ()
 Destructor. More...
 
void parse (QFile &_xml)
 Parse xml content. More...
 
const QVector< Element * > & elements () const
 Returns all available elements. More...
 
QVector< Element * > elements (const QString &_category)
 Returns all available elements for a given category. More...
 
Elementelement (const QString &_name)
 Returns the element with a given name. More...
 
QStringList categories ()
 List of categories. More...
 
void registerType (Type *_type)
 Registers a supported datatype. More...
 
bool typeSupported (const QString &_type)
 Is the given type supported. More...
 
TypegetType (const QString &_type)
 Get type object for given type name. More...
 
bool canConvert (const QString &_type1, const QString &_type2)
 Can the given types be converted to each other. More...
 
void executeScript (const QString &_script)
 
void openScriptInEditor (const QString &_script)
 

Static Public Member Functions

static bool strToBool (const QString &_str)
 Converts the given string to bool. More...
 
static QString getXmlString (QDomElement &_element, const QString &_tag, QString _default="")
 Gets the string of a xml query. More...
 
static QString removeCommonTrailingSpaces (const QString &in)
 Removes trailing spaces from string which are present in each line - relative trailing spaces are not removed. More...
 

Private Member Functions

void parseElement (QDomElement &_element)
 parse element from xml More...
 
InputparseInput (QDomElement &_domElement, Element *_e)
 
OutputparseOutput (QDomElement &_domElement, Element *_e)
 
FunctionparseFunction (QDomElement &_domElement, Element *_e)
 
bool parseInOutBase (QDomElement &_domElement, InOut *_io)
 

Private Attributes

QVector< Element * > elements_
 
QMap< QString, Type * > supportedTypes_
 
QList< Type * > types_
 
LoggingInterfaceloggingInterface_
 
PythonInterfacepythonInterface_
 

Detailed Description

Class holding all the informations / parsed xml metadata for the visual scripting interface

Definition at line 71 of file context.hh.

Constructor & Destructor Documentation

◆ Context()

VSI::Context::Context ( LoggingInterface _loggingInterface,
PythonInterface _pythonInterface 
)
explicit

Constructor.

Definition at line 76 of file context.cc.

◆ ~Context()

VSI::Context::~Context ( )

Destructor.

Definition at line 132 of file context.cc.

Member Function Documentation

◆ canConvert()

bool VSI::Context::canConvert ( const QString &  _type1,
const QString &  _type2 
)

Can the given types be converted to each other.

Definition at line 560 of file context.cc.

◆ categories()

QStringList VSI::Context::categories ( )

List of categories.

Definition at line 166 of file context.cc.

◆ element()

Element * VSI::Context::element ( const QString &  _name)

Returns the element with a given name.

Definition at line 155 of file context.cc.

◆ elements() [1/2]

const QVector< Element * > & VSI::Context::elements ( ) const
inline

Returns all available elements.

Definition at line 84 of file context.hh.

◆ elements() [2/2]

QVector< Element * > VSI::Context::elements ( const QString &  _category)

Returns all available elements for a given category.

Definition at line 143 of file context.cc.

◆ executeScript()

void VSI::Context::executeScript ( const QString &  _script)

Definition at line 632 of file context.cc.

◆ getType()

Type * VSI::Context::getType ( const QString &  _type)

Get type object for given type name.

Definition at line 571 of file context.cc.

◆ getXmlString()

QString VSI::Context::getXmlString ( QDomElement &  _element,
const QString &  _tag,
QString  _default = "" 
)
static

Gets the string of a xml query.

Gets the string of a tag or returns the default.

Definition at line 514 of file context.cc.

◆ openScriptInEditor()

void VSI::Context::openScriptInEditor ( const QString &  _script)

Definition at line 636 of file context.cc.

◆ parse()

void VSI::Context::parse ( QFile &  _xml)

Parse xml content.

Parse xml file content.

Definition at line 180 of file context.cc.

◆ parseElement()

void VSI::Context::parseElement ( QDomElement &  _element)
private

parse element from xml

Definition at line 204 of file context.cc.

◆ parseFunction()

Function * VSI::Context::parseFunction ( QDomElement &  _domElement,
Element _e 
)
private

Definition at line 400 of file context.cc.

◆ parseInOutBase()

bool VSI::Context::parseInOutBase ( QDomElement &  _domElement,
InOut _io 
)
private

Definition at line 370 of file context.cc.

◆ parseInput()

Input * VSI::Context::parseInput ( QDomElement &  _domElement,
Element _e 
)
private

Definition at line 312 of file context.cc.

◆ parseOutput()

Output * VSI::Context::parseOutput ( QDomElement &  _domElement,
Element _e 
)
private

Definition at line 353 of file context.cc.

◆ registerType()

void VSI::Context::registerType ( Type _type)

Registers a supported datatype.

Definition at line 541 of file context.cc.

◆ removeCommonTrailingSpaces()

QString VSI::Context::removeCommonTrailingSpaces ( const QString &  in)
static

Removes trailing spaces from string which are present in each line - relative trailing spaces are not removed.

Definition at line 588 of file context.cc.

◆ strToBool()

bool VSI::Context::strToBool ( const QString &  _str)
static

Converts the given string to bool.

Definition at line 530 of file context.cc.

◆ typeSupported()

bool VSI::Context::typeSupported ( const QString &  _type)

Is the given type supported.

Definition at line 552 of file context.cc.

Member Data Documentation

◆ elements_

QVector<Element *> VSI::Context::elements_
private

Definition at line 140 of file context.hh.

◆ loggingInterface_

LoggingInterface* VSI::Context::loggingInterface_
private

Definition at line 146 of file context.hh.

◆ pythonInterface_

PythonInterface* VSI::Context::pythonInterface_
private

Definition at line 147 of file context.hh.

◆ supportedTypes_

QMap<QString, Type*> VSI::Context::supportedTypes_
private

Definition at line 142 of file context.hh.

◆ types_

QList<Type *> VSI::Context::types_
private

Definition at line 144 of file context.hh.


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