kind of working but where did the euler layer go?

This commit is contained in:
robin committed 2024-05-08 13:01:36 +02:00
1 parent 5a2e9a8a7a
commit 945eebf76f
7 files changed
+151 -43

No files matched your search

@@ -38,8 +38,8 @@ void SpawnPointCallback::Execute(vtkObject *caller, unsigned long evId, void *ca
ren->SetDisplayPoint(displayPos);
ren->DisplayToWorld();
ren->GetWorldPoint(worldPos);
inverseCartographicProjection->MultiplyPoint(worldPos, worldPos);
// cout << "clicked on lon = " << worldPos[0] << " and lat = " << worldPos[1] << endl;
cout << "clicked on " << worldPos[1] << ", " << worldPos[0] << endl;
inverseCartographicProjection->TransformPoint(worldPos, worldPos);
vtkIdType id = points->InsertNextPoint(worldPos[0], worldPos[1], 0);
data->SetPoints(points);
@@ -77,6 +77,5 @@ void SpawnPointCallback::setRen(const vtkSmartPointer<vtkRenderer> &ren) {
void SpawnPointCallback::setUVGrid(const std::shared_ptr<UVGrid> &uvGrid) {
this->uvGrid = uvGrid;
inverseCartographicProjection = getCartographicTransformMatrix(uvGrid);
inverseCartographicProjection->Invert();
inverseCartographicProjection = createInverseCartographicTransformFilter(uvGrid)->GetTransform();
}
@@ -1,13 +1,13 @@
#ifndef SPAWNPOINTCALLBACK_H
#define SPAWNPOINTCALLBACK_H
#include <memory>
#include <vtkCallbackCommand.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkPoints.h>
#include <vtkPolyData.h>
#include <vtkMatrix4x4.h>
#include <vtkAbstractTransform.h>
#include "../advection/UVGrid.h"
class SpawnPointCallback : public vtkCallbackCommand {
@@ -30,7 +30,7 @@ private:
vtkSmartPointer<vtkPoints> points;
vtkSmartPointer<vtkRenderer> ren;
std::shared_ptr<UVGrid> uvGrid;
vtkSmartPointer<vtkMatrix4x4> inverseCartographicProjection;
vtkSmartPointer<vtkAbstractTransform> inverseCartographicProjection;
void Execute(vtkObject *caller, unsigned long evId, void *callData) override;
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.