Salome HOME
merge BR_PORTING_OCCT_7
[modules/hydro.git] / doc / salome / examples / h007_createPolySplineClosed.py
1 # -*- coding: utf-8 -*-
2
3 import sys
4 import salome
5
6 salome.salome_init()
7 theStudy = salome.myStudy
8
9 from HYDROPy import *
10 from PyQt5.QtCore import *
11 from PyQt5.QtGui import *
12
13 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
14
15 hydro_doc.SetLocalCS( 0, 0 )
16
17 Polyline_1 = hydro_doc.CreateObject( KIND_POLYLINEXY )
18 Polyline_1.SetName( "Polyline_1" )
19
20 Polyline_1.SetZLevel( 0 )
21
22 Polyline_1.SetWireColor( QColor( 0, 0, 0, 255 ) )
23
24 Polyline_1.AddSection( "Section_1", 1, 1 )
25 Polyline_1.AddPoint( 0, gp_XY( -293.23, 276.54 ) )
26 Polyline_1.AddPoint( 0, gp_XY( -270.98, 163.29 ) )
27 Polyline_1.AddPoint( 0, gp_XY( -207.28, 251.26 ) )
28 Polyline_1.AddPoint( 0, gp_XY( -158.75, 160.26 ) )
29 Polyline_1.AddPoint( 0, gp_XY( -109.20, 131.95 ) )
30 Polyline_1.AddPoint( 0, gp_XY( -59.66, 126.90 ) )
31 Polyline_1.AddPoint( 0, gp_XY( -54.60, 187.56 ) )
32 Polyline_1.AddPoint( 0, gp_XY( -82.91, 220.93 ) )
33 Polyline_1.AddPoint( 0, gp_XY( 76.84, 251.27 ) )
34 Polyline_1.AddPoint( 0, gp_XY( -60.67, 285.65 ) )
35 Polyline_1.AddPoint( 0, gp_XY( -73.81, 330.13 ) )
36
37 Polyline_1.Update()
38
39
40
41 if salome.sg.hasDesktop():
42   salome.sg.updateObjBrowser(1)