+
+
+import salome_notebook
+notebook = salome_notebook.notebook
+
+##Return values of the notebook variables
+def ParseParameters(last, nbParams,nbParam, value):
+ result = None
+ strResult = ""
+ counter = 0
+ listSize = len(last)
+ for n in range(0,nbParams):
+ if n+1 != nbParam:
+ if counter < listSize:
+ strResult = strResult + last[counter]
+ else:
+ strResult = strResult + ""
+ else:
+ if isinstance(value, str):
+ if notebook.isVariable(value):
+ result = notebook.get(value)
+ strResult=strResult+value
+ else:
+ raise RuntimeError, "Variable with name '" + value + "' doesn't exist!!!"
+ else:
+ strResult=strResult+str(value)
+ result = value
+ if nbParams - 1 != counter:
+ strResult=strResult+var_separator #":"
+ counter = counter+1
+ return result, strResult
+
+#Wrapper class for StdMeshers_LocalLength hypothesis
+class LocalLength(StdMeshers._objref_StdMeshers_LocalLength):
+
+ ## Set Length parameter value
+ # @param length numerical value or name of variable from notebook
+ def SetLength(self, length):
+ length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_LocalLength.GetLastParameters(self),2,1,length)
+ StdMeshers._objref_StdMeshers_LocalLength.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_LocalLength.SetLength(self,length)
+
+ ## Set Precision parameter value
+ # @param precision numerical value or name of variable from notebook
+ def SetPrecision(self, precision):
+ precision,parameters = ParseParameters(StdMeshers._objref_StdMeshers_LocalLength.GetLastParameters(self),2,2,precision)
+ StdMeshers._objref_StdMeshers_LocalLength.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_LocalLength.SetPrecision(self, precision)
+
+#Registering the new proxy for LocalLength
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_LocalLength._NP_RepositoryId, LocalLength)
+
+
+#Wrapper class for StdMeshers_LayerDistribution hypothesis
+class LayerDistribution(StdMeshers._objref_StdMeshers_LayerDistribution):
+
+ def SetLayerDistribution(self, hypo):
+ StdMeshers._objref_StdMeshers_LayerDistribution.SetParameters(self,hypo.GetParameters())
+ hypo.ClearParameters();
+ StdMeshers._objref_StdMeshers_LayerDistribution.SetLayerDistribution(self,hypo)
+
+#Registering the new proxy for LayerDistribution
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_LayerDistribution._NP_RepositoryId, LayerDistribution)
+
+#Wrapper class for StdMeshers_SegmentLengthAroundVertex hypothesis
+class SegmentLengthAroundVertex(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex):
+
+ ## Set Length parameter value
+ # @param length numerical value or name of variable from notebook
+ def SetLength(self, length):
+ length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.GetLastParameters(self),1,1,length)
+ StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex.SetLength(self,length)
+
+#Registering the new proxy for SegmentLengthAroundVertex
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_SegmentLengthAroundVertex._NP_RepositoryId, SegmentLengthAroundVertex)
+
+
+#Wrapper class for StdMeshers_Arithmetic1D hypothesis
+class Arithmetic1D(StdMeshers._objref_StdMeshers_Arithmetic1D):
+
+ ## Set Length parameter value
+ # @param length numerical value or name of variable from notebook
+ # @param isStart true is length is Start Length, otherwise false
+ def SetLength(self, length, isStart):
+ nb = 2
+ if isStart:
+ nb = 1
+ length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Arithmetic1D.GetLastParameters(self),2,nb,length)
+ StdMeshers._objref_StdMeshers_Arithmetic1D.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_Arithmetic1D.SetLength(self,length,isStart)
+
+#Registering the new proxy for Arithmetic1D
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_Arithmetic1D._NP_RepositoryId, Arithmetic1D)
+
+#Wrapper class for StdMeshers_Deflection1D hypothesis
+class Deflection1D(StdMeshers._objref_StdMeshers_Deflection1D):
+
+ ## Set Deflection parameter value
+ # @param deflection numerical value or name of variable from notebook
+ def SetDeflection(self, deflection):
+ deflection,parameters = ParseParameters(StdMeshers._objref_StdMeshers_Deflection1D.GetLastParameters(self),1,1,deflection)
+ StdMeshers._objref_StdMeshers_Deflection1D.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_Deflection1D.SetDeflection(self,deflection)
+
+#Registering the new proxy for Deflection1D
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_Deflection1D._NP_RepositoryId, Deflection1D)
+
+#Wrapper class for StdMeshers_StartEndLength hypothesis
+class StartEndLength(StdMeshers._objref_StdMeshers_StartEndLength):
+
+ ## Set Length parameter value
+ # @param length numerical value or name of variable from notebook
+ # @param isStart true is length is Start Length, otherwise false
+ def SetLength(self, length, isStart):
+ nb = 2
+ if isStart:
+ nb = 1
+ length,parameters = ParseParameters(StdMeshers._objref_StdMeshers_StartEndLength.GetLastParameters(self),2,nb,length)
+ StdMeshers._objref_StdMeshers_StartEndLength.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_StartEndLength.SetLength(self,length,isStart)
+
+#Registering the new proxy for StartEndLength
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_StartEndLength._NP_RepositoryId, StartEndLength)
+
+#Wrapper class for StdMeshers_MaxElementArea hypothesis
+class MaxElementArea(StdMeshers._objref_StdMeshers_MaxElementArea):
+
+ ## Set Max Element Area parameter value
+ # @param area numerical value or name of variable from notebook
+ def SetMaxElementArea(self, area):
+ area ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementArea.GetLastParameters(self),1,1,area)
+ StdMeshers._objref_StdMeshers_MaxElementArea.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_MaxElementArea.SetMaxElementArea(self,area)
+
+#Registering the new proxy for MaxElementArea
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementArea._NP_RepositoryId, MaxElementArea)
+
+
+#Wrapper class for StdMeshers_MaxElementVolume hypothesis
+class MaxElementVolume(StdMeshers._objref_StdMeshers_MaxElementVolume):
+
+ ## Set Max Element Volume parameter value
+ # @param volume numerical value or name of variable from notebook
+ def SetMaxElementVolume(self, volume):
+ volume ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_MaxElementVolume.GetLastParameters(self),1,1,volume)
+ StdMeshers._objref_StdMeshers_MaxElementVolume.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_MaxElementVolume.SetMaxElementVolume(self,volume)
+
+#Registering the new proxy for MaxElementVolume
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_MaxElementVolume._NP_RepositoryId, MaxElementVolume)
+
+
+#Wrapper class for StdMeshers_NumberOfLayers hypothesis
+class NumberOfLayers(StdMeshers._objref_StdMeshers_NumberOfLayers):
+
+ ## Set Number Of Layers parameter value
+ # @param nbLayers numerical value or name of variable from notebook
+ def SetNumberOfLayers(self, nbLayers):
+ nbLayers ,parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfLayers.GetLastParameters(self),1,1,nbLayers)
+ StdMeshers._objref_StdMeshers_NumberOfLayers.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_NumberOfLayers.SetNumberOfLayers(self,nbLayers)
+
+#Registering the new proxy for NumberOfLayers
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfLayers._NP_RepositoryId, NumberOfLayers)
+
+#Wrapper class for StdMeshers_NumberOfSegments hypothesis
+class NumberOfSegments(StdMeshers._objref_StdMeshers_NumberOfSegments):
+
+ ## Set Number Of Segments parameter value
+ # @param nbSeg numerical value or name of variable from notebook
+ def SetNumberOfSegments(self, nbSeg):
+ lastParameters = StdMeshers._objref_StdMeshers_NumberOfSegments.GetLastParameters(self)
+ nbSeg , parameters = ParseParameters(lastParameters,1,1,nbSeg)
+ StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_NumberOfSegments.SetNumberOfSegments(self,nbSeg)
+
+ ## Set Scale Factor parameter value
+ # @param factor numerical value or name of variable from notebook
+ def SetScaleFactor(self, factor):
+ factor, parameters = ParseParameters(StdMeshers._objref_StdMeshers_NumberOfSegments.GetLastParameters(self),2,2,factor)
+ StdMeshers._objref_StdMeshers_NumberOfSegments.SetParameters(self,parameters)
+ StdMeshers._objref_StdMeshers_NumberOfSegments.SetScaleFactor(self,factor)
+
+#Registering the new proxy for NumberOfSegments
+omniORB.registerObjref(StdMeshers._objref_StdMeshers_NumberOfSegments._NP_RepositoryId, NumberOfSegments)
+
+if not noNETGENPlugin:
+ #Wrapper class for NETGENPlugin_Hypothesis hypothesis
+ class NETGENPlugin_Hypothesis(NETGENPlugin._objref_NETGENPlugin_Hypothesis):
+
+ ## Set Max Size parameter value
+ # @param maxsize numerical value or name of variable from notebook
+ def SetMaxSize(self, maxsize):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+ maxsize, parameters = ParseParameters(lastParameters,4,1,maxsize)
+ NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetMaxSize(self,maxsize)
+
+ ## Set Growth Rate parameter value
+ # @param value numerical value or name of variable from notebook
+ def SetGrowthRate(self, value):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+ value, parameters = ParseParameters(lastParameters,4,2,value)
+ NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetGrowthRate(self,value)
+
+ ## Set Number of Segments per Edge parameter value
+ # @param value numerical value or name of variable from notebook
+ def SetNbSegPerEdge(self, value):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+ value, parameters = ParseParameters(lastParameters,4,3,value)
+ NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerEdge(self,value)
+
+ ## Set Number of Segments per Radius parameter value
+ # @param value numerical value or name of variable from notebook
+ def SetNbSegPerRadius(self, value):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_Hypothesis.GetLastParameters(self)
+ value, parameters = ParseParameters(lastParameters,4,4,value)
+ NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_Hypothesis.SetNbSegPerRadius(self,value)
+
+ #Registering the new proxy for NETGENPlugin_Hypothesis
+ omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis._NP_RepositoryId, NETGENPlugin_Hypothesis)
+
+
+ #Wrapper class for NETGENPlugin_Hypothesis_2D hypothesis
+ class NETGENPlugin_Hypothesis_2D(NETGENPlugin_Hypothesis,NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D):
+ pass
+
+ #Registering the new proxy for NETGENPlugin_Hypothesis_2D
+ omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_Hypothesis_2D._NP_RepositoryId, NETGENPlugin_Hypothesis_2D)
+
+ #Wrapper class for NETGENPlugin_SimpleHypothesis_2D hypothesis
+ class NETGEN_SimpleParameters_2D(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D):
+
+ ## Set Number of Segments parameter value
+ # @param nbSeg numerical value or name of variable from notebook
+ def SetNumberOfSegments(self, nbSeg):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+ nbSeg, parameters = ParseParameters(lastParameters,2,1,nbSeg)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetNumberOfSegments(self, nbSeg)
+
+ ## Set Local Length parameter value
+ # @param length numerical value or name of variable from notebook
+ def SetLocalLength(self, length):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+ length, parameters = ParseParameters(lastParameters,2,1,length)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetLocalLength(self, length)
+
+ ## Set Max Element Area parameter value
+ # @param area numerical value or name of variable from notebook
+ def SetMaxElementArea(self, area):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+ area, parameters = ParseParameters(lastParameters,2,2,area)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetMaxElementArea(self, area)
+
+ def LengthFromEdges(self):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.GetLastParameters(self)
+ value = 0;
+ value, parameters = ParseParameters(lastParameters,2,2,value)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D.LengthFromEdges(self)
+
+ #Registering the new proxy for NETGEN_SimpleParameters_2D
+ omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_2D._NP_RepositoryId, NETGEN_SimpleParameters_2D)
+
+
+ #Wrapper class for NETGENPlugin_SimpleHypothesis_3D hypothesis
+ class NETGEN_SimpleParameters_3D(NETGEN_SimpleParameters_2D,NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D):
+ ## Set Max Element Volume parameter value
+ # @param volume numerical value or name of variable from notebook
+ def SetMaxElementVolume(self, volume):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
+ volume, parameters = ParseParameters(lastParameters,3,3,volume)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetMaxElementVolume(self, volume)
+
+ def LengthFromFaces(self):
+ lastParameters = NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.GetLastParameters(self)
+ value = 0;
+ value, parameters = ParseParameters(lastParameters,3,3,value)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.SetParameters(self,parameters)
+ NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D.LengthFromFaces(self)
+
+ #Registering the new proxy for NETGEN_SimpleParameters_3D
+ omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D._NP_RepositoryId, NETGEN_SimpleParameters_3D)
+
+ pass # if not noNETGENPlugin:
+
+class Pattern(SMESH._objref_SMESH_Pattern):
+
+ def ApplyToMeshFaces(self, theMesh, theFacesIDs, theNodeIndexOnKeyPoint1, theReverse):
+ flag = False
+ if isinstance(theNodeIndexOnKeyPoint1,str):
+ flag = True
+ theNodeIndexOnKeyPoint1,Parameters = geompyDC.ParseParameters(theNodeIndexOnKeyPoint1)
+ if flag:
+ theNodeIndexOnKeyPoint1 -= 1
+ theMesh.SetParameters(Parameters)
+ return SMESH._objref_SMESH_Pattern.ApplyToMeshFaces( self, theMesh, theFacesIDs, theNodeIndexOnKeyPoint1, theReverse )
+
+ def ApplyToHexahedrons(self, theMesh, theVolumesIDs, theNode000Index, theNode001Index):
+ flag0 = False
+ flag1 = False
+ if isinstance(theNode000Index,str):
+ flag0 = True
+ if isinstance(theNode001Index,str):
+ flag1 = True
+ theNode000Index,theNode001Index,Parameters = geompyDC.ParseParameters(theNode000Index,theNode001Index)
+ if flag0:
+ theNode000Index -= 1
+ if flag1:
+ theNode001Index -= 1
+ theMesh.SetParameters(Parameters)
+ return SMESH._objref_SMESH_Pattern.ApplyToHexahedrons( self, theMesh, theVolumesIDs, theNode000Index, theNode001Index )
+
+#Registering the new proxy for Pattern
+omniORB.registerObjref(SMESH._objref_SMESH_Pattern._NP_RepositoryId, Pattern)