#include "VISU_Table_i.hh"
#include "VISU_Mesh_i.hh"
#include "VISU_ViewManager_i.hh"
-#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VISU_Actor.h"
#include "VISU_ScalarMapAct.h"
GetPrs3dFromBase(Base_i* theBase)
{
if(theBase && theBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
- VISU::ColoredPrs3dHolder_i* aHolder = dynamic_cast<VISU::ColoredPrs3dHolder_i*>(theBase);
- return aHolder->GetPrs3dDevice();
+ CORBA::Object_var anObject = theBase->_this();
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ VISU::Prs3d_var aPrs3d = aHolder->GetDevice();
+ return VISU::GetServantInterface<VISU::Prs3d_i>(aPrs3d);
}
return dynamic_cast<VISU::Prs3d_i*>(theBase);
}
}
} else {
// Remove aSObject together with all its sub-objects
-
VISU::RemoveFromStudy(theSObject,
false, // remove not only IOR attribute, but Object With Children
false); // not Destroy() sub-objects
{
if (!thePrs)
return;
+
if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
return;
- SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
- RemoveScalarBarPosition(theModule, vw, thePrs);
-
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule))
+ RemoveScalarBarPosition(theModule, aViewWindow, thePrs);
+
+ if(VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(thePrs)){
+ std::string anEntry = aColoredPrs3d->GetHolderEntry();
+ if(anEntry != ""){
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), anEntry);
+ if(VISU::Base_i* aBase = anObjectInfo.myBase){
+ if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
+ CORBA::Object_var anObject = aBase->_this();
+ VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObject);
+ aRemovableObject->RemoveFromStudy();
+ return;
+ }
+ }
+ }
+ }
+
thePrs->RemoveFromStudy();
+
}
//------------------------------------------------------------