mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 23:49:59 +00:00
Add OCCT data to output file
This commit is contained in:
@@ -43,6 +43,7 @@ HdfSerializer::HdfSerializer(const std::string& obj_filename, const std::string&
|
|||||||
, DATASET_NAME_POSITIONS("Positions")
|
, DATASET_NAME_POSITIONS("Positions")
|
||||||
, DATASET_NAME_NORMALS("Normals")
|
, DATASET_NAME_NORMALS("Normals")
|
||||||
, DATASET_NAME_INDICES("Indices")
|
, DATASET_NAME_INDICES("Indices")
|
||||||
|
, DATASET_NAME_OCCT("OCCT Text")
|
||||||
, mtype1(sizeof(s1_t))
|
, mtype1(sizeof(s1_t))
|
||||||
, mtype2(sizeof(s2_t))
|
, mtype2(sizeof(s2_t))
|
||||||
, mtype3(sizeof(s1_t))
|
, mtype3(sizeof(s1_t))
|
||||||
@@ -108,6 +109,8 @@ void HdfSerializer::write(const IfcGeom::BRepElement<real_t>* o) {
|
|||||||
H5::DataSet indicesDataset;
|
H5::DataSet indicesDataset;
|
||||||
|
|
||||||
H5::Group OCCTGroup;
|
H5::Group OCCTGroup;
|
||||||
|
H5::DataSet OCCTDataset;
|
||||||
|
|
||||||
|
|
||||||
//const IfcGeom::BRepElement<real_t>*elem = static_cast<IfcGeom::BRepElement<real_t>*>(o);
|
//const IfcGeom::BRepElement<real_t>*elem = static_cast<IfcGeom::BRepElement<real_t>*>(o);
|
||||||
|
|
||||||
@@ -131,6 +134,9 @@ void HdfSerializer::write(const IfcGeom::BRepElement<real_t>* o) {
|
|||||||
guids.insert(guid);
|
guids.insert(guid);
|
||||||
elementGroup = file.createGroup(guid);
|
elementGroup = file.createGroup(guid);
|
||||||
meshGroup = elementGroup.createGroup("Triangle Mesh");
|
meshGroup = elementGroup.createGroup("Triangle Mesh");
|
||||||
|
|
||||||
|
OCCTGroup = elementGroup.createGroup("OCCT Data");
|
||||||
|
|
||||||
H5::StrType str_type(0, H5T_VARIABLE);
|
H5::StrType str_type(0, H5T_VARIABLE);
|
||||||
H5:: DataSpace attrdspace(H5S_SCALAR);
|
H5:: DataSpace attrdspace(H5S_SCALAR);
|
||||||
H5::Attribute att = elementGroup.createAttribute("IFC entity type", str_type, attrdspace);
|
H5::Attribute att = elementGroup.createAttribute("IFC entity type", str_type, attrdspace);
|
||||||
@@ -148,6 +154,13 @@ void HdfSerializer::write(const IfcGeom::BRepElement<real_t>* o) {
|
|||||||
dimsfaces[1] = 1;
|
dimsfaces[1] = 1;
|
||||||
H5::DataSpace face_dataspace(RANK, dimsfaces);
|
H5::DataSpace face_dataspace(RANK, dimsfaces);
|
||||||
|
|
||||||
|
const int RANK_OCCT = 1;
|
||||||
|
hsize_t dimsocct[2];
|
||||||
|
dimsocct[0] = 1;
|
||||||
|
dimsfaces[1] = 1;
|
||||||
|
H5::DataSpace occt_dataspace(RANK_OCCT, dimsocct);
|
||||||
|
OCCTDataset = OCCTGroup.createDataSet(DATASET_NAME_OCCT, str_type, occt_dataspace);
|
||||||
|
OCCTDataset.write(brep_data, str_type);
|
||||||
|
|
||||||
indicesDataset = meshGroup.createDataSet(DATASET_NAME_INDICES, mtype1, face_dataspace);
|
indicesDataset = meshGroup.createDataSet(DATASET_NAME_INDICES, mtype1, face_dataspace);
|
||||||
positionsDataset = meshGroup.createDataSet(DATASET_NAME_POSITIONS, mtype2, dataspace);
|
positionsDataset = meshGroup.createDataSet(DATASET_NAME_POSITIONS, mtype2, dataspace);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ private:
|
|||||||
const H5std_string DATASET_NAME_POSITIONS;
|
const H5std_string DATASET_NAME_POSITIONS;
|
||||||
const H5std_string DATASET_NAME_NORMALS;
|
const H5std_string DATASET_NAME_NORMALS;
|
||||||
const H5std_string DATASET_NAME_INDICES;
|
const H5std_string DATASET_NAME_INDICES;
|
||||||
|
const H5std_string DATASET_NAME_OCCT;
|
||||||
H5::CompType mtype1;
|
H5::CompType mtype1;
|
||||||
H5::CompType mtype2;
|
H5::CompType mtype2;
|
||||||
H5::CompType mtype3;
|
H5::CompType mtype3;
|
||||||
|
|||||||
Reference in New Issue
Block a user