2011-05-08 11:04:32 +00:00
|
|
|
/********************************************************************************
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of IfcOpenShell. *
|
|
|
|
|
* *
|
|
|
|
|
* IfcOpenShell is free software: you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the Lesser GNU General Public License as published by *
|
|
|
|
|
* the Free Software Foundation, either version 3.0 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* IfcOpenShell is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* Lesser GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the Lesser GNU General Public License *
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
|
* *
|
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
|
|
|
|
namespace IfcGeomObjects {
|
2011-10-28 09:55:26 +00:00
|
|
|
|
|
|
|
|
const int WELD_VERTICES = 1;
|
|
|
|
|
const int USE_WORLD_COORDS = 2;
|
2012-01-31 08:56:10 +00:00
|
|
|
const int CONVERT_BACK_UNITS = 3;
|
|
|
|
|
const int USE_BREP_DATA = 4;
|
2011-10-28 09:55:26 +00:00
|
|
|
|
2011-05-08 11:04:32 +00:00
|
|
|
class IfcMesh {
|
|
|
|
|
public:
|
|
|
|
|
int id;
|
|
|
|
|
std::vector<float> verts;
|
|
|
|
|
std::vector<int> faces;
|
|
|
|
|
std::vector<int> edges;
|
2011-10-28 09:55:26 +00:00
|
|
|
std::vector<float> normals;
|
2012-01-31 08:56:10 +00:00
|
|
|
std::string brep_data;
|
2011-05-08 11:04:32 +00:00
|
|
|
};
|
|
|
|
|
|
2011-10-08 13:06:57 +00:00
|
|
|
class IfcObject {
|
2011-05-08 11:04:32 +00:00
|
|
|
public:
|
2011-10-08 09:01:35 +00:00
|
|
|
int id;
|
2011-10-08 13:06:57 +00:00
|
|
|
int parent_id;
|
2011-05-08 11:04:32 +00:00
|
|
|
std::string name;
|
|
|
|
|
std::string type;
|
2011-10-08 13:06:57 +00:00
|
|
|
std::string guid;
|
2011-05-08 11:04:32 +00:00
|
|
|
std::vector<float> matrix;
|
2011-12-05 14:23:22 +00:00
|
|
|
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;
|
|
|
|
|
}
|
2011-10-08 13:06:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class IfcGeomObject : public IfcObject {
|
|
|
|
|
public:
|
2011-05-08 11:04:32 +00:00
|
|
|
IfcMesh* mesh;
|
|
|
|
|
};
|
|
|
|
|
|
2011-10-08 13:06:57 +00:00
|
|
|
bool Next();
|
|
|
|
|
const IfcGeomObject* Get();
|
2011-12-01 11:19:27 +00:00
|
|
|
bool Init(const std::string fn);
|
2011-12-06 10:38:14 +00:00
|
|
|
bool InitUCS2(const char* fn) {
|
|
|
|
|
return Init(std::string(fn+1));
|
|
|
|
|
}
|
2011-10-28 09:55:26 +00:00
|
|
|
void Settings(int setting, bool value);
|
2011-10-08 13:06:57 +00:00
|
|
|
int Progress();
|
|
|
|
|
const IfcObject* GetObject(int id);
|
|
|
|
|
bool CleanUp();
|
2011-10-12 16:43:29 +00:00
|
|
|
std::string GetLog();
|
|
|
|
|
|
2011-05-08 11:04:32 +00:00
|
|
|
};
|