Salome HOME
Moving to GUI module
[modules/geom.git] / src / GEOM_SWIG / GEOM_ObjectInfo.py
1 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
2 #
3 #  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5
6 #  This library is free software; you can redistribute it and/or 
7 #  modify it under the terms of the GNU Lesser General Public 
8 #  License as published by the Free Software Foundation; either 
9 #  version 2.1 of the License. 
10
11 #  This library is distributed in the hope that it will be useful, 
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 #  Lesser General Public License for more details. 
15
16 #  You should have received a copy of the GNU Lesser General Public 
17 #  License along with this library; if not, write to the Free Software 
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 #
23 #
24 #  File   : GEOM_ObjectInfo.py
25 #  Author : Michael ZORIN
26 #  Module : GEOM
27 #  $Header: 
28
29 import salome
30 import geompy
31
32 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
33
34 # Create several objects
35 obj1 = geompy.MakeVertex(0.,0.,0.)
36 obj2 = geompy.MakeCircleR(150.)
37 obj3 = geompy.MakeBoxDXDYDZ(300.,400.,500.)
38 obj4 = geompy.MakeCylinderRH(100.,200.)
39 ShapeListCompound = []
40 ShapeListCompound.append(obj3)
41 ShapeListCompound.append(obj4)
42 obj5 = geompy.MakeCompound(ShapeListCompound)
43
44 obj1_entry = geompy.addToStudy(obj1, "Object1")
45 obj2_entry = geompy.addToStudy(obj2, "Object2")
46 obj3_entry = geompy.addToStudy(obj3, "Object3")
47 obj4_entry = geompy.addToStudy(obj4, "Object4")
48 obj5_entry = geompy.addToStudy(obj5, "Object5")
49
50 # Get information about objects
51 hasInfo = geom.hasObjectInfo()
52 print "Check if GEOM module provides information about its objects: ", hasInfo
53 if hasInfo == True:
54     print "Information about first  object: ", geom.getObjectInfo(salome.myStudyId, obj1_entry) 
55     print "Information about second object: ", geom.getObjectInfo(salome.myStudyId, obj2_entry)
56     print "Information about third  object: ", geom.getObjectInfo(salome.myStudyId, obj3_entry)
57     print "Information about fourth object: ", geom.getObjectInfo(salome.myStudyId, obj4_entry)
58     print "Information about fifth  object: ", geom.getObjectInfo(salome.myStudyId, obj5_entry)
59
60 salome.sg.updateObjBrowser(1)