Allow for string data to be passed as vectors of int between IfcPython and IfcGeom, to circumvent SWG trying to access UCS-2 data as UCS-4 and vice versa

This commit is contained in:
Thomas Krijnen
2011-12-05 14:23:22 +00:00
parent cab44ce754
commit 08d3eb649c
4 changed files with 98 additions and 64 deletions
+16 -1
View File
@@ -39,6 +39,21 @@ namespace IfcGeomObjects {
std::string type;
std::string guid;
std::vector<float> matrix;
const std::vector<int> name_as_intvector() {
std::vector<int> r;
for ( std::string::const_iterator it = name.begin(); it != name.end(); ++ it ) r.push_back(*it);
return r;
}
const std::vector<int> type_as_intvector() {
std::vector<int> r;
for ( std::string::const_iterator it = type.begin(); it != type.end(); ++ it ) r.push_back(*it);
return r;
}
const std::vector<int> guid_as_intvector() {
std::vector<int> r;
for ( std::string::const_iterator it = guid.begin(); it != guid.end(); ++ it ) r.push_back(*it);
return r;
}
};
class IfcGeomObject : public IfcObject {
@@ -49,7 +64,7 @@ namespace IfcGeomObjects {
bool Next();
const IfcGeomObject* Get();
bool Init(const std::string fn);
bool InitUCS2(char* fn);
bool Init(const std::vector<int>& fn);
void Settings(int setting, bool value);
int Progress();
const IfcObject* GetObject(int id);