-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
73 lines (66 loc) · 1.67 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "inc/helper.h"
#include "inc/IOManager.h"
#include "inc/cjCreator.h"
#include "inc/stringManager.h"
// basic includes
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <algorithm>
#include <chrono>
#include <memory>
// IfcOpenShell includes
#include <ifcparse/IfcFile.h>
#include <ifcparse/IfcHierarchyHelper.h>
#include <ifcgeom_schema_agnostic/Kernel.h>
#if USE_VLD
#include <vld.h>
#endif
int main(int argc, char** argv) {
std::cout << " " << std::endl;
auto startTime = std::chrono::high_resolution_clock::now();
std::string issueEncounterString = errorWarningStringEnum::getString(ErrorID::warningIssueencountered);
// outputs errors related to the selected objects
if (false) { Logger::SetOutput(&std::cout, &std::cout); }
IOManager manager;
bool success = false;
if (argc > 1) {
try
{
success = manager.init({ argv[1] });
}
catch (const std::string& exceptionString)
{
std::cout << issueEncounterString << std::endl;
std::cout << exceptionString << std::endl;
success = false;
}
}
else {
try
{
success = manager.init({});
}
catch (const std::string& exceptionString)
{
std::cout << issueEncounterString << std::endl;
std::cout << exceptionString << std::endl;
success = false;
}
}
if (!success)
{
std::cout << errorWarningStringEnum::getString(ErrorID::errorUnableToProcessFile) << std::endl;
manager.write(true);
return 1;
}
if (!manager.run())
{
std::cout << errorWarningStringEnum::getString(ErrorID::errorUnableToProcessFile) << std::endl;
manager.write();
return 1;
}
manager.write();
return 0;
}