Salome HOME
Corrections of examples path after install with scbi
[modules/hydro.git] / doc / salome / examples / h001_importImage.py
1 # -*- coding: utf-8 -*-
2
3 import os
4 HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test")
5
6 import sys
7 import salome
8
9 salome.salome_init()
10
11 from HYDROPy import *
12 from PyQt5.QtCore import *
13 from PyQt5.QtGui import *
14
15 hydro_doc = HYDROData_Document.Document()
16
17 hydro_doc.SetLocalCS( 0, 0 )
18
19 garonne_ign_01 = hydro_doc.CreateObject( KIND_IMAGE )
20 garonne_ign_01.SetName( "garonne_ign_01" )
21
22 if not(garonne_ign_01.LoadImage( os.path.join(HYDRO_SAMPLES , "garonne_ign_01.png" ))):
23   raise ValueError('problem while loading image')
24
25 garonne_ign_01.SetLocalPoints( QPoint( 40, 817 ),
26                                QPoint( 1325, 85 ) )
27
28 garonne_ign_01.SetGlobalPoints( 1,
29                                 QPointF( 471562, 6.36775e+06 ),
30                                 QPointF( 489400, 6.37702e+06 ) )
31
32 garonne_ign_01.Update()
33
34 if salome.sg.hasDesktop():
35   salome.sg.updateObjBrowser()