Salome HOME
bos #29469: Advanced geometry features: Detect type of shape
[modules/geom.git] / src / GEOM_SWIG / GEOM_example7.py
index 23650e622ee66b83bf91fdcd72be793d66701022..428fcd0823496d9769c5cd083183687fbc68137a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2022  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
@@ -29,25 +29,23 @@ import GEOM
 from salome.geom import geomBuilder
 geompy = geomBuilder.New()
 
-data_dir = os.getenv('DATA_DIR')
-if data_dir:
-    texture_1 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture1.dat"))
-    texture_2 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture2.dat"))
-    texture_3 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture3.dat"))
-    
-    Vertex_1 = geompy.MakeVertex(0, 0, 0)
-    Vertex_2 = geompy.MakeVertex(100, 0, 0)
-    Vertex_3 = geompy.MakeVertex(0, 100, 0)
-    Vertex_4 = geompy.MakeVertex(0, 0, 100)
-    Vertex_5 = geompy.MakeVertex(100, 0, 100)
-    Vertex_1.SetMarkerTexture(texture_1);
-    Vertex_2.SetMarkerTexture(texture_2);
-    Vertex_3.SetMarkerTexture(texture_3);
-    Vertex_4.SetMarkerStd(GEOM.MT_O_PLUS, GEOM.MS_25);
-    Vertex_5.SetMarkerStd(GEOM.MT_BALL,   GEOM.MS_40);
-    geompy.addToStudy( Vertex_1, "Vertex_1" )
-    geompy.addToStudy( Vertex_2, "Vertex_2" )
-    geompy.addToStudy( Vertex_3, "Vertex_3" )
-    geompy.addToStudy( Vertex_4, "Vertex_4" )
-    geompy.addToStudy( Vertex_5, "Vertex_5" )
-    pass
+data_dir = os.path.join(os.getenv('GEOM_ROOT_DIR'), 'share', 'salome', 'resources', 'geom', 'textures')
+texture_1 = geompy.LoadTexture(os.path.join(data_dir, "texture1.dat"))
+texture_2 = geompy.LoadTexture(os.path.join(data_dir, "texture2.dat"))
+texture_3 = geompy.LoadTexture(os.path.join(data_dir, "texture3.dat"))
+
+Vertex_1 = geompy.MakeVertex(0, 0, 0)
+Vertex_2 = geompy.MakeVertex(100, 0, 0)
+Vertex_3 = geompy.MakeVertex(0, 100, 0)
+Vertex_4 = geompy.MakeVertex(0, 0, 100)
+Vertex_5 = geompy.MakeVertex(100, 0, 100)
+Vertex_1.SetMarkerTexture(texture_1);
+Vertex_2.SetMarkerTexture(texture_2);
+Vertex_3.SetMarkerTexture(texture_3);
+Vertex_4.SetMarkerStd(GEOM.MT_O_PLUS, GEOM.MS_25);
+Vertex_5.SetMarkerStd(GEOM.MT_BALL,   GEOM.MS_40);
+geompy.addToStudy( Vertex_1, "Vertex_1" )
+geompy.addToStudy( Vertex_2, "Vertex_2" )
+geompy.addToStudy( Vertex_3, "Vertex_3" )
+geompy.addToStudy( Vertex_4, "Vertex_4" )
+geompy.addToStudy( Vertex_5, "Vertex_5" )