| 89 | |
| 90 | |
| 91 | App::DocumentObjectExecReturn *DrawViewArch::execute() |
| 92 | { |
| 93 | if (!keepUpdated()) { |
| 94 | return App::DocumentObject::StdReturn; |
| 95 | } |
| 96 | |
| 97 | App::DocumentObject* sourceObj = Source.getValue(); |
| 98 | if (sourceObj) { |
| 99 | //if (sourceObj is not ArchSection) return |
| 100 | App::Property* proxy = sourceObj->getPropertyByName("Proxy"); |
| 101 | if (!proxy) { |
| 102 | Base::Console().error("DVA::execute - %s is not an ArchSection\n", sourceObj->Label.getValue()); |
| 103 | //this is definitely not an ArchSection |
| 104 | return DrawView::execute(); |
| 105 | } |
| 106 | |
| 107 | //std::string svgFrag; |
| 108 | std::string svgHead = getSVGHead(); |
| 109 | std::string svgTail = getSVGTail(); |
| 110 | std::string FeatName = getNameInDocument(); |
| 111 | std::string SourceName = sourceObj->getNameInDocument(); |
| 112 | // ArchSectionPlane.getSVG(section, allOn=False, renderMode="Wireframe", showHidden=False, showFill=False, scale=1, linewidth=1, fontsize=1): |
| 113 | |
| 114 | std::stringstream paramStr; |
| 115 | paramStr << ", allOn=" << (AllOn.getValue() ? "True" : "False") |
| 116 | << ", renderMode=" << RenderMode.getValue() |
| 117 | << ", showHidden=" << (ShowHidden.getValue() ? "True" : "False") |
| 118 | << ", showFill=" << (ShowFill.getValue() ? "True" : "False") |
| 119 | << ", scale=" << getScale() |
| 120 | << ", linewidth=" << LineWidth.getValue() |
| 121 | << ", fontsize=" << FontSize.getValue() |
| 122 | << ", techdraw=True" |
| 123 | << ", rotation=" << Rotation.getValue() |
| 124 | << ", fillSpaces=" << (FillSpaces.getValue() ? "True" : "False") |
| 125 | << ", cutlinewidth=" << CutLineWidth.getValue() |
| 126 | << ", linespacing=" << LineSpacing.getValue() |
| 127 | << ", joinArch=" << (JoinArch.getValue() ? "True" : "False"); |
| 128 | |
| 129 | Base::Interpreter().runString("import ArchSectionPlane"); |
| 130 | Base::Interpreter().runStringArg("svgBody = ArchSectionPlane.getSVG(App.activeDocument().%s %s)", |
| 131 | SourceName.c_str(), paramStr.str().c_str()); |
| 132 | Base::Interpreter().runStringArg("App.activeDocument().%s.Symbol = '%s' + svgBody + '%s'", |
| 133 | FeatName.c_str(), svgHead.c_str(), svgTail.c_str()); |
| 134 | } |
| 135 | overrideKeepUpdated(false); |
| 136 | return DrawView::execute(); |
| 137 | } |
| 138 | |
| 139 | std::string DrawViewArch::getSVGHead() |
| 140 | { |
nothing calls this directly
no test coverage detected