mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Working on multiple sources selection: created bounding box decoration,
fixed Switch node in Scene, removed Animation node from scene, created display mode for Source.
This commit is contained in:
35
View.cpp
35
View.cpp
@@ -14,6 +14,7 @@
|
||||
#include "View.h"
|
||||
#include "Source.h"
|
||||
#include "Primitives.h"
|
||||
#include "Decorations.h"
|
||||
#include "PickingVisitor.h"
|
||||
#include "DrawVisitor.h"
|
||||
#include "Mesh.h"
|
||||
@@ -29,6 +30,9 @@ bool View::need_deep_update_ = true;
|
||||
|
||||
View::View(Mode m) : mode_(m)
|
||||
{
|
||||
selection_ = new Selection;
|
||||
selection_->visible_ = false;
|
||||
scene.ws()->attach(selection_);
|
||||
}
|
||||
|
||||
void View::restoreSettings()
|
||||
@@ -95,12 +99,43 @@ std::pair<Node *, glm::vec2> View::pick(glm::vec3 point)
|
||||
// select top-most Node picked
|
||||
picked = pv.picked().back();
|
||||
|
||||
//DEBUG
|
||||
select(glm::vec2(-1.f, -1.f), glm::vec2(1.f, 1.f));
|
||||
|
||||
|
||||
}
|
||||
// cancel selection on clic in background
|
||||
else {
|
||||
deselect();
|
||||
}
|
||||
|
||||
return picked;
|
||||
}
|
||||
|
||||
|
||||
void View::select(glm::vec2 A, glm::vec2 B)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void View::selectall()
|
||||
{
|
||||
for(auto it = scene.ws()->begin(); it != scene.ws()->end(); it++) {
|
||||
if ( *it != selection_)
|
||||
selection_->attach(*it);
|
||||
}
|
||||
|
||||
selection_->visible_ = true;
|
||||
}
|
||||
|
||||
void View::deselect()
|
||||
{
|
||||
selection_->clear();
|
||||
selection_->visible_ = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MixingView::MixingView() : View(MIXING)
|
||||
{
|
||||
// read default settings
|
||||
|
||||
Reference in New Issue
Block a user