implemented node derivative that loads all metadata/code from an external file
Implemented the ability to load a node externally. This XML data could also eventually be copy/pasted between instances of Olive alongside XML data for other nodes and their connections to allow copying entire node trees.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#ifndef EXTERNALNODE_H
|
||||
#define EXTERNALNODE_H
|
||||
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#include "node.h"
|
||||
|
||||
/**
|
||||
* @brief A node generated from an external XML metadata file
|
||||
*/
|
||||
class ExternalNode : public Node
|
||||
{
|
||||
public:
|
||||
ExternalNode(const QString& xml_meta_filename);
|
||||
|
||||
virtual Node* copy() const override;
|
||||
|
||||
virtual QString Name() const override;
|
||||
virtual QString id() const override;
|
||||
virtual QString Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual bool IsAccelerated() const override;
|
||||
virtual QString AcceleratedCodeVertex() const override;
|
||||
virtual QString AcceleratedCodeFragment() const override;
|
||||
virtual int AcceleratedCodeIterations() const override;
|
||||
virtual NodeInput* AcceleratedCodeIterativeInput() const override;
|
||||
|
||||
private:
|
||||
void XMLReadLanguageString(QXmlStreamReader* reader, QMap<QString, QString>* map);
|
||||
void XMLReadEffect(QXmlStreamReader *reader);
|
||||
void XMLReadIterations(QXmlStreamReader* reader);
|
||||
void XMLReadParam(QXmlStreamReader* reader);
|
||||
void XMLReadShader(QXmlStreamReader* reader, QString& destination);
|
||||
|
||||
QString xml_filename_;
|
||||
|
||||
QMap<QString, QString> names_;
|
||||
QMap<QString, QString> descriptions_;
|
||||
QMap<QString, QString> categories_;
|
||||
QMap<QString, QMap<QString, QString> > param_names_;
|
||||
|
||||
QString id_;
|
||||
|
||||
QString frag_code_;
|
||||
QString vert_code_;
|
||||
|
||||
int iterations_;
|
||||
NodeInput* iteration_input_;
|
||||
};
|
||||
|
||||
#endif // EXTERNALNODE_H
|
||||
Reference in New Issue
Block a user