VisuGUI_ClippingDlg::~VisuGUI_ClippingDlg()
{
// no need to delete child widgets, Qt does it all for us
+ SetPrs3d(NULL);
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
VISU::RenderViewWindow(VISU::GetActiveViewWindow<SVTK_ViewWindow>(myVisuGUI));
}
PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
if (!aServant.in()) return;
- myPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
+ VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
+ SetPrs3d(aPrs3d);
+
if (myPrs3d) {
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
myPlanes.clear();
//=================================================================================
void VisuGUI_ClippingDlg::ClickOnNew()
{
+ Handle(SALOME_InteractiveObject) anIO;
+ CORBA::Object_var anObject = VISU::GetSelectedObj(myVisuGUI, &anIO);
+ if (CORBA::is_nil(anObject)) return;
+
SetCurrentPlaneParam();
if (!myPrs3d)
ClickOnHelp();
}
}
+
+void VisuGUI_ClippingDlg::SetPrs3d(VISU::Prs3d_i* thePrs)
+{
+ if(thePrs != myPrs3d){
+ if(myPrs3d)
+ myPrs3d->Destroy();
+ if(thePrs)
+ thePrs->Register();
+ myPrs3d = thePrs;
+ } else
+ return;
+}