mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
setNoCSS()
This commit is contained in:
@@ -2005,45 +2005,49 @@ void SvgSerializer::doWriteHeader() {
|
|||||||
" <marker id=\"arrowstart\" markerWidth=\"10\" markerHeight=\"7\" refX=\"0\" refY=\"3.5\" orient=\"auto\">\n"
|
" <marker id=\"arrowstart\" markerWidth=\"10\" markerHeight=\"7\" refX=\"0\" refY=\"3.5\" orient=\"auto\">\n"
|
||||||
" <polygon points=\"10 0, 0 3.5, 10 7\" />\n"
|
" <polygon points=\"10 0, 0 3.5, 10 7\" />\n"
|
||||||
" </marker>\n"
|
" </marker>\n"
|
||||||
" </defs>\n"
|
" </defs>\n";
|
||||||
" <style type=\"text/css\" >\n"
|
|
||||||
" <![CDATA[\n"
|
|
||||||
" path {\n"
|
|
||||||
" stroke: #222222;\n"
|
|
||||||
" fill: #444444;\n"
|
|
||||||
" }\n"
|
|
||||||
" .IfcDoor path,\n"
|
|
||||||
" .Symbol path {\n"
|
|
||||||
" fill: none;\n"
|
|
||||||
" }\n"
|
|
||||||
" .Symbol path {\n"
|
|
||||||
" stroke-width: 0.5px;\n"
|
|
||||||
" }\n"
|
|
||||||
" .IfcSpace path {\n"
|
|
||||||
" fill-opacity: .2;\n"
|
|
||||||
" }\n"
|
|
||||||
" .Dimension path {\n"
|
|
||||||
" marker-end: url(#arrowend);\n"
|
|
||||||
" marker-start: url(#arrowstart);\n"
|
|
||||||
" }\n";
|
|
||||||
|
|
||||||
if (scale_) {
|
if (!no_css_) {
|
||||||
// previously:
|
svg_file <<
|
||||||
// (pt) (px) (in) (mm)
|
" <style type=\"text/css\" >\n"
|
||||||
// approx 12 / 0.75 / 96 * 25.4
|
" <![CDATA[\n"
|
||||||
|
" path {\n"
|
||||||
|
" stroke: #222222;\n"
|
||||||
|
" fill: #444444;\n"
|
||||||
|
" }\n"
|
||||||
|
" .IfcDoor path,\n"
|
||||||
|
" .Symbol path {\n"
|
||||||
|
" fill: none;\n"
|
||||||
|
" }\n"
|
||||||
|
" .Symbol path {\n"
|
||||||
|
" stroke-width: 0.5px;\n"
|
||||||
|
" }\n"
|
||||||
|
" .IfcSpace path {\n"
|
||||||
|
" fill-opacity: .2;\n"
|
||||||
|
" }\n"
|
||||||
|
" .Dimension path {\n"
|
||||||
|
" marker-end: url(#arrowend);\n"
|
||||||
|
" marker-start: url(#arrowstart);\n"
|
||||||
|
" }\n";
|
||||||
|
|
||||||
|
if (scale_) {
|
||||||
|
// previously:
|
||||||
|
// (pt) (px) (in) (mm)
|
||||||
|
// approx 12 / 0.75 / 96 * 25.4
|
||||||
|
|
||||||
|
svg_file <<
|
||||||
|
" text {\n"
|
||||||
|
" font-size: 2;\n" // (reduced to two).
|
||||||
|
" }\n"
|
||||||
|
" path {\n"
|
||||||
|
" stroke-width: 0.3;\n"
|
||||||
|
" }\n";
|
||||||
|
}
|
||||||
|
|
||||||
svg_file <<
|
svg_file <<
|
||||||
" text {\n"
|
" ]]>\n"
|
||||||
" font-size: 2;\n" // (reduced to two).
|
" </style>\n";
|
||||||
" }\n"
|
|
||||||
" path {\n"
|
|
||||||
" stroke-width: 0.3;\n"
|
|
||||||
" }\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
svg_file <<
|
|
||||||
" ]]>\n"
|
|
||||||
" </style>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ protected:
|
|||||||
bool auto_section_, auto_elevation_;
|
bool auto_section_, auto_elevation_;
|
||||||
bool use_namespace_, use_hlr_poly_, always_project_, polygonal_;
|
bool use_namespace_, use_hlr_poly_, always_project_, polygonal_;
|
||||||
bool emit_building_storeys_;
|
bool emit_building_storeys_;
|
||||||
|
bool no_css_;
|
||||||
|
|
||||||
IfcParse::IfcFile* file;
|
IfcParse::IfcFile* file;
|
||||||
IfcUtil::IfcBaseEntity* storey_;
|
IfcUtil::IfcBaseEntity* storey_;
|
||||||
@@ -201,6 +202,7 @@ public:
|
|||||||
, always_project_(false)
|
, always_project_(false)
|
||||||
, polygonal_(false)
|
, polygonal_(false)
|
||||||
, emit_building_storeys_(true)
|
, emit_building_storeys_(true)
|
||||||
|
, no_css_(false)
|
||||||
, file(0)
|
, file(0)
|
||||||
, storey_(0)
|
, storey_(0)
|
||||||
, xcoords_begin(0)
|
, xcoords_begin(0)
|
||||||
@@ -282,6 +284,10 @@ public:
|
|||||||
emit_building_storeys_ = !b;
|
emit_building_storeys_ = !b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setNoCSS(bool b) {
|
||||||
|
no_css_ = b;
|
||||||
|
}
|
||||||
|
|
||||||
void setScale(double s) { scale_ = s; }
|
void setScale(double s) { scale_ = s; }
|
||||||
void setDrawingCenter(double x, double y) {
|
void setDrawingCenter(double x, double y) {
|
||||||
center_x_ = x; center_y_ = y;
|
center_x_ = x; center_y_ = y;
|
||||||
|
|||||||
Reference in New Issue
Block a user