- //===========================================================================
- string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry,
- const char* theComment, int IsAllLevels)
- {
- if(0 && MYDEBUG) MESSAGE("FindEntryWithComment - '"<<theComment<<"'");
- SALOMEDS::ChildIterator_var anIter =
- theStudyDocument->NewChildIterator(theStudyDocument->FindObjectID(theStartEntry));
- anIter->InitEx(IsAllLevels);
- SALOMEDS::SObject_var aFieldSO;
- for(;anIter->More();anIter->Next()) {
- SALOMEDS::GenericAttribute_var anAttr;
- if (anIter->Value()->FindAttribute(anAttr,"AttributeComment")) {
- SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
- CORBA::String_var aString = aCmnt->Value();
- string aValue(aString);
- if (aValue == theComment) {
- aFieldSO = anIter->Value();
- aString = aFieldSO->GetID();
- aValue = aString;
- return aValue;
- }
- }
- }
- return "";
- }
- //===========================================================================
- string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
- const char* theFatherEntry, const char* theRefFatherEntry,
- const char* theIOR, const char* theName,
- const char* thePersistentRef, const char* theComment,
- CORBA::Boolean theCreateNew)
- {
- if(0 && MYDEBUG)
- MESSAGE("CreateAttributes - theName = "<<theName<<"; theComment = '"<<theComment<<
- "'; theFatherEntry = "<<theFatherEntry);
- SALOMEDS::StudyBuilder_var aStudyBuilder = theStudyDocument->NewBuilder();
- SALOMEDS::SObject_var aFather = theStudyDocument->FindObjectID(theFatherEntry);
- SALOMEDS::SObject_var newObj;
- if (theCreateNew) newObj = aStudyBuilder->NewObject(aFather);
- else newObj = aFather;
- SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeIOR");
- SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(theIOR);
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeName");
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(theName);
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributePersistentRef");
- SALOMEDS::AttributePersistentRef_var aPRef = SALOMEDS::AttributePersistentRef::_narrow(anAttr);
- aPRef->SetValue(thePersistentRef);
- anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
- SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
- aCmnt->SetValue(theComment);
- if(strcmp(theRefFatherEntry,"") != 0){
- SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);
- SALOMEDS::SObject_var anObj = aStudyBuilder->NewObject(aRefFather);
- aStudyBuilder->Addreference(anObj,newObj);
- }
- CORBA::String_var anEntry = newObj->GetID();
- string aRet(anEntry);
- if(0 && MYDEBUG) MESSAGE("CreateAttributes - anEntry = "<<aRet<<"; IOR = "<<theIOR);
- return aRet;
- }
- //===========================================================================
- static SALOMEDS::SComponent_var VisuSComponent;
- static string VisuTmpDir;
- static CORBA::Boolean myIsMultiFile;
- const CORBA::Boolean IsMultifile() {
- return myIsMultiFile;
- }
- //===========================================================================
- VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName) :
- Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
- {
- if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<myMutex);
- _thisObj = this ;
- _id = _poa->activate_object(_thisObj);
- SALOME_NamingService aNamingService(orb);
- CORBA::Object_ptr anObject = aNamingService.Resolve("/Kernel/Session");
- SALOME::Session_var aSession = SALOME::Session::_narrow(anObject);
- //aSession->GetInterface();
- Engines::Component_var aComponent = aSession->GetVisuComponent();
- myVisuGen = VISU::VISU_Gen::_narrow(aComponent);
+
+ void RegistryStorable() {
+ Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore));
+ Storable::Registry(Mesh_i::myComment.c_str(),&(Restore<Mesh_i>));
+ Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
+ Storable::Registry(DeformedShape_i::myComment.c_str(),&(Restore<DeformedShape_i>));
+ Storable::Registry(CutPlanes_i::myComment.c_str(),&(Restore<CutPlanes_i>));
+ Storable::Registry(CutLines_i::myComment.c_str(),&(Restore<CutLines_i>));
+ Storable::Registry(IsoSurfaces_i::myComment.c_str(),&(Restore<IsoSurfaces_i>));
+ Storable::Registry(StreamLines_i::myComment.c_str(),&(Restore<StreamLines_i>));
+ Storable::Registry(Plot3D_i::myComment.c_str(),&(Restore<Plot3D_i>));
+ Storable::Registry(Vectors_i::myComment.c_str(),&(Restore<Vectors_i>));
+ Storable::Registry(Table_i::myComment.c_str(),&(Table_i::Restore));
+ Storable::Registry(Curve_i::myComment.c_str(),&(Curve_i::Restore));
+ Storable::Registry(Container_i::myComment.c_str(),&(Container_i::Restore));