<source>NAME_COLUMN</source>
<translation>Name</translation>
</message>
+ <message>
+ <source>VISIBILITY_COLUMN</source>
+ <translation>Visibility</translation>
+ </message>
</context>
<context>
<name>SUIT_Study</name>
<source>NAME_COLUMN</source>
<translation>Nom</translation>
</message>
+ <message>
+ <source>VISIBILITY_COLUMN</source>
+ <translation>Visibilité</translation>
+ </message>
</context>
<context>
<name>SUIT_Study</name>
#include <VTKViewer_Functor.h>
-#include "SALOME_InteractiveObject.hxx"
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
/*!
\file SVTK_Functor.h
}
};
+ //----------------------------------------------------------------
+ /*!
+ This collect visible IO in list
+ */
+ template<class TActor>
+ struct TCollectIfVisible
+ {
+ SALOME_ListIO& myList;
+ //! To construct the functor
+ TCollectIfVisible (SALOME_ListIO& theList) : myList(theList)
+ {}
+ //! To calculate the functor
+ void operator()(TActor* theActor)
+ {
+ if(theActor->GetVisibility() && theActor->hasIO())
+ myList.Append( theActor->getIO() );
+ }
+ };
}
return QColor(0,0,0);
}
+/*!
+ \Collect objects visible in viewer
+ \param theList - visible objects collection
+*/
+void SVTK_View::GetVisible( SALOME_ListIO& theList )
+{
+ using namespace SVTK;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEach<SALOME_Actor>(aCopy.GetActors(),
+ TCollectIfVisible<SALOME_Actor>(theList));
+}
#endif
#include "SVTK.h"
-#include "SALOME_InteractiveObject.hxx"
+
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
#include <QObject>
Remove(SALOME_Actor* SActor,
bool updateViewer = true);
+ //! Collect objects visible in viewer
+ void
+ GetVisible( SALOME_ListIO& theList );
+
//----------------------------------------------------------------------------
//! Redirect the request to #SVTK_Renderer::SetPreselectionProp
void
return true;
}
+/*!
+ \Collect objects visible in viewer
+ \param theList - visible objects collection
+*/
+void SVTK_Viewer::GetVisible( SALOME_ListIO& theList )
+{
+ // here we collect object if it is disaplaed even one view
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
+ if(TViewWindow* aViewWnd = dynamic_cast<TViewWindow*>(aViewWindow))
+ if(SVTK_View* aView = aViewWnd->getView())
+ aView->GetVisible( theList );
+}
+
/*!
Updates current viewer
*/
#include "SVTK.h"
#include "SVTK_ViewModelBase.h"
-#include "SALOME_Prs.h"
-#include "SALOME_InteractiveObject.hxx"
+#include <SALOME_Prs.h>
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
#include <QColor>
#include <QMap>
//! See #SALOME_View::EraseAll( const bool = false )
void EraseAll( const bool = false );
+ //! See #SALOME_View::getVisible( SALOME_ListIO& )
+ virtual void GetVisible( SALOME_ListIO& );
+
//! See #SALOME_View::CreatePrs( const char* entry = 0 )
SALOME_Prs* CreatePrs( const char* entry = 0 );