Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/134.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ IFC中的绝对墙位置_C++_Ifc - Fatal编程技术网

C++ IFC中的绝对墙位置

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

因为我想将窗与墙关联,所以我尝试使用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 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如中所述,位置是相对的,因此我必须将其与两个矩阵相乘