#pragma once #include "connector.h" #include "graph-item.h" #include #include "node.h" using namespace VISEQ::GRAPH; namespace VISEQ::GRAPH::EDGES { class Edge : public GraphItem{ public: Edge() {} Edge(std::weak_ptr start, std::weak_ptr end) : start(start), end(end) {} std::weak_ptr start; std::weak_ptr end; std::weak_ptr start_conn; std::weak_ptr 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(); virtual EdgeType getEdgeType() const; std::weak_ptr getNextNode(std::weak_ptr origin); void draw(Vec2Df mouse_pos, Camera2D cam); friend void to_json(json& j, const Edge& E); friend void from_json(const json& j, Edge& E); friend void to_json(json& j, const std::shared_ptr& E); friend void from_json(const json& j, std::shared_ptr& E); }; typedef std::shared_ptr SPTR_Edge; typedef std::weak_ptr WPTR_Edge; typedef std::vector VEC_SPTR_Edge; typedef std::vector VEC_WPTR_Edge; }