#pragma once #include #include #include #include #include #include #include #include struct BIMEntity { typedef std::wstring string; typedef std::map Datas; struct Geometry { // AcDbSubDMesh面的定义: 一个面由N+1个索引组成 // 索引 0 - 记录此面由N个vertex构成 // 索引 1-N 记录组成此面的vertex索引 Geometry(): faces(0), vertices(0){} AcArray faces; AcGePoint3dArray vertices; AcGePoint3dArray edges; void clear() { faces.removeAll(); vertices.removeAll(); edges.removeAll(); } }; template bool convert(const in_value & t, out_type &out_value) { std::wstringstream stream; stream << t;//向流中传值 return stream >> out_value;//向result中写入值 } template bool insertData(std::wstring &key, InData & value) { string v(_T("")); if (convert(value)) { std::pair pr = datas.insert(std::make_pair(key, v)); return pr.second; } return false; } void setGeometry(const AcArray &fs, const AcGePoint3dArray &pts) { geometry.faces = fs; geometry.vertices = pts; } void clear() { datas.clear(); geometry.clear(); } // bim数据 Datas datas; // 几何数据 Geometry geometry; string id, name, type; };