// Module : SALOME
// $Header$
-#ifndef WNT
+#ifdef WNT
#include <SALOMEDS.hxx>
#include <SALOMEDS_StudyManager.hxx>
#include <SALOMEDS_Study.hxx>
#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDS_StudyBuilder.hxx>
#include <SALOMEDS_SComponent.hxx>
#include <SALOMEDSClient.hxx>
+#include <SALOMEDSClient_IParameters.hxx>
+#include <SALOMEDS_IParameters.hxx>
#include <SALOMEDS_StudyManager_i.hxx>
#else
#include "SALOMEDS.hxx"
#include "SALOMEDS_StudyManager.hxx"
#include "SALOMEDS_Study.hxx"
+#include "SALOMEDS_StudyBuilder.hxx"
#include "SALOMEDS_SObject.hxx"
#include "SALOMEDS_SComponent.hxx"
#include "SALOMEDSClient.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
+#include "SALOMEDS_IParameters.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
#endif
SALOMEDSClient_Study* StudyFactory(SALOMEDS::Study_ptr theStudy)
{
+ if(CORBA::is_nil(theStudy)) return NULL;
return new SALOMEDS_Study(theStudy);
}
SALOMEDSClient_SObject* SObjectFactory(SALOMEDS::SObject_ptr theSObject)
{
+ if(CORBA::is_nil(theSObject)) return NULL;
return new SALOMEDS_SObject(theSObject);
}
SALOMEDSClient_SComponent* SComponentFactory(SALOMEDS::SComponent_ptr theSComponent)
{
+ if(CORBA::is_nil(theSComponent)) return NULL;
return new SALOMEDS_SComponent(theSComponent);
}
+SALOMEDSClient_StudyBuilder* BuilderFactory(SALOMEDS::StudyBuilder_ptr theBuilder)
+{
+ if(CORBA::is_nil(theBuilder)) return NULL;
+ return new SALOMEDS_StudyBuilder(theBuilder);
+}
+
SALOMEDSClient_StudyManager* CreateStudyManager(CORBA::ORB_ptr orb, PortableServer::POA_ptr root_poa)
{
SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, root_poa);
return new SALOMEDS_StudyManager();
}
+SALOMEDSClient_IParameters* GetIParameters(const _PTR(AttributeParameter)& ap)
+{
+ return new SALOMEDS_IParameters(ap);
+}
+
+
+SALOMEDS::SObject_ptr ConvertSObject(const _PTR(SObject)& theSObject)
+{
+
+ SALOMEDS_SObject* so = _CAST(SObject, theSObject);
+ if(!theSObject || !so) return SALOMEDS::SObject::_nil();
+ return so->GetSObject();
+}
+
+SALOMEDS::Study_ptr ConvertStudy(const _PTR(Study)& theStudy)
+{
+ SALOMEDS_Study* study = _CAST(Study, theStudy);
+ if(!theStudy || !study) return SALOMEDS::Study::_nil();
+ return study->GetStudy();
+}
+
+SALOMEDS::StudyBuilder_ptr ConvertBuilder(const _PTR(StudyBuilder)& theBuilder)
+{
+ SALOMEDS_StudyBuilder* builder = _CAST(StudyBuilder, theBuilder);
+ if(!theBuilder || !builder) return SALOMEDS::StudyBuilder::_nil();
+ return builder->GetBuilder();
+}
+
+
}
#include <map>
#include "SALOMEDSClient.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
/*!
Class which an interface to store the parameters of the objects
*/
-class SALOMEDS_IParameters
+class SALOMEDS_IParameters: public SALOMEDSClient_IParameters
{
public:
SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap);
/*!
Enables/Disables the dumping visual parameters
*/
- static void setDumpPython(_PTR(Study) study, const std::string& theID = "");
+ virtual void setDumpPython(_PTR(Study) study, const std::string& theID = "");
/*!
Returns whether there is the dumping visual parameters
*/
- static bool isDumpPython(_PTR(Study) study, const std::string& theID = "");
+ virtual bool isDumpPython(_PTR(Study) study, const std::string& theID = "");
/*!
Returns a default name of the component where the visula parameters are stored.
*/
- static std::string getDefaultVisualComponent();
+ virtual std::string getDefaultVisualComponent();
private:
_PTR(AttributeParameter) _ap;
SALOMEDS::SComponent_ptr SALOMEDS_SComponent::GetSComponent()
{
- if (_isLocal) {
- if (!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
- SALOMEDS::SComponent_var aSCO =
- SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()), _orb);
+ if(_isLocal) {
+ if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_duplicate(SALOMEDS::SComponent::_narrow(GetCORBAImpl()));
+ SALOMEDS::SComponent_var aSCO = SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()), _orb);
+ _corba_impl = SALOMEDS::SComponent::_duplicate(aSCO);
return aSCO._retn();
}
else {
- return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
+ return SALOMEDS::SComponent::_duplicate(SALOMEDS::SComponent::_narrow(GetCORBAImpl()));
}
-
return SALOMEDS::SComponent::_nil();
}
#include "SALOMEDS_SComponent.hxx"
#include "SALOMEDS_GenericAttribute.hxx"
#include "SALOMEDS_Study.hxx"
+#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDSImpl_SComponent.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
SALOMEDS::SObject_ptr SALOMEDS_SObject::GetSObject()
{
if(_isLocal) {
- if(!CORBA::is_nil(_corba_impl)) return _corba_impl;
+ if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SObject::_duplicate(_corba_impl);
SALOMEDS::SObject_var aSO = SALOMEDS_SObject_i::New(_local_impl, _orb);
+ _corba_impl = SALOMEDS::SObject::_duplicate(aSO);
return aSO._retn();
}
else {
- return _corba_impl;
+ return SALOMEDS::SObject::_duplicate(_corba_impl);
}
return SALOMEDS::SObject::_nil();
}
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)
-#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDSImpl_SObject.hxx"
class Standard_EXPORT SALOMEDS_SObject: public virtual SALOMEDSClient_SObject
if (_isLocal) {
SALOMEDS::Locker lock;
- if (!CORBA::is_nil(_corba_impl)) return _corba_impl;
+ if (!CORBA::is_nil(_corba_impl)) return SALOMEDS::Study::_duplicate(_corba_impl);
std::string anIOR = _local_impl->GetTransientReference().ToCString();
SALOMEDS::Study_var aStudy;
if (!_local_impl->IsError() && anIOR != "") {
aStudy = aStudy_servant->_this();
_local_impl->SetTransientReference(_orb->object_to_string(aStudy));
}
+ _corba_impl = SALOMEDS::Study::_duplicate(aStudy);
return aStudy._retn();
}
else {
- return _corba_impl;
+ return SALOMEDS::Study::_duplicate(_corba_impl);
}
return SALOMEDS::Study::_nil();
}
+
_PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID, int theSavePoint)
{
SALOMEDSClient_AttributeParameter* AP = NULL;
#include "SALOMEDS_SComponent.hxx"
#include "SALOMEDS_GenericAttribute.hxx"
#include "SALOMEDS_StudyManager.hxx"
+#include "SALOMEDS_StudyBuilder_i.hxx"
#include "SALOMEDS_Driver_i.hxx"
else _corba_impl->SetIOR(aSO->GetCORBAImpl(), (char*)theValue.c_str());
}
+SALOMEDS::StudyBuilder_ptr SALOMEDS_StudyBuilder::GetBuilder()
+{
+ if(_isLocal) {
+ if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::StudyBuilder::_duplicate(_corba_impl);
+ SALOMEDS_StudyBuilder_i* servant = new SALOMEDS_StudyBuilder_i(_local_impl, _orb);
+ SALOMEDS::StudyBuilder_var aBuilder = servant->StudyBuilder::_this();
+ _corba_impl = SALOMEDS::StudyBuilder::_duplicate(aBuilder);
+ return aBuilder._retn();
+ }
+ else {
+ return SALOMEDS::StudyBuilder::_duplicate(_corba_impl);
+ }
+ return SALOMEDS::StudyBuilder::_nil();
+}
+
void SALOMEDS_StudyBuilder::init_orb()
{
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
virtual void SetComment(const _PTR(SObject)& theSO, const std::string& theValue);
virtual void SetIOR(const _PTR(SObject)& theSO, const std::string& theValue);
+ SALOMEDS::StudyBuilder_ptr GetBuilder();
+
private:
void CheckLocked();
void init_orb();