2021-02-12 17:32:43 +01: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/>. *
|
|
|
|
|
* *
|
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef HdfSERIALIZER_H
|
|
|
|
|
#define HdfSERIALIZER_H
|
|
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
|
2021-02-14 12:23:43 +01:00
|
|
|
#include "H5Cpp.h"
|
|
|
|
|
|
2021-02-12 17:32:43 +01:00
|
|
|
#include "../serializers/GeometrySerializer.h"
|
|
|
|
|
|
2021-02-20 15:35:33 +01:00
|
|
|
|
2021-02-12 17:32:43 +01:00
|
|
|
class HdfSerializer : public GeometrySerializer {
|
|
|
|
|
private:
|
2021-02-19 17:03:41 +01:00
|
|
|
const std::string hdf_filename;
|
2021-02-12 17:32:43 +01:00
|
|
|
unsigned int vcount_total;
|
2021-02-14 12:23:43 +01:00
|
|
|
H5::H5File file;
|
2021-02-15 21:17:35 +01:00
|
|
|
std::set<std::string> guids;
|
2021-02-18 10:35:51 +01:00
|
|
|
const H5std_string DATASET_NAME_POSITIONS;
|
|
|
|
|
const H5std_string DATASET_NAME_NORMALS;
|
|
|
|
|
const H5std_string DATASET_NAME_INDICES;
|
2021-02-19 12:05:29 +01:00
|
|
|
const H5std_string DATASET_NAME_OCCT;
|
2021-02-15 21:17:35 +01:00
|
|
|
|
2021-02-18 10:12:29 +01:00
|
|
|
|
2021-02-12 17:32:43 +01:00
|
|
|
public:
|
2021-02-19 17:03:41 +01:00
|
|
|
HdfSerializer(const std::string& hdf_filename, const SerializerSettings& settings);
|
2021-02-12 17:32:43 +01:00
|
|
|
virtual ~HdfSerializer() {}
|
|
|
|
|
bool ready();
|
|
|
|
|
void writeHeader();
|
2021-07-11 15:00:59 +02:00
|
|
|
void write(const IfcGeom::BRepElement* o);
|
|
|
|
|
void write(const IfcGeom::TriangulationElement* /*o*/) {}
|
2021-02-12 17:32:43 +01:00
|
|
|
void finalize() {}
|
2021-02-19 11:52:32 +01:00
|
|
|
bool isTesselated() const { return false; }
|
2021-02-12 17:32:43 +01:00
|
|
|
void setUnitNameAndMagnitude(const std::string& /*name*/, float /*magnitude*/) {}
|
|
|
|
|
void setFile(IfcParse::IfcFile*) {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|