-// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "PVViewer_ViewManager.h"
#include "PVViewer_ViewModel.h"
#endif // DISABLE_PVVIEWER
+#ifndef DISABLE_PV3DVIEWER
+#include "PV3DViewer_ViewManager.h"
+#include "PV3DViewer_ViewModel.h"
+#endif // DISABLE_PV3DVIEWER
#include "QtxActionMenuMgr.h"
#include "QtxWorkstack.h"
#include "QtxTreeView.h"
myResult = true;
}
#endif // DISABLE_PVVIEWER
+ }
+ else if ( type == "ParaView3D") {
+#ifndef DISABLE_PV3DVIEWER
+ // specific processing for ParaView3D viewer:
+ // hierarchy of ParaView3D viewer is much more complex than for usual view;
+ // we look for sub-widget named "Viewport"
+ QList<QWidget*> lst = wnd->findChildren<QWidget*>( "Viewport" );
+ if ( !lst.isEmpty() ) {
+ lst[0]->resize( myWndWidth, myWndHeight );
+ myResult = true;
+ }
+#endif // DISABLE_PV3DVIEWER
}
else {
if ( wnd->centralWidget() ) {
};
ProcessVoidEvent( new TEvent() );
}
+
+/*!
+ \brief Log GUI event.
+ \param eventDescription GUI event description.
+*/
+void SalomePyQt::logUserEvent( const QString& eventDescription )
+{
+ class TEvent: public SALOME_Event
+ {
+ QString myEventDescription;
+ public:
+ TEvent( const QString& theDescription ) : myEventDescription( theDescription ) {}
+ virtual void Execute()
+ {
+ LightApp_Application::logUserEvent( myEventDescription );
+ }
+ };
+ ProcessVoidEvent( new TEvent( eventDescription ) );
+}
+
+/*!
+ \brief Log given action.
+ \param action GUI action being logged.
+ \param moduleName optional name of module, owning an action
+*/
+void SalomePyQt::logAction( QAction* action, const QString& moduleName )
+{
+ class TEvent: public SALOME_Event
+ {
+ QAction* myAction;
+ QString myModuleName;
+ public:
+ TEvent( QAction* theAction, const QString& theModuleName ) : myAction( theAction ), myModuleName( theModuleName ) {}
+ virtual void Execute()
+ {
+ LightApp_Application::logAction( myAction, myModuleName );
+ }
+ };
+ ProcessVoidEvent( new TEvent( action, moduleName ) );
+}
+
+/*!
+ \brief Enable/disable action logging.
+*/
+void SalomePyQt::setActionLoggingEnabled( bool enabled )
+{
+ class TEvent: public SALOME_Event
+ {
+ bool myEnabled;
+ public:
+ TEvent( bool theEnabled ) : myEnabled( theEnabled ) {}
+ virtual void Execute()
+ {
+ LightApp_Module* module = getActiveModule();
+ if ( module )
+ module->setActionLoggingEnabled( myEnabled );
+ }
+ };
+ ProcessVoidEvent( new TEvent( enabled ) );
+}