mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-03-16 02:31:27 +05:00
Use some classes of library LightApp instead of classes in library SalomeApp
(DataOwner, DataSubOwner, Selection, SelectionMgr, VTKSelector, OCCSelector, Preferences)
This commit is contained in:
parent
0c20b44be3
commit
454214b7ff
@ -1,6 +1,6 @@
|
|||||||
#include "GEOMGUI_OCCSelector.h"
|
#include "GEOMGUI_OCCSelector.h"
|
||||||
|
|
||||||
#include <SalomeApp_DataSubOwner.h>
|
#include <LightApp_DataSubOwner.h>
|
||||||
|
|
||||||
#include <OCCViewer_ViewModel.h>
|
#include <OCCViewer_ViewModel.h>
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
// Purpose :
|
// Purpose :
|
||||||
//================================================================
|
//================================================================
|
||||||
GEOMGUI_OCCSelector::GEOMGUI_OCCSelector( OCCViewer_Viewer* viewer, SUIT_SelectionMgr* mgr )
|
GEOMGUI_OCCSelector::GEOMGUI_OCCSelector( OCCViewer_Viewer* viewer, SUIT_SelectionMgr* mgr )
|
||||||
: SalomeApp_OCCSelector( viewer, mgr )
|
: LightApp_OCCSelector( viewer, mgr )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,11 +79,11 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
|
|||||||
|
|
||||||
if ( !entryStr.isEmpty() )
|
if ( !entryStr.isEmpty() )
|
||||||
{
|
{
|
||||||
SalomeApp_DataOwner* owner;
|
LightApp_DataOwner* owner;
|
||||||
if ( index > -1 ) // Local Selection
|
if ( index > -1 ) // Local Selection
|
||||||
owner = new SalomeApp_DataSubOwner( entryStr, index );
|
owner = new LightApp_DataSubOwner( entryStr, index );
|
||||||
else // Global Selection
|
else // Global Selection
|
||||||
owner = new SalomeApp_DataOwner( entryStr );
|
owner = new LightApp_DataOwner( entryStr );
|
||||||
|
|
||||||
aList.append( SUIT_DataOwnerPtr( owner ) );
|
aList.append( SUIT_DataOwnerPtr( owner ) );
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
|
|||||||
|
|
||||||
if ( !entryStr.isEmpty() )
|
if ( !entryStr.isEmpty() )
|
||||||
{
|
{
|
||||||
SalomeApp_DataOwner* owner = new SalomeApp_DataOwner( entryStr );
|
LightApp_DataOwner* owner = new LightApp_DataOwner( entryStr );
|
||||||
aList.append( SUIT_DataOwnerPtr( owner ) );
|
aList.append( SUIT_DataOwnerPtr( owner ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
|
|||||||
// "entry - to - list_of_ids" map
|
// "entry - to - list_of_ids" map
|
||||||
for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
|
for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
|
||||||
{
|
{
|
||||||
const SalomeApp_DataSubOwner* subOwner = dynamic_cast<const SalomeApp_DataSubOwner*>( (*itr).operator->() );
|
const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
|
||||||
if ( subOwner )
|
if ( subOwner )
|
||||||
{
|
{
|
||||||
QString entry = subOwner->entry();
|
QString entry = subOwner->entry();
|
||||||
@ -191,7 +191,7 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
|
|||||||
}
|
}
|
||||||
else // the owner is NOT a sub owner, maybe it is a DataOwner == GLOBAL selection
|
else // the owner is NOT a sub owner, maybe it is a DataOwner == GLOBAL selection
|
||||||
{
|
{
|
||||||
const SalomeApp_DataOwner* owner = dynamic_cast<const SalomeApp_DataOwner*>( (*itr).operator->() );
|
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
|
||||||
if ( owner )
|
if ( owner )
|
||||||
{
|
{
|
||||||
globalSelMap[owner->entry()] = 1;
|
globalSelMap[owner->entry()] = 1;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef GEOMGUI_OCCSELECTOR_H
|
#ifndef GEOMGUI_OCCSELECTOR_H
|
||||||
#define GEOMGUI_OCCSELECTOR_H
|
#define GEOMGUI_OCCSELECTOR_H
|
||||||
|
|
||||||
#include <SalomeApp_OCCSelector.h>
|
#include <LightApp_OCCSelector.h>
|
||||||
|
|
||||||
class GEOMGUI_OCCSelector : public SalomeApp_OCCSelector
|
class GEOMGUI_OCCSelector : public LightApp_OCCSelector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GEOMGUI_OCCSelector( OCCViewer_Viewer*, SUIT_SelectionMgr* );
|
GEOMGUI_OCCSelector( OCCViewer_Viewer*, SUIT_SelectionMgr* );
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "GeometryGUI.h"
|
#include "GeometryGUI.h"
|
||||||
#include "GEOM_Displayer.h"
|
#include "GEOM_Displayer.h"
|
||||||
|
|
||||||
#include <SalomeApp_DataOwner.h>
|
#include <LightApp_DataOwner.h>
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
|
|
||||||
#include <OCCViewer_ViewModel.h>
|
#include <OCCViewer_ViewModel.h>
|
||||||
@ -48,7 +48,7 @@ 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() );
|
||||||
|
|
||||||
return SalomeApp_Selection::globalParam( p );
|
return LightApp_Selection::globalParam( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
QtxValue GEOMGUI_Selection::param( const int ind, const QString& p ) const
|
QtxValue GEOMGUI_Selection::param( const int ind, const QString& p ) const
|
||||||
@ -57,7 +57,7 @@ QtxValue GEOMGUI_Selection::param( const int ind, const QString& p ) const
|
|||||||
else if ( p == "type" ) return QtxValue( typeName( ind ) );
|
else if ( p == "type" ) return QtxValue( typeName( ind ) );
|
||||||
else if ( p == "displaymode" ) return QtxValue( displayMode( ind ) );
|
else if ( p == "displaymode" ) return QtxValue( displayMode( ind ) );
|
||||||
|
|
||||||
return SalomeApp_Selection::param( ind, p );
|
return LightApp_Selection::param( ind, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GEOMGUI_Selection::typeName( const int index ) const
|
QString GEOMGUI_Selection::typeName( const int index ) const
|
||||||
|
@ -29,12 +29,12 @@
|
|||||||
#ifndef GEOMGUI_SELECTION_HeaderFile
|
#ifndef GEOMGUI_SELECTION_HeaderFile
|
||||||
#define GEOMGUI_SELECTION_HeaderFile
|
#define GEOMGUI_SELECTION_HeaderFile
|
||||||
|
|
||||||
#include <SalomeApp_Selection.h>
|
#include <LightApp_Selection.h>
|
||||||
|
|
||||||
#include <SALOMEconfig.h>
|
#include <SALOMEconfig.h>
|
||||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||||
|
|
||||||
class GEOMGUI_Selection : public SalomeApp_Selection
|
class GEOMGUI_Selection : public LightApp_Selection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GEOMGUI_Selection();
|
GEOMGUI_Selection();
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
#include <SalomeApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
#include <SalomeApp_TypeFilter.h>
|
#include <SalomeApp_TypeFilter.h>
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
|
|
||||||
@ -879,7 +879,7 @@ void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& the
|
|||||||
if ( !app )
|
if ( !app )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SalomeApp_SelectionMgr* sm = app->selectionMgr();
|
LightApp_SelectionMgr* sm = app->selectionMgr();
|
||||||
|
|
||||||
// remove all filters from selection
|
// remove all filters from selection
|
||||||
sm->clearFilters();
|
sm->clearFilters();
|
||||||
@ -930,7 +930,7 @@ void GEOM_Displayer::GlobalSelection( const TColStd_MapOfInteger& theModes,
|
|||||||
vf->GlobalSelection( update );
|
vf->GlobalSelection( update );
|
||||||
|
|
||||||
// Set selection filters in accordance with current mode
|
// Set selection filters in accordance with current mode
|
||||||
SalomeApp_SelectionMgr* sm = app->selectionMgr();
|
LightApp_SelectionMgr* sm = app->selectionMgr();
|
||||||
if ( !sm )
|
if ( !sm )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1103,7 +1103,7 @@ bool GEOM_Displayer::ToActivate() const
|
|||||||
* Removes from selection temporary objects
|
* Removes from selection temporary objects
|
||||||
*/
|
*/
|
||||||
//=================================================================
|
//=================================================================
|
||||||
void GEOM_Displayer::clearTemporary( SalomeApp_SelectionMgr* theSelMgr )
|
void GEOM_Displayer::clearTemporary( LightApp_SelectionMgr* theSelMgr )
|
||||||
{
|
{
|
||||||
SALOME_ListIO selected, toSelect;
|
SALOME_ListIO selected, toSelect;
|
||||||
theSelMgr->selectedObjects( selected );
|
theSelMgr->selectedObjects( selected );
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
typedef std::list<GEOM::GEOM_Object_ptr> ObjectList;
|
typedef std::list<GEOM::GEOM_Object_ptr> ObjectList;
|
||||||
|
|
||||||
class TColStd_MapOfInteger;
|
class TColStd_MapOfInteger;
|
||||||
class SalomeApp_SelectionMgr;
|
class LightApp_SelectionMgr;
|
||||||
class SalomeApp_Study;
|
class SalomeApp_Study;
|
||||||
class SUIT_SelectionFilter;
|
class SUIT_SelectionFilter;
|
||||||
//class SALOME_Selection;
|
//class SALOME_Selection;
|
||||||
@ -171,7 +171,7 @@ protected:
|
|||||||
/* Resets internal data */
|
/* Resets internal data */
|
||||||
void internalReset();
|
void internalReset();
|
||||||
|
|
||||||
void clearTemporary( SalomeApp_SelectionMgr* theSelMgr );
|
void clearTemporary( LightApp_SelectionMgr* theSelMgr );
|
||||||
|
|
||||||
SUIT_SelectionFilter* getFilter( const int theMode );
|
SUIT_SelectionFilter* getFilter( const int theMode );
|
||||||
|
|
||||||
|
@ -47,10 +47,10 @@
|
|||||||
#include <VTKViewer_ViewManager.h>
|
#include <VTKViewer_ViewManager.h>
|
||||||
|
|
||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
#include <SalomeApp_SelectionMgr.h>
|
#include <LightApp_SelectionMgr.h>
|
||||||
#include <SalomeApp_VTKSelector.h>
|
#include <LightApp_VTKSelector.h>
|
||||||
#include <SalomeApp_Study.h>
|
#include <SalomeApp_Study.h>
|
||||||
#include <SalomeApp_Preferences.h>
|
#include <LightApp_Preferences.h>
|
||||||
#include <SALOME_LifeCycleCORBA.hxx>
|
#include <SALOME_LifeCycleCORBA.hxx>
|
||||||
#include <SALOME_ListIO.hxx>
|
#include <SALOME_ListIO.hxx>
|
||||||
|
|
||||||
@ -1102,7 +1102,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
|
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
|
||||||
it.data()->activate( application()->desktop() );
|
it.data()->activate( application()->desktop() );
|
||||||
|
|
||||||
SalomeApp_SelectionMgr* sm = getApp()->selectionMgr();
|
LightApp_SelectionMgr* sm = (LightApp_SelectionMgr*)getApp()->selectionMgr();
|
||||||
SUIT_ViewManager* vm;
|
SUIT_ViewManager* vm;
|
||||||
ViewManagerList OCCViewManagers, VTKViewManagers;
|
ViewManagerList OCCViewManagers, VTKViewManagers;
|
||||||
application()->viewManagers( OCCViewer_Viewer::Type(), OCCViewManagers );
|
application()->viewManagers( OCCViewer_Viewer::Type(), OCCViewManagers );
|
||||||
@ -1110,7 +1110,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
|
myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
|
||||||
application()->viewManagers( VTKViewer_Viewer::Type(), VTKViewManagers );
|
application()->viewManagers( VTKViewer_Viewer::Type(), VTKViewManagers );
|
||||||
for ( vm = VTKViewManagers.first(); vm; vm = VTKViewManagers.next() )
|
for ( vm = VTKViewManagers.first(); vm; vm = VTKViewManagers.next() )
|
||||||
myVTKSelectors.append( new SalomeApp_VTKSelector( (SVTK_Viewer*)vm->getViewModel(), sm ) );
|
myVTKSelectors.append( new LightApp_VTKSelector( (SVTK_Viewer*)vm->getViewModel(), sm ) );
|
||||||
|
|
||||||
// disable OCC selectors
|
// disable OCC selectors
|
||||||
getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
|
getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
|
||||||
@ -1119,7 +1119,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
|
|||||||
|
|
||||||
// disable VTK selectors
|
// disable VTK selectors
|
||||||
getApp()->selectionMgr()->setEnabled( false, VTKViewer_Viewer::Type() );
|
getApp()->selectionMgr()->setEnabled( false, VTKViewer_Viewer::Type() );
|
||||||
for ( SalomeApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
|
for ( LightApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
|
||||||
sr->setEnabled(true);
|
sr->setEnabled(true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1509,7 +1509,7 @@ void GeometryGUI::onViewManagerAdded( SUIT_ViewManager* vm )
|
|||||||
{
|
{
|
||||||
if ( vm->getType() == OCCViewer_Viewer::Type() )
|
if ( vm->getType() == OCCViewer_Viewer::Type() )
|
||||||
{
|
{
|
||||||
SalomeApp_SelectionMgr* sm = getApp()->selectionMgr();
|
LightApp_SelectionMgr* sm = (LightApp_SelectionMgr*)getApp()->selectionMgr();
|
||||||
myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
|
myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
|
||||||
|
|
||||||
// disable OCC selectors
|
// disable OCC selectors
|
||||||
@ -1519,12 +1519,12 @@ void GeometryGUI::onViewManagerAdded( SUIT_ViewManager* vm )
|
|||||||
}
|
}
|
||||||
else if ( vm->getType() == VTKViewer_Viewer::Type() )
|
else if ( vm->getType() == VTKViewer_Viewer::Type() )
|
||||||
{
|
{
|
||||||
SalomeApp_SelectionMgr* sm = getApp()->selectionMgr();
|
LightApp_SelectionMgr* sm = (LightApp_SelectionMgr*)getApp()->selectionMgr();
|
||||||
myVTKSelectors.append( new SalomeApp_VTKSelector( (SVTK_Viewer*)vm->getViewModel(), sm ) );
|
myVTKSelectors.append( new LightApp_VTKSelector( (SVTK_Viewer*)vm->getViewModel(), sm ) );
|
||||||
|
|
||||||
// disable VTK selectors
|
// disable VTK selectors
|
||||||
getApp()->selectionMgr()->setEnabled( false, VTKViewer_Viewer::Type() );
|
getApp()->selectionMgr()->setEnabled( false, VTKViewer_Viewer::Type() );
|
||||||
for ( SalomeApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
|
for ( LightApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
|
||||||
sr->setEnabled(true);
|
sr->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1543,7 +1543,7 @@ void GeometryGUI::onViewManagerRemoved( SUIT_ViewManager* vm )
|
|||||||
}
|
}
|
||||||
if ( vm->getType() == VTKViewer_Viewer::Type() )
|
if ( vm->getType() == VTKViewer_Viewer::Type() )
|
||||||
{
|
{
|
||||||
for ( SalomeApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
|
for ( LightApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
|
||||||
if ( sr->viewer() == viewer )
|
if ( sr->viewer() == viewer )
|
||||||
{
|
{
|
||||||
myVTKSelectors.remove( sr );
|
myVTKSelectors.remove( sr );
|
||||||
@ -1559,7 +1559,7 @@ QString GeometryGUI::engineIOR() const
|
|||||||
return QString( "" );
|
return QString( "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
SalomeApp_Selection* GeometryGUI::createSelection() const
|
LightApp_Selection* GeometryGUI::createSelection() const
|
||||||
{
|
{
|
||||||
return new GEOMGUI_Selection();
|
return new GEOMGUI_Selection();
|
||||||
}
|
}
|
||||||
@ -1585,11 +1585,11 @@ void GeometryGUI::createPreferences()
|
|||||||
|
|
||||||
int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
|
int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
|
||||||
addPreference( tr( "PREF_SHADING_COLOR" ), genGroup,
|
addPreference( tr( "PREF_SHADING_COLOR" ), genGroup,
|
||||||
SalomeApp_Preferences::Color, "Geometry", "shading_color" );
|
LightApp_Preferences::Color, "Geometry", "shading_color" );
|
||||||
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
|
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
|
||||||
SalomeApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
|
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
|
||||||
int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup,
|
int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup,
|
||||||
SalomeApp_Preferences::Selector, "Geometry", "display_mode" );
|
LightApp_Preferences::Selector, "Geometry", "display_mode" );
|
||||||
|
|
||||||
setPreferenceProperty( genGroup, "columns", 1 );
|
setPreferenceProperty( genGroup, "columns", 1 );
|
||||||
|
|
||||||
|
@ -70,7 +70,8 @@ typedef QMap<QString, GEOMGUI*> GUIMap;
|
|||||||
class QDialog;
|
class QDialog;
|
||||||
class QPopupMenu;
|
class QPopupMenu;
|
||||||
class GEOMGUI_OCCSelector;
|
class GEOMGUI_OCCSelector;
|
||||||
class SalomeApp_VTKSelector;
|
class LightApp_VTKSelector;
|
||||||
|
class LightApp_Selection;
|
||||||
class SUIT_ViewManager;
|
class SUIT_ViewManager;
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -156,7 +157,7 @@ signals :
|
|||||||
void SignalDefaultStepValueChanged( double newVal );
|
void SignalDefaultStepValueChanged( double newVal );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SalomeApp_Selection* createSelection() const;
|
virtual LightApp_Selection* createSelection() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GEOMGUI* getLibrary( const QString& libraryName );
|
GEOMGUI* getLibrary( const QString& libraryName );
|
||||||
@ -180,7 +181,7 @@ private:
|
|||||||
QMap<int,QString> myRules; // popup rules
|
QMap<int,QString> myRules; // popup rules
|
||||||
|
|
||||||
QPtrList<GEOMGUI_OCCSelector> myOCCSelectors;
|
QPtrList<GEOMGUI_OCCSelector> myOCCSelectors;
|
||||||
QPtrList<SalomeApp_VTKSelector> myVTKSelectors;
|
QPtrList<LightApp_VTKSelector> myVTKSelectors;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user