-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
52 lines (40 loc) · 1.31 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include <filesystem>
#include "Test/MeshFeatureTest.h"
std::string GetDataDir()
{
const std::filesystem::path cmakeDir(CMAKE_SOURCE_DIR);
const auto dataDir = cmakeDir / "Data";
return dataDir.string();
}
std::string GetOutputDir()
{
const std::filesystem::path dataFolderDir(GetDataDir());
const auto outputFolderDir = dataFolderDir / "output";
return outputFolderDir.string();
}
int main()
{
const auto dataDir = GetDataDir();
std::cout << "data dir: " << dataDir << std::endl;
if(!std::filesystem::is_directory(dataDir))
{
std::cerr << "data directory does not exist!" << std::endl;
return 1;
}
const std::filesystem::path DataPath(dataDir);
const auto inputFile = DataPath / "lowerJaw.stl";
const auto outDir = GetOutputDir();
//create the output folder if it does not exist
if(!std::filesystem::exists(outDir))
{
std::cerr << "output directory " << outDir << " does not exist!" << std::endl;
std::filesystem::create_directory(outDir);
}
UnitTest::MeshFeatureTest meshFeatureTest;
meshFeatureTest.SetUp(inputFile.string().c_str(), outDir);
meshFeatureTest.TestMeanCurvatureFeature();
meshFeatureTest.TestGaussianCurvatureFeature();
meshFeatureTest.TestPCAFeature();
return 0;
}