mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 02:21:02 +00:00
optional building storey argument added to setSectionHeight()
This commit is contained in:
@@ -282,7 +282,7 @@ SvgSerializer::path_object& SvgSerializer::start_path(IfcSchema::IfcBuildingStor
|
|||||||
|
|
||||||
void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* o)
|
void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* o)
|
||||||
{
|
{
|
||||||
IfcSchema::IfcBuildingStorey* storey = 0;
|
IfcSchema::IfcBuildingStorey* storey = storey_;
|
||||||
boost::optional<double> storey_elevation = boost::none;
|
boost::optional<double> storey_elevation = boost::none;
|
||||||
IfcSchema::IfcObjectDefinition* obdef = static_cast<IfcSchema::IfcObjectDefinition*>(file->entityById(o->id()));
|
IfcSchema::IfcObjectDefinition* obdef = static_cast<IfcSchema::IfcObjectDefinition*>(file->entityById(o->id()));
|
||||||
|
|
||||||
@@ -292,7 +292,7 @@ void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* o)
|
|||||||
typedef IfcSchema::IfcRelAggregates decomposition_element;
|
typedef IfcSchema::IfcRelAggregates decomposition_element;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (;;) {
|
for (; storey == 0;) {
|
||||||
// Iterate over the decomposing element to find the parent IfcBuildingStorey
|
// Iterate over the decomposing element to find the parent IfcBuildingStorey
|
||||||
decomposition_element::list::ptr decomposes = obdef->Decomposes();
|
decomposition_element::list::ptr decomposes = obdef->Decomposes();
|
||||||
if (!decomposes->size()) {
|
if (!decomposes->size()) {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ protected:
|
|||||||
std::vector< boost::shared_ptr<util::string_buffer::float_item> > ycoords;
|
std::vector< boost::shared_ptr<util::string_buffer::float_item> > ycoords;
|
||||||
std::vector< boost::shared_ptr<util::string_buffer::float_item> > radii;
|
std::vector< boost::shared_ptr<util::string_buffer::float_item> > radii;
|
||||||
IfcParse::IfcFile* file;
|
IfcParse::IfcFile* file;
|
||||||
|
IfcSchema::IfcBuildingStorey* storey_;
|
||||||
public:
|
public:
|
||||||
SvgSerializer(const std::string& out_filename, const SerializerSettings& settings)
|
SvgSerializer(const std::string& out_filename, const SerializerSettings& settings)
|
||||||
: GeometrySerializer(settings)
|
: GeometrySerializer(settings)
|
||||||
@@ -52,6 +53,7 @@ public:
|
|||||||
, ymax(-std::numeric_limits<double>::infinity())
|
, ymax(-std::numeric_limits<double>::infinity())
|
||||||
, rescale(false)
|
, rescale(false)
|
||||||
, file(0)
|
, file(0)
|
||||||
|
, storey_(0)
|
||||||
{}
|
{}
|
||||||
void addXCoordinate(const boost::shared_ptr<util::string_buffer::float_item>& fi) { xcoords.push_back(fi); }
|
void addXCoordinate(const boost::shared_ptr<util::string_buffer::float_item>& fi) { xcoords.push_back(fi); }
|
||||||
void addYCoordinate(const boost::shared_ptr<util::string_buffer::float_item>& fi) { ycoords.push_back(fi); }
|
void addYCoordinate(const boost::shared_ptr<util::string_buffer::float_item>& fi) { ycoords.push_back(fi); }
|
||||||
@@ -68,7 +70,7 @@ public:
|
|||||||
void setUnitNameAndMagnitude(const std::string& /*name*/, float /*magnitude*/) {}
|
void setUnitNameAndMagnitude(const std::string& /*name*/, float /*magnitude*/) {}
|
||||||
void setFile(IfcParse::IfcFile* f);
|
void setFile(IfcParse::IfcFile* f);
|
||||||
void setBoundingRectangle(double width, double height);
|
void setBoundingRectangle(double width, double height);
|
||||||
void setSectionHeight(double h) { section_height = h; }
|
void setSectionHeight(double h, IfcSchema::IfcBuildingStorey* storey = 0) { section_height = h; storey_ = storey; }
|
||||||
std::string nameElement(const IfcGeom::Element<real_t>* elem);
|
std::string nameElement(const IfcGeom::Element<real_t>* elem);
|
||||||
std::string nameElement(const IfcSchema::IfcProduct* elem);
|
std::string nameElement(const IfcSchema::IfcProduct* elem);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user