WITH_BATCH=no
test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes
+
+AC_ARG_ENABLE(batch,
+ [AC_HELP_STRING([--enable-batch],[Batch [default=yes]])],
+ [case "${enableval}" in
+ yes) test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes;;
+ no) WITH_BATCH=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-batch) ;;
+ esac],[test x$openpbs_ok = xyes || test x$lsf_ok = xyes || test x$localbatch_ok = xyes && WITH_BATCH=yes])
+
+echo Batch mode = $WITH_BATCH
+
AC_SUBST(WITH_BATCH)
AM_CONDITIONAL(WITH_BATCH, [test x"$WITH_BATCH" = xyes])
# --------------------------------------
-basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok occ_ok"
+if test x$corba_gen = xtrue; then
+ basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok occ_ok"
+else
+ basic_mandatory_products="cc_ok threads_ok python_ok hdf5_ok occ_ok"
+fi
+
echo --- General mandatory products - Light configuration:
summary $basic_mandatory_products
check_fatal_error $basic_mandatory_products
rst2html doc.txt > doc.html
-This document corresponds to SALOME2 3.1. (alpha version)
+This document corresponds to SALOME2 3.2. (alpha version)
+-------------------------------------------+
| **WORK in PROGRESS, INCOMPLETE DOCUMENT** |
Application Directory
---------------------
+Two ways for creation of an application directory
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+First way - references to different module directories
+''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
The script createAppli.sh in ${KERNEL_ROOT_DIR}/bin/salome creates an
application directory with the given path in parameter. ${APPLI} is a path
relative to ${HOME}.
- CatalogResources.xml
- SalomeApp.xml
+Second way - one single virtual install directory
+'''''''''''''''''''''''''''''''''''''''''''''''''
+
+The user must create an application directory in which he copies
+appli_install.sh, appli_clean.sh and virtual_salome.py,
+from ${KERNEL_ROOT_DIR}/bin/salome.
+
+appli_install.sh needs to be edited, to define a list of modules with their
+install paths.
+Then, the script appli_install.sh creates a virtual installation of SALOME
+in the application directory (bin, lib, doc, share...), with,
+for each file (executable, script, data,library, resources...),
+symbolic links to the actual file.
+
+General rules
+-------------
+
Directory ${APPLI} must be created on each computer of the application.
The easiest way is to use the same relative path (to ${HOME}) on each computer.
(Sometimes it is not possible to use the same path everywhere, for instance
scripts must be configured (by the user) on each computer. All the environment
scripts are in the ${APPLI}/env.d directory.
-The script ${APPLI}/envd sources **all** the files in ${APPLI}/env.d in
+The script ${APPLI}/envd sources **all** the files (\*.sh) in ${APPLI}/env.d in
alphanumeric order (after edition, think to remove backup files). the envd
script is used by run scripts.
-Proposal for env.d scripts
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+env.d scripts
+~~~~~~~~~~~~~
+
Each user **must define** his own configuration for these scripts, following
-the above rules. **The following is only an example not working as it is**.
+the above rules. With the virtual installation (second way, above), env.d
+scripts are built by appli_install.sh (given it's parameters). Otherwise, the
+scripts must be manually defined.
+
+
+ **The following is only an example proposed by createAppli.sh,
+ not working as it is**.
atFirst.sh
Sets the computer configuration not directly related to SALOME,
runSession
Launches a shell script in the SALOME application environment, with access
- to the current SALOME session (naming service), if any.
+ to the current (last launched) SALOME session (naming service), if any.
Without arguments, the script is interactive. With arguments, the script
executes the command in the SALOME application environment.
This file is similar to the default given
in ${GUI_ROOT_DIR}/share/salome/resources
+
CatalogRessources.xml
This files describes all the computer the application can use. The given
example is minimal and suppose ${APPLI} is the same relative path
appliPath="my/specific/path/on/this/computer"
+Examples of use
+---------------
+
+Launch a SALOME session with a GUI interface
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launch is done with a command like::
+
+ ./runAppli --logger
+
+The --logger option means here : collect all the traces from the all the
+distributed process, via CORBA, in a single file : logger.log.
+
+There are a lot of options, a complete list is given by::
+
+ ./runAppli --help
+
+Note that, without argument, runAppli is a non interactive Python application,
+and, with arguments, runAppli is an interactive Python interpreter.
+
+Several options are already defined by default in SalomeApp.xml files. Optional
+arguments given in the command override the SalomeApp.xml configuration.
+
+Several sessions can run simultaneously, each session use a different port for
+CORBA naming service, so the sessions are totally separated from each other.
+
+When the GUI is closed, the different SALOME servers are still running.
+
+Close a SALOME session, kill all the servers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Inside the interactive python interpreter you get when you use runAppli
+with arguments, you can kill all the servers of your session with::
+
+ >>> killLocalPort()
+
+or the servers of all the sessions with::
+
+ >>> killAllPorts()
+
+If you have no active Python interpreter connected to your session, you can
+kill all the SALOME servers of **all the sessions** on a given computer::
+
+ ./runSession killSalome.py
+
+Remember! it's the same in *Windows (R) operating system* [#]_ :
+use the start menu to stop...
+
+When you use only one session at a time, you don't need more.
+
+To kill a given session (when several session are running), one needs
+the naming service port number::
+
+ ./runSession killSalomeWithPort 2810
+
+Note that the port number of the last launched session can be found on Linux,
+in the prompt, within a runSession shell (see below).
+
+It is also possible to get the Naming Service host and port number of
+the last launched session with::
+
+ ./runSession NSparam.py
+
+.. [#] Microsoft and Windows are either registered trademarks or trademarks of
+ Microsoft Corporation in the United States and/or other countries.
+
+Different uses of the runSession shell interpreter
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+runSession invoked without arguments gives an interactive shell with the full
+environment of SALOME (PATH, LD_LIBRARY_PATH, PYTHONPATH, other variables).
+If there are running sessions of the same SALOME application, runSession
+connects to the last launched session (i.e. gets the naming service references
+of the session: hostname and port)
+
+On Linux, the shell prompt (bash) gives information on naming service
+references, hostname and port::
+
+ [NS=cli76cc:2811]prascle@cli76cc:~/SALOME2/Run/Virtual$
+
+If there is no running session, prompt looks like::
+
+ [NS=:]prascle@cli76cc:~/SALOME2/Run/Virtual$
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = ../../../share/salome/idl/SALOME_ModuleCatalog.idl \
- ../../../share/salome/idl/SALOMEDS.idl \
- ../../../share/salome/idl/SALOME_Exception.idl \
- ../../../share/salome/idl/SALOMEDS_Attributes.idl \
- ../../../share/salome/idl/SALOME_Component.idl \
- ../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx \
- ../../../share/salome/src/NamingService/SALOME_NamingService.hxx \
- ../../../share/salome/src/NamingService/SALOME_NamingService.cxx \
- ../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
-FILE_PATTERNS =
-RECURSIVE = NO
+INPUT = ../../../../share/salome/idl/SALOME_ModuleCatalog.idl \
+ ../../../../share/salome/idl/SALOMEDS.idl \
+ ../../../../share/salome/idl/SALOME_Exception.idl \
+ ../../../../share/salome/idl/SALOMEDS_Attributes.idl \
+ ../../../../share/salome/idl/SALOME_Component.idl \
+ ../../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx \
+ ../../../../share/salome/src/NamingService/SALOME_NamingService.hxx \
+ ../../../../share/salome/src/NamingService/SALOME_NamingService.cxx \
+ ../../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx \
+ ../../../../build/salome/bin/salome \
+ ../../../../build/salome/src/Batch_SWIG \
+ ../../../../build/salome/src/Communication_SWIG \
+ ../../../../build/salome/src/LifeCycleCORBA_SWIG \
+ ../../../../build/salome/src/LifeCycleCORBA_SWIG \
+ ../../../../build/salome/src/NOTIFICATION_SWIG
+FILE_PATTERNS = *.idl *.hxx *.cxx python_extension_must_be_here
+RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
cp -fr $(srcdir)/KERNEL ./INPUT; \
cd INPUT; \
sed 's|../../../share/salome|@top_srcdir@|' ./doxyfile > ./doxyfile1; \
+ sed 's|../../../build/salome|@top_builddir@|' ./doxyfile1 > ./doxyfile2; \
+ mv -f doxyfile2 doxyfile1; \
+ echo "DOXYGEN SUPPORT PYTHON - $(DOXYGEN_WITH_PYTHON)"; \
+ if( test "x$(DOXYGEN_WITH_PYTHON)" = "xyes"); then \
+ sed 's|python_extension_must_be_here|*.py|' ./doxyfile1 > ./doxyfile2; \
+ mv -f doxyfile2 doxyfile1; \
+ $(DOXYGEN) -u ./doxyfile1; \
+ else \
+ sed 's|python_extension_must_be_here||' ./doxyfile1 > ./doxyfile2; \
+ mv -f doxyfile2 doxyfile1; \
+ fi; \
+ if( test "x$(DOXYGEN_WITH_STL)" = "xyes"); then \
+ sed -e 's|BUILTIN_STL_SUPPORT = NO|BUILTIN_STL_SUPPORT = YES|' ./doxyfile1 > ./doxyfile2; \
+ mv -f doxyfile2 doxyfile1; \
+ fi; \
mv -f doxyfile1 doxyfile; \
$(DOXYGEN) ./doxyfile; \
cd ..;
- $(INSTALL) -d $(docdir)/tui/KERNEL;
+ $(INSTALL) -d $(docdir)/tui/KERNEL;
+ cp -fr KERNEL $(docdir)/tui
cp -fr $(srcdir)/KERNEL/sources/static/*.* $(docdir)/tui/KERNEL;
cp -fr $(srcdir)/KERNEL/sources/ $(docdir)/tui/KERNEL;
cp -fr $(srcdir)/KERNEL/HTML/ $(docdir)/tui/KERNEL;
#include "SALOME_Component.idl"
-module SuperVisionTest {
+module CatalogTest {
interface Adder ;
AC_MSG_WARN(doxygen not found)
doxygen_ok=no
fi
+if test "x$doxygen_ok" = "xyes"
+then
+ version=`$DOXYGEN --version`
+ AC_MSG_RESULT(doxygen version $version)
+ case "$version" in
+ 1.4.4*)
+ DOXYGEN_WITH_PYTHON=yes
+ DOXYGEN_WITH_STL=no
+ ;;
+ 1.4.5*)
+ DOXYGEN_WITH_PYTHON=yes
+ DOXYGEN_WITH_STL=yes
+ ;;
+ 1.4.6*)
+ DOXYGEN_WITH_PYTHON=yes
+ DOXYGEN_WITH_STL=yes
+ ;;
+ 1.4.7*)
+ DOXYGEN_WITH_PYTHON=yes
+ DOXYGEN_WITH_STL=yes
+ ;;
+ 1.4.8*)
+ DOXYGEN_WITH_PYTHON=yes
+ DOXYGEN_WITH_STL=yes
+ ;;
+ 1.4.9*)
+ DOXYGEN_WITH_PYTHON=yes
+ DOXYGEN_WITH_STL=yes
+ ;;
+ [1-9].[5-9]*)
+ DOXYGEN_WITH_PYTHON=yes
+ DOXYGEN_WITH_STL=yes
+ ;;
+ *)
+ DOXYGEN_WITH_PYTHON=no
+ DOXYGEN_WITH_STL=no
+ ;;
+ esac
+ AC_MSG_RESULT(doxygen with support STL - $DOXYGEN_WITH_STL)
+ AC_MSG_RESULT(doxygen with support PYTHON - $DOXYGEN_WITH_PYTHON)
+ AC_SUBST(DOXYGEN_WITH_PYTHON)
+ AC_SUBST(DOXYGEN_WITH_STL)
+fi
dnl AC_SUBST(DOXYGEN)
graphviz_ok=yes
SALOMEDS_TMPFile_i.hxx
libSalomeDS_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDS_la_LDFLAGS = -no-undefined -version-info=0:0:0
+libSalomeDS_la_LDFLAGS = -Wl,-E -no-undefined -version-info=0:0:0 @LDEXPDYNFLAGS@
libSalomeDS_la_LIBADD = $(COMMON_LIBS)
#
// Module : SALOME
// $Header$
-#ifndef WNT
+#ifdef WNT
#include <SALOMEDS.hxx>
#include <SALOMEDS_StudyManager.hxx>
#include <SALOMEDS_Study.hxx>
#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDS_StudyBuilder.hxx>
#include <SALOMEDS_SComponent.hxx>
#include <SALOMEDSClient.hxx>
+#include <SALOMEDSClient_IParameters.hxx>
+#include <SALOMEDS_IParameters.hxx>
#include <SALOMEDS_StudyManager_i.hxx>
#else
#include "SALOMEDS.hxx"
#include "SALOMEDS_StudyManager.hxx"
#include "SALOMEDS_Study.hxx"
+#include "SALOMEDS_StudyBuilder.hxx"
#include "SALOMEDS_SObject.hxx"
#include "SALOMEDS_SComponent.hxx"
#include "SALOMEDSClient.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
+#include "SALOMEDS_IParameters.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
#endif
// IDL headers
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)
+#include <SALOME_NamingService.hxx>
using namespace SALOMEDS;
SALOMEDSClient_Study* StudyFactory(SALOMEDS::Study_ptr theStudy)
{
+ if(CORBA::is_nil(theStudy)) return NULL;
return new SALOMEDS_Study(theStudy);
}
SALOMEDSClient_SObject* SObjectFactory(SALOMEDS::SObject_ptr theSObject)
{
+ if(CORBA::is_nil(theSObject)) return NULL;
return new SALOMEDS_SObject(theSObject);
}
SALOMEDSClient_SComponent* SComponentFactory(SALOMEDS::SComponent_ptr theSComponent)
{
+ if(CORBA::is_nil(theSComponent)) return NULL;
return new SALOMEDS_SComponent(theSComponent);
}
+SALOMEDSClient_StudyBuilder* BuilderFactory(SALOMEDS::StudyBuilder_ptr theBuilder)
+{
+ if(CORBA::is_nil(theBuilder)) return NULL;
+ return new SALOMEDS_StudyBuilder(theBuilder);
+}
+
SALOMEDSClient_StudyManager* CreateStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
{
- SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, root_poa);
- // Activate the objects. This tells the POA that the objects are ready to accept requests.
- PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i);
- aStudyManager_i->register_name("/myStudyManager");
+ cout << "############## CreateStudyManager" << endl;
+ SALOME_NamingService namingService(orb);
+ CORBA::Object_var obj = namingService.Resolve( "/myStudyManager" );
+ SALOMEDS::StudyManager_var theManager = SALOMEDS::StudyManager::_narrow( obj );
+ if( CORBA::is_nil(theManager) ) {
+ SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, root_poa);
+ // Activate the objects. This tells the POA that the objects are ready to accept requests.
+ PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i);
+ aStudyManager_i->register_name("/myStudyManager");
+ }
return new SALOMEDS_StudyManager();
}
+SALOMEDSClient_IParameters* GetIParameters(const _PTR(AttributeParameter)& ap)
+{
+ return new SALOMEDS_IParameters(ap);
+}
+
+
+SALOMEDS::SObject_ptr ConvertSObject(const _PTR(SObject)& theSObject)
+{
+
+ SALOMEDS_SObject* so = _CAST(SObject, theSObject);
+ if(!theSObject || !so) return SALOMEDS::SObject::_nil();
+ return so->GetSObject();
+}
+
+SALOMEDS::Study_ptr ConvertStudy(const _PTR(Study)& theStudy)
+{
+ SALOMEDS_Study* study = _CAST(Study, theStudy);
+ if(!theStudy || !study) return SALOMEDS::Study::_nil();
+ return study->GetStudy();
+}
+
+SALOMEDS::StudyBuilder_ptr ConvertBuilder(const _PTR(StudyBuilder)& theBuilder)
+{
+ SALOMEDS_StudyBuilder* builder = _CAST(StudyBuilder, theBuilder);
+ if(!theBuilder || !builder) return SALOMEDS::StudyBuilder::_nil();
+ return builder->GetBuilder();
+}
+
+
}
#include <map>
#include "SALOMEDSClient.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
/*!
Class which an interface to store the parameters of the objects
*/
-class SALOMEDS_IParameters
+class SALOMEDS_IParameters: public SALOMEDSClient_IParameters
{
public:
SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap);
/*!
Enables/Disables the dumping visual parameters
*/
- static void setDumpPython(_PTR(Study) study, const std::string& theID = "");
+ virtual void setDumpPython(_PTR(Study) study, const std::string& theID = "");
/*!
Returns whether there is the dumping visual parameters
*/
- static bool isDumpPython(_PTR(Study) study, const std::string& theID = "");
+ virtual bool isDumpPython(_PTR(Study) study, const std::string& theID = "");
/*!
Returns a default name of the component where the visula parameters are stored.
*/
- static std::string getDefaultVisualComponent();
+ virtual std::string getDefaultVisualComponent();
private:
_PTR(AttributeParameter) _ap;
SALOMEDS::SComponent_ptr SALOMEDS_SComponent::GetSComponent()
{
- if (_isLocal) {
- if (!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
- SALOMEDS::SComponent_var aSCO =
- SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()), _orb);
+ if(_isLocal) {
+ if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_duplicate(SALOMEDS::SComponent::_narrow(GetCORBAImpl()));
+ SALOMEDS::SComponent_var aSCO = SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()), _orb);
+ _corba_impl = SALOMEDS::SComponent::_duplicate(aSCO);
return aSCO._retn();
}
else {
- return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
+ return SALOMEDS::SComponent::_duplicate(SALOMEDS::SComponent::_narrow(GetCORBAImpl()));
}
-
return SALOMEDS::SComponent::_nil();
}
#include "SALOMEDS_SComponent.hxx"
#include "SALOMEDS_GenericAttribute.hxx"
#include "SALOMEDS_Study.hxx"
+#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDSImpl_SComponent.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
SALOMEDS::SObject_ptr SALOMEDS_SObject::GetSObject()
{
if(_isLocal) {
- if(!CORBA::is_nil(_corba_impl)) return _corba_impl;
+ if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SObject::_duplicate(_corba_impl);
SALOMEDS::SObject_var aSO = SALOMEDS_SObject_i::New(_local_impl, _orb);
+ _corba_impl = SALOMEDS::SObject::_duplicate(aSO);
return aSO._retn();
}
else {
- return _corba_impl;
+ return SALOMEDS::SObject::_duplicate(_corba_impl);
}
return SALOMEDS::SObject::_nil();
}
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)
-#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDSImpl_SObject.hxx"
class Standard_EXPORT SALOMEDS_SObject: public virtual SALOMEDSClient_SObject
if (_isLocal) {
SALOMEDS::Locker lock;
- if (!CORBA::is_nil(_corba_impl)) return _corba_impl;
+ if (!CORBA::is_nil(_corba_impl)) return SALOMEDS::Study::_duplicate(_corba_impl);
std::string anIOR = _local_impl->GetTransientReference().ToCString();
SALOMEDS::Study_var aStudy;
if (!_local_impl->IsError() && anIOR != "") {
aStudy = aStudy_servant->_this();
_local_impl->SetTransientReference(_orb->object_to_string(aStudy));
}
+ _corba_impl = SALOMEDS::Study::_duplicate(aStudy);
return aStudy._retn();
}
else {
- return _corba_impl;
+ return SALOMEDS::Study::_duplicate(_corba_impl);
}
return SALOMEDS::Study::_nil();
}
+
_PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID, int theSavePoint)
{
SALOMEDSClient_AttributeParameter* AP = NULL;
#include "SALOMEDS_SComponent.hxx"
#include "SALOMEDS_GenericAttribute.hxx"
#include "SALOMEDS_StudyManager.hxx"
+#include "SALOMEDS_StudyBuilder_i.hxx"
#include "SALOMEDS_Driver_i.hxx"
else _corba_impl->SetIOR(aSO->GetCORBAImpl(), (char*)theValue.c_str());
}
+SALOMEDS::StudyBuilder_ptr SALOMEDS_StudyBuilder::GetBuilder()
+{
+ if(_isLocal) {
+ if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::StudyBuilder::_duplicate(_corba_impl);
+ SALOMEDS_StudyBuilder_i* servant = new SALOMEDS_StudyBuilder_i(_local_impl, _orb);
+ SALOMEDS::StudyBuilder_var aBuilder = servant->StudyBuilder::_this();
+ _corba_impl = SALOMEDS::StudyBuilder::_duplicate(aBuilder);
+ return aBuilder._retn();
+ }
+ else {
+ return SALOMEDS::StudyBuilder::_duplicate(_corba_impl);
+ }
+ return SALOMEDS::StudyBuilder::_nil();
+}
+
void SALOMEDS_StudyBuilder::init_orb()
{
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
virtual void SetComment(const _PTR(SObject)& theSO, const std::string& theValue);
virtual void SetIOR(const _PTR(SObject)& theSO, const std::string& theValue);
+ SALOMEDS::StudyBuilder_ptr GetBuilder();
+
private:
void CheckLocked();
void init_orb();
SALOMEDSClient_UseCaseBuilder.hxx \
SALOMEDSClient_UseCaseIterator.hxx \
SALOMEDSClient_ClientFactory.hxx \
+ SALOMEDSClient_IParameters.hxx \
SALOMEDSClient.hxx
#
libSalomeDSClient_la_CPPFLAGS = $(COMMON_CPPFLAGS)
-libSalomeDSClient_la_LDFLAGS = -no-undefined -version-info=0:0:0
+libSalomeDSClient_la_LDFLAGS = -Wl,-E -no-undefined -version-info=0:0:0
libSalomeDSClient_la_LIBADD = $(COMMON_LIBS)
#define SOBJECT_FACTORY "SObjectFactory"
#define SCOMPONENT_FACTORY "SComponentFactory"
#define STUDY_FACTORY "StudyFactory"
+#define BUILDER_FACTORY "BuilderFactory"
#define STUDYMANAGER_FACTORY "StudyManagerFactory"
#define STUDYMANAGER_CREATE "CreateStudyManager"
+#define GET_PARAMETERS "GetIParameters"
+#define CONVERT_SOBJECT "ConvertSObject"
+#define CONVERT_STUDY "ConvertStudy"
+#define CONVERT_BUILDER "ConvertBuilder"
typedef SALOMEDSClient_SObject* (*SOBJECT_FACTORY_FUNCTION) (SALOMEDS::SObject_ptr);
typedef SALOMEDSClient_SComponent* (*SCOMPONENT_FACTORY_FUNCTION) (SALOMEDS::SComponent_ptr);
typedef SALOMEDSClient_Study* (*STUDY_FACTORY_FUNCTION) (SALOMEDS::Study_ptr);
typedef SALOMEDSClient_StudyManager* (*STUDYMANAGER_FACTORY_FUNCTION) ();
+typedef SALOMEDSClient_StudyBuilder* (*BUILDER_FACTORY_FUNCTION) (SALOMEDS::StudyBuilder_ptr);
typedef SALOMEDSClient_StudyManager* (*STUDYMANAGER_CREATE_FUNCTION) (CORBA::ORB_ptr, PortableServer::POA_ptr);
+typedef SALOMEDSClient_IParameters* (*GET_PARAMETERS_FACTORY) (const _PTR(AttributeParameter)&);
+typedef SALOMEDS::SObject_ptr (*CONVERT_SOBJECT_FUNCTION) (const _PTR(SObject)&);
+typedef SALOMEDS::Study_ptr (*CONVERT_STUDY_FUNCTION) (const _PTR(Study)&);
+typedef SALOMEDS::StudyBuilder_ptr (*CONVERT_BUILDER_FUNCTION) (const _PTR(StudyBuilder)&);
+
static SOBJECT_FACTORY_FUNCTION aSObjectFactory = NULL;
static SCOMPONENT_FACTORY_FUNCTION aSComponentFactory = NULL;
static STUDY_FACTORY_FUNCTION aStudyFactory = NULL;
+static BUILDER_FACTORY_FUNCTION aBuilderFactory = NULL;
static STUDYMANAGER_FACTORY_FUNCTION aManagerFactory = NULL;
static STUDYMANAGER_CREATE_FUNCTION aCreateFactory = NULL;
+static GET_PARAMETERS_FACTORY aGetIParameters = NULL;
+static CONVERT_SOBJECT_FUNCTION aConvertSObject = NULL;
+static CONVERT_STUDY_FUNCTION aConvertStudy = NULL;
+static CONVERT_BUILDER_FUNCTION aConvertBuilder = NULL;
using namespace std;
return _PTR(Study)(study);
}
+_PTR(StudyBuilder) ClientFactory::StudyBuilder(SALOMEDS::StudyBuilder_ptr theStudyBuilder)
+{
+ SALOMEDSClient_StudyBuilder* studyBuilder = NULL;
+
+#ifdef WIN32
+ if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+ if(!aBuilderFactory) aBuilderFactory = (BUILDER_FACTORY_FUNCTION)::GetProcAddress(_libHandle, BUILDER_FACTORY);
+#else
+ if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+ if(!aBuilderFactory) aBuilderFactory = (BUILDER_FACTORY_FUNCTION) dlsym(_libHandle, BUILDER_FACTORY);
+#endif
+
+ if(aBuilderFactory) studyBuilder = aBuilderFactory(theStudyBuilder);
+ return _PTR(StudyBuilder)(studyBuilder);
+}
+
_PTR(StudyManager) ClientFactory::StudyManager()
{
SALOMEDSClient_StudyManager* manager = NULL;
return _PTR(StudyManager)(manager);
}
+_PTR(IParameters) ClientFactory::getIParameters(const _PTR(AttributeParameter)& ap)
+{
+ SALOMEDSClient_IParameters* interface = NULL;
+
+#ifdef WIN32
+ if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+ if(!aGetIParameters) aGetIParameters = (GET_PARAMETERS_FACTORY)::GetProcAddress(_libHandle, GET_PARAMETERS);
+#else
+ if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+ if(!aGetIParameters) aGetIParameters = (GET_PARAMETERS_FACTORY) dlsym(_libHandle, GET_PARAMETERS);
+#endif
+
+ if(aGetIParameters) interface = aGetIParameters(ap);
+ return _PTR(IParameters)(interface);
+}
+
+SALOMEDS::SObject_ptr ClientFactory::crbSObject(const _PTR(SObject)& theSObject)
+{
+ SALOMEDS::SObject_var so;
+
+#ifdef WIN32
+ if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+ if(!aConvertSObject) aConvertSObject = (CONVERT_SOBJECT_FUNCTION)::GetProcAddress(_libHandle, CONVERT_SOBJECT);
+#else
+ if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+ if(!aConvertSObject) aConvertSObject = (CONVERT_SOBJECT_FUNCTION) dlsym(_libHandle, CONVERT_SOBJECT);
+#endif
+
+ if(aConvertSObject) so = aConvertSObject(theSObject);
+
+ if(CORBA::is_nil(so)) return SALOMEDS::SObject::_nil();
+ return so._retn();
+}
+
+
+SALOMEDS::Study_ptr ClientFactory::crbStudy(const _PTR(Study)& theStudy)
+{
+ SALOMEDS::Study_var study;
+
+#ifdef WIN32
+ if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+ if(!aConvertStudy) aConvertStudy = (CONVERT_STUDY_FUNCTION)::GetProcAddress(_libHandle, CONVERT_STUDY);
+#else
+ if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+ if(!aConvertStudy) aConvertStudy = (CONVERT_STUDY_FUNCTION) dlsym(_libHandle, CONVERT_STUDY);
+#endif
+
+ if(aConvertStudy) study = aConvertStudy(theStudy);
+
+ if(CORBA::is_nil(study)) return SALOMEDS::Study::_nil();
+ return study._retn();
+}
+
+SALOMEDS::StudyBuilder_ptr ClientFactory::crbStudyBuilder(const _PTR(StudyBuilder)& theStudyBuilder)
+{
+ SALOMEDS::StudyBuilder_var studyBuilder;
+
+#ifdef WIN32
+ if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
+ if(!aConvertBuilder)aConvertBuilder = (CONVERT_BUILDER_FUNCTION)::GetProcAddress(_libHandle, CONVERT_BUILDER);
+#else
+ if(!_libHandle) _libHandle = dlopen(SALOMEDS_LIB_NAME, RTLD_LAZY | RTLD_GLOBAL);
+ if(!aConvertBuilder) aConvertBuilder = (CONVERT_BUILDER_FUNCTION) dlsym(_libHandle, CONVERT_BUILDER);
+#endif
+
+ if(aConvertBuilder) studyBuilder = aConvertBuilder(theStudyBuilder);
+
+ if(CORBA::is_nil(studyBuilder)) return SALOMEDS::StudyBuilder::_nil();
+ return studyBuilder._retn();
+}
#include "SALOMEDSClient_SComponent.hxx"
#include "SALOMEDSClient_Study.hxx"
#include "SALOMEDSClient_StudyManager.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
#include <string>
*/
static _PTR(Study) Study(SALOMEDS::Study_ptr theStudy);
+ /*!
+ * Returns a client StudyBuilder wrapper that corresponds %theStudy
+ */
+ static _PTR(StudyBuilder) StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder);
+
/*!
* Returns a client StudyManager wrapper
*/
*/
static _PTR(StudyManager) createStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa);
-
+ /*!
+ * Returns an IParameters interface
+ */
+ static _PTR(IParameters) getIParameters(const _PTR(AttributeParameter)& ap);
+
+
+ /*!
+ * Returns a CORBA SObject that corresponds %theStudy
+ */
+ static SALOMEDS::SObject_ptr crbSObject(const _PTR(SObject)& theSObject);
+
+ /*!
+ * Returns a CORBA Study that corresponds %theStudy
+ */
+ static SALOMEDS::Study_ptr crbStudy(const _PTR(Study)& theStudy);
+
+ /*!
+ * Returns a CORBA StudyBuilder that corresponds %theStudyBuilder
+ */
+ static SALOMEDS::StudyBuilder_ptr crbStudyBuilder(const _PTR(StudyBuilder)& theStudyBuilder);
+
};
#endif
--- /dev/null
+// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
+#ifndef SALOMEDSClient_IParameters_H
+#define SALOMEDSClient_IParameters_H
+
+#include <string>
+#include <vector>
+#include <map>
+
+#include "SALOMEDSClient_definitions.hxx"
+#include "SALOMEDSClient_AttributeParameter.hxx"
+
+/*!
+ Class which an interface to store the parameters of the objects
+*/
+class SALOMEDSClient_IParameters
+{
+public:
+
+ virtual ~SALOMEDSClient_IParameters() {}
+
+ /*!
+ Appends a string value to a named list.
+ Returns a number of the added value.
+ Note: the name of the list MUST be unique
+ */
+ virtual int append(const std::string& listName, const std::string& value) = 0;
+
+ /*!
+ Returns a number elements in the list
+ */
+ virtual int nbValues(const std::string& listName) = 0;
+
+ /*!
+ Returns a list of values in the list
+ */
+ virtual std::vector<std::string> getValues(const std::string& listName) = 0;
+
+ /*!
+ Returns a value with given %index, where %index is in range [0:nbValues-1]
+ */
+ virtual std::string getValue(const std::string& listName, int index) = 0;
+
+ /*!
+ Returns a list all entries lists
+ */
+ virtual std::vector<std::string> getLists() = 0;
+
+ /*!
+ Sets a new named parameter value for the given entry
+ */
+ virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value) = 0;
+
+ /*!
+ Gets a named parameter value for the given entry
+ */
+ virtual std::string getParameter(const std::string& entry, const std::string& parameterName) = 0;
+
+ /*!
+ Returns all parameter names of the given entry
+ */
+ virtual std::vector<std::string> getAllParameterNames(const std::string& entry) = 0;
+
+ /*!
+ Returns all parameter values of the given entry
+ */
+ virtual std::vector<std::string> getAllParameterValues(const std::string& entry) = 0;
+
+ /*!
+ Returns a number of parameters of the given entry
+ */
+ virtual int getNbParameters(const std::string& entry) = 0;
+
+ /*!
+ Returns a list all entries
+ */
+ virtual std::vector<std::string> getEntries() = 0;
+
+ /*!
+ Sets a global named property value
+ */
+ virtual void setProperty(const std::string& name, const std::string& value) = 0;
+
+ /*!
+ Gets a value of global named property
+ */
+ virtual std::string getProperty(const std::string& name) = 0;
+
+ /*!
+ Returns a list all properties
+ */
+ virtual std::vector<std::string> getProperties() = 0;
+
+ /*!
+ Breaks a value string in two parts which is divided by %separator.
+ If fromEnd is True the search of separator starts from the end of the string
+ */
+ virtual std::vector<std::string> parseValue(const std::string& value, const char separator, bool fromEnd = true) = 0;
+
+
+ /*!
+ Returns encoded entry that is a relative entry for the component
+ */
+ virtual std::string encodeEntry(const std::string& entry, const std::string& compName) = 0;
+
+ /*!
+ Returns decoded entry that is an absolute entry
+ */
+ virtual std::string decodeEntry(const std::string& entry) = 0;
+
+ /*!
+ Enables/Disables the dumping visual parameters, static implementation is supposed
+ */
+ virtual void setDumpPython(_PTR(Study) study, const std::string& theID = "") = 0;
+
+ /*!
+ Returns whether there is the dumping visual parameters, static implementation is supposed
+ */
+ virtual bool isDumpPython(_PTR(Study) study, const std::string& theID = "") = 0;
+
+ /*!
+ Returns a default name of the component where the visula parameters are stored.
+ Static implementation is supposed
+ */
+ virtual std::string getDefaultVisualComponent() = 0;
+
+};
+
+
+#endif
if (isASCII) {
Handle(TColStd_HSequenceOfAsciiString) aFilesToRemove = new TColStd_HSequenceOfAsciiString;
- aFilesToRemove->Append(aHDFUrl);
+ aFilesToRemove->Append("hdf_from_ascii.hdf");
SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
}
# include <exception>
# include <iostream>
+#ifdef _DEBUG_
# define LOCALIZED(message) #message , __FILE__ , __LINE__
+#else
+# define LOCALIZED(message) #message
+#endif
#if defined UTILS_EXPORTS
#if defined WIN32