# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2010-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
if DEMO_IS_ACTIVATED:
# Check that GEOM and SMESH modules are present
try:
- import geompy, smesh
+ import GEOM
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New(salome.myStudy)
+
+ import SMESH, SALOMEDS
+ from salome.smesh import smeshBuilder
+ smesh = smeshBuilder.New(salome.myStudy)
except:
DEMO_IS_ACTIVATED = False
import salome
def trihedron(context):
- import geompy
+ import GEOM
+ from salome.geom import geomBuilder
# Intialize the geompy factory with the active study
activeStudy = context.study
- geompy.init_geom(activeStudy)
+ geompy = geomBuilder.New(activeStudy)
# Create the objects
Vx = geompy.MakeVectorDXDYDZ(10, 0, 0)
# -------------------------------------------------------------------------
# Example 1 bis: creation of basic objects and automatic display
def trihedron_withdisplay(context):
- import geompy
+ import GEOM
+ from salome.geom import geomBuilder
# Intialize the geompy factory with the active study
activeStudy = context.study
- geompy.init_geom(activeStudy)
+ geompy = geomBuilder.New(activeStudy)
# Create the objects
Vx = geompy.MakeVectorDXDYDZ(10, 0, 0)
global tubebuilder, xalome
global dialogWithApply, activeStudy
global previewShapeEntry, deletePreviewShape
- global DEFAULT_FOLDER_NAME,DEFAULT_SHAPE_NAME
+ global DEFAULT_FOLDER_NAME,DEFAULT_SHAPE_NAME
dialogWithApply.accept()
shape = tubebuilder.createGeometry(activeStudy, radius, length, width)
entry = xalome.addToStudy(activeStudy, shape, DEFAULT_SHAPE_NAME, DEFAULT_FOLDER_NAME)
xalome.displayShape(entry)
-
+
def rejectCallback():
"""Action to be done when click on Cancel"""
global dialogWithApply, previewShapeEntry, deletePreviewShape
version = salome_version.getVersion(full=True)
kernel_appli_dir = os.environ['KERNEL_ROOT_DIR']
command = ""
- if os.path.exists("/usr/bin/xterm"):
- command = 'xterm -T "SALOME %s - Shell session" -e %s/runSession &'%(version,kernel_appli_dir)
- elif os.path.exists("/usr/bin/gnome-terminal"):
- command = 'gnome-terminal -t "SALOME %s - Shell session" -e %s/runSession &'%(version,kernel_appli_dir)
+ if os.path.exists("/usr/bin/gnome-terminal"):
+ command = 'gnome-terminal -t "SALOME %s - Shell session" -e "%s/salome shell" &'%(version,kernel_appli_dir)
+ elif os.path.exists("/usr/bin/konsole"):
+ command = 'PATH="/usr/bin:/sbin:/bin" LD_LIBRARY_PATH="" konsole -e "%s/salome shell" &'%(kernel_appli_dir)
+ elif os.path.exists("/usr/bin/xterm"):
+ command = 'xterm -T "SALOME %s - Shell session" -e "%s/salome shell" &'%(version,kernel_appli_dir)
else:
- print "Neither xterm nor gnome-terminal is installed."
-
+ print "Neither xterm nor gnome-terminal nor konsole is installed."
+
if command is not "":
try:
subprocess.check_call(command, shell = True)