{
myGeomGUI = 0;
SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- {
- SalomeApp_Module* module = dynamic_cast<SalomeApp_Module*>(app->loadModule("Geometry"));
- if (module)
- myGeomGUI = dynamic_cast<GeometryGUI*>(module);
- }
+ if( app )
+ myGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
/* init variables */
myGeomBase = new GEOMBase(); // SAN -- TO BE REMOVED !!!
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
if (myGeomGUI)
- {
- connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
- }
+ {
+ connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ }
/* Move widget on the botton right corner of main widget */
// int x, y;
// function : GeometryGUI::OnKeyPress()
// purpose : Called when any key is pressed by user [static]
//=================================================================================
-bool GeometryGUI::OnKeyPress( QKeyEvent* pe, SUIT_ViewWindow* win )
+void GeometryGUI::OnKeyPress( SUIT_ViewWindow* win, QKeyEvent* pe )
{
GUIMap::Iterator it;
bool bOk = true;
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
bOk = bOk && it.data()->OnKeyPress( pe, application()->desktop(), win );
- return bOk;
+// return bOk;
}
// function : GeometryGUI::OnMouseMove()
// purpose : Manages mouse move events [static]
//=================================================================================
-bool GeometryGUI::OnMouseMove( QMouseEvent* pe, SUIT_ViewWindow* win )
+void GeometryGUI::OnMouseMove( SUIT_ViewWindow* win, QMouseEvent* pe )
{
GUIMap::Iterator it;
bool bOk = true;
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
bOk = bOk && it.data()->OnMouseMove( pe, application()->desktop(), win );
- return bOk;
+// return bOk;
}
// function : GeometryGUI::0nMousePress()
// purpose : Manage mouse press events [static]
//=================================================================================
-bool GeometryGUI::OnMousePress( QMouseEvent* pe, SUIT_ViewWindow* win )
+void GeometryGUI::OnMousePress( SUIT_ViewWindow* win, QMouseEvent* pe )
{
GUIMap::Iterator it;
// OnMousePress() should return false if this event should be processed further
bool processed = false;
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
processed = processed || it.data()->OnMousePress( pe, application()->desktop(), win );
- return processed;
+// return processed;
}
/*
connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
- connect( (STD_Application*)application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
- this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );
- connect( (STD_Application*)application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
- this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
GUIMap::Iterator it;
for ( it = myGUIMap.begin(); it != myGUIMap.end(); ++it )
disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
- disconnect( (STD_Application*)application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
- this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );
- disconnect( (STD_Application*)application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
- this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
EmitSignalCloseAllDialogs();
{
if ( vm->getType() == OCCViewer_Viewer::Type() )
{
+ qDebug( "connect" );
+ connect( vm, SIGNAL( keyPress ( SUIT_ViewWindow*, QKeyEvent* ) ),
+ this, SLOT( OnKeyPress( SUIT_ViewWindow*, QKeyEvent* ) ) );
+ connect( vm, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
+ this, SLOT( OnMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+ connect( vm, SIGNAL( mouseMove ( SUIT_ViewWindow*, QMouseEvent* ) ),
+ this, SLOT( OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
+
+
LightApp_SelectionMgr* sm = getApp()->selectionMgr();
myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
void OnGUIEvent( int id );
- virtual bool OnKeyPress( QKeyEvent*, SUIT_ViewWindow* );
- virtual bool OnMousePress( QMouseEvent*, SUIT_ViewWindow* );
- virtual bool OnMouseMove( QMouseEvent*, SUIT_ViewWindow* );
-
// virtual bool SetSettings();
// virtual void SupportedViewType ( int* buffer, int bufferSize );
virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&, SUIT_ViewWindow* = 0 );
public slots:
virtual bool deactivateModule( SUIT_Study* );
virtual bool activateModule( SUIT_Study* );
+ virtual void OnKeyPress ( SUIT_ViewWindow*, QKeyEvent* );
+ virtual void OnMousePress( SUIT_ViewWindow*, QMouseEvent* );
+ virtual void OnMouseMove ( SUIT_ViewWindow*, QMouseEvent* );
+
+protected slots:
+ virtual void onViewManagerAdded( SUIT_ViewManager* );
+ virtual void onViewManagerRemoved( SUIT_ViewManager* );
private slots:
void OnGUIEvent();
- void onViewManagerAdded( SUIT_ViewManager* );
- void onViewManagerRemoved( SUIT_ViewManager* );
void onWindowActivated( SUIT_ViewWindow* );
signals :