diff --git a/CMakeLists.txt b/CMakeLists.txt index 62d01c0..9b3462a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,16 +46,16 @@ target_sources(pfe PRIVATE src/aspect_ratio_filter.h src/dihedral_angles_filter.cc src/dihedral_angles_filter.h - src/external_points_filter.cc - src/external_points_filter.h + src/surface_points_filter.cc + src/surface_points_filter.h src/kd_tree.cc src/kd_tree.h src/mesh_fit_filter.cc src/mesh_fit_filter.h src/point_tris_dist.cc src/point_tris_dist.h - src/project_external_points_on_surface.cc - src/project_external_points_on_surface.h) + src/project_surface_points_on_poly.cc + src/project_surface_points_on_poly.h) target_link_libraries(pfe PRIVATE ${VTK_COMPONENTS}) diff --git a/src/external_points_filter.h b/src/external_points_filter.h deleted file mode 100644 index 9c6e5b7..0000000 --- a/src/external_points_filter.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef EXTERNAL_POINTS_FILTER_H -#define EXTERNAL_POINTS_FILTER_H - - -#include -#include - - -class ExternalPointsFilter : public vtkUnstructuredGridAlgorithm { -public: - static ExternalPointsFilter *New(); - vtkTypeMacro(ExternalPointsFilter, vtkUnstructuredGridAlgorithm); - vtkTypeBool RequestData(vtkInformation *request, - vtkInformationVector **inputVector, - vtkInformationVector *outputVector) override; - -protected: - ~ExternalPointsFilter() override = default; -}; - - -#endif diff --git a/src/main.cc b/src/main.cc index 4ad8fb5..9f731fc 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,8 +1,8 @@ #include "angles_filter.h" #include "aspect_ratio_filter.h" #include "dihedral_angles_filter.h" -#include "external_points_filter.h" -#include "project_external_points_on_surface.h" +#include "surface_points_filter.h" +#include "project_surface_points_on_poly.h" #include "mesh_fit_filter.h" #include "point_tris_dist.h" @@ -91,24 +91,24 @@ int main(int argc, char **argv) { // externalFacesFilter->DebugOn(); // externalFacesFilter->SetInputConnection(dihedralAnglesFilter->GetOutputPort()); - /* External points filter. */ - vtkNew externalPointsFilter; - externalPointsFilter->SetInputConnection(dihedralAnglesFilter->GetOutputPort()); + /* Surface points filter. */ + vtkNew surfacePointsFilter; + surfacePointsFilter->SetInputConnection(dihedralAnglesFilter->GetOutputPort()); // vtkNew meshFitFilter; - // meshFitFilter->SetInputConnection(externalPointsFilter->GetOutputPort()); + // meshFitFilter->SetInputConnection(surfacePointsFilter->GetOutputPort()); vtkNew pdReader; pdReader->SetFileName(argv[2]); - vtkNew pepouse; - pepouse->SetInputConnection(0, externalPointsFilter->GetOutputPort()); - pepouse->SetInputConnection(1, pdReader->GetOutputPort()); + vtkNew project; + project->SetInputConnection(0, surfacePointsFilter->GetOutputPort()); + project->SetInputConnection(1, pdReader->GetOutputPort()); vtkNew writer; - writer->SetInputConnection(pepouse->GetOutputPort()); + writer->SetInputConnection(project->GetOutputPort()); writer->SetFileTypeToASCII(); writer->SetFileName("out.vtk"); writer->Write(); diff --git a/src/project_external_points_on_surface.h b/src/project_external_points_on_surface.h deleted file mode 100644 index c19077f..0000000 --- a/src/project_external_points_on_surface.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef PROJECT_EXTERNAL_POINTS_ON_SURFACE_H -#define PROJECT_EXTERNAL_POINTS_ON_SURFACE_H - -#include -#include - - -class ProjectExternalPointsOnSurface : public vtkUnstructuredGridAlgorithm { -public: - static ProjectExternalPointsOnSurface *New(); - vtkTypeMacro(ProjectExternalPointsOnSurface, vtkUnstructuredGridAlgorithm); - ProjectExternalPointsOnSurface(); - int FillInputPortInformation(int, vtkInformation *info) override; - vtkTypeBool RequestData(vtkInformation *request, - vtkInformationVector **inputVector, - vtkInformationVector *outputVector) override; - -protected: - ~ProjectExternalPointsOnSurface() override = default; -}; - - -#endif diff --git a/src/project_external_points_on_surface.cc b/src/project_surface_points_on_poly.cc similarity index 88% rename from src/project_external_points_on_surface.cc rename to src/project_surface_points_on_poly.cc index 1f29492..0dc3899 100644 --- a/src/project_external_points_on_surface.cc +++ b/src/project_surface_points_on_poly.cc @@ -1,6 +1,6 @@ #include "point_tris_dist.h" -#include "project_external_points_on_surface.h" +#include "project_surface_points_on_poly.h" #include #include @@ -16,15 +16,15 @@ #include -vtkStandardNewMacro(ProjectExternalPointsOnSurface); +vtkStandardNewMacro(ProjectSurfacePointsOnPoly); -ProjectExternalPointsOnSurface::ProjectExternalPointsOnSurface() { +ProjectSurfacePointsOnPoly::ProjectSurfacePointsOnPoly() { SetNumberOfInputPorts(2); } -int ProjectExternalPointsOnSurface::FillInputPortInformation(int port, vtkInformation *info) { +int ProjectSurfacePointsOnPoly::FillInputPortInformation(int port, vtkInformation *info) { if (port == 0) { vtkUnstructuredGridAlgorithm::FillInputPortInformation(port, info); } else if (port == 1) { @@ -36,7 +36,7 @@ int ProjectExternalPointsOnSurface::FillInputPortInformation(int port, vtkInform } -vtkTypeBool ProjectExternalPointsOnSurface::RequestData( +vtkTypeBool ProjectSurfacePointsOnPoly::RequestData( vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) { diff --git a/src/project_surface_points_on_poly.h b/src/project_surface_points_on_poly.h new file mode 100644 index 0000000..926a562 --- /dev/null +++ b/src/project_surface_points_on_poly.h @@ -0,0 +1,23 @@ +#ifndef PROJECT_SURFACE_POINTS_ON_POLY_H +#define PROJECT_SURFACE_POINTS_ON_POLY_H + +#include +#include + + +class ProjectSurfacePointsOnPoly : public vtkUnstructuredGridAlgorithm { +public: + static ProjectSurfacePointsOnPoly *New(); + vtkTypeMacro(ProjectSurfacePointsOnPoly, vtkUnstructuredGridAlgorithm); + ProjectSurfacePointsOnPoly(); + int FillInputPortInformation(int, vtkInformation *info) override; + vtkTypeBool RequestData(vtkInformation *request, + vtkInformationVector **inputVector, + vtkInformationVector *outputVector) override; + +protected: + ~ProjectSurfacePointsOnPoly() override = default; +}; + + +#endif diff --git a/src/external_points_filter.cc b/src/surface_points_filter.cc similarity index 95% rename from src/external_points_filter.cc rename to src/surface_points_filter.cc index d54836d..4579d23 100644 --- a/src/external_points_filter.cc +++ b/src/surface_points_filter.cc @@ -1,4 +1,4 @@ -#include "external_points_filter.h" +#include "surface_points_filter.h" #include #include @@ -32,10 +32,10 @@ static void keep_only_dupes(std::vector &ids_a, } -vtkStandardNewMacro(ExternalPointsFilter); +vtkStandardNewMacro(SurfacePointsFilter); -vtkTypeBool ExternalPointsFilter::RequestData( +vtkTypeBool SurfacePointsFilter::RequestData( vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) { diff --git a/src/surface_points_filter.h b/src/surface_points_filter.h new file mode 100644 index 0000000..baab7d0 --- /dev/null +++ b/src/surface_points_filter.h @@ -0,0 +1,22 @@ +#ifndef SURFACE_POINT_FILTER_H +#define SURFACE_POINT_FILTER_H + + +#include +#include + + +class SurfacePointsFilter : public vtkUnstructuredGridAlgorithm { +public: + static SurfacePointsFilter *New(); + vtkTypeMacro(SurfacePointsFilter, vtkUnstructuredGridAlgorithm); + vtkTypeBool RequestData(vtkInformation *request, + vtkInformationVector **inputVector, + vtkInformationVector *outputVector) override; + +protected: + ~SurfacePointsFilter() override = default; +}; + + +#endif