-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathInterface.h
More file actions
111 lines (92 loc) · 3.48 KB
/
Copy pathInterface.h
File metadata and controls
111 lines (92 loc) · 3.48 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#define IFCUNTYPEDENTITY_H
#include <map>
#include <fstream>
namespace IfcParse { class IfcUntypedEntity; }
#include "../ifcparse/IfcUtil.h"
#include "../ifcparse/Ifc2x3.h"
#include "../ifcgeom/IfcGeom.h"
namespace IfcParse {
class IfcUntypedEntity : public IfcUtil::IfcBaseEntity {
private:
IfcSchema::Type::Enum _type;
public:
IfcUntypedEntity(const std::string& s);
bool is(IfcSchema::Type::Enum v) const;
IfcSchema::Type::Enum type() const;
bool is_a(const std::string& s) const;
std::string is_a() const;
unsigned int getArgumentCount() const;
IfcUtil::ArgumentType getArgumentType(unsigned int i) const;
ArgumentPtr getArgument(unsigned int i) const;
ArgumentPtr getArgument(const std::string& a) const;
const char* getArgumentName(unsigned int i) const;
unsigned getArgumentIndex(const std::string& a) const;
IfcEntities get_inverse(const std::string& a);
void setArgument(unsigned int i);
void setArgument(unsigned int i, int v);
void setArgument(unsigned int i, bool v);
void setArgument(unsigned int i, double v);
void setArgument(unsigned int i, const std::string& v);
void setArgument(unsigned int i, const std::vector<int>& v);
void setArgument(unsigned int i, const std::vector<double>& v);
void setArgument(unsigned int i, const std::vector<std::string>& v);
void setArgument(unsigned int i, IfcUntypedEntity* v);
void setArgument(unsigned int i, IfcEntities v);
std::string toString();
std::pair<IfcUtil::ArgumentType,ArgumentPtr> get_argument(unsigned i);
std::pair<IfcUtil::ArgumentType,ArgumentPtr> get_argument(const std::string& a);
bool is_valid();
};
}
typedef IfcUtil::IfcSchemaEntity IfcEntity;
typedef std::map<IfcSchema::Type::Enum,IfcEntities> MapEntitiesByType;
typedef std::map<unsigned int,IfcEntity> MapEntityById;
typedef std::map<std::string,IfcSchema::IfcRoot::ptr> MapEntityByGuid;
typedef std::map<unsigned int,IfcEntities> MapEntitiesByRef;
typedef std::map<unsigned int,unsigned int> MapOffsetById;
namespace IfcParse {
class IfcSpfStream;
class Tokens;
class IfcFile {
private:
MapEntityById byid;
MapEntitiesByType bytype;
MapEntitiesByRef byref;
MapEntityByGuid byguid;
MapOffsetById offsets;
unsigned int lastId;
unsigned int MaxId;
std::string _filename;
std::string _timestamp;
std::string _author;
std::string _author_email;
std::string _author_organisation;
public:
IfcParse::IfcSpfStream* stream;
IfcParse::Tokens* tokens;
bool Init(const std::string& fn);
IfcEntities EntitiesByType(const std::string& t);
IfcEntity EntityById(int id);
IfcSchema::IfcRoot::ptr EntityByGuid(const std::string& guid);
void AddEntity(IfcUtil::IfcSchemaEntity e);
IfcFile();
~IfcFile();
};
IfcParse::IfcFile* open(const std::string& s) {
IfcParse::IfcFile* f = new IfcParse::IfcFile();
f->Init(s);
return f;
}
std::string create_shape(IfcParse::IfcUntypedEntity* e, unsigned int settings = 0) {
if (!e->is(IfcSchema::Type::IfcProduct)) throw IfcException("Entity is not an IfcProduct");
IfcSchema::IfcProduct* ifc_product = (IfcSchema::IfcProduct*) e;
return IfcGeom::create_brep_data(ifc_product, settings);
}
void clean() {
IfcGeom::Cache::Purge();
}
const int DISABLE_OPENING_SUBTRACTIONS = 1 << 0;
const int DISABLE_OBJECT_PLACEMENT = 1 << 1;
const int SEW_SHELLS = 1 << 2;
}
std::ostream& operator<< (std::ostream& os, const IfcParse::IfcFile& f);