Merge pull request #24 from MakeNEnjoy/robin-rename-headers

renamed directory
This commit is contained in:
Djairo 2024-05-06 17:33:13 +02:00 committed by GitHub
commit 1ae59e41f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 52 additions and 54 deletions

View File

@ -19,7 +19,7 @@ data/
hydrodynamic_U.h5
hydrodynamic_V.h5
interactive-track-and-trace/
opening-hdf5/
particle-track-and-trace/
...
```

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(VtkBase)
project(ParticleTrackTrace)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -36,24 +36,23 @@ endif()
# netcdf setup
find_package(netCDF REQUIRED)
add_executable(VtkBase MACOSX_BUNDLE main.cpp
CartographicTransformation.cpp
commands/CameraMoveCallback.cpp
commands/CameraMoveCallback.h
commands/SpawnPointCallback.cpp
commands/SpawnPointCallback.h
commands/TimerCallbackCommand.cpp
commands/TimerCallbackCommand.h
layers/BackgroundImage.cpp
layers/BackgroundImage.h
layers/EGlyphLayer.cpp
layers/EGlyphLayer.h
layers/Layer.cpp
layers/Layer.h
layers/LGlyphLayer.cpp
layers/LGlyphLayer.h
Program.cpp
Program.h
add_executable(ParticleTrackTrace MACOSX_BUNDLE main.cpp
layers/BackgroundImage.cpp
layers/BackgroundImage.h
layers/EGlyphLayer.cpp
layers/EGlyphLayer.h
layers/Layer.cpp
layers/Layer.h
layers/LGlyphLayer.cpp
layers/LGlyphLayer.h
Program.cpp
Program.h
commands/TimerCallbackCommand.h
commands/TimerCallbackCommand.cpp
commands/SpawnPointCallback.h
commands/SpawnPointCallback.cpp
commands/CameraMoveCallback.cpp
commands/CameraMoveCallback.h
CartographicTransformation.cpp
advection/AdvectionKernel.h
advection/EulerAdvectionKernel.cpp
@ -82,16 +81,16 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
target_include_directories(VtkBase PUBLIC ${netCDF_INCLUDE_DIR})
target_include_directories(ParticleTrackTrace PUBLIC ${netCDF_INCLUDE_DIR})
find_library(NETCDF_LIB NAMES netcdf-cxx4 netcdf_c++4 PATHS ${NETCDFCXX_LIB_DIR} NO_DEFAULT_PATH)
# Prevent a "command line is too long" failure in Windows.
set(CMAKE_NINJA_FORCE_RESPONSE_FILE "ON" CACHE BOOL "Force Ninja to use response files.")
target_link_libraries(VtkBase ${NETCDF_LIB} ${VTK_LIBRARIES})
target_link_libraries(ParticleTrackTrace ${NETCDF_LIB} ${VTK_LIBRARIES})
# vtk_module_autoinit is needed
vtk_module_autoinit(
TARGETS VtkBase
TARGETS ParticleTrackTrace
MODULES ${VTK_LIBRARIES}
)

View File

@ -1,12 +1,11 @@
#ifndef NORMALISEDCARTOGRAPHICCAMERA_H
#define NORMALISEDCARTOGRAPHICCAMERA_H
#include <memory>
#include <vtkCamera.h>
#include <vtkTransformFilter.h>
#include "advection/UVGrid.h"
#ifndef VTKBASE_NORMALISEDCARTOGRAPHICCAMERA_H
#define VTKBASE_NORMALISEDCARTOGRAPHICCAMERA_H
#endif //VTKBASE_NORMALISEDCARTOGRAPHICCAMERA_H
/**
* Constructs a orthographically projected camera that looks at the square x,y in [-1, 1] with z = 0 and w = 1.
@ -29,3 +28,4 @@ vtkSmartPointer<vtkMatrix4x4> getCartographicTransformMatrix(const std::shared_p
* @return pointer to transform filter
*/
vtkSmartPointer<vtkTransformFilter> createCartographicTransformFilter(const std::shared_ptr<UVGrid> uvGrid);
#endif //NORMALISEDCARTOGRAPHICCAMERA_H

View File

@ -1,5 +1,5 @@
#ifndef ADVECTION_ADVECTIONKERNEL_H
#define ADVECTION_ADVECTIONKERNEL_H
#ifndef ADVECTIONKERNEL_H
#define ADVECTIONKERNEL_H
#include <tuple>
@ -28,4 +28,4 @@ public:
virtual ~AdvectionKernel() = default; // Apparently I need this, idk why
};
#endif //ADVECTION_ADVECTIONKERNEL_H
#endif //ADVECTIONKERNEL_H

View File

@ -1,5 +1,5 @@
#ifndef ADVECTION_EULERADVECTIONKERNEL_H
#define ADVECTION_EULERADVECTIONKERNEL_H
#ifndef EULERADVECTIONKERNEL_H
#define EULERADVECTIONKERNEL_H
#include "AdvectionKernel.h"
#include "UVGrid.h"
@ -23,4 +23,4 @@ public:
};
#endif //ADVECTION_EULERADVECTIONKERNEL_H
#endif //EULERADVECTIONKERNEL_H

View File

@ -1,5 +1,5 @@
#ifndef ADVECTION_RK4ADVECTIONKERNEL_H
#define ADVECTION_RK4ADVECTIONKERNEL_H
#ifndef RK4ADVECTIONKERNEL_H
#define RK4ADVECTIONKERNEL_H
#include "AdvectionKernel.h"
#include "UVGrid.h"
@ -20,4 +20,4 @@ public:
};
#endif //ADVECTION_RK4ADVECTIONKERNEL_H
#endif //RK4ADVECTIONKERNEL_H

View File

@ -1,5 +1,5 @@
#ifndef ADVECTION_UVGRID_H
#define ADVECTION_UVGRID_H
#ifndef UVGRID_H
#define UVGRID_H
#include <vector>
#include "Vel.h"
@ -62,4 +62,4 @@ public:
void streamSlice(std::ostream &os, size_t t);
};
#endif //ADVECTION_UVGRID_H
#endif //UVGRID_H

View File

@ -1,5 +1,5 @@
#ifndef ADVECTION_VEL_H
#define ADVECTION_VEL_H
#ifndef VEL_H
#define VEL_H
#include <utility>
#include <stdexcept>
@ -41,4 +41,4 @@ Vel operator*(Scalar scalar, const Vel& p) {
return Vel(p.u * scalar, p.v * scalar);
}
#endif //ADVECTION_VEL_H
#endif //VEL_H

View File

@ -1,5 +1,5 @@
#ifndef ADVECTION_INTERPOLATE_H
#define ADVECTION_INTERPOLATE_H
#ifndef INTERPOLATE_H
#define INTERPOLATE_H
#include <vector>
@ -25,4 +25,4 @@ Vel bilinearinterpolate(const UVGrid &uvGrid, int time, double lat, double lon);
*/
std::vector<Vel> bilinearinterpolation(const UVGrid &uvGrid, std::vector<std::tuple<int, double, double>> points);
#endif //ADVECTION_INTERPOLATE_H
#endif //INTERPOLATE_H

View File

@ -1,5 +1,5 @@
#ifndef ADVECTION_READDATA_H
#define ADVECTION_READDATA_H
#ifndef READDATA_H
#define READDATA_H
/**
* reads the file hydrodynamic_U.h5
@ -19,4 +19,4 @@ std::vector<double> readHydrodynamicV();
*/
std::tuple<std::vector<int>, std::vector<double>, std::vector<double>> readGrid();
#endif //ADVECTION_READDATA_H
#endif //READDATA_H

View File

@ -1,5 +1,5 @@
#ifndef VTKBASE_CAMERAMOVECALLBACK_H
#define VTKBASE_CAMERAMOVECALLBACK_H
#ifndef CAMERAMOVECALLBACK_H
#define CAMERAMOVECALLBACK_H
#include <vtkCallbackCommand.h>

View File

@ -1,5 +1,5 @@
#ifndef VTKBASE_SPAWNPOINTCALLBACK_H
#define VTKBASE_SPAWNPOINTCALLBACK_H
#ifndef SPAWNPOINTCALLBACK_H
#define SPAWNPOINTCALLBACK_H
#include <memory>
@ -38,4 +38,4 @@ private:
};
#endif //VTKBASE_SPAWNPOINTCALLBACK_H
#endif //SPAWNPOINTCALLBACK_H

View File

@ -29,7 +29,6 @@ vtkSmartPointer<SpawnPointCallback> LGlyphLayer::createSpawnPointCallback() {
// Further notes; current thinking is to allow tracking a particle's age by using a scalar array in the VtkPolyData. This would be incremented for every tick/updateData function call.
// Another challenge is the concept of beaching; dead particles must not be included in the advect function call (wasted computations), but they should not be outright deleted from the vtkPoints either (we still want to display them). Working Solution: have another array of ints in the vtkPolyData, which tracks for how many calls of UpdateData a given particle has not had its position changed. If this int reaches some treshold (5? 10? 3? needs some testing), exclude the particle from the advect call.
//
// TODO: modelling all this in vtkClasses is workable, but ideally i would want to work with a native C++ class. See if this is doable and feasible.
LGlyphLayer::LGlyphLayer(std::shared_ptr<UVGrid> uvGrid, std::unique_ptr<AdvectionKernel> advectionKernel) {