polar snapping now very goood!

This commit is contained in:
Sebastian
2024-11-01 14:08:27 +01:00
parent 19b2c9549f
commit a10335ed47
8 changed files with 171 additions and 116 deletions
+10 -8
View File
@@ -1,24 +1,21 @@
#pragma once
#include "datatypes.h"
#include "graph-item.h"
#include <memory>
class Node;
class Edge : public GraphItem{
public:
Edge() {}
Edge(std::shared_ptr<Node> start, std::shared_ptr<Node> end) : start(start), end(end) {}
Edge(SPTR_Node start, SPTR_Node end) : start(start), end(end) {}
std::shared_ptr<Node> start;
std::shared_ptr<Node> end;
SPTR_Node start;
SPTR_Node end;
bool pass_forward = true;
bool pass_backward = true;
bool active = false;
bool remove = false;
bool config = false;
bool split = false;
@@ -27,11 +24,16 @@ class Edge : public GraphItem{
virtual bool GActive() {return active;}
std::shared_ptr<Node> getNextNode(std::shared_ptr<Node> origin){
SPTR_Node getNextNode(SPTR_Node origin){
return start == origin ? end : start;
}
void draw(Vec2D<float> mouse_pos, Camera2D cam) {
}
void remove(){
delete this;
}
};