json is loading, but does nothing yet

This commit is contained in:
Sebastian
2024-11-03 03:48:49 +01:00
parent a4ea20b2b3
commit 7bdd68bdcc
16 changed files with 1174 additions and 1104 deletions
+32 -30
View File
@@ -1,38 +1,40 @@
#pragma once
#include "datatypes.h"
#include "graph-item.h"
#include <memory>
#include "node.h"
class Edge : public GraphItem{
using namespace VISEQ::GRAPH;
public:
Edge() {}
Edge(SPTR_Node start, SPTR_Node end) : start(start), end(end) {}
namespace VISEQ::GRAPH::EDGES {
class Edge : public GraphItem{
SPTR_Node start;
SPTR_Node end;
public:
Edge() {}
Edge(std::shared_ptr<NODES::Node> start, std::shared_ptr<NODES::Node> end) : start(start), end(end) {}
bool pass_forward = true;
bool pass_backward = true;
std::shared_ptr<NODES::Node> start;
std::shared_ptr<NODES::Node> end;
bool pass_forward = true;
bool pass_backward = true;
bool active = false;
bool config = false;
bool split = false;
float connector_offset = 8.0f;
float switches_offset = 25.0f;
virtual bool GActive() {return active;}
std::shared_ptr<NODES::Node> getNextNode(std::shared_ptr<NODES::Node> origin){
return start == origin ? end : start;
}
void draw(Vec2Df mouse_pos, Camera2D cam) {}
};
bool active = false;
bool config = false;
bool split = false;
float connector_offset = 8.0f;
float switches_offset = 25.0f;
virtual bool GActive() {return active;}
SPTR_Node getNextNode(SPTR_Node origin){
return start == origin ? end : start;
}
void draw(Vec2Df mouse_pos, Camera2D cam) {}
};
/*typedef std::shared_ptr<Edge> SPTR_Edge;*/
/*typedef std::vector<SPTR_Edge> VEC_SPTR_Edge;*/
//NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Edge, id, start, end, pass_forward, pass_backward)
typedef std::shared_ptr<Edge> SPTR_Edge;
typedef std::vector<SPTR_Edge> VEC_SPTR_Edge;
}