Salome HOME
3fff5a702b7e4bd07fe4c520b6fd7e5144e66da9
[modules/hydro.git] / doc / salome / examples / h003_changeLCS.py
1 # -*- coding: utf-8 -*-
2
3 import os
4 HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO")
5
6 import sys
7 import salome
8
9 salome.salome_init()
10 theStudy = salome.myStudy
11
12 from HYDROPy import *
13 from PyQt5.QtCore import *
14 from PyQt5.QtGui import *
15
16 hydro_doc = HYDROData_Document.Document()
17
18 hydro_doc.SetLocalCS( 430000, 6.35e+06 )
19
20 garonne_ign_01 = hydro_doc.CreateObject( KIND_IMAGE )
21 garonne_ign_01.SetName( "garonne_ign_01" )
22
23 garonne_ign_01.SetZLevel( 0 )
24
25
26 if not(garonne_ign_01.LoadImage(os.path.join(HYDRO_SAMPLES, "garonne_ign_01.png" ))):
27   raise ValueError('problem while loading image')
28
29 garonne_ign_01.SetLocalPoints( QPoint( 40, 817 ),
30                                QPoint( 1325, 85 ) )
31
32 garonne_ign_01.SetGlobalPoints( 1,
33                                 QPointF( 471562, 6.36775e+06 ),
34                                 QPointF( 489400, 6.37702e+06 ) )
35
36 garonne_ign_01.Update()
37
38 garonne_ign_02 = hydro_doc.CreateObject( KIND_IMAGE )
39 garonne_ign_02.SetName( "garonne_ign_02" )
40
41 garonne_ign_02.SetZLevel( 1 )
42
43
44 if not(garonne_ign_02.LoadImage( os.path.join(HYDRO_SAMPLES, "garonne_ign_02.png" ))):
45   raise ValueError('problem while loading image')
46
47 garonne_ign_02.SetLocalPoints( QPoint( 1389, 447 ),
48                                QPoint( 784, 481 ) )
49
50 garonne_ign_02.SetGlobalPoints( 3,
51                                 QPointF( 631, 95 ),
52                                 QPointF( 26, 129 ) )
53 garonne_ign_02.SetTrsfReferenceImage( garonne_ign_01 )
54
55 garonne_ign_02.Update()
56
57 if salome.sg.hasDesktop():
58   salome.sg.updateObjBrowser()