fix: removed comments and added comments

This commit is contained in:
robin 2024-05-08 19:43:15 +02:00
parent 52873b38de
commit 0f99201c06
3 changed files with 20 additions and 47 deletions

View File

@ -89,34 +89,4 @@ vtkSmartPointer<vtkTransformFilter> createInverseCartographicTransformFilter(con
transformFilter->SetTransform(totalProjection); transformFilter->SetTransform(totalProjection);
return transformFilter; return transformFilter;
} }
//vtkSmartPointer<vtkMatrix4x4> getCartographicTransformMatrix(const std::shared_ptr<UVGrid> 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<vtkMatrix4x4>::New();
// matrix->DeepCopy(eyeTransform);
// return matrix;
//}
//
//// Assumes Normalised camera is used
//vtkSmartPointer<vtkTransformFilter> createCartographicTransformFilter(const std::shared_ptr<UVGrid> uvGrid) {
// vtkNew<vtkTransform> transform;
//
// transform->SetMatrix(getCartographicTransformMatrix(uvGrid));
//
// vtkSmartPointer<vtkTransformFilter> transformFilter = vtkSmartPointer<vtkTransformFilter>::New();
// transformFilter->SetTransform(transform);
//
// return transformFilter;
//}

View File

@ -15,19 +15,20 @@
vtkSmartPointer<vtkCamera> createNormalisedCamera(); vtkSmartPointer<vtkCamera> createNormalisedCamera();
/** /**
* Constructs a 4x4 projection matrix that maps homogenious (longitude, latitude, 0, 1) points * Creates a mercator projection and then scales into normalised space.
* to the normalised space. * @param uvGrid grid that contains latitudes and longitudes
* TODO: This transformation has room for improvement see: * @return pointer to transform filter
* https://github.com/MakeNEnjoy/interactive-track-and-trace/issues/12
* @return pointer to 4x4 matrix
*/
vtkSmartPointer<vtkMatrix4x4> getCartographicTransformMatrix(const std::shared_ptr<UVGrid> uvGrid);
/**
* Convenience function that converts the 4x4 projection matrix into a vtkTransformFilter
* @return pointer to transform filter
*/ */
vtkSmartPointer<vtkTransformFilter> createCartographicTransformFilter(const std::shared_ptr<UVGrid> uvGrid); vtkSmartPointer<vtkTransformFilter> createCartographicTransformFilter(const std::shared_ptr<UVGrid> 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<vtkTransformFilter> createInverseCartographicTransformFilter(const std::shared_ptr<UVGrid> uvGrid); vtkSmartPointer<vtkTransformFilter> createInverseCartographicTransformFilter(const std::shared_ptr<UVGrid> uvGrid);
#endif //NORMALISEDCARTOGRAPHICCAMERA_H #endif //NORMALISEDCARTOGRAPHICCAMERA_H

View File

@ -23,13 +23,15 @@ public:
*/ */
LGlyphLayer(std::shared_ptr<UVGrid> uvGrid, std::unique_ptr<AdvectionKernel> advectionKernel); LGlyphLayer(std::shared_ptr<UVGrid> uvGrid, std::unique_ptr<AdvectionKernel> 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(); 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; void updateData(int t) override;
vtkSmartPointer<SpawnPointCallback> createSpawnPointCallback(); vtkSmartPointer<SpawnPointCallback> createSpawnPointCallback();