This commit is contained in:
CookieKastanie 2022-03-04 11:05:52 +01:00
commit aa3e6e67df
8 changed files with 67 additions and 67 deletions

View File

@ -46,16 +46,16 @@ target_sources(pfe PRIVATE
src/aspect_ratio_filter.h src/aspect_ratio_filter.h
src/dihedral_angles_filter.cc src/dihedral_angles_filter.cc
src/dihedral_angles_filter.h src/dihedral_angles_filter.h
src/external_points_filter.cc src/surface_points_filter.cc
src/external_points_filter.h src/surface_points_filter.h
src/kd_tree.cc src/kd_tree.cc
src/kd_tree.h src/kd_tree.h
src/mesh_fit_filter.cc src/mesh_fit_filter.cc
src/mesh_fit_filter.h src/mesh_fit_filter.h
src/point_tris_dist.cc src/point_tris_dist.cc
src/point_tris_dist.h src/point_tris_dist.h
src/project_external_points_on_surface.cc src/project_surface_points_on_poly.cc
src/project_external_points_on_surface.h) src/project_surface_points_on_poly.h)
target_link_libraries(pfe PRIVATE ${VTK_COMPONENTS}) target_link_libraries(pfe PRIVATE ${VTK_COMPONENTS})

View File

@ -1,22 +0,0 @@
#ifndef EXTERNAL_POINTS_FILTER_H
#define EXTERNAL_POINTS_FILTER_H
#include <vtkUnstructuredGridAlgorithm.h>
#include <vtkIdList.h>
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

View File

@ -1,8 +1,8 @@
#include "angles_filter.h" #include "angles_filter.h"
#include "aspect_ratio_filter.h" #include "aspect_ratio_filter.h"
#include "dihedral_angles_filter.h" #include "dihedral_angles_filter.h"
#include "external_points_filter.h" #include "surface_points_filter.h"
#include "project_external_points_on_surface.h" #include "project_surface_points_on_poly.h"
#include "mesh_fit_filter.h" #include "mesh_fit_filter.h"
#include "point_tris_dist.h" #include "point_tris_dist.h"
@ -91,24 +91,24 @@ int main(int argc, char **argv) {
// externalFacesFilter->DebugOn(); // externalFacesFilter->DebugOn();
// externalFacesFilter->SetInputConnection(dihedralAnglesFilter->GetOutputPort()); // externalFacesFilter->SetInputConnection(dihedralAnglesFilter->GetOutputPort());
/* External points filter. */ /* Surface points filter. */
vtkNew<ExternalPointsFilter> externalPointsFilter; vtkNew<SurfacePointsFilter> surfacePointsFilter;
externalPointsFilter->SetInputConnection(dihedralAnglesFilter->GetOutputPort()); surfacePointsFilter->SetInputConnection(dihedralAnglesFilter->GetOutputPort());
// vtkNew<MeshFitFilter> meshFitFilter; // vtkNew<MeshFitFilter> meshFitFilter;
// meshFitFilter->SetInputConnection(externalPointsFilter->GetOutputPort()); // meshFitFilter->SetInputConnection(surfacePointsFilter->GetOutputPort());
vtkNew<vtkXMLPolyDataReader> pdReader; vtkNew<vtkXMLPolyDataReader> pdReader;
pdReader->SetFileName(argv[2]); pdReader->SetFileName(argv[2]);
vtkNew<ProjectExternalPointsOnSurface> pepouse; vtkNew<ProjectSurfacePointsOnPoly> project;
pepouse->SetInputConnection(0, externalPointsFilter->GetOutputPort()); project->SetInputConnection(0, surfacePointsFilter->GetOutputPort());
pepouse->SetInputConnection(1, pdReader->GetOutputPort()); project->SetInputConnection(1, pdReader->GetOutputPort());
vtkNew<vtkUnstructuredGridWriter> writer; vtkNew<vtkUnstructuredGridWriter> writer;
writer->SetInputConnection(pepouse->GetOutputPort()); writer->SetInputConnection(project->GetOutputPort());
writer->SetFileTypeToASCII(); writer->SetFileTypeToASCII();
writer->SetFileName("out.vtk"); writer->SetFileName("out.vtk");
writer->Write(); writer->Write();

View File

@ -1,23 +0,0 @@
#ifndef PROJECT_EXTERNAL_POINTS_ON_SURFACE_H
#define PROJECT_EXTERNAL_POINTS_ON_SURFACE_H
#include <vtkUnstructuredGridAlgorithm.h>
#include <vtkIdList.h>
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

View File

@ -1,6 +1,6 @@
#include "point_tris_dist.h" #include "point_tris_dist.h"
#include "project_external_points_on_surface.h" #include "project_surface_points_on_poly.h"
#include <vtkUnstructuredGrid.h> #include <vtkUnstructuredGrid.h>
#include <vtkPointData.h> #include <vtkPointData.h>
@ -16,15 +16,15 @@
#include <limits> #include <limits>
vtkStandardNewMacro(ProjectExternalPointsOnSurface); vtkStandardNewMacro(ProjectSurfacePointsOnPoly);
ProjectExternalPointsOnSurface::ProjectExternalPointsOnSurface() { ProjectSurfacePointsOnPoly::ProjectSurfacePointsOnPoly() {
SetNumberOfInputPorts(2); SetNumberOfInputPorts(2);
} }
int ProjectExternalPointsOnSurface::FillInputPortInformation(int port, vtkInformation *info) { int ProjectSurfacePointsOnPoly::FillInputPortInformation(int port, vtkInformation *info) {
if (port == 0) { if (port == 0) {
vtkUnstructuredGridAlgorithm::FillInputPortInformation(port, info); vtkUnstructuredGridAlgorithm::FillInputPortInformation(port, info);
} else if (port == 1) { } else if (port == 1) {
@ -36,7 +36,7 @@ int ProjectExternalPointsOnSurface::FillInputPortInformation(int port, vtkInform
} }
vtkTypeBool ProjectExternalPointsOnSurface::RequestData( vtkTypeBool ProjectSurfacePointsOnPoly::RequestData(
vtkInformation *request, vtkInformation *request,
vtkInformationVector **inputVector, vtkInformationVector **inputVector,
vtkInformationVector *outputVector) { vtkInformationVector *outputVector) {

View File

@ -0,0 +1,23 @@
#ifndef PROJECT_SURFACE_POINTS_ON_POLY_H
#define PROJECT_SURFACE_POINTS_ON_POLY_H
#include <vtkUnstructuredGridAlgorithm.h>
#include <vtkIdList.h>
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

View File

@ -1,4 +1,4 @@
#include "external_points_filter.h" #include "surface_points_filter.h"
#include <vtkIdList.h> #include <vtkIdList.h>
#include <vtkUnstructuredGrid.h> #include <vtkUnstructuredGrid.h>
@ -32,10 +32,10 @@ static void keep_only_dupes(std::vector<vtkIdType> &ids_a,
} }
vtkStandardNewMacro(ExternalPointsFilter); vtkStandardNewMacro(SurfacePointsFilter);
vtkTypeBool ExternalPointsFilter::RequestData( vtkTypeBool SurfacePointsFilter::RequestData(
vtkInformation *request, vtkInformation *request,
vtkInformationVector **inputVector, vtkInformationVector **inputVector,
vtkInformationVector *outputVector) { vtkInformationVector *outputVector) {

View File

@ -0,0 +1,22 @@
#ifndef SURFACE_POINT_FILTER_H
#define SURFACE_POINT_FILTER_H
#include <vtkUnstructuredGridAlgorithm.h>
#include <vtkIdList.h>
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