52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "connector.h"
|
|
#include "graph-item.h"
|
|
#include <memory>
|
|
#include "node.h"
|
|
|
|
using namespace VISEQ::GRAPH;
|
|
|
|
namespace VISEQ::GRAPH::EDGES {
|
|
class Edge : public GraphItem{
|
|
|
|
public:
|
|
Edge() {}
|
|
Edge(std::shared_ptr<NODES::Node> start, std::shared_ptr<NODES::Node> end) : start(start), end(end) {}
|
|
|
|
std::shared_ptr<NODES::Node> start;
|
|
std::shared_ptr<NODES::Node> end;
|
|
|
|
std::shared_ptr<Connector> start_conn;
|
|
std::shared_ptr<Connector> end_conn;
|
|
|
|
EdgeType edgeType;
|
|
|
|
bool pass_forward = true;
|
|
bool pass_backward = true;
|
|
|
|
bool active = false;
|
|
bool config = false;
|
|
bool split = false;
|
|
|
|
float speed = 0;
|
|
float bpm = 120.0f;
|
|
|
|
float connector_offset = 8.0f;
|
|
float switches_offset = 25.0f;
|
|
|
|
virtual bool GActive() {return active;}
|
|
|
|
virtual EdgeType getEdgeType() const {return edgeType;}
|
|
|
|
std::shared_ptr<NODES::Node> getNextNode(std::shared_ptr<NODES::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;
|
|
}
|