Files
viseq/src/edge.h
T

49 lines
1.0 KiB
C++
Raw Normal View History

#pragma once
#include "connector.h"
#include "graph-item.h"
2024-11-03 03:48:49 +01:00
#include <memory>
#include "node.h"
2024-11-03 03:48:49 +01:00
using namespace VISEQ::GRAPH;
2024-11-03 03:48:49 +01:00
namespace VISEQ::GRAPH::EDGES {
class Edge : public GraphItem{
2024-11-03 03:48:49 +01:00
public:
Edge() {}
Edge(std::shared_ptr<NODES::Node> start, std::shared_ptr<NODES::Node> end) : start(start), end(end) {}
2024-11-03 03:48:49 +01:00
std::shared_ptr<NODES::Node> start;
std::shared_ptr<NODES::Node> end;
2024-11-07 00:56:33 +01:00
EdgeType edgeType;
2024-11-03 03:48:49 +01:00
bool pass_forward = true;
bool pass_backward = true;
bool active = false;
bool config = false;
bool split = false;
2024-11-07 00:56:33 +01:00
float speed = 0;
float bpm = 120.0f;
2024-11-03 03:48:49 +01:00
float connector_offset = 8.0f;
float switches_offset = 25.0f;
2024-11-03 03:48:49 +01:00
virtual bool GActive() {return active;}
2024-11-08 01:43:06 +01:00
virtual EdgeType getEdgeType() const {return edgeType;}
2024-11-03 03:48:49 +01:00
std::shared_ptr<NODES::Node> getNextNode(std::shared_ptr<NODES::Node> origin){
return start == origin ? end : start;
}
2024-11-03 03:48:49 +01:00
void draw(Vec2Df mouse_pos, Camera2D cam) {}
};
typedef std::shared_ptr<Edge> SPTR_Edge;
typedef std::vector<SPTR_Edge> VEC_SPTR_Edge;
}