VISU_View_i.hh \
VISU_TimeAnimation.h \
VISU_ScalarMapOnDeformedShape_i.hh \
- VISU_ColoredPrs3dCache_i.hh \
- VISU_ColoredPrs3dHolder_i.hh \
VISU_ColoredPrs3dFactory.hh \
SALOME_GenericObjPointer.hh
SObjectToObject(SALOMEDS::SObject_ptr theSObject)
{
SALOMEDS::GenericAttribute_var anAttr;
- CORBA::Object_var anObj;
+ CORBA::Object_var anObject;
+ if(CORBA::is_nil(theSObject))
+ return anObject;
try{
if(theSObject->FindAttribute(anAttr, "AttributeIOR")){
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var aValue = anIOR->Value();
CORBA::ORB_ptr anORB = Base_i::GetORB();
if(strcmp(aValue,"") != 0)
- anObj = anORB->string_to_object(aValue);
+ anObject = anORB->string_to_object(aValue);
}
}catch(...){
INFOS("SObjectToObject - Unknown exception was occured!!!");
}
- return anObj;
+ return anObject;
}
//===========================================================================
ClientSObjectToObject(_PTR(SObject) theSObject)
{
_PTR(GenericAttribute) anAttr;
- CORBA::Object_var anObj;
+ CORBA::Object_var anObject;
+ if(!theSObject)
+ return anObject;
try{
if(theSObject->FindAttribute(anAttr, "AttributeIOR")){
_PTR(AttributeIOR) anIOR = anAttr;
CORBA::String_var aValue = anIOR->Value().c_str();
CORBA::ORB_ptr anORB = Base_i::GetORB();
if(strcmp(aValue,"") != 0)
- anObj = anORB->string_to_object(aValue);
+ anObject = anORB->string_to_object(aValue);
}
}catch(...){
INFOS("ClientSObjectToObject - Unknown exception was occured!!!");
}
- return anObj;
+ return anObject;
}
{
CORBA::Float aRequiredMemory = 0.0;
if(IsPossible(theType, theInput, aRequiredMemory, "")){
- VISU::ColoredPrs3dHolder_i* aHolder = new VISU::ColoredPrs3dHolder_i(theType, theInput, *this);
+ VISU::ColoredPrs3dHolder_i* aHolder = new VISU::ColoredPrs3dHolder_i(*this);
VISU::ColoredPrs3d_i* aColoredPrs3d = CreateColoredPrs3d(theType, theInput);
std::string aComment = std::string("myComment=") + aColoredPrs3d->GetComment();
std::string aName = aColoredPrs3d->GenerateName().latin1();
aHolder->PublishInStudy(aName, aComment);
- RegisterInHolder(aColoredPrs3d, aHolder);
+ RegisterInHolder(aColoredPrs3d, aHolder->GetEntry());
if( aRequiredMemory > 1.0 / VTK_LARGE_FLOAT )
ClearMemory( aRequiredMemory, aHolder->GetEntry() );
return aHolder->_this();
VISU::ColoredPrs3d_i*
VISU::ColoredPrs3dCache_i
::RegisterInHolder(VISU::ColoredPrs3d_i* thePrs3d,
- VISU::ColoredPrs3dHolder_i* theHolder)
+ const std::string& theHolderEntry)
{
TPrs3dPtr aPrs3d( thePrs3d );
aPrs3d->Destroy();
- aPrs3d->SetHolderEntry( theHolder->GetEntry() );
- GetLastVisitedPrsList(theHolder).push_front(aPrs3d);
+ aPrs3d->SetHolderEntry( theHolderEntry );
+ myHolderMap[theHolderEntry].push_front(aPrs3d);
return thePrs3d;
}
VISU::ColoredPrs3dHolder::BasicInput theInput,
VISU::ColoredPrs3dHolder_i* theHolder)
{
- return RegisterInHolder(CreateColoredPrs3d(theType, theInput), theHolder);
+ return RegisterInHolder(CreateColoredPrs3d(theType, theInput),
+ theHolder->GetEntry());
}
class ColoredPrs3d_i;
class ColoredPrs3dHolder_i;
- typedef SALOME::GenericObjPtr<VISU::ColoredPrs3d_i> TPrs3dPtr;
+ struct TPrs3dPtr: SALOME::GenericObjPtr<ColoredPrs3d_i>
+ {
+ typedef SALOME::GenericObjPtr<ColoredPrs3d_i> TSuperClass;
+ // Description:
+ // Initialize smart pointer to given object.
+ TPrs3dPtr(ColoredPrs3d_i* r): TSuperClass(r) {}
+
+ // Description:
+ // Initialize smart pointer with a new reference to the same object
+ // referenced by given smart pointer.
+ TPrs3dPtr(const SALOME::GenericObjPtrBase& r): TSuperClass(r) {}
+
+ // Description:
+ // Provides normal pointer target member access using operator ->.
+ ColoredPrs3d_i* operator->() const
+ {
+ ColoredPrs3d_i* aColoredPrs3d = TSuperClass::operator ->();
+ // To implement postponed restoring of the presentation
+ aColoredPrs3d->InitFromRestoringState();
+ return aColoredPrs3d;
+ }
+ };
+
typedef std::deque<TPrs3dPtr> TLastVisitedPrsList;
typedef std::string THolderEntry;
//! Registers the given ColoredPrs3d instance for the ColoredPrs3dHolder
VISU::ColoredPrs3d_i*
RegisterInHolder(VISU::ColoredPrs3d_i* thePrs3d,
- VISU::ColoredPrs3dHolder_i* theHolder);
+ const std::string& theHolderEntry);
//! Creates and registers corresponding ColoredPrs3d instance for the ColoredPrs3dHolder
VISU::ColoredPrs3d_i*
//----------------------------------------------------------------------------
VISU::ColoredPrs3dHolder_i
-::ColoredPrs3dHolder_i(VISU::VISUType theType,
- VISU::ColoredPrs3dHolder::BasicInput theInput,
- VISU::ColoredPrs3dCache_i& theCache) :
+::ColoredPrs3dHolder_i(VISU::ColoredPrs3dCache_i& theCache) :
PrsObject_i(theCache.GetStudyDocument()),
myCache(theCache)
{
VISU::ColoredPrs3dHolder_i
::ToStream(std::ostringstream& theStr)
{
- Storable::DataToStream( theStr, "myType", GetPrsType() );
+ Storable::DataToStream( theStr, "myPrsType", GetPrsType() );
GetPrs3dDevice()->ToStream(theStr);
}
-//---------------------------------------------------------------
-VISU::Storable*
-VISU::ColoredPrs3dHolder_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap,
- const string& thePrefix)
-{
- VISU::ColoredPrs3d_i* aDevice = GetPrs3dDevice();
- return aDevice->Restore(theMap);
-}
-
//---------------------------------------------------------------
VISU::Storable*
VISU::ColoredPrs3dHolder_i
const string& thePrefix,
const Storable::TRestoringMap& theMap)
{
- /*
- Storable::TRestoringMap aMap = theMap;
-
- std::string aResultEntry = VISU::Storable::FindValue(theMap,"myResultEntry");
- cout << aResultEntry.c_str() << endl;
-
- SALOMEDS::SObject_var aFather = theSObject->GetFather();
- SALOMEDS::SObject_var aGrandFather = aFather->GetFather();
- cout << aGrandFather->GetName() << endl;
-
- VISU::Result_var aResult;
+ using namespace VISU;
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
- SALOMEDS::SObject_var aSObject = aStudy->FindObjectID();
-
- SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(aGrandFather);
- for (anIter->InitEx(true); anIter->More(); anIter->Next())
- {
- SALOMEDS::SObject_var gotBranch = anIter->Value();
- CORBA::Object_var anObj = SObjectToObject(gotBranch);
- if(CORBA::is_nil(anObj))
- continue;
-
- aResult = VISU::Result::_narrow(anObj);
- if(!CORBA::is_nil(aResult))
- break;
+ VISUType aType = VISUType(Storable::FindValue(theMap,"myPrsType").toInt());
+ if(ColoredPrs3d_i* aColoredPrs3d = CreatePrs3d_i(aType, aStudy, ColoredPrs3d_i::EDoNotPublish)){
+ if(ColoredPrs3dCache_i* aCache = ColoredPrs3dCache_i::GetInstance_i(aStudy))
+ if(ColoredPrs3dHolder_i* aHolder = new ColoredPrs3dHolder_i(*aCache)){
+ // To postpone restoring of the device
+ aColoredPrs3d->SaveRestoringState(aStudy, theMap);
+ CORBA::String_var anEntry = theSObject->GetID();
+ aCache->RegisterInHolder(aColoredPrs3d, anEntry.in());
+ return aHolder;
+ }
}
-
- if(CORBA::is_nil(aResult))
- return NULL;
-
- VISU::ColoredPrs3dHolder::BasicInput anInput;
- anInput.myResult = aResult;
- anInput.myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
- anInput.myEntity = (VISU::Entity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
- anInput.myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
- anInput.myTimeStampNumber = VISU::Storable::FindValue(theMap,"myIteration").toInt();
-
- VISU_Gen_i* aVisuGen = VISU::Base_i::GetVisuGenImpl();
- VISU::ColoredPrs3dCache_i* aCache =
- dynamic_cast<VISU::ColoredPrs3dCache_i*>( VISU::GetServant(aVisuGen->GetColoredPrs3dCache(aStudy)).in() );
-
- bool isFind = false;
- QString aType = Storable::FindValue( theMap, "myType", &isFind );
- if( !isFind )
- return NULL;
-
- VISU::VISUType aVISUType = (VISU::VISUType)( aType.toInt() );
-
- VISU::ColoredPrs3dHolder_var aHolder = aCache->CreateHolder( aVISUType, anInput );
-
- VISU::ColoredPrs3dHolder_i* aHolderImpl =
- dynamic_cast<VISU::ColoredPrs3dHolder_i*>( VISU::GetServant(aHolder).in() );
-
- return aHolderImpl->Restore(theSObject,theMap,thePrefix);
- */
return NULL;
}
//----------------------------------------------------------------------------
//! A constructor to create an instance of the class
explicit
- ColoredPrs3dHolder_i(VISU::VISUType theType,
- VISU::ColoredPrs3dHolder::BasicInput theInput,
- VISU::ColoredPrs3dCache_i& theCache);
+ ColoredPrs3dHolder_i(VISU::ColoredPrs3dCache_i& theCache);
virtual
~ColoredPrs3dHolder_i();
void
ToStream(std::ostringstream&);
- virtual
- Storable*
- Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap,
- const std::string& thePrefix);
-
static
Storable*
Restore(SALOMEDS::SObject_ptr theSObject,
//============================================================================
VISU::ColoredPrs3d_i::
ColoredPrs3d_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
myPublishInStudyMode(thePublishInStudyMode),
myIsTimeStampFixed(thePublishInStudyMode == EPublishUnderTimeStamp),
myScalarMapPL(NULL),
myIsFixedRange(false)
{}
-
-//---------------------------------------------------------------
-VISU::ColoredPrs3d_i::
-ColoredPrs3d_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- myPublishInStudyMode(EDoNotPublish),
- myIsTimeStampFixed(true),
- myScalarMapPL(NULL),
- myIsFixedRange(false)
-{}
-
-
//---------------------------------------------------------------
VISU::ColoredPrs3d_i
::~ColoredPrs3d_i()
//----------------------------------------------------------------------------
VISU::Storable*
VISU::ColoredPrs3d_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- SetMeshName(VISU::Storable::FindValue(theMap,"myMeshName").latin1());
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
+
SetEntity((VISU::Entity)VISU::Storable::FindValue(theMap,"myEntity").toInt());
SetFieldName(VISU::Storable::FindValue(theMap,"myFieldName").latin1());
SetTimeStampNumber(VISU::Storable::FindValue(theMap,"myIteration").toInt());
Build(ERestore);
- TSuperClass::Restore(theMap);
-
SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
SetBarOrientation((VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt());
{
TSuperClass::ToStream(theStr);
- Storable::DataToStream( theStr, "myMeshName", GetCMeshName() );
Storable::DataToStream( theStr, "myEntity", GetEntity() );
Storable::DataToStream( theStr, "myFieldName", GetCFieldName() );
Storable::DataToStream( theStr, "myIteration", int(GetTimeStampNumber()) );
Storable::DataToStream( theStr, "myIsTimeStampFixed", int(myIsTimeStampFixed) );
- Storable::DataToStream( theStr, "myResultEntry", GetCResult()->GetEntry() );
Storable::DataToStream( theStr, "myHolderEntry", myHolderEntry );
Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) );
"",
aComment.latin1(),
true);
- SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
}else if(myPublishInStudyMode == EPublishIndependently){
SetName(GenerateName().latin1(), false);
CORBA::String_var anIOR = GetID();
"",
aComment.latin1(),
true);
- SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
}
#ifndef _DEXCEPT_
}catch(std::exception& exc){
explicit
ColoredPrs3d_i(EPublishInStudyMode thePublishInStudyMode);
- explicit
- ColoredPrs3d_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
virtual
~ColoredPrs3d_i();
*/
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
/*!
Writes persistent params of the presentation into the given stream
bool myIsFixedRange;
};
+ //----------------------------------------------------------------------------
+ template<class TColoredPrs3d>
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const std::string& thePrefix,
+ const Storable::TRestoringMap& theMap)
+ {
+ TColoredPrs3d* aColoredPrs3d = new TColoredPrs3d(ColoredPrs3d_i::EDoNotPublish);
+ SALOMEDS::Study_var aStudy = theSObject->GetStudy();
+ return aColoredPrs3d->Restore(aStudy, theMap);
+ }
+ //----------------------------------------------------------------------------
}
#endif
//---------------------------------------------------------------
VISU::CutLines_i::
CutLines_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
myCutLinesPL(NULL)
//---------------------------------------------------------------
-VISU::CutLines_i::
-CutLines_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- myCutLinesPL(NULL)
-{}
-
-
/*! Copy map to /a myMapCurvesInverted.
* \param theCurves - map
*/
//---------------------------------------------------------------
VISU::Storable*
VISU::CutLines_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetNbLines(VISU::Storable::FindValue(theMap,"myNbLines").toInt());
SetDisplacement(VISU::Storable::FindValue(theMap,"myDisplacement[0]").toDouble());
explicit
CutLines_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- CutLines_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
+
virtual
~CutLines_i();
//! Extends VISU_ColoredPrs3d_i::Restore
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
//! Extends VISU_ColoredPrs3d_i::CreateActor
virtual
//----------------------------------------------------------------------------
VISU::CutPlanes_i
::CutPlanes_i(EPublishInStudyMode thePublishInStudyMode):
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
myCutPlanesPL(NULL)
{}
-//----------------------------------------------------------------------------
-VISU::CutPlanes_i
-::CutPlanes_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject):
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- myCutPlanesPL(NULL)
-{}
-
-
//----------------------------------------------------------------------------
VISU::Storable*
VISU::CutPlanes_i
//----------------------------------------------------------------------------
VISU::Storable*
VISU::CutPlanes_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetNbPlanes(VISU::Storable::FindValue(theMap,"myNbPlanes").toInt());
SetDisplacement(VISU::Storable::FindValue(theMap,"myDisplacement").toDouble());
explicit
CutPlanes_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- CutPlanes_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
+
virtual
~CutPlanes_i();
//! Redefines VISU_ColoredPrs3d_i::Restore
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
//! Redefines VISU_ColoredPrs3d_i::CreateActor
virtual
//---------------------------------------------------------------
VISU::DeformedShape_i
::DeformedShape_i(EPublishInStudyMode thePublishInStudyMode):
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
myDeformedShapePL(NULL)
}
-//---------------------------------------------------------------
-VISU::DeformedShape_i
-::DeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject):
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- myDeformedShapePL(NULL)
-{
- if(MYDEBUG) MESSAGE("DeformedShape_i::DeformedShape_i");
-}
-
-
//---------------------------------------------------------------
void
VISU::DeformedShape_i
//---------------------------------------------------------------
VISU::Storable*
VISU::DeformedShape_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").toInt();
explicit
DeformedShape_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- DeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
+
virtual
void
SameAs(const Prs3d_i* theOrigin);
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
virtual
void
//----------------------------------------------------------------------------
VISU::GaussPoints_i
::GaussPoints_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
myGaussPointsPL(NULL),
myColor(Qt::blue),
}
-//----------------------------------------------------------------------------
-VISU::GaussPoints_i
-::GaussPoints_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- myGaussPointsPL(NULL),
- myColor(Qt::blue),
- myIsActiveLocalScalarBar(true),
- myIsDispGlobalScalarBar(true),
- myFaceLimit(50000)
-{
- if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i - this = "<<this);
-}
-
-
//----------------------------------------------------------------------------
VISU::Storable*
VISU::GaussPoints_i
//----------------------------------------------------------------------------
VISU::Storable*
VISU::GaussPoints_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetIsActiveLocalScalarBar(Storable::FindValue(theMap,"myIsActiveLocalScalarBar").toInt());
SetIsDispGlobalScalarBar(Storable::FindValue(theMap,"myIsDispGlobalScalarBar").toInt());
explicit
GaussPoints_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- GaussPoints_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
virtual
~GaussPoints_i();
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
//----------------------------------------------------------------------------
virtual
RegistryStorable()
{
Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore));
- Storable::Registry(Mesh_i::myComment.c_str(),&(Restore<Mesh_i>));
+ Storable::Registry(Mesh_i::myComment.c_str(),&(Mesh_i::Restore));
Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
Storable::Registry(GaussPoints_i::myComment.c_str(),&(Restore<GaussPoints_i>));
Storable::Registry(DeformedShape_i::myComment.c_str(),&(Restore<DeformedShape_i>));
{
if(myStudyDocument->GetProperties()->IsLocked())
return Mesh::_nil();
- Mutex mt(myMutex);
- if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
- Mesh_i* aPresent = new Mesh_i(pResult);
- if(aPresent->Create(theMeshName,theEntity) != NULL)
+
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+ Mesh_i* aPresent = new Mesh_i();
+ if(!aPresent->Create(aResult, theMeshName, theEntity))
return aPresent->_this();
else{
aPresent->_remove_ref();
{
if(myStudyDocument->GetProperties()->IsLocked())
return Mesh::_nil();
- Mutex mt(myMutex);
- if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
- Mesh_i* aPresent = new Mesh_i(pResult);
- if(aPresent->Create(theMeshName,theEntity,theFamilyName) != NULL)
+
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+ Mesh_i* aPresent = new Mesh_i();
+ if(!aPresent->Create(aResult, theMeshName, theEntity, theFamilyName))
return aPresent->_this();
else{
aPresent->_remove_ref();
{
if(myStudyDocument->GetProperties()->IsLocked())
return Mesh::_nil();
- Mutex mt(myMutex);
- if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
- Mesh_i* aPresent = new Mesh_i(pResult);
- if(aPresent->Create(theMeshName,theGroupName) != NULL)
+
+ if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+ Mesh_i* aPresent = new Mesh_i();
+ if(!aPresent->Create(aResult, theMeshName, theGroupName))
return aPresent->_this();
else{
aPresent->_remove_ref();
const char* theFieldName,
CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::GaussPoints_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::GaussPoints_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
- DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ DeformedShape_ptr
+ VISU_Gen_i
+ ::DeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::DeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::DeformedShape_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
- ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ ScalarMapOnDeformedShape_ptr
+ VISU_Gen_i
+ ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::ScalarMapOnDeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::ScalarMapOnDeformedShape_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
- Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ Vectors_ptr
+ VISU_Gen_i
+ ::VectorsOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::Vectors_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::Vectors_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
- IsoSurfaces_ptr VISU_Gen_i::IsoSurfacesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ IsoSurfaces_ptr
+ VISU_Gen_i
+ ::IsoSurfacesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::IsoSurfaces_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::IsoSurfaces_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
- StreamLines_ptr VISU_Gen_i::StreamLinesOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ StreamLines_ptr
+ VISU_Gen_i
+ ::StreamLinesOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::StreamLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::StreamLines_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
- Plot3D_ptr VISU_Gen_i::Plot3DOnField(Result_ptr theResult,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theIteration)
+ Plot3D_ptr
+ VISU_Gen_i
+ ::Plot3DOnField(Result_ptr theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::Plot3D_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::Plot3D_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult,
const char* theFieldName,
CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::CutPlanes_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::CutPlanes_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
CutLines_ptr VISU_Gen_i::CutLinesOnField(Result_ptr theResult,
const char* theFieldName,
CORBA::Long theIteration)
{
- return Prs3dOnField<VISU::CutLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+ return Prs3dOnField<VISU::CutLines_i>(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theIteration)._retn();
}
Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry){
//---------------------------------------------------------------
VISU::IsoSurfaces_i
::IsoSurfaces_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
myIsoSurfacesPL(NULL)
{}
-//---------------------------------------------------------------
-VISU::IsoSurfaces_i
-::IsoSurfaces_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- myIsoSurfacesPL(NULL)
-{}
-
-
//---------------------------------------------------------------
VISU::Storable*
VISU::IsoSurfaces_i
//---------------------------------------------------------------
VISU::Storable*
VISU::IsoSurfaces_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetNbSurfaces(VISU::Storable::FindValue(theMap,"myNbSurface").toInt());
float aMin = VISU::Storable::FindValue(theMap,"myRange[0]").toDouble();
explicit
IsoSurfaces_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- IsoSurfaces_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
+
virtual
~IsoSurfaces_i();
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
virtual
VISU_Actor*
VISU::Mesh_i
::GenerateName()
{
- return VISU::GenerateName("Mesh",myNbPresent++);
+ return VISU::GenerateName("Mesh", myNbPresent++);
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
VISU::Mesh_i
-::Mesh_i(VISU::Result_i* theResult) :
- PrsObject_i(theResult->GetStudyDocument()),
- Prs3d_i(theResult,false),
+::Mesh_i():
myMeshPL(VISU_MeshPL::New())
{
SetPipeLine(myMeshPL);
//----------------------------------------------------------------------------
+size_t
VISU::Mesh_i
-::Mesh_i(VISU::Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
- Prs3d_i(theResult,theSObject),
- myMeshPL(VISU_MeshPL::New())
+::IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ Entity theEntity,
+ const std::string& theFamilyName)
{
- SetPipeLine(myMeshPL);
+ try{
+ MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
+ size_t aSize = INCMEMORY*
+ theResult->GetInput()->GetMeshOnEntitySize(theMeshName,(VISU::TEntity)theEntity);
+ size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ return aResult;
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+ return 0;
+}
+
+
+//----------------------------------------------------------------------------
+VISU::Storable*
+VISU::Mesh_i
+::Create(VISU::Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFamilyName)
+{
+ SetCResult(theResult);
+ SetMeshName(theMeshName.c_str());
+ myEntity = int(theEntity);//jfa IPAL9284
+ mySubMeshName = theFamilyName;
+ return Build(false);
}
//----------------------------------------------------------------------------
+size_t
+VISU::Mesh_i
+::IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ const std::string& theGroupName)
+{
+ try{
+ MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
+ size_t aSize = INCMEMORY*
+ theResult->GetInput()->GetMeshOnGroupSize(theMeshName,theGroupName);
+ size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ INFOS("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ return aResult;
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+ return 0;
+}
+
+
+//----------------------------------------------------------------------------
+VISU::Storable*
+VISU::Mesh_i
+::Create(VISU::Result_i* theResult,
+ const std::string& theMeshName,
+ const std::string& theGroupName)
+{
+ SetCResult(theResult);
+ SetMeshName(theMeshName.c_str());
+ myEntity = -1;//jfa IPAL9284
+ mySubMeshName = theGroupName;
+ return Build(false);
+}
+
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+VISU::Mesh_i
+::~Mesh_i()
+{
+ if(MYDEBUG) MESSAGE("Mesh_i::~Mesh_i()");
+}
+
+
+//----------------------------------------------------------------------------
+VISU::Storable*
+VISU::Mesh_i
+::Build(int theRestoring)
+{
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
+ aStudyBuilder->NewCommand(); // There is a transaction
+ try {
+ if (GetCResult()->GetInput() == NULL)
+ throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
+ if (!theRestoring) {
+ myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
+ if(myEntity == VISU::NODE_ENTITY)
+ myPresentType = VISU::POINT;
+ SetName(GenerateName().latin1(), false);
+ myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0;
+ myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0;
+ myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
+ }
+
+ if(myEntity >= 0)
+ if(mySubMeshName == "")
+ myType = VISU::TENTITY;
+ else
+ myType = VISU::TFAMILY;
+ else
+ myType = VISU::TGROUP;
+
+ if(MYDEBUG) MESSAGE("Mesh_i::Build - myType = "<<myType);
+ QString aComment,aTmp;
+
+ VISU::PIDMapper anIDMapper;
+ VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+ switch(myType){
+ case VISU::TENTITY :
+ anIDMapper = anInput->GetMeshOnEntity(GetCMeshName(),
+ (VISU::TEntity)myEntity);//jfa IPAL9284
+ aComment = "";
+ aComment.append(aTmp.sprintf("myComment=ENTITY;myType=%d;",VISU::TENTITY));
+ aComment.append("myMeshName=");
+ aComment.append(GetCMeshName().c_str());
+ aComment.append(";");
+ aComment.append(aTmp.sprintf("myId=%d",myEntity));
+ break;
+ case VISU::TFAMILY :
+ anIDMapper = anInput->GetFamilyOnEntity(GetCMeshName(),
+ (VISU::TEntity)myEntity,
+ mySubMeshName);
+ aComment = "";
+ aComment.append(aTmp.sprintf("myComment=FAMILY;myType=%d;",VISU::TFAMILY));
+ aComment.append("myMeshName=");
+ aComment.append(GetCMeshName().c_str());
+ aComment.append(";");
+ aComment.append(aTmp.sprintf("myEntityId=%d;",myEntity));
+ aComment.append("myName=");
+ aComment.append(mySubMeshName);
+ break;
+ case VISU::TGROUP :
+ anIDMapper = anInput->GetMeshOnGroup(GetCMeshName(),
+ mySubMeshName);
+ aComment = "";
+ aComment.append(aTmp.sprintf("myComment=GROUP;myType=%d;",VISU::TGROUP));
+ aComment.append("myMeshName=");
+ aComment.append(GetCMeshName().c_str());
+ aComment.append(";");
+ aComment.append("myName=");
+ aComment.append(mySubMeshName);
+
+ break;
+ }
+ if(!anIDMapper)
+ throw std::runtime_error("Mesh_i::Build - !anIDMapper !!!");
+
+ myMeshPL->SetIDMapper(anIDMapper);
+ myMeshPL->Build();
+
+ if(!theRestoring) { //Setting IOR on the label
+ myMeshPL->Init();
+ string aResultEntry = GetCResult()->GetEntry();
+ string anEntry = GetCResult()->GetEntry(aComment.latin1());
+ if(anEntry == "")
+ throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
+ SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID(anEntry.c_str());
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
+ SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
+ SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ CORBA::String_var aString = GetID();
+ anIOR->SetValue(aString);
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ return NULL;
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ return NULL;
+ }
+ aStudyBuilder->CommitCommand();
+ return this;
+}
+
+
+//---------------------------------------------------------------
void
VISU::Mesh_i
::SameAs(const VISU::Prs3d_i* theOrigin)
}
-//----------------------------------------------------------------------------
-size_t
-VISU::Mesh_i
-::IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- Entity theEntity,
- const std::string& theFamilyName)
-{
- try{
- MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
- size_t aSize = INCMEMORY*
- theResult->GetInput()->GetMeshOnEntitySize(theMeshName,(VISU::TEntity)theEntity);
- size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
- return aResult;
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
- return 0;
-}
-
//----------------------------------------------------------------------------
VISU::Storable*
VISU::Mesh_i
-::Create(const std::string& theMeshName,
- Entity theEntity,
- const std::string& theFamilyName)
-{
- SetMeshName(theMeshName.c_str());
- myEntity = int(theEntity);//jfa IPAL9284
- mySubMeshName = theFamilyName;
- return Build(false);
-}
-
-
-//----------------------------------------------------------------------------
-size_t
-VISU::Mesh_i
-::IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- const std::string& theGroupName)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- try{
- MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
- size_t aSize = INCMEMORY*
- theResult->GetInput()->GetMeshOnGroupSize(theMeshName,theGroupName);
- size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- INFOS("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
- return aResult;
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
- return 0;
-}
-
-
-//----------------------------------------------------------------------------
-VISU::Storable*
-VISU::Mesh_i
-::Create(const std::string& theMeshName,
- const std::string& theGroupName)
-{
- SetMeshName(theMeshName.c_str());
- myEntity = -1;//jfa IPAL9284
- mySubMeshName = theGroupName;
- return Build(false);
-}
-
-
-//----------------------------------------------------------------------------
-VISU::Storable*
-VISU::Mesh_i
-::Restore(const Storable::TRestoringMap& theMap)
-{
- Prs3d_i::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
- SetMeshName(VISU::Storable::FindValue(theMap,"myMeshName").latin1());
myEntity = VISU::Storable::FindValue(theMap,"myEntity").toInt();//jfa IPAL9284
mySubMeshName = VISU::Storable::FindValue(theMap,"mySubMeshName").latin1();
}
+//----------------------------------------------------------------------------
+VISU::Storable*
+VISU::Mesh_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+ const string& thePrefix,
+ const Storable::TRestoringMap& theMap)
+{
+ Mesh_i* aMesh = new Mesh_i();
+ SALOMEDS::Study_var aStudy = theSObject->GetStudy();
+ return aMesh->Restore(aStudy, theMap);
+}
+
+
//----------------------------------------------------------------------------
void
VISU::Mesh_i
::ToStream(std::ostringstream& theStr)
{
- Prs3d_i::ToStream(theStr);
+ TSuperClass::ToStream(theStr);
- Storable::DataToStream( theStr, "myMeshName", GetCMeshName() );
Storable::DataToStream( theStr, "myEntity", myEntity );
Storable::DataToStream( theStr, "mySubMeshName", mySubMeshName.c_str() );
}
-//----------------------------------------------------------------------------
-VISU::Mesh_i
-::~Mesh_i()
-{
- if(MYDEBUG) MESSAGE("Mesh_i::~Mesh_i()");
-}
-
-
-//----------------------------------------------------------------------------
-VISU::Storable*
-VISU::Mesh_i
-::Build(int theRestoring)
-{
- SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
- aStudyBuilder->NewCommand(); // There is a transaction
- try {
- if (GetCResult()->GetInput() == NULL)
- throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
- if (!theRestoring) {
- myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
- if(myEntity == VISU::NODE_ENTITY)
- myPresentType = VISU::POINT;
- SetName(GenerateName().latin1(), false);
- myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0;
- myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0;
- myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
- }
-
- if(myEntity >= 0)
- if(mySubMeshName == "")
- myType = VISU::TENTITY;
- else
- myType = VISU::TFAMILY;
- else
- myType = VISU::TGROUP;
-
- if(MYDEBUG) MESSAGE("Mesh_i::Build - myType = "<<myType);
- QString aComment,aTmp;
-
- VISU::PIDMapper anIDMapper;
- VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
- switch(myType){
- case VISU::TENTITY :
- anIDMapper = anInput->GetMeshOnEntity(GetCMeshName(),
- (VISU::TEntity)myEntity);//jfa IPAL9284
- aComment = "";
- aComment.append(aTmp.sprintf("myComment=ENTITY;myType=%d;",VISU::TENTITY));
- aComment.append("myMeshName=");
- aComment.append(GetCMeshName().c_str());
- aComment.append(";");
- aComment.append(aTmp.sprintf("myId=%d",myEntity));
- break;
- case VISU::TFAMILY :
- anIDMapper = anInput->GetFamilyOnEntity(GetCMeshName(),
- (VISU::TEntity)myEntity,
- mySubMeshName);
- aComment = "";
- aComment.append(aTmp.sprintf("myComment=FAMILY;myType=%d;",VISU::TFAMILY));
- aComment.append("myMeshName=");
- aComment.append(GetCMeshName().c_str());
- aComment.append(";");
- aComment.append(aTmp.sprintf("myEntityId=%d;",myEntity));
- aComment.append("myName=");
- aComment.append(mySubMeshName);
- break;
- case VISU::TGROUP :
- anIDMapper = anInput->GetMeshOnGroup(GetCMeshName(),
- mySubMeshName);
- aComment = "";
- aComment.append(aTmp.sprintf("myComment=GROUP;myType=%d;",VISU::TGROUP));
- aComment.append("myMeshName=");
- aComment.append(GetCMeshName().c_str());
- aComment.append(";");
- aComment.append("myName=");
- aComment.append(mySubMeshName);
-
- break;
- }
- if(!anIDMapper)
- throw std::runtime_error("Mesh_i::Build - !anIDMapper !!!");
-
- myMeshPL->SetIDMapper(anIDMapper);
- myMeshPL->Build();
-
- if(!theRestoring) { //Setting IOR on the label
- myMeshPL->Init();
- string aResultEntry = GetCResult()->GetEntry();
- string anEntry = GetCResult()->GetEntry(aComment.latin1());
- if(anEntry == "")
- throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
- SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID(anEntry.c_str());
- SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
- SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
- SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- CORBA::String_var aString = GetID();
- anIOR->SetValue(aString);
- SetSObject(aSObject);
- }
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- return NULL;
- }catch(...){
- INFOS("Unknown exception was occured!");
- return NULL;
- }
- aStudyBuilder->CommitCommand();
- return this;
-}
-
-
//----------------------------------------------------------------------------
VISU_Actor*
VISU::Mesh_i
{
static int myNbPresent;
Mesh_i(const Mesh_i&);
- Mesh_i();
public:
typedef Prs3d_i TSuperClass;
typedef VISU::Mesh TInterface;
- explicit
- Mesh_i(Result_i* theResult);
-
- explicit
- Mesh_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject);
+ Mesh_i();
virtual
~Mesh_i();
public:
static
size_t
- IsPossible(Result_i* theResult,
+ IsPossible(VISU::Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFamilyName = "");
virtual
Storable*
- Create(const std::string& theMeshName,
+ Create(VISU::Result_i* theResult,
+ const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFamilyName = "");
static
size_t
- IsPossible(Result_i* theResult,
+ IsPossible(VISU::Result_i* theResult,
const std::string& theMeshName,
const std::string& theGroupName);
virtual
Storable*
- Create(const std::string& theMeshName,
+ Create(VISU::Result_i* theResult,
+ const std::string& theMeshName,
const std::string& theGroupName);
VISU::Entity
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
+ static
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const std::string& thePrefix,
+ const Storable::TRestoringMap& theMap);
+
virtual
VISU_Actor*
CreateActor();
//---------------------------------------------------------------
VISU::Plot3D_i
::Plot3D_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
myPlot3DPL(NULL)
{}
-//---------------------------------------------------------------
-VISU::Plot3D_i
-::Plot3D_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- myPlot3DPL(NULL)
-{}
-
-
//---------------------------------------------------------------
VISU::Storable*
VISU::Plot3D_i
//---------------------------------------------------------------
VISU::Storable*
VISU::Plot3D_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetOrientation(VISU::Plot3D::Orientation(VISU::Storable::FindValue(theMap,"myBasePlane").toInt()),
Storable::FindValue(theMap,"aRot[0]").toDouble(),
explicit
Plot3D_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- Plot3D_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
virtual
~Plot3D_i();
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
virtual
VISU_Actor*
::Prs3d_i() :
PrsObject_i(SALOMEDS::Study::_nil()),
myActorCollection(vtkActorCollection::New()),
- mySObject(SALOMEDS::SObject::_nil()),
myIsActiveSatate(true),
- myResult(NULL)
+ myIsRestored(true)
{
if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
myOffset[0] = myOffset[1] = myOffset[2] = 0;
}
-//----------------------------------------------------------------------------
-VISU::Prs3d_i
-::Prs3d_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- mySObject(theSObject),
- myActorCollection(vtkActorCollection::New()),
- myIsActiveSatate(true),
- myResult(theResult)
-{
- if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
- myOffset[0] = myOffset[1] = myOffset[2] = 0;
- myActorCollection->Delete();
- if(theResult){
- SetStudyDocument(theResult->GetStudyDocument());
- theResult->Register();
- }
-}
-
-
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
{
if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
myRemoveActorsFromRendererSignal();
- if(myResult)
- myResult->Destroy();
}
VISU::Prs3d_i
::SetInput(bool theReInit)
{
- if(!myResult)
- return false;
-
- myPreviousResult = myResult;
-
- if(myMeshName == "")
- return false;
-
- myPreviousMeshName = myMeshName;
-
- return true;
+ if(GetCResult()){
+ if(myMeshName != ""){
+ myPreviousResult = myResult;
+ myPreviousMeshName = myMeshName;
+ return true;
+ }
+ }
+ return false;
}
VISU::Prs3d_i
::OnRestoreInput()
{
- myResult = myPreviousResult;
+ SetCResult(myPreviousResult.GetPointer());
myMeshName = myPreviousMeshName;
}
VISU::Prs3d_i
::SetCResult(VISU::Result_i* theResult)
{
- if(myResult != theResult){
- if(myResult)
- myResult->Destroy();
+ VISU::Result_i* aResult = GetCResult();
+ if(aResult != theResult){
+ if(aResult)
+ aResult->Destroy();
if(theResult){
theResult->Register();
SetStudyDocument(theResult->GetStudyDocument());
}
}
+//----------------------------------------------------------------------------
+void
+VISU::Prs3d_i
+::SetResultEntry(const std::string& theResultEntry)
+{
+ SetCResult(VISU::GetResult(GetStudyDocument(), theResultEntry));
+}
+
+//----------------------------------------------------------------------------
+std::string
+VISU::Prs3d_i
+::GetResultEntry()
+{
+ if(VISU::Result_i* aResult = GetCResult())
+ return aResult->GetEntry();
+ return "";
+}
+
//----------------------------------------------------------------------------
VISU::Result_i*
VISU::Prs3d_i
::GetCResult() const
{
- return myResult;
+ return myResult.GetPointer();
}
VISU::Prs3d_i
::GetResultObject()
{
- return myResult->_this();
+ return GetCResult()->_this();
}
//----------------------------------------------------------------------------
VISU::Storable*
VISU::Prs3d_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
+ SetStudyDocument(theStudy);
+ SetResultEntry(VISU::Storable::FindValue(theMap,"myResultEntry").latin1());
+ if(!GetCResult())
+ return NULL;
+
+ SetMeshName(VISU::Storable::FindValue(theMap,"myMeshName").latin1());
SetName(VISU::Storable::FindValue(theMap,"myName").latin1(), false);
myOffset[0] = VISU::Storable::FindValue(theMap,"myOffset[0]").toFloat();
myOffset[1] = VISU::Storable::FindValue(theMap,"myOffset[1]").toFloat();
return this;
}
+//----------------------------------------------------------------------------
+void
+VISU::Prs3d_i
+::SaveRestoringState(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
+{
+ myRestoringStudy = theStudy;
+ myRestoringMap = theMap;
+ myIsRestored = false;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Prs3d_i
+::InitFromRestoringState()
+{
+ if(!myIsRestored){
+ Restore(myRestoringStudy, myRestoringMap);
+ myIsRestored = true;
+ }
+}
+
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
::ToStream(std::ostringstream& theStr)
{
- Storable::DataToStream( theStr, "myName", GetName().c_str() );
+ Storable::DataToStream( theStr, "myResultEntry", GetResultEntry() );
+ Storable::DataToStream( theStr, "myMeshName", GetCMeshName() );
+ Storable::DataToStream( theStr, "myName", GetName().c_str() );
Storable::DataToStream( theStr, "myOffset[0]", myOffset[0] );
Storable::DataToStream( theStr, "myOffset[1]", myOffset[1] );
Storable::DataToStream( theStr, "myOffset[2]", myOffset[2] );
VISU::Prs3d_i
::GetSObject()
{
- if(CORBA::is_nil(mySObject.in())){
- const SALOMEDS::Study_var& aStudy = myResult->GetStudyDocument();
+ const SALOMEDS::Study_var& aStudy = GetStudyDocument();
+ if(CORBA::is_nil(aStudy.in())){
CORBA::String_var anIOR = GetID();
- mySObject = aStudy->FindObjectIOR(anIOR);
+ return aStudy->FindObjectIOR(anIOR);
}
- return mySObject;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU::Prs3d_i
-::SetSObject(SALOMEDS::SObject_var theSObject)
-{
- mySObject = theSObject;
+ return SALOMEDS::SObject::_nil();
}
// Convert to mega bytes
return aSize / (1024.0 * 1024.0);
}
-
-//----------------------------------------------------------------------------
-VISU::Result_i*
-VISU::GetResult(SALOMEDS::SObject_var theSObject)
-{
- VISU::Result_var aResult = FindResult(theSObject);
- if(!aResult->_is_nil())
- return dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult.in()).in());
- return NULL;
-}
#include "VISU_ActorFactory.h"
#include "VISU_ConvertorDef.hxx"
-#include "SALOME_GenericObj_i.hh"
+#include "SALOME_GenericObj.hh"
+#include "SALOME_GenericObjPointer.hh"
#include "SALOME_InteractiveObject.hxx"
#include "VTKViewer.h"
//! A constructor to create a fresh instance of the class
Prs3d_i();
- //! A constructor to restore an instance of the class
- explicit
- Prs3d_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
-
//! To create a deep copy from another instance of the class
virtual
void
QString
GenerateName() = 0;
+ //! To save paramters of the instance to std::ostringstream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
//! To restore paramters of the instance from Storable::TRestoringMap
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
- //! To save paramters of the instance to std::ostringstream
- virtual
+ //! To keep restoring params till the explicit Restore() call
void
- ToStream(std::ostringstream& theStr);
+ SaveRestoringState(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
+
+ //! To restore the presentation according to the saved state
+ void
+ InitFromRestoringState();
//----------------------------------------------------------------------------
//! Get corresponding SALOMEDS::SObject
void
CheckDataSet();
- //! Used in derived classes to initilize the mySObject member
- void
- SetSObject(SALOMEDS::SObject_var theSObject);
-
//! Used in derived classes to initilize the myIO member
void
SetIO(const Handle(SALOME_InteractiveObject)& theIO);
vtkTimeStamp myParamsTime;
private:
- Result_i *myResult;
- Result_i *myPreviousResult;
+ bool myIsRestored;
+ SALOMEDS::Study_var myRestoringStudy;
+ Storable::TRestoringMap myRestoringMap;
+
+ void
+ SetResultEntry(const std::string& theResultEntry);
+
+ std::string
+ GetResultEntry();
+
+ typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
+ TResultPtr myResult;
+ TResultPtr myPreviousResult;
std::string myMeshName;
std::string myPreviousMeshName;
CORBA::Float myOffset[3];
- SALOMEDS::SObject_var mySObject;
-
boost::signal0<void> myUpdateActorsSignal;
boost::signal0<void> myRemoveActorsFromRendererSignal;
vtkSmartPointer<vtkActorCollection> myActorCollection;
Handle(SALOME_InteractiveObject) myIO;
private:
+ friend class ColoredPrs3dCache_i;
+
//! Sets activity flag for the factory instance
void
SetActiveState(bool theState);
bool myIsActiveSatate;
-
- friend class ColoredPrs3dCache_i;
};
//----------------------------------------------------------------------------
- Result_i*
- GetResult(SALOMEDS::SObject_var theSObject);
-
- //----------------------------------------------------------------------------
- template<class TPrs3d>
- Storable*
- Restore(SALOMEDS::SObject_ptr theSObject,
- const std::string& thePrefix,
- const Storable::TRestoringMap& theMap)
- {
- if(VISU::Result_i* aResult = GetResult(theSObject)){
- SALOMEDS::SObject_var aSObject = SALOMEDS::SObject::_duplicate(theSObject);
- TPrs3d* aPrs3d = new TPrs3d(aResult,aSObject);
- return aPrs3d->Restore(theMap);
- }
- return NULL;
- }
- //----------------------------------------------------------------------------
}
#endif
public:
typedef RemovableObject_i TSuperClass;
- PrsObject_i(SALOMEDS::Study_ptr theStudy);
+ PrsObject_i(SALOMEDS::Study_ptr theStudy = SALOMEDS::Study::_nil());
};
}
}
+ //---------------------------------------------------------------
+ Result_i*
+ GetResult(SALOMEDS::Study_ptr theStudy,
+ const std::string& theResultEntry)
+ {
+ if(CORBA::is_nil(theStudy))
+ return NULL;
+
+ SALOMEDS::SObject_var aSObject = theStudy->FindObjectID(theResultEntry.c_str());
+ CORBA::Object_var anObject = SObjectToObject(aSObject);
+ return dynamic_cast<VISU::Result_i*>(GetServant(anObject).in());
+ }
+
+
//---------------------------------------------------------------
typedef boost::recursive_mutex TMutex;
typedef TMutex::scoped_lock TLock;
return "";
}
-string
+std::string
VISU::Result_i
::GetEntry()
{
CORBA::String_var anEntry = mySObject->GetID();
- return string(anEntry);
+ return anEntry.in();
}
const SALOMEDS::SObject_var&
std::map< std::string, TGridInfo > myMeshName2GridInfoMap;
};
- Result_var FindResult(SALOMEDS::SObject_ptr theSObject);
+ //! To find Result object as published on father of the given SObject
+ Result_var
+ FindResult(SALOMEDS::SObject_ptr theSObject);
+
+ //! To get VISU::Result object published on the given SALOMEDS::SObject
+ Result_i*
+ GetResult(SALOMEDS::Study_ptr theStudy,
+ const std::string& theResultEntry);
}
#endif
return myComment.c_str();
}
+
//---------------------------------------------------------------
VISU::ScalarMapOnDeformedShape_i
::ScalarMapOnDeformedShape_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
myScalarMapOnDeformedShapePL(NULL),
myScalarIteration(1)
{}
-//---------------------------------------------------------------
-VISU::ScalarMapOnDeformedShape_i
-::ScalarMapOnDeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject):
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- myScalarMapOnDeformedShapePL(NULL),
- myScalarIteration(1)
-{}
//---------------------------------------------------------------
VISU::Storable*
//---------------------------------------------------------------
VISU::Storable*
VISU::ScalarMapOnDeformedShape_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
SetScalarMeshName(VISU::Storable::FindValue(theMap,"myScalarMeshName"));
explicit
ScalarMapOnDeformedShape_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- ScalarMapOnDeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
- virtual ~ScalarMapOnDeformedShape_i();
+ virtual
+ ~ScalarMapOnDeformedShape_i();
- virtual VISU::VISUType GetType()
+ virtual
+ VISU::VISUType
+ GetType()
{
return VISU::TSCALARMAPONDEFORMEDSHAPE;
}
//! Redefines VISU_ColoredPrs3d_i::Restore
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
-
- static
- Storable*
- Restore(SALOMEDS::SObject_ptr theSObject,
- const std::string& thePrefix,
+ Restore(SALOMEDS::Study_ptr theStudy,
const Storable::TRestoringMap& theMap);
-
+
static const std::string myComment;
virtual
//----------------------------------------------------------------------------
VISU::ScalarMap_i::
ScalarMap_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode)
{}
-//----------------------------------------------------------------------------
-VISU::ScalarMap_i::
-ScalarMap_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject)
-{}
-
//----------------------------------------------------------------------------
VISU::ScalarMap_i
::~ScalarMap_i()
//----------------------------------------------------------------------------
VISU::Storable*
VISU::ScalarMap_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetScaling(VISU::Scaling(VISU::Storable::FindValue(theMap,"myScaling").toInt()));
explicit
ScalarMap_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- ScalarMap_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
+
virtual
~ScalarMap_i();
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
-
- static
- Storable*
- Restore(SALOMEDS::SObject_ptr theSObject,
- const std::string& thePrefix,
+ Restore(SALOMEDS::Study_ptr theStudy,
const Storable::TRestoringMap& theMap);
virtual
//---------------------------------------------------------------
VISU::StreamLines_i
::StreamLines_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
DeformedShape_i(thePublishInStudyMode),
{}
-//---------------------------------------------------------------
-VISU::StreamLines_i
-::StreamLines_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- DeformedShape_i(theResult,theSObject),
- myStreamLinesPL(NULL),
- myAppendFilter(vtkAppendFilter::New())
-{}
-
-
//---------------------------------------------------------------
void
VISU::StreamLines_i
//---------------------------------------------------------------
VISU::Storable*
VISU::StreamLines_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
double anIntegrationStep = VISU::Storable::FindValue(theMap,"myIntegrationStep").toDouble();
double aPropagationTime = VISU::Storable::FindValue(theMap,"myPropagationTime").toDouble();
explicit
StreamLines_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- StreamLines_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
virtual
void
//! Extends VISU_ColoredPrs3d_i::Restore
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
//! Extends VISU_ColoredPrs3d_i::Update
virtual
VISU::Storable::TRestoringMap aPrsMap;
VISU::Storable::StrToMap(strPrsIn,aPrsMap);
- aData.myPrs[0]->Restore(aPrsMap);
+ aData.myPrs[0]->Restore(VISU::GetDSStudy(myStudy), aPrsMap);
}
aData.myPrs[0]->GetOffset(aData.myOffset);
for (int i = 1; i < aData.myNbFrames; i++) {
//---------------------------------------------------------------
VISU::Vectors_i
::Vectors_i(EPublishInStudyMode thePublishInStudyMode) :
- PrsObject_i(SALOMEDS::Study::_nil()),
- Prs3d_i(),
ColoredPrs3d_i(thePublishInStudyMode),
ScalarMap_i(thePublishInStudyMode),
DeformedShape_i(thePublishInStudyMode),
{}
-//---------------------------------------------------------------
-VISU::Vectors_i
-::Vectors_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject) :
- PrsObject_i(theSObject->GetStudy()),
- Prs3d_i(theResult,theSObject),
- ColoredPrs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- DeformedShape_i(theResult,theSObject),
- myLineWidth(1.0),
- myVectorsPL(NULL)
-{}
-
-
//---------------------------------------------------------------
void
VISU::Vectors_i
//---------------------------------------------------------------
VISU::Storable*
VISU::Vectors_i
-::Restore(const Storable::TRestoringMap& theMap)
+::Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap)
{
- TSuperClass::Restore(theMap);
+ if(!TSuperClass::Restore(theStudy, theMap))
+ return NULL;
SetGlyphType(VISU::Vectors::GlyphType(VISU::Storable::FindValue(theMap,"myTypeGlyph").toInt()));
SetGlyphPos(VISU::Vectors::GlyphPos(VISU::Storable::FindValue(theMap,"myPosGlyph").toInt()));
explicit
Vectors_i(EPublishInStudyMode thePublishInStudyModep);
- explicit
- Vectors_i(Result_i* theResult,
- SALOMEDS::SObject_var theSObject);
virtual
void
//! Redefines VISU_ColoredPrs3d_i::Restore
virtual
Storable*
- Restore(const Storable::TRestoringMap& theMap);
+ Restore(SALOMEDS::Study_ptr theStudy,
+ const Storable::TRestoringMap& theMap);
static const std::string myComment;