started memory cache server

This commit is contained in:
itsmattkc
2019-05-20 03:26:14 +10:00
parent 3d4f12cd8e
commit bdf513585f
11 changed files with 364 additions and 46 deletions
+44 -3
View File
@@ -3,11 +3,20 @@
#include <QChildEvent>
#include <QDebug>
NodeGraph::NodeGraph()
NodeGraph::NodeGraph() :
output_node_(nullptr),
ctx_(nullptr)
{
}
void NodeGraph::Process()
{
if (output_node_ != nullptr) {
output_node_->Process(Time());
}
}
void NodeGraph::childEvent(QChildEvent *event)
{
if (event->type() == QEvent::ChildAdded || event->type() == QEvent::ChildRemoved) {
@@ -25,13 +34,45 @@ Node *NodeGraph::OutputNode()
return output_node_;
}
double NodeGraph::Time()
const rational& NodeGraph::Time()
{
return time_;
}
void NodeGraph::SetTime(double d)
void NodeGraph::SetTime(const rational &d)
{
time_ = d;
emit TimeChanged();
}
MemoryCache *NodeGraph::memory_cache()
{
return &memory_cache_;
}
const int &NodeGraph::width()
{
return width_;
}
const int &NodeGraph::height()
{
return height_;
}
void NodeGraph::set_width(const int& w)
{
width_ = w;
emit ParametersChanged();
}
void NodeGraph::set_height(const int& h)
{
height_ = h;
emit ParametersChanged();
}
void NodeGraph::SetGLContext(QOpenGLContext *ctx)
{
memory_cache_.SetParameters(ctx, width_, height_);
}