]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_Tools.cpp
Salome HOME
Issue #1309 Management of icons - corrections for PythonAddons plugin, to load icons...
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_Tools.cpp
4 // Created:     11 July 2014
5 // Author:      Vitaly Smetannikov
6
7 #include "ModuleBase_Tools.h"
8
9 #include <ModuleBase_ParamIntSpinBox.h>
10 #include <ModuleBase_ParamSpinBox.h>
11 #include <ModuleBase_WidgetFactory.h>
12 #include <ModuleBase_IWorkshop.h>
13 #include <ModuleBase_IModule.h>
14 #include <ModuleBase_IconFactory.h>
15
16 #include <ModelAPI_Attribute.h>
17 #include <ModelAPI_AttributeRefAttr.h>
18 #include <ModelAPI_AttributeReference.h>
19 #include <ModelAPI_AttributeSelection.h>
20 #include <ModelAPI_AttributeSelectionList.h>
21 #include <ModelAPI_AttributeRefList.h>
22 #include <ModelAPI_AttributeRefAttrList.h>
23 #include <Events_Loop.h>
24
25 #include <ModelAPI_Data.h>
26 #include <ModelAPI_Result.h>
27 #include <ModelAPI_ResultCompSolid.h>
28 #include <ModelAPI_ResultParameter.h>
29 #include <ModelAPI_Tools.h>
30 #include <ModelAPI_Session.h>
31 #include <ModelAPI_Events.h>
32
33 #include <TopoDS_Iterator.hxx>
34
35 #include <GeomDataAPI_Point2D.h>
36 #include <Events_Error.h>
37
38 #include <Config_PropManager.h>
39
40 #include <QWidget>
41 #include <QLayout>
42 #include <QPainter>
43 #include <QBitmap>
44 #include <QDoubleSpinBox>
45 #include <QGraphicsDropShadowEffect>
46 #include <QColor>
47 #include <QApplication>
48
49 #include <sstream>
50 #include <string>
51
52 const double tolerance = 1e-7;
53
54 //#define DEBUG_ACTIVATE_WINDOW
55 //#define DEBUG_SET_FOCUS
56
57 namespace ModuleBase_Tools {
58
59 //******************************************************************
60
61 //******************************************************************
62
63 void adjustMargins(QWidget* theWidget)
64 {
65   if(!theWidget)
66     return;
67   adjustMargins(theWidget->layout());
68 }
69
70 void adjustMargins(QLayout* theLayout)
71 {
72   if(!theLayout)
73     return;
74   theLayout->setContentsMargins(2, 5, 2, 5);
75   theLayout->setSpacing(4);
76 }
77
78 void zeroMargins(QWidget* theWidget)
79 {
80   if(!theWidget)
81     return;
82   zeroMargins(theWidget->layout());
83 }
84
85 void zeroMargins(QLayout* theLayout)
86 {
87   if(!theLayout)
88     return;
89   theLayout->setContentsMargins(0, 0, 0, 0);
90   theLayout->setSpacing(5);
91 }
92
93 void activateWindow(QWidget* theWidget, const QString& theInfo)
94 {
95   theWidget->activateWindow();
96
97 #ifdef DEBUG_ACTIVATE_WINDOW
98   qDebug(QString("activateWindow: %1").arg(theInfo).toStdString().c_str());
99 #endif
100 }
101
102 void setFocus(QWidget* theWidget, const QString& theInfo)
103 {
104   theWidget->setFocus();
105
106 #ifdef DEBUG_SET_FOCUS
107   qDebug(QString("setFocus: %1").arg(theInfo).toStdString().c_str());
108 #endif
109 }
110
111 void setShadowEffect(QWidget* theWidget, const bool isSetEffect)
112 {
113   if (isSetEffect) {
114     QGraphicsDropShadowEffect* aGlowEffect = new QGraphicsDropShadowEffect();
115     aGlowEffect->setOffset(.0);
116     aGlowEffect->setBlurRadius(10.0);
117     aGlowEffect->setColor(QColor(0, 170, 255)); // Light-blue color, #00AAFF
118     theWidget->setGraphicsEffect(aGlowEffect);
119   }
120   else {
121     QGraphicsEffect* anEffect = theWidget->graphicsEffect();
122     if(anEffect)
123     anEffect->deleteLater();
124     theWidget->setGraphicsEffect(NULL);
125   }
126 }
127
128 QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon)
129 {
130   QImage anIcon = ModuleBase_IconFactory::loadImage(theIcon);
131   QImage anAditional(theAdditionalIcon);
132
133   if (anIcon.isNull())
134     return QPixmap();
135
136   int anAddWidth = anAditional.width();
137   int anAddHeight = anAditional.height();
138
139   int aWidth = anIcon.width();
140   int aHeight = anIcon.height();
141
142   int aStartWidthPos = aWidth - anAddWidth - 1;
143   int aStartHeightPos = aHeight - anAddHeight - 1;
144
145   for (int i = 0; i < anAddWidth && i + aStartWidthPos < aWidth; i++)
146   {
147     for (int j = 0; j < anAddHeight && j + aStartHeightPos < aHeight; j++)
148     {
149       if (qAlpha(anAditional.pixel(i, j)) > 0)
150         anIcon.setPixel(i + aStartWidthPos, j + aStartHeightPos, anAditional.pixel(i, j));
151     }
152   }
153   return QPixmap::fromImage(anIcon);
154 }
155
156 QPixmap lighter(const QString& theIcon, const int theLighterValue)
157 {
158   QImage anIcon = ModuleBase_IconFactory::loadImage(theIcon);
159   if (anIcon.isNull())
160     return QPixmap();
161
162   QImage aResult = ModuleBase_IconFactory::loadImage(theIcon);
163   for (int i = 0; i < anIcon.width(); i++)
164   {
165     for (int j = 0; j < anIcon.height(); j++)
166     {
167       QRgb anRgb = anIcon.pixel(i, j);
168       QColor aPixelColor(qRed(anRgb), qGreen(anRgb), qBlue(anRgb),
169                          qAlpha(aResult.pixel(i, j)));
170
171       QColor aLighterColor = aPixelColor.lighter(theLighterValue);
172       aResult.setPixel(i, j, qRgba(aLighterColor.red(), aLighterColor.green(),
173                                     aLighterColor.blue(), aLighterColor.alpha()));
174     }
175   }
176   return QPixmap::fromImage(aResult);
177 }
178
179 void setSpinText(ModuleBase_ParamSpinBox* theSpin, const QString& theText)
180 {
181   if (theSpin->text() == theText) 
182     return;
183   // In order to avoid extra text setting because it will
184   // reset cursor position in control
185   bool isBlocked = theSpin->blockSignals(true);
186   theSpin->setText(theText);
187   theSpin->blockSignals(isBlocked);
188 }
189
190 void setSpinValue(QDoubleSpinBox* theSpin, double theValue)
191 {
192   if (fabs(theSpin->value() - theValue) < tolerance)
193     return;
194   bool isBlocked = theSpin->blockSignals(true);
195   theSpin->setValue(theValue);
196   theSpin->blockSignals(isBlocked);
197 }
198
199 void setSpinValue(ModuleBase_ParamSpinBox* theSpin, double theValue)
200 {
201   if (fabs(theSpin->value() - theValue) < tolerance)
202     return;
203   bool isBlocked = theSpin->blockSignals(true);
204   theSpin->setValue(theValue);
205   theSpin->blockSignals(isBlocked);
206 }
207
208 void setSpinText(ModuleBase_ParamIntSpinBox* theSpin, const QString& theText)
209 {
210   // In order to avoid extra text setting because it will
211   // reset cursor position in control
212   if (theSpin->text() == theText)
213     return;
214   bool isBlocked = theSpin->blockSignals(true);
215   theSpin->setText(theText);
216   theSpin->blockSignals(isBlocked);
217 }
218
219 void setSpinValue(ModuleBase_ParamIntSpinBox* theSpin, int theValue)
220 {
221   if (theSpin->value() == theValue)
222     return;
223   bool isBlocked = theSpin->blockSignals(true);
224   theSpin->setValue(theValue);
225   theSpin->blockSignals(isBlocked);
226 }
227
228 QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo)
229 {
230   QString aFeatureStr = "feature";
231   if (!theObj.get())
232     return aFeatureStr;
233
234   std::ostringstream aPtrStr;
235   aPtrStr << "[" << theObj.get() << "]";
236
237   ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObj);
238   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theObj);
239   if(aRes.get()) {
240     aFeatureStr.append(QString("(result%1)").arg(aPtrStr.str().c_str()).toStdString() .c_str());
241     if (aRes->isDisabled())
242       aFeatureStr.append("[disabled]");
243     if (aRes->isConcealed())
244       aFeatureStr.append("[concealed]");
245     if (ModelAPI_Tools::hasSubResults(aRes))
246       aFeatureStr.append("[hasSubResults]");
247
248     aFeature = ModelAPI_Feature::feature(aRes);
249   }
250   else
251     aFeatureStr.append(aPtrStr.str().c_str());
252
253   if (aFeature.get()) {
254     aFeatureStr.append(QString(": %1").arg(aFeature->getKind().c_str()).toStdString().c_str());
255     if (aFeature->data()->isValid()) {
256       aFeatureStr.append(QString(", name=%1").arg(aFeature->data()->name().c_str()).toStdString()
257                                                                                        .c_str());
258     }
259     if (isUseAttributesInfo) {
260       std::list<AttributePtr> anAttrs = aFeature->data()->attributes("");
261       std::list<AttributePtr>::const_iterator anIt = anAttrs.begin(), aLast = anAttrs.end();
262       QStringList aValues;
263       for(; anIt != aLast; anIt++) {
264         AttributePtr anAttr = *anIt;
265         QString aValue = "not defined";
266         std::string aType = anAttr->attributeType();
267         if (aType == GeomDataAPI_Point2D::typeId()) {
268           std::shared_ptr<GeomDataAPI_Point2D> aPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
269                                                                                          anAttr);
270           if (aPoint.get())
271             aValue = QString("(%1, %2)").arg(aPoint->x()).arg(aPoint->y());
272         }
273         else if (aType == ModelAPI_AttributeRefAttr::typeId()) {
274         }
275
276         aValues.push_back(QString("%1: %2").arg(anAttr->id().c_str()).arg(aValue).toStdString().c_str());
277       }
278       if (!aValues.empty())
279         aFeatureStr.append(QString(", attributes: %1").arg(aValues.join(", ").toStdString().c_str()));
280     }
281   }
282
283   return aFeatureStr;
284 }
285
286 typedef QMap<QString, TopAbs_ShapeEnum> ShapeTypes;
287 static ShapeTypes MyShapeTypes;
288
289 TopAbs_ShapeEnum shapeType(const QString& theType)
290 {
291   if (MyShapeTypes.count() == 0) {
292     MyShapeTypes["face"] = TopAbs_FACE;
293     MyShapeTypes["faces"] = TopAbs_FACE;
294     MyShapeTypes["vertex"] = TopAbs_VERTEX;
295     MyShapeTypes["vertices"] = TopAbs_VERTEX;
296     MyShapeTypes["wire"] = TopAbs_WIRE;
297     MyShapeTypes["edge"] = TopAbs_EDGE;
298     MyShapeTypes["edges"] = TopAbs_EDGE;
299     MyShapeTypes["shell"] = TopAbs_SHELL;
300     MyShapeTypes["solid"] = TopAbs_SOLID;
301     MyShapeTypes["solids"] = TopAbs_SOLID;
302     MyShapeTypes["objects"] = TopAbs_SHAPE;
303   }
304   QString aType = theType.toLower();
305   if (MyShapeTypes.contains(aType))
306     return MyShapeTypes[aType];
307   Events_Error::send("Shape type defined in XML is not implemented!");
308   return TopAbs_SHAPE;
309 }
310
311 void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFeature,
312                   bool& hasParameter, bool& hasCompositeOwner)
313 {
314   hasResult = false;
315   hasFeature = false;
316   hasParameter = false;
317   hasCompositeOwner = false;
318   foreach(ObjectPtr aObj, theObjects) {
319     FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
320     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
321     ResultParameterPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aResult);
322
323     hasResult |= (aResult.get() != NULL);
324     hasFeature |= (aFeature.get() != NULL);
325     hasParameter |= (aConstruction.get() != NULL);
326     if (hasFeature) 
327       hasCompositeOwner |= (ModelAPI_Tools::compositeOwner(aFeature) != NULL);
328     if (hasFeature && hasResult  && hasParameter && hasCompositeOwner)
329       break;
330   }
331 }
332
333 void setDefaultDeviationCoefficient(const TopoDS_Shape& theShape,
334                                     const Handle(Prs3d_Drawer)& theDrawer)
335 {
336   if (theShape.IsNull())
337     return;
338   TopAbs_ShapeEnum aType = theShape.ShapeType();
339   if ((aType == TopAbs_EDGE) || (aType == TopAbs_WIRE)) 
340     theDrawer->SetDeviationCoefficient(1.e-4);
341 }
342
343 Quantity_Color color(const std::string& theSection,
344                      const std::string& theName,
345                      const std::string& theDefault)
346 {
347   std::vector<int> aColor = Config_PropManager::color(theSection, theName, theDefault);
348   return Quantity_Color(aColor[0] / 255., aColor[1] / 255., aColor[2] / 255., Quantity_TOC_RGB);
349 }
350
351 ObjectPtr getObject(const AttributePtr& theAttribute)
352 {
353   ObjectPtr anObject;
354   std::string anAttrType = theAttribute->attributeType();
355   if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) {
356     AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
357     if (anAttr != NULL && anAttr->isObject())
358       anObject = anAttr->object();
359   }
360   if (anAttrType == ModelAPI_AttributeSelection::typeId()) {
361     AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
362     if (anAttr != NULL)
363       anObject = anAttr->context();
364   }
365   if (anAttrType == ModelAPI_AttributeReference::typeId()) {
366     AttributeReferencePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
367     if (anAttr.get() != NULL)
368       anObject = anAttr->value();
369   }
370   return anObject;
371 }
372
373 TopAbs_ShapeEnum getCompoundSubType(const TopoDS_Shape& theShape)
374 {
375   TopAbs_ShapeEnum aShapeType = theShape.ShapeType();
376
377   // for compounds check sub-shapes: it may be compound of needed type:
378   // Booleans may produce compounds of Solids
379   if (aShapeType == TopAbs_COMPOUND) {
380     for(TopoDS_Iterator aSubs(theShape); aSubs.More(); aSubs.Next()) {
381       if (!aSubs.Value().IsNull()) {
382         TopAbs_ShapeEnum aSubType = aSubs.Value().ShapeType();
383         if (aSubType == TopAbs_COMPOUND) { // compound of compound(s)
384           aShapeType = TopAbs_COMPOUND;
385           break;
386         }
387         if (aShapeType == TopAbs_COMPOUND) {
388           aShapeType = aSubType;
389         } else if (aShapeType != aSubType) { // compound of shapes of different types
390           aShapeType = TopAbs_COMPOUND;
391           break;
392         }
393       }
394     }
395   }
396   return aShapeType;
397 }
398
399 void getParameters(QStringList& theParameters)
400 {
401   theParameters.clear();
402
403   SessionPtr aSession = ModelAPI_Session::get();
404   std::list<DocumentPtr> aDocList;
405   DocumentPtr anActiveDocument = aSession->activeDocument();
406   DocumentPtr aRootDocument = aSession->moduleDocument();
407   aDocList.push_back(anActiveDocument);
408   if (anActiveDocument != aRootDocument) {
409     aDocList.push_back(aRootDocument);
410   }
411   std::string aGroupId = ModelAPI_ResultParameter::group();
412   for(std::list<DocumentPtr>::const_iterator it = aDocList.begin(); it != aDocList.end(); ++it) {
413     DocumentPtr aDocument = *it;
414     int aSize = aDocument->size(aGroupId);
415     for (int i = 0; i < aSize; i++) {
416       ObjectPtr anObject = aDocument->object(aGroupId, i);
417       std::string aParameterName = anObject->data()->name();
418       theParameters.append(aParameterName.c_str());
419     }
420   }
421 }
422
423 std::string findGreedAttribute(ModuleBase_IWorkshop* theWorkshop, const FeaturePtr& theFeature)
424 {
425   std::string anAttributeId;
426
427   std::string aXmlCfg, aDescription;
428   theWorkshop->module()->getXMLRepresentation(theFeature->getKind(), aXmlCfg, aDescription);
429
430   ModuleBase_WidgetFactory aFactory(aXmlCfg, theWorkshop);
431   std::string anAttributeTitle;
432   aFactory.getGreedAttribute(anAttributeId);
433
434   return anAttributeId;
435 }
436
437 void setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject,
438                const GeomShapePtr& theShape, ModuleBase_IWorkshop* theWorkshop,
439                const bool theTemporarily)
440 {
441   if (!theAttribute.get())
442     return;
443
444   std::string aType = theAttribute->attributeType();
445   if (aType == ModelAPI_AttributeReference::typeId()) {
446     AttributeReferencePtr aRef = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
447     ObjectPtr aObject = aRef->value();
448     if (!(aObject && aObject->isSame(theObject))) {
449       aRef->setValue(theObject);
450     }
451   } else if (aType == ModelAPI_AttributeRefAttr::typeId()) {
452     AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
453
454     AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape);
455     if (anAttribute.get())
456       aRefAttr->setAttr(anAttribute);
457     else {
458       ObjectPtr aObject = aRefAttr->object();
459       if (!(aObject && aObject->isSame(theObject))) {
460         aRefAttr->setObject(theObject);
461       }
462     }
463   } else if (aType == ModelAPI_AttributeSelection::typeId()) {
464     AttributeSelectionPtr aSelectAttr =
465                              std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
466     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
467     if (aSelectAttr.get() != NULL) {
468       aSelectAttr->setValue(aResult, theShape, theTemporarily);
469     }
470   }
471   if (aType == ModelAPI_AttributeSelectionList::typeId()) {
472     AttributeSelectionListPtr aSelectionListAttr =
473                          std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
474     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
475     if (!aSelectionListAttr->isInList(aResult, theShape, theTemporarily))
476       aSelectionListAttr->append(aResult, theShape, theTemporarily);
477   }
478   else if (aType == ModelAPI_AttributeRefList::typeId()) {
479     AttributeRefListPtr aRefListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(theAttribute);
480     if (!aRefListAttr->isInList(theObject))
481       aRefListAttr->append(theObject);
482   }
483   else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
484     AttributeRefAttrListPtr aRefAttrListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttrList>(theAttribute);
485     AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape);
486
487     if (anAttribute.get()) {
488       if (!aRefAttrListAttr->isInList(anAttribute))
489         aRefAttrListAttr->append(anAttribute);
490     }
491     else {
492       if (!aRefAttrListAttr->isInList(theObject))
493         aRefAttrListAttr->append(theObject);
494     }
495   }
496 }
497
498 GeomShapePtr getShape(const AttributePtr& theAttribute, ModuleBase_IWorkshop* theWorkshop)
499 {
500   GeomShapePtr aShape;
501   if (!theAttribute.get())
502     return aShape;
503
504   std::string aType = theAttribute->attributeType();
505   if (aType == ModelAPI_AttributeReference::typeId()) {
506   } else if (aType == ModelAPI_AttributeRefAttr::typeId()) {
507     AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
508     if (aRefAttr.get() && !aRefAttr->isObject()) {
509       AttributePtr anAttribute = aRefAttr->attr();
510       aShape = theWorkshop->module()->findShape(anAttribute);
511     }
512   } else if (aType == ModelAPI_AttributeSelection::typeId()) {
513     AttributeSelectionPtr aSelectAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
514                                                                                  (theAttribute);
515     aShape = aSelectAttr->value();
516   }
517   return aShape;
518 }
519
520 void flushUpdated(ObjectPtr theObject)
521 {
522   blockUpdateViewer(true);
523
524   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
525
526   blockUpdateViewer(false);
527 }
528
529 void blockUpdateViewer(const bool theValue)
530 {
531   // the viewer update should be blocked in order to avoid the temporary feature content
532   // when the solver processes the feature, the redisplay message can be flushed
533   // what caused the display in the viewer preliminary states of object
534   // e.g. fillet feature, angle value change
535   std::shared_ptr<Events_Message> aMsg;
536   if (theValue) {
537     aMsg = std::shared_ptr<Events_Message>(
538         new Events_Message(Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED)));
539   }
540   else {
541     // the viewer update should be unblocked
542     aMsg = std::shared_ptr<Events_Message>(
543         new Events_Message(Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED)));
544   }
545   Events_Loop::loop()->send(aMsg);
546 }
547
548 QString wrapTextByWords(const QString& theValue, QWidget* theWidget,
549                                           int theMaxLineInPixels)
550 {
551   static QFontMetrics tfm(theWidget ? theWidget->font() : QApplication::font());
552   static qreal phi = 2.618;
553
554   QRect aBounds = tfm.boundingRect(theValue);
555   if(aBounds.width() <= theMaxLineInPixels)
556     return theValue;
557
558   qreal s = aBounds.width() * aBounds.height();
559   qreal aGoldWidth = sqrt(s*phi);
560
561   QStringList aWords = theValue.split(" ", QString::SkipEmptyParts);
562   QStringList aLines;
563   int n = aWords.count();
564   QString aLine;
565   for (int i = 0; i < n; i++) {
566     QString aLineExt = aLine + " " + aWords[i];
567     qreal anWidthNonExt = tfm.boundingRect(aLine).width();
568     qreal anWidthExt = tfm.boundingRect(aLineExt).width();
569     qreal aDeltaNonExt = fabs(anWidthNonExt-aGoldWidth);
570     qreal aDeltaExt    = fabs(anWidthExt-aGoldWidth);
571     if(aDeltaNonExt < aDeltaExt) {
572       // new line
573       aLines.append(aLine);
574       aLine = aWords[i];
575     }
576     else
577       aLine = aLineExt;
578   }
579
580   if(!aLine.isEmpty())
581     aLines.append(aLine);
582
583   QString aResult = aLines.join("\n");
584   return aResult;
585 }
586
587 } // namespace ModuleBase_Tools
588
589