Merge branch 'robin-spawn-particles' into djairo-vtk-test

This commit is contained in:
djaidjai committed 2024-05-03 15:32:18 +02:00
commit 06315a3d52
9 files changed
+122 -3

No files matched your search

+9 -2
View File
@@ -15,9 +15,11 @@
#include <vtkArrowSource.h>
#include <vtkNew.h>
#include <vtkCallbackCommand.h>
#include <vtkInteractorStyleUser.h>
#include "Program.h"
#include "../commands/TimerCallbackCommand.h"
#include "SpawnPointCallback.h"
void Program::setWinProperties() {
this->win->SetWindowName("Simulation");
@@ -27,6 +29,8 @@ void Program::setWinProperties() {
this->interact->SetRenderWindow(this->win);
this->interact->Initialize();
vtkNew<vtkInteractorStyleUser> style;
interact->SetInteractorStyle(style);
}
void Program::setupTimer() {
@@ -36,7 +40,6 @@ void Program::setupTimer() {
this->interact->CreateRepeatingTimer(17); // 60 fps == 1000 / 60 == 16.7 ms per frame
}
Program::Program(Layer *bg, Layer *e, Layer *l) : background(bg), euler(e), lagrange(l), win(), interact() {
this->win = vtkSmartPointer<vtkRenderWindow>::New();
this->interact = vtkSmartPointer<vtkRenderWindowInteractor>::New();
@@ -71,7 +74,11 @@ void Program::setLagrange(Layer *l) {
this->win->AddRenderer(l->getLayer());
}
// void Program::addInteractionStyle(vtkInteractorStyle style);
void Program::setLagrangeInteractor(SpawnPointCallback *cb){
interact->AddObserver(vtkCommand::LeftButtonPressEvent, cb);
interact->AddObserver(vtkCommand::LeftButtonReleaseEvent, cb);
interact->AddObserver(vtkCommand::MouseMoveEvent, cb);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.