Files
viseq/src/node.h
T

46 lines
998 B
C++
Raw Normal View History

2024-10-09 02:01:23 +02:00
#pragma once
#include <memory>
#include <raylib.h>
2024-10-09 02:01:23 +02:00
#include "datatypes.h"
2024-10-30 14:55:24 +01:00
#include "graph-item.h"
2024-10-09 02:01:23 +02:00
#include "moveable.h"
2024-10-20 01:17:18 +02:00
2024-11-03 03:48:49 +01:00
namespace VISEQ::GRAPH::EDGES{
class Edge;
}
2024-10-09 02:01:23 +02:00
2024-11-03 03:48:49 +01:00
namespace VISEQ::GRAPH::NODES {
2024-11-03 03:48:49 +01:00
class Node : public BASE::Movable, public GraphItem{
2024-11-03 03:48:49 +01:00
public:
Node() {}
Node(float x, float y) : Movable(Vec2Df(x, y), 0.0f) {}
Node(Vec2Df p) : Movable(p, 0.0f) {}
2024-10-27 00:40:57 +02:00
2024-11-03 03:48:49 +01:00
NodeType nodeType;
2024-11-06 02:28:37 +01:00
std::vector<std::shared_ptr<Node>> neighbors;
2024-11-03 03:48:49 +01:00
std::vector<std::shared_ptr<VISEQ::GRAPH::EDGES::Edge>> connections;
2024-11-03 03:48:49 +01:00
Distribution distributionMode = Distribution::GEOMETRIC;
2024-11-03 03:48:49 +01:00
float radius = 15.0f;
bool config = false;
2024-11-03 03:48:49 +01:00
virtual NodeType getNodeType() const {return nodeType;}
2024-11-03 03:48:49 +01:00
virtual void SMode(int mode) {};
virtual int GGate() {return 0;};
virtual int GActive() {return 0;};
virtual void trigger() {};
void draw(Vec2Df mouse_pos, Camera2D cam) override {}
};
2024-11-03 03:48:49 +01:00
typedef std::shared_ptr<VISEQ::GRAPH::NODES::Node> SPTR_Node;
typedef std::vector<SPTR_Node> VEC_SPTR_Node;
2024-11-03 03:48:49 +01:00
}