|
<meshers-group name="MyName"Back to the contents
resources="MyResourceKey"
server-lib="libMyServerLib.so"
gui-lib="libMyClientLib.so">
<hypotheses>
<hypothesis type="MyHypType1"
label-id="My beautiful hypothesis name"
icon-id="my_hypo_1_icon.png"/>
</hypotheses>
<algorithms>
<algorithm type="MyAlgType1"
label-id="My beautiful algorithm name"
icon-id="my_algo_1_icon.png"/>
</algorithms>
</meshers-group>
- Attributes of <meshers-group> tag:
- value of <name> attribute is used to collect hypotheses/algoritms in groups; you can also use this attribute for short description of your mesher plugin.
- value of <resources> attribute (MyResourceKey) is used to access resources (messages and icons) from GUI (see paragraphs 2.4.2 and 2.5); in the current implementation it should coincide with the name of plugin package; this limitation will be eliminated in the further development.
- value of <server-lib> attribute describes the name of your mesher's server plugin library (See paragraph 2.3)
- value of <gui-lib> attribute describes the name of your mesher's client plugin library (See paragraph 2.4)
- Attributes of <hypothesis/algorithm> tag:
- value of <type> attribute is an unique name of the hypothesis/algorithm
- It is a value of _name field of your hypothesis class (see paragraph 2.3, implementation of constructor of StdMeshers_LocalLength class: _name = "LocalLength")
- It is a key to each certain hypothesis class (see paragraph 2.3, implementation of "GetHypothesisCreator()" method in StdMeshers_i.cxx)
- It is a key to each certain hypothesis GUI (see paragraph 2.4, implementation of "StdMeshersGUI_HypothesisCreator::CreateHypothesis()" and "StdMeshersGUI_HypothesisCreator::EditHypothesis()" methods in StdMeshersGUI.cxx)
- It is a key to each certain hypothesis icon in Object Browser (see paragraph 2.4.2.1)
Note: All attributes values are accessible in your GUI via HypothesisData class (see paragraph 2.4.1)
- value of <label-id> attribute is displayed in the GUI in the list of available hypotheses/algorithms ("Create Hypothesis/Algorithm" dialog)
- value of <icon-id> attribute is a name of icon file, which is displayed in GUI in the list of available hypotheses/algorithms ("Create Hypothesis/Algorithm" dialog)
Note: The environment variable SMESH_MeshersList contains the list of plugins names, separated by colon (":") symbol, e.g.:
setenv SMESH_MeshersList StdMeshers:NETGENPlugin
Please, pay attention that StdMeshers should also be included into this environment variable, if you want to use standard hypotheses/algorithms, provided with SMESH module.
The SALOME automatically locates XML files, searching them in the following directories:
${<PLUGINNAME>_ROOT_DIR}/share/salome/resources
${SALOME_<PluginName>Resources}
${HOME}/.salome/resources
${KERNEL_ROOT_DIR}/share/salome/resources
where <PluginName> is a name of each mesher plugin package
Example: SMESH_SRC/idl/SMESH_BasicHypothesis.idl
NETGENPLUGIN_SRC/src/NETGENPlugin_Algorithm.idl
Inherit corresponding classes from SMESH.Example: SMESH_SRC/src/StdMeshers/StdMeshers_*
NETGENPLUGIN_SRC/src/NETGENPlugin_NETGEN_3D
Inherit corresponding classes from SMESH_I.Example: SMESH_SRC/src/StdMeshers_I/SMESH_*_i
NETGENPLUGIN_SRC/src/NETGENPlugin_NETGEN_3D_i
GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypType)<aHypType> is a value of <type> attribute in the XML-description file
Example: SMESH_SRC/src/StdMeshers_I/StdMeshers_i.cxxBack to the contents
NETGENPLUGIN_SRC/src/NETGENPlugin_i.cxx
This step is required only if your hypotheses/algorithms need specific GUI for their construction.
Example: SMESH_SRC/src/StdMeshersGUI/StdMeshersGUI_*DlgNote: all data from XML-description files is accessible in your GUI via HypothesisData class (mySMESHGUI->GetHypothesisData (aHypType), see SMESHGUI_Hypotheses.h for HypothesisData definition)
MyResourceKey_icons.po and MyResourceKey_msg_en.poExample: SMESH_SRC/src/StdMeshersGUI/StdMeshers_*.po
NETGENPLUGIN_SRC/src/NETGENPlugin_icons.po
Note: ICON_SMESH_TREE_HYPO_MyHypType1 is ID of icon for Object Browser for hypothesis with type="MyHypType1"; ICON_SMESH_TREE_ALGO_MyAlgType1 is ID of icon for Object Browser for algorithm with type="MyAlgType1".
See paragraph 2 for definition of MyResourceKey, MyHypType1, MyAlgType1.
It should point to the directory where resources are situated.
Example: setenv SALOME_StdMeshersResources ${SMESH_ROOT_DIR}/share/salome/resources
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreatorBack to the contents
(QString aHypType, QString aServerLibName, SMESHGUI* aSMESHGUI)<aHypType> is to pass a value of <type> attribute in XML-description file;
<aServerLibName> is to pass a value of <server-lib> attribute in XML-description file.Example: SMESH_SRC/src/StdMeshersGUI/StdMeshersGUI.cxx
If your hypotheses/algorithms do not need specific GUI, but you want to provide icons for object browser, see 2.4.2 paragrath.
setenv PATH <path-to-my-plugin>/bin/salome:${PATH}
setenv LD_LIBRARY_PATH <path-to-my-plugin>/lib/salome:${LD_LIBRARY_PATH}
Setenv PYTHONPATH <path-to-my-plugin>/lib/python2.2/site-packages/salome:${PYTHONPATH}
This enviroment variable is used to set meshers plugins which should be loaded by SMESH module (see 2.4.2.2 paragraph). Add your plugin to this variable. All plugins are separated by colon (":") symbol.Back to the contents
Note: If you use runSalome.py script from KERNEL package to launch SALOME, you may not to set environment variables, because this script sets them itself. All what you should do is to add <plugin> section to your ${HOME}/.salome/salome.launch file for SMESH module section:
...
<modules-list>
...
<module name="SMESH">
<plugin name="MyMesher"/>
</module>
...
</modules-list>
...