Salome HOME
Updated copyright comment
[modules/kernel.git] / src / KERNEL_PY / Help.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
3 #
4 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23
24 #  File   : Help.py
25 #  Author : Paul RASCLE, EDF
26 #  Module : SALOME
27 #  $Header$
28 #
29 class SalomeDoc:
30     def __init__(self, aDoc):
31         self.doc = aDoc
32     def __repr__(self):
33         print(self.doc)
34         return "---"
35     def salome(self):
36         doc_salome = '''
37 MODULE : salome
38 ---------------
39 module salome gives access to Salome resources:
40 variables:
41
42   salome.orb             : CORBA
43   salome.naming_service  : instance of naming Service class
44       methods:
45           Resolve(name)  : find a CORBA object (ior) by its pathname
46           Register(name) : register a CORBA object under a pathname
47   salome.lcc             : instance of lifeCycleCORBA class
48       methods:
49           FindOrLoadComponent(server,name) :
50                            obtain an Engine (CORBA object)
51                            or launch the Engine if not found,
52                            with a Server name and an Engine name
53   salome.sg
54       methods:
55          updateObjBrowser():
56          getStudyName():
57          
58          SelectedCount():      returns number of selected objects
59          getSelected(i):       returns entry of selected object number i
60          getAllSelected():     returns list of entry of selected objects
61          AddIObject(Entry):    select an existing Interactive object
62          RemoveIObject(Entry): remove object from selection
63          ClearIObjects():      clear selection
64          
65          Display(*Entry):
66          DisplayOnly(Entry):
67          Erase(Entry):
68          DisplayAll():
69          EraseAll():
70
71          IDToObject(Entry):    returns CORBA reference from entry
72
73   salome.myStudyName     : the Study Name
74   salome.myStudy         : the active Study itself (CORBA ior)
75                            methods : defined in SALOMEDS.idl
76                                                          
77 methods:
78   salome.DumpStudy() : Dump a study, given the ior
79 ---
80 '''
81         print(doc_salome)
82         
83     def geompy(self):
84         doc_geompy = '''
85 MODULE : geompy
86 ---------------
87 module geompy provides an encapsulation of GEOM Engine methods
88 variables:
89   geompy.geom               : a Geometry Engine, found or loaded
90                               at first import of module geompy.
91                               methods : defined in GEOM_Gen.idl
92   geompy.myBuilder          : a study builder
93   geompy.father             : GEOM root in current study (salome.myStudy)
94
95 methods:
96   addToStudy(aShape, aName) : add the shape into the current study
97   --- all methods of GEOM_Gen.idl that returns a shape are encapsulated,
98       with the same interface : shapes are named with their ior
99 '''
100         print(doc_geompy)
101         
102     def supervision(self):
103         doc_supervision = '''
104 MODULES : SALOME_SuperVisionEditor and SALOME_SuperVisionExecutor
105 -----------------------------------------------------------------
106 this modules provide access to Editor and Executor Engine methods
107
108 See SUPERV.idl
109
110 In order to run the example (supervisionexample.py)
111
112     Type : from supervisionexample import *
113            supervisionexample.py contains comments
114
115 A new python example avoids references to LifeCycleCORBA
116                      avoids references to NamingService
117                      avoids references to ModuleCatalog
118                      avoids SuperVisionComponent creation
119                      allows G.Input(...) instead of AddInput(G,...)
120                      replaces Editor/Executor with Graph
121                      allows Nodes, Ports and Links CORBA objects
122                      shortens methods names
123                      ...
124
125     See /SuperVisionTest/resources/GraphExample.py
126                                    and GraphExample.xml
127 ---
128 '''
129         print(doc_supervision)
130         
131     
132
133 Help = SalomeDoc('''
134 Availables modules:
135   salome      : gives access to Salome resources
136   geompy      : encapsulation of GEOM Engine methods
137   supervision : gives access to SuperVision Engine
138 To obtain specific help on a module "truc", type: Help.truc()
139 To run an example, type: import example3
140 ''')
141