mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-24 01:32:05 +05:00
Implementation of PAL13455 (GEOM : PAL EDF 293 Selection filter).
This commit is contained in:
parent
db7b6bec5b
commit
ae2f3f9d44
@ -105,9 +105,13 @@ GEOMBase_Helper::~GEOMBase_Helper()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
if ( hasCommand() )
|
if ( hasCommand() )
|
||||||
abortCommand();
|
abortCommand();
|
||||||
|
SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
|
||||||
globalSelection( GEOM_ALLOBJECTS, true );
|
if (app) {
|
||||||
|
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
|
||||||
|
if(aGeomGUI)
|
||||||
|
globalSelection(aGeomGUI->getLocalSelectionMode() , true );
|
||||||
|
}
|
||||||
|
|
||||||
if (myDisplayer)
|
if (myDisplayer)
|
||||||
delete myDisplayer;
|
delete myDisplayer;
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "GEOM_Displayer.h"
|
#include "GEOM_Displayer.h"
|
||||||
|
|
||||||
#include <LightApp_DataOwner.h>
|
#include <LightApp_DataOwner.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
|
|
||||||
#include <OCCViewer_ViewModel.h>
|
#include <OCCViewer_ViewModel.h>
|
||||||
@ -66,7 +67,9 @@ GEOMGUI_Selection::~GEOMGUI_Selection()
|
|||||||
QtxValue GEOMGUI_Selection::globalParam( const QString& p ) const
|
QtxValue GEOMGUI_Selection::globalParam( const QString& p ) const
|
||||||
{
|
{
|
||||||
if ( p == "isOCC" ) return QtxValue( activeViewType() == OCCViewer_Viewer::Type() );
|
if ( p == "isOCC" ) return QtxValue( activeViewType() == OCCViewer_Viewer::Type() );
|
||||||
|
if ( p == "selectionmode" ){
|
||||||
|
return QtxValue(selectionMode());
|
||||||
|
}
|
||||||
return LightApp_Selection::globalParam( p );
|
return LightApp_Selection::globalParam( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,3 +204,24 @@ GEOM::GEOM_Object_ptr GEOMGUI_Selection::getObject( const int index ) const
|
|||||||
}
|
}
|
||||||
return GEOM::GEOM_Object::_nil();
|
return GEOM::GEOM_Object::_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString GEOMGUI_Selection:: selectionMode() const
|
||||||
|
{
|
||||||
|
SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
|
||||||
|
if (app) {
|
||||||
|
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
|
||||||
|
if(aGeomGUI)
|
||||||
|
switch(aGeomGUI->getLocalSelectionMode())
|
||||||
|
{
|
||||||
|
case GEOM_POINT : return "VERTEX";
|
||||||
|
case GEOM_EDGE : return "EDGE";
|
||||||
|
case GEOM_WIRE : return "WIRE";
|
||||||
|
case GEOM_FACE : return "FACE";
|
||||||
|
case GEOM_SHELL : return "SHELL";
|
||||||
|
case GEOM_SOLID : return "SOLID";
|
||||||
|
case GEOM_COMPOUND : return "COMPOUND";
|
||||||
|
case GEOM_ALLOBJECTS : return "ALL";
|
||||||
|
default: return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -47,6 +47,7 @@ private:
|
|||||||
bool isVisible( const int ) const;
|
bool isVisible( const int ) const;
|
||||||
QString typeName( const int ) const;
|
QString typeName( const int ) const;
|
||||||
QString displayMode( const int ) const;
|
QString displayMode( const int ) const;
|
||||||
|
QString selectionMode() const;
|
||||||
|
|
||||||
bool isComponent( const int ) const;
|
bool isComponent( const int ) const;
|
||||||
GEOM::GEOM_Object_ptr getObject( const int ) const;
|
GEOM::GEOM_Object_ptr getObject( const int ) const;
|
||||||
|
@ -766,3 +766,24 @@ msgstr "erase.png"
|
|||||||
|
|
||||||
msgid "ICO_POP_CREATE_GROUP"
|
msgid "ICO_POP_CREATE_GROUP"
|
||||||
msgstr "group_new.png"
|
msgstr "group_new.png"
|
||||||
|
|
||||||
|
msgid "ICO_VERTEX_SEL_ONLY"
|
||||||
|
msgstr "point2.png"
|
||||||
|
|
||||||
|
msgid "ICO_EDGE_SEL_ONLY"
|
||||||
|
msgstr "build_edge.png"
|
||||||
|
|
||||||
|
msgid "ICO_WIRE_SEL_ONLY"
|
||||||
|
msgstr "build_wire.png"
|
||||||
|
|
||||||
|
msgid "ICO_FACE_SEL_ONLY"
|
||||||
|
msgstr "build_face.png"
|
||||||
|
|
||||||
|
msgid "ICO_SHELL_SEL_ONLY"
|
||||||
|
msgstr "build_shell.png"
|
||||||
|
|
||||||
|
msgid "ICO_SOLID_SEL_ONLY"
|
||||||
|
msgstr "build_solid.png"
|
||||||
|
|
||||||
|
msgid "ICO_COMPOUND_SEL_ONLY"
|
||||||
|
msgstr "build_compound.png"
|
@ -3000,3 +3000,54 @@ msgstr "Object of incorrect type selected!\nPlease, select face, shell or solid
|
|||||||
|
|
||||||
msgid "DEP_OBJECT"
|
msgid "DEP_OBJECT"
|
||||||
msgstr "Selected object has been used to create another one\n It can't be deleted "
|
msgstr "Selected object has been used to create another one\n It can't be deleted "
|
||||||
|
|
||||||
|
msgid "MEN_SELECT_ONLY"
|
||||||
|
msgstr "Select Only"
|
||||||
|
|
||||||
|
msgid "STB_VERTEX_SEL_ONLY"
|
||||||
|
msgstr "Select only a Points"
|
||||||
|
|
||||||
|
msgid "STB_EDGE_SEL_ONLY"
|
||||||
|
msgstr "Select only a Edges"
|
||||||
|
|
||||||
|
msgid "STB_WIRE_SEL_ONLY"
|
||||||
|
msgstr "Select only a Wires"
|
||||||
|
|
||||||
|
msgid "STB_FACE_SEL_ONLY"
|
||||||
|
msgstr "Select only a Faces"
|
||||||
|
|
||||||
|
msgid "STB_SHELL_SEL_ONLY"
|
||||||
|
msgstr "Select only a Shells"
|
||||||
|
|
||||||
|
msgid "STB_SOLID_SEL_ONLY"
|
||||||
|
msgstr "Select only a Solids"
|
||||||
|
|
||||||
|
msgid "STB_COMPOUND_SEL_ONLY"
|
||||||
|
msgstr "Select only a Compounds"
|
||||||
|
|
||||||
|
msgid "STB_ALL_SEL_ONLY"
|
||||||
|
msgstr "Select all Objects"
|
||||||
|
|
||||||
|
msgid "MEN_VERTEX_SEL_ONLY"
|
||||||
|
msgstr "Vertex"
|
||||||
|
|
||||||
|
msgid "MEN_EDGE_SEL_ONLY"
|
||||||
|
msgstr "Edge"
|
||||||
|
|
||||||
|
msgid "MEN_WIRE_SEL_ONLY"
|
||||||
|
msgstr "Wire"
|
||||||
|
|
||||||
|
msgid "MEN_FACE_SEL_ONLY"
|
||||||
|
msgstr "Face"
|
||||||
|
|
||||||
|
msgid "MEN_SHELL_SEL_ONLY"
|
||||||
|
msgstr "Shell"
|
||||||
|
|
||||||
|
msgid "MEN_SOLID_SEL_ONLY"
|
||||||
|
msgstr "Solid"
|
||||||
|
|
||||||
|
msgid "MEN_COMPOUND_SEL_ONLY"
|
||||||
|
msgstr "Compound"
|
||||||
|
|
||||||
|
msgid "MEN_ALL_SEL_ONLY"
|
||||||
|
msgstr "Select All"
|
||||||
|
@ -190,6 +190,7 @@ GeometryGUI::GeometryGUI() :
|
|||||||
myVTKSelectors.setAutoDelete( true );
|
myVTKSelectors.setAutoDelete( true );
|
||||||
|
|
||||||
myDisplayer = 0;
|
myDisplayer = 0;
|
||||||
|
myLocalSelectionMode = GEOM_ALLOBJECTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -369,6 +370,14 @@ void GeometryGUI::OnGUIEvent( int id )
|
|||||||
id == 121 || // MENU FILE - EXPORT BREP
|
id == 121 || // MENU FILE - EXPORT BREP
|
||||||
id == 122 || // MENU FILE - EXPORT IGES
|
id == 122 || // MENU FILE - EXPORT IGES
|
||||||
id == 123 || // MENU FILE - EXPORT STEP
|
id == 123 || // MENU FILE - EXPORT STEP
|
||||||
|
id == 2171 || // POPUP VIEWER - SELECT ONLY - VERTEX
|
||||||
|
id == 2172 || // POPUP VIEWER - SELECT ONLY - EDGE
|
||||||
|
id == 2173 || // POPUP VIEWER - SELECT ONLY - WIRE
|
||||||
|
id == 2174 || // POPUP VIEWER - SELECT ONLY - FACE
|
||||||
|
id == 2175 || // POPUP VIEWER - SELECT ONLY - SHELL
|
||||||
|
id == 2176 || // POPUP VIEWER - SELECT ONLY - SOLID
|
||||||
|
id == 2177 || // POPUP VIEWER - SELECT ONLY - COMPOUND
|
||||||
|
id == 2178 || // POPUP VIEWER - SELECT ONLY - SELECT ALL
|
||||||
id == 31 || // MENU EDIT - COPY
|
id == 31 || // MENU EDIT - COPY
|
||||||
id == 33 || // MENU EDIT - DELETE
|
id == 33 || // MENU EDIT - DELETE
|
||||||
id == 411 || // MENU SETTINGS - ADD IN STUDY
|
id == 411 || // MENU SETTINGS - ADD IN STUDY
|
||||||
@ -855,6 +864,14 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createGeomAction( 212, "DISPLAY_ALL" );
|
createGeomAction( 212, "DISPLAY_ALL" );
|
||||||
createGeomAction( 214, "ERASE_ALL" );
|
createGeomAction( 214, "ERASE_ALL" );
|
||||||
createGeomAction( 216, "DISPLAY" );
|
createGeomAction( 216, "DISPLAY" );
|
||||||
|
createGeomAction( 2171, "VERTEX_SEL_ONLY" ,"", 0, true );
|
||||||
|
createGeomAction( 2172, "EDGE_SEL_ONLY", "", 0, true );
|
||||||
|
createGeomAction( 2173, "WIRE_SEL_ONLY", "", 0, true );
|
||||||
|
createGeomAction( 2174, "FACE_SEL_ONLY", "", 0, true );
|
||||||
|
createGeomAction( 2175, "SHELL_SEL_ONLY", "", 0, true );
|
||||||
|
createGeomAction( 2176, "SOLID_SEL_ONLY", "", 0, true );
|
||||||
|
createGeomAction( 2177, "COMPOUND_SEL_ONLY", "", 0, true );
|
||||||
|
createGeomAction( 2178, "ALL_SEL_ONLY", "", 0, true );
|
||||||
createGeomAction( 213, "DISPLAY_ONLY" );
|
createGeomAction( 213, "DISPLAY_ONLY" );
|
||||||
createGeomAction( 215, "ERASE" );
|
createGeomAction( 215, "ERASE" );
|
||||||
|
|
||||||
@ -1116,6 +1133,35 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
mgr->insert( action( 214 ), -1, -1 ); // erase All
|
mgr->insert( action( 214 ), -1, -1 ); // erase All
|
||||||
mgr->setRule( action( 214 ), clientOCCorVTK, true );
|
mgr->setRule( action( 214 ), clientOCCorVTK, true );
|
||||||
|
|
||||||
|
QString selectOnly = "(client='OCCViewer' or client='VTKViewer') and (selcount=0)";
|
||||||
|
|
||||||
|
int selectolnyId = mgr->insert( tr("MEN_SELECT_ONLY"), -1, -1); //select only menu
|
||||||
|
mgr->insert( action(2171), selectolnyId, -1); //Vertex
|
||||||
|
mgr->setRule(action(2171), selectOnly, true);
|
||||||
|
mgr->setRule(action(2171), selectOnly + " and selectionmode='VERTEX'", false);
|
||||||
|
mgr->insert( action(2172), selectolnyId, -1); //Edge
|
||||||
|
mgr->setRule(action(2172), selectOnly, true);
|
||||||
|
mgr->setRule(action(2172), selectOnly + " and selectionmode='EDGE'", false);
|
||||||
|
mgr->insert( action(2173), selectolnyId, -1); //Wire
|
||||||
|
mgr->setRule(action(2173), selectOnly, true);
|
||||||
|
mgr->setRule(action(2173), selectOnly + " and selectionmode='WIRE'", false);
|
||||||
|
mgr->insert( action(2174), selectolnyId, -1); //Face
|
||||||
|
mgr->setRule(action(2174), selectOnly, true);
|
||||||
|
mgr->setRule(action(2174), selectOnly + " and selectionmode='FACE'", false);
|
||||||
|
mgr->insert( action(2175), selectolnyId, -1); //Shell
|
||||||
|
mgr->setRule(action(2175), selectOnly, true);
|
||||||
|
mgr->setRule(action(2175), selectOnly + " and selectionmode='SHELL'", false);
|
||||||
|
mgr->insert( action(2176), selectolnyId, -1); //Solid
|
||||||
|
mgr->setRule(action(2176), selectOnly, true);
|
||||||
|
mgr->setRule(action(2176), selectOnly + " and selectionmode='SOLID'", false);
|
||||||
|
mgr->insert( action(2177), selectolnyId, -1); //Compound
|
||||||
|
mgr->setRule(action(2177), selectOnly, true);
|
||||||
|
mgr->setRule(action(2177), selectOnly + " and selectionmode='COMPOUND'", false);
|
||||||
|
mgr->insert( separator(), selectolnyId, -1);
|
||||||
|
mgr->insert( action(2178), selectolnyId, -1); //Clear selection filter
|
||||||
|
mgr->setRule(action(2178), selectOnly, true);
|
||||||
|
mgr->setRule(action(2178), selectOnly + " and selectionmode='ALL'", false);
|
||||||
|
|
||||||
mgr->insert( action( 213 ), -1, -1 ); // display only
|
mgr->insert( action( 213 ), -1, -1 ); // display only
|
||||||
mgr->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true );
|
mgr->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true );
|
||||||
mgr->insert( separator(), -1, -1 );
|
mgr->insert( separator(), -1, -1 );
|
||||||
@ -1759,3 +1805,12 @@ LightApp_Displayer* GeometryGUI::displayer()
|
|||||||
myDisplayer = new GEOM_Displayer( dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) );
|
myDisplayer = new GEOM_Displayer( dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) );
|
||||||
return myDisplayer;
|
return myDisplayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeometryGUI::setLocalSelectionMode(const int mode)
|
||||||
|
{
|
||||||
|
myLocalSelectionMode = mode;
|
||||||
|
}
|
||||||
|
int GeometryGUI::getLocalSelectionMode() const
|
||||||
|
{
|
||||||
|
return myLocalSelectionMode;
|
||||||
|
}
|
||||||
|
@ -136,7 +136,8 @@ public:
|
|||||||
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
|
virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
|
||||||
virtual void createPreferences();
|
virtual void createPreferences();
|
||||||
virtual void preferencesChanged( const QString&, const QString& );
|
virtual void preferencesChanged( const QString&, const QString& );
|
||||||
|
int getLocalSelectionMode() const;
|
||||||
|
void setLocalSelectionMode(const int mode);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual bool deactivateModule( SUIT_Study* );
|
virtual bool deactivateModule( SUIT_Study* );
|
||||||
@ -186,6 +187,7 @@ private:
|
|||||||
QPtrList<LightApp_VTKSelector> myVTKSelectors;
|
QPtrList<LightApp_VTKSelector> myVTKSelectors;
|
||||||
|
|
||||||
LightApp_Displayer* myDisplayer;
|
LightApp_Displayer* myDisplayer;
|
||||||
|
int myLocalSelectionMode; //Select Only
|
||||||
|
|
||||||
friend class DisplayGUI;
|
friend class DisplayGUI;
|
||||||
};
|
};
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
#include <LightApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
#include <SALOME_ListIteratorOfListIO.hxx>
|
#include <SALOME_ListIteratorOfListIO.hxx>
|
||||||
#include <SALOME_Prs.h>
|
#include <SALOME_Prs.h>
|
||||||
@ -154,6 +155,46 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
|||||||
Export();
|
Export();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 2171: // POPUP VIEWER - SELECT ONLY - VERTEX
|
||||||
|
{
|
||||||
|
OnSelectOnly( GEOM_POINT );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2172: // POPUP VIEWER - SELECT ONLY - EDGE
|
||||||
|
{
|
||||||
|
OnSelectOnly( GEOM_EDGE );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2173: // POPUP VIEWER - SELECT ONLY - WIRE
|
||||||
|
{
|
||||||
|
OnSelectOnly( GEOM_WIRE );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2174: // POPUP VIEWER - SELECT ONLY - FACE
|
||||||
|
{
|
||||||
|
OnSelectOnly( GEOM_FACE );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2175: // POPUP VIEWER - SELECT ONLY - SHELL
|
||||||
|
{
|
||||||
|
OnSelectOnly( GEOM_SHELL );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2176: // POPUP VIEWER - SELECT ONLY - SOLID
|
||||||
|
{
|
||||||
|
OnSelectOnly( GEOM_SOLID );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2177: // POPUP VIEWER - SELECT ONLY - COMPOUND
|
||||||
|
{
|
||||||
|
OnSelectOnly( GEOM_COMPOUND );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2178: // POPUP VIEWER - SELECT ONLY - SELECT ALL
|
||||||
|
{
|
||||||
|
OnSelectOnly( GEOM_ALLOBJECTS );
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 411: // SETTINGS - ADD IN STUDY
|
case 411: // SETTINGS - ADD IN STUDY
|
||||||
{
|
{
|
||||||
// SAN -- TO BE REMOVED !!!
|
// SAN -- TO BE REMOVED !!!
|
||||||
@ -702,6 +743,21 @@ bool GEOMToolsGUI::CheckSubObjectInUse(_PTR(SObject) checkobj,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : deactivate()
|
||||||
|
// purpose : Called when GEOM component is deactivated
|
||||||
|
//=================================================================================
|
||||||
|
void GEOMToolsGUI::deactivate()
|
||||||
|
{
|
||||||
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
|
if ( app ) {
|
||||||
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
|
GEOM_Displayer aDisp (appStudy);
|
||||||
|
aDisp.GlobalSelection();
|
||||||
|
getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
// EXPORTED METHODS
|
// EXPORTED METHODS
|
||||||
//=====================================================================================
|
//=====================================================================================
|
||||||
|
@ -58,6 +58,7 @@ public :
|
|||||||
~GEOMToolsGUI();
|
~GEOMToolsGUI();
|
||||||
|
|
||||||
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent );
|
||||||
|
virtual void deactivate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Import and export topology methods
|
// Import and export topology methods
|
||||||
@ -78,7 +79,8 @@ private:
|
|||||||
void OnTransparency();
|
void OnTransparency();
|
||||||
void OnNbIsos();
|
void OnNbIsos();
|
||||||
void OnOpen();
|
void OnOpen();
|
||||||
|
void OnSelectOnly(int mode);
|
||||||
|
|
||||||
// returns name of Module (Component) of given objects (usually selected objects)
|
// returns name of Module (Component) of given objects (usually selected objects)
|
||||||
// if objects belong to different Components, a NULL string is returned.
|
// if objects belong to different Components, a NULL string is returned.
|
||||||
QString getParentComponent( _PTR( Study ), const SALOME_ListIO& );
|
QString getParentComponent( _PTR( Study ), const SALOME_ListIO& );
|
||||||
|
@ -437,3 +437,14 @@ void GEOMToolsGUI::OnOpen()
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GEOMToolsGUI::OnSelectOnly(int mode)
|
||||||
|
{
|
||||||
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
|
if ( app ) {
|
||||||
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
|
GEOM_Displayer aDisp (appStudy);
|
||||||
|
aDisp.GlobalSelection(mode);
|
||||||
|
getGeometryGUI()->setLocalSelectionMode(mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user