void Display( const QString& theEntry, const int theIndex, SALOME_View* theView = 0 );
void Erase( const QString& theEntry, const int theIndex, SALOME_View* theView = 0 );
- void DisplayVisibleAnnotations( const QString& theEntry, SALOME_View* theView );
- void EraseVisibleAnnotations( const QString& theEntry, SALOME_View* theView );
+ void DisplayVisibleAnnotations( const QString& theEntry, SALOME_View* theView = 0 );
+ void EraseVisibleAnnotations( const QString& theEntry, SALOME_View* theView = 0 );
void RemoveView( SALOME_View* theView);
connect( this, SIGNAL( customContextMenuRequested(const QPoint&) ),
this, SLOT( showContextMenu(const QPoint&) ) );
- connect( myStudy, SIGNAL( objVisibilityChanged( QString, Qtx::VisibilityState ) ),
- this, SLOT( onUpdateVisibilityColumn( QString, Qtx::VisibilityState ) ) );
connect( app->objectBrowser(), SIGNAL( updated() ), this, SLOT( updateTree() ) );
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
// function : onUpdateVisibilityColumn
// purpose : Update visible state of icons of entry items.
//=================================================================================
-void GEOMGUI_TextTreeWdg::onUpdateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState )
+void GEOMGUI_TextTreeWdg::updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState )
{
// dimension property branch
updateVisibilityColumn( DimensionShape, theEntry, theState );
QTreeWidgetItem* theWidgetItem,
const bool theVisibility );
void updateVisibility( SALOME_View* theView );
+ void updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
protected:
void createActions();
private slots:
void onItemClicked(QTreeWidgetItem*, int );
- void onUpdateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
void setVisibility( QTreeWidgetItem* theItem, bool visibility );
void showContextMenu( const QPoint& pos );
void GEOM_Displayer::AfterDisplay( SALOME_View* v, const SALOME_OCCPrs* p )
{
UpdateColorScale(false,false);
- // visualize annotations for displayed presentation
- SUIT_Session* session = SUIT_Session::session();
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
- GeometryGUI* aModule = dynamic_cast<GeometryGUI*>( anApp->activeModule() );
- if ( aModule )
- aModule->GetAnnotationMgr()->DisplayVisibleAnnotations(QString(p->GetEntry()), v);
}
void GEOM_Displayer::BeforeErase( SALOME_View* v, const SALOME_OCCPrs* p )
{
LightApp_Displayer::AfterErase( v, p );
UpdateColorScale(false,false);
-
- // hide annotations for erased presentation
- //SUIT_Session* session = SUIT_Session::session();
- //SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
- //GeometryGUI* aModule = dynamic_cast<GeometryGUI*>( anApp->activeModule() );
- //if ( aModule )
- // aModule->GetAnnotationMgr()->EraseVisibleAnnotations(QString(p->GetEntry()), v);
}
//=================================================================
connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+ if ( appStudy )
+ connect( appStudy, SIGNAL( objVisibilityChanged( QString, Qtx::VisibilityState ) ),
+ this, SLOT( onUpdateVisibilityColumn( QString, Qtx::VisibilityState ) ) );
+
// Reset actions accelerator keys
action(GEOMOp::OpDelete)->setEnabled( true ); // Delete: Key_Delete
// 0020836 (Basic vectors and origin)
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
if ( aResourceMgr->booleanValue( "Geometry", "auto_create_base_objects", false ) ) {
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
if ( appStudy ) {
_PTR(Study) studyDS = appStudy->studyDS();
if ( studyDS ) {
disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+ if ( appStudy )
+ disconnect( appStudy, SIGNAL( objVisibilityChanged( QString, Qtx::VisibilityState ) ),
+ this, SLOT( onUpdateVisibilityColumn( QString, Qtx::VisibilityState ) ) );
LightApp_SelectionMgr* selMrg = getApp()->selectionMgr();
}
}
+void GeometryGUI::onUpdateVisibilityColumn( QString theEntry,
+ Qtx::VisibilityState theState )
+{
+ if ( myTextTreeWdg )
+ myTextTreeWdg->updateVisibilityColumn( theEntry, theState );
+
+ if ( theState == Qtx::ShownState )
+ GetAnnotationMgr()->DisplayVisibleAnnotations( theEntry );
+ else
+ GetAnnotationMgr()->EraseVisibleAnnotations( theEntry );
+}
+
void GeometryGUI::windows( QMap<int, int>& mappa ) const
{
mappa.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
#include <GEOM_Client.hxx>
#include <SALOME_InteractiveObject.hxx>
#include <SALOMEDSClient.hxx>
+#include <Qtx.h>
#include "GEOMGUI.h"
#include "GEOMPluginGUI.h"
private slots:
void OnGUIEvent();
void onWindowActivated( SUIT_ViewWindow* );
+ void onUpdateVisibilityColumn( QString theEntry,
+ Qtx::VisibilityState theState );
+
void onViewAboutToShow();
void OnSetMaterial( const QString& );
void updateMaterials();