Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Groups
Auxiliary methods and structures

Functions

def DegreesToRadians
 Convert an angle from degrees to radians. More...
 
def ParseParameters
 Return list of variable values from salome notebook. More...
 
def ParseAngles
 Parse parameters while converting variables to radians. More...
 
def __initPointStruct
 Substitute PointStruct.__init__() to create SMESH.PointStruct using notebook variables. More...
 
def __initAxisStruct
 Substitute AxisStruct.__init__() to create SMESH.AxisStruct using notebook variables. More...
 
def IsEqual
 Compare real values using smeshPrecisionConfusion as tolerance. More...
 
def GetName
 Return object name. More...
 
def TreatHypoStatus
 Print error message if a hypothesis was not assigned. More...
 
def AssureGeomPublished
 Private method. More...
 
def FirstVertexOnCurve
 Return the first vertex of a geometrical edge by ignoring orientation. More...
 
def DumpPython
 Dump component to the Python script This method overrides IDL function to allow default values for the parameters. More...
 
def SetDumpPythonHistorical
 Set mode of DumpPython(), historical or snapshot. More...
 
def init_smesh
 Set the current study and Geometry component. More...
 
def EnumToLong
 Return a long value from enumeration. More...
 
def ColorToString
 Return a string representation of the color. More...
 
def GetPointStruct
 Get PointStruct from vertex. More...
 
def GetDirStruct
 Get DirStruct from vector. More...
 
def MakeDirStruct
 Make DirStruct from a triplet. More...
 
def GetAxisStruct
 Get AxisStruct from object. More...
 
def SetName
 Set the given name to the object. More...
 
def SetEmbeddedMode
 Set the current mode. More...
 
def IsEmbeddedMode
 Get the current mode. More...
 
def SetCurrentStudy
 Set the current study. More...
 
def GetCurrentStudy
 Get the current study. More...
 
def GetSubShapesId
 Return IDs of sub-shapes. More...
 
def SetBoundaryBoxSegmentation
 Set number of segments per diagonal of boundary box of geometry, by which default segment length of appropriate 1D hypotheses is defined in GUI. More...
 
def GetSubShapeName
 Return a name of a sub-shape by its ID. More...
 
def GetLog
 Return the log of nodes and elements added or removed since the previous clear of the log. More...
 
def ClearLog
 Clear the log of nodes and elements added or removed since the previous clear. More...
 
def GetId
 Get the internal ID. More...
 
def GetStudyId
 Get the study Id. More...
 
def GetIDSource
 Wrap a list of IDs of elements or nodes into SMESH_IDSource which can be passed as argument to a method accepting mesh, group or sub-mesh. More...
 

Variables

 notebook = salome_notebook.notebook
 
string var_separator = ":"
 
int smeshPrecisionConfusion = 1
 
string NO_NAME = "NoName"
 

Detailed Description

Function Documentation

def smeshBuilder.DegreesToRadians (   AngleInDegrees)

Convert an angle from degrees to radians.

def smeshBuilder.ParseParameters (   args)

Return list of variable values from salome notebook.

The last argument, if is callable, is used to modify values got from notebook

def smeshBuilder.ParseAngles (   args)

Parse parameters while converting variables to radians.

References smeshBuilder.ParseParameters().

def smeshBuilder.__initPointStruct (   point,
  args 
)
private

Substitute PointStruct.__init__() to create SMESH.PointStruct using notebook variables.

Parameters are stored in PointStruct.parameters attribute

References smeshBuilder.ParseParameters().

def smeshBuilder.__initAxisStruct (   ax,
  args 
)
private

Substitute AxisStruct.__init__() to create SMESH.AxisStruct using notebook variables.

Parameters are stored in AxisStruct.parameters attribute

References smeshBuilder.ParseParameters().

def smeshBuilder.IsEqual (   val1,
  val2,
  tol = smeshPrecisionConfusion 
)

Compare real values using smeshPrecisionConfusion as tolerance.

def smeshBuilder.GetName (   obj)

Return object name.

def smeshBuilder.TreatHypoStatus (   status,
  hypName,
  geomName,
  isAlgo,
  mesh 
)

Print error message if a hypothesis was not assigned.

References smeshBuilder.GetName().

def smeshBuilder.AssureGeomPublished (   mesh,
  geom,
  name = '' 
)

Private method.

Add geom (sub-shape of the main shape) into the study if not yet there

def smeshBuilder.FirstVertexOnCurve (   mesh,
  edge 
)

Return the first vertex of a geometrical edge by ignoring orientation.

def DumpPython (   self,
  theStudy,
  theIsPublished = True,
  theIsMultiFile = True 
)

Dump component to the Python script This method overrides IDL function to allow default values for the parameters.

def SetDumpPythonHistorical (   self,
  isHistorical 
)

Set mode of DumpPython(), historical or snapshot.

In the historical mode, the Python Dump script includes all commands performed by SMESH engine. In the snapshot mode, commands relating to objects removed from the Study are excluded from the script as well as commands not influencing the current state of meshes

def init_smesh (   self,
  theStudy,
  geompyD = None 
)

Set the current study and Geometry component.

References smeshBuilder.SetCurrentStudy().

def EnumToLong (   self,
  theItem 
)

Return a long value from enumeration.

def ColorToString (   self,
  c 
)

Return a string representation of the color.

To be used with filters.

Parameters
ccolor value (SALOMEDS.Color)
def GetPointStruct (   self,
  theVertex 
)

Get PointStruct from vertex.

Parameters
theVertexa GEOM object(vertex)
Returns
SMESH.PointStruct
def GetDirStruct (   self,
  theVector 
)

Get DirStruct from vector.

Parameters
theVectora GEOM object(vector)
Returns
SMESH.DirStruct
def MakeDirStruct (   self,
  x,
  y,
  z 
)

Make DirStruct from a triplet.

Parameters
x,y,zvector components
Returns
SMESH.DirStruct
def GetAxisStruct (   self,
  theObj 
)

Get AxisStruct from object.

Parameters
theObja GEOM object (line or plane)
Returns
SMESH.AxisStruct
def SetName (   self,
  obj,
  name 
)

Set the given name to the object.

Parameters
objthe object to rename
namea new object name
def SetEmbeddedMode (   self,
  theMode 
)

Set the current mode.

def IsEmbeddedMode (   self)

Get the current mode.

def SetCurrentStudy (   self,
  theStudy,
  geompyD = None 
)

Set the current study.

Calling SetCurrentStudy( None ) allows to switch OFF automatic pubilishing in the Study of mesh objects.

def GetCurrentStudy (   self)

Get the current study.

def GetSubShapesId (   self,
  theMainObject,
  theListOfSubObjects 
)

Return IDs of sub-shapes.

Returns
the list of integer values
def SetBoundaryBoxSegmentation (   self,
  nbSegments 
)

Set number of segments per diagonal of boundary box of geometry, by which default segment length of appropriate 1D hypotheses is defined in GUI.

Default value is 10.

def GetSubShapeName (   self,
  subShapeID 
)

Return a name of a sub-shape by its ID.

Parameters
subShapeIDa unique ID of a sub-shape
Returns
a string describing the sub-shape; possible variants:
  • "Face_12" (published sub-shape)
  • FACE #3 (not published sub-shape)
  • sub-shape #3 (invalid sub-shape ID)
  • #3 (error in this function)

References Mesh.GetShape().

def GetLog (   self,
  clearAfterGet 
)

Return the log of nodes and elements added or removed since the previous clear of the log.

Parameters
clearAfterGetlog is emptied after Get (safe if concurrents access)
Returns
list of log_block structures: commandType number coords indexes
def ClearLog (   self)

Clear the log of nodes and elements added or removed since the previous clear.

Must be used immediately after GetLog if clearAfterGet is false.

def GetId (   self)

Get the internal ID.

Returns
integer value, which is the internal Id of the mesh
def GetStudyId (   self)

Get the study Id.

Returns
integer value, which is the study Id of the mesh
def GetIDSource (   self,
  ids,
  elemType = SMESH.ALL 
)

Wrap a list of IDs of elements or nodes into SMESH_IDSource which can be passed as argument to a method accepting mesh, group or sub-mesh.

Parameters
idslist of IDs
elemTypetype of elements; this parameter is used to distinguish IDs of nodes from IDs of elements; by default ids are treated as IDs of elements; use SMESH.NODE if ids are IDs of nodes.
Returns
an instance of SMESH_IDSource
Warning
call UnRegister() for the returned object as soon as it is no more useful: idSrc = mesh.GetIDSource( [1,3,5], SMESH.NODE ) mesh.DoSomething( idSrc ) idSrc.UnRegister()

Variable Documentation

notebook = salome_notebook.notebook
string var_separator = ":"
int smeshPrecisionConfusion = 1
string NO_NAME = "NoName"