return aStr;
}
- //************************************************************
+ //------------------------------------------------------------
// Selection
CORBA::Object_var
GetSelectedObj(const SalomeApp_Study* theStudy,
return CORBA::Object::_nil();
}
+ VISU::Prs3d_i*
+ GetPrsToModify(const SalomeApp_Module* theModule,
+ Handle(SALOME_InteractiveObject)* theIO,
+ VISU::Storable::TRestoringMap* theMap)
+ {
+ if (CheckLock(GetCStudy(GetAppStudy(theModule))))
+ return NULL;
+
+ CORBA::Object_var anObject = GetSelectedObj(theModule, theIO);
+ if (CORBA::is_nil(anObject))
+ return NULL;
+
+ PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
+ if (!aServant.in())
+ return NULL;
+
+ return dynamic_cast<VISU::Prs3d_i*>(aServant.in());
+ }
+
void
Add(SalomeApp_SelectionMgr* theSelectionMgr,
const Handle(SALOME_InteractiveObject)& theIO)
_PTR(Study) theStudy,
_PTR(SObject) theSObject)
{
+ SalomeApp_Study* study = GetAppStudy( theModule );
+ study->deleteReferencesTo( theSObject );
+
_PTR(ChildIterator) aChildIter = theStudy->NewChildIterator(theSObject);
for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
_PTR(SObject) aChildSObject = aChildIter->Value();
+ study->deleteReferencesTo( aChildSObject );
CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject);
ErasePrs(theModule, aChildObj);
}
}
} 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
ChangeRepresentation (const SalomeApp_Module* theModule,
VISU::PresentationType theType)
{
- SUIT_ViewWindow* aView = GetActiveView(theModule, VTKViewer_Viewer::Type());
+ SUIT_ViewWindow* aView = GetActiveView(theModule, SVTK_Viewer::Type());
if (!aView) return;
- SVTK_ViewWindow* vw = (SVTK_ViewWindow*) aView;
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( aView );
+ if( !vw )
+ return;
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
if (CORBA::is_nil(anObject)) return;
+
+ VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
+ if (CORBA::is_nil(aVisuObj)) return;
+
PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
if (!aServant.in()) return;