From 5d9228e549d14082673644f1d22d54e8125f41e8 Mon Sep 17 00:00:00 2001 From: djairoh Date: Tue, 7 May 2024 13:13:08 +0200 Subject: [PATCH] added comment + ref to github issue --- .../src/commands/SpawnPointCallback.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/particle-track-and-trace/src/commands/SpawnPointCallback.cpp b/particle-track-and-trace/src/commands/SpawnPointCallback.cpp index 3253e23..b14b6e2 100644 --- a/particle-track-and-trace/src/commands/SpawnPointCallback.cpp +++ b/particle-track-and-trace/src/commands/SpawnPointCallback.cpp @@ -17,6 +17,7 @@ void convertDisplayToWorld(vtkRenderer *renderer, int x, int y, double *worldPos } void SpawnPointCallback::Execute(vtkObject *caller, unsigned long evId, void *callData) { + // Note the use of reinterpret_cast to cast the caller to the expected type. auto interactor = reinterpret_cast(caller); @@ -39,17 +40,12 @@ void SpawnPointCallback::Execute(vtkObject *caller, unsigned long evId, void *ca ren->DisplayToWorld(); ren->GetWorldPoint(worldPos); inverseCartographicProjection->MultiplyPoint(worldPos, worldPos); - // cout << "clicked on lon = " << worldPos[0] << " and lat = " << worldPos[1] << endl; - vtkIdType id = points->InsertNextPoint(worldPos[0], worldPos[1], 0); - data->SetPoints(points); + points->InsertNextPoint(worldPos[0], worldPos[1], 0); - vtkSmartPointer vertex = vtkSmartPointer::New(); - vertex->GetPointIds()->SetId(0, id); - - vtkSmartPointer vertices = vtkSmartPointer::New(); - vertices->InsertNextCell(vertex); - data->SetVerts(vertices); + // FIXME: The below lines cause some weird interaction with our vtkTimer. + // see github issue https://github.com/MakeNEnjoy/interactive-track-and-trace/issues/28 + this->points->Modified(); ren->GetRenderWindow()->Render(); } @@ -60,7 +56,7 @@ SpawnPointCallback::SpawnPointCallback() : data(nullptr), uvGrid(nullptr) { } SpawnPointCallback *SpawnPointCallback::New() { - return new SpawnPointCallback; + return new SpawnPointCallback; } void SpawnPointCallback::setData(const vtkSmartPointer &data) {