mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 20:22:09 +00:00
Store drawing location in SVG
This commit is contained in:
@@ -107,6 +107,11 @@ struct geometry_data {
|
||||
std::string ifc_name, svg_name;
|
||||
};
|
||||
|
||||
struct drawing_meta {
|
||||
gp_Pln pln_3d;
|
||||
std::array<std::array<double, 3>, 3> matrix_3;
|
||||
};
|
||||
|
||||
class SvgSerializer : public GeometrySerializer {
|
||||
public:
|
||||
typedef std::pair<std::string, std::vector<util::string_buffer> > path_object;
|
||||
@@ -126,6 +131,7 @@ protected:
|
||||
IfcParse::IfcFile* file;
|
||||
IfcUtil::IfcBaseEntity* storey_;
|
||||
std::multimap<drawing_key, path_object, storey_sorter> paths;
|
||||
std::map<drawing_key, drawing_meta> drawing_metadata;
|
||||
|
||||
float_item_list xcoords, ycoords, radii;
|
||||
size_t xcoords_begin, ycoords_begin, radii_begin;
|
||||
@@ -171,8 +177,8 @@ public:
|
||||
void write(const IfcGeom::BRepElement<real_t>* o);
|
||||
void write(path_object& p, const TopoDS_Wire& wire);
|
||||
void write(const geometry_data& data);
|
||||
path_object& start_path(IfcUtil::IfcBaseEntity* storey, const std::string& id);
|
||||
path_object& start_path(const std::string& drawing_name, const std::string& id);
|
||||
path_object& start_path(const gp_Pln& p, IfcUtil::IfcBaseEntity* storey, const std::string& id);
|
||||
path_object& start_path(const gp_Pln& p, const std::string& drawing_name, const std::string& id);
|
||||
bool isTesselated() const { return false; }
|
||||
void finalize();
|
||||
void setUnitNameAndMagnitude(const std::string& /*name*/, float /*magnitude*/) {}
|
||||
@@ -184,7 +190,7 @@ public:
|
||||
void setPrintSpaceAreas(bool b) { print_space_areas_ = b; }
|
||||
void setDrawDoorArcs(bool b) { draw_door_arcs_ = b; }
|
||||
|
||||
void resize();
|
||||
std::array<std::array<double, 3>, 3> resize();
|
||||
void resetScale();
|
||||
|
||||
void setSectionRef(const boost::optional<std::string>& s) {
|
||||
@@ -221,6 +227,9 @@ public:
|
||||
return GeometrySerializer::object_id(o);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
std::string writeMetadata(const drawing_meta& m);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user