Salome HOME
Merge branch 'V9_2_2_BR'
[samples/pylight.git] / README
1 ***************************
2 About SALOME PYLIGHT sample
3 ***************************
4
5 SALOME PYLIGHT module presents example of a simple SALOME module, implemented
6 with Python, without CORBA-engine; such type of module is called "light" in
7 SALOME.
8
9 This sample demonstrates a way to create a modules which have only GUI written
10 in Python but nevertheless can be integrated into SALOME platform.
11
12 This sample module is a simple text file reader. Each empty line read from the
13 file is presented in the data tree as the beginning of new paragraph; paragraph
14 can be empty. Non-empty line presents a "leaf" in the data tree.
15
16 Thus, the data tree hierarchy has tree levels:
17
18 Root
19   |__ Paragraph
20   |        |____ Text line
21   |        |____ Text line
22   |        |____ ...
23   |__ Paragraph
24   |__ Paragraph
25   |        |____ Text line
26   |        |____ ...
27   |__ ...
28
29 For more information about SALOME platform please visit the SALOME web site:
30
31   <http://www.salome-platform.org/>
32
33 =======
34 License
35 =======
36
37 SALOME platform is distributed under the GNU Lesser General Public License.
38 See COPYING file for more details.
39
40 Also, additional information can be found at SALOME platform web site:
41
42   <http://www.salome-platform.org/downloads/license/>
43
44 ============
45 Installation
46 ============
47
48 --------------
49 Pre-requisites
50 --------------
51
52 SALOME platform relies on a set of third-party softwares; some of them are needed
53 at build time only, while other ones are needed in runtime also.
54
55 For more information about the pre-requisites please visit SALOME platform web
56 site:
57
58 * Check Release Notes and Software Requirements of the latest SALOME release at
59
60   <http://www.salome-platform.org/downloads/current-version/>
61
62 * Pre-requisites page at SALOME web site:
63
64   <http://www.salome-platform.org/downloads/license/>
65
66 Note: SALOME PYLIGHT needs SALOME KERNEL and SALOME GUI as pre-requisites.
67
68 ------------------
69 Basic Installation
70 ------------------
71
72 The build procedure of the SALOME platform is implemented with CMake.
73 In order to build the module you have to do the following actions:
74
75 1. Set up environment for pre-requisites (see "Pre-requisites" section above).
76
77 2. Create a build directory:
78
79    % mkdir PYLIGHT_BUILD
80
81 3. Configure the build procedure:
82
83    % cd PYLIGHT_BUILD
84    % cmake -DCMAKE_BUILD_TYPE=<mode> -DCMAKE_INSTALL_PREFIX=<installation_directory> <path_to_src_dir>
85
86    where
87    - <mode> is either Release or Debug (default: Release);
88    - <installation_directory> is a destination folder to install SALOME PYLIGHT
89      module (default: /usr);
90    - <path_to_src_dir> is a path to the SALOME PYLIGHT sources directory.
91
92    Note: by default (if CMAKE_INSTALL_PREFIX option is not given), SALOME PYLIGHT
93    module will be configured for installation to the /usr directory that requires
94    root permissions to complete the installation.
95
96 4. Build and install:
97
98    % make
99    % make install
100
101    This will install SALOME PYLIGHT module to the <installation_directory>
102    specified to cmake command on the previous step.
103
104 -------------------
105 Custom installation
106 -------------------
107
108 SALOME PYLIGHT module supports a set of advanced configuration options;
109 for more details learn CMakeLists.txt file in the root source directory.
110
111 You can also use other options of cmake command to customize your installation.
112 Learn more about available options by typing
113
114    % cmake --help
115
116 =============
117 Functionality
118 =============
119
120 The functionality of the module is very similar to that one provided by
121 LIGHT module.
122
123 The module functionality includes the following user actions:
124
125 * "File" menu:
126
127   - "Load text file"       : reads and loads the contents of text file to the
128                              study; the previous contents of the data tree
129                              is erased.
130
131   - "Save text file"       : dumps the contents of the data tree to the text
132                              file.
133
134 * "PyLight" menu:
135
136   - "Insert Line"          : inserts new text line entered by the user to the
137                              end of selected paragraph.
138
139   - "Edit Line"            : allows user to edit selected text line.
140
141   - "Remove Lines" :       : removes selected line(s).
142
143   - "Clear All"            : clears contents of the data tree.
144
145   - "Display Line"         : displays selected line in the VTK 3D viewer.
146
147   - "Erase Line"           : erases selected line from the VTK 3D viewer.
148
149 Most of these actions change the contents of the internal data model, so the data
150 tree is rebuilt correspondingly.
151 Some of these commands are also avaiable via the context popup menu in the Object
152 Browser.
153
154 Saving/restoring of the data is performed by using of default SALOMEDS-based
155 persistence mechanism provided by SALOME GUI via embedded SalomeApp engine.
156
157 Note: after opening of the sudy file the PYLIGHT module data is not
158 immediately displayed in the Object Browser. To see it, you should activate the
159 module. Such behaviour takes place because the PYLIGHT module does not publish any
160 data directly in the SALOMEDS study - this is typical behavior of any "lighy"
161 SALOME module, imposed by limitation of SALOME platform.
162
163 =====
164 Usage
165 =====
166
167 Run SALOME with PYLIGHT module:
168
169 - In full, CORBA-based session:
170
171 runSalome --modules=PYLIGHT
172
173 - In "light" session:
174
175 runLightSalome.sh --modules=PYLIGHT
176
177 ===============
178 Troubleshooting
179 ===============
180
181 Please, send a mail to webmaster.salome@opencascade.com.