Implemented selection of multiple sources

This commit is contained in:
brunoherbelin
2020-06-15 23:38:01 +02:00
parent bfdeb0b52f
commit 89fed033e9
10 changed files with 140 additions and 59 deletions

14
View.h
View File

@@ -43,8 +43,11 @@ public:
Cursor(CursorType t, std::string i = "") { type = t; info = i;}
} Cursor;
// picking of nodes in a view provided a point coordinates in scene reference frame
virtual std::pair<Node *, glm::vec2> pick(glm::vec3 point);
// picking of nodes in a view provided a point coordinates in screen coordinates
virtual std::pair<Node *, glm::vec2> pick(glm::vec2);
// select sources provided a start and end selection points in screen coordinates
virtual void select(glm::vec2, glm::vec2);
// drag the view provided a start and an end point in screen coordinates
virtual Cursor drag (glm::vec2, glm::vec2);
@@ -53,12 +56,11 @@ public:
virtual Cursor grab (glm::vec2, glm::vec2, Source*, std::pair<Node *, glm::vec2>) {
return Cursor();
}
// test mouse over provided a point in screen coordinates and the picking point
virtual Cursor over (glm::vec2, Source*, std::pair<Node *, glm::vec2>) {
return Cursor();
}
// select sources provided a start and end selection points in screen coordinates
virtual void select(glm::vec2, glm::vec2) {}
virtual void restoreSettings();
virtual void saveSettings();
@@ -114,10 +116,10 @@ public:
void draw () override;
void update (float dt) override;
void zoom (float factor) override;
std::pair<Node *, glm::vec2> pick(glm::vec3 point) override;
std::pair<Node *, glm::vec2> pick(glm::vec2 P) override;
Cursor grab (glm::vec2 from, glm::vec2 to, Source *s, std::pair<Node *, glm::vec2> pick) override;
Cursor over (glm::vec2, Source*, std::pair<Node *, glm::vec2>) override;
void select(glm::vec2, glm::vec2) override;
// void select(glm::vec2, glm::vec2) override;
// class Box *selection_box_;
};