Salome HOME
2b49cfdcc5589e108fd02e354af5e42cb0e3860e
[modules/geom.git] / src / GEOM_SWIG / GEOM_example7.py
1 # Copyright (C) 2007-2023  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()
31
32 data_dir = os.path.join(os.getenv('GEOM_ROOT_DIR'), 'share', 'salome', 'resources', 'geom', 'textures')
33 texture_1 = geompy.LoadTexture(os.path.join(data_dir, "texture1.dat"))
34 texture_2 = geompy.LoadTexture(os.path.join(data_dir, "texture2.dat"))
35 texture_3 = geompy.LoadTexture(os.path.join(data_dir, "texture3.dat"))
36
37 Vertex_1 = geompy.MakeVertex(0, 0, 0)
38 Vertex_2 = geompy.MakeVertex(100, 0, 0)
39 Vertex_3 = geompy.MakeVertex(0, 100, 0)
40 Vertex_4 = geompy.MakeVertex(0, 0, 100)
41 Vertex_5 = geompy.MakeVertex(100, 0, 100)
42 Vertex_1.SetMarkerTexture(texture_1);
43 Vertex_2.SetMarkerTexture(texture_2);
44 Vertex_3.SetMarkerTexture(texture_3);
45 Vertex_4.SetMarkerStd(GEOM.MT_O_PLUS, GEOM.MS_25);
46 Vertex_5.SetMarkerStd(GEOM.MT_BALL,   GEOM.MS_40);
47 geompy.addToStudy( Vertex_1, "Vertex_1" )
48 geompy.addToStudy( Vertex_2, "Vertex_2" )
49 geompy.addToStudy( Vertex_3, "Vertex_3" )
50 geompy.addToStudy( Vertex_4, "Vertex_4" )
51 geompy.addToStudy( Vertex_5, "Vertex_5" )