From 0f99201c061fa26c99ecc504a2f5d1228c354bbd Mon Sep 17 00:00:00 2001 From: robin Date: Wed, 8 May 2024 19:43:15 +0200 Subject: [PATCH] fix: removed comments and added comments --- .../src/CartographicTransformation.cpp | 32 +------------------ .../src/CartographicTransformation.h | 23 ++++++------- .../src/layers/LGlyphLayer.h | 12 ++++--- 3 files changed, 20 insertions(+), 47 deletions(-) diff --git a/particle-track-and-trace/src/CartographicTransformation.cpp b/particle-track-and-trace/src/CartographicTransformation.cpp index 4f7e776..1c8b09a 100644 --- a/particle-track-and-trace/src/CartographicTransformation.cpp +++ b/particle-track-and-trace/src/CartographicTransformation.cpp @@ -89,34 +89,4 @@ vtkSmartPointer createInverseCartographicTransformFilter(con transformFilter->SetTransform(totalProjection); return transformFilter; -} - -//vtkSmartPointer getCartographicTransformMatrix(const std::shared_ptr uvGrid) { -// const double XMin = uvGrid->lons.front(); -// const double XMax = uvGrid->lons.back(); -// const double YMin = uvGrid->lats.front(); -// const double YMax = uvGrid->lats.back(); -// -// double eyeTransform[] = { -// 2/(XMax-XMin), 0, 0, -(XMax+XMin)/(XMax-XMin), -// 0, 2/(YMax-YMin), 0, -(YMax+YMin)/(YMax-YMin), -// 0, 0, 1, 0, -// 0, 0, 0, 1 -// }; -// -// auto matrix = vtkSmartPointer::New(); -// matrix->DeepCopy(eyeTransform); -// return matrix; -//} -// -//// Assumes Normalised camera is used -//vtkSmartPointer createCartographicTransformFilter(const std::shared_ptr uvGrid) { -// vtkNew transform; -// -// transform->SetMatrix(getCartographicTransformMatrix(uvGrid)); -// -// vtkSmartPointer transformFilter = vtkSmartPointer::New(); -// transformFilter->SetTransform(transform); -// -// return transformFilter; -//} \ No newline at end of file +} \ No newline at end of file diff --git a/particle-track-and-trace/src/CartographicTransformation.h b/particle-track-and-trace/src/CartographicTransformation.h index 9b265e5..46dc51f 100644 --- a/particle-track-and-trace/src/CartographicTransformation.h +++ b/particle-track-and-trace/src/CartographicTransformation.h @@ -15,19 +15,20 @@ vtkSmartPointer createNormalisedCamera(); /** - * Constructs a 4x4 projection matrix that maps homogenious (longitude, latitude, 0, 1) points - * to the normalised space. - * TODO: This transformation has room for improvement see: - * https://github.com/MakeNEnjoy/interactive-track-and-trace/issues/12 - * @return pointer to 4x4 matrix - */ -vtkSmartPointer getCartographicTransformMatrix(const std::shared_ptr uvGrid); - -/** - * Convenience function that converts the 4x4 projection matrix into a vtkTransformFilter - * @return pointer to transform filter + * Creates a mercator projection and then scales into normalised space. + * @param uvGrid grid that contains latitudes and longitudes + * @return pointer to transform filter */ vtkSmartPointer createCartographicTransformFilter(const std::shared_ptr uvGrid); +/** + * Creates an inverse mercator projection and then scales into normalised space. + * + * Note that it is not possible to call the Inverse() member function on the transform of the + * createCartographicTransformFilter. It produces the wrong output, + * I believe that this is a bug in VTK, I might make an issue about this sometime. + * @param uvGrid grid that contains latitudes and longitudes + * @return pointer to transform filter + */ vtkSmartPointer createInverseCartographicTransformFilter(const std::shared_ptr uvGrid); #endif //NORMALISEDCARTOGRAPHICCAMERA_H diff --git a/particle-track-and-trace/src/layers/LGlyphLayer.h b/particle-track-and-trace/src/layers/LGlyphLayer.h index 125282f..5ffdbd1 100644 --- a/particle-track-and-trace/src/layers/LGlyphLayer.h +++ b/particle-track-and-trace/src/layers/LGlyphLayer.h @@ -23,13 +23,15 @@ public: */ LGlyphLayer(std::shared_ptr uvGrid, std::unique_ptr advectionKernel); - /** This function spoofs a few points in the dataset. Mostly used for testing. - */ + /** + * This function spoofs a few points in the dataset. Mostly used for testing. + */ void spoofPoints(); - /** updates the glyphs to reflect the given timestamp in the dataset. - * @param t : the time at which to fetch the data. - */ + /** + * updates the glyphs to reflect the given timestamp in the dataset. + * @param t : the time at which to fetch the data. + */ void updateData(int t) override; vtkSmartPointer createSpawnPointCallback();