ui: graphView

Added basic graph view with simple nodes (just text, no edges or anything...)

fortune cookie message = Don't be afraid to take that big step.
This commit is contained in:
Manuel Dobusch
2014-07-02 16:14:56 +02:00
parent 5251e3ecb6
commit a8e32af5dd
16 changed files with 220 additions and 2 deletions
+8
View File
@@ -1,6 +1,7 @@
#include "component/ComponentManager.h"
#include "component/view/CodeView.h"
#include "component/view/GraphView.h"
#include "component/view/ViewLayout.h"
std::shared_ptr<ComponentManager> ComponentManager::create(
@@ -20,6 +21,13 @@ ComponentManager::~ComponentManager()
void ComponentManager::setup()
{
std::shared_ptr<Component> graphComponent = m_componentFactory->createGraphComponent();
GraphView* graphView = dynamic_cast<GraphView*>(graphComponent->getView());
graphView->addNode(Vec2i(-100, -100), "foo");
graphView->addNode(Vec2i(50, 50), "bar");
m_components.push_back(graphComponent);
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
m_components.push_back(codeComponent);