mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-30 19:00:33 +05:00
Debug correction for display/erase annotation in manager, update visible icon in tree widget
This commit is contained in:
parent
aebbb9d494
commit
fafd844ade
@ -54,8 +54,8 @@ public:
|
|||||||
void Display( const QString& theEntry, const int theIndex, SALOME_View* theView = 0 );
|
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 Erase( const QString& theEntry, const int theIndex, SALOME_View* theView = 0 );
|
||||||
|
|
||||||
void DisplayVisibleAnnotations( const QString& theEntry, SALOME_View* theView );
|
void DisplayVisibleAnnotations( const QString& theEntry, SALOME_View* theView = 0 );
|
||||||
void EraseVisibleAnnotations( const QString& theEntry, SALOME_View* theView );
|
void EraseVisibleAnnotations( const QString& theEntry, SALOME_View* theView = 0 );
|
||||||
|
|
||||||
void RemoveView( SALOME_View* theView);
|
void RemoveView( SALOME_View* theView);
|
||||||
|
|
||||||
|
@ -198,8 +198,6 @@ GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app )
|
|||||||
connect( this, SIGNAL( customContextMenuRequested(const QPoint&) ),
|
connect( this, SIGNAL( customContextMenuRequested(const QPoint&) ),
|
||||||
this, SLOT( showContextMenu(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() ) );
|
connect( app->objectBrowser(), SIGNAL( updated() ), this, SLOT( updateTree() ) );
|
||||||
|
|
||||||
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
|
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
|
||||||
@ -462,7 +460,7 @@ QTreeWidgetItem* GEOMGUI_TextTreeWdg::itemFromEntry( const BranchType& theBranch
|
|||||||
// function : onUpdateVisibilityColumn
|
// function : onUpdateVisibilityColumn
|
||||||
// purpose : Update visible state of icons of entry items.
|
// 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
|
// dimension property branch
|
||||||
updateVisibilityColumn( DimensionShape, theEntry, theState );
|
updateVisibilityColumn( DimensionShape, theEntry, theState );
|
||||||
|
@ -67,6 +67,7 @@ public:
|
|||||||
QTreeWidgetItem* theWidgetItem,
|
QTreeWidgetItem* theWidgetItem,
|
||||||
const bool theVisibility );
|
const bool theVisibility );
|
||||||
void updateVisibility( SALOME_View* theView );
|
void updateVisibility( SALOME_View* theView );
|
||||||
|
void updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void createActions();
|
void createActions();
|
||||||
@ -80,7 +81,6 @@ public slots:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onItemClicked(QTreeWidgetItem*, int );
|
void onItemClicked(QTreeWidgetItem*, int );
|
||||||
void onUpdateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
|
|
||||||
void setVisibility( QTreeWidgetItem* theItem, bool visibility );
|
void setVisibility( QTreeWidgetItem* theItem, bool visibility );
|
||||||
void showContextMenu( const QPoint& pos );
|
void showContextMenu( const QPoint& pos );
|
||||||
|
|
||||||
|
@ -2159,12 +2159,6 @@ void GEOM_Displayer::BeforeDisplay( SALOME_View* v, const SALOME_OCCPrs* )
|
|||||||
void GEOM_Displayer::AfterDisplay( SALOME_View* v, const SALOME_OCCPrs* p )
|
void GEOM_Displayer::AfterDisplay( SALOME_View* v, const SALOME_OCCPrs* p )
|
||||||
{
|
{
|
||||||
UpdateColorScale(false,false);
|
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 )
|
void GEOM_Displayer::BeforeErase( SALOME_View* v, const SALOME_OCCPrs* p )
|
||||||
@ -2177,13 +2171,6 @@ void GEOM_Displayer::AfterErase( SALOME_View* v, const SALOME_OCCPrs* p )
|
|||||||
{
|
{
|
||||||
LightApp_Displayer::AfterErase( v, p );
|
LightApp_Displayer::AfterErase( v, p );
|
||||||
UpdateColorScale(false,false);
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================
|
//=================================================================
|
||||||
|
@ -1828,6 +1828,11 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
|
|
||||||
connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
|
connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
|
||||||
this, SLOT( onWindowActivated( 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
|
// Reset actions accelerator keys
|
||||||
action(GEOMOp::OpDelete)->setEnabled( true ); // Delete: Key_Delete
|
action(GEOMOp::OpDelete)->setEnabled( true ); // Delete: Key_Delete
|
||||||
@ -1880,7 +1885,6 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
// 0020836 (Basic vectors and origin)
|
// 0020836 (Basic vectors and origin)
|
||||||
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
|
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
|
||||||
if ( aResourceMgr->booleanValue( "Geometry", "auto_create_base_objects", false ) ) {
|
if ( aResourceMgr->booleanValue( "Geometry", "auto_create_base_objects", false ) ) {
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
|
|
||||||
if ( appStudy ) {
|
if ( appStudy ) {
|
||||||
_PTR(Study) studyDS = appStudy->studyDS();
|
_PTR(Study) studyDS = appStudy->studyDS();
|
||||||
if ( studyDS ) {
|
if ( studyDS ) {
|
||||||
@ -1910,6 +1914,10 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study )
|
|||||||
|
|
||||||
disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
|
disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
|
||||||
this, SLOT( onWindowActivated( 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();
|
LightApp_SelectionMgr* selMrg = getApp()->selectionMgr();
|
||||||
|
|
||||||
@ -1980,6 +1988,18 @@ void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
void GeometryGUI::windows( QMap<int, int>& mappa ) const
|
||||||
{
|
{
|
||||||
mappa.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
|
mappa.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <GEOM_Client.hxx>
|
#include <GEOM_Client.hxx>
|
||||||
#include <SALOME_InteractiveObject.hxx>
|
#include <SALOME_InteractiveObject.hxx>
|
||||||
#include <SALOMEDSClient.hxx>
|
#include <SALOMEDSClient.hxx>
|
||||||
|
#include <Qtx.h>
|
||||||
|
|
||||||
#include "GEOMGUI.h"
|
#include "GEOMGUI.h"
|
||||||
#include "GEOMPluginGUI.h"
|
#include "GEOMPluginGUI.h"
|
||||||
@ -170,6 +171,9 @@ protected slots:
|
|||||||
private slots:
|
private slots:
|
||||||
void OnGUIEvent();
|
void OnGUIEvent();
|
||||||
void onWindowActivated( SUIT_ViewWindow* );
|
void onWindowActivated( SUIT_ViewWindow* );
|
||||||
|
void onUpdateVisibilityColumn( QString theEntry,
|
||||||
|
Qtx::VisibilityState theState );
|
||||||
|
|
||||||
void onViewAboutToShow();
|
void onViewAboutToShow();
|
||||||
void OnSetMaterial( const QString& );
|
void OnSetMaterial( const QString& );
|
||||||
void updateMaterials();
|
void updateMaterials();
|
||||||
|
Loading…
Reference in New Issue
Block a user