Salome HOME
Règles python - Fin
[modules/smesh.git] / src / Tools / blocFissure / gmu / triedreBase.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2021  EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 """Origine et vecteurs de base"""
21
22 import logging
23
24 from .geomsmesh import geompy
25 from .geomsmesh import geomPublish
26
27 from . import initLog
28
29 O = None
30 OX = None
31 OY = None
32 OZ = None
33
34 def triedreBase():
35   """
36   definitions globales du triedre de reference,
37   objets partages par plusieurs methodes
38   """
39   global O, OX, OY, OZ
40
41   if ( O is None ):
42     logging.info("start")
43     O = geompy.MakeVertex(0, 0, 0)
44     OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
45     OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
46     OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
47
48     if not geompy.myStudy.FindObjectByName( 'OX', geompy.ComponentDataType() ):
49       geomPublish(initLog.debug,  O, 'O' )
50       geomPublish(initLog.debug,  OX, 'OX' )
51       geomPublish(initLog.debug,  OY, 'OY' )
52       geomPublish(initLog.debug,  OZ, 'OZ' )
53
54   return O, OX, OY, OZ