mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Product names in STP export thanks to luuk https://sourceforge.net/p/ifcopenshell/discussion/1782717/thread/55558229/?limit=25#a843
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user