Salome HOME
761e70b62b64602ee208d86933374da16f7c5f5d
[modules/geom.git] / src / GEOM_SWIG / GEOM_example7.py
1 # Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # ---
21 #  File   : GEOM_example7.py
22 #  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
23 # ---
24 #
25 import os
26 import salome
27 salome.salome_init()
28 import GEOM
29 from salome.geom import geomBuilder
30 geompy = geomBuilder.New(salome.myStudy)
31
32 data_dir = os.getenv('DATA_DIR')
33 if data_dir:
34     texture_1 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture1.dat"))
35     texture_2 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture2.dat"))
36     texture_3 = geompy.LoadTexture(os.path.join(data_dir, "Textures", "texture3.dat"))
37     
38     Vertex_1 = geompy.MakeVertex(0, 0, 0)
39     Vertex_2 = geompy.MakeVertex(100, 0, 0)
40     Vertex_3 = geompy.MakeVertex(0, 100, 0)
41     Vertex_4 = geompy.MakeVertex(0, 0, 100)
42     Vertex_5 = geompy.MakeVertex(100, 0, 100)
43     Vertex_1.SetMarkerTexture(texture_1);
44     Vertex_2.SetMarkerTexture(texture_2);
45     Vertex_3.SetMarkerTexture(texture_3);
46     Vertex_4.SetMarkerStd(GEOM.MT_O_PLUS, GEOM.MS_25);
47     Vertex_5.SetMarkerStd(GEOM.MT_BALL,   GEOM.MS_40);
48     geompy.addToStudy( Vertex_1, "Vertex_1" )
49     geompy.addToStudy( Vertex_2, "Vertex_2" )
50     geompy.addToStudy( Vertex_3, "Vertex_3" )
51     geompy.addToStudy( Vertex_4, "Vertex_4" )
52     geompy.addToStudy( Vertex_5, "Vertex_5" )
53     pass