This commit is contained in:
Thomas Krijnen
2020-03-18 10:12:54 +01:00
parent 358323492e
commit d02182793b
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ public:
: OpenCascadeBasedSerializer(out_filename, settings)
{}
virtual ~IgesSerializer() {}
void writeShape(const TopoDS_Shape& shape) {
void writeShape(const std::string&, const TopoDS_Shape& shape) {
writer.AddShape(shape);
}
void finalize() {
@@ -43,7 +43,7 @@ void OpenCascadeBasedSerializer::write(const IfcGeom::BRepElement<real_t>* o) {
if (settings.get(IfcGeom::IteratorSettings::CONVERT_BACK_UNITS) && settings.unit_magnitude() != 1.0) {
trsf.SetTranslationPart(trsf.TranslationPart() / settings.unit_magnitude());
}
writeShape(compound.Moved(trsf));
writeShape(object_id(o), compound.Moved(trsf));
}
#define RATHER_SMALL (1e-3)
+1 -1
View File
@@ -38,7 +38,7 @@ public:
virtual ~OpenCascadeBasedSerializer() {}
void writeHeader() {}
bool ready();
virtual void writeShape(const TopoDS_Shape& shape) = 0;
virtual void writeShape(const std::string& name, const TopoDS_Shape& shape) = 0;
void write(const IfcGeom::TriangulationElement<real_t>* /*o*/) {}
void write(const IfcGeom::BRepElement<real_t>* o);
bool isTesselated() const { return false; }
+2 -1
View File
@@ -36,9 +36,10 @@ public:
: OpenCascadeBasedSerializer(out_filename, settings)
{}
virtual ~StepSerializer() {}
void writeShape(const TopoDS_Shape& shape) {
void writeShape(const std::string& name, const TopoDS_Shape& shape) {
std::stringstream ss;
std::streambuf *sb = std::cout.rdbuf(ss.rdbuf());
Interface_Static::SetCVal("write.step.product.name", name.c_str());
writer.Transfer(shape, STEPControl_AsIs);
std::cout.rdbuf(sb);
}