Back to index

salome-geom  6.5.0
GEOM_ObjectInfo.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # This library is free software; you can redistribute it and/or
00005 # modify it under the terms of the GNU Lesser General Public
00006 # License as published by the Free Software Foundation; either
00007 # version 2.1 of the License.
00008 #
00009 # This library is distributed in the hope that it will be useful,
00010 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 # Lesser General Public License for more details.
00013 #
00014 # You should have received a copy of the GNU Lesser General Public
00015 # License along with this library; if not, write to the Free Software
00016 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 #
00018 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 #
00020 
00021 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
00022 #  File   : GEOM_ObjectInfo.py
00023 #  Author : Michael ZORIN
00024 #  Module : GEOM
00025 #  $Header: 
00026 #
00027 import salome
00028 import geompy
00029 
00030 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
00031 
00032 # Create several objects
00033 obj1 = geompy.MakeVertex(0.,0.,0.)
00034 obj2 = geompy.MakeCircleR(150.)
00035 obj3 = geompy.MakeBoxDXDYDZ(300.,400.,500.)
00036 obj4 = geompy.MakeCylinderRH(100.,200.)
00037 ShapeListCompound = []
00038 ShapeListCompound.append(obj3)
00039 ShapeListCompound.append(obj4)
00040 obj5 = geompy.MakeCompound(ShapeListCompound)
00041 
00042 obj1_entry = geompy.addToStudy(obj1, "Object1")
00043 obj2_entry = geompy.addToStudy(obj2, "Object2")
00044 obj3_entry = geompy.addToStudy(obj3, "Object3")
00045 obj4_entry = geompy.addToStudy(obj4, "Object4")
00046 obj5_entry = geompy.addToStudy(obj5, "Object5")
00047 
00048 # Get information about objects
00049 hasInfo = geom.hasObjectInfo()
00050 print "Check if GEOM module provides information about its objects: ", hasInfo
00051 if hasInfo == True:
00052     print "Information about first  object: ", geom.getObjectInfo(salome.myStudyId, obj1_entry) 
00053     print "Information about second object: ", geom.getObjectInfo(salome.myStudyId, obj2_entry)
00054     print "Information about third  object: ", geom.getObjectInfo(salome.myStudyId, obj3_entry)
00055     print "Information about fourth object: ", geom.getObjectInfo(salome.myStudyId, obj4_entry)
00056     print "Information about fifth  object: ", geom.getObjectInfo(salome.myStudyId, obj5_entry)
00057 
00058 salome.sg.updateObjBrowser(1)