C++ IFC中的绝对墙位置
因为我想将窗与墙关联,所以我尝试使用IFCOpenShell查找墙的端点C++ IFC中的绝对墙位置,c++,ifc,C++,Ifc,因为我想将窗与墙关联,所以我尝试使用IFCOpenShell查找墙的端点 #include <ifcgeom/IfcGeom.h> #include <ifcparse/IfcFile.h> using namespace Ifc2x3; using namespace IfcSchema; using namespace IfcParse; using namespace IfcUtil; using namespace IfcGeom; std::string t
#include <ifcgeom/IfcGeom.h>
#include <ifcparse/IfcFile.h>
using namespace Ifc2x3;
using namespace IfcSchema;
using namespace IfcParse;
using namespace IfcUtil;
using namespace IfcGeom;
std::string tostr(gp_XYZ a) {
std::stringstream ss;
ss << a.X() << "," << a.Y() << "," << a.Z();
return ss.str();
}
int main(int argc, char** argv) {
IfcFile file;
if (!file.Init(argc > 1 ? argv[1] : "windows connected to walls Archicad.ifc")) abort();
Kernel k;
gp_Pnt start;
gp_Pnt end;
auto list = file.entitiesByType<IfcWall>();
for ( auto it = list->begin(); it != list->end(); ++it) {
auto w1 = *it;
std::cout << "wall " << w1->entity->id() << std::endl;
bool suc = k.find_wall_end_points(w1, start, end);
std::cout << suc << std::endl;
std::cout << tostr(start.XYZ()) << std::endl;
std::cout << tostr(end.XYZ()) << std::endl;
}
}
#包括
#包括
使用名称空间Ifc2x3;
使用名称空间IfcSchema;
使用名称空间IfcParse;
使用名称空间IfcUtil;
使用名称空间IfcGeom;
std::字符串tostr(gp_XYZ a){
std::stringstream-ss;
ss如中所述,位置是相对的,因此我必须将其与两个矩阵相乘