import salome
from salome.kernel import studyedit
- #print "enregistreResultat"
maStudy=studyedit.getActiveStudy()
smesh.SetCurrentStudy(maStudy)
(outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
name=str(self.LE_MeshSmesh.text())
+ initialMeshFile=None
+ initialMeshObject=None
if name=="":
- #print "name new MESH",self.LE_MeshFile.text()
a=str(self.fichierIn)
name=os.path.basename(os.path.splitext(a)[0])
+ initialMeshFile=a
+ else:
+ initialMeshObject=maStudy.FindObjectByName(name ,"SMESH")[0]
meshname = name+"_MGC_"+str(self.num)
smesh.SetName(outputMesh.GetMesh(), meshname)
self.editor = studyedit.getStudyEditor()
moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
HypReMeshEntry = self.editor.findOrCreateItem(
- moduleEntry, name = "MGCleaner Hypotheses", icon="mesh_tree_algo.png") #, comment = "HypoForRemeshing" )
+ moduleEntry, name = "Plugins Hypotheses", icon="mesh_tree_hypo.png") #, comment = "HypoForRemeshing" )
monStudyBuilder=maStudy.NewBuilder()
monStudyBuilder.NewCommand()
newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
- aNameAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeName")
- hypoName = "HypoMGC_"+str(self.num)
- aNameAttrib.SetValue(hypoName)
- aCommentAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeComment")
- aCommentAttrib.SetValue(self.getResumeData(separator=" ; "))
+ self.editor.setAttributeValue(newStudyIter, "AttributeName", "MGCleaner Parameters_"+str(self.num))
+ self.editor.setAttributeValue(newStudyIter, "AttributeComment", self.getResumeData(separator=" ; "))
SOMesh=maStudy.FindObjectByName(meshname ,"SMESH")[0]
+
+ if initialMeshFile!=None:
+ newStudyFileName=monStudyBuilder.NewObject(SOMesh)
+ self.editor.setAttributeValue(newStudyFileName, "AttributeName", "meshFile")
+ self.editor.setAttributeValue(newStudyFileName, "AttributeExternalFileDef", initialMeshFile)
+ self.editor.setAttributeValue(newStudyFileName, "AttributeComment", initialMeshFile)
+
+ if initialMeshObject!=None:
+ newLink=monStudyBuilder.NewObject(SOMesh)
+ monStudyBuilder.Addreference(newLink, initialMeshObject)
+
newLink=monStudyBuilder.NewObject(SOMesh)
- monStudyBuilder.Addreference(newLink, newStudyIter);
+ monStudyBuilder.Addreference(newLink, newStudyIter)
if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
self.num+=1
self.editor = studyedit.getStudyEditor()
moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
HypReMeshEntry = self.editor.findOrCreateItem(
- moduleEntry, name = "MGCleaner Hypotheses", icon="mesh_tree_algo.png") #, comment = "HypoForRemeshing" )
+ moduleEntry, name = "Plugins Hypotheses", icon="mesh_tree_hypo.png") #, comment = "HypoForRemeshing" )
monStudyBuilder=maStudy.NewBuilder()
monStudyBuilder.NewCommand()
newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
- aNameAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeName")
- hypoName = "HypoMGC_"+str(self.num)
- aNameAttrib.SetValue(hypoName)
- aCommentAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeComment")
- #print "getResumeData",type(self.getResumeData(separator=" ; ")),self.getResumeData(separator=" ; ")
- aCommentAttrib.SetValue(self.getResumeData(separator=" ; "))
+ self.editor.setAttributeValue(newStudyIter, "AttributeName", "MGCleaner Parameters_"+str(self.num))
+ self.editor.setAttributeValue(newStudyIter, "AttributeComment", self.getResumeData(separator=" ; "))
if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
self.num+=1
return True
+ """
+ import salome_pluginsmanager
+ print "salome_pluginsmanager.plugins",salome_pluginsmanager.plugins
+ print "salome_pluginsmanager.current_plugins_manager",salome_pluginsmanager.current_plugins_manager
+ """
+
def getResumeData(self, separator="\n"):
text=""
if self.RB_Fix1.isChecked():
</property>
</widget>
</item>
- <item>
- <widget class="QPushButton" name="PB_Save">
- <property name="text">
- <string>Save</string>
- </property>
- <property name="iconSize">
- <size>
- <width>18</width>
- <height>18</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PB_Load">
- <property name="text">
- <string>Load</string>
- </property>
- <property name="iconSize">
- <size>
- <width>18</width>
- <height>18</height>
- </size>
- </property>
- </widget>
- </item>
<item>
<widget class="QPushButton" name="PB_Default">
<property name="text">
<x>10</x>
<y>150</y>
<width>750</width>
- <height>140</height>
+ <height>170</height>
</rect>
</property>
<property name="title">
</rect>
</property>
</widget>
+
+ <widget class="QPushButton" name="PB_Save">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>110</y>
+ <width>70</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>18</width>
+ <height>18</height>
+ </size>
+ </property>
+ </widget>
+
+ <widget class="QPushButton" name="PB_Load">
+ <property name="geometry">
+ <rect>
+ <x>120</x>
+ <y>110</y>
+ <width>70</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Load</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>18</width>
+ <height>18</height>
+ </size>
+ </property>
+ </widget>
+
</widget>
</widget>
</widget>
import MGCleanerMonPlugDialog
window=MGCleanerMonPlugDialog.getDialog()
window.show()
+
Advanced Remeshing Options
==========================
-** be aware that no control of coherency is done when you set these parameters : for instance, geometrical approximation is only allowed when MG-Cleaner compute a mesh for finite elements but the GUI will let you choose geometrical approximation and compute a visualisation mesh. read DISTENE documentation **
+See tooltips comments for each parameter.
+See also :download:`MG-cleaner user manual <files/mg-cleaner_user_manual.pdf>`.
- - **Ridge detection**
-if not set (ridge detection disabled ), MG-Cleaner will not try to detect any new ridge edge by its own mechanism :
-it will consider as ridge only the ridges given in the mesh. All non-ridge edges that would have been detected as ridge by the Ridge angle paramaeter (see below split edge) will be considered as part of the same continuous patch. This option should not be checked when all the known ridges of the mesh are given and when all other possible ridges are not geometric ridges to take into account.
-
- - **Point smoothing**
-When not set (point smoothing is disabled), MG-Cleaner will not try to move the initial given vertices (along an edge, a ridge or onto the surface), hence MG-Cleaner will only swap edges, remove vertices or add vertices (refines) to change the mesh.
-
- - **Geometrical approximation**
-this field as well as the Chordal deviation tolerance parameter,enables the user to bound the maximal chordal deviation allowed. it avoids having sharp angles. , that is, the maximal distance allowed between the detected curve and the plane of the corresponding mesh face. It avoids having faces too far away from the curve they represent.
-
-.. image:: images/Tolerance.png
+.. image:: images/Advanced.png
:align: center
-This parameter P enables the user to specify the maximal chordal deviation E relatively to the local curvature. the maximal chordal deviation will be set to E=P x r (r is the radius of the circumcercle) if the units parameter is set to relative or E=P if the units parameter is set to absolute.
-
-
- - **Ridge angle**
-
-This parameter specifies the angular values for the automatic detection of ridges and corners. A ridge is automatically detected if the angle between the normal vectors of two adjacent faces exceeds this value.
-
-
- - **Maximal/Minimal size around vertices**
-
-These two parameters allow the user to prescribe a Maximal/Minimal size for the mesh elements, ie the lengths of the edges.
-
-
- - **Mesh gradation**
-This paramater P controls the element size variation : MG-Cleaner will avoid having two adjacent egdes which sizes vary more than th given gradation. a size correction is applied to the size map : if two adjacent edges are respectively e1 and e2 long and e2 > Pxe1, then, the new size for the second edge will be set to P x e1.
-**This procedure is desactived if P=-1***
-
-
-
- - **Split edge**
-If this option is activated, MG-Cleaner creates new vertices placed on the curved surface and adds them to elements.
-It may be used to obtain higher order elements.
- **Verbosity Level**
This parameter (between 0 and 10) indicates the amount of information that MG-Cleaner prints during the run.
-
-
-- **Memory Size**
-You usually don't have to set this parameter but you can choose to limit the amount of memory used by MG-Cleaner. - It requires 370 bytes per node -. Or, if you try to enrich a already big mesh (up to 2 millions nodes), you exceptionally, need to allocate more memory.
- **File**
-You can change the file used to store the remeshing hypothesis. see paragraph :ref:`hypothesis-label` for further informations.
+You can change the file used to store your favorite remeshing hypothesis. see paragraph :ref:`hypothesis-label` for further informations.
.. image:: images/Generic.png
:align: center
-----------
All options, but the input mesh, have default values. however, **you have to specified these
- simple options in order to drive yams and control remeshing parameters**.
+ simple options in order to drive MG-Cleaner and control remeshing parameters**.
You can access Distene documentation by clicking on Help button.
You have to select a Mesh Object from Salome Object Browser or choose a .GMF file.
-Optimisation
+Options
------------
-This is the main remeshing Option. Yams always does quality improvement. It is done by point smooting and edge swapping. It can produce a regular mesh for finite element computation (initial mesh is a a geometrical mesh). In this case, the given surface trianglation is modified in accordance to a size map : an intrinsic size map is computed automatically. it is based on the surface proporties. Yams is also able to produce a geometrical mesh (initial mesh is a a mesh for finite element computation). In both case, It can coarsen or enrich the mesh.
-
- - **Quality improvement**
-
- If you activitate this option, Yams does only quality improvement.
-
- It is equivalent to Yams's batch option 0.
-
- - **Pure Geometry Enrichement**
-
- The given surface triangulation is enriched (no coarsening at all) in such away that the distance between the elements in the final mesh and those of the initial one is bounded by auser specified tolerance value. One should use this option, to enrich the mesh where purely geometrical features may be insuficiently fine, i.e. the resulting mesh will be least as fine as the input. Mesh and the geometric features will be refined if needed as specified by the other program parameters. The meshes obtained with those settings may not be suitable for computation.
-
- It is equivalent to Yams's batch option G.
-
- - **Uniform subdivision**
-
- A uniform subdivision of the given surface triangulation is performed : each triangle of the given surface triangulation is considered at and is divided into identical triangles.
-
- It is equivalent to Yams's batch option U.
-
- - **Smoothing**
-
- A surface sandpapering without shrinkage of the given surface triangulation is performed, i.e., the high curvature variations of the given surface will be smoothed out without shrinking the volume in doing so. If ridges are defined, they will be kept as they are in the resulting mesh. It could modify the geometry.
- It is equivalent to Yams's batch option S.
-
- - **Geometrical Mesh : Coarsening**
-
- The given surface triangulation is modified in such a way that the distance between the elements in the final mesh and those of the initial one is bounded by a user specfied tolerance value.One should use this option, to coarsen when a purely geometrical mesh is needed. (a mesh that keeps and obeys its geometric features only.) The meshes obtained with this option are usually not suitable for computation because anisotropic elements may be generated
-
- It is equivalent to Yams's batch option -2.
-
- - **Geometrical Mesh : Coarsening and Enrichment**
-
- Yams coarses and enrichs meshes to obtain a purely geometrical mesh. The method is the same as above.
-
- It is equivalent to Yams's batch option 2.
-
- - **Mesh for finite element computation : Coarsening**
-
- The given surface triangulation is modified in accordance to a size map. The latter is the intrinsic size map (computed automatically and based on the surface properties, i.e. the local curvatures). One should use this option to coarsen the mesh, when a regular mesh for computation purposes is desired, i.e. a mesh with good aspect ratios or good quality elements.
-
- It is equivalent to Yams's batch option -1.
-
- - **Mesh for finite element computation : Coarsening and Enrichment**
-
- One should use this option to coarsen and enrich the mesh, when a regular mesh for computation purposes is desired, i.e. a mesh with good aspect ratios or good quality elements. The method is the same as above.
-
- It is equivalent to Yams's batch option 1.
+This is the main remeshing Option.
-Units parameter
----------------
-
-It indicates what reference is used for the values corresponding to size or distance specifications:
-If the Units parameter is absolute, values are relative to the bounding box,otherwise the tolerance parameter is expressed in model units. The bounding box size is defined as the length of the diagonal (lower left back icorner to upper right front corner).
-
-
-
-Chordal deviation tolerance parameter
--------------------------------------
-
-This field enables the user to bound the maximal chordal deviation allowed, that is, the maximal distance allowed between the detected curve and the plane of the corresponding mesh face. It avoids having faces too far away from the curve they represent.
-
-.. image:: images/Tolerance.png
- :align: center
-
-
-This parameter enables the user to specify the maximal chordal deviation epsilon max.
-
-it can be :
- - relative : the maximal chordal deviation - epsilon max -is set to 0.001 x the parameter. by default, the parameter is set to 0.1 and the maximum deviation is also 0.1 x 1/1000 * the size of the bounding box, which is equivalent to say that, for a bouding box of 1 meter, the maximal deviation is 0.1 mm.
- - absolute : the maximal chordal deviation is the parameter itself. eg if the parameter equals 2, the maximal chordal deviation will be 2 (mm if the point coordonates are given in mm).
-
-Following that criterion:
- - if the chordal deviation epsilon is smaller than epsilon max, it is acceptable to remove the considered point.
- - if the chordal deviation epsilon is greater than epsilon max, the considered mesh face should be redifined by adding a point on the curve.
-
How to save MG-Cleaner Parameters
===========================
-As MG-Cleaner hypothesis are not meshing hypothesis for Salome (but hypothesis for MG-Cleaner), parameters
-are stored in a special file. Default file is $HOME/.MGCleaner.dat. It is strongly recommended that you
-change this name if you want to preserve the way you obtain a mesh : This file is never cleaned.
-All sets of parameters are logged in it.
+MG-Cleaner hypothesis is not meshing hypothesis for Salome, but hypothesis for MG-Cleaner.
+The current set of parameters is automatically written in the salome study object browser when you run computation.
+Theses parameters could also be stored in a special file.
+Default file is $HOME/.MGCleaner.dat.
+This ASCII file is appended, and never cleaned.
-- To save the current setting, click on "Save Params" pushbutton.
-- A set of parameters is automatically written in the .MGCleaner.dat file when you run computation.
-- Restoring the default settings can be done by pushing "Default Params".
-- "Loading Params" will reload the last set of parameters
+In frame "Plug-in Generic Options":
+- To save the current setting in this file, click on "Save" pushbutton.
+- To load the last set of parameters saved, click on "Load" pushbutton.
+
+At the bottom of the dialog window:
+
+- To save a current setting in the study object browser, click on "Save" pushbutton.
+- To load a current setting from the study object browser, click on "Load" pushbutton.
+- To load the default setting, click on "Default" pushbutton. .
**example of .MGCleaner.dat**
.. code-block:: python
- # Save intermediate params
- # Params for mesh :
- Optimisation ='Quality improvement Only (0)'
- Units ='Relative'
- Chordal_Tolerance_Deviation=1.0
- Ridge_Detection=True
- Split_Edge=False
- Point_Smoothing=True
- Geometrical_Approximation=0.04
- Ridge_Angle=45.0
- Maximum_Size=-2.0
- Minimum_Size=-2.0
- Mesh_Gradation=1.3
- Verbosity=3
- Memory=0
-
-
-
- # Params for Hypothese : anHypo_MGCleaner_0
+ # MGCleaner hypothesis parameters
# Params for mesh : Mesh_1
- Optimisation ='Quality improvement Only (0)'
- Units ='Relative'
- Chordal_Tolerance_Deviation=1.0
- Ridge_Detection=True
- Split_Edge=False
- Point_Smoothing=True
- Geometrical_Approximation=0.04
- Ridge_Angle=45.0
- Maximum_Size=-2.0
- Minimum_Size=-2.0
- Mesh_Gradation=1.3
- Verbosity=3
- Memory=0
-
+ # Date : 21/05/13 10:44:05
+ # Command : mg-cleaner.exe --verbose 2 --in /tmp/ForMGCleaner_2.mesh --out /tmp/ForMGCleaner_2_fix.mesh --check --topology ignore --tolerance_displacement 0.0 --folding_angle 15.0 --overlap_angle 15.0
+ CheckOrFix=check
+ PreserveTopology=False
+ FillHoles=False
+ MinHoleSize=0.0
+ ComputedToleranceDisplacement=True
+ ToleranceDisplacement=0.0
+ ComputedResolutionLength=False
+ ResolutionLength=0.0
+ FoldingAngle=15.0
+ RemeshPlanes=False
+ ComputedOverlapDistance=True
+ OverlapDistance=0.0
+ OverlapAngle=15.0
+ Verbosity=2
lct.rst
Mandatory_params.rst
- Generics_params.rst
Advanced_params.rst
+ Generics_params.rst
editHypo.rst
</property>
</widget>
</item>
- <item>
- <widget class="QPushButton" name="PB_Save">
- <property name="text">
- <string>Save</string>
- </property>
- <property name="iconSize">
- <size>
- <width>18</width>
- <height>18</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="PB_Load">
- <property name="text">
- <string>Load</string>
- </property>
- <property name="iconSize">
- <size>
- <width>18</width>
- <height>18</height>
- </size>
- </property>
- </widget>
- </item>
<item>
<widget class="QPushButton" name="PB_Default">
<property name="text">
<x>10</x>
<y>150</y>
<width>750</width>
- <height>140</height>
+ <height>170</height>
</rect>
</property>
<property name="title">
</rect>
</property>
</widget>
+
+ <widget class="QPushButton" name="PB_Save">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>110</y>
+ <width>70</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>18</width>
+ <height>18</height>
+ </size>
+ </property>
+ </widget>
+
+ <widget class="QPushButton" name="PB_Load">
+ <property name="geometry">
+ <rect>
+ <x>120</x>
+ <y>110</y>
+ <width>70</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Load</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>18</width>
+ <height>18</height>
+ </size>
+ </property>
+ </widget>
+
</widget>
</widget>
</widget>
- **File**
-You can change the file used to store the remeshing hypothesis. see paragraph :ref:`hypothesis-label` for further informations.
+You can change the file used to store remeshing hypotheses. see paragraph :ref:`hypothesis-label` for further informations.
.. image:: images/Generic.png
:align: center
How to save Yams Parameters
===========================
-As Yams hypothesis are not meshing hypothesis for Salome (but hypothesis for yams), parameters
-are stored in a special file. Default file is $HOME/.yams.dat. It is strongly recommended that you
-change this name if you want to preserve the way you obtain a mesh : This file is never cleaned.
-All sets of parameters are logged in it.
+Yams hypothesis is not meshing hypothesis for Salome, but hypothesis for yams.
+The current set of parameters is automatically written in the salome study object browser when you run computation.
+Theses parameters could also be stored in a special file.
+Default file is $HOME/.yams.dat.
+This ASCII file is appended, and never cleaned.
-- To save the current setting, click on "Save Params" pushbutton.
-- A set of parameters is automatically written in the .yams.dat file when you run computation.
-- Restoring the default settings can be done by pushing "Default Params".
-- "Loading Params" will reload the last set of parameters
+In frame "Plug-in Generic Options":
+- To save the current setting in this file, click on "Save" pushbutton.
+- To load the last set of parameters saved, click on "Load" pushbutton.
+
+At the bottom of the dialog window:
+
+- To save a current setting in the study object browser, click on "Save" pushbutton.
+- To load a current setting from the study object browser, click on "Load" pushbutton.
+- To load the default setting, click on "Default" pushbutton. .
**example of .yams.dat**
.. code-block:: python
- # Save intermediate params
- # Params for mesh :
- Optimisation ='Quality improvement Only (0)'
- Units ='Relative'
- Chordal_Tolerance_Deviation=1.0
- Ridge_Detection=True
- Split_Edge=False
- Point_Smoothing=True
- Geometrical_Approximation=0.04
- Ridge_Angle=45.0
- Maximum_Size=-2.0
- Minimum_Size=-2.0
- Mesh_Gradation=1.3
- Verbosity=3
- Memory=0
-
-
-
- # Params for Hypothese : anHypo_Yams_0
+ # YAMS hypothesis parameters
# Params for mesh : Mesh_1
- Optimisation ='Quality improvement Only (0)'
- Units ='Relative'
- Chordal_Tolerance_Deviation=1.0
- Ridge_Detection=True
- Split_Edge=False
- Point_Smoothing=True
- Geometrical_Approximation=0.04
- Ridge_Angle=45.0
- Maximum_Size=-2.0
- Minimum_Size=-2.0
- Mesh_Gradation=1.3
+ # Date : 23/05/13 14:23:18
+ # Command : yams -v 3 -O 0 -Drelative,tolerance=0.100000,maxsize=0.010000,minsize=0.000000 /tmp/ForYams_1.mesh
+ Optimisation=Quality improvement Only (0)
+ Units=Relative
+ ChordalToleranceDeviation=0.1
+ RidgeDetection=True
+ SplitEdge=False
+ PointSmoothing=True
+ GeometricalApproximation=0.04
+ RidgeAngle=45.0
+ MaximumSize=0.01
+ MinimumSize=0.0
+ MeshGradation=1.3
Verbosity=3
Memory=0
+
+
lct.rst
Mandatory_params.rst
- Generics_params.rst
Advanced_params.rst
+ Generics_params.rst
editHypo.rst
import salome
from salome.kernel import studyedit
- #print "enregistreResultat"
maStudy=studyedit.getActiveStudy()
smesh.SetCurrentStudy(maStudy)
(outputMesh, status) = smesh.CreateMeshesFromGMF(self.fichierOut)
name=str(self.LE_MeshSmesh.text())
+ initialMeshFile=None
+ initialMeshObject=None
if name=="":
- #print "name new MESH",self.LE_MeshFile.text()
a=str(self.fichierIn)
name=os.path.basename(os.path.splitext(a)[0])
+ initialMeshFile=a
+ else:
+ initialMeshObject=maStudy.FindObjectByName(name ,"SMESH")[0]
meshname = name+"_YAMS_"+str(self.num)
smesh.SetName(outputMesh.GetMesh(), meshname)
self.editor = studyedit.getStudyEditor() #
moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
HypReMeshEntry = self.editor.findOrCreateItem(
- moduleEntry, name = "YAMS Hypotheses", icon="mesh_tree_algo.png") #, comment = "HypoForRemeshing" )
+ moduleEntry, name = "Plugins Hypotheses", icon="mesh_tree_hypo.png") #, comment = "HypoForRemeshing" )
- monStudyBuilder=maStudy.NewBuilder();
- monStudyBuilder.NewCommand();
+ monStudyBuilder=maStudy.NewBuilder()
+ monStudyBuilder.NewCommand()
newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
- aNameAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeName")
- hypoName = "HypoYams_"+str(self.num)
- aNameAttrib.SetValue(hypoName)
- aCommentAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeComment")
- aCommentAttrib.SetValue(self.getResumeData(separator=" ; "))
+ self.editor.setAttributeValue(newStudyIter, "AttributeName", "YAMS Parameters_"+str(self.num))
+ self.editor.setAttributeValue(newStudyIter, "AttributeComment", self.getResumeData(separator=" ; "))
SOMesh=maStudy.FindObjectByName(meshname ,"SMESH")[0]
+
+ if initialMeshFile!=None:
+ newStudyFileName=monStudyBuilder.NewObject(SOMesh)
+ self.editor.setAttributeValue(newStudyFileName, "AttributeName", "meshFile")
+ self.editor.setAttributeValue(newStudyFileName, "AttributeExternalFileDef", initialMeshFile)
+ self.editor.setAttributeValue(newStudyFileName, "AttributeComment", initialMeshFile)
+
+ if initialMeshObject!=None:
+ newLink=monStudyBuilder.NewObject(SOMesh)
+ monStudyBuilder.Addreference(newLink, initialMeshObject)
+
newLink=monStudyBuilder.NewObject(SOMesh)
monStudyBuilder.Addreference(newLink, newStudyIter)
-
+
if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
self.num+=1
return True
self.editor = studyedit.getStudyEditor()
moduleEntry=self.editor.findOrCreateComponent("SMESH","SMESH")
HypReMeshEntry = self.editor.findOrCreateItem(
- moduleEntry, name = "YAMS Hypotheses", icon="mesh_tree_algo.png") #, comment = "HypoForRemeshing" )
+ moduleEntry, name = "Plugins Hypotheses", icon="mesh_tree_hypo.png") #, comment = "HypoForRemeshing" )
monStudyBuilder=maStudy.NewBuilder()
monStudyBuilder.NewCommand()
newStudyIter=monStudyBuilder.NewObject(HypReMeshEntry)
- aNameAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeName")
- hypoName = "HypoYams_"+str(self.num)
- aNameAttrib.SetValue(hypoName)
- aCommentAttrib=monStudyBuilder.FindOrCreateAttribute(newStudyIter,"AttributeComment")
- #print "getResumeData",type(self.getResumeData(separator=" ; ")),self.getResumeData(separator=" ; ")
- aCommentAttrib.SetValue(self.getResumeData(separator=" ; "))
+ self.editor.setAttributeValue(newStudyIter, "AttributeName", "YAMS Parameters_"+str(self.num))
+ self.editor.setAttributeValue(newStudyIter, "AttributeComment", self.getResumeData(separator=" ; "))
if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0)
self.num+=1
QMessageBox.critical(self, "Hypothese", "select an Object Browser YAMS hypothesis")
return
- #for i in dir(mySObject): print "dir mySObject",i
- #print "GetAllAttributes",mySObject.GetAllAttributes()
- #print "GetComment",mySObject.GetComment()
- #print "GetName",mySObject.GetName()
-
- #could be renamed...
- #if mySObject.GetFather().GetName()!="MGCleaner Hypotheses":
- # QMessageBox.critical(self, "Hypothese", "not a child of MGCleaner Hypotheses")
- # return
-
text=mySObject.GetComment()
#a verification
def meshSmeshNameChanged(self):
"""only change by GUI mouse selection, otherwise clear"""
- #self.MeshIn=str(self.LE_MeshSmesh.text())
- #print "meshSmeshNameChanged", self.MeshIn
self.__selectedMesh = None
self.MeshIn=""
self.LE_MeshSmesh.setText("")