Back to index

salome-gui  6.5.0
Functions | Variables
salome_plugins Namespace Reference

Functions

def trihedron
def trihedron_withdisplay
def tube_shapewithgui
def tube_meshwithgui
def acceptCallback
def rejectCallback
def applyCallback
def deletePreviewShape
def tube_shapewithguiAndPreview
def runSalomeShellSession

Variables

 DEMO_IS_ACTIVATED = True
tuple dialog = tubedialog.TubeDialog()
tuple dialogWithApply = tubedialog.TubeDialogOnTopWithApply()
 activeStudy = None
 previewShapeEntry = None
string DEFAULT_FOLDER_NAME = "TubeList"
string DEFAULT_SHAPE_NAME = "tube"
string PREVIEW_SHAPE_NAME = "preview"
tuple PREVIEW_COLOR = SALOMEDS.Color(1,0.6,1)

Function Documentation

Action to be done when click on Ok

Definition at line 172 of file salome_plugins.py.

00172 
00173 def acceptCallback():
00174     """Action to be done when click on Ok"""
00175     global tubebuilder, xalome
00176     global dialogWithApply, activeStudy
00177     global previewShapeEntry, deletePreviewShape
00178     global DEFAULT_FOLDER_NAME,DEFAULT_SHAPE_NAME 
00179 
00180     dialogWithApply.accept()
00181 
00182     if previewShapeEntry is not None:
00183         deletePreviewShape()
00184 
00185     radius, length, width = dialogWithApply.getData()
00186     shape = tubebuilder.createGeometry(activeStudy, radius, length, width)
00187     entry = xalome.addToStudy(activeStudy, shape, DEFAULT_SHAPE_NAME, DEFAULT_FOLDER_NAME)
00188     xalome.displayShape(entry)
    

Here is the call graph for this function:

Action to be done when click on Apply

Definition at line 201 of file salome_plugins.py.

00201 
00202 def applyCallback():
00203     """Action to be done when click on Apply"""
00204     global tubebuilder, xalome
00205     global dialogWithApply, activeStudy
00206     global previewShapeEntry, deletePreviewShape
00207     global PREVIEW_COLOR, DEFAULT_SHAPE_NAME, DEFAULT_FOLDER_NAME, PREVIEW_SHAPE_NAME
00208 
00209     # We first have to destroy the currently displayed preview shape.
00210     if previewShapeEntry is not None:
00211         deletePreviewShape()
00212 
00213     # Then we can create the new shape with the new parameter values
00214     radius, length, width = dialogWithApply.getData()
00215     shape = tubebuilder.createGeometry(activeStudy, radius, length, width)
00216     # We apply a specific color on the shape for the preview state
00217     shape.SetColor(PREVIEW_COLOR)
00218     previewShapeEntry = xalome.addToStudy(activeStudy, shape, PREVIEW_SHAPE_NAME, DEFAULT_FOLDER_NAME )
00219     xalome.displayShape(previewShapeEntry)

Here is the call graph for this function:

This delete the shape currently being displayed as a preview

Definition at line 220 of file salome_plugins.py.

00220 
00221 def deletePreviewShape():
00222     """This delete the shape currently being displayed as a preview"""
00223     global activeStudy, previewShapeEntry, xsalome
00224     xalome.deleteShape(activeStudy,previewShapeEntry)
00225     previewShapeEntry = None
00226 
00227 # Connection of callback functions to the dialog butoon click signals
00228 dialogWithApply.handleAcceptWith(acceptCallback)
00229 dialogWithApply.handleRejectWith(rejectCallback)
00230 dialogWithApply.handleApplyWith(applyCallback)

Here is the call graph for this function:

Here is the caller graph for this function:

Action to be done when click on Cancel

Definition at line 189 of file salome_plugins.py.

00189 
00190 def rejectCallback():
00191     """Action to be done when click on Cancel"""
00192     global dialogWithApply, previewShapeEntry, deletePreviewShape
00193 
00194     dialogWithApply.reject()
00195 
00196     if previewShapeEntry is not None:
00197         deletePreviewShape()

Here is the call graph for this function:

Definition at line 250 of file salome_plugins.py.

00250 
00251 def runSalomeShellSession(context):
00252     import os
00253     command="(xterm -e "+os.environ['KERNEL_ROOT_DIR']+"/runSession)&"
00254     os.system(command)

Here is the call graph for this function:

def salome_plugins.trihedron (   context)

Definition at line 32 of file salome_plugins.py.

00032 
00033 def trihedron(context):
00034     import geompy
00035 
00036     # Intialize the geompy factory with the active study
00037     activeStudy = context.study
00038     geompy.init_geom(activeStudy)
00039 
00040     # Create the objects
00041     Vx = geompy.MakeVectorDXDYDZ(10, 0, 0)
00042     Vy = geompy.MakeVectorDXDYDZ(0, 10, 0)
00043     Vz = geompy.MakeVectorDXDYDZ(0, 0, 10)
00044     origin = geompy.MakeVertex(0, 0, 0)
00045 
00046     # Register the objects in the active study
00047     geompy.addToStudy( Vx, "Vx" )
00048     geompy.addToStudy( Vy, "Vy" )
00049     geompy.addToStudy( Vz, "Vz" )
00050     geompy.addToStudy( origin, "origin" )

Here is the call graph for this function:

Definition at line 59 of file salome_plugins.py.

00059 
00060 def trihedron_withdisplay(context):
00061     import geompy
00062 
00063     # Intialize the geompy factory with the active study
00064     activeStudy = context.study
00065     geompy.init_geom(activeStudy)
00066 
00067     # Create the objects
00068     Vx = geompy.MakeVectorDXDYDZ(10, 0, 0)
00069     Vy = geompy.MakeVectorDXDYDZ(0, 10, 0)
00070     Vz = geompy.MakeVectorDXDYDZ(0, 0, 10)
00071     origin = geompy.MakeVertex(0, 0, 0)
00072 
00073     # Register the objects in the active study
00074     entries=[]
00075     entries.append(geompy.addToStudy( Vx, "Vx" ))
00076     entries.append(geompy.addToStudy( Vy, "Vy" ))
00077     entries.append(geompy.addToStudy( Vz, "Vz" ))
00078     entries.append(geompy.addToStudy( origin, "origin" ))
00079 
00080     # This part is to automatically display the objects in the active viewer.
00081     gcomp = salome.ImportComponentGUI("GEOM")
00082     for entry in entries:
00083         gcomp.createAndDisplayFitAllGO(entry)

Here is the call graph for this function:

Definition at line 131 of file salome_plugins.py.

00131 
00132 def tube_meshwithgui(context):
00133     global tube, dialog
00134     activeStudy = context.study
00135 
00136     # Get the parameter values from a gui dialog box. If the dialog is
00137     # closed using the Ok button, then the data are requested from the
00138     # gui and used to create the shape of the tube.
00139     dialog.exec_()
00140     if dialog.wasOk():
00141         radius, length, width = dialog.getData()
00142         mesh = tubebuilder.createModel(activeStudy, radius, length, width)

Here is the call graph for this function:

Definition at line 106 of file salome_plugins.py.

00106 
00107 def tube_shapewithgui(context):
00108     global tubebuilder, xalome, dialog
00109     activeStudy = context.study
00110 
00111     # Get the parameter values from a gui dialog box. If the dialog is
00112     # closed using the Ok button, then the data are requested from the
00113     # gui and used to create the shape of the tube.
00114     dialog.exec_()
00115     if dialog.wasOk():
00116         radius, length, width = dialog.getData()
00117         shape = tubebuilder.createGeometry(activeStudy, radius, length, width)
00118         entry = xalome.addToStudy(activeStudy, shape, "Tube" )
00119         xalome.displayShape(entry)

Here is the call graph for this function:

This plugin open a dialog in an asynchronous mode. Then it
required callback functions to be associated to the button
signals.

Definition at line 231 of file salome_plugins.py.

00231 
00232 def tube_shapewithguiAndPreview(context):
00233     """
00234     This plugin open a dialog in an asynchronous mode. Then it
00235     required callback functions to be associated to the button
00236     signals.
00237     """
00238     global dialogWithApply, activeStudy
00239     activeStudy = context.study
00240     dialogWithApply.open()

Here is the call graph for this function:


Variable Documentation

Definition at line 165 of file salome_plugins.py.

Definition at line 168 of file salome_plugins.py.

Definition at line 169 of file salome_plugins.py.

Definition at line 24 of file salome_plugins.py.

Definition at line 101 of file salome_plugins.py.

Definition at line 161 of file salome_plugins.py.

tuple salome_plugins.PREVIEW_COLOR = SALOMEDS.Color(1,0.6,1)

Definition at line 199 of file salome_plugins.py.

Definition at line 170 of file salome_plugins.py.

Definition at line 166 of file salome_plugins.py.