-This is the version 2.1.0 of KERNEL
+This is the version 2.2.0 of KERNEL
Previous versions :
- - 2.0.0
+ - 2.1.0
+ - 2.0.0
- 1.4.1
- 1.3.0
- 1.2.1
cascade.png \
CatalogDataType.xml \
KERNELCatalog.xml \
+CatalogResources.xml \
CatalogRessources.xml \
close.png \
config \
-THIS IS SALOME - KERNEL VERSION: 2.1.0
+THIS IS SALOME - KERNEL VERSION: 2.2.0
# --------------------------------------------------------------------------
- def waitNS(self,name,typobj=None,maxcount=70):
+ def waitNS(self,name,typobj=None,maxcount=40):
count=0
- delta=0.3
+ delta=0.5
print "Searching %s in Naming Service " % name,
while(1):
count += 1
# --------------------------------------------------------------------------
- def waitLogger(self,name,typobj=None,maxcount=10):
+ def waitLogger(self,name,typobj=None,maxcount=40):
count=0
- delta=0.3
+ delta=0.5
print "Searching %s in Naming Service " % name,
while(1):
count += 1
pid = os.spawnvp(os.P_NOWAIT, command[0], command)
process_id[pid]=self.CMD
-# ---
class InterpServer(Server):
def __init__(self,args):
# Notify Server launch
#
+ print "Notify Server to launch"
+
myServer=NotifyServer(args,modules_root_dir)
myServer.run()
# Lancement Catalog Server,
# attente de la disponibilité du Catalog Server dans le Naming Service
#
+
if 'moduleCatalog' not in args['embedded']:
cataServer=CatalogServer(args)
os.environ["HOSTNAME"]=os.getenv("HOST")
theComputer = getShortHostName()
-
+
#
# Lancement Container C++ local,
# attente de la disponibilité du Container C++ local dans le Naming Service
mv -f doxyfile1 doxyfile; \
$(doxygen) ./doxyfile; \
cd ..; \
+ mkdir KERNEL; \
cp -fr $(srcdir)/KERNEL/sources/static/*.* ./KERNEL/
cp -fr $(srcdir)/KERNEL/sources/ KERNEL/
cp -fr $(srcdir)/KERNEL/HTML/ KERNEL/
SALOMEDS_Attributes.idl \
SALOME_Session.idl \
SALOME_Component.idl \
+ SALOME_ContainerManager.idl \
SALOME_TestComponent.idl \
SALOME_Registry.idl \
SALOME_MPIObject.idl \
*/
interface Container
{
-/*!
- Initializes the %container with a definite name.
- \param ContainerName Name of the container
- \return an initialized container
-*/
- Container start_impl( in string ContainerName ) ;
/*!
Loads into the container a new component, registers it and starts it's CORBA servant.
Returns True if the %container has been killed
*/
boolean Kill_impl() ;
+/*!
+ Shutdown the Container process.
+*/
+ oneway void Shutdown();
/*!
Returns the hostname of the container
*/
<component-username>Salome</component-username>
<component-type>Other</component-type>
<component-author>NRI</component-author>
- <component-version>2.1.0</component-version>
+ <component-version>2.2.0</component-version>
<component-comment>GUI Neutral Context</component-comment>
<component-multistudy>1</component-multistudy>
LIBS=@LIBS@
+LIBSFORBIN=@LIBS@
# LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker -L$(top_builddir)/lib/salome
LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome
+LDFLAGSFORBIN=@LDFLAGS@ -L$(top_builddir)/lib/salome
# add libstdc++ to link c++ library with libtool !
LDFLAGS+= @STDLIB@
+LDFLAGSFORBIN+= @STDLIB@
#CP=@CP@
ln -sf $(CURDIR)/$< $@
$(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGS) $(LIBS)
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
# copy python scripts in $(top_builddir)/bin/salome
#
// $Header$
#include "SALOME_Component_i.hxx"
+#include "SALOME_Container_i.hxx"
#include "RegistryConnexion.hxx"
#include "OpUtil.hxx"
#include <stdio.h>
void Engines_Component_i::sendMessage(const char *event_type, const char *message) {
_notifSupplier->Send(graphName(), nodeName(), event_type, message);
}
+
+string Engines_Component_i::GetDynLibraryName(const char *componentName)
+{
+ string ret="lib";
+ ret+=componentName;
+ ret+="Engine.so";
+ return ret;
+}
+
+string Engines_Component_i::BuildComponentNameForNS(const char *ComponentName, const char *ContainerName, const char *hostname)
+{
+ string ret=Engines_Container_i::BuildContainerNameForNS(ContainerName,hostname);
+ ret+="/";
+ ret+=ComponentName;
+ return ret;
+}
+
#include CORBA_SERVER_HEADER(SALOME_Component)
#include "SALOME_Container_i.hxx"
#include "SALOME_NamingService.hxx"
-#include "Utils_SINGLETON.hxx"
+//#include "Utils_SINGLETON.hxx"
#include "OpUtil.hxx"
+#include <string.h>
#include <stdio.h>
#include <dlfcn.h>
#include <unistd.h>
extern "C" {void ActSigIntHandler() ; }
extern "C" {void SigIntHandler(int, siginfo_t *, void *) ; }
+const char *Engines_Container_i::_defaultContainerName="FactoryServer";
+
Engines_Container_i::Engines_Container_i () :
_numInstance(0)
{
PortableServer::POA_ptr poa,
char *containerName ,
int argc , char* argv[],
- bool regist,
- bool activ ) :
+ bool activAndRegist ) :
_numInstance(0)
{
_pid = (long)getpid();
- if(regist)
+ if(activAndRegist)
ActSigIntHandler() ;
_ArgC = argc ;
SCRUTE(hostname);
- _containerName = "/Containers/";
- if (strlen(containerName)== 0)
- {
- _containerName += hostname;
- }
- else
- {
- _containerName += hostname;
- _containerName += "/" ;
- _containerName += containerName;
- }
+ _containerName = BuildContainerNameForNS(containerName,hostname.c_str());
_orb = CORBA::ORB::_duplicate(orb) ;
_poa = PortableServer::POA::_duplicate(poa) ;
- // Pour les containers paralleles: il ne faut pas activer le container generique, mais le container specialise
- if(activ){
- MESSAGE("activate object");
- _id = _poa->activate_object(this);
- }
-
- // Pour les containers paralleles: il ne faut pas enregistrer le container generique, mais le container specialise
- if(regist){
- // _NS = new SALOME_NamingService(_orb);
- _NS = SINGLETON_<SALOME_NamingService>::Instance() ;
- ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
- _NS->init_orb( orb ) ;
- Engines::Container_ptr pCont
- = Engines::Container::_narrow(_this());
+ // Pour les containers paralleles: il ne faut pas enregistrer et activer le container generique, mais le container specialise
+ if(activAndRegist){
+ _id = _poa->activate_object(this);
+ _NS = new SALOME_NamingService();//SINGLETON_<SALOME_NamingService>::Instance() ;
+ //ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
+ _NS->init_orb( CORBA::ORB::_duplicate(_orb) ) ;
+ CORBA::Object_var obj=_poa->id_to_reference(*_id);
+ Engines::Container_var pCont
+ = Engines::Container::_narrow(obj);
SCRUTE(_containerName);
_NS->Register(pCont, _containerName.c_str());
}
Engines_Container_i::~Engines_Container_i()
{
MESSAGE("Container_i::~Container_i()");
+ delete _id;
}
char* Engines_Container_i::name()
MESSAGE("Engines_Container_i::ping() pid "<< getpid());
}
+// shutdown corba server
+void Engines_Container_i::Shutdown()
+{
+ MESSAGE("Engines_Container_i::Shutdown()");
+ _NS->Destroy_Name(_containerName.c_str());
+ //_remove_ref();
+ //_poa->deactivate_object(*_id);
+ _orb->shutdown(0);
+}
+
//! Kill current container
bool Engines_Container_i::Kill_impl() {
MESSAGE("Engines_Container_i::Kill() pid "<< getpid() << " containerName "
exit( 0 ) ;
}
-//! Launch a new container from the current container
-Engines::Container_ptr Engines_Container_i::start_impl(
- const char* ContainerName ) {
- MESSAGE("start_impl argc " << _argc << " ContainerName " << ContainerName
- << hex << this << dec) ;
- _numInstanceMutex.lock() ; // lock on the instance number
-
- CORBA::Object_var obj = Engines::Container::_nil() ;
- bool nilvar = true ;
- try {
- string cont("/Containers/");
- cont += machineName() ;
- cont += "/" ;
- cont += ContainerName;
- INFOS(machineName() << " start_impl unknown container " << cont.c_str()
- << " try to Resolve" );
- obj = _NS->Resolve( cont.c_str() );
- nilvar = CORBA::is_nil( obj ) ;
- if ( nilvar ) {
- INFOS(machineName() << " start_impl unknown container "
- << ContainerName);
- }
- }
- catch (ServiceUnreachable&) {
- INFOS(machineName() << "Caught exception: Naming Service Unreachable");
- }
- catch (...) {
- INFOS(machineName() << "Caught unknown exception.");
- }
- if ( !nilvar ) {
- _numInstanceMutex.unlock() ;
- MESSAGE("start_impl container found without new launch") ;
- return Engines::Container::_narrow(obj);
- }
- int i = 0 ;
- while ( _argv[ i ] ) {
- MESSAGE(" argv" << i << " " << _argv[ i ]) ;
- i++ ;
- }
- string shstr = string(getenv("KERNEL_ROOT_DIR")) + "/bin/salome/SALOME_Container ";
-// string shstr( "./runSession SALOME_Container " ) ;
- shstr += ContainerName ;
- if ( _argc == 4 ) {
- shstr += " " ;
- shstr += _argv[ 2 ] ;
- shstr += " " ;
- shstr += _argv[ 3 ] ;
- }
-
- // asv : 16.11.04 : creation of log file in /tmp/logs/$USER dir.
- // "/tmp/logs/$USER" was created by runSalome.py -> orbmodule.py.
- string tempfilename = "/tmp/logs/";
- tempfilename += getenv( "USER" ) ;
- tempfilename += "/" ;
- tempfilename += ContainerName ;
- tempfilename += ".log" ;
- FILE* f = fopen ( tempfilename.c_str(), "a" );
- if ( f ) { // check if file can be opened for writing
- fclose( f );
- shstr += " > " ;
- shstr += tempfilename;
- shstr += " 2>&1 &" ;
- }
- else { // if file can't be opened - use a guaranteed temp file name
- char* tmpFileName = tempnam( NULL, ContainerName );
- shstr += " > ";
- shstr += tmpFileName;
- shstr += " 2>&1 &";
- free( tmpFileName );
- }
-
- MESSAGE("system(" << shstr << ")") ;
- int status = system( shstr.c_str() ) ;
- if (status == -1) {
- INFOS("Engines_Container_i::start_impl SALOME_Container failed (system command status -1)") ;
- }
- else if (status == 217) {
- INFOS("Engines_Container_i::start_impl SALOME_Container failed (system command status 217)") ;
- }
- INFOS(machineName() << " Engines_Container_i::start_impl SALOME_Container launch done");
-
-// pid_t pid = fork() ;
-// if ( pid == 0 ) {
-// string anExe( _argv[ 0 ] ) ;
-// anExe += "runSession" ;
-// char * args[ 6 ] ;
-// args[ 0 ] = "runSession" ;
-// args[ 1 ] = "SALOME_Container" ;
-// args[ 2 ] = strdup( ContainerName ) ;
-// args[ 3 ] = strdup( _argv[ 2 ] ) ;
-// args[ 4 ] = strdup( _argv[ 3 ] ) ;
-// args[ 5 ] = NULL ;
-// MESSAGE("execl(" << anExe.c_str() << " , " << args[ 0 ] << " , "
-// << args[ 1 ] << " , " << args[ 2 ] << " , " << args[ 3 ]
-// << " , " << args[ 4 ] << ")") ;
-// int status = execv( anExe.c_str() , args ) ;
-// if (status == -1) {
-// INFOS("Engines_Container_i::start_impl execl failed (system command status -1)") ;
-// perror( "Engines_Container_i::start_impl execl error ") ;
-// }
-// else {
-// INFOS(machineName() << " Engines_Container_i::start_impl execl done");
-// }
-// exit(0) ;
-// }
-
- obj = Engines::Container::_nil() ;
- try {
- string cont("/Containers/");
- cont += machineName() ;
- cont += "/" ;
- cont += ContainerName;
- nilvar = true ;
- int count = 20 ;
- while ( nilvar && count >= 0) {
- sleep( 1 ) ;
- obj = _NS->Resolve(cont.c_str());
- nilvar = CORBA::is_nil( obj ) ;
- if ( nilvar ) {
- INFOS(count << ". " << machineName()
- << " start_impl unknown container " << cont.c_str());
- count -= 1 ;
- }
- }
- _numInstanceMutex.unlock() ;
- if ( !nilvar ) {
- MESSAGE("start_impl container found after new launch of SALOME_Container") ;
- }
- return Engines::Container::_narrow(obj);
- }
- catch (ServiceUnreachable&) {
- INFOS(machineName() << "Caught exception: Naming Service Unreachable");
- }
- catch (...) {
- INFOS(machineName() << "Caught unknown exception.");
- }
- _numInstanceMutex.unlock() ;
- MESSAGE("start_impl container not found after new launch of SALOME_Container") ;
- return Engines::Container::_nil() ;
-}
-
Engines::Component_ptr Engines_Container_i::load_impl( const char* nameToRegister,
const char* componentName ) {
char* Engines_Container_i::getHostName() {
return((char*)(GetHostname().c_str()));
}
+
+// Retrieves only with container naming convention if it is a python container
+bool Engines_Container_i::isPythonContainer(const char* ContainerName)
+{
+ bool ret=false;
+ int len=strlen(ContainerName);
+ if(len>=2)
+ if(strcmp(ContainerName+len-2,"Py")==0)
+ ret=true;
+ return ret;
+}
+
+string Engines_Container_i::BuildContainerNameForNS(const char *ContainerName, const char *hostname)
+{
+ string ret="/Containers/";
+ ret += hostname;
+ ret+="/";
+ if (strlen(ContainerName)== 0)
+ ret+=_defaultContainerName;
+ else
+ ret += ContainerName;
+ return ret;
+}
+
EXPORT_HEADERS = \
SALOME_Component_i.hxx \
- SALOME_Container_i.hxx
+ SALOME_Container_i.hxx \
+ SALOME_ContainerManager.hxx
# Libraries targets
LIB = libSalomeContainer.la
-LIB_SRC = Component_i.cxx Container_i.cxx
-LIB_SERVER_IDL = SALOME_Registry.idl SALOME_Component.idl
+LIB_SRC = Component_i.cxx Container_i.cxx SALOME_ContainerManager.cxx
+LIB_SERVER_IDL = SALOME_Registry.idl SALOME_Component.idl SALOME_ContainerManager.idl
+LIB_CLIENT_IDL =
# Executables targets
BIN = SALOME_Container
BIN_SRC = SALOME_Container_SignalsHandler.cxx
-BIN_SERVER_IDL = SALOME_Component.idl
+BIN_SERVER_IDL = SALOME_Component.idl SALOME_ContainerManager.idl
-CPPFLAGS+= $(PYTHON_INCLUDES) $(MPI_INCLUDE) $(OCC_INCLUDES)
+CPPFLAGS+= $(PYTHON_INCLUDES) $(MPI_INCLUDE) $(OCC_INCLUDES) $(QT_MT_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+= -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification -lSALOMELocalTrace -lSALOMETraceCollector
+LDFLAGS+= $(QT_MT_LIBS) -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification -lSALOMELocalTrace -lSALOMETraceCollector -lSalomeResourcesManager
-LIBS += @LDEXPDYNFLAGS@ $(PYTHON_LIBS) $(MPI_LIBS) -lCASCatch
+LIBS += @LDEXPDYNFLAGS@ $(PYTHON_LIBS) $(MPI_LIBS)
+LDFLAGSFORBIN= $(LDFLAGS) -lSALOMETraceCollector
+LIBSFORBIN= $(LIBS)
@CONCLUDE@
long CpuUsed() ;
CORBA::Long CpuUsed_impl() ;
+ static std::string GetDynLibraryName(const char *componentName);
+ static std::string BuildComponentNameForNS(const char *ComponentName, const char *ContainerName, const char *hostname);
protected:
std::string _instanceName ;
std::string _interfaceName ;
#include <string>
#include <stdio.h>
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
+//#include "Utils_ORB_INIT.hxx"
+//#include "Utils_SINGLETON.hxx"
+#include <unistd.h>
#include "SALOME_NamingService.hxx"
#include "SALOME_Container_i.hxx"
#include "utilities.h"
MPI_Init(&argc,&argv);
#endif
// Initialise the ORB.
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- CORBA::ORB_var &orb = init( argc , argv ) ;
+ //ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ;
SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
INFOS_COMPILATION;
BEGIN_OF(argv[0]);
// Obtain a reference to the root POA.
// obtain the root poa manager
//
- long TIMESleep = 250000000;
+ long TIMESleep = 500000000;
int NumberOfTries = 40;
int a;
timespec ts_req;
CORBA::Object_var theObj;
CORBA::Object_var obj;
CORBA::Object_var object;
- SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ //SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
int CONTAINER=0;
const char * Env = getenv("USE_LOGGER");
int EnvL =0;
break;
}
- // define policy objects
- PortableServer::ImplicitActivationPolicy_var implicitActivation =
- root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION) ;
-
- // default = NO_IMPLICIT_ACTIVATION
- PortableServer::ThreadPolicy_var threadPolicy =
- root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL);
- // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
-
- // create policy list
- CORBA::PolicyList policyList;
- policyList.length(2);
- policyList[0] = PortableServer::ImplicitActivationPolicy::_duplicate(implicitActivation) ;
- policyList[1] = PortableServer::ThreadPolicy::_duplicate(threadPolicy) ;
-
- // create the child POA
- PortableServer::POAManager_var nil_mgr = PortableServer::POAManager::_nil() ;
- PortableServer::POA_var factory_poa =
- root_poa->create_POA("factory_poa", pman, policyList) ;
- //with nil_mgr instead of pman, a new POA manager is created with the new POA
-
- // destroy policy objects
- implicitActivation->destroy() ;
- threadPolicy->destroy() ;
-
char *containerName = "";
if(argc > 1){
containerName = argv[1] ;
}
Engines_Container_i * myContainer
- = new Engines_Container_i(orb, factory_poa, containerName , argc , argv );
-
- // Engines_Container_i * myContainer
- // = new Engines_Container_i(string(argv[1]),string(argv[2]), orb, factory_poa);
-
- // use naming service
- // myContainer->_NS.init_orb(orb);
- // Engines::Container_ptr pCont = Engines::Container::_narrow(myContainer->_this());
- // myContainer->_NS.Register(pCont, argv[2]);
-
+ = new Engines_Container_i(orb, root_poa, containerName , argc , argv );
+
pman->activate();
#ifdef CHECKTIME
#endif
HandleServerSideSignals(orb);
-
- orb->destroy();
}catch(CORBA::SystemException&){
INFOS("Caught CORBA::SystemException.");
}catch(PortableServer::POA::WrongPolicy&){
PortableServer::POA_ptr poa,
char * containerName ,
int argc, char* argv[],
- bool regist = true,
- bool activ = true);
+ bool activAndRegist = true);
virtual ~Engines_Container_i();
- //! Launch a new container from the current container
- Engines::Container_ptr start_impl(const char* ContainerName);
-
//! Load component in current container
Engines::Component_ptr load_impl(const char* nameToRegister,
const char* componentName);
char* name();
char* machineName();
void ping();
-
+ void Shutdown();
//! Kill current container
bool Kill_impl() ;
char* getHostName();
CORBA::Long getPID();
+ static bool isPythonContainer(const char* ContainerName);
+ static std::string BuildContainerNameForNS(const char *ContainerName, const char *hostname);
+ static const char *_defaultContainerName;
protected:
SALOME_NamingService *_NS ;
CPPFLAGS+= $(QT_MT_INCLUDES)
CXXFLAGS+=
-LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace -lSALOMETraceCollector
+LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace
+LDFLAGSFORBIN= $(LDFLAGS) -lSALOMETraceCollector
@CONCLUDE@
if self._catalog is None:
MESSAGE( "/Kernel.dir/ModulCatalog.object exists but is not a ModulCatalog" )
+ name = [CosNaming.NameComponent("ContainerManager","object")]
+ try:
+ obj = self._rootContext.resolve(name)
+ except CosNaming.NamingContext.NotFound, ex:
+ MESSAGE( "ContainerManager.object not found in Naming Service" )
+ self._contManager = obj._narrow(Engines.ContainerManager)
+ if self._contManager is None:
+ MESSAGE( "ContainerManager.object exists but is not a ContainerManager")
+
#-------------------------------------------------------------------------
def ContainerName(self, containerName):
#-------------------------------------------------------------------------
- def FindOrStartContainer(self, theComputer , theContainer ):
- MESSAGE( "FindOrStartContainer" + theComputer + theContainer )
- aContainer = self.FindContainer( theComputer + "/" + theContainer )
- if aContainer is None :
- if (theContainer == "FactoryServer") | (theContainer == "FactoryServerPy") :
- myMachine=getShortHostName()
- if theComputer == myMachine :
- rshstr = ""
- else :
- rshstr = "rsh -n " + theComputer + " "
- path = self.ComputerPath( theComputer )
-## if path != "" :
-## rshstr = rshstr + path + "/../bin/"
-## else :
-## rshstr = rshstr + os.getenv( "KERNEL_ROOT_DIR" ) + "/bin/"
- if theContainer == "FactoryServer" :
- rshstr = rshstr + path + "SALOME_Container "
- else :
- rshstr = rshstr + path + "SALOME_ContainerPy.py '"
- rshstr = rshstr + theContainer + " -"
- omniORBcfg = os.getenv( "OMNIORB_CONFIG" )
- file = os.open( omniORBcfg , os.O_RDONLY )
- ORBInitRef = os.read(file,132)
- if ORBInitRef[len(ORBInitRef)-1] == '\n' :
- ORBInitRef,bsn = ORBInitRef.split('\n')
- os.close( file )
- rshstr = rshstr + ORBInitRef
- if theContainer == "FactoryServerPy" :
- rshstr = rshstr + "'"
- rshstr = rshstr + " > /tmp/" + theContainer + "_"
- rshstr = rshstr + theComputer
- rshstr = rshstr + ".log 2>&1 &"
- os.system( rshstr )
- MESSAGE( "FindOrStartContainer" + rshstr + " done" )
- else :
- if theContainer.find('Py') == -1 :
- aContainer = self.FindContainer( theComputer + "/" + "FactoryServer" )
- else :
- aContainer = self.FindContainer( theComputer + "/" + "FactoryServerPy" )
- aContainer = aContainer.start_impl( theContainer )
-
- count = 21
- while aContainer is None :
- time.sleep(1)
- count = count - 1
- MESSAGE( str(count) + ". Waiting for " + theComputer + "/" + theContainer )
- aContainer = self.FindContainer( theComputer + "/" + theContainer )
- if count == 0 :
- return aContainer
-
- return aContainer
- #os.system("rsh -n dm2s0017 /export/home/KERNEL_ROOT/bin/runSession SALOME_Container -ORBInitRef NameService=corbaname::dm2s0017:1515")
+ def FindComponent(self,containerName,componentName,listOfMachines):
+ if containerName!="":
+ machinesOK=[]
+ for i in range(len(listOfMachines)):
+ currentMachine=listOfMachines[i]
+ componentNameForNS= [CosNaming.NameComponent(currentMachine,"dir"),
+ CosNaming.NameComponent(containerName,"dir"),
+ CosNaming.NameComponent(componentName,"object")]
+ obj=None
+ try:
+ obj = self._containerRootContext.resolve(componentNameForNS)
+ except CosNaming.NamingContext.NotFound, ex:
+ MESSAGE( "component " + componentName + " not found on machine " + currentMachine + " , trying to load" )
+ pass
+ if obj is not None:
+ machinesOK.append(currentMachine)
+ pass
+ pass
+ if len(machinesOK)!=0:
+ bestMachine=self._contManager.FindBest(machinesOK)
+ componentNameForNS= [CosNaming.NameComponent(bestMachine,"dir"),
+ CosNaming.NameComponent(containerName,"dir"),
+ CosNaming.NameComponent(componentName,"object")]
+ obj=None
+ try:
+ obj = self._containerRootContext.resolve(componentNameForNS)
+ except:
+ pass
+ if obj is not None:
+ return obj._narrow(Engines.Component)
+ else:
+ MESSAGE( "Big problem !!!")
+ return None
+ else:
+ return None
+ else:
+ bestMachine=self._contManager.FindBest(listOfMachines)
+ MESSAGE("Not implemented yet ...")
+ return None
+ pass
#-------------------------------------------------------------------------
- def FindOrLoadComponent(self, containerName, componentName):
-
- theComputer,theContainer = self.ContainerName( containerName )
- name = [CosNaming.NameComponent(theComputer,"dir"),
- CosNaming.NameComponent(theContainer,"dir"),
- CosNaming.NameComponent(componentName,"object")]
+ def LoadComponent(self,containerName,componentName,listOfMachine):
+ container=self._contManager.FindOrStartContainer(containerName,listOfMachine)
+ implementation="lib"+componentName+"Engine.so"
try:
- obj = self._containerRootContext.resolve(name)
- except CosNaming.NamingContext.NotFound, ex:
- MESSAGE( "component " + componentName + " not found, trying to load" )
- container = self.FindContainer(theComputer + "/" + theContainer)
- if container is None:
- MESSAGE( "container " + theComputer + "/" + theContainer + " not found in Naming Service, trying to start" )
- if (theContainer != "FactoryServer") & (theContainer != "FactoryServerPy") :
- if theContainer.find('Py') == -1 :
- theFactorycontainer = "FactoryServer"
- else :
- theFactorycontainer = "FactoryServerPy"
- Factorycontainer = self.FindContainer(theComputer + "/" + theFactorycontainer)
- if Factorycontainer is None:
- MESSAGE( "container " + theComputer + "/" + theFactorycontainer + " not found in Naming Service, trying to start" )
- Factorycontainer = self.FindOrStartContainer(theComputer,theFactorycontainer)
- else:
- Factorycontainer = self.FindOrStartContainer(theComputer,theContainer)
- if Factorycontainer != None :
- container = self.FindOrStartContainer(theComputer,theContainer)
-
- if container != None:
- compoinfo = self._catalog.GetComponent(componentName)
- if compoinfo is None:
- MESSAGE( "component " + componentName + " not found in Module Catalog" )
- else:
- try:
- machineName = theComputer
- path = compoinfo.GetPathPrefix(machineName) + "/"
- except SALOME_ModuleCatalog.NotFound, ex:
- MESSAGE( "machine " + machineName + " not found in Module Catalog" )
- MESSAGE( "trying localhost" )
- try:
- path = compoinfo.GetPathPrefix("localhost") + "/"
- except SALOME_ModuleCatalog.NotFound, ex:
- path = ""
- implementation = path + "lib" + componentName + "Engine.so"
- MESSAGE( "Trying to load " + implementation )
- try:
- component = container.load_impl(componentName, implementation)
- MESSAGE( "component " + component._get_instanceName() + " launched !" )
- return component
- except:
- MESSAGE( "component " + componentName + " NOT launched !" )
+ component = container.load_impl(componentName, implementation)
+ MESSAGE( "component " + component._get_instanceName() + " launched !" )
+ return component
+ except:
+ MESSAGE( "component " + componentName + " NOT launched !" )
+ return None
+ #-------------------------------------------------------------------------
+
+
+ def FindOrLoadComponent(self, containerName, componentName):
+ sp=containerName.split("/")
+ if len(sp)==1:
+ listOfMachine=[]
+ listOfMachine.append(getShortHostName())
+ comp=self.FindComponent(containerName,componentName,listOfMachine)
+ if comp is None:
+ return self.LoadComponent(containerName,componentName,listOfMachine)
+ else:
+ return comp
+ pass
else:
- try:
- component = obj._narrow(Engines.Component)
- if component is None:
- MESSAGE( componentName + " is not a component !" )
- else:
- MESSAGE( "component " + component._get_instanceName() + " found !" )
- return component
- except:
- MESSAGE( componentName + " failure" )
- return None
+ params= Engines.MachineParameters(sp[1],sp[0],"LINUX",0,0,0,0)
+ listOfMachine=self._contManager.GetFittingResources(params,componentName)
+ ret=self.FindComponent(sp[1],componentName,listOfMachine);
+ if ret is None:
+ return self.LoadComponent(sp[1],componentName,listOfMachine)
+ else:
+ return ret
+ pass
+
LIB = libSalomeLifeCycleCORBA.la
LIB_SRC = SALOME_LifeCycleCORBA.cxx
LIB_CLIENT_IDL = SALOME_Component.idl SALOME_TestComponent.idl \
- SALOME_ModuleCatalog.idl
+ SALOME_ModuleCatalog.idl SALOME_ContainerManager.idl
# Executables targets
BIN = TestLifeCycleCORBA
BIN_SRC =
BIN_CLIENT_IDL = SALOME_Component.idl SALOME_TestComponent.idl \
- SALOME_ModuleCatalog.idl
+ SALOME_ModuleCatalog.idl SALOME_ContainerManager.idl
-LDFLAGS += -lSalomeNS -lOpUtil -lSALOMELocalTrace
+CPPFLAGS += $(QT_MT_INCLUDES)
+
+LDFLAGS += -lSalomeNS -lOpUtil -lSALOMELocalTrace -lSalomeContainer -lSalomeResourcesManager
+LDFLAGSFORBIN= $(LDFLAGS) -lRegistry -lSalomeNotification -lSALOMETraceCollector
@CONCLUDE@
#include "SALOME_LifeCycleCORBA.hxx"
#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
+#include "SALOME_ContainerManager.hxx"
+#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
using namespace std;
-SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA()
-{
- _NS = NULL;
- _FactoryServer = NULL ;
-}
-
SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns)
{
_NS = ns;
- _FactoryServer = NULL ;
+ //add try catch
+ CORBA::Object_var obj=_NS->Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS);
+ ASSERT( !CORBA::is_nil(obj));
+ _ContManager=Engines::ContainerManager::_narrow(obj);
}
SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA()
theComputerContainer += "/" ;
theComputerContainer += *theContainer ;
}
+ delete [] ContainerName;
return theComputerContainer ;
}
+bool SALOME_LifeCycleCORBA::isKnownComponentClass(const char *componentName)
+{
+
+ try
+ {
+ CORBA::Object_var obj = _NS->Resolve("/Kernel/ModulCatalog");
+ SALOME_ModuleCatalog::ModuleCatalog_var Catalog =
+ SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj) ;
+ SALOME_ModuleCatalog::Acomponent_ptr compoInfo =
+ Catalog->GetComponent(componentName);
+ if (CORBA::is_nil (compoInfo))
+ {
+ INFOS("Catalog Error : Component not found in the catalog");
+ return false;
+ }
+ else return true;
+ }
+ catch (ServiceUnreachable&)
+ {
+ INFOS("Caught exception: Naming Service Unreachable");
+ }
+ catch (...)
+ {
+ INFOS("Caught unknown exception.");
+ }
+ return false;
+}
+
string SALOME_LifeCycleCORBA::ComputerPath(
const char * theComputer ) {
CORBA::String_var path;
return CORBA::string_dup( path ) ;
}
-Engines::Container_var SALOME_LifeCycleCORBA::FindContainer(const char *containerName ) {
+Engines::Container_ptr SALOME_LifeCycleCORBA::FindContainer(const char *containerName)
+{
ASSERT(_NS != NULL);
string cont ;
if ( strncmp( containerName , "/Containers/" , 12 ) ) { // Compatibility ...
return Engines::Container::_nil();
}
-Engines::Container_var SALOME_LifeCycleCORBA::FindOrStartContainer(
- const string aComputerContainer ,
- const string theComputer ,
- const string theContainer ) {
- Engines::Container_var aContainer = FindContainer( aComputerContainer.c_str() ) ;
- Engines::Container_var aFactoryServer ;
- SCRUTE( aComputerContainer ) ;
- SCRUTE( theComputer ) ;
- SCRUTE( theContainer ) ;
- bool pyCont = false ;
- int len = theContainer.length() ;
- if ( !strcmp( &theContainer.c_str()[len-2] , "Py" ) ) {
- pyCont = true ;
- }
- if ( !CORBA::is_nil( aContainer ) ) {
- return aContainer ;
- }
- else {
- string FactoryServer = theComputer ;
- if ( pyCont ) {
- FactoryServer += "/FactoryServerPy" ;
- }
- else {
- FactoryServer += "/FactoryServer" ;
- }
- aFactoryServer = FindContainer( FactoryServer.c_str() ) ;
- if ( CORBA::is_nil( aFactoryServer ) ) {
-// rsh -n ikkyo /export/home/rahuel/SALOME_ROOT/bin/runSession SALOME_Container -ORBInitRef NameService=corbaname::dm2s0017:1515 &
- string rsh( "" ) ;
- if ( theComputer!= GetHostname() ) {
- rsh += "rsh -n " ;
- rsh += theComputer ;
- rsh += " " ;
- }
- string path = ComputerPath( theComputer.c_str() ) ;
- SCRUTE( path ) ;
- if ( path[0] != '\0' ) {
- rsh += path ;
- rsh += "/../bin/" ;
- }
- rsh += "runSession " ;
- if ( pyCont ) {
- rsh += "SALOME_ContainerPy.py " ;
- rsh += "FactoryServerPy -" ;
- }
- else {
- rsh += "SALOME_Container " ;
- rsh += "FactoryServer -" ;
- }
- string omniORBcfg( getenv( "OMNIORB_CONFIG" ) ) ;
- ifstream omniORBfile( omniORBcfg.c_str() ) ;
- char ORBInitRef[12] ;
- char nameservice[132] ;
- omniORBfile >> ORBInitRef ;
- rsh += ORBInitRef ;
- rsh += " " ;
- omniORBfile >> nameservice ;
- omniORBfile.close() ;
- char * bsn = strchr( nameservice , '\n' ) ;
- if ( bsn ) {
- bsn[ 0 ] = '\0' ;
- }
- rsh += nameservice ;
- if ( pyCont ) {
- rsh += " > /tmp/FactoryServerPy_" ;
- }
- else {
- rsh += " > /tmp/FactoryServer_" ;
- }
- rsh += theComputer ;
- rsh += ".log 2>&1 &" ;
- SCRUTE( rsh );
- int status = system( rsh.c_str() ) ;
- if (status == -1) {
- MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed (system command status -1)") ;
- }
- else if (status == 217) {
- MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed (system command status 217)") ;
- }
- else {
- int count = 21 ;
- while ( CORBA::is_nil( aFactoryServer ) && count ) {
- sleep( 1 ) ;
- count-- ;
- if ( count != 10 )
- MESSAGE( count << ". Waiting for FactoryServer on " << theComputer)
- aFactoryServer = FindContainer( FactoryServer.c_str() ) ;
- }
- if ( CORBA::is_nil( aFactoryServer ) ) {
- MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed") ;
- }
- else if ( strcmp( theComputer.c_str() , GetHostname().c_str() ) ) {
- _FactoryServer = aFactoryServer ;
+Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component
+ (const char *containerName,
+ const char *componentName)
+{
+ if (! isKnownComponentClass(componentName)) return Engines::Component::_nil();
+ char *stContainer=strdup(containerName);
+ string st2Container(stContainer);
+ int rg=st2Container.find("/");
+ if(rg>=0)
+ {
+ stContainer[rg]='\0';
+ if(strcmp(stContainer,"localhost")==0)
+ {
+ Engines::Component_ptr ret=FindOrLoad_Component(stContainer+rg+1,componentName);
+ free(stContainer);
+ return ret;
}
- }
- }
- if ( !CORBA::is_nil( aFactoryServer ) ) {
- if ( strcmp( theContainer.c_str() , "FactoryServer" ) ||
- strcmp( theContainer.c_str() , "FactoryServerPy" ) ) {
- MESSAGE("Container not found ! trying to start " << aComputerContainer);
- Engines::Container_var myContainer = aFactoryServer->start_impl( theContainer.c_str() ) ;
- if ( !CORBA::is_nil( myContainer ) ) {
- MESSAGE("Container " << aComputerContainer << " started");
- return myContainer ;
- }
- else {
- MESSAGE("Container " << aComputerContainer << " NOT started");
- }
- }
- else {
- MESSAGE("Container " << aComputerContainer << " started");
- return aFactoryServer ;
- }
}
+ if(rg<0) {
+ //containerName doesn't contain "/" => Local container
+ free(stContainer);
+ Engines::MachineList_var listOfMachine=new Engines::MachineList;
+ listOfMachine->length(1);
+ listOfMachine[0]=CORBA::string_dup(GetHostname().c_str());
+ Engines::Component_ptr ret=FindComponent(containerName,componentName,listOfMachine.in());
+ if(CORBA::is_nil(ret))
+ return LoadComponent(containerName,componentName,listOfMachine);
+ else
+ return ret;
+ }
+ else {
+ //containerName contains "/" => Remote container
+ stContainer[rg]='\0';
+ Engines::MachineParameters_var params=new Engines::MachineParameters;
+ params->container_name=CORBA::string_dup(stContainer+rg+1);
+ params->hostname=CORBA::string_dup(stContainer);
+ params->OS=CORBA::string_dup("LINUX");
+ free(stContainer);
+ return FindOrLoad_Component(params,componentName);
}
- return Engines::Container::_nil();
}
-Engines::Component_var SALOME_LifeCycleCORBA::FindOrLoad_Component
- (const char *containerName,
- const char *componentName,
- const char *implementation)
+Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component(const Engines::MachineParameters& params,
+ const char *componentName)
{
- BEGIN_OF("FindOrLoad_Component(1)");
- ASSERT(_NS != NULL);
- string theComputer ;
- string theContainer ;
- string theComputerContainer = ContainerName( containerName ,
- &theComputer ,
- &theContainer ) ;
- Engines::Container_var cont = FindOrStartContainer( theComputerContainer ,
- theComputer ,
- theContainer ) ;
-// ASSERT(!CORBA::is_nil(cont));
+ if (! isKnownComponentClass(componentName)) return Engines::Component::_nil();
+ Engines::MachineList_var listOfMachine=_ContManager->GetFittingResources(params,componentName);
+ Engines::Component_ptr ret=FindComponent(params.container_name,componentName,listOfMachine);
+ if(CORBA::is_nil(ret))
+ return LoadComponent(params.container_name,componentName,listOfMachine);
+ else
+ return ret;
+}
- string path( theComputerContainer );
- path = path + "/";
- path = path + componentName;
- SCRUTE(path);
- try
+Engines::Component_ptr SALOME_LifeCycleCORBA::FindComponent(const char *containerName,
+ const char *componentName,
+ const Engines::MachineList& listOfMachines)
+{
+ if (! isKnownComponentClass(componentName)) return Engines::Component::_nil();
+ if(containerName[0]!='\0')
{
- CORBA::Object_var obj = _NS->Resolve(path.c_str());
- if (CORBA::is_nil(obj))
- {
- MESSAGE("Component not found ! trying to load " << path);
- Engines::Component_var compo
- = cont->load_impl(componentName, implementation);
-// ASSERT(!CORBA::is_nil(compo));
- MESSAGE("Component launched !" << path);
- return compo;
- }
- else
+ Engines::MachineList_var machinesOK=new Engines::MachineList;
+ unsigned int lghtOfmachinesOK=0;
+ machinesOK->length(listOfMachines.length());
+ for(unsigned int i=0;i<listOfMachines.length();i++)
{
- MESSAGE("Component found !" << path);
- Engines::Component_var compo = Engines::Component::_narrow(obj);
-// ASSERT(!CORBA::is_nil(compo));
- try
+ const char *currentMachine=listOfMachines[i];
+ string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,currentMachine);
+ CORBA::Object_var obj = _NS->Resolve(componentNameForNS.c_str());
+ if(!CORBA::is_nil(obj))
{
- compo->ping();
+ machinesOK[lghtOfmachinesOK++]=CORBA::string_dup(currentMachine);
}
- catch (CORBA::COMM_FAILURE&)
- {
- INFOS("Caught CORBA::SystemException CommFailure. Engine "
- << path << "does not respond" );
- }
- return compo;
}
+ if(lghtOfmachinesOK!=0)
+ {
+ machinesOK->length(lghtOfmachinesOK);
+ CORBA::String_var bestMachine=_ContManager->FindBest(machinesOK);
+ string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,bestMachine);
+ CORBA::Object_var obj=_NS->Resolve(componentNameForNS.c_str());
+ return Engines::Component::_narrow(obj);
+ }
+ else
+ return Engines::Component::_nil();
}
- catch (ServiceUnreachable&)
- {
- INFOS("Caught exception: Naming Service Unreachable");
- }
- catch (...)
+ else
{
- INFOS("Caught unknown exception.");
+ //user specified no container name so trying to find a component in the best machine among listOfMachines
+ CORBA::String_var bestMachine=_ContManager->FindBest(listOfMachines);
+ //Normally look at all containers launched on bestMachine to see if componentName is already launched on one of them. To do..
+ string componentNameForNS=Engines_Component_i::BuildComponentNameForNS(componentName,containerName,bestMachine);
+ CORBA::Object_var obj = _NS->Resolve(componentNameForNS.c_str());
+ return Engines::Component::_narrow(obj);
}
- return Engines::Component::_nil();
}
-Engines::Component_var SALOME_LifeCycleCORBA::FindOrLoad_Component
- (const char *containerName,
- const char *componentName)
+Engines::Component_ptr SALOME_LifeCycleCORBA::LoadComponent(const char *containerName, const char *componentName, const Engines::MachineList& listOfMachines)
{
-// BEGIN_OF("FindOrLoad_Component(2)");
- ASSERT(_NS != NULL);
- string theComputer ;
- string theContainer ;
- string theComputerContainer = ContainerName( containerName ,
- &theComputer ,
- &theContainer ) ;
- Engines::Container_var cont = FindOrStartContainer( theComputerContainer ,
- theComputer ,
- theContainer ) ;
-
- if ( CORBA::is_nil( cont ) ) {
- MESSAGE("Container not found ! " << theComputerContainer );
- return Engines::Component::_nil();
- }
-
-// char * machine = cont->machineName() ;
- const char * machine = theComputer.c_str() ;
-
- string path( theComputerContainer );
- path += "/";
- path += componentName;
- SCRUTE(path);
-
- try {
- CORBA::Object_var obj = _NS->Resolve(path.c_str());
- if ( CORBA::is_nil( obj ) ) {
- MESSAGE("Component not found ! trying to load " << path);
- CORBA::Object_var obj2 = _NS->Resolve("/Kernel/ModulCatalog");
- SALOME_ModuleCatalog::ModuleCatalog_var Catalog =
- SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj2);
-
- SALOME_ModuleCatalog::Acomponent_ptr compoInfo =
- Catalog->GetComponent(componentName);
- if (CORBA::is_nil (compoInfo))
- {
- INFOS("Catalog Error : Component not found in the catalog")
- return Engines::Component::_nil();
-// exit (-1);
- }
-
- string path;
- try
- {
- path = compoInfo->GetPathPrefix( machine ) ;
- path += "/" ;
- }
- catch (SALOME_ModuleCatalog::NotFound&)
- {
- INFOS("GetPathPrefix(" << machine << ") not found!"
- << "trying localhost");
- try {
- path = compoInfo->GetPathPrefix("localhost") ;
- path += "/" ;
- }
- catch (SALOME_ModuleCatalog::NotFound&) {
- INFOS("GetPathPrefix(localhost) not found!") ;
- path = "" ;
- }
- }
-
- SCRUTE(path);
- string implementation(path);
- implementation += "lib";
- implementation += componentName;
- implementation += "Engine.so";
-
- Engines::Component_var compo
- = cont->load_impl(componentName, implementation.c_str());
-
-// ASSERT(!CORBA::is_nil(compo));
-// MESSAGE("Component launched !" << path);
- return compo;
- }
- else
- {
- MESSAGE("Component found !" << path);
- Engines::Component_var compo = Engines::Component::_narrow(obj);
-// ASSERT(!CORBA::is_nil(compo));
- try
- {
- string instanceName = compo->instanceName();
- }
- catch (CORBA::COMM_FAILURE&)
- {
- INFOS("Caught CORBA::SystemException CommFailure. Engine "
- << path << "does not respond" );
- }
- return compo;
- }
- }
- catch (ServiceUnreachable&)
- {
- INFOS("Caught exception: Naming Service Unreachable");
- }
- catch (...)
- {
- INFOS("Caught unknown exception.");
- }
- return Engines::Component::_nil();
+ Engines::Container_var cont=_ContManager->FindOrStartContainer(containerName,listOfMachines);
+ string implementation=Engines_Component_i::GetDynLibraryName(componentName);
+ return cont->load_impl(componentName, implementation.c_str());
}
#include <string>
#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
#include CORBA_CLIENT_HEADER(SALOME_Component)
class SALOME_NamingService;
class SALOME_LifeCycleCORBA
{
public:
- SALOME_LifeCycleCORBA();
SALOME_LifeCycleCORBA(SALOME_NamingService *ns);
virtual ~SALOME_LifeCycleCORBA();
-
- Engines::Container_var FindContainer(const char *containerName);
- Engines::Component_var FindOrLoad_Component(const char *containerName,
- const char *componentName,
- const char *implementationPath);
- Engines::Component_var FindOrLoad_Component(const char *containerName,
+ Engines::Container_ptr FindContainer(const char *containerName); // for supervision
+ Engines::Component_ptr FindOrLoad_Component(const Engines::MachineParameters& params,
+ const char *componentName);
+ Engines::Component_ptr FindOrLoad_Component(const char *containerName,
const char *componentName);
+ bool isKnownComponentClass(const char *componentName);
protected:
- SALOME_NamingService *_NS;
- Engines::Container_var _FactoryServer ;
+ //! Establish if a component called "componentName" in a container called "containerName" exists among the list of resources
+ //! in "listOfMachines". This method uses Naming Service to find the component.
+ Engines::Component_ptr FindComponent(const char *containerName,
+ const char *componentName,
+ const Engines::MachineList& listOfMachines);
+ Engines::Component_ptr LoadComponent(const char *containerName, const char *componentName, const Engines::MachineList& listOfMachines);
+
+ SALOME_NamingService *_NS;
+ Engines::ContainerManager_var _ContManager;
+
//private:
std::string ContainerName( const char * aComputerContainer ,
- std::string * theComputer ,
- std::string * theContainer ) ;
+ std::string * theComputer ,
+ std::string * theContainer ) ;
std::string ComputerPath( const char * theComputer ) ;
- Engines::Container_var FindOrStartContainer(const std::string aComputerContainer ,
- const std::string theComputer ,
- const std::string theContainer ) ;
-
} ;
#endif
CPPFLAGS+=$(QT_MT_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+=$(QT_MT_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace -lSALOMETraceCollector
+LDFLAGS+=$(QT_MT_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace
+LDFLAGSFORBIN= $(LDFLAGS) -lSALOMETraceCollector
@CONCLUDE@
try
{
//Initialize the ORB
- const long TIMESleep = 250000000;
+ const long TIMESleep = 500000000;
const int NumberOfTries = 40;
int i;
timespec ts_req = {0, TIMESleep};
namespace MED{
//---------------------------------------------------------------
- TCellGroup
- GetCellsByEntity(TWrapper& theWrapper,
+ TElemGroup
+ GetElemsByEntity(TWrapper& theWrapper,
const PMeshInfo& theMeshInfo,
const MED::TEntityInfo& theEntityInfo)
{
- MSG(MYDEBUG,"GetCellsByEntity(...)");
- TCellGroup aGroup;
+ MSG(MYDEBUG,"GetElemsByEntity(...)");
+ TElemGroup aGroup;
MED::TEntityInfo::const_iterator anIter = theEntityInfo.begin();
for(; anIter != theEntityInfo.end(); anIter++){
const EEntiteMaillage& anEntity = anIter->first;
if(anEntity == eNOEUD) continue;
const MED::TGeom& aGeom = anIter->second;
- TCellSet& aCellSet = aGroup[anEntity];
+ TElemSet& aElemSet = aGroup[anEntity];
MED::TGeom::const_iterator anGeomIter = aGeom.begin();
for(; anGeomIter != aGeom.end(); anGeomIter++){
const EGeometrieElement& aGeo = anGeomIter->first;
- PCellInfo aCellInfo = theWrapper.GetPCellInfo(theMeshInfo,anEntity,aGeo);
- aCellSet.insert(aCellInfo);
- if(MYDEBUG){
- TInt aNbElem = aCellInfo->GetNbElem();
- INITMSG(MYDEBUG,"aGeo = "<<aGeo<<"; aNbElem = "<<aNbElem<<": ");
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- TInt iConnEnd = aCellInfo->GetConnDim();
- for(TInt iConn = 0; iConn < iConnEnd; iConn++){
- ADDMSG(MYVALUEDEBUG,aCellInfo->GetConn(iElem,iConn)<<",");
+ switch(aGeo){
+ case ePOLYGONE:
+ {
+ PPolygoneInfo aPolygoneInfo = theWrapper.GetPPolygoneInfo(theMeshInfo,anEntity,aGeo);
+ aElemSet.insert(aPolygoneInfo);
+ TElemNum aConn = aPolygoneInfo->GetConnectivite();
+ TElemNum aIndex = aPolygoneInfo->GetIndex();
+ TInt aNbIndex = aIndex.size();
+ TInt aIndex0 = aIndex[0];
+ INITMSG(MYDEBUG,"aGeo = "<<aGeo<<"; aNbElem = "<<aNbIndex-1<<": ");
+ for(TInt iElem = 1; iElem < aNbIndex; iElem++){
+ for (TInt i = aIndex0; i < aIndex[iElem];i++)
+ ADDMSG(MYVALUEDEBUG,aConn[i-1]<<",");
+ ADDMSG(MYDEBUG," ");
+ aIndex0 = aIndex[iElem];
}
- ADDMSG(MYVALUEDEBUG," ");
+ ADDMSG(MYDEBUG,endl);
+ ADDMSG(MYDEBUG," Indexes :");
+ for(TInt iElem = 0; iElem < aIndex.size(); iElem++){
+ ADDMSG(MYVALUEDEBUG,aIndex[iElem]<<",");
+ }
+ ADDMSG(MYDEBUG,endl);
+ break;
+ }
+ default:
+ {
+ PCellInfo aCellInfo = theWrapper.GetPCellInfo(theMeshInfo,anEntity,aGeo);
+ aElemSet.insert(aCellInfo);
}
- ADDMSG(MYDEBUG,"\n");
}
}
}
const PMeshInfo& theMeshInfo)
{
MSG(MYDEBUG,"GetFamilies(...)");
+ TErr anErr;
TFamilyGroup aGroup;
TInt aNbFam = theWrapper.GetNbFamilies(*theMeshInfo);
INITMSG(MYDEBUG,"GetNbFamilies() = "<<aNbFam<<"\n");
for(TInt iFam = 1; iFam <= aNbFam; iFam++){
- PFamilyInfo aFamilyInfo = theWrapper.GetPFamilyInfo(theMeshInfo,iFam);
- aGroup.insert(aFamilyInfo);
- if(MYDEBUG){
- string aName = aFamilyInfo->GetName();
- TInt aNbAttr = aFamilyInfo->GetNbAttr();
- TInt aNbGroup = aFamilyInfo->GetNbGroup();
- INITMSG(MYDEBUG,
- "aFamilyName = '"<<aName<<"'; andId = "<<aFamilyInfo->GetId()<<
- "; aNbAttr = "<<aNbAttr<<"; aNbGroup = "<<aNbGroup<<"\n");
- for(TInt iGroup = 0; iGroup < aNbGroup; iGroup++){
- aName = aFamilyInfo->GetGroupName(iGroup);
- INITMSG(MYDEBUG,"aGroupName = '"<<aName<<"'\n");
- }
- }
+ PFamilyInfo aFamilyInfo = theWrapper.GetPFamilyInfo(theMeshInfo,iFam,&anErr);
+ if(anErr >= 0)
+ aGroup.insert(aFamilyInfo);
}
ADDMSG(MYDEBUG,"\n");
return aGroup;
aGroup[aFamilyInfo->GetGroupName(iGroup)].insert(aFamilyInfo);
}
}
+
+#ifdef _DEBUG_
if(MYDEBUG){
TGroupInfo::const_iterator anIter = aGroup.begin();
for(; anIter != aGroup.end(); anIter++){
}
ADDMSG(MYDEBUG,"\n");
}
+#endif
+
return aGroup;
}
INITMSG(MYDEBUG,"GetNbFields() = "<<aNbFields<<"\n");
for(TInt iField = 1; iField <= aNbFields; iField++){
PFieldInfo aFieldInfo = theWrapper.GetPFieldInfo(theMeshInfo,iField);
- TInt aNbComp = aFieldInfo->GetNbComp();
- string aName = aFieldInfo->GetName();
- INITMSG(MYDEBUG,"aFieldName = '"<<aName<<"'; aNbComp = "<<aNbComp<<"; ");
+ INITMSG(MYDEBUG,"aFieldName = '"<<aFieldInfo->GetName()<<
+ "'; aNbComp = "<<aFieldInfo->GetNbComp()<<"; ");
MED::TGeom aGeom;
EEntiteMaillage anEntity = EEntiteMaillage(-1);
TInt aNbTimeStamps = theWrapper.GetNbTimeStamps(aFieldInfo,theEntityInfo,anEntity,aGeom);
TFamilyByEntity
GetFamiliesByEntity(TWrapper& theWrapper,
const PNodeInfo& theNodeInfo,
- const TCellGroup& theCellGroup,
+ const TElemGroup& theElemGroup,
const TFamilyGroup& theFamilyGroup)
{
MSG(MYDEBUG,"GetFamiliesByEntity(...)");
}
}
- if(!theCellGroup.empty()){
- TCellGroup::const_iterator anIter = theCellGroup.begin();
- for(; anIter != theCellGroup.end(); anIter++){
+ if(!theElemGroup.empty()){
+ TElemGroup::const_iterator anIter = theElemGroup.begin();
+ for(; anIter != theElemGroup.end(); anIter++){
const EEntiteMaillage& anEntity = anIter->first;
TFamilyIdSet& aFamilyIdSet = aFamilyIdByEntity[anEntity];
- const TCellSet& aCellSet = anIter->second;
- TCellSet::const_iterator anCellIter = aCellSet.begin();
- for(; anCellIter != aCellSet.end(); anCellIter++){
- const PCellInfo& aCellInfo = *anCellIter;
- if(TInt aNbElem = aCellInfo->GetNbElem()){
+ const TElemSet& aElemSet = anIter->second;
+ TElemSet::const_iterator anElemIter = aElemSet.begin();
+ for(; anElemIter != aElemSet.end(); anElemIter++){
+ const PElemInfo& aElemInfo = *anElemIter;
+ if(TInt aNbElem = aElemInfo->GetNbElem()){
for(TInt i = 0; i < aNbElem; i++){
- aFamilyIdSet.insert(aCellInfo->GetFamNum(i));
+ aFamilyIdSet.insert(aElemInfo->GetFamNum(i));
}
}
}
namespace MED{
//---------------------------------------------------------------
- typedef std::set<PCellInfo> TCellSet;
- typedef std::map<EEntiteMaillage,TCellSet> TCellGroup;
+ typedef std::set<PElemInfo> TElemSet;
+ typedef std::map<EEntiteMaillage,TElemSet> TElemGroup;
- TCellGroup GetCellsByEntity(TWrapper& theWrapper,
+ TElemGroup GetElemsByEntity(TWrapper& theWrapper,
const PMeshInfo& theMeshInfo,
const MED::TEntityInfo& theEntityInfo);
TFamilyByEntity GetFamiliesByEntity(TWrapper& theWrapper,
const PNodeInfo& theNodeInfo,
- const TCellGroup& theCellGroup,
+ const TElemGroup& theElemGroup,
const TFamilyGroup& theFamilyGroup);
const TEntity2GeomSet& GetEntity2GeomSet();
- inline TInt GetNbConn(EEntiteMaillage theEntity,
- EGeometrieElement theElem,
- TInt theMeshDim)
- {
- TInt anElemDim = theElem / 100, nsup = 0;
- if(theEntity == eMAILLE && anElemDim < theMeshDim) nsup = 1;
- return nsup + theElem % 100;
- }
+ enum EVersion {eVUnknown = -1, eV2_1, eV2_2};
+
+ TInt GetNbConnectivities(EGeometrieElement typmai);
+
+ template<int EVersion>
+ TInt GetNbConn(EGeometrieElement typmai,
+ TInt mdim);
+
+ template<>
+ TInt GetNbConn<eV2_1>(EGeometrieElement typmai,
+ TInt mdim);
+
+ template<>
+ TInt GetNbConn<eV2_2>(EGeometrieElement typmai,
+ TInt mdim);
struct TNameInfo;
typedef MED::shared_ptr<TNameInfo> PNameInfo;
struct TNodeInfo;
typedef MED::shared_ptr<TNodeInfo> PNodeInfo;
+ struct TPolygoneInfo;
+ typedef MED::shared_ptr<TPolygoneInfo> PPolygoneInfo;
+
+ struct TPolyedreInfo;
+ typedef MED::shared_ptr<TPolyedreInfo> PPolyedreInfo;
+
struct TCellInfo;
typedef MED::shared_ptr<TCellInfo> PCellInfo;
void TCellInfo::SetConn(TInt theElemId, TInt theConnId, TInt theVal){
GETINDEX(myConn,GetConnDim()*theElemId + theConnId) = theVal;
}
-
-TConstConnSlice
-TCellInfo::GetConnSlice(TInt theElemId) const
-{
- return TConstConnSlice(myConn,std::slice(GetConnDim()*theElemId,GetNbConnectivities(myTGeom),1));
-}
-
-TConnSlice
-TCellInfo::GetConnSlice(TInt theElemId)
-{
- return TConnSlice(myConn,std::slice(GetConnDim()*theElemId,GetNbConnectivities(myTGeom),1));
-}
-
//---------------------------------------------------------------
TInt TPolygoneInfo::GetNbConn(TInt theElemId) const {
TInt i1 = GETINDEX(myIndex,theElemId);
//---------------------------------------------------------------
typedef std::vector<char> TString;
- inline std::string GetString(TInt theId, TInt theStep,
- const TString& theString)
- {
- const char* aPos = &theString[theId*theStep];
- TInt aSize = std::min(TInt(strlen(aPos)),theStep);
- return std::string(aPos,aSize);
- }
-
- inline void SetString(TInt theId, TInt theStep,
- TString& theString,
- const std::string& theValue)
- {
- TInt aSize = std::min(TInt(theValue.size()+1),theStep);
- strncpy(&theString[theId*theStep],theValue.c_str(),aSize);
- }
+ std::string GetString(TInt theId, TInt theStep,
+ const TString& theString);
+ void SetString(TInt theId, TInt theStep,
+ TString& theString,
+ const std::string& theValue);
//---------------------------------------------------------------
struct TBase
TInt GetNbAttr() const { return myNbAttr;}
TFamAttr myAttrId;
- TInt GetAttrId(TInt theId) const { return myAttrId[theId];}
- void SetAttrId(TInt theId, TInt theVal) { myAttrId[theId] = theVal;}
+ TInt GetAttrId(TInt theId) const;
+ void SetAttrId(TInt theId, TInt theVal);
TFamAttr myAttrVal;
- TInt GetAttrVal(TInt theId) const { return myAttrVal[theId];}
- void SetAttrVal(TInt theId, TInt theVal) { myAttrVal[theId] = theVal;}
+ TInt GetAttrVal(TInt theId) const;
+ void SetAttrVal(TInt theId, TInt theVal);
TString myAttrDesc;
virtual std::string GetAttrDesc(TInt theId) const = 0;
TInt GetNbElem() const { return myNbElem;}
TElemNum myFamNum;
- TInt GetFamNum(TInt theId) const { return myFamNum[theId];}
- void SetFamNum(TInt theId, TInt theVal) { myFamNum[theId] = theVal;}
+ TInt GetFamNum(TInt theId) const;
+ void SetFamNum(TInt theId, TInt theVal);
EBooleen myIsElemNum;
EBooleen IsElemNum() const { return myIsElemNum;}
TElemNum myElemNum;
- TInt GetElemNum(TInt theId) const { return myElemNum[theId];}
- void SetElemNum(TInt theId, TInt theVal) { myElemNum[theId] = theVal;}
+ TInt GetElemNum(TInt theId) const;
+ void SetElemNum(TInt theId, TInt theVal);
EBooleen myIsElemNames;
EBooleen IsElemNames() const { return myIsElemNames;}
struct TNodeInfo: virtual TElemInfo
{
TNodeCoord myCoord;
- TFloat GetNodeCoord(TInt theId, TInt theComp) const {
- return myCoord[myMeshInfo->myDim*theId + theComp];
- }
- void SetNodeCoord(TInt theId, TInt theComp, TFloat theVal){
- myCoord[myMeshInfo->myDim*theId + theComp] = theVal;
- }
+ TFloat GetNodeCoord(TInt theId, TInt theComp) const;
+ void SetNodeCoord(TInt theId, TInt theComp, TFloat theVal);
ERepere mySystem;
ERepere GetSystem() const { return mySystem;}
EConnectivite myTConn;
EConnectivite GetConn() const { return myTConn;}
+ virtual TInt GetConnDim() const = 0;
+
+ TElemNum myConn;
+ TInt GetConn(TInt theElemId, TInt theConnId) const;
+ void SetConn(TInt theElemId, TInt theConnId, TInt theVal);
+ };
+
+ //---------------------------------------------------------------
+ struct TPolygoneInfo: virtual TElemInfo
+ {
+ EEntiteMaillage myTEntity; // MED_FACE|MED_MAILLE
+ EEntiteMaillage GetEntity() const { return myTEntity;}
+
+ EGeometrieElement myTGeom; // ePOLYGONE
+ EGeometrieElement GetGeom() const { return ePOLYGONE;}
+
+ EConnectivite myTConn; // eNOD|eDESC(eDESC not used)
+ EConnectivite GetConn() const { return myTConn;}
+
TInt myConnDim;
TInt GetConnDim() const { return myConnDim;}
- TElemNum myConn;
- TInt GetConn(TInt theElemId, TInt theConnId) const {
- return myConn[myConnDim*theElemId + theConnId];
- }
- void SetConn(TInt theElemId, TInt theConnId, TInt theVal){
- myConn[myConnDim*theElemId + theConnId] = theVal;
- }
+ TElemNum myConn; // Table de connectivities
+ TElemNum GetConnectivite() const { return myConn;}
+
+ TElemNum myIndex; // Table de indexes
+ TElemNum GetIndex() {return myIndex;}
+ TInt GetNbConn(TInt theElemId) const;
};
+ //---------------------------------------------------------------
+ struct TPolyedreInfo: virtual TElemInfo
+ {
+ EEntiteMaillage myTEntity; // MED_FACE|MED_MAILLE
+ EEntiteMaillage GetEntity() const { return myTEntity;}
+
+ EGeometrieElement myTGeom; // ePOLYEDRE
+ EGeometrieElement GetGeom() const { return ePOLYEDRE;}
+
+ EConnectivite myTConn; // eNOD|eDESC(eDESC not used)
+ EConnectivite GetConn() const { return myTConn;}
+
+ TInt myNbConn;
+ TInt GetNbConn() const { return myNbConn;}
+
+ TElemNum myConn; // Table de connectivities
+ TElemNum GetConnectivite() const { return myConn;}
+
+ TInt myNbFacesIndex;
+ TInt GetNbFacesIndex() const { return myNbFacesIndex;}
+
+ TElemNum myFacesIndex; // Table de faces indexes
+ TElemNum GetFacesIndex() {return myFacesIndex;}
+
+ TElemNum myIndex; // Table de indexes
+ TElemNum GetIndex() {return myIndex;}
+ };
//---------------------------------------------------------------
struct TFieldInfo: virtual TNameInfo
TMeshValue myMeshValue;
TFloat GetVal(EGeometrieElement theGeom, TInt theId,
- TInt theComp, TInt theGauss = 0) const
- {
- TInt aNbComp = myTimeStampInfo->myFieldInfo->myNbComp;
- TInt aNbGauss = myTimeStampInfo->myNbGauss;
- TInt aStep = aNbComp*aNbGauss;
- TMeshValue::const_iterator anIter = myMeshValue.find(theGeom);
- if(anIter != myMeshValue.end())
- return anIter->second[theId*aStep + theComp*aNbGauss + theGauss];
- return TFloat();
- }
+ TInt theComp, TInt theGauss = 0) const;
+
void SetVal(EGeometrieElement theGeom, TInt theId,
- TInt theComp, TFloat theVal, TInt theGauss = 0)
- {
- TInt aNbComp = myTimeStampInfo->myFieldInfo->myNbComp;
- TInt aNbGauss = myTimeStampInfo->myNbGauss;
- TInt aStep = aNbComp*aNbGauss;
- myMeshValue[theGeom][theId*aStep + theComp*aNbGauss + theGauss] = theVal;
- }
+ TInt theComp, TFloat theVal, TInt theGauss = 0);
EModeProfil myPflMode;
EModeProfil GetPflMode() const { return myPflMode;}
void GetPflMode(EModeProfil theVal) { myPflMode = theVal;}
const TInt LNOM = 80;
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
struct TTNameInfo: virtual TNameInfo
{
TTNameInfo(const std::string& theValue = "")
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
- struct TTMeshInfo: TMeshInfo, TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
+ struct TTMeshInfo: TMeshInfo, TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
{
- typedef TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM> TNameInfoBase;
+ typedef TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV> TNameInfoBase;
TTMeshInfo(const PMeshInfo& theInfo):
TNameInfoBase(theInfo->GetName())
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
- struct TTFamilyInfo: TFamilyInfo, TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
+ struct TTFamilyInfo: TFamilyInfo, TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
{
- typedef TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM> TNameInfoBase;
+ typedef TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV> TNameInfoBase;
TTFamilyInfo(const PMeshInfo& theMeshInfo, const PFamilyInfo& theInfo):
TNameInfoBase(theInfo->GetName())
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
struct TTElemInfo: virtual TElemInfo
{
TTElemInfo(const PMeshInfo& theMeshInfo, const PElemInfo& theInfo)
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
- struct TTNodeInfo: TNodeInfo, TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
+ struct TTNodeInfo: TNodeInfo, TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
{
- typedef TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM> TElemInfoBase;
+ typedef TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV> TElemInfoBase;
TTNodeInfo(const PMeshInfo& theMeshInfo, const PNodeInfo& theInfo):
TElemInfoBase(theMeshInfo,theInfo)
}
};
+ //---------------------------------------------------------------
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
+ struct TTPolygoneInfo: TPolygoneInfo, TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
+ {
+ typedef TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV> TElemInfoBase;
+ TTPolygoneInfo(const PMeshInfo& theMeshInfo, const PPolygoneInfo& theInfo):
+ TElemInfoBase(theMeshInfo,theInfo)
+ {
+ myTEntity = theInfo->GetEntity();
+ myTGeom = theInfo->GetGeom();
+ myTConn = theInfo->GetConn();
+ myConnDim = theInfo->GetConnDim();
+ myConn = theInfo->GetConnectivite();
+ myIndex = theInfo->GetIndex();
+ }
+
+ TTPolygoneInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ TInt theNbConn,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn = eNOD,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI):
+ TElemInfoBase(theMeshInfo,
+ theNbElem,
+ theIsElemNum,
+ theIsElemNames)
+ {
+ myTEntity = theTEntity;
+ myTGeom = theTGeom;
+ myTConn = theTConn;
+ myConnDim = theNbConn;
+ myConn.resize(myConnDim);
+ myIndex.resize(theNbElem+1);
+ }
+
+ TTPolygoneInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ const TIntVector& theConnectivities,
+ const TIntVector& theIndexes,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector()):
+ TElemInfoBase(theMeshInfo,
+ theFamilyNums,
+ theElemNums,
+ theElemNames)
+ {
+ myTEntity = theTEntity;
+ myTGeom = theTGeom;
+ myTConn = theTConn;
+ myConnDim = theConnectivities.size();
+ myConn = theConnectivities;
+ myIndex = theIndexes;
+ }
+ };
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
- struct TTCellInfo: TCellInfo, TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
+ struct TTPolyedreInfo: TPolyedreInfo, TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
{
- typedef TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM> TElemInfoBase;
+ typedef TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV> TElemInfoBase;
+
+ TTPolyedreInfo(const PMeshInfo& theMeshInfo, const PPolyedreInfo& theInfo):
+ TElemInfoBase(theMeshInfo,theInfo)
+ {
+ myTEntity = theInfo->GetEntity();
+ myTGeom = theInfo->GetGeom();
+ myTConn = theInfo->GetConn();
+ myNbConn = theInfo->GetNbConn();
+ myNbFacesIndex = theInfo->GetNbFacesIndex();
+ myConn = theInfo->GetConnectivite();
+ myFacesIndex = theInfo->GetFacesIndex();
+ myIndex = theInfo->GetIndex();
+ }
+
+ TTPolyedreInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ TInt theNbConn,
+ TInt theNbFacesIndex,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn = eNOD,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI):
+ TElemInfoBase(theMeshInfo,
+ theNbElem,
+ theIsElemNum,
+ theIsElemNames)
+ {
+ myTEntity = theTEntity;
+ myTGeom = theTGeom;
+ myTConn = theTConn;
+ myNbConn = theNbConn;
+ myNbFacesIndex = theNbFacesIndex;
+ myConn.resize(myNbConn);
+ myFacesIndex.resize(myNbFacesIndex);
+ myIndex.resize(theNbElem+1);
+ }
+
+ TTPolyedreInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ const TIntVector& theConnectivities,
+ const TIntVector& theFacesIndexes,
+ const TIntVector& theIndexes,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector()):
+ TElemInfoBase(theMeshInfo,
+ theFamilyNums,
+ theElemNums,
+ theElemNames)
+ {
+ myTEntity = theTEntity;
+ myTGeom = theTGeom;
+ myTConn = theTConn;
+ myNbConn = theConnectivities.size();
+ myNbFacesIndex = theFacesIndexes.size();
+ myConn = theConnectivities;
+ myFacesIndex = theFacesIndexes;
+ myIndex = theIndexes;
+ }
+ };
+
+ //---------------------------------------------------------------
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
+ struct TTCellInfo: TCellInfo, TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
+ {
+ typedef TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV> TElemInfoBase;
TTCellInfo(const PMeshInfo& theMeshInfo, const PCellInfo& theInfo):
TElemInfoBase(theMeshInfo,theInfo)
myTEntity = theInfo->GetEntity();
myTGeom = theInfo->GetGeom();
myTConn = theInfo->GetConn();
- myConnDim = theInfo->GetConnDim();
- myConn.resize(myNbElem*myConnDim);
+ TInt aConnDim = GetNbConnectivities(myTGeom);
+ myConn.resize(myNbElem*GetNbConn<nV>(myTGeom,myMeshInfo->myDim));
for(TInt anElemId = 0; anElemId < myNbElem; anElemId++){
- for(TInt anConnId = 0; anConnId < myConnDim; anConnId++){
+ for(TInt anConnId = 0; anConnId < aConnDim; anConnId++){
SetConn(anElemId,anConnId,theInfo->GetConn(anElemId,anConnId));
}
}
myTEntity = theTEntity;
myTGeom = theTGeom;
myTConn = theTConn;
- myConnDim = GetNbConn(myTEntity,myTGeom,theMeshInfo->myDim);
- myConn.resize(theNbElem*myConnDim);
+ myConn.resize(theNbElem*GetNbConn<nV>(theTGeom,theMeshInfo->myDim));
}
TTCellInfo(const PMeshInfo& theMeshInfo,
const TIntVector& theFamilyNums,
const TIntVector& theElemNums,
const TStringVector& theElemNames = TStringVector()):
- TTElemInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>(theMeshInfo,
- theFamilyNums,
- theElemNums,
- theElemNames)
+ TElemInfoBase(theMeshInfo,
+ theFamilyNums,
+ theElemNums,
+ theElemNames)
{
myTEntity = theTEntity;
myTGeom = theTGeom;
myTConn = theTConn;
- myConnDim = GetNbConn(myTEntity,myTGeom,theMeshInfo->myDim);
- myConn.resize(theConnectivities.size());
- for(TInt anId = 0, anEnd = myConn.size(); anId < anEnd; anId++){
- myConn[anId] = theConnectivities[anId];
+
+ TInt aConnDim = GetNbConnectivities(myTGeom);
+ myNbElem = theConnectivities.size() / aConnDim;
+ myConn.resize(myNbElem*GetNbConn<nV>(myTGeom,myMeshInfo->myDim));
+ for(TInt anElemId = 0; anElemId < myNbElem; anElemId++){
+ for(TInt anConnId = 0; anConnId < aConnDim; anConnId++){
+ SetConn(anElemId,anConnId,theConnectivities[anElemId*aConnDim+anConnId]);
+ }
}
+
+ }
+
+ virtual TInt GetConnDim() const {
+ return GetNbConn<nV>(myTGeom,myMeshInfo->myDim);
}
+
};
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
- struct TTFieldInfo: TFieldInfo, TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
+ struct TTFieldInfo: TFieldInfo, TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
{
- typedef TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM> TNameInfoBase;
+ typedef TTNameInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV> TNameInfoBase;
TTFieldInfo(const PMeshInfo& theMeshInfo, const PFieldInfo& theInfo):
TNameInfoBase(theInfo->GetName())
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
struct TTTimeStampInfo: TTimeStampInfo
{
TTTimeStampInfo(const PFieldInfo& theFieldInfo, const PTimeStampInfo& theInfo)
//---------------------------------------------------------------
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
struct TTTimeStampVal: TTimeStampVal
{
TTTimeStampVal(const PTimeStampInfo& theTimeStampInfo, const PTimeStampVal& theInfo)
namespace MED{
- template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM>
+ template<TInt nPNOM, TInt nDESC, TInt nIDENT, TInt nNOM, TInt nLNOM, EVersion nV>
class TTWrapper: public TWrapper{
public:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual PMeshInfo CrMeshInfo(TInt theDim = 0,
- const std::string& theValue = "",
- EMaillage theType = eNON_STRUCTURE,
- const std::string& theDesc = "")
+ virtual
+ PMeshInfo
+ CrMeshInfo(TInt theDim = 0,
+ const std::string& theValue = "",
+ EMaillage theType = eNON_STRUCTURE,
+ const std::string& theDesc = "")
{
- return PMeshInfo(new TTMeshInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PMeshInfo(new TTMeshInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theDim,
theValue,
theType,
theDesc));
}
- virtual PMeshInfo CrMeshInfo(const PMeshInfo& theInfo)
+ virtual
+ PMeshInfo
+ CrMeshInfo(const PMeshInfo& theInfo)
{
- return PMeshInfo(new TTMeshInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>(theInfo));
+ return PMeshInfo(new TTMeshInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>(theInfo));
}
-
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual PFamilyInfo CrFamilyInfo(const PMeshInfo& theMeshInfo,
- TInt theNbGroup = 0,
- TInt theNbAttr = 0,
- TInt theId = 0,
- const std::string& theValue = "")
+ virtual
+ PFamilyInfo
+ CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbGroup = 0,
+ TInt theNbAttr = 0,
+ TInt theId = 0,
+ const std::string& theValue = "")
{
- return PFamilyInfo(new TTFamilyInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PFamilyInfo(new TTFamilyInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theNbGroup,
theNbAttr,
theValue));
}
- virtual PFamilyInfo CrFamilyInfo(const PMeshInfo& theMeshInfo,
- const std::string& theValue,
- TInt theId,
- const MED::TStringSet& theGroupNames,
- const MED::TStringVector& theAttrDescs = MED::TStringVector(),
- const MED::TIntVector& theAttrIds = MED::TIntVector(),
- const MED::TIntVector& theAttrVals = MED::TIntVector())
+ virtual
+ PFamilyInfo
+ CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ const std::string& theValue,
+ TInt theId,
+ const MED::TStringSet& theGroupNames,
+ const MED::TStringVector& theAttrDescs = MED::TStringVector(),
+ const MED::TIntVector& theAttrIds = MED::TIntVector(),
+ const MED::TIntVector& theAttrVals = MED::TIntVector())
{
- return PFamilyInfo(new TTFamilyInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PFamilyInfo(new TTFamilyInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theValue,
theId,
theAttrVals));
}
- virtual PFamilyInfo CrFamilyInfo(const PMeshInfo& theMeshInfo,
- const PFamilyInfo& theInfo)
+ virtual
+ PFamilyInfo
+ CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ const PFamilyInfo& theInfo)
{
- return PFamilyInfo(new TTFamilyInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PFamilyInfo(new TTFamilyInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theInfo));
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual PNodeInfo CrNodeInfo(const PMeshInfo& theMeshInfo,
- TInt theNbElem,
- ERepere theSystem = eCART,
- EBooleen theIsElemNum = eVRAI,
- EBooleen theIsElemNames = eVRAI)
+ virtual
+ PNodeInfo
+ CrNodeInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ ERepere theSystem = eCART,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI)
{
- return PNodeInfo(new TTNodeInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PNodeInfo(new TTNodeInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theNbElem,
theSystem,
theIsElemNames));
}
- virtual PNodeInfo CrNodeInfo(const PMeshInfo& theMeshInfo,
- ERepere theSystem,
- const TFloatVector& theNodeCoords,
- const TStringVector& theCoordNames,
- const TStringVector& theCoordUnits,
- const TIntVector& theFamilyNums,
- const TIntVector& theElemNums,
- const TStringVector& theElemNames = TStringVector())
+ virtual
+ PNodeInfo
+ CrNodeInfo(const PMeshInfo& theMeshInfo,
+ ERepere theSystem,
+ const TFloatVector& theNodeCoords,
+ const TStringVector& theCoordNames,
+ const TStringVector& theCoordUnits,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector())
{
- return PNodeInfo(new TTNodeInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PNodeInfo(new TTNodeInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theSystem,
theNodeCoords,
theElemNames));
}
- virtual PNodeInfo CrNodeInfo(const PMeshInfo& theMeshInfo,
- const PNodeInfo& theInfo)
+ virtual
+ PNodeInfo
+ CrNodeInfo(const PMeshInfo& theMeshInfo,
+ const PNodeInfo& theInfo)
{
- return PNodeInfo(new TTNodeInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PNodeInfo(new TTNodeInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theInfo));
}
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ virtual
+ PPolygoneInfo
+ CrPolygoneInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ TInt theNbConn,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn = eNOD,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI)
+ {
+ return PPolygoneInfo(new TTPolygoneInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
+ (theMeshInfo,
+ theNbElem,
+ theNbConn,
+ theTEntity,
+ theTGeom,
+ theTConn,
+ theIsElemNum,
+ theIsElemNames));
+ }
+
+ virtual
+ PPolygoneInfo
+ CrPolygoneInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ const TIntVector& theConnectivities,
+ const TIntVector& theIndexes,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector())
+ {
+ return PPolygoneInfo(new TTPolygoneInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
+ (theMeshInfo,
+ theTEntity,
+ theTGeom,
+ theTConn,
+ theConnectivities,
+ theIndexes,
+ theFamilyNums,
+ theElemNums,
+ theElemNames));
+ }
+
+ virtual
+ PPolygoneInfo
+ CrPolygoneInfo(const PMeshInfo& theMeshInfo,
+ const PPolygoneInfo& theInfo)
+ {
+ return PPolygoneInfo(new TTPolygoneInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
+ (theMeshInfo,
+ theInfo));
+ }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual PCellInfo CrCellInfo(const PMeshInfo& theMeshInfo,
- TInt theNbElem,
- EEntiteMaillage theTEntity,
- EGeometrieElement theTGeom,
- EConnectivite theTConn = eNOD,
- EBooleen theIsElemNum = eVRAI,
- EBooleen theIsElemNames = eVRAI)
+ virtual
+ PPolyedreInfo
+ CrPolyedreInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ TInt theNbConn,
+ TInt theNbFaces,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn = eNOD,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI)
+ {
+ return PPolyedreInfo(new TTPolyedreInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
+ (theMeshInfo,
+ theNbElem,
+ theNbConn,
+ theNbFaces,
+ theTEntity,
+ theTGeom,
+ theTConn,
+ theIsElemNum,
+ theIsElemNames));
+ }
+
+ virtual
+ PPolyedreInfo
+ CrPolyedreInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ const TIntVector& theConnectivities,
+ const TIntVector& theFacesIndexes,
+ const TIntVector& theIndexes,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector())
+ {
+ return PPolyedreInfo(new TTPolyedreInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
+ (theMeshInfo,
+ theTEntity,
+ theTGeom,
+ theTConn,
+ theConnectivities,
+ theFacesIndexes,
+ theIndexes,
+ theFamilyNums,
+ theElemNums,
+ theElemNames));
+ }
+
+ virtual
+ PPolyedreInfo
+ CrPolyedreInfo(const PMeshInfo& theMeshInfo,
+ const PPolyedreInfo& theInfo)
+ {
+ return PPolyedreInfo(new TTPolyedreInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
+ (theMeshInfo,
+ theInfo));
+ }
+
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ virtual
+ PCellInfo
+ CrCellInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn = eNOD,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI)
{
- return PCellInfo(new TTCellInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PCellInfo(new TTCellInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theNbElem,
theTEntity,
theIsElemNames));
}
- virtual PCellInfo CrCellInfo(const PMeshInfo& theMeshInfo,
- EEntiteMaillage theTEntity,
- EGeometrieElement theTGeom,
- EConnectivite theTConn,
- const TIntVector& theConnectivities,
- const TIntVector& theFamilyNums,
- const TIntVector& theElemNums,
- const TStringVector& theElemNames = TStringVector())
+ virtual
+ PCellInfo
+ CrCellInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ const TIntVector& theConnectivities,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector())
{
- return PCellInfo(new TTCellInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PCellInfo(new TTCellInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theTEntity,
theTGeom,
theElemNames));
}
- virtual PCellInfo CrCellInfo(const PMeshInfo& theMeshInfo,
- const PCellInfo& theInfo)
+ virtual
+ PCellInfo
+ CrCellInfo(const PMeshInfo& theMeshInfo,
+ const PCellInfo& theInfo)
{
- return PCellInfo(new TTCellInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PCellInfo(new TTCellInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theInfo));
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual PFieldInfo CrFieldInfo(const PMeshInfo& theMeshInfo,
- TInt theNbComp = 0,
- ETypeChamp theType = eFLOAT64,
- const std::string& theValue = "",
- EBooleen theIsLocal = eVRAI,
- TInt theNbRef = 1)
+ virtual
+ PFieldInfo
+ CrFieldInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbComp = 0,
+ ETypeChamp theType = eFLOAT64,
+ const std::string& theValue = "",
+ EBooleen theIsLocal = eVRAI,
+ TInt theNbRef = 1)
{
- return PFieldInfo(new TTFieldInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PFieldInfo(new TTFieldInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theNbComp,
theType,
theNbRef));
}
- virtual PFieldInfo CrFieldInfo(const PMeshInfo& theMeshInfo,
- const PFieldInfo& theInfo)
+ virtual
+ PFieldInfo
+ CrFieldInfo(const PMeshInfo& theMeshInfo,
+ const PFieldInfo& theInfo)
{
- return PFieldInfo(new TTFieldInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PFieldInfo(new TTFieldInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theMeshInfo,
theInfo));
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual PTimeStampInfo CrTimeStampInfo(const PFieldInfo& theFieldInfo,
- EEntiteMaillage theEntity,
- const TGeom& theGeom,
- TInt theNbGauss = 0,
- TInt theNumDt = 0,
- TInt theNumOrd = 0,
- TFloat theDt = 0,
- const std::string& theUnitDt = "",
- const std::string& theGaussName = "")
+ virtual
+ PTimeStampInfo
+ CrTimeStampInfo(const PFieldInfo& theFieldInfo,
+ EEntiteMaillage theEntity,
+ const TGeom& theGeom,
+ TInt theNbGauss = 0,
+ TInt theNumDt = 0,
+ TInt theNumOrd = 0,
+ TFloat theDt = 0,
+ const std::string& theUnitDt = "",
+ const std::string& theGaussName = "")
{
- return PTimeStampInfo(new TTTimeStampInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PTimeStampInfo(new TTTimeStampInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theFieldInfo,
theEntity,
theGeom,
theGaussName));
}
- virtual PTimeStampInfo CrTimeStampInfo(const PFieldInfo& theFieldInfo,
- const PTimeStampInfo& theInfo)
+ virtual
+ PTimeStampInfo
+ CrTimeStampInfo(const PFieldInfo& theFieldInfo,
+ const PTimeStampInfo& theInfo)
{
- return PTimeStampInfo(new TTTimeStampInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PTimeStampInfo(new TTTimeStampInfo<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theFieldInfo,
theInfo));
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual PTimeStampVal CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
- const std::string& thePflName = "",
- EModeProfil thePflMode = eCOMPACT)
+ virtual
+ PTimeStampVal
+ CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
+ const std::string& thePflName = "",
+ EModeProfil thePflMode = eCOMPACT)
{
- return PTimeStampVal(new TTTimeStampVal<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PTimeStampVal(new TTTimeStampVal<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theTimeStampInfo,
thePflName,
thePflMode));
}
- virtual PTimeStampVal CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
- const PTimeStampVal& theInfo)
+ virtual
+ PTimeStampVal
+ CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
+ const PTimeStampVal& theInfo)
{
- return PTimeStampVal(new TTTimeStampVal<nPNOM,nDESC,nIDENT,nNOM,nLNOM>
+ return PTimeStampVal(new TTTimeStampVal<nPNOM,nDESC,nIDENT,nNOM,nLNOM,nV>
(theTimeStampInfo,
theInfo));
}
aGeomFACESet.insert(eQUAD4);
aGeomFACESet.insert(eTRIA6);
aGeomFACESet.insert(eQUAD8);
+ aGeomFACESet.insert(ePOLYGONE);
TGeomSet& aGeomMAILLESet = Entity2GeomSet[eMAILLE];
aGeomMAILLESet.insert(ePOINT1);
aGeomMAILLESet.insert(ePYRA13);
aGeomMAILLESet.insert(ePENTA15);
aGeomMAILLESet.insert(eHEXA20);
+ aGeomMAILLESet.insert(ePOLYEDRE);
return true;
}
};
};
-
+//#define _DEBUG_
#ifdef _DEBUG_
#define MSG(deb,msg) if(deb) std::cout<<MED::PrefixPrinter::GetPrefix()<<msg<<" ("<<__FILE__<<" ["<<__LINE__<<"])\n"
#define BEGMSG(deb,msg) if(deb) std::cout<<MED::PrefixPrinter::GetPrefix()<<msg
#include "MED_Wrapper.hxx"
#include "MED_Utilities.hxx"
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+static int MYVALUEDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+static int MYVALUEDEBUG = 0;
+#endif
+
namespace MED{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- PMeshInfo TWrapper::GetPMeshInfo(TInt theId)
+ PMeshInfo TWrapper::GetPMeshInfo(TInt theId,
+ TErr* theErr)
{
PMeshInfo anInfo = CrMeshInfo();
- GetMeshInfo(theId,*anInfo);
+ GetMeshInfo(theId,*anInfo,theErr);
return anInfo;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- PFamilyInfo TWrapper::GetPFamilyInfo(const PMeshInfo& theMeshInfo, TInt theId)
+ PFamilyInfo TWrapper::GetPFamilyInfo(const PMeshInfo& theMeshInfo,
+ TInt theId,
+ TErr* theErr)
{
TInt aNbAttr = GetNbFamAttr(theId,*theMeshInfo);
TInt aNbGroup = GetNbFamGroup(theId,*theMeshInfo);
PFamilyInfo anInfo = CrFamilyInfo(theMeshInfo,aNbGroup,aNbAttr);
- GetFamilyInfo(theId,*anInfo);
+ GetFamilyInfo(theId,*anInfo,theErr);
+
+#ifdef _DEBUG_
+ string aName = anInfo->GetName();
+ INITMSG(MYDEBUG,
+ "aFamilyName = '"<<aName<<"'; andId = "<<anInfo->GetId()<<
+ "; aNbAttr = "<<aNbAttr<<"; aNbGroup = "<<aNbGroup<<"\n");
+ for(TInt iGroup = 0; iGroup < aNbGroup; iGroup++){
+ aName = anInfo->GetGroupName(iGroup);
+ INITMSG(MYDEBUG,"aGroupName = '"<<aName<<"'\n");
+ }
+#endif
+
return anInfo;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- PNodeInfo TWrapper::GetPNodeInfo(const PMeshInfo& theMeshInfo)
+ PNodeInfo TWrapper::GetPNodeInfo(const PMeshInfo& theMeshInfo,
+ TErr* theErr)
{
TInt aNbElems = GetNbNodes(*theMeshInfo);
PNodeInfo anInfo = CrNodeInfo(theMeshInfo,aNbElems);
- GetNodeInfo(*anInfo);
+ GetNodeInfo(*anInfo,theErr);
+
+#ifdef _DEBUG_
+ TInt aDim = theMeshInfo->myDim;
+ TInt aNbElem = anInfo->GetNbElem();
+ INITMSG(MYDEBUG,"GetPNodeInfo - aCoords: "<<aNbElem<<": ");
+ TNodeCoord& aCoord = anInfo->myCoord;
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ for(TInt iDim = 0, anId = iElem*aDim; iDim < aDim; iDim++, anId++){
+ ADDMSG(MYVALUEDEBUG,aCoord[anId]<<",");
+ }
+ ADDMSG(MYVALUEDEBUG," ");
+ }
+ ADDMSG(MYDEBUG,endl);
+
+ BEGMSG(MYDEBUG,"GetPNodeInfo - GetFamNum: ");
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ ADDMSG(MYVALUEDEBUG,anInfo->GetFamNum(iElem)<<", ");
+ }
+ ADDMSG(MYDEBUG,endl);
+
+ if(anInfo->IsElemNum()){
+ BEGMSG(MYDEBUG,"GetPNodeInfo - GetElemNum: ");
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ ADDMSG(MYVALUEDEBUG,anInfo->GetElemNum(iElem)<<", ");
+ }
+ ADDMSG(MYDEBUG,endl);
+ }
+
+ ADDMSG(MYDEBUG,endl);
+#endif
+
return anInfo;
}
-
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ PPolygoneInfo TWrapper::GetPPolygoneInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theEntity,
+ EGeometrieElement theGeom,
+ EConnectivite theConn)
+ {
+ TInt aNbElem = GetNbPolygones(*theMeshInfo,theEntity,theGeom,theConn);
+ TInt aNbConn = GetNbPolygoneConn(*theMeshInfo,theEntity,theGeom,theConn);
+ PPolygoneInfo anInfo = CrPolygoneInfo(theMeshInfo,aNbElem,aNbConn,theEntity,theGeom,theConn);
+ GetPolygoneInfo(*anInfo);
+ return anInfo;
+ }
+
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ PPolyedreInfo TWrapper::GetPPolyedreInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theEntity,
+ EGeometrieElement theGeom,
+ EConnectivite theConn)
+ {
+ TInt aNbElem = GetNbPolyedres(*theMeshInfo,theEntity,theGeom,theConn);
+ TInt aNbConn = 0;
+ TInt aNbFaces = 0;
+ GetNbPolyedreConnF(*theMeshInfo,theConn,aNbFaces,aNbConn);
+ PPolyedreInfo anInfo = CrPolyedreInfo(theMeshInfo,aNbElem,aNbConn,aNbFaces,theEntity,theGeom,theConn);
+ GetPolyedreInfo(*anInfo);
+ return anInfo;
+ }
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PCellInfo TWrapper::GetPCellInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
- EConnectivite theConn)
+ EConnectivite theConn,
+ TErr* theErr)
{
TInt aNbElem = GetNbCells(*theMeshInfo,theEntity,theGeom,theConn);
PCellInfo anInfo = CrCellInfo(theMeshInfo,aNbElem,theEntity,theGeom,theConn);
- GetCellInfo(*anInfo);
+ GetCellInfo(*anInfo,theErr);
+
+#ifdef _DEBUG_
+ TInt aConnDim = anInfo->GetConnDim();
+ INITMSG(MYDEBUG,"GetPCellInfo - theEntity = "<<theEntity<<"; theGeom = "<<theGeom<<"; aConnDim: "<<aConnDim<<"\n");
+ BEGMSG(MYDEBUG,"GetPCellInfo - aNbElem: "<<aNbElem<<": ");
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ for(TInt iConn = 0; iConn < aConnDim; iConn++){
+ ADDMSG(MYVALUEDEBUG,anInfo->GetConn(iElem,iConn)<<",");
+ }
+ ADDMSG(MYVALUEDEBUG," ");
+ }
+ ADDMSG(MYDEBUG,endl);
+
+ BEGMSG(MYDEBUG,"GetPCellInfo - GetFamNum: ");
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ ADDMSG(MYVALUEDEBUG,anInfo->GetFamNum(iElem)<<", ");
+ }
+ ADDMSG(MYDEBUG,endl);
+
+ if(anInfo->IsElemNum()){
+ BEGMSG(MYDEBUG,"GetPCellInfo - GetElemNum: ");
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ ADDMSG(MYVALUEDEBUG,anInfo->GetElemNum(iElem)<<", ");
+ }
+ ADDMSG(MYDEBUG,endl);
+ }
+
+ ADDMSG(MYDEBUG,endl);
+#endif
+
return anInfo;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- PFieldInfo TWrapper::GetPFieldInfo(const PMeshInfo& theMeshInfo, TInt theId)
+ PFieldInfo TWrapper::GetPFieldInfo(const PMeshInfo& theMeshInfo,
+ TInt theId,
+ TErr* theErr)
{
TInt aNbComp = GetNbComp(theId);
PFieldInfo anInfo = CrFieldInfo(theMeshInfo,aNbComp);
- GetFieldInfo(theId,*anInfo);
+ GetFieldInfo(theId,*anInfo,theErr);
return anInfo;
}
PTimeStampInfo TWrapper::GetPTimeStampInfo(const PFieldInfo& theFieldInfo,
EEntiteMaillage theEntity,
const MED::TGeom& theGeom,
- TInt theId)
+ TInt theId,
+ TErr* theErr)
{
PTimeStampInfo anInfo = CrTimeStampInfo(theFieldInfo,theEntity,theGeom);
- GetTimeStampInfo(theId,*anInfo);
+ GetTimeStampInfo(theId,*anInfo,theErr);
return anInfo;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- PTimeStampVal TWrapper::GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo)
+ PTimeStampVal TWrapper::GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
+ TErr* theErr)
{
PTimeStampVal anInfo = CrTimeStampVal(theTimeStampInfo);
- GetTimeStampVal(*anInfo);
+ GetTimeStampVal(*anInfo,theErr);
return anInfo;
}
}
struct TWrapper{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual PMeshInfo CrMeshInfo(TInt theDim = 0,
- const std::string& theValue = "",
- EMaillage theType = eNON_STRUCTURE,
- const std::string& theDesc = "") = 0;
-
- virtual PMeshInfo CrMeshInfo(const PMeshInfo& theInfo) = 0;
-
- virtual TInt GetNbMeshes(TErr* theErr = NULL) = 0;
+ virtual
+ PMeshInfo
+ CrMeshInfo(TInt theDim = 0,
+ const std::string& theValue = "",
+ EMaillage theType = eNON_STRUCTURE,
+ const std::string& theDesc = "") = 0;
+
+ virtual
+ PMeshInfo
+ CrMeshInfo(const PMeshInfo& theInfo) = 0;
+
+ virtual
+ TInt
+ GetNbMeshes(TErr* theErr = NULL) = 0;
- virtual void GetMeshInfo(TInt theMeshId, TMeshInfo&,
- TErr* theErr = NULL) = 0;
-
- virtual void SetMeshInfo(const TMeshInfo& theInfo,
- TErr* theErr = NULL) = 0;
+ virtual
+ void
+ GetMeshInfo(TInt theMeshId, TMeshInfo&,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ void
+ SetMeshInfo(const TMeshInfo& theInfo,
+ TErr* theErr = NULL) = 0;
- virtual PMeshInfo GetPMeshInfo(TInt theId);
+ virtual
+ PMeshInfo
+ GetPMeshInfo(TInt theId,
+ TErr* theErr = NULL);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbFamilies(const TMeshInfo& theMeshInfo,
- TErr* theErr = NULL) = 0;
-
- virtual TInt GetNbFamAttr(TInt theFamId,
- const TMeshInfo& theInfo,
- TErr* theErr = NULL) = 0;
-
- virtual TInt GetNbFamGroup(TInt theFamId,
- const TMeshInfo& theInfo,
- TErr* theErr = NULL) = 0;
+ virtual
+ TInt
+ GetNbFamilies(const TMeshInfo& theMeshInfo,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ TInt
+ GetNbFamAttr(TInt theFamId,
+ const TMeshInfo& theInfo,
+ TErr* theErr = NULL) = 0;
- virtual void GetFamilyInfo(TInt theFamId,
- TFamilyInfo& theInfo,
- TErr* theErr = NULL) = 0;
+ virtual
+ TInt
+ GetNbFamGroup(TInt theFamId,
+ const TMeshInfo& theInfo,
+ TErr* theErr = NULL) = 0;
- virtual void SetFamilyInfo(const TFamilyInfo& theInfo,
- TErr* theErr = NULL) = 0;
+ virtual
+ void
+ GetFamilyInfo(TInt theFamId,
+ TFamilyInfo& theInfo,
+ TErr* theErr = NULL) = 0;
- virtual PFamilyInfo CrFamilyInfo(const PMeshInfo& theMeshInfo,
- TInt theNbGroup = 0,
- TInt theNbAttr = 0,
- TInt theId = 0,
- const std::string& theValue = "") = 0;
+ virtual
+ void
+ SetFamilyInfo(const TFamilyInfo& theInfo,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ PFamilyInfo
+ CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbGroup = 0,
+ TInt theNbAttr = 0,
+ TInt theId = 0,
+ const std::string& theValue = "") = 0;
+
+ virtual
+ PFamilyInfo
+ CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ const std::string& theValue,
+ TInt theId,
+ const TStringSet& theGroupNames,
+ const TStringVector& theAttrDescs = TStringVector(),
+ const TIntVector& theAttrIds = TIntVector(),
+ const TIntVector& theAttrVals = TIntVector()) = 0;
+
+ virtual
+ PFamilyInfo
+ CrFamilyInfo(const PMeshInfo& theMeshInfo,
+ const PFamilyInfo& theInfo) = 0;
+
+ PFamilyInfo
+ GetPFamilyInfo(const PMeshInfo& theMeshInfo,
+ TInt theId,
+ TErr* theErr = NULL);
- virtual PFamilyInfo CrFamilyInfo(const PMeshInfo& theMeshInfo,
- const std::string& theValue,
- TInt theId,
- const TStringSet& theGroupNames,
- const TStringVector& theAttrDescs = TStringVector(),
- const TIntVector& theAttrIds = TIntVector(),
- const TIntVector& theAttrVals = TIntVector()) = 0;
-
- virtual PFamilyInfo CrFamilyInfo(const PMeshInfo& theMeshInfo,
- const PFamilyInfo& theInfo) = 0;
-
- PFamilyInfo GetPFamilyInfo(const PMeshInfo& theMeshInfo, TInt theId);
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbNodes(const TMeshInfo& theMeshInfo,
- TErr* theErr = NULL) = 0;
+ virtual
+ TInt
+ GetNbNodes(const TMeshInfo& theMeshInfo,
+ TErr* theErr = NULL) = 0;
- virtual void GetNodeInfo(TNodeInfo& theInfo,
- TErr* theErr = NULL) = 0;
-
- virtual void SetNodeInfo(const TNodeInfo& theInfo,
- TErr* theErr = NULL) = 0;
+ virtual
+ void
+ GetNodeInfo(TNodeInfo& theInfo,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ void
+ SetNodeInfo(const TNodeInfo& theInfo,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ PNodeInfo
+ CrNodeInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ ERepere theSystem = eCART,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI) = 0;
+
+ virtual
+ PNodeInfo
+ CrNodeInfo(const PMeshInfo& theMeshInfo,
+ ERepere theSystem,
+ const TFloatVector& theNodeCoords,
+ const TStringVector& theCoordNames,
+ const TStringVector& theCoordUnits,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector()) = 0;
+
+ virtual
+ PNodeInfo
+ CrNodeInfo(const PMeshInfo& theMeshInfo,
+ const PNodeInfo& theInfo) = 0;
+
+ PNodeInfo
+ GetPNodeInfo(const PMeshInfo& theMeshInfo,
+ TErr* theErr = NULL);
- virtual PNodeInfo CrNodeInfo(const PMeshInfo& theMeshInfo,
- TInt theNbElem,
- ERepere theSystem = eCART,
- EBooleen theIsElemNum = eVRAI,
- EBooleen theIsElemNames = eVRAI) = 0;
-
- virtual PNodeInfo CrNodeInfo(const PMeshInfo& theMeshInfo,
- ERepere theSystem,
- const TFloatVector& theNodeCoords,
- const TStringVector& theCoordNames,
- const TStringVector& theCoordUnits,
- const TIntVector& theFamilyNums,
- const TIntVector& theElemNums,
- const TStringVector& theElemNames = TStringVector()) = 0;
-
- virtual PNodeInfo CrNodeInfo(const PMeshInfo& theMeshInfo,
- const PNodeInfo& theInfo) = 0;
-
- PNodeInfo GetPNodeInfo(const PMeshInfo& theMeshInfo);
-
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TEntityInfo GetEntityInfo(const TMeshInfo& theMeshInfo,
- EConnectivite theTConn = eNOD,
- TErr* theErr = NULL) = 0;
-
- virtual TInt GetNbCells(const TMeshInfo& theMeshInfo,
- EEntiteMaillage,
- EGeometrieElement,
- EConnectivite theTConn = eNOD,
- TErr* theErr = NULL) = 0;
-
- virtual void GetCellInfo(TCellInfo& theInfo,
- TErr* theErr = NULL) = 0;
-
- virtual void SetCellInfo(const TCellInfo& theInfo,
- TErr* theErr = NULL) = 0;
-
- virtual PCellInfo CrCellInfo(const PMeshInfo& theMeshInfo,
- TInt theNbElem,
- EEntiteMaillage theTEntity,
- EGeometrieElement theTGeom,
- EConnectivite theTConn = eNOD,
- EBooleen theIsElemNum = eVRAI,
- EBooleen theIsElemNames = eVRAI) = 0;
-
- virtual PCellInfo CrCellInfo(const PMeshInfo& theMeshInfo,
- EEntiteMaillage theTEntity,
- EGeometrieElement theTGeom,
- EConnectivite theTConn,
- const TIntVector& theConnectivities,
- const TIntVector& theFamilyNums,
- const TIntVector& theElemNums,
- const TStringVector& theElemNames = TStringVector()) = 0;
-
- virtual PCellInfo CrCellInfo(const PMeshInfo& theMeshInfo,
- const PCellInfo& theInfo) = 0;
-
- PCellInfo GetPCellInfo(const PMeshInfo& theMeshInfo,
- EEntiteMaillage theEntity,
- EGeometrieElement theGeom,
- EConnectivite theConn = eNOD);
-
-
+ virtual
+ void
+ GetPolygoneInfo(TPolygoneInfo& theInfo,
+ TErr* theErr = NULL)
+ {}
+
+ virtual
+ void
+ SetPolygoneInfo(const TPolygoneInfo& theInfo,
+ TErr* theErr = NULL)
+ {}
+
+ virtual
+ TInt
+ GetNbPolygones(const TMeshInfo& theMeshInfo,
+ EEntiteMaillage,
+ EGeometrieElement,
+ EConnectivite,
+ TErr* theErr = NULL)
+ { return 0;}
+
+ virtual
+ TInt
+ GetNbPolygoneConn(const TMeshInfo& theMeshInfo,
+ EEntiteMaillage,
+ EGeometrieElement,
+ EConnectivite,
+ TErr* theErr = NULL)
+ { return 0;}
+
+ virtual
+ PPolygoneInfo
+ CrPolygoneInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ TInt theNbConn,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn = eNOD,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI)
+ {
+ return PPolygoneInfo();
+ }
+
+ virtual
+ PPolygoneInfo
+ CrPolygoneInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ const TIntVector& theConnectivities,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector())
+ {
+ return PPolygoneInfo();
+ }
+
+ virtual
+ PPolygoneInfo
+ CrPolygoneInfo(const PMeshInfo& theMeshInfo,
+ const PPolygoneInfo& theInfo)
+ {
+ return PPolygoneInfo();
+ }
+
+ PPolygoneInfo
+ GetPPolygoneInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theEntity,
+ EGeometrieElement theGeom,
+ EConnectivite theConn = eNOD);
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbFields(TErr* theErr = NULL) = 0;
+ virtual
+ void
+ GetPolyedreInfo(TPolyedreInfo& theInfo,
+ TErr* theErr = NULL)
+ {}
+
+ virtual
+ void
+ SetPolyedreInfo(const TPolyedreInfo& theInfo,
+ TErr* theErr = NULL)
+ {}
- virtual TInt GetNbComp(TInt theFieldId,
- TErr* theErr = NULL) = 0;
+ virtual
+ TInt
+ GetNbPolyedres(const TMeshInfo& theMeshInfo,
+ EEntiteMaillage,
+ EGeometrieElement,
+ EConnectivite,
+ TErr* theErr = NULL)
+ { return 0;}
+
+ virtual
+ void
+ GetNbPolyedreConnF(const TMeshInfo& theMeshInfo,
+ EConnectivite theConn,
+ TInt& nf,
+ TInt& nc,
+ TErr* theErr = NULL)
+ {}
- virtual void GetFieldInfo(TInt theFieldId,
- TFieldInfo& theInfo,
- TErr* theErr = NULL) = 0;
-
- virtual void SetFieldInfo(const TFieldInfo& theInfo,
- TErr* theErr = NULL) = 0;
+ virtual
+ PPolyedreInfo
+ CrPolyedreInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ TInt theNbConn,
+ TInt theNbFaces,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn = eNOD,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI)
+ {
+ return PPolyedreInfo();
+ }
+
+ virtual
+ PPolyedreInfo
+ CrPolyedreInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ const TIntVector& theConnectivities,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector())
+ {
+ return PPolyedreInfo();
+ }
+
+ virtual
+ PPolyedreInfo
+ CrPolyedreInfo(const PMeshInfo& theMeshInfo,
+ const PPolyedreInfo& theInfo)
+ {
+ return PPolyedreInfo();
+ }
+
+ PPolyedreInfo
+ GetPPolyedreInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theEntity,
+ EGeometrieElement theGeom,
+ EConnectivite theConn = eNOD);
+
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ virtual
+ TEntityInfo
+ GetEntityInfo(const TMeshInfo& theMeshInfo,
+ EConnectivite theTConn = eNOD,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ TInt
+ GetNbCells(const TMeshInfo& theMeshInfo,
+ EEntiteMaillage,
+ EGeometrieElement,
+ EConnectivite theTConn = eNOD,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ void
+ GetCellInfo(TCellInfo& theInfo,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ void
+ SetCellInfo(const TCellInfo& theInfo,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ PCellInfo
+ CrCellInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbElem,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn = eNOD,
+ EBooleen theIsElemNum = eVRAI,
+ EBooleen theIsElemNames = eVRAI) = 0;
+
+ virtual
+ PCellInfo
+ CrCellInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ const TIntVector& theConnectivities,
+ const TIntVector& theFamilyNums,
+ const TIntVector& theElemNums,
+ const TStringVector& theElemNames = TStringVector()) = 0;
+
+ virtual
+ PCellInfo
+ CrCellInfo(const PMeshInfo& theMeshInfo,
+ const PCellInfo& theInfo) = 0;
+ PCellInfo
+ GetPCellInfo(const PMeshInfo& theMeshInfo,
+ EEntiteMaillage theEntity,
+ EGeometrieElement theGeom,
+ EConnectivite theConn = eNOD,
+ TErr* theErr = NULL);
- virtual PFieldInfo CrFieldInfo(const PMeshInfo& theMeshInfo,
- TInt theNbComp = 0,
- ETypeChamp theType = eFLOAT64,
- const std::string& theValue = "",
- EBooleen theIsLocal = eVRAI,
- TInt theNbRef = 1) = 0;
- virtual PFieldInfo CrFieldInfo(const PMeshInfo& theMeshInfo,
- const PFieldInfo& theInfo) = 0;
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ virtual
+ TInt
+ GetNbFields(TErr* theErr = NULL) = 0;
+
+ virtual
+ TInt
+ GetNbComp(TInt theFieldId,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ void
+ GetFieldInfo(TInt theFieldId,
+ TFieldInfo& theInfo,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ void
+ SetFieldInfo(const TFieldInfo& theInfo,
+ TErr* theErr = NULL) = 0;
+
- PFieldInfo GetPFieldInfo(const PMeshInfo& theMeshInfo, TInt theId);
+ virtual
+ PFieldInfo
+ CrFieldInfo(const PMeshInfo& theMeshInfo,
+ TInt theNbComp = 0,
+ ETypeChamp theType = eFLOAT64,
+ const std::string& theValue = "",
+ EBooleen theIsLocal = eVRAI,
+ TInt theNbRef = 1) = 0;
+
+ virtual
+ PFieldInfo
+ CrFieldInfo(const PMeshInfo& theMeshInfo,
+ const PFieldInfo& theInfo) = 0;
+
+ PFieldInfo
+ GetPFieldInfo(const PMeshInfo& theMeshInfo,
+ TInt theId,
+ TErr* theErr = NULL);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbTimeStamps(const TFieldInfo& theInfo,
- const TEntityInfo& theEntityInfo,
- EEntiteMaillage& theEntity,
- TGeom& theGeom,
- TErr* theErr = NULL) = 0;
-
- virtual void GetTimeStampInfo(TInt theTimeStampId,
- TTimeStampInfo& theInfo,
- TErr* theErr = NULL) = 0;
-
- virtual PTimeStampInfo CrTimeStampInfo(const PFieldInfo& theFieldInfo,
- EEntiteMaillage theEntity,
- const TGeom& theGeom,
- TInt theNbGauss = 0,
- TInt theNumDt = 0,
- TInt theNumOrd = 0,
- TFloat theDt = 0,
- const std::string& theUnitDt = "",
- const std::string& theGaussName = "") = 0;
-
- virtual PTimeStampInfo CrTimeStampInfo(const PFieldInfo& theFieldInfo,
- const PTimeStampInfo& theInfo) = 0;
-
- PTimeStampInfo GetPTimeStampInfo(const PFieldInfo& theFieldInfo,
- EEntiteMaillage theEntity,
- const MED::TGeom& theGeom,
- TInt theId);
+ virtual
+ TInt
+ GetNbTimeStamps(const TFieldInfo& theInfo,
+ const TEntityInfo& theEntityInfo,
+ EEntiteMaillage& theEntity,
+ TGeom& theGeom,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ void
+ GetTimeStampInfo(TInt theTimeStampId,
+ TTimeStampInfo& theInfo,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ PTimeStampInfo
+ CrTimeStampInfo(const PFieldInfo& theFieldInfo,
+ EEntiteMaillage theEntity,
+ const TGeom& theGeom,
+ TInt theNbGauss = 0,
+ TInt theNumDt = 0,
+ TInt theNumOrd = 0,
+ TFloat theDt = 0,
+ const std::string& theUnitDt = "",
+ const std::string& theGaussName = "") = 0;
+
+ virtual
+ PTimeStampInfo
+ CrTimeStampInfo(const PFieldInfo& theFieldInfo,
+ const PTimeStampInfo& theInfo) = 0;
+
+ PTimeStampInfo
+ GetPTimeStampInfo(const PFieldInfo& theFieldInfo,
+ EEntiteMaillage theEntity,
+ const MED::TGeom& theGeom,
+ TInt theId,
+ TErr* theErr = NULL);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual void GetTimeStampVal(TTimeStampVal& theVal,
- TErr* theErr = NULL) = 0;
+ virtual
+ void
+ GetTimeStampVal(TTimeStampVal& theVal,
+ TErr* theErr = NULL) = 0;
- virtual void SetTimeStamp(const TTimeStampVal& theTimeStampVal,
- TErr* theErr = NULL) = 0;
-
- virtual PTimeStampVal CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
- const std::string& thePflName = "",
- EModeProfil thePflMode = eCOMPACT) = 0;
-
- virtual PTimeStampVal CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
- const PTimeStampVal& theInfo) = 0;
-
- PTimeStampVal GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo);
+ virtual
+ void
+ SetTimeStamp(const TTimeStampVal& theTimeStampVal,
+ TErr* theErr = NULL) = 0;
+
+ virtual
+ PTimeStampVal
+ CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
+ const std::string& thePflName = "",
+ EModeProfil thePflMode = eCOMPACT) = 0;
+
+ virtual
+ PTimeStampVal
+ CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
+ const PTimeStampVal& theInfo) = 0;
+
+ PTimeStampVal
+ GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
+ TErr* theErr = NULL);
};
# Libraries targets
LIB = libMEDWrapperBase.la
-LIB_SRC = MED_Wrapper.cxx MED_Algorithm.cxx MED_Utilities.cxx
+LIB_SRC = \
+ MED_Structures.cxx MED_Wrapper.cxx \
+ MED_Algorithm.cxx MED_Utilities.cxx
# Executables targets
BIN =
namespace MED{
- enum EVersion {eVUnknown = -1, eV2_1, eV2_2};
-
EVersion GetVersionId(const std::string& theFileName);
PWrapper CrWrapper(const std::string& theFileName);
TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
- TCellGroup aCellGroup = GetCellsByEntity(aMed,aMeshInfo,aEntityInfo);
+ TElemGroup aElemGroup = GetElemsByEntity(aMed,aMeshInfo,aEntityInfo);
TFamilyGroup aFamilyGroup = GetFamilies(aMed,aMeshInfo);
- TFamilyByEntity aFamilyByEntity = GetFamiliesByEntity(aMed,aNodeInfo,aCellGroup,aFamilyGroup);
+ TFamilyByEntity aFamilyByEntity = GetFamiliesByEntity(aMed,aNodeInfo,aElemGroup,aFamilyGroup);
TGroupInfo aGroupInfo = GetFamiliesByGroup(aFamilyGroup);
TInt aNbGroup = aFamilyInfo->GetNbGroup();
TInt aNbAttr = aFamilyInfo->GetNbAttr();
TInt anId = aFamilyInfo->GetId();
+ if(anId == 0)
+ continue;
+
aName = aFamilyInfo->GetName();
INITMSG(MYDEBUG,"aName = '"<<aName<<"'; anId = "<<anId<<
"; aNbAttr = "<<aNbAttr<<"; aNbGroup = "<<aNbGroup<<"\n");
INITMSG(MYDEBUG,"anEntity = "<<anEntity<<"\n");
if(anEntity == eNOEUD){
PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
- TInt aNbNodes = aNodeInfo->GetNbElem();
- INITMSG(MYDEBUG,"GetNodeInfo - aNbNodes = "<<aNbNodes<<": ");
- TNodeCoord& aCoord = aNodeInfo->myCoord;
- for(TInt iNode = 0; iNode < aNbNodes; iNode++){
- for(TInt iDim = 0, anId = iNode*aDim; iDim < aDim; iDim++, anId++){
- ADDMSG(MYVALUEDEBUG,aCoord[anId]<<",");
- aCoord[anId] += theIncr;
- }
- ADDMSG(MYVALUEDEBUG," ");
- }
- ADDMSG(MYDEBUG,endl);
PNodeInfo aNodeInfo2 = theMed->CrNodeInfo(aMeshInfo2,aNodeInfo);
if(MYWRITEDEBUG) theMed2->SetNodeInfo(aNodeInfo2);
continue;
const EGeometrieElement& aGeom = anTGeomIter->first;
const TInt& aNbElem = anTGeomIter->second;
INITMSG(MYDEBUG,"aGeom = "<<aGeom<<"; aNbElem = "<<aNbElem<<": ");
- PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
- TInt aConnDim = aCellInfo->GetConnDim();
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- for(TInt iConn = 0; iConn < aConnDim; iConn++){
- ADDMSG(MYVALUEDEBUG,aCellInfo->GetConn(iElem,iConn)<<",");
+ switch(aGeom){
+ case ePOLYGONE:
+ {
+ PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,anEntity,aGeom);
+ TElemNum aConn = aPolygoneInfo->GetConnectivite();
+ TElemNum aIndex = aPolygoneInfo->GetIndex();
+ TInt aNbIndex = aIndex.size();
+ TInt aIndex0 = aIndex[0];
+ for(TInt iElem = 1; iElem < aNbIndex; iElem++){
+ for (TInt i = aIndex0; i < aIndex[iElem];i++)
+ ADDMSG(MYVALUEDEBUG,aConn[i-1]<<",");
+ ADDMSG(MYDEBUG," ");
+ aIndex0 = aIndex[iElem];
+ }
+ ADDMSG(MYDEBUG,endl);
+ INITMSG(MYDEBUG,"Indexes :");
+ for(TInt iElem = 0; iElem < aIndex.size(); iElem++){
+ ADDMSG(MYVALUEDEBUG,aIndex[iElem]<<",");
+ }
+ ADDMSG(MYDEBUG,endl);
+ PPolygoneInfo aPolygoneInfo2 = theMed->CrPolygoneInfo(aMeshInfo2,aPolygoneInfo);
+ if(MYWRITEDEBUG) theMed2->SetPolygoneInfo(aPolygoneInfo2);
+ break;
+ }
+ case ePOLYEDRE:
+ {
+ PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,anEntity,aGeom);
+ TElemNum aConn = aPolyedreInfo->GetConnectivite();
+ TElemNum aFacesIndex = aPolyedreInfo->GetFacesIndex();
+ TElemNum aIndex = aPolyedreInfo->GetIndex();
+
+ TInt aNbIndex = aIndex.size();
+
+ for (int aNp = 0; aNp < aNbIndex-1;aNp++){
+ if (aPolyedreInfo->IsElemNames())
+ ADDMSG(MYDEBUG,aPolyedreInfo->GetElemName(aNp)<<endl);
+ else
+ ADDMSG(MYDEBUG,"POLYEDRE "<<aNp+1<<endl);
+
+ for (int aNf = aIndex[aNp]-1;aNf < aIndex[aNp+1]-1;aNf++){
+ ADDMSG(MYDEBUG,"Face "<<aNf-aIndex[aNp]+2<<": [");
+ for (int aNc = aFacesIndex[aNf]-1; aNc < aFacesIndex[aNf+1]-1;aNc++){
+ ADDMSG(MYDEBUG," "<<aConn[aNc]);
+ }
+ ADDMSG(MYDEBUG," ]"<<endl;);
+ }
+ }
+
+ PPolyedreInfo aPolyedreInfo2 = theMed->CrPolyedreInfo(aMeshInfo2,aPolyedreInfo);
+ if(MYWRITEDEBUG) theMed2->SetPolyedreInfo(aPolyedreInfo2);
+ break;
}
- ADDMSG(MYVALUEDEBUG," ");
+ default:
+ PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
+ PCellInfo aCellInfo2 = theMed2->CrCellInfo(aMeshInfo2,aCellInfo);
+ if(MYWRITEDEBUG) theMed2->SetCellInfo(aCellInfo2);
}
- ADDMSG(MYDEBUG,endl);
- PCellInfo aCellInfo2 = theMed->CrCellInfo(aMeshInfo2,aCellInfo);
- if(MYWRITEDEBUG) theMed2->SetCellInfo(aCellInfo2);
}
}
MED::EVersion theVersion,
int theNbCopy)
{
- MSG(MYDEBUG,"CopyMed - theFileName = '"<<theFileName<<"'; theFileName2 = '"<<theFileName2<<"'");
+ MSG(MYDEBUG,"CopyMed - theFileName = '"<<theFileName<<"'; theFileName2 = '"<<theFileName2<<"', theVersion = "<<theVersion);
PWrapper aMed = CrWrapper(theFileName);
void ReadMed(const char* theFileName,
const char* theFileName2,
- MED::EVersion theVersion = eV2_1,
+ MED::EVersion theVersion = eV2_2,
int theNbCopy = 1)
{
MSG(MYDEBUG,"theFileName = '"<<theFileName<<"'; "<<
}catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was accured :\n"<<exc.what());
}catch(...){
- MSG(MYDEBUG,"Unknown exception was accured in VISU_Convertor_impl");
+ MSG(MYDEBUG,"Unknown exception was accured");
}
return 1;
}
CPPFLAGS+= $(BOOST_CPPFLAGS) $(MED2_INCLUDES)
-LDFLAGS+= -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase
+LDFLAGS+= -lMEDWrapper_V2_2 -lMEDWrapper_V2_1
+
+LDFLAGSFORBIN=$(LDFLAGS) -lMEDWrapperBase
@CONCLUDE@
TInt TVWrapper::GetNbNodes(const MED::TMeshInfo& theMeshInfo,
TErr* theErr)
{
+ MSG(MYDEBUG,"TVWrapper::GetNbNodes");
+ INITMSG(MYDEBUG,"GetNbNodes ... ");
TFileWrapper aFileWrapper(myFile,eLECT,theErr);
if(theErr && *theErr < 0)
MED::TMeshInfo& aMeshInfo = const_cast<MED::TMeshInfo&>(theMeshInfo);
- return MEDnEntMaa(myFile->Id(),
- &aMeshInfo.myName[0],
- MED_COOR,
- MED_NOEUD,
- med_geometrie_element(0),
- med_connectivite(0));
+ TInt aRet = MEDnEntMaa(myFile->Id(),
+ &aMeshInfo.myName[0],
+ MED_COOR,
+ MED_NOEUD,
+ med_geometrie_element(0),
+ med_connectivite(0));
+
+ ADDMSG(MYDEBUG," nbnodes="<<aRet<<" ... OK"<<endl);
+ return aRet;
}
void TVWrapper::GetNodeInfo(MED::TNodeInfo& theInfo,
TErr* theErr)
{
+ MSG(MYDEBUG,"TVWrapper::GetNodeInfo");
+ INITMSG(MYDEBUG,"GetNodeInfo ... ");
TFileWrapper aFileWrapper(myFile,eLECT,theErr);
- if(theErr && *theErr < 0)
+ if(theErr && *theErr < 0 || theInfo.myNbElem<=0)
return;
MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo;
&anIsElemNum,
&theInfo.myFamNum[0],
theInfo.myNbElem);
+
+ ADDMSG(MYDEBUG," myDim="<<aMeshInfo.myDim<<" myNbElem="<<theInfo.myNbElem<<" ... ");
if(theErr)
*theErr = aRet;
else if(aRet < 0)
EXCEPTION(runtime_error,"GetNodeInfo - MEDnoeudsLire(...)");
+ ADDMSG(MYDEBUG,"OK"<<endl);
}
if(theErr && *theErr < 0)
return anInfo;
- if(TInt aNbElem = GetNbNodes(theMeshInfo)){
+ TInt aNbElem = GetNbNodes(theMeshInfo);
+ if(aNbElem > 0){
anInfo[eNOEUD][ePOINT1] = aNbElem;
const TEntity2GeomSet& anEntity2GeomSet = GetEntity2GeomSet();
TEntity2GeomSet::const_iterator anIter = anEntity2GeomSet.begin();
TGeomSet::const_iterator anIterEnd2 = aGeomSet.end();
for(; anIter2 != anIterEnd2; anIter2++){
const EGeometrieElement& aGeom = *anIter2;
- if(TInt aNb = GetNbCells(theMeshInfo,anEntity,aGeom,theTConn,theErr)){
- anInfo[anEntity][aGeom] = aNb;
- }
+ aNbElem = GetNbCells(theMeshInfo,anEntity,aGeom,theTConn,theErr);
+ if(aNbElem > 0)
+ anInfo[anEntity][aGeom] = aNbElem;
}
}
}
MED::TMeshInfo& aMeshInfo = const_cast<MED::TMeshInfo&>(theMeshInfo);
- med_entite_maillage& anEntity = static_cast<med_entite_maillage>(theTEntity);
- med_geometrie_element& aGeom = static_cast<med_geometrie_element>(theTGeom);
- med_connectivite& aConn = static_cast<med_connectivite>(theTConn);
+ med_entite_maillage anEntity = med_entite_maillage(theTEntity);
+ med_geometrie_element aGeom = med_geometrie_element(theTGeom);
+ med_connectivite aConn = med_connectivite(theTConn);
return MEDnEntMaa(myFile->Id(),
&aMeshInfo.myName[0],
const TInt PNOM = 8;
- typedef MED::TTMeshInfo<PNOM,DESC,IDENT,NOM,LNOM> TVMeshInfo;
+ typedef MED::TTMeshInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVMeshInfo;
- typedef MED::TTFamilyInfo<PNOM,DESC,IDENT,NOM,LNOM> TVFamilyInfo;
+ typedef MED::TTFamilyInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVFamilyInfo;
- typedef MED::TTNodeInfo<PNOM,DESC,IDENT,NOM,LNOM> TVNodeInfo;
+ typedef MED::TTNodeInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVNodeInfo;
- typedef MED::TTCellInfo<PNOM,DESC,IDENT,NOM,LNOM> TVCellInfo;
+ typedef MED::TTCellInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVCellInfo;
- typedef MED::TTFieldInfo<PNOM,DESC,IDENT,NOM,LNOM> TVFieldInfo;
+ typedef MED::TTFieldInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVFieldInfo;
- typedef MED::TTTimeStampInfo<PNOM,DESC,IDENT,NOM,LNOM> TVTimeStampInfo;
+ typedef MED::TTTimeStampInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVTimeStampInfo;
- typedef MED::TTTimeStampVal<PNOM,DESC,IDENT,NOM,LNOM> TVTimeStampVal;
+ typedef MED::TTTimeStampVal<PNOM,DESC,IDENT,NOM,LNOM,eV2_1> TVTimeStampVal;
//---------------------------------------------------------------
class TFile;
typedef enum {eLECT, eECRI, eREMP} EModeAcces;
//---------------------------------------------------------------
- class TVWrapper: public MED::TTWrapper<PNOM,DESC,IDENT,NOM,LNOM>{
+ class TVWrapper: public MED::TTWrapper<PNOM,DESC,IDENT,NOM,LNOM,eV2_1>
+ {
TVWrapper();
TVWrapper(const TVWrapper&);
TVWrapper& operator=(const TVWrapper&);
LDFLAGS+= $(HDF5_LIBS) -lMEDWrapperBase
+LDFLAGSFORBIN=$(LDFLAGS)
+
@CONCLUDE@
SetNodeInfo(theInfo,eLECTURE_AJOUT,theErr);
}
+ void TVWrapper::GetPolygoneInfo(MED::TPolygoneInfo& theInfo,
+ TErr* theErr)
+ {
+ TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+
+ if(theErr && !*theErr)
+ return;
+
+ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo;
+ TInt aNbElem = theInfo.myElemNum.size();
+
+ med_entite_maillage& anEntity = static_cast<med_entite_maillage>(theInfo.myTEntity);
+ med_connectivite& aConn = static_cast<med_connectivite>(theInfo.myTConn);
+
+ TErr aRet = 0;
+
+ aRet = MEDpolygoneConnLire(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &theInfo.myIndex[0],
+ aNbElem+1,
+ &theInfo.myConn[0],
+ anEntity,
+ aConn);
+
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"GetPolygoneInfo - MEDpolygoneInfo(...)");
+ }
+
+ void TVWrapper::SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
+ TErr* theErr)
+ {
+ SetPolygoneInfo(theInfo,eLECTURE_ECRITURE,theErr);
+ }
+
+ void TVWrapper::SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
+ EModeAcces theMode,
+ TErr* theErr)
+ {
+ TFileWrapper aFileWrapper(myFile,theMode,theErr);
+
+ if(theErr && !*theErr)
+ return;
+
+ MED::TPolygoneInfo& anInfo = const_cast<MED::TPolygoneInfo&>(theInfo);
+ MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo;
+
+ med_booleen& anIsElemNames = static_cast<med_booleen>(theInfo.myIsElemNames);
+ med_booleen& anIsElemNum = static_cast<med_booleen>(theInfo.myIsElemNum);
+ med_entite_maillage& anEntity = static_cast<med_entite_maillage>(theInfo.myTEntity);
+ med_connectivite& aConn = static_cast<med_connectivite>(theInfo.myTConn);
+
+ TErr aRet = MEDpolygoneConnEcr(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &anInfo.myIndex[0],
+ anInfo.myNbElem+1,
+ &anInfo.myConn[0],
+ anEntity,
+ aConn);
+
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"SetPolygoneInfo - MEDpolygoneConnEcr(...)");
+
+ if (anIsElemNames){
+ aRet = MEDnomEcr(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &anInfo.myElemNames[0],
+ anInfo.myElemNames.size(),
+ anEntity,
+ MED_POLYGONE);
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"SetPolygoneInfo - MEDnomEcr(...)");
+ }
+
+ if (anIsElemNum){
+ aRet = MEDnumEcr(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &anInfo.myElemNum[0],
+ anInfo.myElemNum.size(),
+ anEntity,
+ MED_POLYGONE);
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"SetPolygoneInfo - MEDnumEcr(...)");
+ }
+
+ aRet = MEDfamEcr(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &anInfo.myFamNum[0],
+ anInfo.myFamNum.size(),
+ anEntity,
+ MED_POLYGONE);
+
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"SetPolygoneInfo - MEDfamEcr(...)");
+ }
+
+ TInt TVWrapper::GetNbPolygones(const MED::TMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ TErr* theErr)
+ {
+ return GetNbCells(theMeshInfo,theTEntity,theTGeom,theTConn,theErr);
+ }
+
+ TInt TVWrapper::GetNbPolygoneConn(const MED::TMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ TErr* theErr)
+ {
+ TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+
+ if(theErr && !*theErr)
+ return 0;
+
+ MED::TMeshInfo& aMeshInfo = const_cast<MED::TMeshInfo&>(theMeshInfo);
+
+ med_entite_maillage& anEntity = static_cast<med_entite_maillage>(theTEntity);
+ med_connectivite& aConn = static_cast<med_connectivite>(theTConn);
+
+ med_int taille = 0;
+
+ TErr aRet = MEDpolygoneInfo(myFile->Id(),
+ &aMeshInfo.myName[0],
+ anEntity,
+ aConn,
+ &taille);
+
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"GetPolygoneInfo - MEDpolygoneInfo(...)");
+
+ return TInt(taille);
+ }
+
+ void TVWrapper::GetPolyedreInfo(TPolyedreInfo& theInfo,
+ TErr* theErr)
+ {
+ TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+
+ if(theErr && !*theErr)
+ return;
+
+ MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo;
+ TInt aNbElem = theInfo.myElemNum.size();
+
+ med_connectivite& aConn = static_cast<med_connectivite>(theInfo.myTConn);
+
+ TErr aRet = 0;
+
+ aRet = MEDpolyedreConnLire(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &theInfo.myIndex[0],
+ aNbElem+1,
+ &theInfo.myFacesIndex[0],
+ theInfo.myNbFacesIndex,
+ &theInfo.myConn[0],
+ aConn);
+
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"GetPolygoneInfo - MEDpolyedreConnLire(...)");
+ }
+
+ void TVWrapper::SetPolyedreInfo(const TPolyedreInfo& theInfo,
+ TErr* theErr)
+ {
+ SetPolyedreInfo(theInfo,eLECTURE_ECRITURE,theErr);
+ }
+
+ void TVWrapper::SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
+ EModeAcces theMode,
+ TErr* theErr)
+ {
+ TFileWrapper aFileWrapper(myFile,theMode,theErr);
+
+ if(theErr && !*theErr)
+ return;
+
+ MED::TPolyedreInfo& anInfo = const_cast<MED::TPolyedreInfo&>(theInfo);
+ MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo;
+
+ med_booleen& anIsElemNames = static_cast<med_booleen>(theInfo.myIsElemNames);
+ med_booleen& anIsElemNum = static_cast<med_booleen>(theInfo.myIsElemNum);
+ med_entite_maillage& anEntity = static_cast<med_entite_maillage>(theInfo.myTEntity);
+ med_connectivite& aConn = static_cast<med_connectivite>(theInfo.myTConn);
+
+ TErr aRet = MEDpolyedreConnEcr(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &anInfo.myIndex[0],
+ anInfo.myNbElem+1,
+ &anInfo.myFacesIndex[0],
+ anInfo.myNbFacesIndex,
+ &anInfo.myConn[0],
+ aConn);
+
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"SetPolyedreInfo - MEDpolyedreConnEcr(...)");
+
+ if (anIsElemNames){
+ aRet = MEDnomEcr(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &anInfo.myElemNames[0],
+ anInfo.myElemNames.size(),
+ anEntity,
+ MED_POLYEDRE);
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"SetPolyedreInfo - MEDnomEcr(...)");
+ }
+
+ if (anIsElemNum){
+ aRet = MEDnumEcr(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &anInfo.myElemNum[0],
+ anInfo.myElemNum.size(),
+ anEntity,
+ MED_POLYEDRE);
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"SetPolyedreInfo - MEDnumEcr(...)");
+ }
+
+
+ aRet = MEDfamEcr(myFile->Id(),
+ &aMeshInfo.myName[0],
+ &anInfo.myFamNum[0],
+ anInfo.myFamNum.size(),
+ anEntity,
+ MED_POLYEDRE);
+
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"SetPolyedreInfo - MEDfamEcr(...)");
+ }
+
+ TInt TVWrapper::GetNbPolyedres(const MED::TMeshInfo& theMeshInfo,
+ EEntiteMaillage theTEntity,
+ EGeometrieElement theTGeom,
+ EConnectivite theTConn,
+ TErr* theErr)
+ {
+ return GetNbCells(theMeshInfo,theTEntity,theTGeom,theTConn,theErr);
+ }
+
+ void TVWrapper::GetNbPolyedreConnF(const MED::TMeshInfo& theMeshInfo,
+ EConnectivite theTConn,
+ TInt& nf,
+ TInt& nc,
+ TErr* theErr)
+ {
+ TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+
+ if(theErr && !*theErr) EXCEPTION(runtime_error,"GetPolyedreInfo - (...)");
+
+ MED::TMeshInfo& aMeshInfo = const_cast<MED::TMeshInfo&>(theMeshInfo);
+ med_connectivite& aConn = static_cast<med_connectivite>(theTConn);
+
+ TErr aRet = MEDpolyedreInfo(myFile->Id(),
+ &aMeshInfo.myName[0],
+ aConn,
+ &nf,
+ &nc);
+
+ if(theErr)
+ *theErr = aRet;
+ else if(aRet < 0)
+ EXCEPTION(runtime_error,"GetPolygoneInfo - MEDpolyedreInfo(...)");
+
+ }
TEntityInfo TVWrapper::GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
EConnectivite theTConn,
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
- if(theErr && !*theErr)
+ if(theErr && *theErr < 0)
return anInfo;
- if(TInt aNbElem = GetNbNodes(theMeshInfo)){
+ TInt aNbElem = GetNbNodes(theMeshInfo);
+ if(aNbElem > 0){
anInfo[eNOEUD][ePOINT1] = aNbElem;
const TEntity2GeomSet& anEntity2GeomSet = GetEntity2GeomSet();
TEntity2GeomSet::const_iterator anIter = anEntity2GeomSet.begin();
TGeomSet::const_iterator anIterEnd2 = aGeomSet.end();
for(; anIter2 != anIterEnd2; anIter2++){
const EGeometrieElement& aGeom = *anIter2;
- if(TInt aNb = GetNbCells(theMeshInfo,anEntity,aGeom,theTConn,theErr)){
- anInfo[anEntity][aGeom] = aNb;
- }
+ aNbElem = GetNbCells(theMeshInfo,anEntity,aGeom,theTConn,theErr);
+ if(aNbElem > 0)
+ anInfo[anEntity][aGeom] = aNbElem;
}
}
}
MED::TMeshInfo& aMeshInfo = const_cast<MED::TMeshInfo&>(theMeshInfo);
- med_entite_maillage& anEntity = static_cast<med_entite_maillage>(theTEntity);
- med_geometrie_element& aGeom = static_cast<med_geometrie_element>(theTGeom);
- med_connectivite& aConn = static_cast<med_connectivite>(theTConn);
+ med_entite_maillage anEntity = med_entite_maillage(theTEntity);
+ med_geometrie_element aGeom = med_geometrie_element(theTGeom);
+ med_connectivite aConn = med_connectivite(theTConn);
return MEDnEntMaa(myFile->Id(),
&aMeshInfo.myName[0],
void TVWrapper::GetCellInfo(MED::TCellInfo& theInfo,
- TErr* theErr)
+ TErr* theErr)
{
TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
if(theErr)
*theErr = aRet;
else if(aRet < 0)
- EXCEPTION(runtime_error,"GetCellInfo - MEDelementsLire(...)");
+ EXCEPTION(runtime_error,"SetCellInfo - MEDelementsLire(...)");
}
TGeom::const_iterator anGeomIter = aTGeom.begin();
for(; anGeomIter != aTGeom.end(); anGeomIter++){
const med_geometrie_element& aGeom = static_cast<const med_geometrie_element>(anGeomIter->first);
- aNbTimeStamps = MEDnPasdetemps(myFile->Id(),&anInfo.myName[0],anEntity,aGeom);
- if(aNbTimeStamps){
+ TInt aTmp = MEDnPasdetemps(myFile->Id(),&anInfo.myName[0],anEntity,aGeom);
+ aNbTimeStamps = max(aTmp,aNbTimeStamps);
+ BEGMSG(MYDEBUG,"GetNbTimeStamps aNbTimeStamps="<<aTmp<<"; aGeom="<<aGeom<<"; anEntity="<<anEntity<<"\n");
+ if(aTmp){
theEntity = EEntiteMaillage(anEntity);
theGeom[EGeometrieElement(aGeom)] = anGeomIter->second;
}
}
- if(aNbTimeStamps)
+ if(!theGeom.empty())
break;
}
return aNbTimeStamps;
aTimeStampInfo.myNumDt,
aTimeStampInfo.myNumOrd);
if(aRet >= 0)
- for(TInt i = 0; i < iEnd; i++)
+ for(TInt i = 0; i < iEnd; i++) {
aValue[i] = anArray[i];
+ MSG(MYDEBUG," "<<anArray[i]);
+ }
break;
}
default: {
const TInt PNOM = 16;
- typedef MED::TTMeshInfo<PNOM,DESC,IDENT,NOM,LNOM> TVMeshInfo;
+ typedef MED::TTMeshInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_2> TVMeshInfo;
- typedef MED::TTFamilyInfo<PNOM,DESC,IDENT,NOM,LNOM> TVFamilyInfo;
+ typedef MED::TTFamilyInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_2> TVFamilyInfo;
- typedef MED::TTNodeInfo<PNOM,DESC,IDENT,NOM,LNOM> TVNodeInfo;
+ typedef MED::TTNodeInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_2> TVNodeInfo;
- typedef MED::TTCellInfo<PNOM,DESC,IDENT,NOM,LNOM> TVCellInfo;
+ typedef MED::TTCellInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_2> TVCellInfo;
- typedef MED::TTFieldInfo<PNOM,DESC,IDENT,NOM,LNOM> TVFieldInfo;
+ typedef MED::TTFieldInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_2> TVFieldInfo;
- typedef MED::TTTimeStampInfo<PNOM,DESC,IDENT,NOM,LNOM> TVTimeStampInfo;
+ typedef MED::TTTimeStampInfo<PNOM,DESC,IDENT,NOM,LNOM,eV2_2> TVTimeStampInfo;
- typedef MED::TTTimeStampVal<PNOM,DESC,IDENT,NOM,LNOM> TVTimeStampVal;
+ typedef MED::TTTimeStampVal<PNOM,DESC,IDENT,NOM,LNOM,eV2_2> TVTimeStampVal;
//---------------------------------------------------------------
class TFile;
typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
//---------------------------------------------------------------
- class TVWrapper: public MED::TTWrapper<PNOM,DESC,IDENT,NOM,LNOM>{
+ class TVWrapper: public MED::TTWrapper<PNOM,DESC,IDENT,NOM,LNOM,eV2_2>{
TVWrapper();
TVWrapper(const TVWrapper&);
TVWrapper& operator=(const TVWrapper&);
TVWrapper(const std::string& theFileName);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbMeshes(TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbMeshes(TErr* theErr = NULL);
- virtual void GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
+ virtual
+ void
+ GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
TErr* theErr = NULL);
- virtual void SetMeshInfo(const MED::TMeshInfo& theInfo,
- TErr* theErr = NULL);
+ virtual
+ void
+ SetMeshInfo(const MED::TMeshInfo& theInfo,
+ TErr* theErr = NULL);
void SetMeshInfo(const MED::TMeshInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
-
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
- TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
+ TErr* theErr = NULL);
- virtual TInt GetNbFamAttr(TInt theFamId,
- const MED::TMeshInfo& theInfo,
- TErr* theErr = NULL);
-
- virtual TInt GetNbFamGroup(TInt theFamId,
- const MED::TMeshInfo& theInfo,
- TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbFamAttr(TInt theFamId,
+ const MED::TMeshInfo& theInfo,
+ TErr* theErr = NULL);
- virtual void GetFamilyInfo(TInt theFamId,
- MED::TFamilyInfo& theInfo,
- TErr* theErr = NULL);
-
- virtual void SetFamilyInfo(const MED::TFamilyInfo& theInfo,
- TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbFamGroup(TInt theFamId,
+ const MED::TMeshInfo& theInfo,
+ TErr* theErr = NULL);
+
+ virtual
+ void
+ GetFamilyInfo(TInt theFamId,
+ MED::TFamilyInfo& theInfo,
+ TErr* theErr = NULL);
+
+ virtual
+ void
+ SetFamilyInfo(const MED::TFamilyInfo& theInfo,
+ TErr* theErr = NULL);
+
+ void
+ SetFamilyInfo(const MED::TFamilyInfo& theInfo,
+ EModeAcces theMode,
+ TErr* theErr = NULL);
- void SetFamilyInfo(const MED::TFamilyInfo& theInfo,
- EModeAcces theMode,
- TErr* theErr = NULL);
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbNodes(const MED::TMeshInfo& theMeshInfo,
- TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbNodes(const MED::TMeshInfo& theMeshInfo,
+ TErr* theErr = NULL);
- virtual void GetNodeInfo(MED::TNodeInfo& theInfo,
- TErr* theErr = NULL);
+ virtual
+ void
+ GetNodeInfo(MED::TNodeInfo& theInfo,
+ TErr* theErr = NULL);
+
+ virtual
+ void
+ SetNodeInfo(const MED::TNodeInfo& theInfo,
+ TErr* theErr = NULL);
+
+ void
+ SetNodeInfo(const MED::TNodeInfo& theInfo,
+ EModeAcces theMode,
+ TErr* theErr = NULL);
+
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ virtual
+ void
+ GetPolygoneInfo(TPolygoneInfo& theInfo,
+ TErr* theErr = NULL);
- virtual void SetNodeInfo(const MED::TNodeInfo& theInfo,
- TErr* theErr = NULL);
+ virtual
+ void
+ SetPolygoneInfo(const TPolygoneInfo& theInfo,
+ TErr* theErr = NULL);
- void SetNodeInfo(const MED::TNodeInfo& theInfo,
- EModeAcces theMode,
- TErr* theErr = NULL);
+ void
+ SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
+ EModeAcces theMode,
+ TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbPolygones(const TMeshInfo& theMeshInfo,
+ EEntiteMaillage,
+ EGeometrieElement,
+ EConnectivite,
+ TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbPolygoneConn(const TMeshInfo& theMeshInfo,
+ EEntiteMaillage,
+ EGeometrieElement,
+ EConnectivite,
+ TErr* theErr = NULL);
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TEntityInfo GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
- EConnectivite theTConn = eNOD,
- TErr* theErr = NULL);
+ virtual
+ void
+ GetPolyedreInfo(TPolyedreInfo& theInfo,
+ TErr* theErr = NULL);
- virtual TInt GetNbCells(const MED::TMeshInfo& theMeshInfo,
- EEntiteMaillage,
- EGeometrieElement,
- EConnectivite theTConn = eNOD,
- TErr* theErr = NULL);
+ virtual
+ void
+ SetPolyedreInfo(const TPolyedreInfo& theInfo,
+ TErr* theErr = NULL);
- virtual void GetCellInfo(MED::TCellInfo& theInfo,
- TErr* theErr = NULL);
-
- virtual void SetCellInfo(const MED::TCellInfo& theInfo,
- TErr* theErr = NULL);
+ void
+ SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
+ EModeAcces theMode,
+ TErr* theErr = NULL);
- void SetCellInfo(const MED::TCellInfo& theInfo,
- EModeAcces theMode,
- TErr* theErr = NULL);
-
+ virtual
+ TInt
+ GetNbPolyedres(const TMeshInfo& theMeshInfo,
+ EEntiteMaillage,
+ EGeometrieElement,
+ EConnectivite,
+ TErr* theErr = NULL);
+
+ virtual
+ void
+ GetNbPolyedreConnF(const TMeshInfo& theMeshInfo,
+ EConnectivite,
+ TInt& nf,
+ TInt& nc,
+ TErr* theErr = NULL);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbFields(TErr* theErr = NULL);
+ virtual
+ TEntityInfo
+ GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
+ EConnectivite theTConn = eNOD,
+ TErr* theErr = NULL);
- virtual TInt GetNbComp(TInt theFieldId,
- TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbCells(const MED::TMeshInfo& theMeshInfo,
+ EEntiteMaillage,
+ EGeometrieElement,
+ EConnectivite theTConn = eNOD,
+ TErr* theErr = NULL);
- virtual void GetFieldInfo(TInt theFieldId,
- MED::TFieldInfo& theInfo,
- TErr* theErr = NULL);
+ virtual
+ void
+ GetCellInfo(MED::TCellInfo& theInfo,
+ TErr* theErr = NULL);
- virtual void SetFieldInfo(const MED::TFieldInfo& theInfo,
- TErr* theErr = NULL);
+ virtual
+ void
+ SetCellInfo(const MED::TCellInfo& theInfo,
+ TErr* theErr = NULL);
+
+ void
+ SetCellInfo(const MED::TCellInfo& theInfo,
+ EModeAcces theMode,
+ TErr* theErr = NULL);
- void SetFieldInfo(const MED::TFieldInfo& theInfo,
- EModeAcces theMode,
- TErr* theErr = NULL);
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- virtual TInt GetNbTimeStamps(const MED::TFieldInfo& theInfo,
- const MED::TEntityInfo& theEntityInfo,
- EEntiteMaillage& theEntity,
- TGeom& theGeom,
- TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbFields(TErr* theErr = NULL);
- virtual void GetTimeStampInfo(TInt theTimeStampId,
- MED::TTimeStampInfo& theInfo,
- TErr* theErr = NULL);
-
- virtual void GetTimeStampVal(MED::TTimeStampVal& theVal,
- TErr* theErr = NULL);
+ virtual
+ TInt
+ GetNbComp(TInt theFieldId,
+ TErr* theErr = NULL);
- virtual void SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
- TErr* theErr = NULL);
+ virtual
+ void
+ GetFieldInfo(TInt theFieldId,
+ MED::TFieldInfo& theInfo,
+ TErr* theErr = NULL);
+
+ virtual
+ void
+ SetFieldInfo(const MED::TFieldInfo& theInfo,
+ TErr* theErr = NULL);
+
+ void
+ SetFieldInfo(const MED::TFieldInfo& theInfo,
+ EModeAcces theMode,
+ TErr* theErr = NULL);
+
+
+ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ virtual
+ TInt
+ GetNbTimeStamps(const MED::TFieldInfo& theInfo,
+ const MED::TEntityInfo& theEntityInfo,
+ EEntiteMaillage& theEntity,
+ TGeom& theGeom,
+ TErr* theErr = NULL);
+
+ virtual
+ void
+ GetTimeStampInfo(TInt theTimeStampId,
+ MED::TTimeStampInfo& theInfo,
+ TErr* theErr = NULL);
+
+ virtual
+ void
+ GetTimeStampVal(MED::TTimeStampVal& theVal,
+ TErr* theErr = NULL);
+
+ virtual
+ void
+ SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
+ TErr* theErr = NULL);
+
+ void
+ SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
+ EModeAcces theMode,
+ TErr* theErr = NULL);
- void SetTimeStamp(const MED::TTimeStampVal& theTimeStampVal,
- EModeAcces theMode,
- TErr* theErr = NULL);
-
protected:
PFile myFile;
};
PortableServer::POA_ptr poa,
char * containerName,
int argc, char *argv[])
- : Engines_Container_i(orb,poa,containerName,argc,argv,false,false), MPIObject_i(nbproc,numproc)
+ : Engines_Container_i(orb,poa,containerName,argc,argv,false), MPIObject_i(nbproc,numproc)
{
MESSAGE("[" << numproc << "] activate object");
_id = _poa->activate_object(this);
CPPFLAGS+=$(QT_INCLUDES) $(OGL_INCLUDES)
LDFLAGS+=$(QT_MT_LIBS) $(OGL_LIBS)
+LDFLAGSFORBIN=$(LDFLAGS)
@CONCLUDE@
SUBDIRS = MSG2QM SALOMELocalTrace SALOMETraceCollector Logger Utils CASCatch PatchQt \
GenericObj MEDWrapper NamingService Registry \
ModuleCatalog DataTypeCatalog RessourcesCatalog \
- Notification NOTIFICATION_SWIG \
+ ResourcesManager Notification NOTIFICATION_SWIG \
Container TestContainer LifeCycleCORBA HDFPersist Prs \
VTKFilter OBJECT \
TOOLSDS SALOMEDS Event \
SUBDIRS = MSG2QM SALOMELocalTrace SALOMETraceCollector Logger Utils CASCatch \
GenericObj NamingService Registry \
ModuleCatalog DataTypeCatalog RessourcesCatalog \
- Notification NOTIFICATION_SWIG \
+ ResourcesManager Notification NOTIFICATION_SWIG \
Container TestContainer LifeCycleCORBA HDFPersist Prs \
TOOLSDS SALOMEDS Event \
SALOME_SWIG_WITHOUTIHM ModuleGenerator Loader Communication
BIN_SERVER_IDL = SALOME_ModuleCatalog.idl
CPPFLAGS+= $(QT_MT_INCLUDES)
-LDFLAGS+= $(QT_MT_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace -lSALOMETraceCollector
+LDFLAGS+= $(QT_MT_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace
+LDFLAGSFORBIN= $(LDFLAGS) -lSALOMETraceCollector
@CONCLUDE@
// initialize POA
//
- long TIMESleep = 250000000;
+ long TIMESleep = 500000000;
int NumberOfTries = 40;
int a;
timespec ts_req;
* \param serverName name of the server to find.
* \param NS SALOME_NamingService object
* Wait until the given server is ready i.e. is name is found in namingService.
- * Try 40 times, with 250 ms sleep between each try.
+ * Try 40 times, with 500 ms sleep between each try.
* If Logger is used for traces, it must be ready before this call, because
* SALOME_NamingService client uses SALOME traces. So, Logger readiness must be
* checked in Launch script before execution of WaitForServerReadiness.
void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
string serverName)
{
- long TIMESleep = 250000000; // 250 ms.
- int NumberOfTries = 40; // total wait = 10 s.
+ long TIMESleep = 500000000; // 500 ms.
+ int NumberOfTries = 40; // total wait = 20 s.
int found = 0;
timespec ts_req;
// the directories
length_path = length_path + strlen(result_path[k]) + 1;
}
- char* return_Path = new char[length_path +1];
+ char* return_Path = new char[length_path +2];
return_Path[0] = '/' ;
return_Path[1] = '\0' ;
for (int k = 0 ; k <i ;k++)
return _list;
}
+//----------------------------------------------------------------------
+/*! Function : list_directory_recurs
+ * Purpose : method to get all the contexts contained in the current
+ * directory
+ * Get only objects and is recursive
+ * If the NamingService is out, the exception ServiceUnreachable is thrown
+ */
+//----------------------------------------------------------------------
+vector<string> SALOME_NamingService::list_directory_recurs()
+ throw(ServiceUnreachable)
+{
+ vector<string> _list ;
+ char *currentDir=Current_Directory();
+ _list_directory_recurs(_list,0,currentDir);
+ delete [] currentDir;
+ return _list;
+}
//----------------------------------------------------------------------
/*! Function : Destroy_Name
// We go to the last directory where an occurence was found
_current_context = _ref_context ;
}
+
+
+//----------------------------------------------------------------------
+/*! Function :_list_directory_recurs.
+ * Purpose : method to list recursively all the objects contained in the tree of absCurDirectory/relativeSubDir.
+ * \param myList The list that will be filled.
+ * \param relativeSubDir The directory from absCurDirectory in which the objects are found.
+ * \param absCurDirectory The directory in ABSOLUTE form.
+ * _current_context must refer to absCurDirectory.
+ */
+//----------------------------------------------------------------------
+void SALOME_NamingService::_list_directory_recurs(vector<string>& myList, const char *relativeSubDir,const char *absCurDirectory)
+{
+ CosNaming::BindingList_var _binding_list;
+ CosNaming::BindingIterator_var _binding_iterator;
+ unsigned long nb=0 ; // for using only the BindingIterator to access the bindings
+ CosNaming::Binding_var _binding ;
+ char *absDir;
+
+ CosNaming::NamingContext_var _ref_context = _current_context;
+ if(relativeSubDir)
+ {
+ Change_Directory(relativeSubDir);
+ absDir=new char[strlen(absCurDirectory)+2+strlen(relativeSubDir)];
+ strcpy(absDir,absCurDirectory);
+ strcat(absDir,relativeSubDir);
+ strcat(absDir,"/");
+ }
+ else
+ absDir=(char *)absCurDirectory;
+ _current_context->list(nb, _binding_list, _binding_iterator) ;
+
+ while (_binding_iterator->next_one(_binding)) {
+ CosNaming::Name _bindingName = _binding->binding_name;
+ if (_binding->binding_type == CosNaming::ncontext) {
+ _list_directory_recurs(myList,_bindingName[0].id,absDir);
+ }
+ else if (_binding->binding_type == CosNaming::nobject) {
+ char *elt=new char[strlen(absDir)+2+strlen(_bindingName[0].id)];
+ strcpy(elt,absDir);
+ strcat(elt,_bindingName[0].id);
+ myList.push_back(elt);
+ delete [] elt;
+ }
+ }
+ if(relativeSubDir)
+ {
+ _current_context = _ref_context ;
+ delete [] absDir;
+ }
+
+ _binding_iterator->destroy();
+}
+
//----------------------------------------------------------------------
// Get only objects, isn't iterative
std::vector<std::string> list_directory()
throw(ServiceUnreachable);
+
+ //!methods that lists all objects RECUSIVELY in the current directory
+ std::vector<std::string> list_directory_recurs()
+ throw(ServiceUnreachable);
//! method to destroy an association Path-Object Reference
void Destroy_Name(const char* Path)
int& length_result,
CosNaming::NamingContext_var context_to_found,
CORBA::Boolean& _continue);
+
+ //! internal method to list all (recursively) the objects contains in absCurDirectory/relativeSubDir.
+ void _list_directory_recurs(std::vector<std::string>& myList, const char *relativeSubDir,const char *absCurDirectory);
+
};
#endif // SALOME_NAMINGSERVICE_H
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOME_ModuleCatalog.idl \
SALOME_Component.idl \
+ SALOME_ContainerManager.idl \
SALOME_Exception.idl
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOME_ModuleCatalog.idl \
SALOME_Component.idl \
+ SALOME_ContainerManager.idl \
SALOME_Exception.idl
CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(OGL_INCLUDES) $(PYTHON_INCLUDES) $(QWT_INCLUDES)
BIN_SRC =
BIN_SERVER_IDL = SALOME_Registry.idl
-LDFLAGS+= -lSalomeNS -lOpUtil -lSALOMELocalTrace -lSALOMETraceCollector
+LDFLAGS+= -lSalomeNS -lOpUtil -lSALOMELocalTrace
+
+LDFLAGSFORBIN= $(LDFLAGS) -lSALOMETraceCollector
@CONCLUDE@
CPPFLAGS+= $(QT_MT_INCLUDES)
CXXFLAGS+=
-LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace -lSALOMETraceCollector
+LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace
+LDFLAGSFORBIN= $(LDFLAGS) -lSALOMETraceCollector
@CONCLUDE@
# Executables targets
BIN = SALOMEDS_Server SALOMEDS_Client
BIN_SRC =
-LIB_SERVER_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl
+LIB_SERVER_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl SALOME_ContainerManager.idl
BIN_SERVER_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl
BIN_CLIENT_IDL =
LIB_CLIENT_IDL = SALOME_Component.idl SALOME_GenericObj.idl
CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace $(CAS_LDPATH) -lTKCAF -lTKBO -lTKStdSchema -lSalomeGenericObj -lSalomeLifeCycleCORBA
+LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace $(CAS_LDPATH) -lTKCAF -lTKBO -lTKStdSchema -lSalomeGenericObj -lSalomeLifeCycleCORBA -lSalomeContainer -lSalomeResourcesManager
# _CS_gbo_090604 Ajout Spécifique Calibre 3, pour l'utilisation de la version 5.12 de la bibliothèque OCC.
# La bibliothèque OCC5.12 a été compilée sur Calibre 3 avec l'extention Xmu (impossible de compiler sans).
#
LDXMUFLAGS= -L/usr/X11R6/lib -lXmu
LDFLAGS+=$(LDXMUFLAGS)
-
+LDFLAGSFORBIN= $(LDFLAGS) -lRegistry -lSalomeNotification -lSALOMETraceCollector
@CONCLUDE@
void SALOMEDS_AttributeIOR_i::SetValue(const char* value)
{
CheckLocked();
- const CORBA::ORB_var& anORB = _mySObject->GetORB();
- SALOMEDS::Study_var aStudy = SALOMEDS_Study_i::GetStudy(_myAttr->Label(),anORB);
+ SALOMEDS_Study_i* aStudy = _mySObject->GetStudyServant();
aStudy->AddCreatedPostponed(value);
aStudy->AddPostponed(Value());
CORBA::String_var Str = CORBA::string_dup(value);
Handle(TDataStd_Comment)::DownCast(_myAttr)->Set(TCollection_ExtendedString(Str));
- SALOMEDS_Study_i::IORUpdated(Handle(SALOMEDS_IORAttribute)::DownCast(_myAttr),anORB);
+ aStudy->IORUpdated(Handle(SALOMEDS_IORAttribute)::DownCast(_myAttr));
}
_lab(theLabel),
_study(theStudy)
{
- TCollection_AsciiString anEntry;
- TDF_Tool::Entry(theLabel,anEntry);
}
//============================================================================
//============================================================================
void SALOMEDS_ChildIterator_i::Init()
{
- _it.Initialize (_lab);
+ _it.Initialize(_lab);
}
//============================================================================
*
*/
//============================================================================
-void SALOMEDS_ChildIterator_i::InitEx(CORBA::Boolean allLevels)
+void SALOMEDS_ChildIterator_i::InitEx(CORBA::Boolean theIsAllLevels)
{
- _it.Initialize (_lab, allLevels);
+ _it.Initialize(_lab,theIsAllLevels);
}
//============================================================================
void SALOMEDS_ChildIterator_i::Next()
{
_it.Next();
- TCollection_AsciiString anEntry;
- TDF_Tool::Entry(_it.Value(),anEntry);
}
return SALOMEDS_SObject_i::NewRef(_study,_it.Value())._retn();
}
+SALOMEDS_SObject_i* SALOMEDS_ChildIterator_i::GetValue()
+{
+ return SALOMEDS_SObject_i::NewPtr(_study,_it.Value());
+}
#include <TDF_Label.hxx>
class SALOMEDS_Study_i;
+class SALOMEDS_SObject_i;
class SALOMEDS_ChildIterator_i: public POA_SALOMEDS::ChildIterator,
public PortableServer::RefCountServantBase
~SALOMEDS_ChildIterator_i();
- TDF_Label GetValue() { return _it.Value();}
+ SALOMEDS_SObject_i* GetValue();
virtual void Init();
virtual void InitEx(CORBA::Boolean);
// Module : SALOME
// $Header$
-#include "SALOMEDS_IORAttribute.ixx"
#include <TDataStd_Comment.hxx>
#include <TCollection_ExtendedString.hxx>
+
+#include "SALOMEDS_IORAttribute.ixx"
#include "SALOMEDS_Study_i.hxx"
+
using namespace std;
//=======================================================================
Handle(SALOMEDS_IORAttribute) SALOMEDS_IORAttribute::Set (const TDF_Label& L,
const TCollection_ExtendedString& S,
- CORBA::ORB_ptr orb)
+ SALOMEDS_Study_i* theStudy)
{
Handle(SALOMEDS_IORAttribute) A;
if (!L.FindAttribute(SALOMEDS_IORAttribute::GetID(),A)) {
}
(Handle(TDataStd_Comment)::DownCast(A))->Set (S);
- SALOMEDS_Study_i::IORUpdated(A,orb);
+ theStudy->IORUpdated(A);
return A;
}
class TCollection_ExtendedString;
class TDF_Attribute;
class TDF_RelocationTable;
-
+class SALOMEDS_Study_i;
class SALOMEDS_IORAttribute : public TDataStd_Comment {
// Methods PUBLIC
//
Standard_EXPORT static const Standard_GUID& GetID() ;
-Standard_EXPORT static Handle_SALOMEDS_IORAttribute Set(const TDF_Label& label,const TCollection_ExtendedString& string, CORBA::ORB_ptr orb) ;
+Standard_EXPORT static Handle_SALOMEDS_IORAttribute Set(const TDF_Label& label,
+ const TCollection_ExtendedString& string,
+ SALOMEDS_Study_i* theStudy) ;
Standard_EXPORT SALOMEDS_IORAttribute();
Standard_EXPORT const Standard_GUID& ID() const;
Standard_EXPORT void Restore(const Handle(TDF_Attribute)& with) ;
if(anIter != anSObjectMap.end())
aSObjectHolder = anIter->second;
else{
- TCollection_AsciiString anEntry;
- TDF_Tool::Entry(theLabel,anEntry);
SALOMEDS_SObject_i* aSObject = new SALOMEDS_SObject_i(theStudy,theLabel);
aSObjectHolder.first = aSObject;
aSObjectHolder.second = aSObject->_this();
anSObjectMap[theLabel] = aSObjectHolder;
+
+ //TCollection_AsciiString anEntry;
+ //TDF_Tool::Entry(theLabel,anEntry);
+ //cout<<"APO - SALOMEDS_SObject_i::New - anEntry = "<<anEntry.ToCString()<<endl;
}
return aSObjectHolder;
}
* Purpose : Returns list of all attributes for this sobject
*/
//============================================================================
-SALOMEDS_GenericAttribute_i*
+SALOMEDS_SObject_i::TAttrHolder
SALOMEDS_SObject_i::_FindGenAttribute(const Handle(TDF_Attribute)& theAttr)
{
- SALOMEDS_GenericAttribute_i* anGenAttr = NULL;
+ TAttrHolder anGenAttr;
Standard_GUID aGUID = theAttr->ID();
TGUID2AttrIDMap::const_iterator anIter = __GUID2AttrIDMap__.find(aGUID);
- if(anIter != __GUID2AttrIDMap__.end())
- {
- const ::TAttributeID& anAttributeID = anIter->second;
- TAttrMap::const_iterator anIter = myAttrMap.find(anAttributeID);
- if(anIter != myAttrMap.end())
- anGenAttr = anIter->second;
-
- if(anGenAttr != NULL){
- if(anGenAttr->GetAttribute() != theAttr)
- anGenAttr->SetAttribute(theAttr);
- }else{
- anGenAttr = _CreateGenAttribute(theAttr,anAttributeID.c_str());
- }
+ if(anIter != __GUID2AttrIDMap__.end()){
+ const TAttributeID& anAttributeID = anIter->second;
+ anGenAttr = _FindGenAttribute(anAttributeID.c_str());
}
return anGenAttr;
Standard_Integer i = 0;
for(TDF_AttributeIterator iter(_lab); iter.More(); iter.Next()) {
Handle(TDF_Attribute) anAttr = iter.Value();
- if(SALOMEDS_GenericAttribute_i* anGenAttr = _FindGenAttribute(anAttr))
+ TAttrHolder anAttrHolder = _FindGenAttribute(anAttr);
+ SALOMEDS::GenericAttribute_var anGenAttr = anAttrHolder.second;
+ if(!anGenAttr->_is_nil())
{
aSeqOfAttr->length(++i);
- aSeqOfAttr[i-1] = anGenAttr->_this();
+ aSeqOfAttr[i-1] = anGenAttr._retn();
}
}
}
* Purpose : Find attribute of given type on this SObject
*/
//============================================================================
-SALOMEDS_GenericAttribute_i*
+SALOMEDS_SObject_i::TAttrHolder
SALOMEDS_SObject_i::_CreateGenAttribute(const Handle(TDF_Attribute)& theAttr,
const char* theType)
{
-
+ SALOMEDS_GenericAttribute_i* anAttr;
TAttrID2FunMap::const_iterator anIter = __AttrID2FunMap__.find(theType);
if(anIter != __AttrID2FunMap__.end()){
const TAttrID2FunMap::data_type& aValue = anIter->second;
if(aValue.myIsCheckLockedStudy())
_study->CheckLocked();
- return aValue.myNewInstance(theAttr,this);
+ anAttr = aValue.myNewInstance(theAttr,this);
+ return TAttrHolder(anAttr,anAttr->_this());
}
if(strncmp(theType,"AttributeTreeNode",17) == 0){
- return new SALOMEDS_AttributeTreeNode_i(theAttr,this);
+ anAttr = new SALOMEDS_AttributeTreeNode_i(theAttr,this);
+ return TAttrHolder(anAttr,anAttr->_this());
}
if(strncmp(theType,"AttributeUserID",15) == 0){
- return new SALOMEDS_AttributeUserID_i(theAttr,this);
+ anAttr = new SALOMEDS_AttributeUserID_i(theAttr,this);
+ return TAttrHolder(anAttr,anAttr->_this());
}
- return NULL;
+ return TAttrHolder();
}
-SALOMEDS_GenericAttribute_i*
+SALOMEDS_SObject_i::TAttrHolder
SALOMEDS_SObject_i::_FindGenAttribute(const char* theType)
{
- SALOMEDS_GenericAttribute_i* anGenAttr = NULL;
+ TAttrHolder anAttrHolder;
TAttrMap::const_iterator anIter = myAttrMap.find(theType);
if(anIter != myAttrMap.end())
- anGenAttr = anIter->second;
+ anAttrHolder = anIter->second;
Standard_GUID aGUID = ::GetGUID(theType);
Handle(TDF_Attribute) anAttr;
if(_lab.FindAttribute(aGUID,anAttr)){
- if(anGenAttr != NULL){
- if(anGenAttr->GetAttribute() != anAttr)
- anGenAttr->SetAttribute(anAttr);
+ SALOMEDS_GenericAttribute_i* aGenAttr = anAttrHolder.first;
+ if(aGenAttr != NULL){
+ if(aGenAttr->GetAttribute() != anAttr)
+ aGenAttr->SetAttribute(anAttr);
}else{
- anGenAttr = _CreateGenAttribute(anAttr,theType);
+ anAttrHolder = _CreateGenAttribute(anAttr,theType);
}
- if(anGenAttr != NULL)
- myAttrMap[theType] = anGenAttr;
+ aGenAttr = anAttrHolder.first;
+ if(aGenAttr != NULL)
+ myAttrMap[theType] = anAttrHolder;
}else{
- myAttrMap.erase(theType);
+ //myAttrMap.erase(theType);
//if(anGenAttr != NULL)
// anGenAttr->Destroy();
+ return TAttrHolder();
}
- return anGenAttr;
+ return anAttrHolder;
}
SALOMEDS::GenericAttribute_ptr
SALOMEDS_SObject_i::_FindCORBAAttribute(const char* theType)
{
- if(SALOMEDS_GenericAttribute_i* anGenAttr = _FindGenAttribute(theType))
- return anGenAttr->_this();
+ TAttrHolder anAttr = _FindGenAttribute(theType);
+ SALOMEDS::GenericAttribute_var anGenAttr = anAttr.second;
+ if(!CORBA::is_nil(anGenAttr)){
+ return anGenAttr._retn();
+ }
+
return SALOMEDS::GenericAttribute::_nil();
}
SALOMEDS::GenericAttribute_ptr
SALOMEDS_SObject_i::FindOrCreateAttribute(const char* theType)
{
- if(SALOMEDS_GenericAttribute_i* anGenAttr = _FindGenAttribute(theType))
- return anGenAttr->_this();
+ TAttrHolder anAttrHolder = _FindGenAttribute(theType);
+ SALOMEDS::GenericAttribute_var anGenAttr = anAttrHolder.second;
+ if(!anGenAttr->_is_nil())
+ return anGenAttr._retn();
+
Handle(TDF_Attribute) anAttr = _AddAttribute(theType);
if(!anAttr.IsNull()){
- if(SALOMEDS_GenericAttribute_i* anGenAttr = _CreateGenAttribute(anAttr,theType)){
- return anGenAttr->_this();
- }
+ anAttrHolder = _CreateGenAttribute(anAttr,theType);
+ anGenAttr = anAttrHolder.second;
+ if(!anGenAttr->_is_nil())
+ return anGenAttr._retn();
}
+
return SALOMEDS::GenericAttribute::_nil();
}
}
TAttrMap::iterator anIter = myAttrMap.find(theType);
if(anIter != myAttrMap.end()){
- myAttrMap.erase(anIter);
+ //myAttrMap.erase(anIter);
}
_lab.ForgetAttribute(::GetGUID(theType));
}
+
+void SALOMEDS_SObject_i::OnRemove()
+{
+ Handle(TDF_Reference) aReference;
+ if(_lab.FindAttribute(TDF_Reference::GetID(),aReference)){
+ Handle(SALOMEDS_TargetAttribute) aTarget;
+ if(aReference->Get().FindAttribute(SALOMEDS_TargetAttribute::GetID(),aTarget))
+ aTarget->Remove(_lab);
+ }
+
+ Handle(SALOMEDS_IORAttribute) anAttr; // postponed removing of CORBA objects
+ if(_lab.FindAttribute(SALOMEDS_IORAttribute::GetID(),anAttr)){
+ _study->AddPostponed(TCollection_AsciiString(anAttr->Get()).ToCString());
+ }
+
+ //myAttrMap.clear();
+
+ //SALOMEDS_Study_i::TSObjectMap& anSObjectMap = _study->GetSObjectMap();
+ //anSObjectMap.erase(_lab);
+}
FindOrCreateAttribute(const char* theTypeOfAttribute);
void RemoveAttribute(const char* theTypeOfAttribute);
+ void OnRemove();
SALOMEDS_Study_i* GetStudyServant(){ return _study;}
+ TDF_Label GetLabel(){ return _lab;}
+
CORBA::ORB_var GetORB() const;
PortableServer::POA_var GetPOA() const;
protected:
friend class SALOMEDS_GenericAttribute_i;
- SALOMEDS_GenericAttribute_i*
+ typedef std::string TAttributeID;
+ typedef std::pair<SALOMEDS_GenericAttribute_i*,SALOMEDS::GenericAttribute_var> TAttrHolder;
+ typedef std::map<TAttributeID,TAttrHolder> TAttrMap;
+ TAttrMap myAttrMap;
+
+ TAttrHolder
_FindGenAttribute(const Handle(TDF_Attribute)& theAttr);
- SALOMEDS_GenericAttribute_i*
+ TAttrHolder
_CreateGenAttribute(const Handle(TDF_Attribute)& theAttr,
const char* theTypeOfAttribute);
- SALOMEDS_GenericAttribute_i*
+ TAttrHolder
_FindGenAttribute(const char* theTypeOfAttribute);
SALOMEDS::GenericAttribute_ptr
std::string _name;
TDF_Label _lab;
- typedef std::string TAttributeID;
- typedef SALOMEDS_GenericAttribute_i* TAttrHolder;
- typedef std::map<TAttributeID,TAttrHolder> TAttrMap;
- TAttrMap myAttrMap;
-
SALOMEDS_SObject_i(SALOMEDS_Study_i* theStudy,
const TDF_Label& theLabel);
omniORB::MaxMessageSize(100 * 1024 * 1024);
// Obtain a reference to the root POA.
//
- long TIMESleep = 250000000;
+ long TIMESleep = 500000000;
int NumberOfTries = 40;
int a;
timespec ts_req;
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS_SComponent_i.hxx"
+#include "SALOMEDS_ChildIterator_i.hxx"
#include "SALOMEDS_TargetAttribute.hxx"
#include "SALOMEDS_IORAttribute.hxx"
//add theObject definition
aString = GetORB()->object_to_string(theObject);
- SALOMEDS_IORAttribute::Set(Lab,const_cast<char*>(aString.in()),GetORB());
+ SALOMEDS_IORAttribute::Set(Lab,const_cast<char*>(aString.in()),_study);
}
//============================================================================
//============================================================================
void SALOMEDS_StudyBuilder_i::RemoveObject(SALOMEDS::SObject_ptr theSObject)
{
- CheckLocked();
-
- if(CORBA::is_nil(theSObject))
- return;
-
- OnRemoveSObject(theSObject);
-
- TDF_Label Lab;
- CORBA::String_var aString(theSObject->GetID());
- TDF_Tool::Label(_doc->GetData(),const_cast<char*>(aString.in()),Lab);
+ RemoveSObject(theSObject);
+}
- Handle(TDF_Reference) aReference;
- if(Lab.FindAttribute(TDF_Reference::GetID(),aReference)){
- Handle(SALOMEDS_TargetAttribute) aTarget;
- if(aReference->Get().FindAttribute(SALOMEDS_TargetAttribute::GetID(),aTarget))
- aTarget->Remove(Lab);
- }
+SALOMEDS_SObject_i*
+SALOMEDS_StudyBuilder_i::RemoveSObject(SALOMEDS::SObject_ptr theSObject,
+ bool theIsForgetAllAttributes)
+{
+ CheckLocked();
- Handle(SALOMEDS_IORAttribute) anAttr; // postponed removing of CORBA objects
- if (Lab.FindAttribute(SALOMEDS_IORAttribute::GetID(), anAttr)){
- SALOMEDS::Study_ptr aStudy = SALOMEDS_Study_i::GetStudy(_doc->Main(),GetORB());
- aStudy->AddPostponed(TCollection_AsciiString(anAttr->Get()).ToCString());
+ if(SALOMEDS_SObject_i* aSObject = _study->DownCast(theSObject)){
+ OnRemoveSObject(theSObject);
+ aSObject->OnRemove();
+ if(theIsForgetAllAttributes){
+ TDF_Label aLabel = aSObject->GetLabel();
+ aLabel.ForgetAllAttributes();
+ }
+ return aSObject;
}
- Lab.ForgetAllAttributes();
+ return NULL;
}
//============================================================================
//============================================================================
void SALOMEDS_StudyBuilder_i::RemoveObjectWithChildren(SALOMEDS::SObject_ptr theSObject)
{
- CheckLocked();
-
- if(CORBA::is_nil(theSObject))
- return;
-
- OnRemoveSObject(theSObject);
-
- TDF_Label Lab;
- CORBA::String_var aString(theSObject->GetID());
- TDF_Tool::Label(_doc->GetData(),aString,Lab);
-
- Handle(TDF_Reference) aReference;
- if (Lab.FindAttribute(TDF_Reference::GetID(), aReference)) {
- Handle(SALOMEDS_TargetAttribute) aTarget;
- if (aReference->Get().FindAttribute(SALOMEDS_TargetAttribute::GetID(),aTarget))
- aTarget->Remove(Lab);
- }
-
- Handle(SALOMEDS_IORAttribute) anAttr; // postponed removing of CORBA objects
- if (Lab.FindAttribute(SALOMEDS_IORAttribute::GetID(), anAttr)){
- SALOMEDS::Study_ptr aStudy = SALOMEDS_Study_i::GetStudy(_doc->Main(),GetORB());
- aStudy->AddPostponed(TCollection_AsciiString(anAttr->Get()).ToCString());
- }
-
- TDF_ChildIterator it(Lab, Standard_True);
- for(;it.More();it.Next()) {
- TDF_Label aLabel = it.Value();
-
- if (aLabel.FindAttribute(TDF_Reference::GetID(), aReference)) {
- Handle(SALOMEDS_TargetAttribute) aTarget;
- if (aReference->Get().FindAttribute(SALOMEDS_TargetAttribute::GetID(),aTarget))
- aTarget->Remove(aLabel);
- }
-
- Handle(SALOMEDS_IORAttribute) anAttr; // postponed removing of CORBA objects
- if (aLabel.FindAttribute(SALOMEDS_IORAttribute::GetID(), anAttr)){
- SALOMEDS::Study_ptr aStudy = SALOMEDS_Study_i::GetStudy(_doc->Main(),GetORB());
- aStudy->AddPostponed(TCollection_AsciiString(anAttr->Get()).ToCString());
+ if(SALOMEDS_SObject_i* aSObject = RemoveSObject(theSObject,false)){
+ SALOMEDS_ChildIterator_i aChildIter(_study,aSObject->GetLabel(),true);
+ for(; aChildIter.More(); aChildIter.Next()){
+ if(SALOMEDS_SObject_i* aSObj = aChildIter.GetValue())
+ aSObj->OnRemove();
}
+ TDF_Label aLabel = aSObject->GetLabel();
+ aLabel.ForgetAllAttributes(Standard_True);
}
-
- Lab.ForgetAllAttributes(Standard_True);
}
//============================================================================
//============================================================================
static void Translate_persistentID_to_IOR(TDF_Label theLabel,
SALOMEDS::Driver_ptr theDriver,
- CORBA::ORB_ptr theORB,
SALOMEDS_Study_i* theStudy,
CORBA::Boolean theIsMultiFile,
CORBA::Boolean theIsASCII)
CORBA::String_var anIOR =
theDriver->LocalPersistentIDToIOR(aSObject,ch.ToCString(),theIsMultiFile,theIsASCII);
- SALOMEDS_IORAttribute::Set (aCurrentLabel,const_cast<char*>(anIOR.in()),theORB);
+ SALOMEDS_IORAttribute::Set(aCurrentLabel,const_cast<char*>(anIOR.in()),theStudy);
}
- Translate_persistentID_to_IOR(aCurrentLabel,theDriver,theORB,theStudy,theIsMultiFile,theIsASCII);
+ Translate_persistentID_to_IOR(aCurrentLabel,theDriver,theStudy,theIsMultiFile,theIsASCII);
}
}
if(CORBA::is_nil(theDriver))
return;
- int aLocked = theSComponent->GetStudy()->GetProperties()->IsLocked();
+ int aLocked = _study->GetProperties()->IsLocked();
if(aLocked)
- theSComponent->GetStudy()->GetProperties()->SetLocked(false);
+ _study->GetProperties()->SetLocked(false);
// mpv 06.03.2003: SAL1927 - if component data if already loaded, it is not necessary to do it again
if (Lab.FindAttribute(SALOMEDS_IORAttribute::GetID(), Att)) {
if(aLocked)
- theSComponent->GetStudy()->GetProperties()->SetLocked(true);
+ _study->GetProperties()->SetLocked(true);
return;
}
DefineComponentInstance (theSComponent,theDriver);
SALOMEDS_Tool::RemoveTemporaryFiles(aDir,aFilesToRemove,true);
}
if(aLocked)
- theSComponent->GetStudy()->GetProperties()->SetLocked(true);
+ _study->GetProperties()->SetLocked(true);
THROW_SALOME_CORBA_EXCEPTION("No persistent file Name found",SALOME::BAD_PARAM);
}
try {
- Translate_persistentID_to_IOR(Lab,theDriver,GetORB(),_study, aMultifileState[0]=='M', ASCIIfileState[0] == 'A');
+ Translate_persistentID_to_IOR(Lab,theDriver,_study,aMultifileState[0]=='M',ASCIIfileState[0] == 'A');
} catch (SALOME::SALOME_Exception) {
INFOS("Can't translate PersRef to IOR");
if (aLocked)
- theSComponent->GetStudy()->GetProperties()->SetLocked(true);
+ _study->GetProperties()->SetLocked(true);
THROW_SALOME_CORBA_EXCEPTION("Unable to convert component persistent data to the transient",SALOME::BAD_PARAM);
// throw HDFexception("Unable to load component data");
}
if(aLocked)
- theSComponent->GetStudy()->GetProperties()->SetLocked(true);
+ _study->GetProperties()->SetLocked(true);
} else
MESSAGE("No persistent file Name");
}
SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SALOMEDS::SObject_ptr theObject,
const char* theTypeOfAttribute)
{
- if(!CORBA::is_nil(theObject)){
- PortableServer::POA_var aPOA = GetPOA();
- PortableServer::ServantBase_var aServant = SALOMEDS::GetServant(theObject,aPOA);
- if(aServant.in() != NULL){
- if(SALOMEDS_SObject_i* anSObject = dynamic_cast<SALOMEDS_SObject_i*>(aServant.in())){
- return anSObject->FindOrCreateAttribute(theTypeOfAttribute);
- }
- }
- }
+ if(SALOMEDS_SObject_i* aSObject = _study->DownCast(theObject))
+ return aSObject->FindOrCreateAttribute(theTypeOfAttribute);
+
return SALOMEDS::GenericAttribute::_nil();
}
SALOMEDS::GenericAttribute_out theAttr,
const char* theTypeOfAttribute)
{
- if(!CORBA::is_nil(theObject)){
- PortableServer::ServantBase_var aServant = SALOMEDS::GetServant(theObject,GetPOA());
- if(aServant.in() != NULL){
- if(SALOMEDS_SObject_i* anSObject = dynamic_cast<SALOMEDS_SObject_i*>(aServant.in())){
- return anSObject->FindAttribute(theAttr,theTypeOfAttribute);
- }
- }
- }
+ if(SALOMEDS_SObject_i* aSObject = _study->DownCast(theObject))
+ return aSObject->FindAttribute(theAttr,theTypeOfAttribute);
+
return Standard_False;
}
if (strcmp(aTypeOfAttribute, "AttributeIOR") == 0) { // postponed removing of CORBA objects
Handle(SALOMEDS_IORAttribute) anAttr;
if (Lab.FindAttribute(SALOMEDS_IORAttribute::GetID(), anAttr))
- SALOMEDS_Study_i::GetStudy(_doc->Main(),GetORB())->AddPostponed(TCollection_AsciiString(anAttr->Get()).ToCString());
- else return;
+ _study->AddPostponed(TCollection_AsciiString(anAttr->Get()).ToCString());
+ else
+ return;
}
Lab.ForgetAttribute(SALOMEDS::GetGUID(aTypeOfAttribute));
Handle(TDataStd_Name) aName;
TDF_Label aLabel;
SALOMEDS::SObject_var anObject = SALOMEDS_SObject_i::NewRef(_study,_doc->Main());
- SALOMEDS::Study_var aStudy = anObject->GetStudy();
try {
- anObject = aStudy->FindObjectByPath(thePath); //Check if the directory already exists
+ anObject = _study->FindObjectByPath(thePath); //Check if the directory already exists
}
catch(...) { }
if(aPath.Value(1) != '/') { //Relative path
aPath.Prepend('/');
- aPath = TCollection_AsciiString(aStudy->GetContext()) + aPath;
+ aPath = TCollection_AsciiString(_study->GetContext()) + aPath;
}
TCollection_AsciiString aToken = aPath.Token("/", 1);
anObject = SALOMEDS::SObject::_nil();
try {
- anObject = aStudy->FindObjectByPath(aFatherPath.ToCString()); //Check if the father directory exists
+ anObject = _study->FindObjectByPath(aFatherPath.ToCString()); //Check if the father directory exists
}
catch(...) { ; }
if(anObject->_is_nil())
AbortCommand();
throw SALOMEDS::StudyBuilder::LockProtection();
} else {
- SALOMEDS_Study_i::GetStudy(_doc->Main(),GetORB())->RemovePostponed(_doc->GetUndoLimit());
+ _study->RemovePostponed(_doc->GetUndoLimit());
int aModif = anAttr->GetModified();
if (aModif < 0) aModif = 1000; // if user make undo and then - new transaction "modify" will never be zero
//============================================================================
void SALOMEDS_StudyBuilder_i::AbortCommand()
{
- SALOMEDS_Study_i::GetStudy(_doc->Main(),GetORB())->UndoPostponed(0);
+ _study->UndoPostponed(0);
_doc->AbortCommand();
}
MESSAGE("Locked document modification !!!");
throw SALOMEDS::StudyBuilder::LockProtection();
} else {
- SALOMEDS_Study_i::GetStudy(_doc->Main(),GetORB())->UndoPostponed(1);
+ _study->UndoPostponed(1);
_doc->Undo();
anAttr->SetModified(anAttr->GetModified()-1);
}
throw SALOMEDS::StudyBuilder::LockProtection();
} else {
_doc->Redo();
- SALOMEDS_Study_i::GetStudy(_doc->Main(),GetORB())->UndoPostponed(-1);
+ _study->UndoPostponed(-1);
anAttr->SetModified(anAttr->GetModified()+1);
}
}
TDF_Label aLabel;
CORBA::String_var aSOID = theSO->GetID();
TDF_Tool::Label(_doc->GetData(), aSOID, aLabel);
- SALOMEDS_IORAttribute::Set(aLabel, TCollection_ExtendedString((char*)theValue),GetORB());
+ SALOMEDS_IORAttribute::Set(aLabel, TCollection_ExtendedString((char*)theValue),_study);
}
#include <TDocStd_Document.hxx>
class SALOMEDS_Study_i;
+class SALOMEDS_SObject_i;
class SALOMEDS_Callback_i;
class SALOMEDS_StudyBuilder_i: public virtual POA_SALOMEDS::StudyBuilder,
throw(SALOME::SALOME_Exception);
virtual void Load(SALOMEDS::SObject_ptr sco);
+ SALOMEDS_SObject_i* RemoveSObject(SALOMEDS::SObject_ptr theSObject,
+ bool theIsForgetAllAttributes = true);
virtual void RemoveObject(SALOMEDS::SObject_ptr anObject);
virtual void RemoveObjectWithChildren(SALOMEDS::SObject_ptr anObject);
#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
-#include "SALOMEDS_SObject_i.hxx"
+
#include "SALOMEDS_Study_i.hxx"
+#include "SALOMEDS_SObject_i.hxx"
+#include "SALOMEDS_StudyBuilder_i.hxx"
#include "SALOMEDS_IORAttribute.hxx"
#include "SALOMEDS_PersRefAttribute.hxx"
//===========================================================================
//Function : LoadAttributes
//===========================================================================
-static void ReadAttributes(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr aSO,
- HDFdataset* hdf_dataset)
+static
+void
+ReadAttributes(SALOMEDS_Study_i* theStudy,
+ SALOMEDS::SObject_ptr aSO,
+ HDFdataset* hdf_dataset)
{
hdf_dataset->OpenOnDisk();
hdf_dataset->ReadFromDisk(current_string);
if (!strcmp(hdf_dataset->GetName(),"COMPONENTDATATYPE")) {
- anAttr = theStudy->NewBuilder()->FindOrCreateAttribute(aSO, "AttributeComment");
+ anAttr = theStudy->GetBuilder()->FindOrCreateAttribute(aSO, "AttributeComment");
} else if (!strcmp(hdf_dataset->GetName(),"Reference")) {
- theStudy->NewBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string));
+ theStudy->GetBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string));
delete(current_string);
hdf_dataset->CloseOnDisk();
return;
} else {
MESSAGE("Read attribute "<<hdf_dataset->GetName())
- anAttr = theStudy->NewBuilder()->FindOrCreateAttribute(aSO, hdf_dataset->GetName());
+ anAttr = theStudy->GetBuilder()->FindOrCreateAttribute(aSO, hdf_dataset->GetName());
}
if (!CORBA::is_nil(anAttr)) {
//============================================================================
//Function : Translate_IOR_to_persistentID
//============================================================================
-static void Translate_IOR_to_persistentID (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::StudyBuilder_ptr theBuilder,
- SALOMEDS::SObject_ptr theSObject,
- SALOMEDS::Driver_ptr theEngine,
- CORBA::Boolean theIsMultiFile,
- CORBA::Boolean theIsASCII)
+static void Translate_IOR_to_persistentID(SALOMEDS_Study_i* theStudy,
+ SALOMEDS_StudyBuilder_i* theBuilder,
+ SALOMEDS::SObject_ptr theSObject,
+ SALOMEDS::Driver_ptr theEngine,
+ CORBA::Boolean theIsMultiFile,
+ CORBA::Boolean theIsASCII)
{
MESSAGE("In Translate_IOR_to_persistentID");
- SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator(theSObject);
- for (; anIter->More(); anIter->Next()){
+ SALOMEDS_ChildIterator_i anIter = theStudy->GetChildIterator(theSObject);
+ for(; anIter.More(); anIter.Next()){
SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::SObject_var aSObject = anIter->Value();
+ SALOMEDS::SObject_var aSObject = anIter.Value();
if(aSObject->FindAttribute(anAttr,"AttributeIOR")){
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var aString = anIOR->Value();
//============================================================================
//Function : BuildlTree
//============================================================================
-static void BuildTree (SALOMEDS::Study_ptr theStudy,HDFgroup* hdf_current_group)
+static
+void
+BuildTree(SALOMEDS_Study_i* theStudy, HDFgroup* hdf_current_group)
{
hdf_current_group->OpenOnDisk();
else if (type == HDF_GROUP) {
MESSAGE( "--> Group: Internal Object Name : " << name);
HDFgroup* new_group = new HDFgroup(name,hdf_current_group);
- BuildTree (theStudy, new_group);
+ BuildTree(theStudy, new_group);
new_group = 0; // will be deleted by father destructor
}
}
_name_service.Destroy_Directory("/Study");
}
+SALOMEDS_Study_i*
+SALOMEDS_StudyManager_i::DownCast(SALOMEDS::Study_ptr theStudy) const
+{
+ if(!CORBA::is_nil(theStudy)){
+ PortableServer::POA_var aPOA = GetPOA();
+ PortableServer::ServantBase_var aServant = SALOMEDS::GetServant(theStudy,aPOA);
+ if(aServant.in())
+ return dynamic_cast<SALOMEDS_Study_i*>(aServant.in());
+ }
+ return NULL;
+}
+
//============================================================================
/*! Function : register_name
* Purpose : Register the study Manager in the naming service under the
// Assign the value of the IOR in the study->root
CORBA::String_var anIOR = _orb->object_to_string(aStudy);
- SALOMEDS_IORAttribute::Set(aDocument->Main().Root(),const_cast<char*>(anIOR.in()),_orb);
+ SALOMEDS_IORAttribute::Set(aDocument->Main().Root(),
+ const_cast<char*>(anIOR.in()),
+ aStudyServant);
// set Study properties
SALOMEDS::AttributeStudyProperties_var aProp = aStudyServant->GetProperties();
aStudy->StudyId( _IDcounter );
// Assign the value of the URL in the study object
- aStudy->URL(theURL);
+ aStudyServant->URL(theURL);
SCRUTE(theURL);
// Assign the value of the IOR in the study->root
CORBA::String_var anIOR = _orb->object_to_string(aStudy);
- SALOMEDS_IORAttribute::Set(Doc->Main().Root(),const_cast<char*>(anIOR.in()),_orb);
+ SALOMEDS_IORAttribute::Set(Doc->Main().Root(),
+ const_cast<char*>(anIOR.in()),
+ aStudyServant);
SALOMEDS_PersRefAttribute::Set(Doc->Main(),const_cast<char*>(theURL));
Handle(TDF_Data) DF = Doc->GetData();
try{
- BuildTree (aStudy,hdf_group_study_structure);
+ BuildTree(aStudyServant,hdf_group_study_structure);
}catch(HDFexception){
std::ostringstream aStream;
aStream<<"Can't open file "<<theURL;
if(!_name_service.Change_Directory("/Study")){
MESSAGE( "Unable to access the study directory" );
}else{
- CORBA::String_var aString(aStudy->Name());
+ CORBA::String_var aString(aStudyServant->Name());
_name_service.Register(aStudy,aString.in());
}
* Purpose : save the study properties in HDF file
*/
//============================================================================
-void SALOMEDS_StudyManager_i::_SaveProperties(SALOMEDS::Study_ptr aStudy, HDFgroup *hdf_group)
+void SALOMEDS_StudyManager_i::_SaveProperties(SALOMEDS_Study_i* theStudy, HDFgroup *hdf_group)
{
// add modifications list (user and date of save)
- SALOMEDS::AttributeStudyProperties_ptr aProp = aStudy->GetProperties();
- SALOMEDS::StudyBuilder_var SB= aStudy->NewBuilder();
-// SB->NewCommand();
+ SALOMEDS::AttributeStudyProperties_ptr aProp = theStudy->GetProperties();
int aLocked = aProp->IsLocked();
if (aLocked)
aProp->SetLocked(Standard_False);
CORBA::Long(aDate.Year()));
if(aLocked)
aProp->SetLocked(Standard_True);
-// SB->CommitCommand();
SALOMEDS::StringSeq_var aNames;
SALOMEDS::LongSeq_var aMinutes, aHours, aDays, aMonths, aYears;
*/
//============================================================================
void SALOMEDS_StudyManager_i::_SaveAs(const char* aUrl,
- SALOMEDS::Study_ptr aStudy,
+ SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theMultiFile,
CORBA::Boolean theASCII)
{
// * Study Structure -> Exactly what is contained in OCAF document
// Informations in data group hdf_group_study_structure
- HDFfile *hdf_file=0;
- HDFgroup *hdf_group_study_structure =0;
- HDFgroup *hdf_sco_group =0;
- HDFgroup *hdf_sco_group2 =0;
+ if(SALOMEDS_Study_i* aStudy = DownCast(theStudy)){
+ HDFfile *hdf_file=0;
+ HDFgroup *hdf_group_study_structure =0;
+ HDFgroup *hdf_sco_group =0;
+ HDFgroup *hdf_sco_group2 =0;
- HDFgroup *hdf_group_datacomponent =0;
- HDFdataset *hdf_dataset =0;
- hdf_size size[1];
- hdf_int32 name_len = 0;
-
- int aLocked = aStudy->GetProperties()->IsLocked();
- if (aLocked) aStudy->GetProperties()->SetLocked(false);
-
- SALOMEDS::StudyBuilder_var SB= aStudy->NewBuilder();
+ HDFgroup *hdf_group_datacomponent =0;
+ HDFdataset *hdf_dataset =0;
+ hdf_size size[1];
+ hdf_int32 name_len = 0;
+
+ int aLocked = aStudy->GetProperties()->IsLocked();
+ if(aLocked)
+ aStudy->GetProperties()->SetLocked(false);
- ASSERT(!CORBA::is_nil(aStudy));
- try
- {
+ SALOMEDS_StudyBuilder_i* SB= aStudy->GetBuilder();
+ try{
// mpv 15.12.2003: for saving components we have to load all data from all modules
-
- SALOMEDS::SComponentIterator_var itcomponent1 = aStudy->NewComponentIterator();
- for (; itcomponent1->More(); itcomponent1->Next())
- {
- SALOMEDS::SComponent_var sco = itcomponent1->Value();
- // if there is an associated Engine call its method for saving
- CORBA::String_var IOREngine;
- try {
+ SALOMEDS_SComponentIterator_i aComponentIter = aStudy->GetComponentIterator();
+ for(; aComponentIter.More(); aComponentIter.Next()){
+ SALOMEDS::SComponent_var sco = aComponentIter.Value();
+ // if there is an associated Engine call its method for saving
+ CORBA::String_var IOREngine;
+ try{
+ if(!sco->ComponentIOR(IOREngine)){
+ SALOMEDS::GenericAttribute_var aGeneric;
+ SALOMEDS::AttributeName_var aName;
+ if(sco->FindAttribute(aGeneric, "AttributeName"))
+ aName = SALOMEDS::AttributeName::_narrow(aGeneric);
- if (!sco->ComponentIOR(IOREngine)) {
- SALOMEDS::GenericAttribute_var aGeneric;
- SALOMEDS::AttributeName_var aName;
- if(sco->FindAttribute(aGeneric, "AttributeName"))
- aName = SALOMEDS::AttributeName::_narrow(aGeneric);
-
- if (!aName->_is_nil()) {
-
- CORBA::String_var aCompType = aName->Value();
-
-
- CORBA::String_var aFactoryType;
- if (strcmp(aCompType, "SUPERV") == 0) aFactoryType = "SuperVisionContainer";
- else aFactoryType = "FactoryServer";
+ if(!aName->_is_nil()){
+ CORBA::String_var aCompType = aName->Value();
+
+ CORBA::String_var aFactoryType;
+ if(strcmp(aCompType, "SUPERV") == 0)
+ aFactoryType = "SuperVisionContainer";
+ else
+ aFactoryType = "FactoryServer";
+
+ Engines::Component_var aComp =
+ SALOME_LifeCycleCORBA(&_name_service).FindOrLoad_Component(aFactoryType, aCompType);
+ if(aComp->_is_nil()){
Engines::Component_var aComp =
- SALOME_LifeCycleCORBA(&_name_service).FindOrLoad_Component(aFactoryType, aCompType);
-
- if (aComp->_is_nil()) {
- Engines::Component_var aComp =
- SALOME_LifeCycleCORBA(&_name_service).FindOrLoad_Component("FactoryServerPy", aCompType);
- }
+ SALOME_LifeCycleCORBA(&_name_service).FindOrLoad_Component("FactoryServerPy", aCompType);
+ }
- if (!aComp->_is_nil()) {
- SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aComp);
- if (!CORBA::is_nil(aDriver)) {
- SB->LoadWith(sco, aDriver);
- }
+ if(!aComp->_is_nil()){
+ SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aComp);
+ if (!CORBA::is_nil(aDriver)) {
+ SB->LoadWith(sco, aDriver);
}
}
}
- } catch(...) {
- MESSAGE("Can not restore information to resave it");
- return;
}
+ }catch(...){
+ MESSAGE("Can not restore information to resave it");
+ return;
}
-
-
+ }
CORBA::String_var anOldName = aStudy->Name();
aStudy->URL(aUrl);
hdf_group_datacomponent = new HDFgroup("DATACOMPONENT",hdf_file);
hdf_group_datacomponent->CreateOnDisk();
- SALOMEDS::SComponentIterator_var itcomponent = aStudy->NewComponentIterator();
-
//SRN: Added 17 Nov, 2003
SALOMEDS::SObject_var anAutoSaveSO = aStudy->FindObjectID(AUTO_SAVE_TAG);
//SRN: End
- for (; itcomponent->More(); itcomponent->Next())
- {
- SALOMEDS::SComponent_var sco = itcomponent->Value();
+ aComponentIter.Init();
+ for(; aComponentIter.More(); aComponentIter.Next()){
+ SALOMEDS::SComponent_var sco = aComponentIter.Value();
- CORBA::String_var scoid = sco->GetID();
- hdf_sco_group = new HDFgroup(scoid,hdf_group_datacomponent);
- hdf_sco_group->CreateOnDisk();
-
- CORBA::String_var componentDataType = sco->ComponentDataType();
- MESSAGE ( "Look for an engine for data type :"<< componentDataType);
-
- //SRN: Added 17 Nov 2003: If there is a specified attribute, the component peforms a special save
- if(!CORBA::is_nil(anAutoSaveSO) && SB->IsGUID(sco, AUTO_SAVE_GUID)) {
-
- SALOMEDS::GenericAttribute_var aGeneric;
- SALOMEDS::AttributeTableOfString_var aTable;
- if(anAutoSaveSO->FindAttribute(aGeneric, "AttributeTableOfString")) {
- aTable = SALOMEDS::AttributeTableOfString::_narrow(aGeneric);
- Standard_Integer nbRows = aTable->GetNbRows(), k, aTimeOut = 0;
- if(nbRows > 0 && aTable->GetNbColumns() > 1) {
-
- SALOMEDS::StringSeq_var aRow;
- for(k=1; k<=nbRows; k++) {
- aRow = aTable->GetRow(k);
- if (strcmp(aRow[0], componentDataType) == 0) {
- CORBA::String_var anEntry = CORBA::string_dup(aRow[1]);
- SALOMEDS::SObject_var aCompSpecificSO = aStudy->FindObjectID(anEntry);
- if(!CORBA::is_nil(aCompSpecificSO)) {
- SALOMEDS::AttributeInteger_var anInteger;
- if(aCompSpecificSO->FindAttribute(aGeneric, "AttributeInteger")) {
- anInteger = SALOMEDS::AttributeInteger::_narrow(aGeneric);
- anInteger->SetValue(-1);
- while(anInteger->Value() < 0) { sleep(2); if(++aTimeOut > AUTO_SAVE_TIME_OUT_IN_SECONDS) break; }
- } // if(aCompSpecificSO->FindAttribute(anInteger, "AttributeInteger"))
- } // if(!CORBA::is_nil(aCompSpecificSO))
- } // if (strcmp(aRow[0], componentDataType) == 0)
- } // for
-
- } // if(nbRows > 0 && aTable->GetNbColumns() > 1)
-
- } // if(anAutoSaveSO->FindAttribute(aTable, "AttributeTableOfString")
-
- } // if(SB->IsGUID(AUTO_SAVE_GUID)
-
- //SRN: End
-
- CORBA::String_var IOREngine;
- if (sco->ComponentIOR(IOREngine))
- {
- // we have found the associated engine to write the data
- MESSAGE ( "We have found an engine for data type :"<< componentDataType);
- CORBA::Object_var obj = _orb->string_to_object(IOREngine);
- SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
+ CORBA::String_var scoid = sco->GetID();
+ hdf_sco_group = new HDFgroup(scoid,hdf_group_datacomponent);
+ hdf_sco_group->CreateOnDisk();
+
+ CORBA::String_var componentDataType = sco->ComponentDataType();
+ MESSAGE ( "Look for an engine for data type :"<< componentDataType);
+
+ //SRN: Added 17 Nov 2003: If there is a specified attribute, the component peforms a special save
+ if(!CORBA::is_nil(anAutoSaveSO) && SB->IsGUID(sco, AUTO_SAVE_GUID)){
+ SALOMEDS::GenericAttribute_var aGeneric;
+ SALOMEDS::AttributeTableOfString_var aTable;
+ if(anAutoSaveSO->FindAttribute(aGeneric, "AttributeTableOfString")){
+ aTable = SALOMEDS::AttributeTableOfString::_narrow(aGeneric);
+ Standard_Integer nbRows = aTable->GetNbRows(), k, aTimeOut = 0;
+ if(nbRows > 0 && aTable->GetNbColumns() > 1) {
+ SALOMEDS::StringSeq_var aRow;
+ for(k=1; k<=nbRows; k++){
+ aRow = aTable->GetRow(k);
+ if(strcmp(aRow[0], componentDataType) == 0){
+ CORBA::String_var anEntry = CORBA::string_dup(aRow[1]);
+ SALOMEDS::SObject_var aCompSpecificSO = aStudy->FindObjectID(anEntry);
+ if(!CORBA::is_nil(aCompSpecificSO)) {
+ SALOMEDS::AttributeInteger_var anInteger;
+ if(aCompSpecificSO->FindAttribute(aGeneric, "AttributeInteger")) {
+ anInteger = SALOMEDS::AttributeInteger::_narrow(aGeneric);
+ anInteger->SetValue(-1);
+ while(anInteger->Value() < 0) { sleep(2); if(++aTimeOut > AUTO_SAVE_TIME_OUT_IN_SECONDS) break; }
+ } // if(aCompSpecificSO->FindAttribute(anInteger, "AttributeInteger"))
+ } // if(!CORBA::is_nil(aCompSpecificSO))
+ } // if (strcmp(aRow[0], componentDataType) == 0)
+ } // for
- if (!CORBA::is_nil(Engine))
- {
- MESSAGE ( "Save the data of type:"<< componentDataType);
- MESSAGE("Engine :"<<Engine->ComponentDataType());
-
- SALOMEDS::TMPFile_var aStream;
-
- if (theASCII) aStream = Engine->SaveASCII(sco,SALOMEDS_Tool::GetDirFromPath(aUrl).c_str(),theMultiFile);
- else aStream = Engine->Save(sco,SALOMEDS_Tool::GetDirFromPath(aUrl).c_str(),theMultiFile);
-
- HDFdataset *hdf_dataset;
- hdf_size aHDFSize[1];
- if(aStream->length() > 0) { //The component saved some auxiliary files, then put them into HDF file
-
- aHDFSize[0] = aStream->length();
-
- HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((unsigned char*) &aStream[0]); //Save the stream in the HDF file
- hdf_dataset->CloseOnDisk();
- }
- // store multifile state
- aHDFSize[0] = 2;
- hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((void*)(theMultiFile?"M":"S")); // save: multi or single
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
-
- // store ASCII state
- aHDFSize[0] = 2;
- hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk((void*)(theASCII?"A":"B")); // save: ASCII or BINARY
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
-
- Translate_IOR_to_persistentID (aStudy,SB,sco,Engine,theMultiFile, theASCII);
- MESSAGE("After Translate_IOR_to_persistentID");
-
- // Creation of the persistance reference attribute
- }
+ } // if(nbRows > 0 && aTable->GetNbColumns() > 1)
+
+ } // if(anAutoSaveSO->FindAttribute(aTable, "AttributeTableOfString")
+
+ } // if(SB->IsGUID(AUTO_SAVE_GUID)
+
+ //SRN: End
+
+ CORBA::String_var IOREngine;
+ if(sco->ComponentIOR(IOREngine)){
+ // we have found the associated engine to write the data
+ MESSAGE ( "We have found an engine for data type :"<< componentDataType);
+ CORBA::Object_var obj = _orb->string_to_object(IOREngine);
+ SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
+
+ if(!CORBA::is_nil(Engine)){
+ MESSAGE ( "Save the data of type:"<< componentDataType);
+ MESSAGE("Engine :"<<Engine->ComponentDataType());
+
+ SALOMEDS::TMPFile_var aStream;
+
+ if(theASCII)
+ aStream = Engine->SaveASCII(sco,SALOMEDS_Tool::GetDirFromPath(aUrl).c_str(),theMultiFile);
+ else
+ aStream = Engine->Save(sco,SALOMEDS_Tool::GetDirFromPath(aUrl).c_str(),theMultiFile);
+
+ HDFdataset *hdf_dataset;
+ hdf_size aHDFSize[1];
+ if(aStream->length() > 0){ //The component saved some auxiliary files, then put them into HDF file
+
+ aHDFSize[0] = aStream->length();
+
+ HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group, HDF_STRING, aHDFSize, 1);
+ hdf_dataset->CreateOnDisk();
+ hdf_dataset->WriteOnDisk((unsigned char*) &aStream[0]); //Save the stream in the HDF file
+ hdf_dataset->CloseOnDisk();
}
- hdf_sco_group->CloseOnDisk();
- hdf_sco_group=0; // will be deleted by hdf_group_datacomponent destructor
+ // store multifile state
+ aHDFSize[0] = 2;
+ hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
+ hdf_dataset->CreateOnDisk();
+ hdf_dataset->WriteOnDisk((void*)(theMultiFile?"M":"S")); // save: multi or single
+ hdf_dataset->CloseOnDisk();
+ hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
+
+ // store ASCII state
+ aHDFSize[0] = 2;
+ hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1);
+ hdf_dataset->CreateOnDisk();
+ hdf_dataset->WriteOnDisk((void*)(theASCII?"A":"B")); // save: ASCII or BINARY
+ hdf_dataset->CloseOnDisk();
+ hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
+
+ Translate_IOR_to_persistentID(aStudy,SB,sco,Engine,theMultiFile, theASCII);
+ MESSAGE("After Translate_IOR_to_persistentID");
+
+ // Creation of the persistance reference attribute
+ }
}
+ hdf_sco_group->CloseOnDisk();
+ hdf_sco_group=0; // will be deleted by hdf_group_datacomponent destructor
+ }
hdf_group_datacomponent->CloseOnDisk();
hdf_group_datacomponent =0; // will be deleted by hdf_file destructor
-
-
+
+
//-----------------------------------------------------------------------
//3 - Write the Study Structure
//-----------------------------------------------------------------------
hdf_group_study_structure->CreateOnDisk();
// save component attributes
- SALOMEDS::SComponentIterator_var itcomp = aStudy->NewComponentIterator();
- for (; itcomp->More(); itcomp->Next())
- {
- SALOMEDS::SComponent_var SC = itcomp->Value();
-
- CORBA::String_var scid = SC->GetID();
- hdf_sco_group2 = new HDFgroup(scid,hdf_group_study_structure);
- hdf_sco_group2->CreateOnDisk();
- SaveAttributes(SC, hdf_sco_group2);
- // ComponentDataType treatment
- CORBA::String_var component_name = SC->ComponentDataType();
- MESSAGE("Component data type " << component_name << " treated");
-
- name_len = (hdf_int32) strlen(component_name.in());
- size[0] = name_len +1 ;
- hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1);
- hdf_dataset->CreateOnDisk();
- hdf_dataset->WriteOnDisk(const_cast<char*>(component_name.in()));
- MESSAGE("component name " << component_name << " wrote on file");
- hdf_dataset->CloseOnDisk();
- hdf_dataset=0; //will be deleted by hdf_sco_group destructor
- _SaveObject(aStudy, SC, hdf_sco_group2);
- hdf_sco_group2->CloseOnDisk();
- hdf_sco_group2=0; // will be deleted by hdf_group_study_structure destructor
- }
+ aComponentIter.Init();
+ for(; aComponentIter.More(); aComponentIter.Next()){
+ SALOMEDS::SComponent_var SC = aComponentIter.Value();
+
+ CORBA::String_var scid = SC->GetID();
+ hdf_sco_group2 = new HDFgroup(scid,hdf_group_study_structure);
+ hdf_sco_group2->CreateOnDisk();
+ SaveAttributes(SC, hdf_sco_group2);
+ // ComponentDataType treatment
+ CORBA::String_var component_name = SC->ComponentDataType();
+ MESSAGE("Component data type " << component_name << " treated");
+
+ name_len = (hdf_int32) strlen(component_name.in());
+ size[0] = name_len +1 ;
+ hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1);
+ hdf_dataset->CreateOnDisk();
+ hdf_dataset->WriteOnDisk(const_cast<char*>(component_name.in()));
+ MESSAGE("component name " << component_name << " wrote on file");
+ hdf_dataset->CloseOnDisk();
+ hdf_dataset=0; //will be deleted by hdf_sco_group destructor
+ _SaveObject(aStudy, SC, hdf_sco_group2);
+ hdf_sco_group2->CloseOnDisk();
+ hdf_sco_group2=0; // will be deleted by hdf_group_study_structure destructor
+ }
//-----------------------------------------------------------------------
//4 - Write the Study UseCases Structure
//-----------------------------------------------------------------------
SALOMEDS::SObject_var aSO = aStudy->FindObjectID(USE_CASE_LABEL_ID);
- if (!aSO->_is_nil()) {
+ if(!aSO->_is_nil()){
HDFgroup *hdf_soo_group = new HDFgroup(USE_CASE_LABEL_ID,hdf_group_study_structure);
hdf_soo_group->CreateOnDisk();
SaveAttributes(aSO, hdf_soo_group);
hdf_soo_group=0; // will be deleted by hdf_group_study_structure destructor
}
- if (aLocked) aStudy->GetProperties()->SetLocked(true);
+ if (aLocked)
+ aStudy->GetProperties()->SetLocked(true);
//-----------------------------------------------------------------------
//5 - Write the Study Properties
//-----------------------------------------------------------------------
_name_service.Change_Directory("/Study");
_name_service.Destroy_Name(anOldName);
- _name_service.Register(aStudy, aStudy->Name());
+ _name_service.Register(theStudy, aStudy->Name());
aStudy->IsSaved(true);
hdf_group_study_structure =0; // will be deleted by hdf_file destructor
delete hdf_file; // recursively deletes all hdf objects...
+ }catch(HDFexception){
+ MESSAGE( "HDFexception ! " );
}
- catch (HDFexception)
- {
- MESSAGE( "HDFexception ! " )
+ if(theASCII){ // save file in ASCII format
+ HDFascii::ConvertFromHDFToASCII(aUrl, true);
}
- if (theASCII) { // save file in ASCII format
- HDFascii::ConvertFromHDFToASCII(aUrl, true);
}
}
* Purpose :
*/
//============================================================================
-void SALOMEDS_StudyManager_i::_SaveObject(SALOMEDS::Study_ptr aStudy,
- SALOMEDS::SObject_ptr SC,
+void SALOMEDS_StudyManager_i::_SaveObject(SALOMEDS_Study_i* theStudy,
+ SALOMEDS::SObject_ptr theSObject,
HDFgroup *hdf_group_datatype)
{
// Write in group hdf_group_datatype all informations of SObject SC
SALOMEDS::SObject_var RefSO;
HDFgroup *hdf_group_sobject = 0;
- SALOMEDS::ChildIterator_var itchild = aStudy->NewChildIterator(SC);
- for (; itchild->More(); itchild->Next())
- {
- SALOMEDS::SObject_var SO = itchild->Value();
-
- // mpv: don't save empty labels
- if (SO->GetAllAttributes()->length() == 0 && !SO->ReferencedObject(RefSO)) {
- SALOMEDS::ChildIterator_var subchild = aStudy->NewChildIterator(SC);
- if (!subchild->More()) {
- continue;
- }
- subchild->InitEx(true);
- bool anEmpty = true;
- for (; subchild->More() && anEmpty; subchild->Next())
- if (subchild->Value()->GetAllAttributes()->length() != 0 ||
- subchild->Value()->ReferencedObject(RefSO)) anEmpty = false;
- if (anEmpty) {
- continue;
- }
+ SALOMEDS_ChildIterator_i aChildIter = theStudy->GetChildIterator(theSObject);
+ for(; aChildIter.More(); aChildIter.Next()){
+ SALOMEDS::SObject_var aSObject = aChildIter.Value();
+ SALOMEDS::ListOfAttributes_var anAllAttributes = aSObject->GetAllAttributes();
+
+ // mpv: don't save empty labels
+ if(anAllAttributes->length() == 0 && !aSObject->ReferencedObject(RefSO)){
+ SALOMEDS_ChildIterator_i aSubChildIter = theStudy->GetChildIterator(theSObject);
+ if(!aSubChildIter.More())
+ continue;
+
+ aSubChildIter.InitEx(true);
+ bool anEmpty = true;
+ for(; aSubChildIter.More() && anEmpty; aSubChildIter.Next()){
+ SALOMEDS::SObject_var aSObj = aSubChildIter.Value();
+ SALOMEDS::ListOfAttributes_var anAllAttr = aSObj->GetAllAttributes();
+ if(anAllAttr->length() != 0 || aSObj->ReferencedObject(RefSO))
+ anEmpty = false;
}
-
- CORBA::String_var scoid(SO->GetID());
- hdf_group_sobject = new HDFgroup(scoid,hdf_group_datatype);
- hdf_group_sobject->CreateOnDisk();
- SaveAttributes(SO, hdf_group_sobject);
- _SaveObject(aStudy,SO, hdf_group_sobject);
- hdf_group_sobject->CloseOnDisk();
- hdf_group_sobject =0; // will be deleted by father hdf object destructor
-
+ if(anEmpty)
+ continue;
}
+
+ CORBA::String_var scoid(aSObject->GetID());
+ hdf_group_sobject = new HDFgroup(scoid,hdf_group_datatype);
+ hdf_group_sobject->CreateOnDisk();
+ SaveAttributes(aSObject, hdf_group_sobject);
+ _SaveObject(theStudy,aSObject, hdf_group_sobject);
+ hdf_group_sobject->CloseOnDisk();
+ hdf_group_sobject =0; // will be deleted by father hdf object destructor
+ }
}
//============================================================================
CORBA::Boolean theMultiFile,
CORBA::Boolean theASCII);
// _SaveObject private function called by _SaveAs
- virtual void _SaveObject(SALOMEDS::Study_ptr aStudy,
- SALOMEDS::SObject_ptr SC,
- HDFgroup *hdf_group_datatype);
+ void _SaveObject(SALOMEDS_Study_i* theStudy,
+ SALOMEDS::SObject_ptr SC,
+ HDFgroup *hdf_group_datatype);
// _SubstituteSlash function called by Open and GetStudyByName
virtual std::string _SubstituteSlash(const char *aUrl);
- virtual void _SaveProperties(SALOMEDS::Study_ptr aStudy, HDFgroup *hdf_group);
+ void _SaveProperties(SALOMEDS_Study_i* theStudy, HDFgroup *hdf_group);
public:
//! standard constructor
PortableServer::POA_var GetPOA() const { return _poa; }
+ SALOMEDS_Study_i* DownCast(SALOMEDS::Study_ptr theStudy) const;
+
//! method to Register study Manager in the naming service
/*!
\param char* arguments, the context to register the study manager in the NS
return _StudyManager->GetPOA();
}
+
+SALOMEDS_SObject_i*
+SALOMEDS_Study_i::DownCast(SALOMEDS::SObject_ptr theSObject) const
+{
+ if(!CORBA::is_nil(theSObject)){
+ PortableServer::POA_var aPOA = GetPOA();
+ PortableServer::ServantBase_var aServant = SALOMEDS::GetServant(theSObject,aPOA);
+ if(aServant.in())
+ return dynamic_cast<SALOMEDS_SObject_i*>(aServant.in());
+ }
+ return NULL;
+}
+
//============================================================================
/*! Function : SetOnAddSObject
* Purpose :
{
// firstly searching in the datamap for optimization
char* anIOR = const_cast<char*>(theObjectIOR);
- if (myIORLabels.IsBound(anIOR)) {
- SALOMEDS::SObject_var aResult = SALOMEDS_SObject_i::NewRef(this,myIORLabels.Find(anIOR));
+ if(myIORLabels.IsBound(anIOR)){
+ TDF_Label aLabel = myIORLabels.Find(anIOR);
+ TSObjectHolder aSObjectHolder = SALOMEDS_SObject_i::New(this,aLabel);
+ SALOMEDS_SObject_i* aSObjectPtr = aSObjectHolder.first;
+ SALOMEDS::SObject_var aSObject = aSObjectHolder.second;
// 11 oct 2002: forbidden attributes must be checked here
SALOMEDS::GenericAttribute_var anAttr;
- if (!aResult->FindAttribute(anAttr,"AttributeIOR")) {
+ if(!aSObjectPtr->FindAttribute(anAttr,"AttributeIOR")){
myIORLabels.UnBind(anIOR);
- } else
- return aResult._retn();
+ }else{
+ return aSObject._retn();
+ }
}
// Iterate to all components defined in the study
* Purpose : Create a ChildIterator from an SObject
*/
//============================================================================
-SALOMEDS::ChildIterator_ptr SALOMEDS_Study_i::NewChildIterator(SALOMEDS::SObject_ptr aSO)
+SALOMEDS::ChildIterator_ptr
+SALOMEDS_Study_i::NewChildIterator(SALOMEDS::SObject_ptr theSObject)
{
- //Convert aSO->GetID in TDF_Label.
- TDF_Label Lab;
- TDF_Tool::Label(_doc->GetData(), aSO->GetID(), Lab);
+ SALOMEDS_ChildIterator_i* aServant =
+ new SALOMEDS_ChildIterator_i(GetChildIterator(theSObject));
- //Create iterator
- SALOMEDS_ChildIterator_i* aServant = new SALOMEDS_ChildIterator_i(this,Lab);
return aServant->_this();
}
+SALOMEDS_ChildIterator_i
+SALOMEDS_Study_i::GetChildIterator(SALOMEDS::SObject_ptr theSObject)
+{
+ TDF_Label aLab;
+ TDF_Tool::Label(_doc->GetData(),theSObject->GetID(),aLab);
+ return SALOMEDS_ChildIterator_i(this,aLab);
+}
//============================================================================
/*! Function : NewComponentIterator
* Purpose : Create a SComponentIterator
*/
//============================================================================
-SALOMEDS::SComponentIterator_ptr SALOMEDS_Study_i::NewComponentIterator()
+SALOMEDS::SComponentIterator_ptr
+SALOMEDS_Study_i::NewComponentIterator()
{
- SALOMEDS_SComponentIterator_i* aServant = new SALOMEDS_SComponentIterator_i(this,_doc);
+ SALOMEDS_SComponentIterator_i* aServant =
+ new SALOMEDS_SComponentIterator_i(GetComponentIterator());
+
return aServant->_this();
}
+SALOMEDS_SComponentIterator_i
+SALOMEDS_Study_i::GetComponentIterator()
+{
+ return SALOMEDS_SComponentIterator_i(this,_doc);
+}
+
//============================================================================
/*! Function : GetUseCaseBuilder
* Purpose : Returns a UseCase builder
* Purpose : Create a StudyBuilder
*/
//============================================================================
+SALOMEDS_StudyBuilder_i* SALOMEDS_Study_i::GetBuilder()
+{
+ return _Builder;
+}
+
SALOMEDS::StudyBuilder_ptr SALOMEDS_Study_i::NewBuilder()
{
- return _Builder->_this();
+ return GetBuilder()->_this();
}
//============================================================================
myIORLabels.Bind(TCollection_ExtendedString(IOR), aLabel);
}
-SALOMEDS::Study_ptr SALOMEDS_Study_i::GetStudy(const TDF_Label theLabel, CORBA::ORB_ptr orb) {
- Handle(SALOMEDS_IORAttribute) Att;
- if (theLabel.Root().FindAttribute(SALOMEDS_IORAttribute::GetID(),Att)){
- char* IOR = CORBA::string_dup(TCollection_AsciiString(Att->Get()).ToCString());
- CORBA::Object_var obj = orb->string_to_object(IOR);
- SALOMEDS::Study_ptr aStudy = SALOMEDS::Study::_narrow(obj) ;
- ASSERT(!CORBA::is_nil(aStudy));
- return SALOMEDS::Study::_duplicate(aStudy);
- } else {
- MESSAGE("GetStudy: Problem to get study");
- }
- return SALOMEDS::Study::_nil();
-}
-
-void SALOMEDS_Study_i::IORUpdated(const Handle(SALOMEDS_IORAttribute) theAttribute, CORBA::ORB_ptr orb) {
+void SALOMEDS_Study_i::IORUpdated(const Handle(SALOMEDS_IORAttribute) theAttribute) {
TCollection_AsciiString aString;
- TDF_Tool::Entry(theAttribute->Label(), aString);
- GetStudy(theAttribute->Label(), orb)->UpdateIORLabelMap(TCollection_AsciiString(theAttribute->Get()).ToCString(),
- aString.ToCString());
+ TDF_Tool::Entry(theAttribute->Label(),aString);
+ TCollection_AsciiString aValue(theAttribute->Get());
+ UpdateIORLabelMap(aValue.ToCString(),aString.ToCString());
}
SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindDependances(SALOMEDS::SObject_ptr anObject) {
}
-SALOMEDS::AttributeStudyProperties_ptr SALOMEDS_Study_i::GetProperties() {
- SALOMEDS::GenericAttribute_ptr anAttr = NewBuilder()->FindOrCreateAttribute(FindObjectID("0:1"),
- "AttributeStudyProperties");
+SALOMEDS::AttributeStudyProperties_ptr SALOMEDS_Study_i::GetProperties(){
+ SALOMEDS::SObject_var aSObject = FindObjectID("0:1");
+
+ SALOMEDS::GenericAttribute_var anAttr =
+ GetBuilder()->FindOrCreateAttribute(aSObject,"AttributeStudyProperties");
+
return SALOMEDS::AttributeStudyProperties::_narrow(anAttr);
}
*/
//============================================================================
void SALOMEDS_Study_i::AddPostponed(const char* theIOR) {
- if (!NewBuilder()->HasOpenCommand()) return;
+ if (!GetBuilder()->HasOpenCommand()) return;
try {
CORBA::Object_var obj = GetORB()->string_to_object(theIOR);
if (!CORBA::is_nil(obj)) {
}
void SALOMEDS_Study_i::AddCreatedPostponed(const char* theIOR) {
- if (!NewBuilder()->HasOpenCommand()) return;
+ if (!GetBuilder()->HasOpenCommand()) return;
try {
CORBA::Object_var obj = GetORB()->string_to_object(theIOR);
if (!CORBA::is_nil(obj)) {
#include "SALOMEDS_DataMapStringLabel.hxx"
#include "SALOMEDS_IORAttribute.hxx"
+#include "SALOMEDS_SComponentIterator_i.hxx"
+#include "SALOMEDS_ChildIterator_i.hxx"
+
class SALOMEDS_StudyManager_i;
class SALOMEDS_UseCaseBuilder_i;
class SALOMEDS_StudyBuilder_i;
CORBA::ORB_var GetORB() const;
PortableServer::POA_var GetPOA() const;
-
+
+ SALOMEDS_SObject_i* DownCast(SALOMEDS::SObject_ptr theSObject) const;
+
SALOMEDS::Callback_ptr SetOnAddSObject(SALOMEDS::Callback_ptr theCallback);
SALOMEDS::Callback_ptr SetOnRemoveSObject(SALOMEDS::Callback_ptr theCallback);
\return ChildIterator_ptr arguments, the created ChildIterator
*/
virtual SALOMEDS::ChildIterator_ptr NewChildIterator(SALOMEDS::SObject_ptr aSO);
+ SALOMEDS_ChildIterator_i GetChildIterator(SALOMEDS::SObject_ptr theSObject);
//! method to Create a SComponentIterator
/*!
\return SComponentIterator_ptr arguments, the created SComponentIterator
*/
virtual SALOMEDS::SComponentIterator_ptr NewComponentIterator();
+ SALOMEDS_SComponentIterator_i GetComponentIterator();
//! method to Create a StudyBuilder
/*!
\return StudyBuilder_ptr arguments, the created StudyBuilder
*/
+ SALOMEDS_StudyBuilder_i* GetBuilder();
virtual SALOMEDS::StudyBuilder_ptr NewBuilder();
//! method to get study name
virtual CORBA::Short StudyId();
virtual void StudyId(CORBA::Short id);
- static SALOMEDS::Study_ptr GetStudy(const TDF_Label theLabel, CORBA::ORB_ptr orb);
-
- static void IORUpdated(const Handle(SALOMEDS_IORAttribute) theAttribute, CORBA::ORB_ptr orb);
+ void IORUpdated(const Handle(SALOMEDS_IORAttribute) theAttribute);
virtual void UpdateIORLabelMap(const char* anIOR, const char* aLabel);
#---------------
msgid "INF_VERSION"
-msgstr "Version 2.1.0"
+msgstr "Version 2.2.0"
msgid "INF_COPYRIGHT"
msgstr "Copyright (C) 2003-2004 OPEN CASCADE, EADS/CCR, LIP6,\nCEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS"
#: QAD_Application.cxx:133
msgid "QAD_Application::APP_DEFAULTTITLE"
-msgstr "SALOME 2.1.0"
+msgstr "SALOME 2.2.0"
#: QAD_Desktop.cxx:424
msgid "QAD_Desktop::DESK_DEFAULTTITLE"
-msgstr "SALOME 2.1.0"
+msgstr "SALOME 2.2.0"
SALOMEDS_Attributes.idl \
SALOME_ModuleCatalog.idl \
SALOME_Component.idl \
+ SALOME_ContainerManager.idl \
SALOME_Exception.idl
CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES)
_atFirst = false;
return ret;
}
+ ret = simpleRun("from salome import salome_init");
+ if (ret) {
+ _atFirst = false;
+ return ret;
+ }
+ ret = simpleRun("salome_init()");
+ if (ret) {
+ _atFirst = false;
+ return ret;
+ }
ret = simpleRun("import salome");
if (ret) {
_atFirst = false;
LIB_SRC = LocalTraceCollector.cxx \
LocalTraceBufferPool.cxx
-LDFLAGS+=
+LIBS= @LIBS@
+#LDFLAGS+=
+
@CONCLUDE@
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOMEDS_Attributes.idl \
+ SALOME_ContainerManager.idl \
SALOME_Exception.idl
CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) -DHAVE_CONFIG_H
EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py
-LIB_CLIENT_IDL = SALOME_Exception.idl
+LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_ContainerManager.idl
CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES)
LIBS+= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(OGL_LIBS)
from salome_study import *
from salome_iapp import *
-IN_SALOME_GUI=sg.hasDesktop()
+salome_initial=1
+def salome_init():
+ global salome_initial
+ global orb, lcc, naming_service, cm
+ global sg
+ global myStudyManager, myStudyId, myStudy, myStudyName
+
+ if salome_initial:
+ salome_initial=0
+ orb, lcc, naming_service, cm = salome_kernel_init()
+ sg = salome_iapp_init()
+ myStudyManager, myStudyId, myStudy, myStudyName =salome_study_init()
#--------------------------------------------------------------------------
-# create an SALOMEGUI_Swig instance
-sg = SalomeGUI()
+salome_iapp_initial = 1
+def salome_iapp_init():
+ global salome_iapp_initial
+ global sg,IN_SALOME_GUI
+
+ if salome_iapp_initial:
+ salome_iapp_initial=0
+
+ # create an SALOMEGUI_Swig instance
+ sg = SalomeGUI()
+ IN_SALOME_GUI=sg.hasDesktop()
+ return sg
from LifeCycleCORBA import *
from SALOME_NamingServicePy import *
from SALOME_utilities import *
+import Engines
-# initialise the ORB
-orb = CORBA.ORB_init([''], CORBA.ORB_ID)
+salome_kernel_initial=1
-# create an LifeCycleCORBA instance
-lcc = LifeCycleCORBA(orb)
+def salome_kernel_init():
+ global salome_kernel_initial
+ global orb, lcc, naming_service, cm
+
+ if salome_kernel_initial:
+ salome_kernel_initial = 0
+
+ # initialise the ORB
+ orb = CORBA.ORB_init([''], CORBA.ORB_ID)
-#create an naming service instance
-naming_service = SALOME_NamingServicePy_i(orb)
+ # create an LifeCycleCORBA instance
+ lcc = LifeCycleCORBA(orb)
+
+ #create an naming service instance
+ naming_service = SALOME_NamingServicePy_i(orb)
+
+ # get Container Manager
+ obj = naming_service.Resolve('/ContainerManager')
+ cm = obj._narrow(Engines.ContainerManager)
+
+ return orb, lcc, naming_service, cm
# Module : SALOME
# $Header$
-from salome_iapp import sg
-from salome_kernel import *
+import salome_kernel
import SALOMEDS
+import salome_iapp
#--------------------------------------------------------------------------
def getActiveStudy():
global salome_study_ID
+
print "getActiveStudy"
+ sg = salome_iapp.salome_iapp_init()
if salome_study_ID == -1:
if sg.hasDesktop():
print "---in gui"
nameAlreadyInUse=0
else:
i = i+1
+
theStudy = myStudyManager.NewStudy(aStudyName)
theStudyId = theStudy._get_StudyId()
print aStudyName, theStudyId
#--------------------------------------------------------------------------
-# get Study Manager reference
-print "looking for studyManager ..."
-obj = naming_service.Resolve('myStudyManager')
-myStudyManager = obj._narrow(SALOMEDS.StudyManager)
-print "studyManager found"
-
-# get active study Id, ref and name
-myStudyId = getActiveStudy()
-print "myStudyId",myStudyId
-myStudy = myStudyManager.GetStudyByID(myStudyId)
-myStudyName = myStudy._get_Name()
-
+salome_study_initial = 1
+def salome_study_init():
+ global salome_study_initial
+ global myStudyManager, myStudyId, myStudy, myStudyName
+ global orb, lcc, naming_service, cm
+
+ if salome_study_initial:
+ salome_study_initial = 0
+
+ orb, lcc, naming_service, cm = salome_kernel.salome_kernel_init()
+
+ # get Study Manager reference
+ print "looking for studyManager ..."
+ obj = naming_service.Resolve('myStudyManager')
+ myStudyManager = obj._narrow(SALOMEDS.StudyManager)
+ print "studyManager found"
+
+ # get active study Id, ref and name
+ myStudyId = getActiveStudy()
+ print "myStudyId",myStudyId
+ myStudy = myStudyManager.GetStudyByID(myStudyId)
+ myStudyName = myStudy._get_Name()
+
+ return myStudyManager, myStudyId, myStudy, myStudyName
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOME_ModuleCatalog.idl \
SALOME_Component.idl \
+ SALOME_ContainerManager.idl \
SALOME_Exception.idl
BIN = SALOME_Session_Server
BIN_SRC =
BIN_SERVER_IDL = SALOME_Session.idl
-BIN_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_Registry.idl SALOME_ModuleCatalog.idl SALOME_Exception.idl
+BIN_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_ContainerManager.idl SALOME_Registry.idl SALOME_ModuleCatalog.idl SALOME_Exception.idl
CPPFLAGS+=$(QT_MT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(HDF5_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+=$(QT_MT_LIBS) $(HDF5_LIBS) -lSalomeHDFPersist -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lOpUtil -lPlot2d -lSalomeVTKFilter -lSALOMELocalTrace -lSALOMETraceCollector -lSalomeContainer -lRegistry -lSalomeNotification -lSalomeDS -lTOOLSDS -lSalomeGenericObj -lSalomeCatalog -lEvent -lSalomePrs $(CAS_LDPATH) -lTKBO -lCASCatch
-
+LDFLAGS+=$(QT_MT_LIBS) $(HDF5_LIBS) -lSalomeHDFPersist -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lOpUtil -lPlot2d -lSalomeVTKFilter -lSALOMELocalTrace -lSalomeContainer -lRegistry -lSalomeNotification -lSalomeDS -lTOOLSDS -lSalomeGenericObj -lSalomeCatalog -lEvent -lSalomePrs $(CAS_LDPATH) -lTKBO -lCASCatch -lSalomeResourcesManager
+LDFLAGSFORBIN= $(LDFLAGS) -lSALOMETraceCollector
@CONCLUDE@
void Session_ServerLauncher::ActivateAll()
{
+
+ // Always launch ContainerManager
+
+ char** argv = new char* [1];
+ argv[0] = "ContainerManager";
+ Session_SessionThread* aServerThread2
+ = new Session_SessionThread(1, argv, _orb,_root_poa,_GUIMutex,_ServerLaunch);
+ _serverThreads.push_front(aServerThread2);
+
+ aServerThread2->Init();
+
list<ServArg>::iterator itServ;
for (itServ = _argServToLaunch.begin(); itServ !=_argServToLaunch.end(); itServ++)
{
// Always launch Session Server
int argc=1;
- char** argv = new char*[argc];
+ argv = new char*[argc];
argv[0] = "Session";
Session_SessionThread* aServerThread
= new Session_SessionThread(argc, argv, _orb,_root_poa,_GUIMutex,_ServerLaunch);
#include "Session_ServerThread.hxx"
#include "SALOME_Container_i.hxx"
+#include "SALOME_ContainerManager.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOME_ModuleCatalog_impl.hxx"
#include "RegistryService.hxx"
using namespace std;
-const int Session_ServerThread::NB_SRV_TYP = 5;
+const int Session_ServerThread::NB_SRV_TYP = 6;
const char* Session_ServerThread::_serverTypes[NB_SRV_TYP] = {"Container",
"ModuleCatalog",
"Registry",
"SALOMEDS",
- "Session"};
+ "Session",
+ "ContainerManager"};
//=============================================================================
/*!
case 0: // Container
{
NamingService_WaitForServerReadiness(_NS,"/Registry");
+ NamingService_WaitForServerReadiness(_NS,"/ContainerManager");
ActivateContainer(_argc, _argv);
break;
}
ActivateSession(_argc, _argv);
break;
}
+ case 5: // Container Manager
+ {
+ NamingService_WaitForServerReadiness(_NS,"");
+ ActivateContainerManager(_argc, _argv);
+ break;
+ }
default:
{
ASSERT(0);
*/
//=============================================================================
+void Session_ServerThread::ActivateContainerManager(int argc,
+ char ** argv)
+{
+ try
+ {
+ PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
+ cout << "ActivateContainerManager ......!!!! " << endl;
+ SALOME_ContainerManager * myContainer
+ = new SALOME_ContainerManager(_orb);
+ }
+ catch(CORBA::SystemException&)
+ {
+ INFOS("Caught CORBA::SystemException.");
+ }
+ catch(PortableServer::POA::WrongPolicy&)
+ {
+ INFOS("Caught CORBA::WrongPolicyException.");
+ }
+ catch(PortableServer::POA::ServantAlreadyActive&)
+ {
+ INFOS("Caught CORBA::ServantAlreadyActiveException");
+ }
+ catch(CORBA::Exception&)
+ {
+ INFOS("Caught CORBA::Exception.");
+ }
+ catch(...)
+ {
+ INFOS("Caught unknown exception.");
+ }
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
void Session_ServerThread::ActivateContainer(int argc,
char ** argv)
{
char ** argv);
void ActivateContainer(int argc,
char ** argv);
+ void ActivateContainerManager(int argc,
+ char ** argv);
virtual void ActivateSession(int argc,
char ** argv);
LIB_MOC = ToolsGUI_CatalogGeneratorDlg_moc.cxx
LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl \
- SALOME_Component.idl SALOME_Exception.idl
+ SALOME_Component.idl SALOME_ContainerManager.idl SALOME_Exception.idl
# additionnal information to compil and link file
BIN = TestContainer TestLogger
BIN_SRC =
-LDFLAGS+= -lSalomeNotification -lSalomeNS -lSalomeContainer -lRegistry -lOpUtil -lSALOMELocalTrace -lSALOMETraceCollector
+LDFLAGS+= -lSalomeNotification -lSalomeNS -lSalomeContainer -lRegistry -lOpUtil -lSALOMELocalTrace -lSalomeResourcesManager
+LDFLAGSFORBIN= $(LDFLAGS) -lSALOMETraceCollector
@CONCLUDE@
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOME_ModuleCatalog.idl \
SALOME_Component.idl \
+ SALOME_ContainerManager.idl \
SALOME_Exception.idl
CPPFLAGS+=$(QT_INCLUDES) $(OGL_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES)
-LDFLAGS+=$(VTK_LIBS) $(OGL_LIBS) $(QT_MT_LIBS) -lSalomePrs -lSalomeGUI
+LDFLAGS+=$(VTK_LIBS) $(OGL_LIBS) $(QT_MT_LIBS) -lSalomePrs -lSalomeGUI -lToolsGUI
@CONCLUDE@