mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 01:11:40 +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"
|
||||
" <polygon points=\"10 0, 0 3.5, 10 7\" />\n"
|
||||
" </marker>\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_) {
|
||||
// previously:
|
||||
// (pt) (px) (in) (mm)
|
||||
// approx 12 / 0.75 / 96 * 25.4
|
||||
" </defs>\n";
|
||||
|
||||
if (!no_css_) {
|
||||
svg_file <<
|
||||
" <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_) {
|
||||
// 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 <<
|
||||
" text {\n"
|
||||
" font-size: 2;\n" // (reduced to two).
|
||||
" }\n"
|
||||
" path {\n"
|
||||
" stroke-width: 0.3;\n"
|
||||
" }\n";
|
||||
" ]]>\n"
|
||||
" </style>\n";
|
||||
}
|
||||
|
||||
svg_file <<
|
||||
" ]]>\n"
|
||||
" </style>\n";
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -157,6 +157,7 @@ protected:
|
||||
bool auto_section_, auto_elevation_;
|
||||
bool use_namespace_, use_hlr_poly_, always_project_, polygonal_;
|
||||
bool emit_building_storeys_;
|
||||
bool no_css_;
|
||||
|
||||
IfcParse::IfcFile* file;
|
||||
IfcUtil::IfcBaseEntity* storey_;
|
||||
@@ -201,6 +202,7 @@ public:
|
||||
, always_project_(false)
|
||||
, polygonal_(false)
|
||||
, emit_building_storeys_(true)
|
||||
, no_css_(false)
|
||||
, file(0)
|
||||
, storey_(0)
|
||||
, xcoords_begin(0)
|
||||
@@ -282,6 +284,10 @@ public:
|
||||
emit_building_storeys_ = !b;
|
||||
}
|
||||
|
||||
void setNoCSS(bool b) {
|
||||
no_css_ = b;
|
||||
}
|
||||
|
||||
void setScale(double s) { scale_ = s; }
|
||||
void setDrawingCenter(double x, double y) {
|
||||
center_x_ = x; center_y_ = y;
|
||||
|
||||
Reference in New Issue
Block a user