mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-26 09:20:35 +05:00
Displayer: bug in clearTemporary() is fixed.
GeometryGUI: rules of popups are changed (fixed).
This commit is contained in:
parent
b4446e7a7f
commit
d323a0aa04
@ -1113,17 +1113,15 @@ bool GEOM_Displayer::ToActivate() const
|
||||
//=================================================================
|
||||
void GEOM_Displayer::clearTemporary( SalomeApp_SelectionMgr* theSelMgr )
|
||||
{
|
||||
SALOME_ListIO toBeSelected;
|
||||
theSelMgr->selectedObjects(toBeSelected)
|
||||
;
|
||||
SALOME_ListIteratorOfListIO anIter( toBeSelected );
|
||||
for ( ; anIter.More(); anIter.Next() )
|
||||
{
|
||||
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
|
||||
if ( !(anIO->hasEntry()) || ( strncmp( anIO->getEntry(), "TEMP_", 5 ) != 0 ) )
|
||||
toBeSelected.Remove( anIter );
|
||||
SALOME_ListIO selected, toSelect;
|
||||
theSelMgr->selectedObjects( selected );
|
||||
|
||||
for ( SALOME_ListIteratorOfListIO it( selected ) ; it.More(); it.Next() ) {
|
||||
Handle(SALOME_InteractiveObject) io = it.Value();
|
||||
if ( !io.IsNull() && io->hasEntry() && strncmp( io->getEntry(), "TEMP_", 5 ) != 0 )
|
||||
toSelect.Append( it.Value() );
|
||||
}
|
||||
|
||||
theSelMgr->setSelectedObjects( toBeSelected, true );
|
||||
theSelMgr->setSelectedObjects( toSelect, true );
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"POT-Creation-Date: 2002-03-19 09:35:48 AM CET\n"
|
||||
"PO-Revision-Date: 2005-06-01 16:24+0400\n"
|
||||
"PO-Revision-Date: 2003-10-27 17:32+0100\n"
|
||||
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
|
||||
"Content-Type: text/plain; charset=iso-8859-1\n"
|
||||
|
||||
@ -2041,22 +2041,22 @@ msgid "STB_CIRCLE"
|
||||
msgstr "Create a circle"
|
||||
|
||||
msgid "TOP_ELLIPSE"
|
||||
msgstr "Create an ellipse"
|
||||
msgstr "Create a ellipse"
|
||||
|
||||
msgid "MEN_ELLIPSE"
|
||||
msgstr "Ellipse"
|
||||
|
||||
msgid "STB_ELLIPSE"
|
||||
msgstr "Create an ellipse"
|
||||
msgstr "Create a ellipse"
|
||||
|
||||
msgid "TOP_ARC"
|
||||
msgstr "Create an arc"
|
||||
msgstr "Create a arc"
|
||||
|
||||
msgid "MEN_ARC"
|
||||
msgstr "Arc"
|
||||
|
||||
msgid "STB_ARC"
|
||||
msgstr "Create an arc"
|
||||
msgstr "Create a arc"
|
||||
|
||||
msgid "TOP_CURVE"
|
||||
msgstr "Create a curve"
|
||||
@ -2876,3 +2876,9 @@ msgstr "Generation"
|
||||
|
||||
msgid "TOOL_TRANSFORMATION"
|
||||
msgstr "Transformation"
|
||||
|
||||
msgid "TLT_RENAME"
|
||||
msgstr "Rename"
|
||||
|
||||
msgid "NAME_LBL"
|
||||
msgstr "Name: "
|
||||
|
@ -49,7 +49,9 @@
|
||||
#include <SalomeApp_Application.h>
|
||||
#include <SalomeApp_SelectionMgr.h>
|
||||
#include <SalomeApp_VTKSelector.h>
|
||||
#include <SalomeApp_Study.h>
|
||||
#include <SALOME_LifeCycleCORBA.hxx>
|
||||
#include <SALOME_ListIO.hxx>
|
||||
|
||||
// External includes
|
||||
#include <qfileinfo.h>
|
||||
@ -308,6 +310,7 @@ void GeometryGUI::OnGUIEvent( int id )
|
||||
id == 804 || // POPUP VIEWER - ADD IN STUDY
|
||||
id == 901 || // OBJECT BROWSER - RENAME
|
||||
id == 9024 ) { // OBJECT BROWSER - OPEN
|
||||
//cout << "id " << id << " received" << endl;
|
||||
library = getLibrary( "libGEOMToolsGUI.so" );
|
||||
}
|
||||
else if( id == 211 || // MENU VIEW - WIREFRAME/SHADING
|
||||
@ -936,9 +939,9 @@ void GeometryGUI::initialize( CAM_Application* app )
|
||||
mgr->insert( action( 216 ), -1, -1 ); // display
|
||||
mgr->setRule( action( 216 ), "$client in {'ObjectBrowser'} and selcount>0 and (($type in {'Shape' 'Group'} and ($isVisible in {false})) or $type in {'Component'})", true );
|
||||
mgr->insert( action( 215 ), -1, -1 ); // erase
|
||||
mgr->setRule( action( 215 ), "$client in {'ObjectBrowser'} and ((($type in {'Shape' 'Group'}) and ($isVisible in {true})) or ($type in {'Component'} and selcount=1))", true );
|
||||
mgr->setRule( action( 215 ), "$client in {'ObjectBrowser'} and selcount>0 and (($type in {'Shape' 'Group'} and $isVisible in {true}) or ($type in {'Component'} and selcount=1))", true );
|
||||
mgr->insert( action( 213 ), -1, -1 ); // display only
|
||||
mgr->setRule( action( 213 ), "$client in {'ObjectBrowser'} and ($type in {'Shape' 'Group'} or ($type in {'Component'} and selcount=1))", true );
|
||||
mgr->setRule( action( 213 ), "$client in {'ObjectBrowser'} and selcount>0 and ($type in {'Shape' 'Group'} or ($type in {'Component'} and selcount=1))", true );
|
||||
mgr->insert( separator(), -1, -1 );
|
||||
dispmodeId = mgr->insert( tr( "MEN_DISPLAY_MODE" ), -1, -1 ); // display mode menu
|
||||
mgr->insert( action( 80311 ), dispmodeId, -1 ); // wireframe
|
||||
@ -947,6 +950,7 @@ void GeometryGUI::initialize( CAM_Application* app )
|
||||
mgr->insert( action( 80312 ), dispmodeId, -1 ); // shading
|
||||
mgr->setRule( action( 80312 ), "$client in {'OCCViewer' 'VTKViewer'} and selcount>0", true );
|
||||
mgr->setRule( action( 80312 ), "$displaymode in {'Shading'}", false );
|
||||
mgr->insert( separator(), -1, -1 );
|
||||
mgr->insert( action( 8032 ), -1, -1 ); // color
|
||||
mgr->setRule( action( 8032 ), "$client in {'OCCViewer' 'VTKViewer'} and selcount>0", true );
|
||||
mgr->insert( action( 8033 ), -1, -1 ); // transparency
|
||||
@ -1422,3 +1426,17 @@ SalomeApp_Selection* GeometryGUI::createSelection() const
|
||||
return new GEOMGUI_Selection();
|
||||
}
|
||||
|
||||
void GeometryGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& title )
|
||||
{
|
||||
SalomeApp_Module::contextMenuPopup( client, menu, title );
|
||||
SALOME_ListIO lst;
|
||||
getApp()->selectionMgr()->selectedObjects( lst );
|
||||
if ( ( client == "OCCViewer" || client == "VTKViewer" ) && lst.Extent() == 1 ) {
|
||||
Handle(SALOME_InteractiveObject) io = lst.First();
|
||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
|
||||
_PTR(Study) study = appStudy->studyDS();
|
||||
_PTR(SObject) obj = study->FindObjectID( io->getEntry() );
|
||||
if ( obj )
|
||||
title = QString( obj->GetName().c_str() );
|
||||
}
|
||||
}
|
||||
|
@ -104,6 +104,7 @@ public:
|
||||
virtual void windows( QMap<int, int>& ) const;
|
||||
virtual void viewManagers( QStringList& ) const;
|
||||
|
||||
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
|
||||
|
||||
public slots:
|
||||
virtual void deactivateModule( SUIT_Study* );
|
||||
|
Loading…
Reference in New Issue
Block a user