added comment + ref to github issue
This commit is contained in:
parent
3cdf3dde2b
commit
5d9228e549
|
|
@ -17,6 +17,7 @@ void convertDisplayToWorld(vtkRenderer *renderer, int x, int y, double *worldPos
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpawnPointCallback::Execute(vtkObject *caller, unsigned long evId, void *callData) {
|
void SpawnPointCallback::Execute(vtkObject *caller, unsigned long evId, void *callData) {
|
||||||
|
|
||||||
// Note the use of reinterpret_cast to cast the caller to the expected type.
|
// Note the use of reinterpret_cast to cast the caller to the expected type.
|
||||||
auto interactor = reinterpret_cast<vtkRenderWindowInteractor *>(caller);
|
auto interactor = reinterpret_cast<vtkRenderWindowInteractor *>(caller);
|
||||||
|
|
||||||
|
|
@ -39,17 +40,12 @@ void SpawnPointCallback::Execute(vtkObject *caller, unsigned long evId, void *ca
|
||||||
ren->DisplayToWorld();
|
ren->DisplayToWorld();
|
||||||
ren->GetWorldPoint(worldPos);
|
ren->GetWorldPoint(worldPos);
|
||||||
inverseCartographicProjection->MultiplyPoint(worldPos, 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);
|
points->InsertNextPoint(worldPos[0], worldPos[1], 0);
|
||||||
data->SetPoints(points);
|
|
||||||
|
|
||||||
vtkSmartPointer<vtkVertex> vertex = vtkSmartPointer<vtkVertex>::New();
|
// FIXME: The below lines cause some weird interaction with our vtkTimer.
|
||||||
vertex->GetPointIds()->SetId(0, id);
|
// see github issue https://github.com/MakeNEnjoy/interactive-track-and-trace/issues/28
|
||||||
|
this->points->Modified();
|
||||||
vtkSmartPointer<vtkCellArray> vertices = vtkSmartPointer<vtkCellArray>::New();
|
|
||||||
vertices->InsertNextCell(vertex);
|
|
||||||
data->SetVerts(vertices);
|
|
||||||
ren->GetRenderWindow()->Render();
|
ren->GetRenderWindow()->Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -60,7 +56,7 @@ SpawnPointCallback::SpawnPointCallback() : data(nullptr),
|
||||||
uvGrid(nullptr) { }
|
uvGrid(nullptr) { }
|
||||||
|
|
||||||
SpawnPointCallback *SpawnPointCallback::New() {
|
SpawnPointCallback *SpawnPointCallback::New() {
|
||||||
return new SpawnPointCallback;
|
return new SpawnPointCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpawnPointCallback::setData(const vtkSmartPointer<vtkPolyData> &data) {
|
void SpawnPointCallback::setData(const vtkSmartPointer<vtkPolyData> &data) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue