void VISU::Curve_i::RemoveFromStudy()
{
+
+ //remove curve from containers
+ PortableServer::POA_ptr aPOA = GetPOA();
+ ContainerSet::ConstIterator it = myContainers.begin();
+ for ( ; it != myContainers.end(); it++ ) {
+ SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID( (*it).toLatin1().data() );
+ if ( aSObject->_is_nil() ) continue;
+
+ CORBA::Object_var anObj = VISU::SObjectToObject( aSObject );
+ if ( CORBA::is_nil( anObj ) ) continue;
+ VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj.in() ).in() );
+ if ( !aContainer ) continue;
+ aContainer->RemoveCurve(VISU::Curve::_narrow(aPOA->servant_to_reference(this)));
+ }
+
struct TRemoveFromStudy: public SALOME_Event
{
VISU::Curve_i* myRemovable;
*/
CORBA::Long VISU::Container_i::GetNbCurves()
{
- Update();
+ // Update();
return myCurves.count();
}
/*!
VISU::Container_i* container,
int theDisplaying)
{
- if ( !thePlot )
+ if ( !thePlot || !container)
return;
if ( theDisplaying == VISU::eDisplayOnly )
thePlot->getCurves( clist );
if ( container->GetNbCurves() > 0 ) {
int nbCurves = container->GetNbCurves();
+ SetVisibilityState(container->GetEntry(), GetStateByDisplaying(theDisplaying));
for ( int k = 1; k <= nbCurves; k++ ) {
VISU::Curve_i* theCurve = container->GetCurve( k );
if ( theCurve && theCurve->IsValid() ) {
if ( updateTable ) {
Table_i* aTable = theCurve->getTable();
- if ( aTable ) {
+ if ( aTable && !(aStudy->visibilityState( aTable->GetEntry().c_str() ) == state) ) {
_PTR(SObject) TableSO = aStudy->studyDS()->FindObjectID( aTable->GetEntry() );
if ( TableSO ) {
bool isTableVisible = false;
ContainerSet aContainers = theCurve->getContainers();
ContainerSet::ConstIterator it = aContainers.begin();
for ( ; it != aContainers.end(); it++ ) {
+ //Check that state of container is not set already
+ if(aStudy->visibilityState(*it) == state) continue;
_PTR(SObject) aSObject = aStudy->studyDS()->FindObjectID( (*it).toLatin1().data() );
if ( !aSObject ) continue;
bool isContainerDisplayed = false;
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
if ( !aStudy ) return;
- SalomeApp_Module* aModule = dynamic_cast<SalomeApp_Module*>( anApp->module( "VISU" ) );
+ SalomeApp_Module* aModule = dynamic_cast<SalomeApp_Module*>( anApp->module( anApp->moduleTitle( "VISU" ) ) );
if ( !aModule ) return;
SUIT_ViewManager* aManager = anApp->activeViewManager();
- Qtx::VisibilityState state = ( aManager && aManager->getType() == SPlot2d_Viewer::Type() ) ?
+ int nbCurves = theContainer->GetNbCurves();
+
+ Qtx::VisibilityState state = ( aManager && aManager->getType() == SPlot2d_Viewer::Type() && nbCurves > 0 ) ?
Qtx::HiddenState : Qtx::UnpresentableState;
LightApp_Displayer* aDisplayer = aModule->displayer();
- int nbCurves = theContainer->GetNbCurves();
if ( nbCurves > 0 && aDisplayer ) {
for ( int k = 1; k <= nbCurves; k++ ) {
VISU::Curve_i* aCurve = theContainer->GetCurve( k );