MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / execute

Method execute

src/Mod/TechDraw/App/DrawViewArch.cpp:91–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90
91App::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
139std::string DrawViewArch::getSVGHead()
140{

Callers

nothing calls this directly

Calls 11

overrideKeepUpdatedFunction · 0.85
runStringMethod · 0.80
runStringArgMethod · 0.80
executeFunction · 0.50
getScaleFunction · 0.50
getValueMethod · 0.45
getPropertyByNameMethod · 0.45
errorMethod · 0.45
getNameInDocumentMethod · 0.45
c_strMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected