-------------------------------------- LIGHT module : README file -------------------------------------- Contents: 1. General description 2. Functionality 3. Implementation 4. Building 5. Launching ---------------------- 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: Root |__ Paragraph | |____ Text line | |____ Text line | |____ ... |__ Paragraph |__ Paragraph | |____ Text line | |____ ... |__ ... ---------------------- 2. 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 flie" : 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. 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. 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. ---------------------- 3. Implementation ---------------------- Here below is a short description of classes implemented in this package. * LIGHTGUI.h + LIGHTGUI.cxx : 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 parameter of the section. * LIGHTGUI_DataModel.h + LIGHTGUI_DataModel.cxx : 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. * LIGHTGUI_DataObject.h + LIGHTGUI_DataObject.cxx : 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. 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). * LIGHTGUI_DataOwner.h + LIGHTGUI_DataOwner.cxx : LIGHTGUI_DataOwner class : The instances of this class are engaged in the selection mechanism allowing the identification inherits SUIT_DataOwner : of the data objects. * LIGHTGUI_OBSelector.h + LIGHTGUI_OBSelector.cxx : 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 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 : * LIGHT_msg_en.po + LIGHT_images.po : : Text and graphic resources of the module.. ---------------------- 4. Building ---------------------- The building process of the LIGHT module is inherited from standard SALOME packages and includes the following steps: mkdir build_dir mkdir instal_dir cd build_dir cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=instal_dir ../src_dir make make install ---------------------- 5. Launching ---------------------- 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): ...
... The launch SALOME in a usual way: ${KERNEL_ROOT_DIR}/bin/salome/runSalome