#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
{
myColoredPrs3d->SetScalarFilterRange( myMinEdit->text().toDouble(), myMaxEdit->text().toDouble() );
myColoredPrs3d->UseScalarFiltering( myRangeBox->isChecked() );
- myColoredPrs3d->UpdateActors();
+
+ bool isToUpdate = true;
+ if( myColoredPrs3d->IsForcedHidden() )
+ if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>( myVisuGUI ) )
+ if( isToUpdate = VISU::PublishInView( myVisuGUI, myColoredPrs3d, aViewWindow, true ) )
+ myColoredPrs3d->SetForcedHidden( false );
+
+ if( isToUpdate )
+ myColoredPrs3d->UpdateActors();
+
QDialog::accept();
}
VISU::Prs3d_i::Prs3d_i() :
PrsObject_i(SALOMEDS::Study::_nil()),
myActorCollection(vtkActorCollection::New()),
- myIsActiveSatate(true)
+ myIsActiveSatate(true),
+ myIsForcedHidden(false)
{
if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
myOffset[0] = myOffset[1] = myOffset[2] = 0;
GetPipeLine()->SameAs(anOrigin->GetPipeLine());
anOrigin->GetOffset(myOffset);
+
+ SetForcedHidden(anOrigin->IsForcedHidden());
}
}
try {
CheckDataSet();
} catch( std::exception& ex ) {
- SUIT_MessageBox::warning( 0,
- QObject::tr("WRN_VISU"),
- QString( ex.what() ),
- QObject::tr("BUT_OK") );
- RemoveActors();
+ if( !IsForcedHidden() ) {
+ if( HasVisibleActors() )
+ SetForcedHidden( true );
+ RemoveActors();
+ SUIT_MessageBox::warning( 0,
+ QObject::tr("WRN_VISU"),
+ QString( ex.what() ),
+ QObject::tr("BUT_OK") );
+ }
return;
}
ProcessVoidEvent(new TInvokeSignalEvent(myUpdateActorsSignal));
{
return myActorCollection->GetNumberOfItems();
}
+
+bool
+VISU::Prs3d_i
+::HasVisibleActors()
+{
+ myActorCollection->InitTraversal();
+ while( vtkActor* anActor = myActorCollection->GetNextActor() )
+ if( VISU_Actor* aVISUActor = dynamic_cast<VISU_Actor*>( anActor ) )
+ if( aVISUActor->GetVisibility() )
+ return true;
+ return false;
+}
+
+bool
+VISU::Prs3d_i
+::IsForcedHidden() const
+{
+ return myIsForcedHidden;
+}
+
+void
+VISU::Prs3d_i
+::SetForcedHidden( bool theFlag )
+{
+ myIsForcedHidden = theFlag;
+}
GetBounds(vtkFloatingPointType aBounds[6]);
int
- GetNumberOfActors ();
+ GetNumberOfActors();
+
+ bool
+ HasVisibleActors();
//! Move the 3D presentation according to the given offset parameters
void
std::string
GetActorEntry();
+ //----------------------------------------------------------------------------
+ //! Managing "forced hidden" flag
+ bool
+ IsForcedHidden() const;
+
+ void
+ SetForcedHidden( bool );
+
protected:
/*!
Used in Apply method to get know whether it is possible to create presentation
SetActiveState(bool theState);
bool myIsActiveSatate;
+
+ bool myIsForcedHidden;
};
//----------------------------------------------------------------------------