1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2013-2021 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
26 from MGCleanerPlugDialog_ui import Ui_MGCleanerPlugDialog
27 from MGCleanerMonViewText import MGCleanerMonViewText
28 from qtsalome import *
32 class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
36 QWidget.__init__(self)
38 self.connecterSignaux()
44 self.__selectedMesh=None
46 # complex with QResources: not used
47 # The icon are supposed to be located in the $SMESH_ROOT_DIR/share/salome/resources/smesh folder,
48 # other solution could be in the same folder than this python module file:
49 # iconfolder=os.path.dirname(os.path.abspath(__file__))
51 self.iconfolder=os.environ["SMESH_ROOT_DIR"]+"/share/salome/resources/smesh"
52 #print "MGCleanerMonPlugDialog iconfolder",iconfolder
54 icon.addFile(os.path.join(self.iconfolder,"select1.png"))
55 self.PB_LoadHyp.setIcon(icon)
56 self.PB_LoadHyp.setToolTip("hypothesis from Salome Object Browser")
57 self.PB_SaveHyp.setIcon(icon)
58 self.PB_SaveHyp.setToolTip("hypothesis to Salome Object Browser")
59 self.PB_MeshSmesh.setIcon(icon)
60 self.PB_MeshSmesh.setToolTip("source mesh from Salome Object Browser")
62 icon.addFile(os.path.join(self.iconfolder,"open.png"))
63 self.PB_ParamsFileExplorer.setIcon(icon)
64 self.PB_Load.setIcon(icon)
65 self.PB_Load.setToolTip("hypothesis from file")
66 self.PB_Save.setIcon(icon)
67 self.PB_Save.setToolTip("hypothesis to file")
68 self.PB_MeshFile.setIcon(icon)
69 self.PB_MeshFile.setToolTip("source mesh from a file in disk")
71 #Ces parametres ne sont pas remis a rien par le clean
72 self.paramsFile= os.path.abspath(os.path.join(os.path.expanduser("~"),".MGCleaner.dat"))
73 self.LE_ParamsFile.setText(self.paramsFile)
74 self.LE_MeshFile.setText("")
75 self.LE_MeshSmesh.setText("")
77 v1=QDoubleValidator(self)
81 self.SP_MinHoleSize.setValidator(v1)
82 self.SP_MinHoleSize.titleForWarning="MinHoleSize"
84 v2=QDoubleValidator(self)
88 self.SP_ToleranceDisplacement.setValidator(v2)
89 self.SP_ToleranceDisplacement.titleForWarning="ToleranceDisplacement"
91 v3=QDoubleValidator(self)
95 self.SP_ResolutionLength.setValidator(v3)
96 self.SP_ResolutionLength.titleForWarning="ResolutionLength"
98 v4=QDoubleValidator(self)
102 self.SP_OverlapDistance.setValidator(v4)
103 self.SP_OverlapDistance.titleForWarning="OverlapDistance"
105 self.resize(800, 500)
108 def connecterSignaux(self) :
109 self.PB_Cancel.clicked.connect(self.PBCancelPressed)
110 self.PB_Default.clicked.connect(self.clean)
111 self.PB_Help.clicked.connect(self.PBHelpPressed)
112 self.PB_OK.clicked.connect(self.PBOKPressed)
114 self.PB_Load.clicked.connect(self.PBLoadPressed)
115 self.PB_Save.clicked.connect(self.PBSavePressed)
116 self.PB_LoadHyp.clicked.connect(self.PBLoadHypPressed)
117 self.PB_SaveHyp.clicked.connect(self.PBSaveHypPressed)
119 self.PB_MeshFile.clicked.connect(self.PBMeshFilePressed)
120 self.PB_MeshSmesh.clicked.connect(self.PBMeshSmeshPressed)
121 self.LE_MeshSmesh.returnPressed.connect(self.meshSmeshNameChanged)
122 self.PB_ParamsFileExplorer.clicked.connect(self.setParamsFileName)
123 self.LE_MeshFile.returnPressed.connect(self.meshFileNameChanged)
124 self.LE_ParamsFile.returnPressed.connect(self.paramsFileNameChanged)
126 #QtCore.QObject.connect(self.checkBox, QtCore.SIGNAL("stateChanged(int)"), self.change)
127 self.CB_FillHoles.stateChanged[int].connect(self.SP_MinHoleSize.setEnabled)
128 self.CB_ComputedToleranceDisplacement.stateChanged[int].connect(self.SP_ToleranceDisplacement.setDisabled)
129 self.CB_ComputedResolutionLength.stateChanged[int].connect(self.SP_ResolutionLength.setDisabled)
130 self.CB_ComputedOverlapDistance.stateChanged[int].connect(self.SP_OverlapDistance.setDisabled)
132 def PBHelpPressed(self):
134 sgPyQt = SalomePyQt.SalomePyQt()
136 mydir=os.environ["SMESH_ROOT_DIR"]
138 QMessageBox.warning(self, "Help", "Help unavailable $SMESH_ROOT_DIR not found")
141 maDoc=mydir+"/share/doc/salome/gui/SMESH/MGCleaner/index.html"
142 sgPyQt.helpContext(maDoc,"")
144 #maDoc=mydir+"/share/doc/salome/gui/SMESH/MGCleaner/_downloads/mg-cleaner_user_manual.pdf"
145 #command="xdg-open "+maDoc+";"
146 #subprocess.call(command, shell=True)
148 def PBOKPressed(self):
149 if not(self.PrepareLigneCommande()):
151 #QMessageBox.warning(self, "Compute", "Command not found")
153 maFenetre=MGCleanerMonViewText(self, self.commande)
155 def enregistreResultat(self):
158 from salome.kernel import studyedit
159 from salome.smesh import smeshBuilder
160 smesh = smeshBuilder.New()
162 if not os.path.isfile(self.fichierOut):
163 QMessageBox.warning(self, "Compute", "Result file "+self.fichierOut+" not found")
165 maStudy=salome.myStudy
166 (outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
167 name=str(self.LE_MeshSmesh.text())
169 initialMeshObject=None
171 a=str(self.fichierIn)
172 name=os.path.basename(os.path.splitext(a)[0])
175 initialMeshObject=maStudy.FindObjectByName(name ,"SMESH")[0]
177 meshname = name+"_MGC_"+str(self.num)
178 smesh.SetName(outputMesh.GetMesh(), meshname)
179 outputMesh.Compute() #no algorithms message for "Mesh_x" has been computed with warnings: - global 1D algorithm is missing
181 self.editor = studyedit.getStudyEditor()
182 moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
183 HypReMeshEntry = self.editor.findOrCreateItem(
184 moduleEntry, name = "Plugins Hypotheses", icon="mesh_tree_hypo.png") #, comment = "HypoForRemeshing" )
186 monStudyBuilder=maStudy.NewBuilder()
187 monStudyBuilder.NewCommand()
188 newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
189 self.editor.setAttributeValue(newStudyIter, "AttributeName", "MGCleaner Parameters_"+str(self.num))
190 self.editor.setAttributeValue(newStudyIter, "AttributeComment", self.getResumeData(separator=" ; "))
192 SOMesh=maStudy.FindObjectByName(meshname ,"SMESH")[0]
194 if initialMeshFile!=None:
195 newStudyFileName=monStudyBuilder.NewObject(SOMesh)
196 self.editor.setAttributeValue(newStudyFileName, "AttributeName", "meshFile")
197 self.editor.setAttributeValue(newStudyFileName, "AttributeExternalFileDef", initialMeshFile)
198 self.editor.setAttributeValue(newStudyFileName, "AttributeComment", initialMeshFile)
200 if initialMeshObject!=None:
201 newLink=monStudyBuilder.NewObject(SOMesh)
202 monStudyBuilder.Addreference(newLink, initialMeshObject)
204 newLink=monStudyBuilder.NewObject(SOMesh)
205 monStudyBuilder.Addreference(newLink, newStudyIter)
207 if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
211 def PBSavePressed(self):
212 from datetime import datetime
213 if not(self.PrepareLigneCommande()): return
214 text = "# MGCleaner hypothesis parameters\n"
215 text += "# Params for mesh : " + self.LE_MeshSmesh.text() +"\n"
216 text += datetime.now().strftime("# Date : %d/%m/%y %H:%M:%S\n")
217 text += "# Command : "+self.commande+"\n"
218 text += self.getResumeData(separator="\n")
222 f=open(self.paramsFile,"a")
224 QMessageBox.warning(self, "File", "Unable to open "+self.paramsFile)
229 QMessageBox.warning(self, "File", "Unable to write "+self.paramsFile)
233 def PBSaveHypPressed_risky(self):
235 save hypothesis in Object Browser outside GEOM ou MESH
236 WARNING: at root of Object Browser is not politically correct
240 if verbose: print("save hypothesis in Object Browser")
243 #how ??? icon = "mesh_tree_hypo.png"
244 namei = "MGCleaner Parameters_%i" % self.num
245 datai = self.getResumeData(separator=" ; ")
247 myStudy = salome.myStudy
248 myBuilder = myStudy.NewBuilder()
249 #myStudy.IsStudyLocked()
250 myComponent = myStudy.FindComponent(name)
251 if myComponent == None:
252 print("myComponent not found, create")
253 myComponent = myBuilder.NewComponent(name)
254 AName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
256 ACmt = myBuilder.FindOrCreateAttribute(myComponent, "AttributeComment")
259 myObject = myBuilder.NewObject(myComponent)
260 AName = myBuilder.FindOrCreateAttribute(myObject, "AttributeName")
261 AName.SetValue(namei)
262 ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
265 if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
267 if verbose: print(("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai)))
270 def PBSaveHypPressed(self):
272 save hypothesis in Object Browser
273 bug: affichage ne marche pas si inclusion dans dans GEOM ou MESH depuis salome 730
277 from salome.kernel import studyedit
278 from salome.smesh import smeshBuilder
279 #[PAL issue tracker:issue1871] Les nouveaux objets ne s'affichent pas dans SMESH
280 QMessageBox.warning(self, "Save", "waiting for fix: Object Browser will not display hypothesis")
282 if verbose: print("save hypothesis in Object Browser")
283 smesh = smeshBuilder.New()
285 maStudy=salome.myStudy
287 self.editor = studyedit.getStudyEditor()
288 moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
289 HypReMeshEntry = self.editor.findOrCreateItem(
290 moduleEntry, name = "Plugins Hypotheses", icon="mesh_tree_hypo.png")
291 #, comment = "HypothesisForRemeshing" )
293 monStudyBuilder=maStudy.NewBuilder()
294 monStudyBuilder.NewCommand()
295 newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
296 name = "MGCleaner Parameters_%i" % self.num
297 self.editor.setAttributeValue(newStudyIter, "AttributeName", name)
298 data = self.getResumeData(separator=" ; ")
299 self.editor.setAttributeValue(newStudyIter, "AttributeComment", data)
302 # example storing in notebook
303 import salome_notebook
304 notebook = salome_notebook.notebook
305 notebook.set("MGCleaner_%i" % self.num, data)
308 if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
310 if verbose: print(("save %s in Object Browser done:\n%s" % (name, data)))
313 def SP_toStr(self, widget):
314 """only for a QLineEdit widget"""
315 #cr, pos=widget.validator().validate(res, 0) #n.b. "1,3" is acceptable !locale!
317 val=float(widget.text())
319 QMessageBox.warning(self, widget.titleForWarning, "float value is incorrect: '"+widget.text()+"'")
320 res=str(widget.validator().bottom())
321 widget.setProperty("text", res)
323 valtest=widget.validator().bottom()
326 QMessageBox.warning(self, widget.titleForWarning, "float value is under minimum: "+str(val)+" < "+str(valtest))
328 widget.setProperty("text", res)
330 valtest=widget.validator().top()
333 QMessageBox.warning(self, widget.titleForWarning, "float value is over maximum: "+str(val)+" > "+str(valtest))
335 widget.setProperty("text", res)
339 def getResumeData(self, separator="\n"):
341 if self.RB_Fix1.isChecked():
342 CheckOrFix="mode_fix"
344 CheckOrFix="mode_check"
345 text+="CheckOrFix="+CheckOrFix+separator
346 text+="PreserveTopology="+str(self.CB_PreserveTopology.isChecked())+separator
347 text+="FillHoles="+str(self.CB_FillHoles.isChecked())+separator
348 v=self.SP_toStr(self.SP_MinHoleSize)
349 text+="MinHoleSize="+v+separator
350 text+="ComputedToleranceDisplacement="+str(self.CB_ComputedToleranceDisplacement.isChecked())+separator
351 v=self.SP_toStr(self.SP_ToleranceDisplacement)
352 text+="ToleranceDisplacement="+v+separator
353 text+="ComputedResolutionLength="+str(self.CB_ComputedResolutionLength.isChecked())+separator
354 v=self.SP_toStr(self.SP_ResolutionLength)
355 text+="ResolutionLength="+v+separator
356 text+="FoldingAngle="+str(self.SP_FoldingAngle.value())+separator
357 text+="RemeshPlanes="+str(self.CB_RemeshPlanes.isChecked())+separator
358 text+="ComputedOverlapDistance="+str(self.CB_ComputedOverlapDistance.isChecked())+separator
359 v=self.SP_toStr(self.SP_OverlapDistance)
360 text+="OverlapDistance="+v+separator
361 text+="OverlapAngle="+str(self.SP_OverlapAngle.value())+separator
362 text+="Verbosity="+str(self.SP_Verbosity.value())+separator
365 def loadResumeData(self, hypothesis, separator="\n"):
368 for slig in reversed(text.split(separator)):
370 #print "load ResumeData",lig
371 if lig=="": continue #skip blank lines
372 if lig[0]=="#": break
374 tit,value=lig.split("=")
375 if tit=="CheckOrFix":
376 self.RB_Fix1.setChecked(False)
377 self.RB_Check.setChecked(False)
378 if value=="mode_fix": self.RB_Fix1.setChecked(True)
379 if value=="mode_check": self.RB_Check.setChecked(True)
380 if tit=="PreserveTopology": self.CB_PreserveTopology.setChecked(value=="True")
381 if tit=="FillHoles": self.CB_FillHoles.setChecked(value=="True")
382 if tit=="MinHoleSize": self.SP_MinHoleSize.setProperty("text", value)
383 if tit=="ComputedToleranceDisplacement": self.CB_ComputedToleranceDisplacement.setChecked(value=="True")
384 if tit=="ToleranceDisplacement": self.SP_ToleranceDisplacement.setProperty("text", value)
385 if tit=="ComputedResolutionLength": self.CB_ComputedResolutionLength.setChecked(value=="True")
386 if tit=="ResolutionLength": self.SP_ResolutionLength.setProperty("text", value)
387 if tit=="FoldingAngle": self.SP_FoldingAngle.setProperty("value", float(value))
388 if tit=="RemeshPlanes": self.CB_RemeshPlanes.setChecked(value=="True")
389 if tit=="ComputedOverlapDistance": self.CB_ComputedOverlapDistance.setChecked(value=="True")
390 if tit=="OverlapDistance": self.SP_OverlapDistance.setProperty("text", value)
391 if tit=="OverlapAngle": self.SP_OverlapAngle.setProperty("value", float(value))
392 if tit=="Verbosity": self.SP_Verbosity.setProperty("value", int(float(value)))
394 QMessageBox.warning(self, "load MGCleaner Hypothesis", "Problem on '"+lig+"'")
396 def PBLoadPressed(self):
397 """load last hypothesis saved in tail of file"""
399 f=open(self.paramsFile,"r")
401 QMessageBox.warning(self, "File", "Unable to open "+self.paramsFile)
406 QMessageBox.warning(self, "File", "Unable to read "+self.paramsFile)
409 self.loadResumeData(text, separator="\n")
411 def PBLoadHypPressed(self):
412 """load hypothesis saved in Object Browser"""
413 #QMessageBox.warning(self, "load Object Browser MGCleaner hypothesis", "TODO")
415 from salome.kernel import studyedit
416 from salome.smesh.smeshstudytools import SMeshStudyTools
417 from salome.gui import helper as guihelper
418 from omniORB import CORBA
420 mySObject, myEntry = guihelper.getSObjectSelected()
421 if CORBA.is_nil(mySObject) or mySObject==None:
422 QMessageBox.critical(self, "Hypothese", "select an Object Browser MGCleaner hypothesis")
425 #for i in dir(mySObject): print "dir mySObject",i
426 #print "GetAllAttributes",mySObject.GetAllAttributes()
427 #print "GetComment",mySObject.GetComment()
428 #print "GetName",mySObject.GetName()
431 #if mySObject.GetFather().GetName()!="MGCleaner Hypotheses":
432 # QMessageBox.critical(self, "Hypothese", "not a child of MGCleaner Hypotheses")
435 text=mySObject.GetComment()
438 if "CheckOrFix=" not in text:
439 QMessageBox.critical(self, "Load Hypothese", "Object Browser selection not a MGCleaner Hypothesis")
441 self.loadResumeData(text, separator=" ; ")
444 def PBCancelPressed(self):
447 def PBMeshFilePressed(self):
448 fd = QFileDialog(self, "select an existing Mesh file", self.LE_MeshFile.text(), "Mesh-Files (*.mesh);;All Files (*)")
450 infile = fd.selectedFiles()[0]
451 self.LE_MeshFile.setText(infile)
452 self.fichierIn=str(infile)
454 self.LE_MeshSmesh.setText("")
455 self.__selectedMesh=None
457 def setParamsFileName(self):
458 fd = QFileDialog(self, "select a file", self.LE_ParamsFile.text(), "dat Files (*.dat);;All Files (*)")
460 infile = fd.selectedFiles()[0]
461 self.LE_ParamsFile.setText(infile)
462 self.paramsFile=str(infile)
464 def meshFileNameChanged(self):
465 self.fichierIn=str(self.LE_MeshFile.text())
466 #print "meshFileNameChanged", self.fichierIn
467 if os.path.exists(self.fichierIn):
468 self.__selectedMesh=None
470 self.LE_MeshSmesh.setText("")
472 QMessageBox.warning(self, "Mesh file", "File doesn't exist")
474 def meshSmeshNameChanged(self):
475 """only change by GUI mouse selection, otherwise clear"""
476 #self.MeshIn=str(self.LE_MeshSmesh.text())
477 #print "meshSmeshNameChanged", self.MeshIn
478 self.__selectedMesh = None
480 self.LE_MeshSmesh.setText("")
484 def paramsFileNameChanged(self):
485 self.paramsFile=self.LE_ParamsFile.text()
487 def PBMeshSmeshPressed(self):
488 from omniORB import CORBA
490 from salome.kernel import studyedit
491 from salome.smesh.smeshstudytools import SMeshStudyTools
492 from salome.gui import helper as guihelper
493 from salome.smesh import smeshBuilder
494 smesh = smeshBuilder.New()
496 mySObject, myEntry = guihelper.getSObjectSelected()
497 if CORBA.is_nil(mySObject) or mySObject==None:
498 QMessageBox.critical(self, "Mesh", "select an input mesh")
499 #self.LE_MeshSmesh.setText("")
501 #self.LE_MeshFile.setText("")
504 self.smeshStudyTool = SMeshStudyTools()
506 self.__selectedMesh = self.smeshStudyTool.getMeshObjectFromSObject(mySObject)
508 QMessageBox.critical(self, "Mesh", "select an input mesh")
510 if CORBA.is_nil(self.__selectedMesh):
511 QMessageBox.critical(self, "Mesh", "select an input mesh")
513 myName = mySObject.GetName()
514 #print "MeshSmeshNameChanged", myName
516 self.LE_MeshSmesh.setText(myName)
517 self.LE_MeshFile.setText("")
520 def prepareFichier(self):
521 self.fichierIn=tempfile.mktemp(suffix=".mesh",prefix="ForMGCleaner_")
522 if os.path.exists(self.fichierIn):
523 os.remove(self.fichierIn)
524 self.__selectedMesh.ExportGMF(self.__selectedMesh, self.fichierIn, True)
526 def PrepareLigneCommande(self):
530 #self.commande="mg-cleaner.exe --in " + self.fichierIn + " --out " + self.fichierOut + " --fix2pass"
532 #print "PrepareLigneCommande '"+self.fichierIn+"' '"+self.MeshIn+"'",self.__selectedMesh
533 if self.fichierIn=="" and self.MeshIn=="":
534 QMessageBox.critical(self, "Mesh", "select an input mesh")
536 if self.__selectedMesh!=None: self.prepareFichier()
537 if not (os.path.isfile(self.fichierIn)):
538 QMessageBox.critical(self, "File", "unable to read GMF Mesh in "+str(self.fichierIn))
541 self.commande="mg-cleaner.exe"
542 verbosity=str(self.SP_Verbosity.value())
543 self.commande+=" --verbose " + verbosity
544 self.commande+=' --in "' + self.fichierIn+'"'
545 deb=os.path.splitext(str(self.fichierIn))
546 self.fichierOut=deb[0] + "_fix.mesh"
547 self.commande+=' --out "'+self.fichierOut+'"'
548 if self.RB_Fix1.isChecked():
549 self.commande+=" --mode fix"
551 self.commande+=" --mode check"
552 if self.CB_PreserveTopology.isChecked():
553 self.commande+=" --topology respect"
555 self.commande+=" --topology ignore"
556 if self.CB_FillHoles.isChecked(): #no fill holes default
557 self.commande+=" --min_hole_size " + self.SP_toStr(self.SP_MinHoleSize)
558 if not self.CB_ComputedToleranceDisplacement.isChecked(): #computed default
559 self.commande+=" --tolerance_displacement " + self.SP_toStr(self.SP_ToleranceDisplacement)
560 if not self.CB_ComputedResolutionLength.isChecked(): #computed default
561 self.commande+=" --resolution_length " + self.SP_toStr(self.SP_ResolutionLength)
562 self.commande+=" --folding_angle " + str(self.SP_FoldingAngle.value())
563 if self.CB_RemeshPlanes.isChecked(): #no remesh default
564 self.commande+=" --remesh_planes yes"
565 if not self.CB_ComputedOverlapDistance.isChecked(): #computed default
566 self.commande+=" --overlap_distance " + self.SP_toStr(self.SP_OverlapDistance)
567 self.commande+=" --overlap_angle " + str(self.SP_OverlapAngle.value())
570 key = SMeshHelper.GetMGLicenseKey( self.fichierIn )
571 self.commande+=' --key ' + key
573 if verbose: print(("INFO: MGCCleaner command:\n %s" % self.commande))
577 self.RB_Check.setChecked(False)
578 self.RB_Fix1.setChecked(True)
579 self.CB_PreserveTopology.setChecked(False)
580 self.CB_FillHoles.setChecked(False)
581 self.CB_RemeshPlanes.setChecked(False)
583 self.SP_MinHoleSize.setProperty("text", 0)
584 self.SP_ToleranceDisplacement.setProperty("text", 0)
585 self.SP_ResolutionLength.setProperty("text", 0)
586 self.SP_FoldingAngle.setProperty("value", 15)
587 self.SP_OverlapDistance.setProperty("text", 0)
588 self.SP_OverlapAngle.setProperty("value", 15)
589 self.SP_Verbosity.setProperty("value", 3)
591 self.CB_ComputedToleranceDisplacement.setChecked(True)
592 self.CB_ComputedResolutionLength.setChecked(True)
593 self.CB_ComputedOverlapDistance.setChecked(True)
598 This function returns a singleton instance of the plugin dialog.
599 It is mandatory in order to call show without a parent ...
603 __dialog = MGCleanerMonPlugDialog()
610 # ==============================================================================
612 # ==============================================================================
614 def TEST_standalone():
616 works only if a salome is launched yet with a study loaded
617 to launch standalone python do:
621 python ./INSTALL/SMESH/share/salome/plugins/smesh/MGCleanerMonPlugDialog.py
625 from salome.kernel import studyedit
627 maStudy=salome.myStudy
631 # ==============================================================================
632 # Basic use cases and unit test functions
633 # ==============================================================================
635 def TEST_MGCleanerMonPlugDialog():
637 from qtsalome import QApplication
638 app = QApplication(sys.argv)
639 app.lastWindowClosed.connect(app.quit)
641 dlg=MGCleanerMonPlugDialog()
643 sys.exit(app.exec_())
645 if __name__ == "__main__":
646 TEST_MGCleanerMonPlugDialog()