---------------------------------------
-LIGHT module : README file
---------------------------------------
+*************************
+About SALOME LIGHT sample
+*************************
-Contents:
+SALOME LIGHT module presents example of a simple SALOME module, implemented
+with C++, without CORBA-engine; such type of module is called "light" in SALOME.
+This sample demonstrates a way to create a modules which have only GUI library
+but nevertheless can be integrated into SALOME platform.
-1. General description
-2. Functionality
-3. Implementation
-4. Building
-5. Launching
+This sample module is a simple text file reader. Each empty line read from the
+file is presented in the data tree as the beginning of new paragraph; paragraph
+can be empty. Non-empty line presents a "leaf" in the data tree.
-----------------------
-1. General description
-----------------------
-
-The LIGHT module presents a simple no-CORBA-engine SALOME 3 compliant module.
-This module proposes a way how to create a modules which have only GUI library but nevertheless
-should be integrated into SALOME 3 CORBA-based architecture.
-
-The LIGHT module uses default SALOMEDS-based persistence mechanism provided by SALOME GUI library
-in order to store/load it's data.
-
-This sample module is a simple text file reader. Each empty line in the file read from the file
-is presented in the data tree as the beginning of new paragraph. Paragraphs can be empty.
-So the data tree hierarchy has tree levels:
+Thus, the data tree hierarchy has tree levels:
Root
|__ Paragraph
| |____ ...
|__ ...
+For more information about SALOME platform please visit the SALOME web site:
-----------------------
-2. Functionality
-----------------------
+ <http://www.salome-platform.org/>
-The module functionality includes the following user actions:
+=======
+License
+=======
-- "File" menu:
+SALOME platform is distributed under the GNU Lesser General Public License.
+See COPYING file for more details.
- - "Load text file" : reads and loads the contents of text file to the data model;
- the previous contents of data model is erased.
+Also, additional information can be found at SALOME platform web site:
- - "Save text flie" : dumps the contents of the data model to the text file.
+ <http://www.salome-platform.org/downloads/license/>
-- "LIGHT" menu:
+============
+Installation
+============
- - "Edit selected line" : allows user to edit the selected text line.
+--------------
+Pre-requisites
+--------------
- - "Insert new text line" : inserts the new text line entered by the user before the selected one;
- if there is no selection, new line is added to the end of the data tree.
+SALOME platform relies on a set of third-party softwares; some of them are needed
+at build time only, while other ones are needed in runtime also.
- - "Remove line" : removes the selected line.
+For more information about the pre-requisites please visit SALOME platform web
+site:
- - "Clear all" : clears all the contents of the data model.
+* Check Release Notes and Software Requirements of the latest SALOME release at
+
+ <http://www.salome-platform.org/downloads/current-version/>
+
+* Pre-requisites page at SALOME web site:
+
+ <http://www.salome-platform.org/downloads/license/>
+
+Note: SALOME LIGHT needs SALOME KERNEL and SALOME GUI as pre-requisites.
+
+------------------
+Basic Installation
+------------------
+
+The build procedure of the SALOME platform is implemented with CMake.
+In order to build the module you have to do the following actions:
+1. Set up environment for pre-requisites (see "Pre-requisites" section above).
-All these actions except saving of the text file change the structure of the underlying text file, so the data tree is
-rebuilt correspondingly.
-Some of these commands are also avaiable via the context popup menu for the selected in the Object Browser data objects.
+2. Create a build directory:
-Saving/restoring of the data is performed by using of default SALOMEDS-based persistence mechanism provided by SALOME GUI
-via embedded SalomeApp engine.
-Note: immediately after opening of the sudy file the LIGHT module data are not displayed in the Object Browser. To see it
-you should activate the module. Such behaviour takes place because the LIGHT module does not publish any data in the SALOMEDS study.
+ % mkdir LIGHT_BUILD
-----------------------
-3. Implementation
-----------------------
+3. Configure the build procedure:
-Here below is a short description of classes implemented in this package.
+ % cd LIGHT_BUILD
+ % cmake -DCMAKE_BUILD_TYPE=<mode> -DCMAKE_INSTALL_PREFIX=<installation_directory> <path_to_src_dir>
-* LIGHTGUI.h + LIGHTGUI.cxx :
+ where
+ - <mode> is either Release or Debug (default: Release);
+ - <installation_directory> is a destination folder to install SALOME LIGHT
+ module (default: /usr);
+ - <path_to_src_dir> is a path to the SALOME LIGHT sources directory.
-LIGHTGUI class : This class presents a GUI module itself, exported by the static function.
-inherits SalomeApp_Module : SALOME GUI application loads it when user activates the module by clicking the
- : corresponding button on the components toolbar.
- : The LIGHTGUI class is responsible for the creation of the data model. It creates
- : user actions and then dispatches them to the corresponding slots.
- : Method engineIOR() of this class returns empty string which means that this
- : module uses default persistence mechanism provided by the SALOME GUI via SalomeApp
- : engine (ensure that your configuration file SalomeApp.xml or .SalomeApprc.3.x.x
- : includes "SalomeAppEngine" module in the <embedded> parameter of the <launch> section.
+ Note: by default (if CMAKE_INSTALL_PREFIX option is not given), SALOME LIGHT
+ module will be configured for installation to the /usr directory that requires
+ root permissions to complete the installation.
-* LIGHTGUI_DataModel.h + LIGHTGUI_DataModel.cxx :
+4. Build and install:
-LIGHTGUI_DataModel class : This class defines an internal organization of the module's data and the way how these
-inherits SalomeApp_DataModel : data should be presented in the study (e.g. in the Object Browser). In addition this class
- : includes methods which modify the data tree: loading/saving of the text file,
- : inserting/removing of the text line, etc.
+ % make
+ % make install
-* LIGHTGUI_DataObject.h + LIGHTGUI_DataObject.cxx :
+ This will install SALOME LIGHT module to the <installation_directory>
+ specified to cmake command on the previous step.
-LIGHTGUI_DataObject class : This class presents an elementary unit of the data model. It includes presentation methods
-inherits CAM_DataObject : like: name(), icon(), toolTip(), etc.
- : Take an attention on the virtual inheritance of this class.
+-------------------
+Custom installation
+-------------------
-LIGHTGUI_ModuleObject class : This class presents a root object of the module's data tree.
-inherits LIGHTGUI_DataObject,: LIGHTGUI_ModuleObject inherits SUIT_DataObject through the different branches, so virtual
- CAM_RootObject : inheritance is needed here (see above).
+SALOME LIGHT module supports a set of advanced configuration options;
+for more details learn CMakeLists.txt file in the root source directory.
-* LIGHTGUI_DataOwner.h + LIGHTGUI_DataOwner.cxx :
+You can also use other options of cmake command to customize your installation.
+Learn more about available options by typing
-LIGHTGUI_DataOwner class : The instances of this class are engaged in the selection mechanism allowing the identification
-inherits SUIT_DataOwner : of the data objects.
+ % cmake --help
-* LIGHTGUI_OBSelector.h + LIGHTGUI_OBSelector.cxx :
+=============
+Functionality
+=============
+
+The module functionality includes the following user actions:
+
+* "File" menu:
+
+ - "Load text file" : reads and loads the contents of text file to the
+ data model; the previous contents of data model
+ is erased.
+
+ - "Save text file" : dumps the contents of the data model to the text
+ file.
+
+* "LIGHT" menu:
+
+ - "Edit selected line" : allows user to edit the selected text line.
+
+ - "Insert new text line" : inserts the new text line entered by the user before
+ the selected one; if there is no selection, new line
+ is added to the end of the data tree.
+
+ - "Remove line" : removes the selected line.
+
+ - "Clear all" : clears all the contents of the data model.
-LIGHTGUI_OBSelector class : This class allows the interacting with the LIGHT module's data objects in the Object Browser.
-inherits SUIT_Selector : When activating the LIGHT module replaces the Object Browser selector by it's own one and
- : restores the previous selector back when deactivating. The main goal of this class is to pick up
- : selected objects and notify the application when selection is changed by the user.
-* LIGHTGUI_Selection.h + LIGHTGUI_Selection.cxx
+Most of these actions change the contents of the internal data model, so the data
+tree is rebuilt correspondingly.
+Some of these commands are also avaiable via the context popup menu in the Object
+Browser.
-LIGHTGUI_Selection class : This class provides the methods of defining the context popup menu contents for the selected
-inherits Selection : objects by using of popup menu manager from the Qtx library.
- from QtxPopupMgr :
+Saving/restoring of the data is performed by using of default SALOMEDS-based
+persistence mechanism provided by SALOME GUI via embedded SalomeApp engine.
-* LIGHT_msg_en.po + LIGHT_images.po :
- : Text and graphic resources of the module..
+Note: after opening of the sudy file the LIGHT module data is not
+immediately displayed in the Object Browser. To see it, you should activate the
+module. Such behaviour takes place because the LIGHT module does not publish any
+data directly in the SALOMEDS study - this is typical behavior of any "lighy"
+SALOME module, imposed by limitation of SALOME platform.
-----------------------
-4. Building
-----------------------
+=====
+Usage
+=====
-The building process of the LIGHT module is inherited from standard SALOME packages and includes the following steps:
+Run SALOME with LIGHT module:
->> cd LIGHT_SRC
->> mkdir ../LIGHT_BUILD
->> cd ../LIGHT_BUILD
->> ../LIGHT_SRC/build_configure
->> ../LIGHT_SRC/configure [ configure-flags ]
->> make
->> make install (optional)
+- In full, CORBA-based session:
-----------------------
-5. Launching
-----------------------
+runSalome --modules=LIGHT
-Set the LIGHT_ROOT_DIR environment variable to point to your LIGHT module binary distribution.
-Then append the following parameters in your configuration file (SalomeApp.xml in ${GUI_ROOT_DIR}/share/salome/resources/gui
-folder or .SalomeApprc.3.x.x in your home directory, where 3.x.x is a your SALOME distribution version number):
+- In "light" session:
-...
-<section name="launch" >
- <parameter name="modules" value="LIGHT" />
-</section>
-<section name="resources" >
- <parameter name="LIGHT" value="${LIGHT_ROOT_DIR}/share/salome/resources/light" />
-</section>
-<section name="LIGHT" >
- <parameter name="name" value="Light" />
- <parameter name="icon" value="LIGHT.png" />
-</section>
-...
+runLightSalome.sh --modules=LIGHT
-The launch SALOME in a usual way:
+===============
+Troubleshooting
+===============
-${KERNEL_ROOT_DIR}/bin/salome/runSalome
+Please, send a mail to webmaster.salome@opencascade.com.