From: Anthony Geay Date: Mon, 17 Apr 2023 06:47:42 +0000 (+0200) Subject: Revert "added debug messages only" X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fagy%2Fpv3d;p=modules%2Fgui.git Revert "added debug messages only" This reverts commit 874521cff78bb836cf3b95b923df944e1d32bf73. --- diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index 8b8b7392f..51e76fcfa 100644 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -46,12 +46,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "CAM_Application" -#include "MBDebug.h" -//--------------------------------------------------------- - namespace { class BusyLocker @@ -107,8 +101,6 @@ CAM_Application::CAM_Application( const bool autoLoad ) myAutoLoad( autoLoad ), myBlocked( false ) { - DBG_FUN(); - ARG(autoLoad); readModuleList(); } @@ -119,7 +111,6 @@ CAM_Application::CAM_Application( const bool autoLoad ) */ CAM_Application::~CAM_Application() { - DBG_FUN(); for ( QList::const_iterator it = myModules.begin(); it != myModules.end(); ++it ) delete *it; myModules.clear(); @@ -134,7 +125,6 @@ CAM_Application::~CAM_Application() */ void CAM_Application::start() { - DBG_FUN(); // check modules for ( ModuleInfoList::iterator it = myInfoList.begin(); it != myInfoList.end(); ++it ) @@ -165,8 +155,6 @@ CAM_Module* CAM_Application::activeModule() const */ CAM_Module* CAM_Application::module( const QString& modName ) const { - DBG_FUN(); - ARG(modName); CAM_Module* mod = 0; for ( QList::const_iterator it = myModules.begin(); it != myModules.end() && !mod; ++it ) @@ -190,7 +178,6 @@ CAM_Application::ModuleList CAM_Application::modules() const */ void CAM_Application::modules( CAM_Application::ModuleList& out ) const { - DBG_FUN(); out.clear(); for ( QList::const_iterator it = myModules.begin(); @@ -209,8 +196,6 @@ void CAM_Application::modules( CAM_Application::ModuleList& out ) const */ void CAM_Application::modules( QStringList& lst, const bool loaded ) const { - DBG_FUN(); - ARG(loaded); lst.clear(); if ( loaded ) @@ -239,7 +224,6 @@ void CAM_Application::modules( QStringList& lst, const bool loaded ) const */ void CAM_Application::addModule( CAM_Module* mod ) { - DBG_FUN(); if ( !mod || myModules.contains( mod ) ) return; @@ -283,7 +267,6 @@ void CAM_Application::addModule( CAM_Module* mod ) */ void CAM_Application::loadModules() { - DBG_FUN(); for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end(); ++it ) { CAM_Module* mod = loadModule( (*it).title ); @@ -312,9 +295,6 @@ void CAM_Application::loadModules() */ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool showMsg ) { - DBG_FUN(); - ARG(modName); - ARG(showMsg); if ( myInfoList.isEmpty() ) { qWarning( qPrintable( tr( "Modules configuration is not defined." ) ) ); @@ -428,8 +408,6 @@ CAM_Module* CAM_Application::loadModule( const QString& modName, const bool show */ bool CAM_Application::activateModule( const QString& modName ) { - DBG_FUN(); - ARG(modName); if ( (!modName.isEmpty() && !activeStudy()) || myBlocked ) return false; @@ -470,7 +448,6 @@ bool CAM_Application::activateModule( const QString& modName ) */ bool CAM_Application::activateModule( CAM_Module* mod ) { - DBG_FUN(); if ( mod && !activeStudy() ) return false; @@ -519,9 +496,6 @@ bool CAM_Application::activateModule( CAM_Module* mod ) */ bool CAM_Application::activateOperation( const QString& modName, int actionId ) { - DBG_FUN(); - ARG(modName); - ARG(actionId); CAM_Module* mod = loadModule(modName, false); if (mod) { addModule(mod); @@ -539,9 +513,6 @@ bool CAM_Application::activateOperation( const QString& modName, int actionId ) */ bool CAM_Application::activateOperation( const QString& modName, const QString& actionId ) { - DBG_FUN(); - ARG(modName); - ARG(actionId); CAM_Module* mod = loadModule(modName, false); if (mod) { addModule(mod); @@ -563,10 +534,6 @@ bool CAM_Application::activateOperation( const QString& modName, const QString& actionId, const QString& pluginName ) { - DBG_FUN(); - ARG(modName); - ARG(actionId); - ARG(pluginName); CAM_Module* mod = loadModule(modName, false); if (mod) { addModule(mod); @@ -581,7 +548,6 @@ bool CAM_Application::activateOperation( const QString& modName, */ SUIT_Study* CAM_Application::createNewStudy() { - DBG_FUN(); return new CAM_Study( this ); } @@ -590,7 +556,6 @@ SUIT_Study* CAM_Application::createNewStudy() */ void CAM_Application::updateCommandsStatus() { - DBG_FUN(); STD_Application::updateCommandsStatus(); if ( activeModule() ) @@ -606,14 +571,12 @@ void CAM_Application::updateCommandsStatus() */ void CAM_Application::beforeCloseDoc( SUIT_Study* theDoc ) { - DBG_FUN(); for ( QList::iterator it = myModules.begin(); it != myModules.end(); ++it ) (*it)->studyClosed( theDoc ); } void CAM_Application::afterCloseDoc() { - DBG_FUN(); } /*! @@ -622,7 +585,6 @@ void CAM_Application::afterCloseDoc() */ void CAM_Application::setActiveStudy( SUIT_Study* study ) { - DBG_FUN(); STD_Application::setActiveStudy( study ); } @@ -636,7 +598,6 @@ void CAM_Application::setActiveStudy( SUIT_Study* study ) */ bool CAM_Application::checkModule( const QString& ) { - DBG_FUN(); return true; } @@ -650,7 +611,6 @@ bool CAM_Application::checkModule( const QString& ) */ void CAM_Application::moduleAdded( CAM_Module* /*mod*/ ) { - DBG_FUN(); } /*! @@ -663,7 +623,6 @@ void CAM_Application::moduleAdded( CAM_Module* /*mod*/ ) */ void CAM_Application::moduleDeactivated( CAM_Module* /*mod*/ ) { - DBG_FUN(); } /*! @@ -673,15 +632,12 @@ void CAM_Application::moduleDeactivated( CAM_Module* /*mod*/ ) */ QString CAM_Application::moduleName( const QString& title ) { - DBG_FUNC(); - ARG(title); QString res; for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end() && res.isEmpty(); ++it ) { if ( (*it).title == title ) res = (*it).name; } - RET(res); return res; } @@ -692,15 +648,12 @@ QString CAM_Application::moduleName( const QString& title ) */ QString CAM_Application::moduleTitle( const QString& name ) { - DBG_FUNC(); - ARG(name); QString res; for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end() && res.isEmpty(); ++it ) { if ( (*it).name == name ) res = (*it).title; } - RET(res); return res; } @@ -727,15 +680,12 @@ QString CAM_Application::moduleIcon( const QString& name ) */ QString CAM_Application::moduleDescription( const QString& name ) { - DBG_FUNC(); - ARG(name); QString res; for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end() && res.isNull(); ++it ) { if ( (*it).name == name || (*it).title == name ) res = tr((*it).description.toUtf8()); } - RET(res); return res; } @@ -747,8 +697,6 @@ QString CAM_Application::moduleDescription( const QString& name ) */ QString CAM_Application::moduleLibrary( const QString& name, const bool full ) { - DBG_FUNC(); - ARG(name); QString res; for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end() && res.isEmpty(); ++it ) { @@ -757,7 +705,6 @@ QString CAM_Application::moduleLibrary( const QString& name, const bool full ) } if ( !res.isEmpty() && full ) res = SUIT_Tools::library( res ); - RET(res); return res; } @@ -768,8 +715,6 @@ QString CAM_Application::moduleLibrary( const QString& name, const bool full ) */ QString CAM_Application::moduleDisplayer( const QString& name ) { - DBG_FUNC(); - ARG(name); QString res; if ( !name.isEmpty() ) @@ -784,7 +729,6 @@ QString CAM_Application::moduleDisplayer( const QString& name ) } } - RET(res); return res; } @@ -810,7 +754,6 @@ QString CAM_Application::moduleDisplayer( const QString& name ) */ void CAM_Application::readModuleList() { - DBG_FUN(); if ( !myInfoList.isEmpty() ) return; @@ -820,7 +763,6 @@ void CAM_Application::readModuleList() QStringList modList; QString args = QApplication::arguments().join( " " ); - SHOW(args); QRegExp rx1("--modules=([\\w,]*)"); rx1.setMinimal( false ); @@ -857,7 +799,6 @@ void CAM_Application::readModuleList() if ( modList.isEmpty() ) { QString mods = resMgr->stringValue( "launch", "modules", QString() ); - SHOW(mods); modList = mods.split( ",", QString::SkipEmptyParts ); } @@ -881,8 +822,6 @@ void CAM_Application::readModuleList() bool CAM_Application::appendModuleInfo( const QString& modName ) { - DBG_FUN(); - ARG(modName); if ( modName.isEmpty() ) return false; // empty module name @@ -933,8 +872,6 @@ bool CAM_Application::appendModuleInfo( const QString& modName ) void CAM_Application::removeModuleInfo( const QString& modName ) { - DBG_FUN(); - ARG(modName); QMutableListIterator it( myInfoList ); while ( it.hasNext() ) { @@ -958,8 +895,6 @@ void CAM_Application::removeModuleInfo( const QString& modName ) */ void CAM_Application::contextMenuPopup( const QString& type, QMenu* menu, QString& title ) { - DBG_FUN(); - ARG(type); // to do : add common items for popup menu ( if they are exist ) if ( activeModule() ) activeModule()->contextMenuPopup( type, menu, title ); @@ -970,7 +905,6 @@ void CAM_Application::contextMenuPopup( const QString& type, QMenu* menu, QStrin */ void CAM_Application::createEmptyStudy() { - DBG_FUN(); /*SUIT_Study* study = */activeStudy(); STD_Application::createEmptyStudy(); } @@ -980,7 +914,6 @@ void CAM_Application::createEmptyStudy() */ CAM_Application::ModuleShortInfoList CAM_Application::getVersionInfo() { - DBG_FUNC(); ModuleShortInfoList info; ModuleShortInfo kernel; @@ -1011,11 +944,10 @@ CAM_Application::ModuleShortInfoList CAM_Application::getVersionInfo() */ bool CAM_Application::abortAllOperations() { - DBG_FUN(); bool aborted = true; for ( QList::const_iterator it = myModules.begin(); it != myModules.end() && aborted; ++it ) { aborted = (*it)->abortAllOperations(); } return aborted; -} +} \ No newline at end of file diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index 1fd103da9..161d69a84 100644 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -37,12 +37,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "CAM_Module" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! \class CAM_Module \brief Base implementation of the module in the CAM application architecture. @@ -83,7 +77,6 @@ CAM_Module::CAM_Module() myApp( 0 ), myDataModel( 0 ) { - DBG_FUN(); } /*! @@ -101,8 +94,6 @@ CAM_Module::CAM_Module( const QString& name ) myMenuShown( false ), myToolShown( false ) { - DBG_FUN(); - ARG(name); } /*! @@ -112,7 +103,6 @@ CAM_Module::CAM_Module( const QString& name ) */ CAM_Module::~CAM_Module() { - DBG_FUN(); delete myDataModel; myDataModel = 0; } @@ -130,7 +120,6 @@ CAM_Module::~CAM_Module() */ void CAM_Module::initialize( CAM_Application* app ) { - DBG_FUN(); myApp = app; if ( myApp ) { @@ -243,7 +232,6 @@ bool CAM_Module::isSelectionCompatible() */ bool CAM_Module::activateModule( SUIT_Study* /*study*/ ) { - DBG_FUN(); // IMN 05/03/2015: we copied myActionMap for reset/unset actions accelerator keys // after activate/deactivate modules for ( QMap::Iterator it = myActionShortcutMap.begin(); it != myActionShortcutMap.end(); ++it ) @@ -269,7 +257,6 @@ bool CAM_Module::activateModule( SUIT_Study* /*study*/ ) */ bool CAM_Module::deactivateModule( SUIT_Study* ) { - DBG_FUN(); // IMN 05/03/2015: we copied myActionMap for reset/unset actions accelerator keys // after activate/deactivate modules myActionShortcutMap.clear(); @@ -290,7 +277,6 @@ bool CAM_Module::deactivateModule( SUIT_Study* ) */ void CAM_Module::studyClosed( SUIT_Study* study ) { - DBG_FUN(); CAM_Study* camDoc = dynamic_cast( study ); if ( !camDoc ) return; @@ -312,7 +298,6 @@ void CAM_Module::studyClosed( SUIT_Study* study ) */ void CAM_Module::studyChanged( SUIT_Study* /*oldStudy*/, SUIT_Study* /*newStudy*/ ) { - DBG_FUN(); } /*! @@ -335,8 +320,6 @@ bool CAM_Module::isActiveModule() const */ void CAM_Module::putInfo( const QString& msg, const int msec ) { - DBG_FUN(); - ARG(msg); if ( application() ) application()->putInfo( msg, msec ); @@ -355,9 +338,6 @@ void CAM_Module::putInfo( const QString& msg, const int msec ) */ int CAM_Module::showNotification( const QString& message, const QString& title, int timeout ) { - DBG_FUN(); - ARG(message); - ARG(title); int res = -1; if ( application() ) res = application()->showNotification( message, title, timeout ); @@ -370,8 +350,6 @@ int CAM_Module::showNotification( const QString& message, const QString& title, */ void CAM_Module::hideNotification( const QString& message ) { - DBG_FUN(); - ARG(message); if ( application() ) application()->hideNotification( message ); } @@ -382,8 +360,6 @@ void CAM_Module::hideNotification( const QString& message ) */ void CAM_Module::hideNotification( int id ) { - DBG_FUN(); - ARG(id); if ( application() ) application()->hideNotification( id ); } @@ -398,8 +374,6 @@ void CAM_Module::hideNotification( int id ) */ void CAM_Module::onInfoChanged( QString txt ) { - DBG_FUN(); - ARG(txt); if ( txt.isEmpty() && isActiveModule() && !myInfo.isEmpty() && application() ) application()->putInfo( myInfo ); } @@ -413,7 +387,6 @@ void CAM_Module::onInfoChanged( QString txt ) */ void CAM_Module::onApplicationClosed( SUIT_Application* theApp ) { - DBG_FUN(); if (myApp == theApp) myApp = NULL; } @@ -424,7 +397,6 @@ void CAM_Module::onApplicationClosed( SUIT_Application* theApp ) */ CAM_DataModel* CAM_Module::createDataModel() { - DBG_FUN(); return new CAM_DataModel( this ); } @@ -435,8 +407,6 @@ CAM_DataModel* CAM_Module::createDataModel() */ void CAM_Module::setName( const QString& name ) { - DBG_FUN(); - ARG(name); setObjectName( name ); } @@ -447,8 +417,6 @@ void CAM_Module::setName( const QString& name ) */ void CAM_Module::setModuleName( const QString& name ) { - DBG_FUN(); - ARG(name); myName = name; } @@ -487,7 +455,6 @@ QtxActionToolMgr* CAM_Module::toolMgr() const */ int CAM_Module::createTool( const QString& title, const QString& name ) { - MSGEL("CAM_Module::createTool(title=\"" << title.toStdString() << "\", name=\"" << name.toStdString() << "\")"); if ( !toolMgr() ) return -1; @@ -517,7 +484,6 @@ int CAM_Module::createTool( const QString& title, const QString& name ) */ int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int idx ) { - MSGEL("CAM_Module::createTool(tBar=" << tBar << ", id=" << id << ", idx=" << idx <<")"); if ( !toolMgr() ) return -1; @@ -553,7 +519,6 @@ int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int */ int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx ) { - MSGEL("CAM_Module::createTool(tBar=\"" << tBar.toStdString() << "\", id=" << id << ", idx=" << idx <<")"); if ( !toolMgr() ) return -1; @@ -588,7 +553,6 @@ int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const */ int CAM_Module::createTool( const int id, const int tBar, const int idx ) { - MSGEL("CAM_Module::createTool(id=" << id << ", tBar=" << tBar << ", idx=" << idx <<")"); if ( !toolMgr() ) return -1; @@ -622,7 +586,6 @@ int CAM_Module::createTool( const int id, const int tBar, const int idx ) */ int CAM_Module::createTool( const int id, const QString& tBar, const int idx ) { - MSGEL("CAM_Module::createTool(id=" << id << ", tBar=\"" << tBar.toStdString() << "\", idx=" << idx <<")"); if ( !toolMgr() ) return -1; @@ -642,8 +605,6 @@ int CAM_Module::createTool( const int id, const QString& tBar, const int idx ) */ void CAM_Module::clearTool( const QString& title ) { - DBG_FUN(); - ARG(title); if ( toolMgr() ) toolMgr()->clear( title ); } @@ -676,7 +637,6 @@ void CAM_Module::clearTool( const QString& title ) int CAM_Module::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx, QMenu * menuObj ) { - MSGEL("CAM_Module::createMenu(subMenu=\"" << subMenu.toStdString() << "\", menu=" << menu << ", id=" << id << ")"); if ( !menuMgr() ) return -1; @@ -711,7 +671,6 @@ int CAM_Module::createMenu( const QString& subMenu, const int menu, int CAM_Module::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx ) { - MSGEL("CAM_Module::createMenu(subMenu=\"" << subMenu.toStdString() << "\", menu=\"" << menu.toStdString() << "\", id=" << id << ")"); if ( !menuMgr() ) return -1; @@ -742,7 +701,6 @@ int CAM_Module::createMenu( const QString& subMenu, const QString& menu, */ int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx ) { - MSGEL("CAM_Module::createMenu(menu=" << menu << ", id=" << id << ")"); if ( !a || !menuMgr() ) return -1; @@ -785,7 +743,6 @@ int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int */ int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx ) { - MSGEL("CAM_Module::createMenu(action, menu=\"" << menu.toStdString() << "\", id=" << id << ")"); if ( !a || !menuMgr() ) return -1; @@ -823,7 +780,6 @@ int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const */ int CAM_Module::createMenu( const int id, const int menu, const int group, const int idx ) { - MSGEL("CAM_Module::createMenu(id=" << id << ", menu=" << menu << ")"); if ( !menuMgr() ) return -1; @@ -864,7 +820,6 @@ int CAM_Module::createMenu( const int id, const int menu, const int group, const */ int CAM_Module::createMenu( const int id, const QString& menu, const int group, const int idx ) { - MSGEL("CAM_Module::createMenu(id=" << id << ", menu=\"" << menu.toStdString() << "\")"); if ( !menuMgr() ) return -1; @@ -885,7 +840,6 @@ int CAM_Module::createMenu( const int id, const QString& menu, const int group, */ void CAM_Module::setMenuShown( const bool on ) { - MSGEL("CAM_Module::setMenuShown(on=" << on << ")"); myMenuShown = on; QtxActionMenuMgr* mMgr = menuMgr(); @@ -925,7 +879,6 @@ void CAM_Module::setMenuShown( QAction* a, const bool on ) */ void CAM_Module::setMenuShown( const int id, const bool on ) { - MSGEL("CAM_Module::setMenuShown(id=" << id << ", on=" << on << ")"); setMenuShown( action( id ), on ); } @@ -936,7 +889,6 @@ void CAM_Module::setMenuShown( const int id, const bool on ) */ void CAM_Module::setToolShown( const bool on ) { - MSGEL("CAM_Module::setToolShown(on=" << on << ")"); myToolShown = on; QtxActionToolMgr* tMgr = toolMgr(); @@ -976,7 +928,6 @@ void CAM_Module::setToolShown( QAction* a, const bool on ) */ void CAM_Module::setToolShown( const int id, const bool on ) { - MSGEL("CAM_Module::setToolShown(id=" << id << ", on=" << on << ")"); setToolShown( action( id ), on ); } @@ -1064,7 +1015,6 @@ QAction* CAM_Module::createAction( const int id, const QString& text, const QIco QObject* parent, const bool toggle, QObject* reciever, const char* member, const QString& shortcutAction ) { - MSGEL("CAM_Module::createAction(id=" << id << ", text=\"" << text.toStdString() << "\")"); QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction ); a->setStatusTip( tip ); @@ -1084,8 +1034,6 @@ QAction* CAM_Module::createAction( const int id, const QString& text, const QIco */ QtxActionGroup* CAM_Module::createActionGroup( const int id, const bool exclusive ) { - DBG_FUN(); - ARG(id); QtxActionGroup* a = qobject_cast( action( id ) ); if ( !a ) { a = new QtxActionGroup( this ); @@ -1107,7 +1055,6 @@ QtxActionGroup* CAM_Module::createActionGroup( const int id, const bool exclusiv */ int CAM_Module::registerAction( const int id, QAction* a ) { - MSGEL("CAM_Module::registerAction(id=" << id << ")"); int ident = -1; for ( QMap::ConstIterator it = myActionMap.begin(); it != myActionMap.end() && ident == -1; ++it ) if ( it.value() == a ) @@ -1143,8 +1090,6 @@ int CAM_Module::registerAction( const int id, QAction* a ) */ bool CAM_Module::unregisterAction( const int id ) { - DBG_FUN(); - ARG(id); return unregisterAction( action( id ) ); } @@ -1156,7 +1101,6 @@ bool CAM_Module::unregisterAction( const int id ) */ bool CAM_Module::unregisterAction( QAction* a ) { - DBG_FUN(); if ( !a ) return false; if ( menuMgr() ) { @@ -1192,7 +1136,6 @@ QAction* CAM_Module::separator() \brief Update visibility state of the module objects. */ void CAM_Module::updateModuleVisibilityState() { - DBG_FUN(); } @@ -1203,7 +1146,6 @@ void CAM_Module::updateModuleVisibilityState() { */ bool CAM_Module::activateOperation( int /*actionId*/ ) { - DBG_FUN(); return false; } @@ -1214,7 +1156,6 @@ bool CAM_Module::activateOperation( int /*actionId*/ ) */ bool CAM_Module::activateOperation( const QString& /*actionId*/ ) { - DBG_FUN(); return false; } @@ -1226,7 +1167,6 @@ bool CAM_Module::activateOperation( const QString& /*actionId*/ ) */ bool CAM_Module::activateOperation( const QString& /*actionId*/, const QString& /*pluginName*/ ) { - DBG_FUN(); return false; } @@ -1237,7 +1177,6 @@ bool CAM_Module::activateOperation( const QString& /*actionId*/, const QString& */ void CAM_Module::connectToStudy( CAM_Study* camStudy ) { - DBG_FUN(); CAM_Application* app = camStudy ? dynamic_cast( camStudy->application() ) : 0; if( !app ) return; @@ -1274,6 +1213,5 @@ void CAM_Module::connectToStudy( CAM_Study* camStudy ) bool CAM_Module::abortAllOperations() { - DBG_FUN(); return true; } diff --git a/src/CAM/MBDebug.h b/src/CAM/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/CAM/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 8c64a4dfd..4758aa40e 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -210,13 +210,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_Application" -#include "MBDebug.h" -#include "MBSUIT.h" -//--------------------------------------------------------- - #define FIRST_HELP_ID 1000000 #define HAS_WWW_URL true #define HAS_FORUM_URL true @@ -356,7 +349,6 @@ namespace /*!Create new instance of LightApp_Application.*/ extern "C" LIGHTAPP_EXPORT SUIT_Application* createApplication() { - DBG_FUNC(); return new LightApp_Application(); } @@ -375,7 +367,6 @@ LightApp_Application::LightApp_Application() myPrefs( 0 ), myScreenHelper(new LightApp_FullScreenHelper()) { - DBG_FUN(); Q_INIT_RESOURCE( LightApp ); STD_TabDesktop* desk = new STD_TabDesktop(); @@ -488,7 +479,6 @@ LightApp_Application::LightApp_Application() */ LightApp_Application::~LightApp_Application() { - DBG_FUN(); savePreferences(); delete mySelMgr; delete myScreenHelper; @@ -498,7 +488,6 @@ LightApp_Application::~LightApp_Application() /*!Start application.*/ void LightApp_Application::start() { - DBG_FUN(); CAM_Application::start(); updateWindows(); @@ -516,7 +505,6 @@ void LightApp_Application::start() /*!Closeapplication.*/ void LightApp_Application::closeApplication() { - DBG_FUN(); #ifndef DISABLE_QTXWEBBROWSER QProcess::startDetached( "HelpBrowser", QStringList() << QString( "--remove=%1" ).arg( QApplication::instance()->applicationPid() ) ); @@ -528,10 +516,8 @@ void LightApp_Application::closeApplication() QString LightApp_Application::applicationName() const { static QString _app_name; - if ( _app_name.isEmpty() ) { + if ( _app_name.isEmpty() ) _app_name = tr( "APP_NAME" ); - SHOW(_app_name); - } return _app_name; } @@ -551,7 +537,6 @@ QString LightApp_Application::applicationVersion() const { _app_version = GUI_VERSION_STR; } - SHOW(_app_version); } return _app_version; } @@ -559,8 +544,6 @@ QString LightApp_Application::applicationVersion() const /*!Load module by \a name.*/ CAM_Module* LightApp_Application::loadModule( const QString& name, const bool showMsg ) { - DBG_FUN(); - SHOW(name); CAM_Module* mod = CAM_Application::loadModule( name, showMsg ); if ( mod ) { @@ -574,8 +557,6 @@ CAM_Module* LightApp_Application::loadModule( const QString& name, const bool sh /*!Activate module by \a modName*/ bool LightApp_Application::activateModule( const QString& modName ) { - DBG_FUN(); - ARG(modName); QString actName; CAM_Module* prevMod = activeModule(); @@ -651,7 +632,6 @@ void LightApp_Application::createActionForViewer( const int id, void LightApp_Application::createActions() { - DBG_FUN(); CAM_Application::createActions(); SUIT_Desktop* desk = desktop(); @@ -862,7 +842,6 @@ void LightApp_Application::createActions() */ void LightApp_Application::customize() { - DBG_FUN(); // List of modules LightApp_ModuleAction* moduleAction = qobject_cast( action( ModulesListId ) ); // a. regular modules were added in createActions() method @@ -882,9 +861,6 @@ void LightApp_Application::customize() /*!On module activation action.*/ void LightApp_Application::onModuleActivation( const QString& modTitle ) { - DBG_FUN(); - ARG(modTitle); - // Force user to create/open a study before module activation QPixmap icon = moduleIcon( modTitle ); bool cancelled = false; @@ -903,7 +879,6 @@ void LightApp_Application::onModuleActivation( const QString& modTitle ) else { // cancelled putInfo( tr("INF_CANCELLED") ); - MSGEL("-----> emit moduleActivated <-----"); emit moduleActivated( QString() ); cancelled = true; } @@ -916,7 +891,6 @@ void LightApp_Application::onModuleActivation( const QString& modTitle ) /*!On module adding action.*/ void LightApp_Application::onModuleAdding() { - DBG_FUN(); // show dialog to browse configuration file QStringList filters = ( QStringList() << tr( "Config files") + " (*.salomex)" << tr( "All files" ) + " (*)" ); QStringList paths = getOpenFileNames( QString(), filters.join( ";;" ), QString(), desktop() ); @@ -954,9 +928,6 @@ void LightApp_Application::onModuleAdding() /*Add user module.*/ bool LightApp_Application::addUserModule( const QString& name, const QString& root, bool interactive ) { - DBG_FUN(); - ARG(name); - ARG(root); if ( name.isEmpty() || root.isEmpty() ) return false; @@ -1036,9 +1007,6 @@ bool LightApp_Application::addUserModule( const QString& name, const QString& ro /*!On module removing action.*/ void LightApp_Application::onModuleRemoving( const QString& title ) { - DBG_FUN(); - ARG(title); - QString root = resourceMgr()->stringValue( "user_modules", moduleName( title ) ); QDir rootDirectory = QDir( root ); @@ -1106,7 +1074,6 @@ QString LightApp_Application::defaultModule() const /*!On new window slot.*/ void LightApp_Application::onNewWindow() { - DBG_FUN(); const QObject* obj = sender(); if ( !obj || !obj->inherits( "QAction" ) ) return; @@ -1161,7 +1128,6 @@ void LightApp_Application::onNewWindow() break; #endif } - SHOW(type); if ( !type.isEmpty() ) createViewManager( type ); @@ -1172,7 +1138,6 @@ void LightApp_Application::onNewWindow() */ void LightApp_Application::onNewDoc() { - DBG_FUN(); if ( !checkExistingDoc() ) return; @@ -1187,7 +1152,6 @@ void LightApp_Application::onNewDoc() */ void LightApp_Application::onOpenDoc() { - DBG_FUN(); SUIT_Study* study = activeStudy(); if ( !checkExistingDoc( false ) ) @@ -1217,8 +1181,6 @@ bool LightApp_Application::canOpenDoc( const QString& ) */ bool LightApp_Application::onOpenDoc( const QString& aName ) { - DBG_FUN(); - ARG(aName); if ( !canOpenDoc(aName)) { bool showError = !property("open_study_from_command_line").isValid() || !property("open_study_from_command_line").toBool(); @@ -1267,7 +1229,6 @@ void LightApp_Application::onHelpAbout() */ void LightApp_Application::onSelection() { - DBG_FUN(); //MESSAGE("onSelection") onSelectionChanged(); @@ -1281,7 +1242,6 @@ void LightApp_Application::onSelection() */ void LightApp_Application::setActiveStudy( SUIT_Study* study ) { - DBG_FUN(); CAM_Application::setActiveStudy( study ); } @@ -1290,7 +1250,6 @@ void LightApp_Application::setActiveStudy( SUIT_Study* study ) */ void LightApp_Application::updateCommandsStatus() { - DBG_FUN(); CAM_Application::updateCommandsStatus(); QAction* a = 0; @@ -1421,8 +1380,6 @@ private: void LightApp_Application::showHelp( const QString& path ) { - DBG_FUN(); - ARG(path); SUIT_ResourceMgr* resMgr = resourceMgr(); #if DISABLE_QTXWEBBROWSER @@ -1511,7 +1468,6 @@ void LightApp_Application::onHelpContextModule( const QString& component, */ void LightApp_Application::onSelectionChanged() { - DBG_FUN(); LightApp_Module* m = dynamic_cast( activeModule() ); bool canCopy = m ? m->canCopy() : false; bool canPaste = m ? m->canPaste() : false; @@ -1681,9 +1637,6 @@ PyConsole_Console* LightApp_Application::pythonConsole(const bool force) */ void LightApp_Application::updateObjectBrowser( const bool updateModels ) { - DBG_FUN(); - ARG(updateModels); - // update existing data models if ( updateModels ) { @@ -1728,10 +1681,6 @@ LightApp_Preferences* LightApp_Application::preferences() const */ SUIT_ViewManager* LightApp_Application::getViewManager( const QString& vmType, const bool create ) { - DBG_FUN(); - ARG(vmType); - ARG(create); - SUIT_ViewManager* aVM = viewManager( vmType ); SUIT_ViewManager* anActiveVM = CAM_Application::activeViewManager(); MESSAGE("vmType: " << vmType.toStdString() << " aVM: " << aVM << " anActiveVM: " << anActiveVM ); @@ -1770,10 +1719,6 @@ SUIT_ViewManager* LightApp_Application::getViewManager( const QString& vmType, c */ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType, bool detached ) { - DBG_FUN(); - ARG(vmType); - ARG(detached); - SUIT_ResourceMgr* resMgr = resourceMgr(); SUIT_ViewManager* viewMgr = 0; @@ -1881,6 +1826,7 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType resMgr->booleanValue( "OCCViewer", "clipping_modulate", vm->isTextureModulated() ), resMgr->doubleValue( "OCCViewer", "clipping_scale", vm->clippingTextureScale() ) ); + viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface new LightApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr ); } @@ -1968,9 +1914,6 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType, QWidget* w ) { - DBG_FUN(); - ARG(vmType); - SUIT_ResourceMgr* resMgr = resourceMgr(); SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(), @@ -1993,8 +1936,6 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType SUIT_ViewManager* LightApp_Application::createViewManager( SUIT_ViewModel* theModel ) { - DBG_FUN(); - SUIT_ResourceMgr* resMgr = resourceMgr(); SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(), @@ -2023,7 +1964,6 @@ SUIT_ViewManager* LightApp_Application::createViewManager( SUIT_ViewModel* theMo */ void LightApp_Application::onCloseView( SUIT_ViewManager* theVM ) { - DBG_FUN(); removeViewManager( theVM ); } @@ -2033,7 +1973,6 @@ void LightApp_Application::onCloseView( SUIT_ViewManager* theVM ) */ void LightApp_Application::onStudyCreated( SUIT_Study* theStudy ) { - DBG_FUN(); SUIT_DataObject* aRoot = 0; if ( theStudy && theStudy->root() ) { @@ -2066,12 +2005,10 @@ void LightApp_Application::onStudyCreated( SUIT_Study* theStudy ) */ void LightApp_Application::onStudyOpened( SUIT_Study* theStudy ) { - DBG_FUN(); SUIT_DataObject* aRoot = 0; if ( theStudy && theStudy->root() ) { aRoot = theStudy->root(); - SHOW(aRoot); //aRoot->dump(); } @@ -2093,26 +2030,22 @@ void LightApp_Application::onStudyOpened( SUIT_Study* theStudy ) getPyInterp()->initStudy(); #endif - MSGEL("-----> emit studyOpened <-----"); emit studyOpened(); } /*!Protected SLOT. On study saved.*/ void LightApp_Application::onStudySaved( SUIT_Study* s ) { - DBG_FUN(); QtxMRUAction* mru = ::qobject_cast( action( MRUId ) ); if ( mru && s ) mru->insert( s->studyName() ); - MSGEL("-----> emit studySaved <-----"); emit studySaved(); } /*!Protected SLOT. On study closed.*/ void LightApp_Application::onStudyClosed( SUIT_Study* /*s*/ ) { - DBG_FUN(); /* disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ), this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) ); @@ -2125,7 +2058,6 @@ void LightApp_Application::onStudyClosed( SUIT_Study* /*s*/ ) mySelMgr->clearSelected(); // Bug 12944: emit signal only after clear selection - MSGEL("-----> emit studyClosed <-----"); emit studyClosed(); activateModule( "" ); @@ -2134,7 +2066,6 @@ void LightApp_Application::onStudyClosed( SUIT_Study* /*s*/ ) /*!Protected SLOT.On desktop activated.*/ void LightApp_Application::onDesktopActivated() { - DBG_FUN(); CAM_Application::onDesktopActivated(); LightApp_Module* aModule = dynamic_cast(activeModule()); if(aModule) @@ -2143,7 +2074,6 @@ void LightApp_Application::onDesktopActivated() void LightApp_Application::studyOpened( SUIT_Study* s ) { - DBG_FUN(); CAM_Application::studyOpened( s ); updateWindows(); @@ -2152,7 +2082,6 @@ void LightApp_Application::studyOpened( SUIT_Study* s ) void LightApp_Application::studySaved( SUIT_Study* s ) { - DBG_FUN(); CAM_Application::studyOpened( s ); SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); if ( aResMgr && activeStudy() ) { @@ -2163,7 +2092,6 @@ void LightApp_Application::studySaved( SUIT_Study* s ) void LightApp_Application::studyCreated( SUIT_Study* s ) { - DBG_FUN(); CAM_Application::studyCreated( s ); updateWindows(); @@ -2211,14 +2139,12 @@ QStringList LightApp_Application::getOpenFileNames( const QString& initial, cons /*!Private SLOT. Update object browser.*/ void LightApp_Application::onRefresh() { - DBG_FUN(); updateObjectBrowser( true ); } /*!Private SLOT. Update actions after rename object.*/ void LightApp_Application::onRenamed() { - DBG_FUN(); activeStudy()->Modified(); updateActions(); } @@ -2292,10 +2218,6 @@ void LightApp_Application::showPreferences( const QStringList& path ) /*!Protected SLOT. On preferences changed.*/ void LightApp_Application::onPreferenceChanged( QString& modName, QString& section, QString& param ) { - DBG_FUN(); - ARG(modName); - ARG(section); - ARG(param); LightApp_Module* sMod = 0; CAM_Module* mod = module( modName ); if ( mod && mod->inherits( "LightApp_Module" ) ) @@ -2306,14 +2228,12 @@ void LightApp_Application::onPreferenceChanged( QString& modName, QString& secti else preferencesChanged( section, param ); // emit signal to allow additional preferences changing processing - MSGEL("-----> emit preferenceChanged <-----"); emit preferenceChanged( modName, section, param ); } /*!Remove all windows from study.*/ void LightApp_Application::beforeCloseDoc( SUIT_Study* s ) { - DBG_FUN(); saveDockWindowsState(); if ( SUIT_DataBrowser* ob = objectBrowser() ) @@ -2333,7 +2253,6 @@ void LightApp_Application::updateActions() */ SUIT_Study* LightApp_Application::createNewStudy() { - DBG_FUN(); LightApp_Study* aStudy = new LightApp_Study( this ); // Set up processing of major study-related events @@ -2351,15 +2270,12 @@ SUIT_Study* LightApp_Application::createNewStudy() */ QWidget* LightApp_Application::createWindow( const int flag ) { - DBG_FUN(); - ARG(flag); QWidget* wid = 0; SUIT_ResourceMgr* resMgr = resourceMgr(); if ( flag == WT_ObjectBrowser ) { - MSGEL("--> create ObjectBrowser"); SUIT_DataBrowser* ob = new SUIT_DataBrowser( new LightApp_DataObject(), desktop() ); ob->setObjectName( "objectBrowser" ); ob->setSortMenuEnabled( true ); @@ -2405,7 +2321,6 @@ QWidget* LightApp_Application::createWindow( const int flag ) } else if ( flag == WT_InfoPanel) { - MSGEL("--> create InfoPanel"); QtxInfoPanel* ipanel = new QtxInfoPanel( desktop() ); ipanel->setObjectName( "infoPanel" ); ipanel->setWindowTitle( tr( "INFO_PANEL" ) ); @@ -2414,7 +2329,6 @@ QWidget* LightApp_Application::createWindow( const int flag ) #ifndef DISABLE_PYCONSOLE else if ( flag == WT_PyConsole ) { - MSGEL("--> create PythonConsole"); PyConsole_Console* pyCons = new PyConsole_Console( desktop(), new LightApp_PyEditor( getPyInterp() ) ); pyCons->setObjectName( "pythonConsole" ); pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) ); @@ -2427,7 +2341,6 @@ QWidget* LightApp_Application::createWindow( const int flag ) #endif else if ( flag == WT_LogWindow ) { - MSGEL("--> create LogWindow"); LogWindow* logWin = new LogWindow( desktop() ); logWin->handleQtMessages( true ); logWin->setObjectName( "logWindow" ); @@ -2542,7 +2455,6 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const */ void LightApp_Application::moduleAdded( CAM_Module* mod ) { - DBG_FUN(); CAM_Application::moduleAdded( mod ); LightApp_Module* lightMod = 0; @@ -2559,7 +2471,6 @@ void LightApp_Application::moduleAdded( CAM_Module* mod ) void LightApp_Application::moduleDeactivated( CAM_Module* /*mod*/ ) { - DBG_FUN(); if ( infoPanel() ) infoPanel()->clear(); } @@ -2583,7 +2494,6 @@ void LightApp_Application::emptyPreferences( const QString& modName ) */ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) { - DBG_FUN(); if ( !pref ) return; @@ -4166,7 +4076,6 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString */ void LightApp_Application::loadPreferences() { - DBG_FUN(); CAM_Application::loadPreferences(); SUIT_ResourceMgr* aResMgr = resourceMgr(); @@ -4217,7 +4126,6 @@ void LightApp_Application::loadPreferences() */ void LightApp_Application::savePreferences() { - DBG_FUN(); CAM_Application::savePreferences(); saveDockWindowsState(); @@ -4251,7 +4159,6 @@ void LightApp_Application::savePreferences() */ void LightApp_Application::updateDesktopTitle() { - DBG_FUN(); QString aTitle = applicationName(); QString aVer = applicationVersion(); if ( !aVer.isEmpty() ) @@ -4262,7 +4169,6 @@ void LightApp_Application::updateDesktopTitle() aTitle += QString( " - [%1]" ).arg( sName ); } - SHOW(aTitle); desktop()->setWindowTitle( aTitle ); } @@ -4317,7 +4223,6 @@ void LightApp_Application::moduleActionSelected( const int id ) */ void LightApp_Application::afterCloseDoc() { - DBG_FUN(); updateWindows(); CAM_Application::afterCloseDoc(); @@ -4328,15 +4233,11 @@ void LightApp_Application::afterCloseDoc() */ void LightApp_Application::updateModuleActions() { - MSGEL("-----> emit moduleActivated <-----"); emit moduleActivated( activeModule() ? activeModule()->moduleName() : QString() ); } bool LightApp_Application::checkModule( const QString& title ) { - DBG_FUN(); - ARG(title); - if ( title.isEmpty() ) return false; @@ -4436,7 +4337,6 @@ void LightApp_Application::currentViewManagers( QStringList& lst ) const */ void LightApp_Application::updateWindows() { - DBG_FUN(); QMap winMap; currentWindows( winMap ); @@ -4497,15 +4397,9 @@ void LightApp_Application::updateWindows() */ void LightApp_Application::updateViewManagers() { - DBG_FUN(); QStringList lst; currentViewManagers( lst ); - std::cout << "-----Current ViewManagers-----------------" << std::endl; - for (auto it = lst.begin(); it != lst.end(); ++it) - std::cout << "VM-Type: [" << (*it).toStdString() << "]" << std::endl; - std::cout << "------------------------------------------" << std::endl; - for ( QStringList::const_iterator it = lst.begin(); it != lst.end(); ++it ) getViewManager( *it, true ); } @@ -4515,7 +4409,6 @@ void LightApp_Application::updateViewManagers() */ void LightApp_Application::loadDockWindowsState() { - DBG_FUN(); if ( !desktop() ) return; SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); @@ -4619,7 +4512,6 @@ void LightApp_Application::loadDockWindowsState() */ void LightApp_Application::saveDockWindowsState() { - DBG_FUN(); if ( !desktop() ) return; @@ -4752,7 +4644,6 @@ QPixmap LightApp_Application::moduleIcon( const QString& moduleTitle, const int */ void LightApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title ) { - MSGEL("LightApp_Application::contextMenuPopup(type=\"" << type.toStdString() << "\")"); //Add "Rename" item LightApp_SelectionMgr* selMgr = LightApp_Application::selectionMgr(); bool cacheIsOn = selMgr->isSelectionCacheEnabled(); @@ -4798,7 +4689,6 @@ void LightApp_Application::contextMenuPopup( const QString& type, QMenu* thePopu */ void LightApp_Application::createEmptyStudy() { - DBG_FUN(); CAM_Application::createEmptyStudy(); if ( objectBrowser() ) @@ -4814,8 +4704,6 @@ void LightApp_Application::createEmptyStudy() /*!Set desktop:*/ void LightApp_Application::setDesktop( SUIT_Desktop* desk ) { - DBG_FUN(); - CAM_Application::setDesktop( desk ); if ( desk ) { @@ -4834,7 +4722,6 @@ void LightApp_Application::setDesktop( SUIT_Desktop* desk ) */ bool LightApp_Application::activateModule( CAM_Module* mod ) { - DBG_FUN(); bool res = CAM_Application::activateModule( mod ); if ( objectBrowser() ) @@ -4899,7 +4786,6 @@ void LightApp_Application::onFullScreen(){ */ void LightApp_Application::addViewManager( SUIT_ViewManager* vm ) { - DBG_FUN(); connect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ), this, SLOT( onCloseView( SUIT_ViewManager* ) ) ); CAM_Application::addViewManager( vm ); @@ -4910,7 +4796,6 @@ void LightApp_Application::addViewManager( SUIT_ViewManager* vm ) */ void LightApp_Application::removeViewManager( SUIT_ViewManager* vm ) { - DBG_FUN(); disconnect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ), this, SLOT( onCloseView( SUIT_ViewManager* ) ) ); LightApp_Study* aStudy = dynamic_cast(activeStudy()); @@ -4938,7 +4823,6 @@ void LightApp_Application::removeViewManager( SUIT_ViewManager* vm ) */ void LightApp_Application::onRenameWindow() { - DBG_FUN(); if( !desktop() ) return; @@ -4957,7 +4841,6 @@ void LightApp_Application::onRenameWindow() */ void LightApp_Application::onCloseWindow() { - DBG_FUN(); if( !desktop() ) return; @@ -4973,7 +4856,6 @@ void LightApp_Application::onCloseWindow() */ void LightApp_Application::onCloseAllWindow() { - DBG_FUN(); STD_TabDesktop* desk = dynamic_cast( desktop() ); if( !desk ) return; @@ -4992,7 +4874,6 @@ void LightApp_Application::onCloseAllWindow() */ void LightApp_Application::onGroupAllWindow() { - DBG_FUN(); STD_TabDesktop* desk = dynamic_cast( desktop() ); if( !desk ) return; @@ -5007,8 +4888,6 @@ void LightApp_Application::onGroupAllWindow() */ void LightApp_Application::setDefaultStudyName( const QString& theName ) { - DBG_FUN(); - ARG(theName); QStringList anInfoList; modules( anInfoList, false ); @@ -5026,7 +4905,6 @@ void LightApp_Application::setDefaultStudyName( const QString& theName ) */ bool LightApp_Application::event( QEvent* e ) { - DBG_FUN(); if( e && e->type()==2000 ) { SALOME_CustomEvent* ce = ( SALOME_CustomEvent* )e; @@ -5051,7 +4929,6 @@ bool LightApp_Application::event( QEvent* e ) /*! Check data object */ bool LightApp_Application::checkDataObject(LightApp_DataObject* theObj) { - DBG_FUN(); if (theObj) { bool isSuitable = !theObj->entry().isEmpty() && @@ -5065,8 +4942,6 @@ bool LightApp_Application::checkDataObject(LightApp_DataObject* theObj) int LightApp_Application::openChoice( const QString& aName ) { - DBG_FUN(); - ARG(aName); int choice = CAM_Application::openChoice( aName ); if ( choice == OpenExist ) // The document is already open. @@ -5082,9 +4957,6 @@ int LightApp_Application::openChoice( const QString& aName ) bool LightApp_Application::openAction( const int choice, const QString& aName ) { - DBG_FUN(); - ARG(choice); - ARG(aName); bool res = false; switch ( choice ) { @@ -5160,7 +5032,6 @@ QStringList LightApp_Application::viewManagersTypes() const */ void LightApp_Application::clearKnownViewManagers() { - DBG_FUN(); QStringList aTypesList = viewManagersTypes(); QList aMgrList; viewManagers( aMgrList ); @@ -5202,7 +5073,6 @@ QString LightApp_Application::browseObjects( const QStringList& theEntryList, const bool theIsApplyAndClose, const bool theIsOptimizedBrowsing ) { - DBG_FUN(); QString aResult; if( SUIT_ResourceMgr* aResourceMgr = resourceMgr() ) { @@ -5253,7 +5123,6 @@ QString LightApp_Application::browseObjects( const QStringList& theEntryList, anObject = aStudy->findObjectByEntry( anEntry ); if( anObject ) { - SHOW2(anObject, SUIT_DataObject*); QModelIndex anIndex = aModel->index( anObject ); anOB->treeView()->scrollTo( anIndex ); } @@ -5326,8 +5195,6 @@ bool LightApp_Application::renameObject( const QString& /*entry*/, const QString /*! Process standard messages from desktop */ void LightApp_Application::onDesktopMessage( const QString& message ) { - DBG_FUN(); - ARG(message); const QString sectionSeparator = "/"; if ( message.toLower() == "updateobjectbrowser" || @@ -5564,7 +5431,6 @@ void LightApp_Application::emitOperationFinished( const QString& theModuleName, const QString& theOperationName, const QStringList& theEntryList ) { - MSGEL("-----> emit operationFinished(\"" << theModuleName.toStdString() << "\", \"" << theOperationName.toStdString() << "\") <-----"); emit operationFinished( theModuleName, theOperationName, theEntryList ); } @@ -5574,7 +5440,6 @@ void LightApp_Application::emitOperationFinished( const QString& theModuleName, void LightApp_Application::updateVisibilityState( DataObjectList& theList, SUIT_ViewModel* theViewModel ) { - DBG_FUN(); if ( !theViewModel || theList.isEmpty() ) return; LightApp_Study* aStudy = dynamic_cast(activeStudy()); @@ -5584,39 +5449,22 @@ void LightApp_Application::updateVisibilityState( DataObjectList& theList, for ( DataObjectList::iterator itr = theList.begin(); itr != theList.end(); ++itr ) { LightApp_DataObject* obj = dynamic_cast(*itr); - SHOW2(obj, SUIT_DataObject*); - MSGEL("Entry=[" << obj->entry().toStdString() << "] isComponent=" << (aStudy->isComponent( obj->entry() ) ? "Yes" : "No")); if ( !obj || aStudy->isComponent( obj->entry() ) ) continue; QString mname = aStudy->componentDataType(obj->entry()); - SHOW(mname); LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(mname, false); if ( aDisplayer ) { Qtx::VisibilityState anObjState = Qtx::UnpresentableState; if ( aDisplayer->canBeDisplayed( obj->entry(), theViewModel->getType() ) ) { if ( aDisplayer->IsDisplayed( obj->entry(), aView ) ) - { - MSGEL("Component=[" << mname.toStdString() << "] Entry=[" << obj->entry().toStdString() << "] - shown"); anObjState = Qtx::ShownState; - } else - { - MSGEL("Component=[" << mname.toStdString() << "] Entry=[" << obj->entry().toStdString() << "] - hidden"); anObjState = Qtx::HiddenState; - } - } - else{ - MSGEL("Component=[" << mname.toStdString() << "] Entry=[" << obj->entry().toStdString() << "]...cannot be displayed"); - //anObjState = Qtx::HiddenState; } aStudy->setVisibilityState( obj->entry(), anObjState ); } - else - { - MSGEL("....no displayer found for component [" << mname.toStdString() << "]!"); - } } } @@ -5626,8 +5474,6 @@ void LightApp_Application::updateVisibilityState( DataObjectList& theList, void LightApp_Application::updatePresentations( const QString& theComponent, const QStringList& theViewManagerTypes ) { - DBG_FUN(); - ARG(theComponent); LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(theComponent, false); if ( aDisplayer ) { LightApp_Study* aStudy = dynamic_cast(activeStudy()); @@ -5650,7 +5496,6 @@ void LightApp_Application::updatePresentations( const QString& theComponent, DataObjectList::const_iterator itObjs = anObjs.begin(); for ( ; itObjs != anObjs.end(); itObjs++ ) { LightApp_DataObject* anObj = dynamic_cast( *itObjs ); - SHOW2(anObj, SUIT_DataObject*); QString anEntry = anObj->entry(); QListIterator itViewMgrs( aViewMgrs ); @@ -5678,12 +5523,10 @@ void LightApp_Application::updatePresentations( const QString& theComponent, */ void LightApp_Application::onWindowActivated( SUIT_ViewWindow* theViewWindow ) { - DBG_FUN(); SUIT_DataBrowser* anOB = objectBrowser(); if ( !anOB ) return; SUIT_DataObject* rootObj = anOB->root(); - SHOW(rootObj); if ( !rootObj ) return; @@ -5700,7 +5543,6 @@ void LightApp_Application::onWindowActivated( SUIT_ViewWindow* theViewWindow ) */ void LightApp_Application::onViewManagerRemoved( SUIT_ViewManager* ) { - DBG_FUN(); ViewManagerList lst; viewManagers( lst ); if ( lst.count() == 1) { // in case if closed last view window @@ -5715,8 +5557,6 @@ void LightApp_Application::onViewManagerRemoved( SUIT_ViewManager* ) */ bool LightApp_Application::checkExistingDoc( bool closeExistingDoc ) { - DBG_FUN(); - ARG(closeExistingDoc); bool result = true; if( activeStudy() ) { int answer = !activeStudy()->isModified() ? 1 : @@ -5774,8 +5614,6 @@ PyConsole_Interp* LightApp_Application::createPyInterp() void LightApp_Application::createHelpItems( const QString& modTitle ) { - DBG_FUN(); - ARG(modTitle); if ( modTitle.isEmpty() ) return; @@ -5860,8 +5698,6 @@ void LightApp_Application::createHelpItems( const QString& modTitle ) void LightApp_Application::removeHelpItems( const QString& modTitle ) { - DBG_FUN(); - ARG(modTitle); QString modName = moduleName( modTitle ); if ( myHelpItems.contains( modName ) ) { diff --git a/src/LightApp/LightApp_DataModel.cxx b/src/LightApp/LightApp_DataModel.cxx index 3f706c0ea..126ff7ab0 100644 --- a/src/LightApp/LightApp_DataModel.cxx +++ b/src/LightApp/LightApp_DataModel.cxx @@ -34,19 +34,12 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_DataModel" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule ) : CAM_DataModel( theModule ) { - DBG_FUN(); myGroupId = 0; if( module() ) myGroupId = qHash( module()->name() ); @@ -57,7 +50,6 @@ LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule ) */ LightApp_DataModel::~LightApp_DataModel() { - DBG_FUN(); } /*! @@ -65,8 +57,6 @@ LightApp_DataModel::~LightApp_DataModel() */ bool LightApp_DataModel::open( const QString&, CAM_Study*, QStringList ) { - DBG_FUN(); - MSGEL("-----> emit opened <-----"); emit opened(); //TODO: is it really needed? to be removed maybe... return true; } @@ -76,8 +66,6 @@ bool LightApp_DataModel::open( const QString&, CAM_Study*, QStringList ) */ bool LightApp_DataModel::save( QStringList& ) { - DBG_FUN(); - MSGEL("-----> emit saved <-----"); emit saved(); return true; } @@ -87,8 +75,6 @@ bool LightApp_DataModel::save( QStringList& ) */ bool LightApp_DataModel::saveAs( const QString&, CAM_Study*, QStringList& ) { - DBG_FUN(); - MSGEL("-----> emit saved <-----"); emit saved(); return true; } @@ -99,7 +85,6 @@ bool LightApp_DataModel::saveAs( const QString&, CAM_Study*, QStringList& ) */ bool LightApp_DataModel::dumpPython( const QString&, CAM_Study*, bool, QStringList& ) { - DBG_FUN(); return true; } @@ -108,8 +93,6 @@ bool LightApp_DataModel::dumpPython( const QString&, CAM_Study*, bool, QStringLi */ bool LightApp_DataModel::close() { - DBG_FUN(); - MSGEL("-----> emit closed <-----"); emit closed(); return true; } @@ -119,7 +102,6 @@ bool LightApp_DataModel::close() */ void LightApp_DataModel::build() { - DBG_FUN(); } /*! @@ -127,7 +109,6 @@ void LightApp_DataModel::build() */ void LightApp_DataModel::updateWidgets() { - DBG_FUN(); LightApp_Application* app = dynamic_cast( module()->application() ); if ( app && app->objectBrowser() ) app->objectBrowser()->updateTree( 0, false ); @@ -138,7 +119,6 @@ void LightApp_DataModel::updateWidgets() */ void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* ) { - DBG_FUN(); // san: Previously modelRoot was casted to LightApp_ModuleObject*, // BUT this is incorrect: in full SALOME the model root has different type. // Hopefully LightApp_DataObject* is sufficient here. @@ -225,8 +205,6 @@ int LightApp_DataModel::groupId() const */ void LightApp_DataModel::registerColumn( SUIT_DataBrowser* browser, const QString& name, const int custom_id ) { - DBG_FUN(); - ARG(name); SUIT_AbstractModel* m = dynamic_cast( browser ? browser->model() : 0 ); if( m ) m->registerColumn( groupId(), name, custom_id ); @@ -239,8 +217,6 @@ void LightApp_DataModel::registerColumn( SUIT_DataBrowser* browser, const QStrin */ void LightApp_DataModel::unregisterColumn( SUIT_DataBrowser* browser, const QString& name ) { - DBG_FUN(); - ARG(name); SUIT_AbstractModel* m = dynamic_cast( browser ? browser->model() : 0 ); if( m ) m->unregisterColumn( groupId(), name ); @@ -257,7 +233,6 @@ void LightApp_DataModel::unregisterColumn( SUIT_DataBrowser* browser, const QStr */ CAM_ModuleObject* LightApp_DataModel::createModuleObject( SUIT_DataObject* theRoot ) const { - DBG_FUN(); LightApp_RootObject* aStudyRoot = dynamic_cast( theRoot ); if ( !aStudyRoot ) return 0; diff --git a/src/LightApp/LightApp_DataObject.cxx b/src/LightApp/LightApp_DataObject.cxx index bd7c1b0e5..34f637c21 100644 --- a/src/LightApp/LightApp_DataObject.cxx +++ b/src/LightApp/LightApp_DataObject.cxx @@ -36,13 +36,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_DataObject" -#include "MBDebug.h" -#include "MBSUIT.h" -//--------------------------------------------------------- - /*! \class LightApp_DataObject::Key \brief Represents unique data object key for the LightApp_DataObject @@ -120,8 +113,6 @@ LightApp_DataObject::LightApp_DataObject( SUIT_DataObject* parent ) myCompDataType( "" ), myCompObject( 0 ) { - DBG_FUN(); - ARG(parent); } /*! @@ -129,7 +120,6 @@ LightApp_DataObject::LightApp_DataObject( SUIT_DataObject* parent ) */ LightApp_DataObject::~LightApp_DataObject() { - DBG_FUN(); } int LightApp_DataObject::groupId() const @@ -231,8 +221,6 @@ bool LightApp_DataObject::renameAllowed( const int id ) const */ bool LightApp_DataObject::setName(const QString& name) { - DBG_FUN(); - ARG(name); LightApp_Module* m = dynamic_cast( module() ); LightApp_RootObject* r = dynamic_cast( root() ); LightApp_Application* app = @@ -330,7 +318,6 @@ QString LightApp_DataObject::text( const int id ) const break; } - MSGEL("LightApp_DataObject::text(id=" << id << ") -> \"" << txt.toStdString() << "\""); return txt; } @@ -501,7 +488,6 @@ LightApp_ModuleObject::LightApp_ModuleObject( SUIT_DataObject* parent ) LightApp_DataObject( parent ), CAM_ModuleObject( parent ) { - DBG_FUN(); } /*! @@ -514,7 +500,6 @@ LightApp_ModuleObject::LightApp_ModuleObject( CAM_DataModel* dm, SUIT_DataObject LightApp_DataObject( parent ), CAM_ModuleObject( dm, parent ) { - DBG_FUN(); } /* @@ -522,7 +507,6 @@ LightApp_ModuleObject::LightApp_ModuleObject( CAM_DataModel* dm, SUIT_DataObject */ LightApp_ModuleObject::~LightApp_ModuleObject() { - DBG_FUN(); } /*! @@ -564,7 +548,6 @@ QString LightApp_ModuleObject::toolTip( const int id ) const */ void LightApp_ModuleObject::insertChild( SUIT_DataObject* obj, int pos ) { - DBG_FUN(); LightApp_DataObject::insertChild( obj, pos ); CAM_DataModel* aModel = dataModel(); @@ -594,7 +577,6 @@ LightApp_RootObject::LightApp_RootObject( LightApp_Study* study ) LightApp_DataObject( 0 ), myStudy( study ) { - DBG_FUN(); } /* @@ -602,7 +584,6 @@ LightApp_RootObject::LightApp_RootObject( LightApp_Study* study ) */ LightApp_RootObject::~LightApp_RootObject() { - DBG_FUN(); } /* @@ -611,7 +592,6 @@ LightApp_RootObject::~LightApp_RootObject() */ void LightApp_RootObject::setStudy( LightApp_Study* study ) { - DBG_FUN(); myStudy = study; } diff --git a/src/LightApp/LightApp_DataOwner.cxx b/src/LightApp/LightApp_DataOwner.cxx index b1f9f66e1..99f6be61b 100644 --- a/src/LightApp/LightApp_DataOwner.cxx +++ b/src/LightApp/LightApp_DataOwner.cxx @@ -22,18 +22,10 @@ #include "LightApp_DataOwner.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_DataOwner" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!Constructor. Initialize by \a theEntry.*/ LightApp_DataOwner::LightApp_DataOwner( const QString& theEntry ) : myEntry( theEntry ) { - DBG_FUN(); - ARG(theEntry); } #ifndef DISABLE_SALOMEOBJECT @@ -42,14 +34,12 @@ LightApp_DataOwner::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& myEntry(!theIO.IsNull()? theIO->getEntry(): ""), myIO(theIO) { - DBG_FUN(); } #endif /*!Destructor. Do nothing.*/ LightApp_DataOwner::~LightApp_DataOwner() { - DBG_FUN(); } /*!Gets key string, used for data owners comparison.*/ diff --git a/src/LightApp/LightApp_Displayer.cxx b/src/LightApp/LightApp_Displayer.cxx index 226529700..abcfbb757 100644 --- a/src/LightApp/LightApp_Displayer.cxx +++ b/src/LightApp/LightApp_Displayer.cxx @@ -39,18 +39,11 @@ #include "SALOME_InteractiveObject.hxx" #endif -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_Displayer" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Default constructor */ LightApp_Displayer::LightApp_Displayer() { - DBG_FUN(); } /*! @@ -58,7 +51,6 @@ LightApp_Displayer::LightApp_Displayer() */ LightApp_Displayer::~LightApp_Displayer() { - DBG_FUN(); } /*! @@ -70,8 +62,6 @@ LightApp_Displayer::~LightApp_Displayer() void LightApp_Displayer::Display( const QString& entry, const bool updateViewer, SALOME_View* theViewFrame ) { - DBG_FUN(); - ARG(entry); QStringList aList; aList.append( entry ); Display( aList, updateViewer, theViewFrame ); @@ -86,8 +76,6 @@ void LightApp_Displayer::Display( const QString& entry, const bool updateViewer, void LightApp_Displayer::Display( const QStringList& list, const bool updateViewer, SALOME_View* theViewFrame ) { - DBG_FUN(); - SHOW(list); SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); QStringList::const_iterator it = list.constBegin(); for ( ; it != list.constEnd(); ++it) @@ -98,7 +86,7 @@ void LightApp_Displayer::Display( const QStringList& list, const bool updateView if ( vf ) { - myLastEntry = *it; + myLastEntry = *it; vf->BeforeDisplay( this, prs ); vf->Display( this, prs ); vf->AfterDisplay( this, prs ); @@ -119,8 +107,6 @@ void LightApp_Displayer::Display( const QStringList& list, const bool updateView */ void LightApp_Displayer::Redisplay( const QString& entry, const bool updateViewer ) { - DBG_FUN(); - ARG(entry); // Remove the object permanently ( == true) SUIT_Session* ses = SUIT_Session::session(); SUIT_Application* app = ses->activeApplication(); @@ -159,8 +145,6 @@ void LightApp_Displayer::Erase( const QString& entry, const bool forced, const bool updateViewer, SALOME_View* theViewFrame ) { - DBG_FUN(); - ARG(entry); QStringList aList; aList.append( entry ); Erase( aList, forced, updateViewer, theViewFrame ); @@ -177,7 +161,6 @@ void LightApp_Displayer::Erase( const QStringList& list, const bool forced, const bool updateViewer, SALOME_View* theViewFrame ) { - DBG_FUN(); SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); if ( !vf ) @@ -208,7 +191,6 @@ void LightApp_Displayer::Erase( const QStringList& list, const bool forced, */ void LightApp_Displayer::EraseAll( const bool forced, const bool updateViewer, SALOME_View* theViewFrame ) { - DBG_FUN(); SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); if ( vf ) { @@ -248,7 +230,6 @@ bool LightApp_Displayer::IsDisplayed( const QString& entry, SALOME_View* theView */ void LightApp_Displayer::UpdateViewer() const { - DBG_FUN(); SALOME_View* vf = GetActiveView(); if ( vf ) vf->Repaint(); @@ -262,8 +243,6 @@ void LightApp_Displayer::UpdateViewer() const */ SALOME_Prs* LightApp_Displayer::buildPresentation( const QString& entry, SALOME_View* theViewFrame ) { - DBG_FUN(); - ARG(entry); SALOME_Prs* prs = 0; SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); @@ -279,7 +258,6 @@ SALOME_Prs* LightApp_Displayer::buildPresentation( const QString& entry, SALOME_ */ SALOME_View* LightApp_Displayer::GetActiveView() { - DBG_FUNC(); SUIT_Session* session = SUIT_Session::session(); if ( SUIT_Application* app = session->activeApplication() ) { if ( LightApp_Application* sApp = dynamic_cast( app ) ) { @@ -315,7 +293,6 @@ bool LightApp_Displayer::canBeDisplayed( const QString& entry ) const if( SUIT_ViewManager* vman = sApp->activeViewManager() ) if( SUIT_ViewModel* vmod = vman->getViewModel() ) viewerType = vmod->getType(); - MSGEL(".....LApp_Displayer: [" << entry.toStdString() << "] can be displayed in \"" << viewerType.toStdString() << "\"?"); return canBeDisplayed( entry, viewerType ); } @@ -328,9 +305,6 @@ bool LightApp_Displayer::canBeDisplayed( const QString& entry ) const */ LightApp_Displayer* LightApp_Displayer::FindDisplayer( const QString& mod_name, const bool load ) { - DBG_FUNC(); - ARG(mod_name); - ARG(load); QString mname = LightApp_Application::moduleDisplayer( mod_name ); SUIT_Session* session = SUIT_Session::session(); SUIT_Application* sapp = session ? session->activeApplication() : 0; @@ -364,8 +338,6 @@ LightApp_Displayer* LightApp_Displayer::FindDisplayer( const QString& mod_name, \param load - is module has to be forced loaded */ void LightApp_Displayer::setVisibilityState( const QString& theEntry, Qtx::VisibilityState theState) const { - DBG_FUN(); - ARG(theEntry); LightApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); LightApp_Study* study = app ? dynamic_cast( app->activeStudy() ) : 0; diff --git a/src/LightApp/LightApp_Driver.cxx b/src/LightApp/LightApp_Driver.cxx index d64d6987d..21e76d437 100644 --- a/src/LightApp/LightApp_Driver.cxx +++ b/src/LightApp/LightApp_Driver.cxx @@ -39,25 +39,17 @@ #include #endif -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_Driver" -#include "MBDebug.h" -//--------------------------------------------------------- - using namespace std; /*! Constructor.*/ LightApp_Driver::LightApp_Driver() : myIsTemp( false ) { - DBG_FUN(); } /*! Destructor.*/ LightApp_Driver::~LightApp_Driver() { - DBG_FUN(); } /*! @@ -65,8 +57,6 @@ LightApp_Driver::~LightApp_Driver() */ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile ) { - DBG_FUN(); - ARG(theFileName); int aNbModules = 0; std::map::const_iterator it; for (it = myMap.begin(); it != myMap.end(); ++it) @@ -150,8 +140,6 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile */ bool LightApp_Driver::ReadDatasFromFile( const char* theFileName, bool isMultiFile ) { - DBG_FUN(); - ARG(theFileName); #ifdef WIN32 ifstream aFile(theFileName, ios::binary); #else @@ -211,12 +199,9 @@ bool LightApp_Driver::ReadDatasFromFile( const char* theFileName, bool isMultiFi */ std::string LightApp_Driver::GetTmpDir (const char* theURL, const bool isMultiFile) { - DBG_FUN(); - ARG(theURL); std::string anURLDir = GetDirFromPath(theURL); std::string aTmpDir = isMultiFile ? anURLDir : GetTmpDir(); - RET(aTmpDir); return aTmpDir; } @@ -225,7 +210,6 @@ std::string LightApp_Driver::GetTmpDir (const char* theURL, const bool isMultiF */ LightApp_Driver::ListOfFiles LightApp_Driver::GetListOfFiles( const char* theModuleName ) { - DBG_FUN(); ListOfFiles aListOfFiles; std::string aName(theModuleName); @@ -240,8 +224,6 @@ LightApp_Driver::ListOfFiles LightApp_Driver::GetListOfFiles( const char* theMod */ void LightApp_Driver::SetListOfFiles( const char* theModuleName, const ListOfFiles theListOfFiles ) { - DBG_FUN(); - ARG(theModuleName); std::string aName (theModuleName); myMap[aName] = theListOfFiles; } @@ -252,8 +234,6 @@ void LightApp_Driver::SetListOfFiles( const char* theModuleName, const ListOfFil void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsigned char*& theBuffer, long& theBufferSize, bool theNamesOnly ) { - DBG_FUN(); - ARG(theModuleName); ListOfFiles aFiles = myMap[theModuleName]; // aFiles must contain temporary directory name in its first item // and names of files (relatively the temporary directory) in the others @@ -365,7 +345,6 @@ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsign LightApp_Driver::ListOfFiles LightApp_Driver::PutStreamToFiles( const unsigned char* theBuffer, const long theBufferSize, bool theNamesOnly ) { - DBG_FUN(); if(theBufferSize == 0 || theBuffer == 0) return ListOfFiles(); @@ -430,7 +409,6 @@ LightApp_Driver::ListOfFiles LightApp_Driver::PutStreamToFiles( const unsigned c */ void LightApp_Driver::RemoveFiles( const ListOfFiles& theFiles, const bool IsDirDeleted) { - DBG_FUN(); int i, aLength = (int)theFiles.size() - 1; //!< TODO: conversion size_t to int if(aLength <= 0) { return; @@ -471,8 +449,6 @@ void LightApp_Driver::RemoveFiles( const ListOfFiles& theFiles, const bool IsDir */ void LightApp_Driver::RemoveTemporaryFiles( const char* theModuleName, const bool IsDirDeleted ) { - DBG_FUN(); - ARG(theModuleName); std::string aModuleName(theModuleName); ListOfFiles aFiles = myMap[aModuleName]; // aFiles must contain temporary directory name in its first item @@ -486,7 +462,6 @@ void LightApp_Driver::RemoveTemporaryFiles( const char* theModuleName, const boo */ void LightApp_Driver::ClearDriverContents() { - DBG_FUN(); std::map::iterator it; for ( it = myMap.begin(); it != myMap.end(); ++it ) { @@ -505,7 +480,6 @@ void LightApp_Driver::ClearDriverContents() */ std::string LightApp_Driver::GetTmpDir() { - DBG_FUN(); if ( myTmpDir.length() != 0 ) return myTmpDir; @@ -567,7 +541,6 @@ std::string LightApp_Driver::GetTmpDir() myTmpDir = aTmpDir.ToCString(); - RET(myTmpDir); return aTmpDir.ToCString(); } diff --git a/src/LightApp/LightApp_GVSelector.cxx b/src/LightApp/LightApp_GVSelector.cxx index 2ce403f22..eb5bea299 100644 --- a/src/LightApp/LightApp_GVSelector.cxx +++ b/src/LightApp/LightApp_GVSelector.cxx @@ -25,25 +25,17 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_GVSelector" -#include "MBDebug.h" -//--------------------------------------------------------- - LightApp_GVSelector::LightApp_GVSelector( GraphicsView_Viewer* theViewer, SUIT_SelectionMgr* theSelMgr ) : SUIT_Selector( theSelMgr, theViewer ), myViewer( theViewer ) { - DBG_FUN(); connect( theViewer, SIGNAL( selectionChanged( GV_SelectionChangeStatus ) ), this, SLOT( onSelectionChanged( GV_SelectionChangeStatus ) ) ); } LightApp_GVSelector::~LightApp_GVSelector() { - DBG_FUN(); } QString LightApp_GVSelector::type() const @@ -53,7 +45,6 @@ QString LightApp_GVSelector::type() const void LightApp_GVSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const { - DBG_FUN(); if( GraphicsView_ViewPort* aViewport = myViewer->getActiveViewPort() ) for( aViewport->initSelected(); aViewport->moreSelected(); aViewport->nextSelected() ) theList.append( new LightApp_DataOwner( aViewport->selectedObject()->getName() ) ); @@ -61,11 +52,9 @@ void LightApp_GVSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const void LightApp_GVSelector::setSelection( const SUIT_DataOwnerPtrList& /*theList*/ ) { - DBG_FUN(); } void LightApp_GVSelector::onSelectionChanged( GV_SelectionChangeStatus ) { - DBG_FUN(); selectionChanged(); } diff --git a/src/LightApp/LightApp_Module.cxx b/src/LightApp/LightApp_Module.cxx index 37b51db60..1b2c15b61 100644 --- a/src/LightApp/LightApp_Module.cxx +++ b/src/LightApp/LightApp_Module.cxx @@ -104,12 +104,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_Module" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!Constructor.*/ LightApp_Module::LightApp_Module( const QString& name ) : CAM_Module( name ), @@ -121,14 +115,11 @@ LightApp_Module::LightApp_Module( const QString& name ) myEraseAll( -1 ), myIsFirstActivate( true ) { - DBG_FUN(); - ARG(name); } /*!Destructor.*/ LightApp_Module::~LightApp_Module() { - DBG_FUN(); if ( mySwitchOp ) delete mySwitchOp; } @@ -136,7 +127,6 @@ LightApp_Module::~LightApp_Module() /*!Initialize module.*/ void LightApp_Module::initialize( CAM_Application* app ) { - DBG_FUN(); CAM_Module::initialize( app ); SUIT_ResourceMgr* resMgr = app ? app->resourceMgr() : 0; @@ -157,7 +147,6 @@ void LightApp_Module::viewManagers( QStringList& ) const /*!Context menu popup.*/ void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QString& /*title*/ ) { - DBG_FUN(); LightApp_Selection* sel = createSelection(); sel->init( client, getApp()->selectionMgr() ); @@ -173,7 +162,6 @@ void LightApp_Module::contextMenuPopup( const QString& client, QMenu* menu, QStr void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel, SUIT_DataObject* theDataObject ) { - DBG_FUN(); if (!getApp()->objectBrowser()) return; bool upd = getApp()->objectBrowser()->autoUpdate(); @@ -232,7 +220,6 @@ bool LightApp_Module::isSelectionCompatible() /*!Activate module.*/ bool LightApp_Module::activateModule( SUIT_Study* study ) { - DBG_FUN(); bool res = CAM_Module::activateModule( study ); if ( !isSelectionCompatible() )// PAL19290, PAL18352 @@ -275,7 +262,6 @@ bool LightApp_Module::activateModule( SUIT_Study* study ) /*!Deactivate module.*/ bool LightApp_Module::deactivateModule( SUIT_Study* study ) { - DBG_FUN(); delete mySwitchOp; mySwitchOp = 0; @@ -315,7 +301,6 @@ bool LightApp_Module::deactivateModule( SUIT_Study* study ) /*! Redefined to reset internal flags valid for study instance */ void LightApp_Module::studyClosed( SUIT_Study* theStudy ) { - DBG_FUN(); CAM_Module::studyClosed( theStudy ); myIsFirstActivate = true; @@ -370,8 +355,6 @@ LightApp_Application* LightApp_Module::getApp() const */ void LightApp_Module::update( const int theFlags ) { - DBG_FUN(); - ARG(theFlags); if ( theFlags & UF_Model ) { if( CAM_DataModel* aDataModel = dataModel() ) @@ -436,14 +419,12 @@ void LightApp_Module::updateControls() /*!Create new instance of data model and return it.*/ CAM_DataModel* LightApp_Module::createDataModel() { - DBG_FUN(); return new LightApp_DataModel( this ); } /*!Create and return instance of LightApp_Selection.*/ LightApp_Selection* LightApp_Module::createSelection() const { - DBG_FUN(); return new LightApp_Selection(); } @@ -465,7 +446,6 @@ void LightApp_Module::onModelClosed() /*!Gets popup manager.(create if not exist)*/ QtxPopupMgr* LightApp_Module::popupMgr() { - DBG_FUN(); if ( !myPopupMgr ) { myPopupMgr = new QtxPopupMgr( 0, this ); @@ -606,8 +586,6 @@ void LightApp_Module::setPreferenceProperty( const int id, const QString& prop, */ void LightApp_Module::startOperation( const int id ) { - DBG_FUN(); - ARG(id); LightApp_Operation* op = 0; if( myOperations.contains( id ) && reusableOperation( id ) ) op = myOperations[ id ]; @@ -642,8 +620,6 @@ void LightApp_Module::startOperation( const int id ) */ LightApp_Operation* LightApp_Module::createOperation( const int id ) const { - DBG_FUN(); - ARG(id); if( id==-1 ) return 0; @@ -680,7 +656,6 @@ void LightApp_Module::onOperationStopped( SUIT_Operation* /*theOp*/ ) */ void LightApp_Module::onOperationDestroyed() { - DBG_FUN(); const QObject* s = sender(); if( s && s->inherits( "LightApp_Operation" ) ) { @@ -710,7 +685,6 @@ LightApp_Displayer* LightApp_Module::displayer() */ void LightApp_Module::onShowHide() { - DBG_FUN(); if( !sender()->inherits( "QAction" ) || !popupMgr() ) return; @@ -839,7 +813,6 @@ bool LightApp_Module::renameObject( const QString& /*entry*/, const QString& /*n */ void LightApp_Module::updateModuleVisibilityState() { - DBG_FUN(); // update visibility state of objects LightApp_Application* app = dynamic_cast(SUIT_Session::session()->activeApplication()); if ( !app ) return; @@ -878,7 +851,6 @@ void LightApp_Module::updateModuleVisibilityState() */ void LightApp_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn ) { - DBG_FUN(); if ( !isActiveModule() ) return; // change visibility of object @@ -904,6 +876,5 @@ void LightApp_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn void LightApp_Module::onOBDestroyed() { - DBG_FUN(); myIsFirstActivate = true; } diff --git a/src/LightApp/LightApp_OBSelector.cxx b/src/LightApp/LightApp_OBSelector.cxx index 0ccd1696b..7c4bd88d4 100644 --- a/src/LightApp/LightApp_OBSelector.cxx +++ b/src/LightApp/LightApp_OBSelector.cxx @@ -34,12 +34,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_OBSelector" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! \class LightApp_OBSelector \brief Object browser selection handler class. @@ -54,7 +48,6 @@ LightApp_OBSelector::LightApp_OBSelector( SUIT_DataBrowser* ob, SUIT_SelectionMg : SUIT_Selector( mgr, ob ), myBrowser( ob ) { - DBG_FUN(); if ( myBrowser ) { connect( myBrowser, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) ); } @@ -66,7 +59,6 @@ LightApp_OBSelector::LightApp_OBSelector( SUIT_DataBrowser* ob, SUIT_SelectionMg */ LightApp_OBSelector::~LightApp_OBSelector() { - DBG_FUN(); } /*! @@ -101,7 +93,6 @@ unsigned long LightApp_OBSelector::getModifiedTime() const */ void LightApp_OBSelector::setModified() { - DBG_FUN(); myModifiedTime = clock(); } @@ -110,7 +101,6 @@ void LightApp_OBSelector::setModified() */ void LightApp_OBSelector::onSelectionChanged() { - DBG_FUN(); #ifdef _DEBUG_ QTime t1 = QTime::currentTime(); #endif @@ -128,7 +118,6 @@ void LightApp_OBSelector::onSelectionChanged() */ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const { - DBG_FUN(); if ( mySelectedList.count() == 0 ) { SUIT_Session* session = SUIT_Session::session(); SUIT_Application* sapp = session ? session->activeApplication() : 0; @@ -156,7 +145,6 @@ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const } } } - RET(mySelectedList.count()); theList = mySelectedList; } @@ -166,7 +154,6 @@ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const */ void LightApp_OBSelector::setSelection( const SUIT_DataOwnerPtrList& theList ) { - DBG_FUN(); if ( !myBrowser ) return; @@ -191,7 +178,6 @@ void LightApp_OBSelector::setSelection( const SUIT_DataOwnerPtrList& theList ) */ void LightApp_OBSelector::fillEntries( QMap& entries ) { - DBG_FUN(); entries.clear(); if ( !myBrowser ) diff --git a/src/LightApp/LightApp_Operation.cxx b/src/LightApp/LightApp_Operation.cxx index 4b1c572ba..282d24351 100644 --- a/src/LightApp/LightApp_Operation.cxx +++ b/src/LightApp/LightApp_Operation.cxx @@ -33,12 +33,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_Operation" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! * \brief Constructor * @@ -49,7 +43,6 @@ LightApp_Operation::LightApp_Operation() myModule( 0 ), myIsAutoResumed( true ) { - DBG_FUN(); } /*! @@ -59,7 +52,7 @@ LightApp_Operation::LightApp_Operation() */ LightApp_Operation::~LightApp_Operation() { - DBG_FUN(); + } /*! @@ -84,7 +77,6 @@ LightApp_Module* LightApp_Operation::module() const */ void LightApp_Operation::setModule( LightApp_Module* theModule ) { - DBG_FUN(); myModule = theModule; setApplication( myModule ? myModule->application() : 0 ); setStudy( application() ? application()->activeStudy() : 0 ); @@ -110,7 +102,6 @@ SUIT_Desktop* LightApp_Operation::desktop() const */ void LightApp_Operation::resumeOperation() { - DBG_FUN(); SUIT_Operation::resumeOperation(); setDialogActive( true ); } @@ -123,7 +114,6 @@ void LightApp_Operation::resumeOperation() */ void LightApp_Operation::startOperation() { - DBG_FUN(); if( selectionMgr() ) connect( selectionMgr(), SIGNAL( selectionChanged() ), SLOT( onSelectionDone() ) ); @@ -140,7 +130,6 @@ void LightApp_Operation::startOperation() */ void LightApp_Operation::suspendOperation() { - DBG_FUN(); SUIT_Operation::suspendOperation(); setDialogActive( false ); } @@ -153,7 +142,6 @@ void LightApp_Operation::suspendOperation() */ void LightApp_Operation::abortOperation() { - DBG_FUN(); SUIT_Operation::abortOperation(); setDialogActive( true ); if ( dlg() ) @@ -171,7 +159,6 @@ void LightApp_Operation::abortOperation() */ void LightApp_Operation::commitOperation() { - DBG_FUN(); SUIT_Operation::commitOperation(); setDialogActive( true ); if ( dlg() ) @@ -204,7 +191,6 @@ LightApp_Dialog* LightApp_Operation::dlg() const */ void LightApp_Operation::activateSelection() { - DBG_FUN(); } /*! @@ -215,7 +201,6 @@ void LightApp_Operation::activateSelection() */ void LightApp_Operation::selectionDone() { - DBG_FUN(); } /*! @@ -250,7 +235,6 @@ LightApp_SelectionMgr* LightApp_Operation::selectionMgr() const */ void LightApp_Operation::onSelectionDone() { - DBG_FUN(); if ( isActive() ) selectionDone(); } @@ -264,7 +248,6 @@ void LightApp_Operation::onSelectionDone() */ void LightApp_Operation::update( const int flags ) { - DBG_FUN(); if ( myModule != 0 ) myModule->update( flags ); } @@ -278,8 +261,6 @@ void LightApp_Operation::update( const int flags ) */ void LightApp_Operation::setDialogActive( const bool active ) { - DBG_FUN(); - ARG(active); if( dlg() ) { if( active ) @@ -314,7 +295,5 @@ bool LightApp_Operation::isAutoResumed() const */ void LightApp_Operation::setAutoResumed( const bool on ) { - DBG_FUN(); - ARG(on); myIsAutoResumed = on; } diff --git a/src/LightApp/LightApp_PV3DSelector.cxx b/src/LightApp/LightApp_PV3DSelector.cxx index ff1ca466e..c1c23aeb0 100644 --- a/src/LightApp/LightApp_PV3DSelector.cxx +++ b/src/LightApp/LightApp_PV3DSelector.cxx @@ -39,13 +39,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_PV3DSelector" -#include "MBDebug.h" -//--------------------------------------------------------- - - #ifndef DISABLE_PV3DVIEWER /*! Constructor. @@ -54,7 +47,6 @@ LightApp_PV3DSelector::LightApp_PV3DSelector( SPV3D_ViewModel* viewer, SUIT_Sele : SUIT_Selector( mgr, viewer ), myViewer( viewer ) { - DBG_FUN(); if ( myViewer ) connect( myViewer, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) ); } @@ -82,7 +74,6 @@ QString LightApp_PV3DSelector::type() const */ void LightApp_PV3DSelector::onSelectionChanged() { - DBG_FUN(); selectionChanged(); } @@ -93,8 +84,6 @@ void LightApp_PV3DSelector::onSelectionChanged() */ void LightApp_PV3DSelector::getSelection( SUIT_DataOwnerPtrList& /*aList*/ ) const { - DBG_FUN(); - if ( !myViewer ) return; @@ -123,8 +112,6 @@ void LightApp_PV3DSelector::getSelection( SUIT_DataOwnerPtrList& /*aList*/ ) con */ void LightApp_PV3DSelector::setSelection( const SUIT_DataOwnerPtrList& theList ) { - DBG_FUN(); - if ( myViewer && ( theList.isEmpty() || myViewer->isSelectionEnabled() )) { //if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()) { diff --git a/src/LightApp/LightApp_Selection.cxx b/src/LightApp/LightApp_Selection.cxx index 7026e4602..813b5e3a9 100644 --- a/src/LightApp/LightApp_Selection.cxx +++ b/src/LightApp/LightApp_Selection.cxx @@ -37,19 +37,12 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_Selection" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ LightApp_Selection::LightApp_Selection() : myStudy( 0 ) { - DBG_FUN(); } /*! @@ -57,7 +50,6 @@ LightApp_Selection::LightApp_Selection() */ LightApp_Selection::~LightApp_Selection() { - DBG_FUN(); } /*! @@ -65,8 +57,6 @@ LightApp_Selection::~LightApp_Selection() */ void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr) { - DBG_FUN(); - ARG(client); myContext = client; if ( mgr ) { @@ -142,7 +132,6 @@ QString LightApp_Selection::referencedToEntry( const QString& entry ) const */ int LightApp_Selection::count() const { - MSGEL("...numSelObjs = " << (int)myObjects.size()); return myObjects.size(); } @@ -191,8 +180,6 @@ QVariant LightApp_Selection::parameter( const int idx, const QString& p ) const //QVariant LightApp_Selection::contextParameter( const QString& p ) const QVariant LightApp_Selection::parameter( const QString& p ) const { - DBG_FUN(); - ARG(p); QVariant v; if ( p == "client" ) @@ -219,9 +206,6 @@ QVariant LightApp_Selection::parameter( const QString& p ) const //QVariant LightApp_Selection::objectParameter( const int idx, const QString& p ) const QVariant LightApp_Selection::parameter( const int idx, const QString& p ) const { - DBG_FUN(); - ARG(idx); - ARG(p); LightApp_Application* app = 0; if ( myStudy ) app = dynamic_cast( myStudy->application() ); @@ -290,8 +274,6 @@ bool LightApp_Selection::processOwner( const LightApp_DataOwner* /*owner*/ ) QString LightApp_Selection::entry( const int index ) const { QVariant v = objectInfo( index, OI_Entry ); - QString qEntry = v.canConvert( QVariant::String ) ? v.toString() : QString(); - MSGEL("LightApp_Selection::entry(index=" << index << ") -> \"" << qEntry.toStdString() << "\""); return v.canConvert( QVariant::String ) ? v.toString() : QString(); } @@ -353,9 +335,6 @@ QVariant LightApp_Selection::objectInfo( const int idx, const int inf ) const */ void LightApp_Selection::setObjectInfo( const int idx, const int inf, const QVariant& val ) { - DBG_FUN(); - ARG(idx); - ARG(inf); if ( 0 <= idx && idx < myObjects.size() ) myObjects[idx].insert( inf, val ); } diff --git a/src/LightApp/LightApp_SelectionMgr.cxx b/src/LightApp/LightApp_SelectionMgr.cxx index 41690c3c5..f3d46befa 100644 --- a/src/LightApp/LightApp_SelectionMgr.cxx +++ b/src/LightApp/LightApp_SelectionMgr.cxx @@ -40,12 +40,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_SelectionMgr" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor. */ @@ -55,7 +49,6 @@ LightApp_SelectionMgr::LightApp_SelectionMgr( LightApp_Application* app, const b myTimeStamp( QTime::currentTime() ), myCacheState( false ) { - DBG_FUN(); } /*! @@ -63,7 +56,6 @@ LightApp_SelectionMgr::LightApp_SelectionMgr( LightApp_Application* app, const b */ LightApp_SelectionMgr::~LightApp_SelectionMgr() { - DBG_FUN(); } /*! @@ -76,7 +68,6 @@ LightApp_Application* LightApp_SelectionMgr::application() const void LightApp_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const bool append ) { - DBG_FUN(); SUIT_SelectionMgr::setSelected( lst, append ); myTimeStamp = QTime::currentTime(); @@ -91,8 +82,6 @@ Handle(SALOME_InteractiveObject) LightApp_SelectionMgr::soleSelectedObject( const QString& theType, const bool convertReferences ) const { - DBG_FUN(); - ARG(theType); SALOME_ListIO list; selectedObjects( list, theType, convertReferences, true ); return list.Extent() == 1 ? list.First() : Handle(SALOME_InteractiveObject)(); @@ -106,8 +95,6 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const bool convertReferences, const bool sole) const { - DBG_FUN(); - ARG(theType); LightApp_Study* study = dynamic_cast( application()->activeStudy() ); if ( !study ) return; @@ -191,7 +178,6 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, */ void LightApp_SelectionMgr::setSelectedObjects( const SALOME_ListIO& lst, const bool append ) { - DBG_FUN(); SUIT_DataOwnerPtrList owners; for ( SALOME_ListIteratorOfListIO it( lst ); it.More(); it.Next() ) { @@ -278,12 +264,10 @@ void LightApp_SelectionMgr::setSelectedObjects( const QStringList& lst, const bo */ void LightApp_SelectionMgr::selectionChanged( SUIT_Selector* theSel ) { - DBG_FUN(); SUIT_SelectionMgr::selectionChanged( theSel ); myTimeStamp = QTime::currentTime(); - MSGEL("-----> emit currentSelectionChanged <-----"); emit currentSelectionChanged(); } @@ -295,7 +279,6 @@ void LightApp_SelectionMgr::selectionChanged( SUIT_Selector* theSel ) void LightApp_SelectionMgr::GetIndexes( const Handle(SALOME_InteractiveObject)& IObject, TColStd_IndexedMapOfInteger& theIndex) { - DBG_FUN(); theIndex.Clear(); SUIT_DataOwnerPtrList aList; @@ -314,8 +297,6 @@ void LightApp_SelectionMgr::GetIndexes( const Handle(SALOME_InteractiveObject)& */ void LightApp_SelectionMgr::GetIndexes( const QString& theEntry, TColStd_IndexedMapOfInteger& theIndex ) { - DBG_FUN(); - ARG(theEntry); theIndex.Clear(); SUIT_DataOwnerPtrList aList; @@ -339,7 +320,6 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj const TColStd_MapOfInteger& theIndexes, bool modeShift) { - DBG_FUN(); SUIT_DataOwnerPtrList remainsOwners; SUIT_DataOwnerPtrList aList; @@ -375,7 +355,6 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj bool append = false; setSelected( remainsOwners, append ); - MSGEL("-----> emit currentSelectionChanged <-----"); emit currentSelectionChanged(); // Bug 17269: To avoid calling of selected(aList) @@ -390,7 +369,6 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject)& IObject, TColStd_IndexedMapOfInteger theIndex, bool append ) { - DBG_FUN(); SUIT_DataOwnerPtrList aList; if ( theIndex.IsEmpty() ) @@ -410,7 +388,6 @@ void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject */ void LightApp_SelectionMgr::selectObjects( MapIOOfMapOfInteger theMapIO, bool append ) { - DBG_FUN(); SUIT_DataOwnerPtrList aList; MapIOOfMapOfInteger::Iterator it(theMapIO); @@ -434,7 +411,6 @@ void LightApp_SelectionMgr::selectObjects( MapIOOfMapOfInteger theMapIO, bool ap */ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap ) { - DBG_FUN(); theMap.Clear(); TColStd_IndexedMapOfInteger anIndexes; @@ -476,7 +452,6 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap ) void LightApp_SelectionMgr::clearSelectionCache() { - DBG_FUN(); myCacheTimes.clear(); myCacheSelection.clear(); } @@ -488,8 +463,6 @@ bool LightApp_SelectionMgr::isSelectionCacheEnabled() const void LightApp_SelectionMgr::setSelectionCacheEnabled( bool on ) { - DBG_FUN(); - ARG(on); if ( myCacheState == on ) return; @@ -503,8 +476,6 @@ void LightApp_SelectionMgr::setSelectionCacheEnabled( bool on ) QList LightApp_SelectionMgr::selectionCache( const QString& type ) const { - DBG_FUN(); - ARG(type); QList res; QStringList types; @@ -559,8 +530,6 @@ QStringList LightApp_SelectionMgr::selectionCache( const QString& type ) const bool LightApp_SelectionMgr::isActualSelectionCache( const QString& type ) const { - DBG_FUN(); - ARG(type); bool ok = true; QStringList types; @@ -577,16 +546,12 @@ bool LightApp_SelectionMgr::isActualSelectionCache( const QString& type ) const QStringList LightApp_SelectionMgr::selectorTypes() const { - DBG_FUN(); QStringList types; QList selectorList; selectors( selectorList ); for ( QList::const_iterator it = selectorList.begin(); it != selectorList.end(); ++it ) { if ( (*it)->isEnabled() ) - { - SHOW((*it)->type()); types.append( (*it)->type() ); - } } return types; } diff --git a/src/LightApp/LightApp_ShowHideOp.cxx b/src/LightApp/LightApp_ShowHideOp.cxx index a8c94f9e2..7930cf385 100644 --- a/src/LightApp/LightApp_ShowHideOp.cxx +++ b/src/LightApp/LightApp_ShowHideOp.cxx @@ -35,12 +35,6 @@ #include #endif -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "LightApp_ShowHideOp" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ @@ -48,7 +42,6 @@ LightApp_ShowHideOp::LightApp_ShowHideOp( ActionType type ) : LightApp_Operation(), myActionType( type ) { - DBG_FUN(); } /*! @@ -56,7 +49,6 @@ LightApp_ShowHideOp::LightApp_ShowHideOp( ActionType type ) */ LightApp_ShowHideOp::~LightApp_ShowHideOp() { - DBG_FUN(); } /*! @@ -64,7 +56,6 @@ LightApp_ShowHideOp::~LightApp_ShowHideOp() */ void LightApp_ShowHideOp::startOperation() { - DBG_FUN(); LightApp_Application* app = dynamic_cast( application() ); LightApp_Study* study = app ? dynamic_cast( app->activeStudy() ) : 0; if( !app || !study ) diff --git a/src/LightApp/MBDebug.h b/src/LightApp/MBDebug.h deleted file mode 100644 index d52b73d27..000000000 --- a/src/LightApp/MBDebug.h +++ /dev/null @@ -1,258 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const QStringList &value) -{ - DLOG << "[QStrLst]: " << szName << "=[len=" << value.length() << "] {"; - bool first = true; - QStringList::const_iterator it = value.constBegin(); - for ( ; it != value.constEnd(); ++it) - { - DLOG << (first ? "" : ",") << "\"" << (*it).toStdString() << "\""; - first = false; - } - DLOG << "}" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/LightApp/MBSUIT.h b/src/LightApp/MBSUIT.h deleted file mode 100644 index 2212c7b3a..000000000 --- a/src/LightApp/MBSUIT.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef MBSUIT_H -#define MBSUIT_H - -#include - - -//========================================================================== -static void DumpVar(const char *szName, const SUIT_DataObject *value) { - if (value) { - DLOG << "[DataObj]: " << szName << "=" << (void*)value << " name=\"" << value->name().toStdString() << "\" level=" << value->level() - << " pos=" << value->position() << " #child=" << value->childCount() << " what=\"" << value->whatsThis().toStdString() << "\"" << std::endl; - } - else { - DLOG << "[DataObj]: " << szName << "=null" << std::endl; - } -} - -#endif // MBSUIT_H \ No newline at end of file diff --git a/src/OCCViewer/MBDebug.h b/src/OCCViewer/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/OCCViewer/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/OCCViewer/OCCViewer_AISSelector.cxx b/src/OCCViewer/OCCViewer_AISSelector.cxx index 6b551f47a..a878ec89f 100644 --- a/src/OCCViewer/OCCViewer_AISSelector.cxx +++ b/src/OCCViewer/OCCViewer_AISSelector.cxx @@ -22,12 +22,6 @@ #include "OCCViewer_AISSelector.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "OCCViewer_AISSelector" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ @@ -38,7 +32,6 @@ OCCViewer_AISSelector::OCCViewer_AISSelector( QObject* parent, myEnableSelection( true ), myEnableMultipleSelection( true ) { - DBG_FUN(); myHilightColor = Quantity_NOC_CYAN1; mySelectColor = Quantity_NOC_GRAY80; @@ -50,7 +43,6 @@ OCCViewer_AISSelector::OCCViewer_AISSelector( QObject* parent, */ OCCViewer_AISSelector::~OCCViewer_AISSelector() { - DBG_FUN(); } /*! @@ -58,8 +50,6 @@ OCCViewer_AISSelector::~OCCViewer_AISSelector() */ void OCCViewer_AISSelector::enableSelection( bool bEnable ) { - DBG_FUN(); - ARG(bEnable); myEnableSelection = bEnable; } @@ -69,8 +59,6 @@ void OCCViewer_AISSelector::enableSelection( bool bEnable ) */ void OCCViewer_AISSelector::enableMultipleSelection( bool bEnable ) { - DBG_FUN(); - ARG(bEnable); myEnableMultipleSelection = bEnable; if ( bEnable ) myEnableSelection = bEnable; } @@ -104,7 +92,6 @@ void OCCViewer_AISSelector::setSelectColor ( Quantity_NameOfColor color ) */ void OCCViewer_AISSelector::setAISContext ( const Handle (AIS_InteractiveContext)& aisContext ) { - DBG_FUN(); myAISContext = aisContext; if ( ! myAISContext.IsNull() ) { const Handle(Prs3d_Drawer)& hStyle = myAISContext->HighlightStyle(); @@ -171,7 +158,6 @@ bool OCCViewer_AISSelector::select () if ( !myEnableSelection ) return false; - DBG_FUN(); bool hadSelection = ( myNumSelected > 0 ); /* select and send notifications */ @@ -192,7 +178,6 @@ bool OCCViewer_AISSelector::select ( int left, int top, int right, int bottom, if ( !myEnableSelection || !myEnableMultipleSelection ) return false; /* selection with rectangle is considered as multiple selection */ - DBG_FUN(); bool hadSelection = ( myNumSelected > 0 ); /* select and send notifications */ @@ -213,7 +198,6 @@ bool OCCViewer_AISSelector::shiftSelect () if ( !myEnableSelection ) return false; - DBG_FUN(); bool hadSelection = ( myNumSelected > 0 ); /* something was selected */ if ( hadSelection && !myEnableMultipleSelection) return false; @@ -238,7 +222,6 @@ bool OCCViewer_AISSelector::shiftSelect ( int left, int top, int right, int bott if ( !myEnableSelection || !myEnableMultipleSelection ) return false; /* selection with rectangle is considered as multiple selection */ - DBG_FUN(); bool hadSelection = ( myNumSelected > 0 ); /* something was selected */ if ( hadSelection && !myEnableMultipleSelection) return false; diff --git a/src/OCCViewer/OCCViewer_VService.cxx b/src/OCCViewer/OCCViewer_VService.cxx index 66c046e11..3d95c2b02 100644 --- a/src/OCCViewer/OCCViewer_VService.cxx +++ b/src/OCCViewer/OCCViewer_VService.cxx @@ -38,19 +38,12 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "OCCViewer_VService" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Create native view window for CasCade view [ static ] */ Handle(Aspect_Window) OCCViewer_VService::CreateWindow( const Handle(V3d_View)& view, WId winId ) { - DBG_FUNC(); #if OCC_VERSION_LARGE < 0x07070000 Aspect_Handle aWindowHandle = (Aspect_Handle)winId; #else @@ -73,7 +66,6 @@ Handle(Aspect_Window) OCCViewer_VService::CreateWindow( const Handle(V3d_View)& */ Handle(V3d_Viewer) OCCViewer_VService::CreateViewer() { - DBG_FUNC(); Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver(new Aspect_DisplayConnection()); return new V3d_Viewer(aGraphicDriver); diff --git a/src/OCCViewer/OCCViewer_ViewFrame.cxx b/src/OCCViewer/OCCViewer_ViewFrame.cxx index c01e6b1d4..dd48c0551 100644 --- a/src/OCCViewer/OCCViewer_ViewFrame.cxx +++ b/src/OCCViewer/OCCViewer_ViewFrame.cxx @@ -36,16 +36,9 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "OCCViewer_ViewFrame" -#include "MBDebug.h" -//--------------------------------------------------------- - OCCViewer_ViewFrame::OCCViewer_ViewFrame(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel) : OCCViewer_ViewWindow( theDesktop, theModel ), mySplitMode(-1), myPopupRequestedView(0) { - DBG_FUN(); QFrame* centralFrame = new QFrame( this ); setCentralWidget( centralFrame ); @@ -66,7 +59,6 @@ OCCViewer_ViewFrame::OCCViewer_ViewFrame(SUIT_Desktop* theDesktop, OCCViewer_Vie OCCViewer_ViewFrame::~OCCViewer_ViewFrame() { - DBG_FUN(); } bool OCCViewer_ViewFrame::event( QEvent* e ) @@ -95,7 +87,6 @@ OCCViewer_ViewWindow* OCCViewer_ViewFrame::getActiveView( ) const //************************************************************************************** void OCCViewer_ViewFrame::setViewManager( SUIT_ViewManager* theMgr ) { - DBG_FUN(); OCCViewer_ViewWindow::setViewManager(theMgr); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setViewManager(theMgr); @@ -105,7 +96,6 @@ void OCCViewer_ViewFrame::setViewManager( SUIT_ViewManager* theMgr ) //************************************************************************************** void OCCViewer_ViewFrame::returnTo3dView() { - DBG_FUN(); OCCViewer_ViewWindow* view = 0; for (int i = BOTTOM_RIGHT; i <= TOP_RIGHT; i++ ) { view = myViews.at(i); @@ -127,7 +117,6 @@ void OCCViewer_ViewFrame::returnTo3dView() //************************************************************************************** void OCCViewer_ViewFrame::onMaximizedView( OCCViewer_ViewWindow* theView, bool isMaximized) { - DBG_FUN(); myMaximizedView = theView; myActiveView = theView; if (isMaximized) { @@ -163,7 +152,6 @@ void OCCViewer_ViewFrame::onMaximizedView( OCCViewer_ViewWindow* theView, bool i //************************************************************************************** void OCCViewer_ViewFrame::createSubViews() { - DBG_FUN(); OCCViewer_Viewer* aModel = dynamic_cast(myManager->getViewModel()); if (!aModel) return; int i = 0; @@ -190,7 +178,6 @@ void OCCViewer_ViewFrame::createSubViews() //************************************************************************************** void OCCViewer_ViewFrame::setSubViewParams( OCCViewer_ViewWindow* theView ) { - DBG_FUN(); Handle(V3d_View) aView = theView->getViewPort()->getView(); Handle(V3d_View) aMainView = myViews.at( MAIN_VIEW )->getViewPort()->getView(); @@ -203,7 +190,6 @@ void OCCViewer_ViewFrame::setSubViewParams( OCCViewer_ViewWindow* theView ) void OCCViewer_ViewFrame::splitSubViews() { - DBG_FUN(); if( mySplitMode == -1 ) return; @@ -331,7 +317,6 @@ void OCCViewer_ViewFrame::updateEnabledDrawMode() void OCCViewer_ViewFrame::setCuttingPlane( bool on, const double x , const double y , const double z, const double dx, const double dy, const double dz) { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setCuttingPlane(on, x, y, z, dx, dy, dz); aView->update(); @@ -341,7 +326,6 @@ void OCCViewer_ViewFrame::setCuttingPlane( bool on, const double x , const doubl //************************************************************************************** void OCCViewer_ViewFrame::setCuttingPlane( bool on, const gp_Pln thePln ) { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setCuttingPlane(on, thePln); aView->update(); @@ -351,7 +335,6 @@ void OCCViewer_ViewFrame::setCuttingPlane( bool on, const gp_Pln thePln ) //************************************************************************************** void OCCViewer_ViewFrame::setInteractionStyle( const int i ) { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setInteractionStyle(i); } @@ -366,7 +349,6 @@ int OCCViewer_ViewFrame::projectionType() const //************************************************************************************** void OCCViewer_ViewFrame::setProjectionType( int t) { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setProjectionType(t); } @@ -381,7 +363,6 @@ OCCViewer_ViewWindow::SelectionStyle OCCViewer_ViewFrame::selectionStyle() const //************************************************************************************** void OCCViewer_ViewFrame::setSelectionStyle(OCCViewer_ViewWindow::SelectionStyle t) { - DBG_FUN(); foreach(OCCViewer_ViewWindow* aView, myViews) { aView->setSelectionStyle(t); } @@ -396,7 +377,6 @@ int OCCViewer_ViewFrame::stereoType() const //************************************************************************************** void OCCViewer_ViewFrame::setStereoType( int t) { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setStereoType(t); } @@ -479,7 +459,6 @@ bool OCCViewer_ViewFrame::isVSync() const //************************************************************************************** void OCCViewer_ViewFrame::setVSync( bool t) { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setVSync(t); } @@ -494,7 +473,6 @@ bool OCCViewer_ViewFrame::isQuadBufferSupport() const //************************************************************************************** void OCCViewer_ViewFrame::setQuadBufferSupport( bool t) { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->setQuadBufferSupport(t); } @@ -511,7 +489,6 @@ void OCCViewer_ViewFrame::setZoomingStyle( const int i ) //************************************************************************************** void OCCViewer_ViewFrame::connectViewSignals(OCCViewer_ViewWindow* theView) { - DBG_FUN(); connect( theView, SIGNAL( returnedTo3d( ) ), this, SLOT( returnTo3dView( ) ) ); connect( theView, SIGNAL( maximized( OCCViewer_ViewWindow*, bool ) ), @@ -551,7 +528,6 @@ void OCCViewer_ViewFrame::connectViewSignals(OCCViewer_ViewWindow* theView) // obsolete void OCCViewer_ViewFrame::setBackgroundColor( const QColor& theColor ) { - DBG_FUN(); if (myPopupRequestedView) myPopupRequestedView->setBackgroundColor(theColor); else { @@ -563,7 +539,6 @@ void OCCViewer_ViewFrame::setBackgroundColor( const QColor& theColor ) } void OCCViewer_ViewFrame::setBackground( const Qtx::BackgroundData& theBackground ) { - DBG_FUN(); if (myPopupRequestedView) myPopupRequestedView->setBackground(theBackground); else { @@ -576,7 +551,6 @@ void OCCViewer_ViewFrame::setBackground( const Qtx::BackgroundData& theBackgroun void OCCViewer_ViewFrame::onViewFitAll() { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->onViewFitAll(); } @@ -584,7 +558,6 @@ void OCCViewer_ViewFrame::onViewFitAll() void OCCViewer_ViewFrame::onFitAll() { - DBG_FUN(); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->onFitAll(); } @@ -666,7 +639,6 @@ void OCCViewer_ViewFrame::onDumpView() void OCCViewer_ViewFrame::setDropDownButtons( bool on ) { - DBG_FUN(); foreach( OCCViewer_ViewWindow* aView, myViews ) { aView->setDropDownButtons( on ); } @@ -697,7 +669,6 @@ QString OCCViewer_ViewFrame::getVisualParameters() void OCCViewer_ViewFrame::setVisualParameters( const QString& parameters ) { - DBG_FUN(); QStringList params = parameters.split( "|" ); if ( params.count() > 1 ) { int maximizedView = params[0].toInt(); @@ -755,8 +726,6 @@ void OCCViewer_ViewFrame::updateWindowTitle(OCCViewer_ViewWindow* theView) void OCCViewer_ViewFrame::enableSelection( bool isEnabled ) { - DBG_FUN(); - ARG(isEnabled); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->enableSelection(isEnabled); } @@ -764,8 +733,6 @@ void OCCViewer_ViewFrame::enableSelection( bool isEnabled ) void OCCViewer_ViewFrame::enablePreselection( bool isEnabled ) { - DBG_FUN(); - ARG(isEnabled); foreach (OCCViewer_ViewWindow* aView, myViews) { aView->enablePreselection(isEnabled); } @@ -773,8 +740,6 @@ void OCCViewer_ViewFrame::enablePreselection( bool isEnabled ) bool OCCViewer_ViewFrame::enableDrawMode( bool on ) { - DBG_FUN(); - ARG(on); bool prev = false; foreach (OCCViewer_ViewWindow* aView, myViews) { prev = prev || aView->enableDrawMode( on ); diff --git a/src/OCCViewer/OCCViewer_ViewManager.cxx b/src/OCCViewer/OCCViewer_ViewManager.cxx index b65ccbe28..6920741f4 100644 --- a/src/OCCViewer/OCCViewer_ViewManager.cxx +++ b/src/OCCViewer/OCCViewer_ViewManager.cxx @@ -24,12 +24,6 @@ #include "OCCViewer_ViewWindow.h" #include "SUIT_Desktop.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "OCCViewer_ViewManager" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ @@ -37,7 +31,6 @@ OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* t : SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron ) ), myIsChainedOperations( false ) { - DBG_FUN(); setTitle( tr( "OCC_VIEW_TITLE" ) ); } @@ -46,7 +39,6 @@ OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* t */ OCCViewer_ViewManager::~OCCViewer_ViewManager() { - DBG_FUN(); } /*! @@ -55,7 +47,6 @@ OCCViewer_ViewManager::~OCCViewer_ViewManager() */ void OCCViewer_ViewManager::contextMenuPopup( QMenu* popup ) { - DBG_FUN(); SUIT_ViewManager::contextMenuPopup( popup ); // if it is necessary invoke method CreatePopup of ViewPort // be sure that existing QPopupMenu menu is used for that. @@ -68,7 +59,5 @@ bool OCCViewer_ViewManager::isChainedOperations() const void OCCViewer_ViewManager::setChainedOperations( bool isChainedOperations ) { - DBG_FUN(); - ARG(isChainedOperations); myIsChainedOperations = isChainedOperations; } diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index eea57c353..f57115479 100644 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -69,12 +69,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "OCCViewer_ViewModel" -#include "MBDebug.h" -//--------------------------------------------------------- - namespace { void setCappingColor(const Handle(Graphic3d_ClipPlane)& plane, const QColor& color) @@ -135,7 +129,6 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron) myClippingDlg(0), myFitter(0) { - DBG_FUN(); // init CasCade viewers myV3dViewer = OCCViewer_VService::CreateViewer(); //myV3dViewer->Init(); // to avoid creation of the useless perspective view (see OCCT issue 0024267) @@ -222,7 +215,6 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron) */ OCCViewer_Viewer::~OCCViewer_Viewer() { - DBG_FUN(); myAISContext.Nullify(); myV3dViewer.Nullify(); } @@ -250,7 +242,6 @@ Qtx::BackgroundData OCCViewer_Viewer::background() const */ void OCCViewer_Viewer::setBackgroundColor( const QColor& c ) { - DBG_FUN(); setBackgroundColor( 0, c ); } @@ -260,7 +251,6 @@ void OCCViewer_Viewer::setBackgroundColor( const QColor& c ) */ void OCCViewer_Viewer::setBackground( const Qtx::BackgroundData& theBackground ) { - DBG_FUN(); setBackground( 0, theBackground ); } @@ -270,7 +260,6 @@ void OCCViewer_Viewer::setBackground( const Qtx::BackgroundData& theBackground ) */ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view ) { - DBG_FUN(); if ( view ) { view->initLayout(); view->initSketchers(); @@ -304,7 +293,6 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view ) */ SUIT_ViewWindow* OCCViewer_Viewer::createView( SUIT_Desktop* theDesktop ) { - DBG_FUN(); // create view frame OCCViewer_ViewFrame* view = new OCCViewer_ViewFrame(theDesktop, this); // get main view window (created by view frame) @@ -323,7 +311,6 @@ SUIT_ViewWindow* OCCViewer_Viewer::createView( SUIT_Desktop* theDesktop ) */ void OCCViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager) { - DBG_FUN(); SUIT_ViewModel::setViewManager(theViewManager); if (theViewManager) { connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), @@ -380,7 +367,6 @@ void OCCViewer_Viewer::onMouseMove(SUIT_ViewWindow* theWindow, QMouseEvent* theE */ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* theEvent) { - DBG_FUN(); if (!mySelectionEnabled) return; if (theEvent->button() != Qt::LeftButton) return; if (!theWindow->inherits("OCCViewer_ViewWindow")) return; @@ -396,7 +382,6 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t { if (!aHasShift) { myAISContext->ClearCurrents( false ); // todo: ClearCurrents is deprecated - MSGEL("-----> emit deselection <-----"); emit deselection(); } if ( !isPreselectionEnabled() ) { @@ -410,7 +395,6 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t myAISContext->ShiftSelect( Standard_True ); else myAISContext->Select( Standard_True ); - MSGEL("-----> emit selectionChanged <-----"); emit selectionChanged(); } @@ -457,7 +441,6 @@ void OCCViewer_Viewer::onKeyPress(SUIT_ViewWindow* theWindow, QKeyEvent* theEven case Qt::Key_S: if (!aHasShift) { myAISContext->ClearCurrents( false ); // todo: ClearCurrents is deprecated - MSGEL("-----> emit deselection <-----"); emit deselection(); } @@ -473,7 +456,6 @@ void OCCViewer_Viewer::onKeyPress(SUIT_ViewWindow* theWindow, QKeyEvent* theEven else myAISContext->Select( Standard_True ); - MSGEL("-----> emit selectionChanged <-----"); emit selectionChanged(); break; @@ -494,7 +476,6 @@ void OCCViewer_Viewer::onKeyPress(SUIT_ViewWindow* theWindow, QKeyEvent* theEven void OCCViewer_Viewer::onViewClosed(OCCViewer_ViewPort3d*) { - DBG_FUN(); Standard_Integer aViewsNb = 0; for ( myV3dViewer->InitActiveViews(); myV3dViewer->MoreActiveViews(); myV3dViewer->NextActiveViews()) ++aViewsNb; @@ -506,8 +487,6 @@ void OCCViewer_Viewer::onViewClosed(OCCViewer_ViewPort3d*) void OCCViewer_Viewer::onViewMapped(OCCViewer_ViewPort3d* viewPort) { - DBG_FUN(); - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); setTrihedronShown( true ); @@ -543,7 +522,6 @@ int OCCViewer_Viewer::interactionStyle() const */ void OCCViewer_Viewer::setInteractionStyle( const int theStyle ) { - DBG_FUN(); myInteractionStyle = theStyle; //!! To be done for view windows if ( !myViewManager ) @@ -572,7 +550,6 @@ int OCCViewer_Viewer::projectionType() const */ void OCCViewer_Viewer::setProjectionType( const int theType ) { - DBG_FUN(); if ( myProjectionType != theType ) { if ( theType != OCCViewer_ViewWindow::Stereo ) myProjectionType = theType; @@ -598,7 +575,6 @@ OCCViewer_ViewWindow::SelectionStyle OCCViewer_Viewer::selectionStyle() const void OCCViewer_Viewer::setSelectionStyle(OCCViewer_ViewWindow::SelectionStyle theMode) { - DBG_FUN(); if (mySelectionStyle != theMode) { mySelectionStyle = theMode; if (!myViewManager) @@ -630,7 +606,6 @@ int OCCViewer_Viewer::stereoType() const */ void OCCViewer_Viewer::setStereoType( const int theType ) { - DBG_FUN(); myStereoType = theType; if ( !myViewManager ) @@ -791,7 +766,6 @@ bool OCCViewer_Viewer::isVSync() const */ void OCCViewer_Viewer::setVSync( const bool theEnable ) { - DBG_FUN(); myVSyncMode = theEnable; if ( !myViewManager ) @@ -820,7 +794,6 @@ bool OCCViewer_Viewer::isQuadBufferSupport() const */ void OCCViewer_Viewer::setQuadBufferSupport( const bool theEnable ) { - DBG_FUN(); myQuadBufferSupport = theEnable; if ( !myViewManager ) @@ -877,7 +850,6 @@ bool OCCViewer_Viewer::isPreselectionEnabled() const */ void OCCViewer_Viewer::enablePreselection(bool isEnabled) { - DBG_FUN(); myPreselectionEnabled = isEnabled; if ( !myViewManager ) @@ -907,7 +879,6 @@ bool OCCViewer_Viewer::isSelectionEnabled() const */ void OCCViewer_Viewer::enableSelection(bool isEnabled) { - DBG_FUN(); mySelectionEnabled = isEnabled; //!! To be done for view windows @@ -938,7 +909,6 @@ void OCCViewer_Viewer::enableSelection(bool isEnabled) */ void OCCViewer_Viewer::enableMultiselection(bool isEnable) { - DBG_FUN(); myMultiSelectionEnabled = isEnable; //!! To be done for view windows if ( !myViewManager ) @@ -1004,7 +974,6 @@ Handle(Graphic3d_Texture2Dmanual) initClippingTexture( const bool isDefault, con void OCCViewer_Viewer::setClippingTextureParams( const bool isDefault, const QString& theTexture, const bool isModulate, const double theScale ) { - DBG_FUN(); myDefaultTextureUsed = isDefault; myClippingTexture = theTexture; myTextureModulated = isModulate; @@ -1059,7 +1028,6 @@ double OCCViewer_Viewer::clippingTextureScale() const */ void OCCViewer_Viewer::contextMenuPopup(QMenu* thePopup) { - DBG_FUN(); thePopup->addAction( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) ); thePopup->addAction( tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) ); @@ -1091,7 +1059,6 @@ void OCCViewer_Viewer::onDumpView() */ void OCCViewer_Viewer::onChangeBackground() { - DBG_FUN(); OCCViewer_ViewWindow* aView = dynamic_cast(myViewManager->getActiveView()); if ( !aView ) return; @@ -1123,7 +1090,6 @@ void OCCViewer_Viewer::onChangeBackground() */ void OCCViewer_Viewer::update() { - DBG_FUN(); if (!myV3dViewer.IsNull()) myV3dViewer->Update(); @@ -1149,7 +1115,6 @@ void OCCViewer_Viewer::getSelectedObjects(AIS_ListOfInteractive& theList) */ void OCCViewer_Viewer::setObjectsSelected(const AIS_ListOfInteractive& theList) { - DBG_FUN(); AIS_ListIteratorOfListOfInteractive aIt; for (aIt.Initialize(theList); aIt.More(); aIt.Next()) myAISContext->AddOrRemoveSelected(aIt.Value(), false); @@ -1161,7 +1126,6 @@ void OCCViewer_Viewer::setObjectsSelected(const AIS_ListOfInteractive& theList) */ void OCCViewer_Viewer::performSelectionChanged() { - MSGEL("-----> emit selectionChanged <-----"); emit selectionChanged(); } @@ -1170,7 +1134,6 @@ void OCCViewer_Viewer::performSelectionChanged() */ void OCCViewer_Viewer::setDefaultLights() { - DBG_FUN(); // clear all light sources myV3dViewer->InitDefinedLights(); while ( myV3dViewer->MoreDefinedLights() ) @@ -1270,7 +1233,6 @@ void OCCViewer_Viewer::setColor( const Handle(AIS_InteractiveObject)& obj, const QColor& color, bool update ) { - DBG_FUN(); if( !obj.IsNull() ) { Quantity_Color CSFColor = Quantity_Color ( color.red() / 255., @@ -1293,7 +1255,6 @@ void OCCViewer_Viewer::setColor( const Handle(AIS_InteractiveObject)& obj, void OCCViewer_Viewer::switchRepresentation( const Handle(AIS_InteractiveObject)& obj, int mode, bool update ) { - DBG_FUN(); myAISContext->SetDisplayMode( obj, (Standard_Integer)mode, update ); if( update ) myV3dViewer->Update(); @@ -1308,7 +1269,6 @@ void OCCViewer_Viewer::switchRepresentation( const Handle(AIS_InteractiveObject) void OCCViewer_Viewer::setTransparency( const Handle(AIS_InteractiveObject)& obj, float trans, bool update ) { - DBG_FUN(); myAISContext->SetTransparency( obj, trans, false ); myAISContext->Redisplay( obj, Standard_False, Standard_True ); if( update ) @@ -1499,7 +1459,6 @@ void OCCViewer_Viewer::isos( int& u, int& v ) const */ OCCViewer_ViewWindow* OCCViewer_Viewer::createSubWindow() { - DBG_FUN(); return new OCCViewer_ViewWindow(0, this); } @@ -1643,7 +1602,6 @@ void OCCViewer_Viewer::setSelectionOptions( bool isPreselectionEnabled, bool isS */ Handle(Graphic3d_ClipPlane) OCCViewer_Viewer::createClipPlane(const gp_Pln& thePlane, const Standard_Boolean theIsOn) { - DBG_FUN(); Handle(Graphic3d_ClipPlane) aGraphic3dPlane = new Graphic3d_ClipPlane( thePlane ); aGraphic3dPlane->SetOn( theIsOn ); aGraphic3dPlane->SetCapping( Standard_True ); @@ -1662,7 +1620,6 @@ Handle(Graphic3d_ClipPlane) OCCViewer_Viewer::createClipPlane(const gp_Pln& theP */ void OCCViewer_Viewer::setClipPlanes(ClipPlanesList theList) { - DBG_FUN(); // 1. Remove existing clipping planes myClipPlanes.clear(); myInternalClipPlanes.Clear(); @@ -1733,9 +1690,6 @@ void OCCViewer_Viewer::setClippingDlg(OCCViewer_ClippingDlg* theDlg) { bool OCCViewer_Viewer::enableDrawMode( bool on ) { - DBG_FUN(); - ARG(on); - //!! To be done for view windows if ( !myViewManager ) return false; diff --git a/src/OCCViewer/OCCViewer_ViewPort.cxx b/src/OCCViewer/OCCViewer_ViewPort.cxx index ed46e3b04..9316db567 100644 --- a/src/OCCViewer/OCCViewer_ViewPort.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort.cxx @@ -50,12 +50,6 @@ #undef QT_CLEAN_NAMESPACE #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "OCCViewer_ViewPort" -#include "MBDebug.h" -//--------------------------------------------------------- - struct CMapEntry { CMapEntry(); @@ -191,7 +185,6 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) OCCViewer_ViewPort::OCCViewer_ViewPort( QWidget* parent ) : QWidget( parent ) { - DBG_FUN(); initialize(); } @@ -200,7 +193,6 @@ OCCViewer_ViewPort::OCCViewer_ViewPort( QWidget* parent ) */ OCCViewer_ViewPort::~OCCViewer_ViewPort() { - DBG_FUN(); cleanup(); } @@ -209,7 +201,6 @@ OCCViewer_ViewPort::~OCCViewer_ViewPort() */ void OCCViewer_ViewPort::initialize() { - DBG_FUN(); myPaintersRedrawing = false; myEnableSketching = true; myEnableTransform = true; @@ -227,7 +218,6 @@ void OCCViewer_ViewPort::initialize() */ void OCCViewer_ViewPort::cleanup() { - DBG_FUN(); } /*! @@ -235,7 +225,6 @@ void OCCViewer_ViewPort::cleanup() */ void OCCViewer_ViewPort::selectVisualId() { - DBG_FUN(); #if !defined WIN32 && !defined __APPLE__ XVisualInfo* pVisualInfo; if ( QX11Info::display() ) @@ -337,7 +326,6 @@ void OCCViewer_ViewPort::selectVisualId() */ void OCCViewer_ViewPort::setBackgroundColor( const QColor& color ) { - DBG_FUN(); QPalette pal = palette(); pal.setColor( QPalette::Background, color ); setPalette( pal ); @@ -366,7 +354,6 @@ bool OCCViewer_ViewPort::isSketchingEnabled() const */ void OCCViewer_ViewPort::setSketchingEnabled( bool enable ) { - DBG_FUN(); myEnableSketching = enable; } @@ -384,7 +371,6 @@ bool OCCViewer_ViewPort::isTransformEnabled() const */ void OCCViewer_ViewPort::setTransformEnabled( bool enable ) { - DBG_FUN(); myEnableTransform = enable; } @@ -488,7 +474,6 @@ bool OCCViewer_ViewPort::synchronize( OCCViewer_ViewPort* ) */ void OCCViewer_ViewPort::onChangeBackground() { - DBG_FUN(); QColor selColor = QColorDialog::getColor ( backgroundColor(), this ); if ( selColor.isValid() ) setBackgroundColor( selColor ); diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index cd7a35328..73c60da4f 100644 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -50,12 +50,6 @@ //#include #endif -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "OCCViewer_ViewPort3d" -#include "MBDebug.h" -//--------------------------------------------------------- - static double rx = 0.; static double ry = 0.; static int sx = 0; @@ -73,7 +67,6 @@ OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_V myScale( 1.0 ), myIsAdvancedZoomingEnabled( false ) { - DBG_FUN(); // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit //selectVisualId(); @@ -89,7 +82,6 @@ OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_V */ OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d() { - DBG_FUN(); if ( myCursor ) { delete myCursor; @@ -125,7 +117,6 @@ OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d() */ bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view ) { - DBG_FUN(); if ( !setWindow( view ) ) return false; @@ -147,7 +138,6 @@ bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view ) */ Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view ) { - DBG_FUN(); /* map the new view */ if ( view == activeView() || !mapView( view ) ) return activeView(); @@ -261,7 +251,6 @@ QColor OCCViewer_ViewPort3d::backgroundColor() const */ void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color ) { - DBG_FUN(); Qtx::BackgroundData bg = background(); bg.setColor( color ); setBackground( bg ); @@ -280,7 +269,6 @@ Qtx::BackgroundData OCCViewer_ViewPort3d::background() const */ void OCCViewer_ViewPort3d::setBackground( const Qtx::BackgroundData& bgData ) { - DBG_FUN(); if ( bgData.isValid() ) { myBackground = bgData; updateBackground(); @@ -290,7 +278,6 @@ void OCCViewer_ViewPort3d::setBackground( const Qtx::BackgroundData& bgData ) void OCCViewer_ViewPort3d::updateBackground() { - DBG_FUN(); if ( activeView().IsNull() ) return; if ( !myBackground.isValid() ) return; @@ -391,7 +378,6 @@ void OCCViewer_ViewPort3d::updateBackground() */ void OCCViewer_ViewPort3d::onUpdate() { - DBG_FUN(); if ( !activeView().IsNull() ) activeView()->Update(); } @@ -401,7 +387,6 @@ void OCCViewer_ViewPort3d::onUpdate() */ void OCCViewer_ViewPort3d::fitRect( const QRect& rect ) { - DBG_FUN(); if ( !activeView().IsNull() ) { activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() ); emit vpTransformed( this ); @@ -574,7 +559,6 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e ) */ void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e ) { - DBG_FUN(); /* Map before first show to avoid flicker */ if ( !mapped( activeView() ) ) mapView( activeView() ); @@ -597,7 +581,6 @@ void OCCViewer_ViewPort3d::repaintViewAfterMove( ) */ void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool /*withZ*/, bool upd ) { - DBG_FUN(); if ( activeView().IsNull() ) return; @@ -656,7 +639,6 @@ void OCCViewer_ViewPort3d::setAxialScale( double xScale, double yScale, double z */ bool OCCViewer_ViewPort3d::setWindow( const Handle(V3d_View)& view ) { - DBG_FUN(); if ( !myWindow.IsNull() ) return true; @@ -672,7 +654,6 @@ bool OCCViewer_ViewPort3d::setWindow( const Handle(V3d_View)& view ) void OCCViewer_ViewPort3d::attachWindow( const Handle(V3d_View)& view, const Handle(Aspect_Window)& window) { - DBG_FUN(); if (!view.IsNull()) { view->SetWindow( window ); updateBackground(); @@ -710,7 +691,6 @@ bool OCCViewer_ViewPort3d::mapped( const Handle(V3d_View)& view ) const */ bool OCCViewer_ViewPort3d::synchronize( OCCViewer_ViewPort* view ) { - DBG_FUN(); bool ok = false; OCCViewer_ViewPort3d* vp3d = qobject_cast( view ); if ( vp3d ) { @@ -768,7 +748,6 @@ QCursor* OCCViewer_ViewPort3d::getDefaultCursor() const */ void OCCViewer_ViewPort3d::setDefaultParams() { - DBG_FUN(); setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background // get ray tracing parameters from preferences diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 9ba4760ef..94a9f8a08 100644 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -97,12 +97,6 @@ #include "utilities.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "OCCViewer_ViewWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - // // OpenCV includes // #include // #include @@ -257,7 +251,6 @@ OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel ) : SUIT_ViewWindow( theDesktop ) { - DBG_FUN(); myModel = theModel; myRestoreFlag = 0; myEnableDrawMode = false; @@ -291,7 +284,6 @@ OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop* theDesktop, */ OCCViewer_ViewWindow::~OCCViewer_ViewWindow() { - DBG_FUN(); endDrawRect(); qDeleteAll( mySketchers ); } @@ -301,7 +293,6 @@ OCCViewer_ViewWindow::~OCCViewer_ViewWindow() */ void OCCViewer_ViewWindow::initLayout() { - DBG_FUN(); myViewPort = new OCCViewer_ViewPort3d( this, myModel->getViewer3d(), V3d_ORTHOGRAPHIC ); myViewPort->installEventFilter(this); setCentralWidget(myViewPort); @@ -394,7 +385,6 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e ) return true; case QEvent::MouseButtonDblClick: - MSGEL("-----> emit mouseDoubleClicked <-----"); emit mouseDoubleClicked(this, (QMouseEvent*)e); return true; @@ -413,7 +403,6 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e ) } } else { - MSGEL("-----> emit vpTransformationStarted(ZOOMVIEW) <-----"); emit vpTransformationStarted ( ZOOMVIEW ); myViewPort->startZoomAtPoint( aEvent->x(), aEvent->y() ); double delta = (double)( aEvent->delta() ) / ( 15 * 8 ); @@ -422,7 +411,6 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e ) int x1 = (int)( aEvent->x() + width()*delta/100 ); int y1 = (int)( aEvent->y() + height()*delta/100 ); myViewPort->zoom( x, y, x1, y1 ); - MSGEL("-----> emit vpTransformationFinished(ZOOMVIEW) <-----"); emit vpTransformationFinished ( ZOOMVIEW ); } } @@ -432,7 +420,6 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e ) { QContextMenuEvent * aEvent = (QContextMenuEvent*)e; if ( aEvent->reason() != QContextMenuEvent::Mouse ) - MSGEL("-----> emit contextMenuRequest <-----"); emit contextMenuRequested( aEvent ); } return true; @@ -457,7 +444,6 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e ) */ bool OCCViewer_ViewWindow::enableDrawMode( bool on ) { - DBG_FUN(); bool prev = myDrawRectEnabled; myDrawRectEnabled = on; updateEnabledDrawMode(); @@ -480,7 +466,6 @@ void OCCViewer_ViewWindow::updateEnabledDrawMode() */ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent ) { - DBG_FUN(); myStartX = theEvent->x(); myStartY = theEvent->y(); int anInteractionStyle = interactionStyle(); @@ -703,7 +688,6 @@ void OCCViewer_ViewWindow::activateRotation() */ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, double& theZ ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); // Project boundaries points and add to avergae gravity @@ -794,7 +778,6 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou */ void OCCViewer_ViewWindow::activateSetRotationGravity() { - DBG_FUN(); if ( myRotationPointSelection ) { Handle(AIS_InteractiveContext) ic = myModel->getAISContext(); @@ -820,7 +803,6 @@ void OCCViewer_ViewWindow::activateSetRotationGravity() */ void OCCViewer_ViewWindow::updateGravityCoords() { - DBG_FUN(); if ( mySetRotationPointDlg && mySetRotationPointDlg->isVisible() && myCurrPointType == BBCENTER ) { Standard_Real Xcenter, Ycenter, Zcenter; @@ -916,7 +898,6 @@ void OCCViewer_ViewWindow::activateGlobalPanning() */ void OCCViewer_ViewWindow::activateWindowFit() { - DBG_FUN(); if ( !transformRequested() && !myCursorIsHand ) saveCursor(); /* save old cursor */ @@ -935,7 +916,6 @@ void OCCViewer_ViewWindow::activateWindowFit() */ bool OCCViewer_ViewWindow::setTransformRequested( OperationType op ) { - DBG_FUN(); bool ok = transformEnabled( op ); myOperation = ok ? op : NOVIEWOP; myViewPort->setMouseTracking( myOperation == NOVIEWOP ); @@ -1073,7 +1053,6 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent ) */ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent) { - DBG_FUN(); switch ( myOperation ) { case NOVIEWOP: { @@ -1159,7 +1138,6 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent) */ void OCCViewer_ViewWindow::resetState() { - DBG_FUN(); myDrawRect = false; if ( myRotationPointSelection ) @@ -1219,7 +1197,6 @@ void OCCViewer_ViewWindow::endDrawRect() */ void OCCViewer_ViewWindow::createActions() { - DBG_FUN(); if( !toolMgr()->isEmpty() ) return; @@ -1563,7 +1540,6 @@ void OCCViewer_ViewWindow::createActions() */ void OCCViewer_ViewWindow::createToolBar() { - DBG_FUN(); static const char* titles[] = { "LBL_3DTOOLBAR_LABEL", "LBL_XYTOOLBAR_LABEL", @@ -1664,7 +1640,6 @@ void OCCViewer_ViewWindow::createToolBar() */ void OCCViewer_ViewWindow::onViewFitAll() { - DBG_FUN(); myViewPort->fitAll(); } @@ -1673,7 +1648,6 @@ void OCCViewer_ViewWindow::onViewFitAll() */ void OCCViewer_ViewWindow::onFrontView() { - DBG_FUN(); emit vpTransformationStarted ( FRONTVIEW ); Handle(V3d_View) aView3d = myViewPort->getView(); if (myAutomaticZoom) @@ -1692,7 +1666,6 @@ void OCCViewer_ViewWindow::onFrontView() */ void OCCViewer_ViewWindow::onBackView() { - DBG_FUN(); emit vpTransformationStarted ( BACKVIEW ); Handle(V3d_View) aView3d = myViewPort->getView(); if (myAutomaticZoom) @@ -1711,7 +1684,6 @@ void OCCViewer_ViewWindow::onBackView() */ void OCCViewer_ViewWindow::onTopView() { - DBG_FUN(); emit vpTransformationStarted ( TOPVIEW ); Handle(V3d_View) aView3d = myViewPort->getView(); if (myAutomaticZoom) @@ -1730,7 +1702,6 @@ void OCCViewer_ViewWindow::onTopView() */ void OCCViewer_ViewWindow::onBottomView() { - DBG_FUN(); emit vpTransformationStarted ( BOTTOMVIEW ); Handle(V3d_View) aView3d = myViewPort->getView(); if (myAutomaticZoom) @@ -1749,7 +1720,6 @@ void OCCViewer_ViewWindow::onBottomView() */ void OCCViewer_ViewWindow::onLeftView() { - DBG_FUN(); emit vpTransformationStarted ( LEFTVIEW ); Handle(V3d_View) aView3d = myViewPort->getView(); if (myAutomaticZoom) @@ -1768,7 +1738,6 @@ void OCCViewer_ViewWindow::onLeftView() */ void OCCViewer_ViewWindow::onRightView() { - DBG_FUN(); emit vpTransformationStarted ( RIGHTVIEW ); Handle(V3d_View) aView3d = myViewPort->getView(); if (myAutomaticZoom) @@ -1787,7 +1756,6 @@ void OCCViewer_ViewWindow::onRightView() */ void OCCViewer_ViewWindow::onClockWiseView() { - DBG_FUN(); emit vpTransformationStarted ( CLOCKWISEVIEW ); myViewPort->rotateXY( 90. ); emit vpTransformationFinished ( CLOCKWISEVIEW ); @@ -1798,7 +1766,6 @@ void OCCViewer_ViewWindow::onClockWiseView() */ void OCCViewer_ViewWindow::onAntiClockWiseView() { - DBG_FUN(); emit vpTransformationStarted ( ANTICLOCKWISEVIEW ); myViewPort->rotateXY( -90. ); emit vpTransformationFinished ( ANTICLOCKWISEVIEW ); @@ -1811,7 +1778,6 @@ void OCCViewer_ViewWindow::onAntiClockWiseView() */ void OCCViewer_ViewWindow::onResetView() { - DBG_FUN(); emit vpTransformationStarted( RESETVIEW ); bool upd = myViewPort->getView()->SetImmediateUpdate( false ); myViewPort->getView()->Reset( false ); @@ -1829,7 +1795,6 @@ void OCCViewer_ViewWindow::onResetView() */ void OCCViewer_ViewWindow::onProjectionType( QAction* theAction ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); if ( !aView3d.IsNull() ) { Handle(Graphic3d_Camera) aCamera = aView3d->Camera(); @@ -1859,7 +1824,6 @@ void OCCViewer_ViewWindow::onProjectionType( QAction* theAction ) */ void OCCViewer_ViewWindow::onStereoType( bool activate ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); if ( !aView3d.IsNull() ) { Handle(Graphic3d_Camera) aCamera = aView3d->Camera(); @@ -1903,7 +1867,6 @@ void OCCViewer_ViewWindow::onStereoType( bool activate ) */ void OCCViewer_ViewWindow::onProjectionType() { - DBG_FUN(); emit vpTransformationStarted( PROJECTION ); if (toolMgr()->action( OrthographicId )->isChecked()) setProjectionType( Orthographic ); @@ -1916,7 +1879,6 @@ void OCCViewer_ViewWindow::onProjectionType() void OCCViewer_ViewWindow::setProjectionType( int mode ) { - DBG_FUN(); QtxAction* anOrthographicAction = dynamic_cast( toolMgr()->action( OrthographicId ) ); QtxAction* aPerspectiveAction = dynamic_cast( toolMgr()->action( PerspectiveId ) ); QtxAction* aStereoAction = dynamic_cast( toolMgr()->action( StereoId ) ); @@ -1979,7 +1941,6 @@ void OCCViewer_ViewWindow::setProjectionType( int mode ) */ void OCCViewer_ViewWindow::onFitAll() { - DBG_FUN(); emit vpTransformationStarted( FITALLVIEW ); if (myModel->fitter()) myModel->fitter()->fitAll(myViewPort->getView()); @@ -1993,7 +1954,6 @@ void OCCViewer_ViewWindow::onFitAll() */ void OCCViewer_ViewWindow::onFitSelection() { - DBG_FUN(); emit vpTransformationStarted( FITSELECTION ); myModel->getAISContext()->FitSelected( getViewPort()->getView() ); emit vpTransformationFinished( FITSELECTION ); @@ -2005,7 +1965,6 @@ void OCCViewer_ViewWindow::onFitSelection() */ void OCCViewer_ViewWindow::onSetRotationPoint( bool on ) { - DBG_FUN(); if (on) { if (!mySetRotationPointDlg) @@ -2038,7 +1997,6 @@ void OCCViewer_ViewWindow::onSetRotationPoint( bool on ) */ void OCCViewer_ViewWindow::onCloneView() { - DBG_FUN(); SUIT_ViewWindow* vw = myManager->createViewWindow(); //vw->show(); emit viewCloned( vw ); @@ -2053,7 +2011,6 @@ void OCCViewer_ViewWindow::onCloneView() */ void OCCViewer_ViewWindow::onAxialScale() { - DBG_FUN(); if ( !myScalingDlg ) myScalingDlg = new OCCViewer_AxialScaleDlg( this , myModel ); @@ -2069,14 +2026,12 @@ void OCCViewer_ViewWindow::onAxialScale() */ void OCCViewer_ViewWindow::onGraduatedAxes() { - DBG_FUN(); myCubeAxesDlg->Update(); myCubeAxesDlg->show(); } void OCCViewer_ViewWindow::onAmbientToogle() { - DBG_FUN(); Handle(V3d_Viewer) viewer = myViewPort->getViewer(); viewer->InitDefinedLights(); while(viewer->MoreDefinedLights()) @@ -2098,7 +2053,6 @@ void OCCViewer_ViewWindow::onAmbientToogle() */ void OCCViewer_ViewWindow::onMemorizeView() { - DBG_FUN(); appendViewAspect( getViewParams() ); } @@ -2107,7 +2061,6 @@ void OCCViewer_ViewWindow::onMemorizeView() */ void OCCViewer_ViewWindow::onRestoreView() { - DBG_FUN(); OCCViewer_CreateRestoreViewDlg* aDlg = new OCCViewer_CreateRestoreViewDlg( centralWidget(), this ); connect( aDlg, SIGNAL( dlgOk() ), this, SLOT( setRestoreFlag() ) ); aDlg->exec(); @@ -2122,7 +2075,6 @@ void OCCViewer_ViewWindow::onRestoreView() */ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool baseParamsOnly ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); Standard_Boolean prev = aView3d->SetImmediateUpdate( Standard_False ); @@ -2219,7 +2171,6 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool base */ void OCCViewer_ViewWindow::setRestoreFlag() { - DBG_FUN(); myRestoreFlag = 1; } @@ -2228,7 +2179,6 @@ void OCCViewer_ViewWindow::setRestoreFlag() */ void OCCViewer_ViewWindow::onTrihedronShow(bool show) { - DBG_FUN(); myModel->setTrihedronShown(show); } @@ -2245,7 +2195,6 @@ void OCCViewer_ViewWindow::onViewCubeShow(bool show) */ void OCCViewer_ViewWindow::onSwitchPreselection( bool on ) { - DBG_FUN(); myPreselectionEnabled = on; myModel->setSelectionOptions( isPreselectionEnabled(), myModel->isSelectionEnabled() ); @@ -2266,7 +2215,6 @@ void OCCViewer_ViewWindow::onSwitchPreselection( bool on ) */ void OCCViewer_ViewWindow::onSwitchSelection( bool on ) { - DBG_FUN(); mySelectionEnabled = on; myModel->setSelectionOptions( myModel->isPreselectionEnabled(), isSelectionEnabled() ); @@ -2291,7 +2239,6 @@ void OCCViewer_ViewWindow::onSwitchSelection( bool on ) void OCCViewer_ViewWindow::onSwitchSelectionStyle(QAction* theAction) { // selection - DBG_FUN(); OCCViewer_ViewSketcher* aSkecher = getSketcher(Polygon); if (aSkecher) { if (theAction == toolMgr()->action(PolygonSelectionStyleId)) { @@ -2317,7 +2264,6 @@ OCCViewer_ViewWindow::SelectionStyle OCCViewer_ViewWindow::selectionStyle() cons void OCCViewer_ViewWindow::setSelectionStyle(SelectionStyle theMode) { - DBG_FUN(); toolMgr()->action(RectangleSelectionStyleId)->setChecked(false); toolMgr()->action(PolygonSelectionStyleId)->setChecked(false); toolMgr()->action(CircleSelectionStyleId)->setChecked(false); @@ -2338,7 +2284,6 @@ void OCCViewer_ViewWindow::setSelectionStyle(SelectionStyle theMode) */ void OCCViewer_ViewWindow::onSwitchInteractionStyle( bool on ) { - DBG_FUN(); myInteractionStyle = on ? (int)SUIT_ViewModel::KEY_FREE : (int)SUIT_ViewModel::STANDARD; // update action state if method is called outside @@ -2352,7 +2297,6 @@ void OCCViewer_ViewWindow::onSwitchInteractionStyle( bool on ) */ void OCCViewer_ViewWindow::onSwitchZoomingStyle( bool on ) { - DBG_FUN(); myViewPort->setAdvancedZoomingEnabled( on ); // update action state if method is called outside @@ -2376,7 +2320,6 @@ int OCCViewer_ViewWindow::interactionStyle() const */ void OCCViewer_ViewWindow::setInteractionStyle( const int theStyle ) { - DBG_FUN(); onSwitchInteractionStyle( theStyle == (int)SUIT_ViewModel::KEY_FREE ); } @@ -2395,7 +2338,6 @@ int OCCViewer_ViewWindow::zoomingStyle() const */ void OCCViewer_ViewWindow::setZoomingStyle( const int theStyle ) { - DBG_FUN(); onSwitchZoomingStyle( theStyle == 1 ); } @@ -2406,7 +2348,6 @@ void OCCViewer_ViewWindow::setZoomingStyle( const int theStyle ) //#define USE_OLD_IMPLEMENTATION QImage OCCViewer_ViewWindow::dumpView() { - DBG_FUN(); Handle(V3d_View) view = myViewPort->getView(); if ( view.IsNull() ) return QImage(); @@ -2487,7 +2428,6 @@ bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& /*img*/, const QString& fileName, const QString& /*format*/ ) { - DBG_FUN(); bool res = false; QApplication::setOverrideCursor( Qt::WaitCursor ); @@ -2519,7 +2459,6 @@ QString OCCViewer_ViewWindow::filter() const void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x, const double y, const double z, const double dx, const double dy, const double dz ) { - DBG_FUN(); Handle(V3d_View) view = myViewPort->getView(); if ( view.IsNull() ) return; @@ -2559,7 +2498,6 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x, const doub void OCCViewer_ViewWindow::setCuttingPlane( bool on, const gp_Pln pln ) { - DBG_FUN(); gp_Dir aDir = pln.Axis().Direction(); gp_Pnt aPnt = pln.Location(); setCuttingPlane(on, aPnt.X(), aPnt.Y(), aPnt.Z(), aDir.X(), aDir.Y(), aDir.Z()); @@ -2860,7 +2798,6 @@ QString OCCViewer_ViewWindow::getVisualParameters() */ void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters ) { - DBG_FUN(); viewAspect params; ClipPlanesList aClipPlanes; QStringList data = parameters.split( '*' ); @@ -3088,8 +3025,6 @@ void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters ) */ void OCCViewer_ViewWindow::showEvent( QShowEvent* theEvent ) { - DBG_FUN(); - MSGEL("-----> emit Show <-----"); emit Show( theEvent ); } @@ -3102,8 +3037,6 @@ void OCCViewer_ViewWindow::showEvent( QShowEvent* theEvent ) */ void OCCViewer_ViewWindow::hideEvent( QHideEvent* theEvent ) { - DBG_FUN(); - MSGEL("-----> emit Hide <-----"); emit Hide( theEvent ); } @@ -3113,7 +3046,6 @@ void OCCViewer_ViewWindow::hideEvent( QHideEvent* theEvent ) */ void OCCViewer_ViewWindow::saveCursor() { - DBG_FUN(); QCursor* aCursor = NULL; if ( myViewPort ) aCursor = myViewPort->getDefaultCursor(); @@ -3126,7 +3058,6 @@ void OCCViewer_ViewWindow::saveCursor() */ OCCViewer_ViewSketcher* OCCViewer_ViewWindow::createSketcher( int type ) { - DBG_FUN(); if ( type == Rect ) return new OCCViewer_RectSketcher( this, type ); if ( type == Polygon ) @@ -3136,7 +3067,6 @@ OCCViewer_ViewSketcher* OCCViewer_ViewWindow::createSketcher( int type ) void OCCViewer_ViewWindow::initSketchers() { - DBG_FUN(); if ( mySketchers.isEmpty() ) { mySketchers.append( createSketcher( Rect ) ); @@ -3162,7 +3092,6 @@ OCCViewer_ViewSketcher* OCCViewer_ViewWindow::getSketcher( const int typ ) const */ void OCCViewer_ViewWindow::activateSketching( int type ) { - DBG_FUN(); OCCViewer_ViewPort3d* vp = getViewPort(); if ( !vp ) return; @@ -3198,7 +3127,6 @@ void OCCViewer_ViewWindow::activateSketching( int type ) */ void OCCViewer_ViewWindow::onSketchingStarted() { - DBG_FUN(); } /*! @@ -3206,7 +3134,6 @@ void OCCViewer_ViewWindow::onSketchingStarted() */ void OCCViewer_ViewWindow::onSketchingFinished() { - DBG_FUN(); MESSAGE("OCCViewer_ViewWindow::onSketchingFinished()"); if ( mypSketcher && mypSketcher->result() == OCCViewer_ViewSketcher::Accept ) { @@ -3281,7 +3208,6 @@ bool OCCViewer_ViewWindow::transformInProcess() const void OCCViewer_ViewWindow::setTransformInProcess( bool bOn ) { - DBG_FUN(); myEventStarted = bOn; } @@ -3290,7 +3216,6 @@ void OCCViewer_ViewWindow::setTransformInProcess( bool bOn ) */ void OCCViewer_ViewWindow::setTransformEnabled( const OperationType id, const bool on ) { - DBG_FUN(); if ( id != NOVIEWOP ) myStatus.insert( id, on ); } @@ -3304,19 +3229,16 @@ bool OCCViewer_ViewWindow::transformEnabled( const OperationType id ) const void OCCViewer_ViewWindow::onMaximizedView() { - DBG_FUN(); setMaximized(!isMaximized()); } void OCCViewer_ViewWindow::returnTo3dView() { - DBG_FUN(); setReturnedTo3dView( true ); } void OCCViewer_ViewWindow::setReturnedTo3dView(bool isVisible3dView) { - DBG_FUN(); if ( !toolMgr()->action( ReturnTo3dViewId ) || toolMgr()->isShown(ReturnTo3dViewId) != isVisible3dView ) return; if ( !isVisible3dView ) @@ -3329,7 +3251,6 @@ void OCCViewer_ViewWindow::setReturnedTo3dView(bool isVisible3dView) void OCCViewer_ViewWindow::setMaximized(bool toMaximize, bool toSendSignal) { - DBG_FUN(); QAction* anAction = toolMgr()->action( MaximizedId ); QAction* anAction2 = toolMgr()->action( ReturnTo3dViewId ); SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); @@ -3340,7 +3261,6 @@ void OCCViewer_ViewWindow::setMaximized(bool toMaximize, bool toSendSignal) anAction->setStatusTip( tr( "DSC_MINIMIZE_VIEW" ) ); if ( anAction2 && my2dMode != No2dMode ) toolMgr()->show( ReturnTo3dViewId ); if (toSendSignal) { - MSGEL("-----> emit maximized(true) <-----"); emit maximized( this, true ); } } @@ -3351,7 +3271,6 @@ void OCCViewer_ViewWindow::setMaximized(bool toMaximize, bool toSendSignal) anAction->setStatusTip( tr( "DSC_MAXIMIZE_VIEW" ) ); if ( anAction2 && my2dMode != No2dMode ) toolMgr()->hide( ReturnTo3dViewId ); if (toSendSignal) { - MSGEL("-----> emit maximized(false) <-----"); emit maximized( this, false ); } } @@ -3364,7 +3283,6 @@ bool OCCViewer_ViewWindow::isMaximized() const void OCCViewer_ViewWindow::setSketcherStyle( bool enable ) { - DBG_FUN(); IsSketcherStyle = enable; } @@ -3376,7 +3294,6 @@ bool OCCViewer_ViewWindow::isSketcherStyle() const void OCCViewer_ViewWindow::set2dMode(Mode2dType theType) { - DBG_FUN(); my2dMode = theType; } @@ -3398,7 +3315,6 @@ int OCCViewer_ViewWindow::projectionType() const void OCCViewer_ViewWindow::setStereoType( int type ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); if ( !aView3d.IsNull() ) { Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams(); @@ -3419,7 +3335,6 @@ int OCCViewer_ViewWindow::stereoType() const void OCCViewer_ViewWindow::setAnaglyphFilter( int type ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); if ( !aView3d.IsNull() ) { Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams(); @@ -3450,7 +3365,6 @@ int OCCViewer_ViewWindow::anaglyphFilter() const void OCCViewer_ViewWindow::setStereographicFocus( int type, double value ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); if ( !aView3d.IsNull() ) { Handle(Graphic3d_Camera) aCamera = aView3d->Camera(); @@ -3482,7 +3396,6 @@ double OCCViewer_ViewWindow::stereographicFocusValue() const void OCCViewer_ViewWindow::setInterocularDistance( int type, double value ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); if ( !aView3d.IsNull() ) { Handle(Graphic3d_Camera) aCamera = aView3d->Camera(); @@ -3514,7 +3427,6 @@ double OCCViewer_ViewWindow::interocularDistanceValue() const void OCCViewer_ViewWindow::setReverseStereo( bool reverse ) { - DBG_FUN(); Handle(V3d_View) aView3d = myViewPort->getView(); if ( !aView3d.IsNull() ) { Graphic3d_RenderingParams* aParams = &aView3d->ChangeRenderingParams(); @@ -3535,7 +3447,6 @@ bool OCCViewer_ViewWindow::isReverseStereo() const void OCCViewer_ViewWindow::setVSync( bool enable ) { - DBG_FUN(); Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext(); if ( !anIntCont.IsNull() ) { Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver()); @@ -3558,7 +3469,6 @@ bool OCCViewer_ViewWindow::isVSync() const void OCCViewer_ViewWindow::setQuadBufferSupport( bool enable ) { - DBG_FUN(); Handle(AIS_InteractiveContext) anIntCont = myModel->getAISContext(); if ( !anIntCont.IsNull() ) { Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast(anIntCont->CurrentViewer()->Driver()); @@ -3597,7 +3507,6 @@ QColor OCCViewer_ViewWindow::backgroundColor() const // obsolete void OCCViewer_ViewWindow::setBackgroundColor( const QColor& theColor ) { - DBG_FUN(); if ( myViewPort ) myViewPort->setBackgroundColor( theColor ); } @@ -3608,13 +3517,11 @@ Qtx::BackgroundData OCCViewer_ViewWindow::background() const void OCCViewer_ViewWindow::setBackground( const Qtx::BackgroundData& theBackground ) { - DBG_FUN(); if ( myViewPort ) myViewPort->setBackground( theBackground ); } void OCCViewer_ViewWindow::showStaticTrihedron( bool on ) { - DBG_FUN(); if ( myViewPort ) myViewPort->showStaticTrihedron( on ); } @@ -3623,7 +3530,6 @@ void OCCViewer_ViewWindow::showStaticTrihedron( bool on ) */ void OCCViewer_ViewWindow::clearViewAspects() { - DBG_FUN(); myViewAspects.clear(); } @@ -3641,7 +3547,6 @@ const viewAspectList& OCCViewer_ViewWindow::getViewAspects() */ void OCCViewer_ViewWindow::appendViewAspect( const viewAspect& aParams ) { - DBG_FUN(); myViewAspects.append( aParams ); } @@ -3651,7 +3556,6 @@ void OCCViewer_ViewWindow::appendViewAspect( const viewAspect& aParams ) */ void OCCViewer_ViewWindow::updateViewAspects( const viewAspectList& aViewList ) { - DBG_FUN(); myViewAspects = aViewList; } @@ -3661,7 +3565,6 @@ void OCCViewer_ViewWindow::updateViewAspects( const viewAspectList& aViewList ) */ SUIT_CameraProperties OCCViewer_ViewWindow::cameraProperties() { - DBG_FUN(); SUIT_CameraProperties aProps; Handle(V3d_View) aSourceView = getViewPort()->getView(); @@ -3719,7 +3622,6 @@ SUIT_CameraProperties OCCViewer_ViewWindow::cameraProperties() */ void OCCViewer_ViewWindow::synchronize( SUIT_ViewWindow* theView ) { - DBG_FUN(); bool blocked = blockSignals( true ); SUIT_CameraProperties aProps = theView->cameraProperties(); @@ -3776,7 +3678,6 @@ bool OCCViewer_ViewWindow::isPreselectionEnabled() const */ void OCCViewer_ViewWindow::enablePreselection( bool theIsToEnable ) { - DBG_FUN(); onSwitchPreselection( theIsToEnable ); } @@ -3795,7 +3696,6 @@ bool OCCViewer_ViewWindow::isSelectionEnabled() const */ void OCCViewer_ViewWindow::enableSelection( bool theIsToEnable ) { - DBG_FUN(); onSwitchSelection( theIsToEnable ); } @@ -3809,7 +3709,6 @@ void OCCViewer_ViewWindow::enableSelection( bool theIsToEnable ) */ void OCCViewer_ViewWindow::onClipping (bool theIsOn) { - DBG_FUN(); if(!myModel) return; OCCViewer_ClippingDlg* aClippingDlg = myModel->getClippingDlg(); @@ -3848,7 +3747,6 @@ void OCCViewer_ViewWindow::onClipping (bool theIsOn) void OCCViewer_ViewWindow::onRayTracing() { - DBG_FUN(); if( !OCCViewer_Utilities::isDialogOpened( this, OCCViewer_RayTracingDlg::getName() ) ) { QDialog* aDlg = new OCCViewer_RayTracingDlg( this ); if ( aDlg != NULL ) @@ -3858,7 +3756,6 @@ void OCCViewer_ViewWindow::onRayTracing() void OCCViewer_ViewWindow::onEnvTexture() { - DBG_FUN(); if( !OCCViewer_Utilities::isDialogOpened( this, OCCViewer_EnvTextureDlg::getName() ) ) { QDialog* aDlg = new OCCViewer_EnvTextureDlg( this ); if ( aDlg != NULL ) @@ -3868,7 +3765,6 @@ void OCCViewer_ViewWindow::onEnvTexture() void OCCViewer_ViewWindow::onLightSource() { - DBG_FUN(); if( !OCCViewer_Utilities::isDialogOpened( this, OCCViewer_LightSourceDlg::getName() ) ) { QDialog* aDlg = new OCCViewer_LightSourceDlg( this, myModel ); if ( aDlg != NULL ) @@ -3884,7 +3780,6 @@ bool OCCViewer_ViewWindow::isActionVisible( ActionId theId ) const void OCCViewer_ViewWindow::setActionVisible( ActionId theId, bool isVisible ) { - DBG_FUN(); QAction* a = toolMgr()->action( theId ); if( a ) a->setVisible( isVisible ); @@ -3892,7 +3787,6 @@ void OCCViewer_ViewWindow::setActionVisible( ActionId theId, bool isVisible ) void OCCViewer_ViewWindow::projAndPanToGravity(V3d_TypeOfOrientation CamOri) { - DBG_FUN(); const bool USE_XY = true; Handle(V3d_View) aView3d = myViewPort->getView(); @@ -3955,7 +3849,6 @@ bool OCCViewer_ViewWindow::isAutomaticZoom() const void OCCViewer_ViewWindow::setAutomaticZoom(const bool isOn) { - DBG_FUN(); myAutomaticZoom = isOn; } diff --git a/src/PV3DViewer/MBDebug.h b/src/PV3DViewer/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/PV3DViewer/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/PV3DViewer/PV3DViewer_ViewManager.cxx b/src/PV3DViewer/PV3DViewer_ViewManager.cxx index 147396936..2e15be1b6 100644 --- a/src/PV3DViewer/PV3DViewer_ViewManager.cxx +++ b/src/PV3DViewer/PV3DViewer_ViewManager.cxx @@ -37,21 +37,12 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PV3DViewer_ViewManager" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ PV3DViewer_ViewManager::PV3DViewer_ViewManager(SUIT_Study* study, SUIT_Desktop* desktop) : SUIT_ViewManager( study, desktop, new PV3DViewer_ViewModel() ) { - DBG_FUN(); - MESSAGE("PV3DViewer - view manager created ..."); setTitle( tr( "PARAVIEW3D_VIEW_TITLE" ) ); // Initialize minimal paraview stuff (if not already done) @@ -65,7 +56,6 @@ PV3DViewer_ViewManager::PV3DViewer_ViewManager(SUIT_Study* study, SUIT_Desktop* */ void PV3DViewer_ViewManager::onWindowActivated(SUIT_ViewWindow* view) { - DBG_FUN(); if (view) { PV3DViewer_ViewWindow* pvWindow = dynamic_cast(view); diff --git a/src/PV3DViewer/PV3DViewer_ViewModel.cxx b/src/PV3DViewer/PV3DViewer_ViewModel.cxx index 291789157..8bc8080c2 100644 --- a/src/PV3DViewer/PV3DViewer_ViewModel.cxx +++ b/src/PV3DViewer/PV3DViewer_ViewModel.cxx @@ -23,18 +23,8 @@ #include #include "SUIT_Desktop.h" -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PV3DViewer_ViewModel" -#include "MBDebug.h" -//--------------------------------------------------------- - -//---------------------------------------- -PV3DViewer_ViewModel::PV3DViewer_ViewModel() -:SUIT_ViewModel() +PV3DViewer_ViewModel::PV3DViewer_ViewModel():SUIT_ViewModel() { - DBG_FUN(); MESSAGE("PV3DViewer_ViewModel: creating view model ..."); } @@ -44,7 +34,5 @@ PV3DViewer_ViewModel::PV3DViewer_ViewModel() */ SUIT_ViewWindow* PV3DViewer_ViewModel::createView(SUIT_Desktop* desktop) { - DBG_FUN(); return new PV3DViewer_ViewWindow(desktop, this); } - diff --git a/src/PV3DViewer/PV3DViewer_ViewWindow.cxx b/src/PV3DViewer/PV3DViewer_ViewWindow.cxx index b0f14d44e..c34737893 100644 --- a/src/PV3DViewer/PV3DViewer_ViewWindow.cxx +++ b/src/PV3DViewer/PV3DViewer_ViewWindow.cxx @@ -32,13 +32,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PV3DViewer_ViewWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! \brief Constructor. \param theDesktop parent desktop window @@ -47,7 +40,6 @@ PV3DViewer_ViewWindow::PV3DViewer_ViewWindow( SUIT_Desktop* theDesktop, PV3DViewer_ViewModel* theModel ) : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 ) { - DBG_FUN(); myDesktop = theDesktop; myModel = theModel; setViewManager(myModel->getViewManager()); @@ -61,18 +53,16 @@ PV3DViewer_ViewWindow::PV3DViewer_ViewWindow( SUIT_Desktop* theDesktop, PV3DView */ PV3DViewer_ViewWindow::~PV3DViewer_ViewWindow() { - DBG_FUN(); if ( myPVMgr ) { - myPVMgr->setParent( 0 ); + myPVMgr->setParent( nullptr ); myPVMgr->hide(); - myPVMgr = 0; - setCentralWidget( 0 ); + myPVMgr = nullptr; + setCentralWidget( nullptr ); } } void PV3DViewer_ViewWindow::removePVMgr() { - DBG_FUNC(); pqTabbedMultiViewWidget* aPVMgr = qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET")); delete aPVMgr; } @@ -83,6 +73,5 @@ void PV3DViewer_ViewWindow::removePVMgr() */ pqTabbedMultiViewWidget *PV3DViewer_ViewWindow::getMultiViewManager() const { - DBG_FUN(); return myPVMgr; } diff --git a/src/PVViewer/MBDebug.h b/src/PVViewer/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/PVViewer/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/PVViewer/PVViewer_Behaviors.cxx b/src/PVViewer/PVViewer_Behaviors.cxx index 639d12289..66f22e2c6 100644 --- a/src/PVViewer/PVViewer_Behaviors.cxx +++ b/src/PVViewer/PVViewer_Behaviors.cxx @@ -49,19 +49,11 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PVViewer_Behaviors" -#include "MBDebug.h" -//--------------------------------------------------------- - int PVViewer_Behaviors::BehaviorLoadingLevel = 0; PVViewer_Behaviors::PVViewer_Behaviors(QMainWindow * parent) : QObject(parent) { - DBG_FUN(); } /**! Instanciate minimal ParaView behaviors needed when using an instance of PVViewer. @@ -70,8 +62,6 @@ PVViewer_Behaviors::PVViewer_Behaviors(QMainWindow * parent) */ void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * /*desk*/) { - DBG_FUN(); - SHOW(BehaviorLoadingLevel); if (BehaviorLoadingLevel < 1) { // Register ParaView interfaces. @@ -100,8 +90,6 @@ void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * /*desk*/) */ void PVViewer_Behaviors::instanciateAllBehaviors(QMainWindow * desk) { - DBG_FUN(); - SHOW(BehaviorLoadingLevel); // "new pqParaViewBehaviors(anApp->desktop(), this);" // -> (which loads all standard ParaView behaviors at once) has to be replaced in order to // exclude using of pqQtMessageHandlerBehaviour diff --git a/src/PVViewer/PVViewer_Core.cxx b/src/PVViewer/PVViewer_Core.cxx index 6ac97835e..d50b18c5a 100644 --- a/src/PVViewer/PVViewer_Core.cxx +++ b/src/PVViewer/PVViewer_Core.cxx @@ -44,14 +44,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PVViewer_Core" -#include "MBDebug.h" -//--------------------------------------------------------- - - //---------- Static init ----------------- pqPVApplicationCore* PVViewer_Core::MyCoreApp = nullptr; bool PVViewer_Core::MyPqTabWidSingletonLoaded = false; @@ -122,7 +114,6 @@ bool PVViewer_Core::ParaViewInitAppCore() */ bool PVViewer_Core::ParaviewInitApp() { - DBG_FUNC(); if( ! MyPqTabWidSingletonLoaded ) { if( ! ParaViewInitAppCore() ) @@ -145,8 +136,6 @@ bool PVViewer_Core::ParaviewInitApp() void PVViewer_Core::ParaviewInitBehaviors(bool fullSetup, QMainWindow* aDesktop) { - DBG_FUNC(); - ARG(fullSetup); if (!ParaviewBehaviors) ParaviewBehaviors = new PVViewer_Behaviors(aDesktop); @@ -158,9 +147,6 @@ void PVViewer_Core::ParaviewInitBehaviors(bool fullSetup, QMainWindow* aDesktop) void PVViewer_Core::ParaviewLoadConfigurations(const QString & configPath, bool force) { - DBG_FUNC(); - ARG(configPath); - ARG(force); if (!ConfigLoaded || force) { if (!configPath.isNull()) { @@ -173,7 +159,6 @@ void PVViewer_Core::ParaviewLoadConfigurations(const QString & configPath, bool void PVViewer_Core::ParaviewCleanup() { - DBG_FUNC(); // Disconnect from server pqServer* server = pqActiveObjects::instance().activeServer(); if (server && server->isRemote()) diff --git a/src/PVViewer/PVViewer_GUIElements.cxx b/src/PVViewer/PVViewer_GUIElements.cxx index 5be7bf5e6..4958535f1 100644 --- a/src/PVViewer/PVViewer_GUIElements.cxx +++ b/src/PVViewer/PVViewer_GUIElements.cxx @@ -59,13 +59,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PVViewer_GUIElements" -#include "MBDebug.h" -//--------------------------------------------------------- - PVViewer_GUIElements * PVViewer_GUIElements::theInstance = 0; PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desktop) : @@ -99,7 +92,6 @@ PVViewer_GUIElements::PVViewer_GUIElements(QMainWindow* desktop) : commonAction(0), dataAction(0) { - DBG_FUN(); } PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(QMainWindow* desk) @@ -116,7 +108,6 @@ PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(QMainWindow* desk) void PVViewer_GUIElements::buildPVWidgets() { if (!myPVWidgetsFlag) { - DBG_FUN(); //Pipeline Browser if ( !pipelineBrowserWidget ) { @@ -266,9 +257,7 @@ void PVViewer_GUIElements::buildPVWidgets() } void PVViewer_GUIElements::setToolBarVisible(bool show) -{ - DBG_FUN(); - ARG(show); +{ QCoreApplication::processEvents(); if (!myPVWidgetsFlag) return; @@ -304,8 +293,6 @@ void PVViewer_GUIElements::setToolBarVisible(bool show) void PVViewer_GUIElements::setVCRTimeToolBarVisible(bool show) { - DBG_FUN(); - ARG(show); vcrAction->setChecked(!show); vcrAction->setVisible(show); vcrAction->trigger(); @@ -326,8 +313,6 @@ QList PVViewer_GUIElements::getToolbars() void PVViewer_GUIElements::setToolBarEnabled(bool enabled) { - DBG_FUN(); - ARG(enabled); if (!myPVWidgetsFlag) return; @@ -389,7 +374,6 @@ QMenu* PVViewer_GUIElements::getCatalystMenu() { } void PVViewer_GUIElements::publishExistingSources() { - DBG_FUN(); vtkSMSessionProxyManager* pxm = pqActiveObjects::instance().proxyManager(); pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel(); if( !pxm || !smmodel ) @@ -397,9 +381,7 @@ void PVViewer_GUIElements::publishExistingSources() { vtkSMProxyIterator* iter = vtkSMProxyIterator::New(); iter->SetModeToOneGroup(); iter->SetSessionProxyManager( pxm ); - MSGEL("....List of all sources:...."); for ( iter->Begin( "sources" ); !iter->IsAtEnd(); iter->Next() ) { - SHOW(iter->GetKey()); if ( pqProxy* item = smmodel->findItem( iter->GetProxy() ) ) { pqPipelineSource* source = qobject_cast( item ); QMetaObject::invokeMethod( smmodel, diff --git a/src/PVViewer/PVViewer_InitSingleton.cxx b/src/PVViewer/PVViewer_InitSingleton.cxx index e6cf39368..c401af392 100644 --- a/src/PVViewer/PVViewer_InitSingleton.cxx +++ b/src/PVViewer/PVViewer_InitSingleton.cxx @@ -22,18 +22,10 @@ #include "PVViewer_Core.h" #include "PVViewer_ViewManager.h" -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PVViewer_InitSingleton" -#include "MBDebug.h" -//--------------------------------------------------------- - bool PVViewer_InitSingleton::IS_INIT=false; void PVViewer_InitSingleton::Init(QMainWindow* desktop) { - DBG_FUNC(); if(IS_INIT) return ; PVViewer_Core::ParaviewInitApp(); diff --git a/src/PVViewer/PVViewer_OutputWindow.cxx b/src/PVViewer/PVViewer_OutputWindow.cxx index bd6b5b567..8d40dc389 100644 --- a/src/PVViewer/PVViewer_OutputWindow.cxx +++ b/src/PVViewer/PVViewer_OutputWindow.cxx @@ -21,23 +21,14 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PVViewer_OutputWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - vtkStandardNewMacro(PVViewer_OutputWindow) PVViewer_OutputWindow::PVViewer_OutputWindow() { - DBG_FUN(); } PVViewer_OutputWindow::~PVViewer_OutputWindow() { - DBG_FUN(); } unsigned int PVViewer_OutputWindow::getTextCount() const @@ -67,8 +58,6 @@ unsigned int PVViewer_OutputWindow::getDebugCount() const void PVViewer_OutputWindow::DisplayText(const char* text) { - DBG_FUN(); - ARG(text); MessageTypes type = GetCurrentMessageType(); myCounter[type] = count(type) + 1; switch (type) diff --git a/src/PVViewer/PVViewer_ViewManager.cxx b/src/PVViewer/PVViewer_ViewManager.cxx index 8b546d51e..9a223eb33 100644 --- a/src/PVViewer/PVViewer_ViewManager.cxx +++ b/src/PVViewer/PVViewer_ViewManager.cxx @@ -38,20 +38,12 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PVViewer_ViewManager" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ PVViewer_ViewManager::PVViewer_ViewManager(SUIT_Study* study, SUIT_Desktop* desktop) : SUIT_ViewManager( study, desktop, new PVViewer_Viewer() ) { - DBG_FUN(); MESSAGE("PVViewer - view manager created ..."); setTitle( tr( "PARAVIEW_VIEW_TITLE" ) ); @@ -69,14 +61,12 @@ PVServer_ServiceWrapper * PVViewer_ViewManager::GetService() QString PVViewer_ViewManager::GetPVConfigPath() { - DBG_FUNC(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); return resMgr->stringValue("resources", "PVViewer", QString()); } bool PVViewer_ViewManager::ConnectToExternalPVServer(QMainWindow* desktop) { - DBG_FUNC(); SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); bool noConnect = aResourceMgr->booleanValue( "PARAVIS", "no_ext_pv_server", false ); if (noConnect) @@ -142,7 +132,6 @@ bool PVViewer_ViewManager::ConnectToExternalPVServer(QMainWindow* desktop) */ void PVViewer_ViewManager::onWindowActivated(SUIT_ViewWindow* view) { - DBG_FUN(); if (view) { PVViewer_ViewWindow* pvWindow = dynamic_cast(view); diff --git a/src/PVViewer/PVViewer_ViewModel.cxx b/src/PVViewer/PVViewer_ViewModel.cxx index 786d4738e..d5b136c80 100644 --- a/src/PVViewer/PVViewer_ViewModel.cxx +++ b/src/PVViewer/PVViewer_ViewModel.cxx @@ -24,18 +24,10 @@ #include #include "SUIT_Desktop.h" -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PVViewer_Viewer" -#include "MBDebug.h" -//--------------------------------------------------------- - //---------------------------------------- PVViewer_Viewer::PVViewer_Viewer() :SUIT_ViewModel() { - DBG_FUN(); MESSAGE("PVViewer_Viewer: creating view model ..."); } @@ -45,7 +37,5 @@ PVViewer_Viewer::PVViewer_Viewer() */ SUIT_ViewWindow* PVViewer_Viewer::createView(SUIT_Desktop* desktop) { - DBG_FUN(); return new PVViewer_ViewWindow(desktop, this); } - diff --git a/src/PVViewer/PVViewer_ViewWindow.cxx b/src/PVViewer/PVViewer_ViewWindow.cxx index 6309f86d3..cd8ed9ebc 100644 --- a/src/PVViewer/PVViewer_ViewWindow.cxx +++ b/src/PVViewer/PVViewer_ViewWindow.cxx @@ -34,14 +34,6 @@ #include #include "pqActiveObjects.h" -//--------------------------------------------------------- -#define USE_DEBUG -//#define MB_IGNORE_QT -#define MBCLASSNAME "PVViewer_ViewWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - - /*! \class PVViewer_ViewWindow \brief PVGUI view window. @@ -55,7 +47,6 @@ PVViewer_ViewWindow::PVViewer_ViewWindow( SUIT_Desktop* theDesktop, PVViewer_Viewer* theModel ) : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 ) { - DBG_FUN(); myDesktop = theDesktop; myModel = theModel; setViewManager(myModel->getViewManager()); @@ -84,7 +75,6 @@ PVViewer_ViewWindow::PVViewer_ViewWindow( SUIT_Desktop* theDesktop, PVViewer_Vie */ PVViewer_ViewWindow::~PVViewer_ViewWindow() { - DBG_FUN(); if ( myPVMgr ) { // Hide toolbars PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(myDesktop); @@ -98,7 +88,6 @@ PVViewer_ViewWindow::~PVViewer_ViewWindow() void PVViewer_ViewWindow::removePVMgr() { - DBG_FUNC(); pqTabbedMultiViewWidget* aPVMgr = qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET")); delete aPVMgr; } @@ -118,12 +107,9 @@ QString PVViewer_ViewWindow::getVisualParameters() */ void PVViewer_ViewWindow::setVisualParameters( const QString& parameters ) { - DBG_FUN(); - ARG(parameters); SUIT_ViewWindow::setVisualParameters( parameters ); } - /*! \brief Returns the ParaView multi-view manager previously set with setMultiViewManager() */ diff --git a/src/Prs/MBDebug.h b/src/Prs/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/Prs/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/Prs/SALOME_Prs.cxx b/src/Prs/SALOME_Prs.cxx index 23649966a..681cb7068 100644 --- a/src/Prs/SALOME_Prs.cxx +++ b/src/Prs/SALOME_Prs.cxx @@ -25,21 +25,12 @@ #include "SALOME_Prs.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MB_IGNORE_QT -#define MBCLASSNAME "SALOME_Prs" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ SALOME_Prs::SALOME_Prs(const char* e) : myIsClippable(true) { myEntry = std::string( e ? e : "" ); - DBG_FUN(); - ARG(myEntry); } /*! @@ -58,14 +49,11 @@ void SALOME_Prs::LocalSelectionIn( SALOME_View*, const std::list ) const // base implementation does nothing } -#undef MBCLASSNAME -#define MBCLASSNAME "SALOME_OCCPrs" /*! Dispatches display operation to proper Display() method of SALOME_View */ void SALOME_OCCPrs::DisplayIn( SALOME_View* v ) const { - DBG_FUN(); if ( v ) v->Display( this ); } @@ -74,7 +62,6 @@ void SALOME_OCCPrs::DisplayIn( SALOME_View* v ) const */ void SALOME_OCCPrs::EraseIn( SALOME_View* v, const bool forced ) const { - DBG_FUN(); if ( v ) v->Erase( this, forced ); } @@ -83,7 +70,6 @@ void SALOME_OCCPrs::EraseIn( SALOME_View* v, const bool forced ) const */ void SALOME_OCCPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->BeforeDisplay( v, this ); } @@ -92,7 +78,6 @@ void SALOME_OCCPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_OCCPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->AfterDisplay( v, this ); } @@ -101,7 +86,6 @@ void SALOME_OCCPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_OCCPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->BeforeErase( v, this ); } @@ -110,7 +94,6 @@ void SALOME_OCCPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_OCCPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->AfterErase( v, this ); } @@ -119,7 +102,6 @@ void SALOME_OCCPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_OCCPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const { - DBG_FUN(); std::list modes; modes.push_back( mode ); LocalSelectionIn( v, modes ); @@ -130,7 +112,6 @@ void SALOME_OCCPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const */ void SALOME_OCCPrs::LocalSelectionIn( SALOME_View* v, const std::list modes ) const { - DBG_FUN(); if ( v && !modes.empty() ) v->LocalSelection( this, modes ); } @@ -139,18 +120,14 @@ void SALOME_OCCPrs::LocalSelectionIn( SALOME_View* v, const std::list modes */ void SALOME_OCCPrs::Update( SALOME_Displayer* d ) { - DBG_FUN(); if ( d ) d->Update( this ); } -#undef MBCLASSNAME -#define MBCLASSNAME "SALOME_VTKPrs" /*! Dispatches display operation to proper Display() method of SALOME_View */ void SALOME_VTKPrs::DisplayIn( SALOME_View* v ) const { - DBG_FUN(); if ( v ) v->Display( this ); } @@ -159,7 +136,6 @@ void SALOME_VTKPrs::DisplayIn( SALOME_View* v ) const */ void SALOME_VTKPrs::EraseIn( SALOME_View* v, const bool forced ) const { - DBG_FUN(); if ( v ) v->Erase( this, forced ); } @@ -168,7 +144,6 @@ void SALOME_VTKPrs::EraseIn( SALOME_View* v, const bool forced ) const */ void SALOME_VTKPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->BeforeDisplay( v, this ); } @@ -177,7 +152,6 @@ void SALOME_VTKPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_VTKPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->AfterDisplay( v, this ); } @@ -186,7 +160,6 @@ void SALOME_VTKPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_VTKPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->BeforeErase( v, this ); } @@ -195,7 +168,6 @@ void SALOME_VTKPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_VTKPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->AfterErase( v, this ); } @@ -204,7 +176,6 @@ void SALOME_VTKPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_VTKPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const { - DBG_FUN(); if ( v ) v->LocalSelection( this, mode ); } @@ -213,18 +184,14 @@ void SALOME_VTKPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const */ void SALOME_VTKPrs::Update( SALOME_Displayer* d ) { - DBG_FUN(); if ( d ) d->Update( this ); } -#undef MBCLASSNAME -#define MBCLASSNAME "SALOME_PV3DPrs" /*! Dispatches display operation to proper Display() method of SALOME_View */ void SALOME_PV3DPrs::DisplayIn( SALOME_View* v ) const { - DBG_FUN(); if ( v ) v->Display( this ); } @@ -233,7 +200,6 @@ void SALOME_PV3DPrs::DisplayIn( SALOME_View* v ) const */ void SALOME_PV3DPrs::EraseIn( SALOME_View* v, const bool forced ) const { - DBG_FUN(); if ( v ) v->Erase( this, forced ); } @@ -242,7 +208,6 @@ void SALOME_PV3DPrs::EraseIn( SALOME_View* v, const bool forced ) const */ void SALOME_PV3DPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->BeforeDisplay( v, this ); } @@ -251,7 +216,6 @@ void SALOME_PV3DPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) cons */ void SALOME_PV3DPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->AfterDisplay( v, this ); } @@ -260,7 +224,6 @@ void SALOME_PV3DPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_PV3DPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->BeforeErase( v, this ); } @@ -269,7 +232,6 @@ void SALOME_PV3DPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_PV3DPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->AfterErase( v, this ); } @@ -278,7 +240,6 @@ void SALOME_PV3DPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_PV3DPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const { - DBG_FUN(); std::list modes; modes.push_back( mode ); LocalSelectionIn( v, modes ); @@ -289,7 +250,6 @@ void SALOME_PV3DPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const */ void SALOME_PV3DPrs::LocalSelectionIn( SALOME_View* v, const std::list modes ) const { - DBG_FUN(); if ( v && !modes.empty() ) v->LocalSelection( this, modes ); } @@ -298,18 +258,14 @@ void SALOME_PV3DPrs::LocalSelectionIn( SALOME_View* v, const std::list mode */ void SALOME_PV3DPrs::Update( SALOME_Displayer* d ) { - DBG_FUN(); if ( d ) d->Update( this ); } -#undef MBCLASSNAME -#define MBCLASSNAME "SALOME_Prs2d" /*! Dispatches display operation to proper Display() method of SALOME_View */ void SALOME_Prs2d::DisplayIn( SALOME_View* v ) const { - DBG_FUN(); if ( v ) v->Display( this ); } @@ -318,7 +274,6 @@ void SALOME_Prs2d::DisplayIn( SALOME_View* v ) const */ void SALOME_Prs2d::EraseIn( SALOME_View* v, const bool forced ) const { - DBG_FUN(); if ( v ) v->Erase( this, forced ); } @@ -327,7 +282,6 @@ void SALOME_Prs2d::EraseIn( SALOME_View* v, const bool forced ) const */ void SALOME_Prs2d::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->BeforeDisplay( v, this ); } @@ -336,7 +290,6 @@ void SALOME_Prs2d::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_Prs2d::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->AfterDisplay( v, this ); } @@ -345,7 +298,6 @@ void SALOME_Prs2d::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_Prs2d::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->BeforeErase( v, this ); } @@ -354,7 +306,6 @@ void SALOME_Prs2d::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_Prs2d::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const { - DBG_FUN(); d->AfterErase( v, this ); } @@ -363,7 +314,6 @@ void SALOME_Prs2d::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const */ void SALOME_Prs2d::LocalSelectionIn( SALOME_View* v, const int mode ) const { - DBG_FUN(); if ( v ) v->LocalSelection( this, mode ); } @@ -372,17 +322,14 @@ void SALOME_Prs2d::LocalSelectionIn( SALOME_View* v, const int mode ) const */ void SALOME_Prs2d::Update( SALOME_Displayer* d ) { - DBG_FUN(); if ( d ) d->Update( this ); } -#define MBCLASSNAME "SALOME_View" /*! Gives control to SALOME_Prs object, so that it could perform double dispatch */ void SALOME_View::Display( SALOME_Displayer* d, const SALOME_Prs* prs ) { - DBG_FUN(); prs->DisplayIn( this ); if ( d ) d->UpdateVisibility( this, prs, true ); } @@ -392,7 +339,6 @@ void SALOME_View::Display( SALOME_Displayer* d, const SALOME_Prs* prs ) */ void SALOME_View::Erase( SALOME_Displayer* d, const SALOME_Prs* prs, const bool forced ) { - DBG_FUN(); prs->EraseIn( this, forced ); if ( d ) d->UpdateVisibility( this, prs, false ); } @@ -402,7 +348,6 @@ void SALOME_View::Erase( SALOME_Displayer* d, const SALOME_Prs* prs, const bool */ void SALOME_View::LocalSelection( const SALOME_Prs* prs, const int mode ) { - DBG_FUN(); std::list modes; modes.push_back( mode ); LocalSelection( prs, modes ); @@ -413,7 +358,6 @@ void SALOME_View::LocalSelection( const SALOME_Prs* prs, const int mode ) */ void SALOME_View::LocalSelection( const SALOME_Prs* prs, const std::list modes ) { - DBG_FUN(); prs->LocalSelectionIn( this, modes ); } @@ -422,7 +366,6 @@ void SALOME_View::LocalSelection( const SALOME_Prs* prs, const std::list mo */ void SALOME_View::Display( const SALOME_OCCPrs* ) { - MSGEL("...SALOME_View::Display(SALOME_OCCPrs)"); // MESSAGE( "SALOME_View::Display( const SALOME_OCCPrs& ) called! Probably, presentation is being displayed in uncompatible viewframe." ); } @@ -431,7 +374,6 @@ void SALOME_View::Display( const SALOME_OCCPrs* ) */ void SALOME_View::Display( const SALOME_VTKPrs* ) { - MSGEL("...SALOME_View::Display(SALOME_VTKPrs)"); // MESSAGE( "SALOME_View::Display( const SALOME_VTKPrs& ) called! Probably, presentation is being displayed in uncompatible viewframe." ); } @@ -440,7 +382,6 @@ void SALOME_View::Display( const SALOME_VTKPrs* ) */ void SALOME_View::Display( const SALOME_PV3DPrs* ) { - MSGEL("...SALOME_View::Display(SALOME_PV3DPrs)"); // MESSAGE( "SALOME_View::Display( const SALOME_PV3DPrs& ) called! Probably, presentation is being displayed in uncompatible viewframe." ); } @@ -449,7 +390,6 @@ void SALOME_View::Display( const SALOME_PV3DPrs* ) */ void SALOME_View::Display( const SALOME_Prs2d* ) { - MSGEL("...SALOME_View::Display(SALOME_Prs2d)"); // MESSAGE( "SALOME_View::Display( const SALOME_Prs2d& ) called! Probably, presentation is being displayed in uncompatible viewframe." ); } @@ -458,7 +398,6 @@ void SALOME_View::Display( const SALOME_Prs2d* ) */ void SALOME_View::Erase( const SALOME_OCCPrs*, const bool ) { - MSGEL("...SALOME_View::Erase(SALOME_OCCPrs,bool)"); // MESSAGE( "SALOME_View::Erase( const SALOME_OCCPrs& ) called! Probably, presentation is being erased in uncompatible viewframe." ); } @@ -467,7 +406,6 @@ void SALOME_View::Erase( const SALOME_OCCPrs*, const bool ) */ void SALOME_View::Erase( const SALOME_VTKPrs*, const bool ) { - MSGEL("...SALOME_View::Erase(SALOME_VTKPrs,bool)"); // MESSAGE( "SALOME_View::Erase( const SALOME_VTKPrs& ) called! Probably, presentation is being erased in uncompatible viewframe." ); } @@ -476,7 +414,6 @@ void SALOME_View::Erase( const SALOME_VTKPrs*, const bool ) */ void SALOME_View::Erase( const SALOME_PV3DPrs*, const bool ) { - MSGEL("...SALOME_View::Erase(SALOME_PV3DPrs,bool)"); // MESSAGE( "SALOME_View::Erase( const SALOME_PV3DPrs& ) called! Probably, presentation is being erased in uncompatible viewframe." ); } @@ -485,7 +422,6 @@ void SALOME_View::Erase( const SALOME_PV3DPrs*, const bool ) */ void SALOME_View::Erase( const SALOME_Prs2d*, const bool ) { - MSGEL("...SALOME_View::Erase(SALOME_Prs2d,bool)"); // MESSAGE( "SALOME_View::Erase( const SALOME_Prs2d& ) called! Probably, presentation is being erased in uncompatible viewframe." ); } @@ -494,7 +430,6 @@ void SALOME_View::Erase( const SALOME_Prs2d*, const bool ) */ void SALOME_View::EraseAll( SALOME_Displayer* d, const bool ) { - DBG_FUN(); // MESSAGE( "SALOME_View::EraseAll() called!" ); if ( d ) d->UpdateVisibility( this, 0, false ); } @@ -504,7 +439,6 @@ void SALOME_View::EraseAll( SALOME_Displayer* d, const bool ) */ void SALOME_View::LocalSelection( const SALOME_OCCPrs*, const int ) { - MSGEL("...SALOME_View::LocalSelection(SALOME_OCCPrs,int)"); // MESSAGE( "SALOME_View::LocalSelection( const SALOME_OCCPrs* ) called! // Probably, selection is being activated in uncompatible viewframe." ); } @@ -514,7 +448,6 @@ void SALOME_View::LocalSelection( const SALOME_OCCPrs*, const int ) */ void SALOME_View::LocalSelection( const SALOME_OCCPrs*, const std::list ) { - MSGEL("...SALOME_View::LocalSelection(SALOME_OCCPrs,list)"); // MESSAGE( "SALOME_View::LocalSelection( const SALOME_OCCPrs* ) called! // Probably, selection is being activated in uncompatible viewframe." ); } @@ -524,7 +457,6 @@ void SALOME_View::LocalSelection( const SALOME_OCCPrs*, const std::list ) */ void SALOME_View::LocalSelection( const SALOME_VTKPrs*, const int ) { - MSGEL("...SALOME_View::LocalSelection(SALOME_VTKPrs,int)"); // MESSAGE( "SALOME_View::LocalSelection( const SALOME_VTKPrs* ) called! // Probably, selection is being activated in uncompatible viewframe." ); } @@ -534,7 +466,6 @@ void SALOME_View::LocalSelection( const SALOME_VTKPrs*, const int ) */ void SALOME_View::LocalSelection( const SALOME_PV3DPrs*, const int ) { - MSGEL("...SALOME_View::LocalSelection(SALOME_PV3DPrs,int)"); // MESSAGE( "SALOME_View::LocalSelection( const SALOME_PV3DPrs* ) called! // Probably, selection is being activated in uncompatible viewframe." ); } @@ -544,7 +475,6 @@ void SALOME_View::LocalSelection( const SALOME_PV3DPrs*, const int ) */ void SALOME_View::LocalSelection( const SALOME_Prs2d*, const int ) { - MSGEL("...SALOME_View::LocalSelection(SALOME_Prs2d,int)"); // MESSAGE( "SALOME_View::LocalSelection( const SALOME_Prs2d* ) called! // Probably, selection is being activated in uncompatible viewframe." ); } @@ -554,43 +484,35 @@ void SALOME_View::LocalSelection( const SALOME_Prs2d*, const int ) */ void SALOME_View::GlobalSelection( const bool ) const { - MSGEL("...SALOME_View::GlobalSelection(bool)"); // MESSAGE( "SALOME_View::GlobalSelection() called! // Probably, selection is being activated in uncompatible viewframe." ); } void SALOME_View::BeforeDisplay( SALOME_Displayer* d, const SALOME_Prs* p ) { - DBG_FUN(); p->BeforeDisplayIn( d, this ); } void SALOME_View::AfterDisplay( SALOME_Displayer* d, const SALOME_Prs* p ) { - DBG_FUN(); p->AfterDisplayIn( d, this ); } void SALOME_View::BeforeErase( SALOME_Displayer* d, const SALOME_Prs* p ) { - DBG_FUN(); p->BeforeEraseIn( d, this ); } void SALOME_View::AfterErase ( SALOME_Displayer* d, const SALOME_Prs* p ) { - DBG_FUN(); p->AfterEraseIn( d, this ); } -#undef MBCLASSNAME -#define MBCLASSNAME "SALOME_Displayer" /*! Gives control to SALOME_Prs object, so that it could perform double dispatch */ void SALOME_Displayer::UpdatePrs( SALOME_Prs* prs ) { - DBG_FUN(); prs->Update( this ); } @@ -599,7 +521,6 @@ void SALOME_Displayer::UpdatePrs( SALOME_Prs* prs ) */ void SALOME_Displayer::Update( SALOME_OCCPrs* ) { - MSGEL("...SALOME_Displayer::Update(SALOME_OCCPrs)"); // MESSAGE( "SALOME_Displayer::Update( SALOME_OCCPrs* ) called! Probably, presentation is being updated in uncompatible viewframe." ); } @@ -608,7 +529,6 @@ void SALOME_Displayer::Update( SALOME_OCCPrs* ) */ void SALOME_Displayer::Update( SALOME_VTKPrs* ) { - MSGEL("...SALOME_Displayer::Update(SALOME_VTKPrs)"); // MESSAGE( "SALOME_Displayer::Update( SALOME_VTKPrs* ) called! Probably, presentation is being updated in uncompatible viewframe." ); } @@ -617,7 +537,6 @@ void SALOME_Displayer::Update( SALOME_VTKPrs* ) */ void SALOME_Displayer::Update( SALOME_PV3DPrs* ) { - MSGEL("...SALOME_Displayer::Update(SALOME_PV3DPrs)"); // MESSAGE( "SALOME_Displayer::Update( SALOME_PV3DPrs* ) called! Probably, presentation is being updated in uncompatible viewframe." ); } @@ -626,7 +545,6 @@ void SALOME_Displayer::Update( SALOME_PV3DPrs* ) */ void SALOME_Displayer::Update( SALOME_Prs2d* ) { - MSGEL("...SALOME_Displayer::Update(SALOME_Prs2d)"); // MESSAGE( "SALOME_Displayer::Update( SALOME_Prs2d* ) called! Probably, presentation is being updated in uncompatible viewframe." ); } @@ -635,5 +553,4 @@ void SALOME_Displayer::Update( SALOME_Prs2d* ) */ void SALOME_Displayer::UpdateVisibility( SALOME_View*, const SALOME_Prs*, bool ) { - MSGEL("...SALOME_Displayer::UpdateVisibility(SALOME_View,SALOME_Prs,bool)"); } diff --git a/src/SOCC/MBDebug.h b/src/SOCC/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/SOCC/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/SOCC/SOCC_Prs.cxx b/src/SOCC/SOCC_Prs.cxx index bc70a8ac0..bc8004f36 100644 --- a/src/SOCC/SOCC_Prs.cxx +++ b/src/SOCC/SOCC_Prs.cxx @@ -28,20 +28,12 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SOCC_Prs" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Default constructor */ SOCC_Prs::SOCC_Prs( const char* entry ) : SALOME_OCCPrs( entry ) { - DBG_FUN(); - ARG(entry); myToActivate = true; } @@ -51,8 +43,6 @@ SOCC_Prs::SOCC_Prs( const char* entry ) SOCC_Prs::SOCC_Prs( const char* entry, const Handle(AIS_InteractiveObject)& obj ) : SALOME_OCCPrs( entry ) { - DBG_FUN(); - ARG(entry); AddObject( obj ); } @@ -61,7 +51,6 @@ SOCC_Prs::SOCC_Prs( const char* entry, const Handle(AIS_InteractiveObject)& obj */ SOCC_Prs::~SOCC_Prs() { - DBG_FUN(); myObjects.Clear(); } @@ -78,7 +67,6 @@ void SOCC_Prs::GetObjects( AIS_ListOfInteractive& list ) const */ void SOCC_Prs::AddObject( const Handle(AIS_InteractiveObject)& obj ) { - DBG_FUN(); myObjects.Append( obj ); } @@ -87,7 +75,6 @@ void SOCC_Prs::AddObject( const Handle(AIS_InteractiveObject)& obj ) */ void SOCC_Prs::PrependObject( const Handle(AIS_InteractiveObject)& obj ) { - DBG_FUN(); myObjects.Prepend( obj ); } @@ -96,7 +83,6 @@ void SOCC_Prs::PrependObject( const Handle(AIS_InteractiveObject)& obj ) */ void SOCC_Prs::RemoveFirst() { - DBG_FUN(); myObjects.RemoveFirst(); } @@ -105,7 +91,6 @@ void SOCC_Prs::RemoveFirst() */ void SOCC_Prs::Clear() { - DBG_FUN(); myObjects.Clear(); } diff --git a/src/SOCC/SOCC_ViewModel.cxx b/src/SOCC/SOCC_ViewModel.cxx index 772324fa7..5c2c59802 100644 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -49,12 +49,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SOCC_Viewer" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor \param DisplayTrihedron - is trihedron displayed @@ -62,7 +56,6 @@ SOCC_Viewer::SOCC_Viewer( bool DisplayTrihedron ) : OCCViewer_Viewer( DisplayTrihedron ) { - DBG_FUN(); } /*! @@ -70,7 +63,6 @@ SOCC_Viewer::SOCC_Viewer( bool DisplayTrihedron ) */ SOCC_Viewer::~SOCC_Viewer() { - DBG_FUN(); } /*! @@ -160,7 +152,6 @@ bool SOCC_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& obj ) void SOCC_Viewer::setColor( const Handle(SALOME_InteractiveObject)& obj, const QColor& color, bool update ) { - DBG_FUN(); if(obj.IsNull() || !obj->hasEntry() ) return; @@ -187,7 +178,6 @@ void SOCC_Viewer::setColor( const Handle(SALOME_InteractiveObject)& obj, void SOCC_Viewer::switchRepresentation( const Handle(SALOME_InteractiveObject)& obj, int mode, bool update ) { - DBG_FUN(); if(obj.IsNull() || !obj->hasEntry() ) return; @@ -214,7 +204,6 @@ void SOCC_Viewer::switchRepresentation( const Handle(SALOME_InteractiveObject)& void SOCC_Viewer::setTransparency( const Handle(SALOME_InteractiveObject)& obj, float trans, bool update ) { - DBG_FUN(); if(obj.IsNull() || !obj->hasEntry() ) return; @@ -240,7 +229,6 @@ void SOCC_Viewer::setTransparency( const Handle(SALOME_InteractiveObject)& obj, void SOCC_Viewer::rename( const Handle(SALOME_InteractiveObject)& obj, const QString& name ) { - DBG_FUN(); AIS_ListOfInteractive List; getAISContext()->DisplayedObjects(List); @@ -278,7 +266,6 @@ void SOCC_Viewer::rename( const Handle(SALOME_InteractiveObject)& obj, */ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs ) { - DBG_FUN(); // try do downcast object const SOCC_Prs* anOCCPrs = dynamic_cast( prs ); if ( !anOCCPrs || anOCCPrs->IsNull() ) @@ -378,7 +365,6 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs ) */ void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool /*forced*/ ) { - DBG_FUN(); // try do downcast object const SOCC_Prs* anOCCPrs = dynamic_cast( prs ); if ( !anOCCPrs || anOCCPrs->IsNull() ) @@ -422,7 +408,6 @@ void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool /*forced*/ ) */ void SOCC_Viewer::EraseAll( SALOME_Displayer* d, const bool forced ) { - DBG_FUN(); // get context Handle(AIS_InteractiveContext) ic = getAISContext(); @@ -470,8 +455,6 @@ void SOCC_Viewer::EraseAll( SALOME_Displayer* d, const bool forced ) */ SALOME_Prs* SOCC_Viewer::CreatePrs( const char* entry ) { - DBG_FUN(); - ARG(entry); SOCC_Prs* prs = new SOCC_Prs(entry); if ( entry ) { @@ -500,7 +483,6 @@ SALOME_Prs* SOCC_Viewer::CreatePrs( const char* entry ) */ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::list modes ) { - DBG_FUN(); Handle(AIS_InteractiveContext) ic = getAISContext(); const SOCC_Prs* anOCCPrs = dynamic_cast( thePrs ); @@ -555,7 +537,6 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::list modes; modes.push_back( theMode ); LocalSelection( thePrs, modes ); @@ -566,7 +547,6 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const int theMode */ void SOCC_Viewer::GlobalSelection( const bool update ) const { - DBG_FUN(); Handle(AIS_InteractiveContext) ic = getAISContext(); if ( !ic.IsNull() ) { @@ -624,6 +604,5 @@ void SOCC_Viewer::Repaint() */ OCCViewer_ViewWindow* SOCC_Viewer::createSubWindow() { - DBG_FUN(); return new SOCC_ViewWindow( 0, this); } diff --git a/src/SOCC/SOCC_ViewWindow.cxx b/src/SOCC/SOCC_ViewWindow.cxx index 42fc34ddf..b3ce040a8 100644 --- a/src/SOCC/SOCC_ViewWindow.cxx +++ b/src/SOCC/SOCC_ViewWindow.cxx @@ -26,12 +26,6 @@ #include "SUIT_Accel.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SOCC_ViewWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ @@ -40,7 +34,6 @@ SOCC_ViewWindow OCCViewer_Viewer* theModel) : OCCViewer_ViewWindow( theDesktop, theModel ) { - DBG_FUN(); } /*! @@ -49,7 +42,6 @@ SOCC_ViewWindow SOCC_ViewWindow ::~SOCC_ViewWindow() { - DBG_FUN(); } /*! @@ -60,7 +52,6 @@ bool SOCC_ViewWindow ::action( const int theAction ) { - MSGEL("...SOCC_ViewWindow::action(" << theAction << ")"); const int inc = 10; int cx = 0, cy = 0; if ( theAction == SUIT_Accel::ZoomIn || theAction == SUIT_Accel::ZoomOut || diff --git a/src/SPV3D/SPV3D_Prs.cxx b/src/SPV3D/SPV3D_Prs.cxx index f06108fef..60520b935 100644 --- a/src/SPV3D/SPV3D_Prs.cxx +++ b/src/SPV3D/SPV3D_Prs.cxx @@ -36,13 +36,6 @@ #include "vtkPVTrivialProducer.h" #include - -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SPV3D_Prs" -#include "MBDebug.h" -//--------------------------------------------------------- - bool SPV3D_EXPORTSPV3DData::IsVisible() const { if( IsNull() ) @@ -116,8 +109,7 @@ void SPV3D_Prs::FillUsingActor(vtkActor *actor) const } SPV3D_Prs:: ~SPV3D_Prs() -{ - DBG_FUN(); +{ } void SPV3D_Prs::DisplayIn( SALOME_View* v ) const diff --git a/src/SPV3D/SPV3D_ViewManager.cxx b/src/SPV3D/SPV3D_ViewManager.cxx index ddb9d7033..ad59d4371 100644 --- a/src/SPV3D/SPV3D_ViewManager.cxx +++ b/src/SPV3D/SPV3D_ViewManager.cxx @@ -43,19 +43,12 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SPV3D_ViewManager" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ SPV3D_ViewManager::SPV3D_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop ) : SUIT_ViewManager( study, theDesktop, new SPV3D_ViewModel() ) { - DBG_FUN(); setTitle( SPV3D_ViewManager::tr( "PARAVIEW3D_VIEW_TITLE" ) ); /*QStringList args = QCoreApplication::arguments(); int argc = args.length(); @@ -89,7 +82,6 @@ SPV3D_ViewManager::SPV3D_ViewManager( SUIT_Study* study, SUIT_Desktop* theDeskto */ SPV3D_ViewManager::~SPV3D_ViewManager() { - DBG_FUN(); } /*! @@ -104,7 +96,6 @@ SUIT_Desktop* SPV3D_ViewManager::getDesktop() */ void SPV3D_ViewManager::onWindowActivated(SUIT_ViewWindow* view) { - DBG_FUN(); if (view) { SPV3D_ViewWindow* pvWindow = dynamic_cast(view); diff --git a/src/SPV3D/SPV3D_ViewModel.cxx b/src/SPV3D/SPV3D_ViewModel.cxx index 2e084f496..6827398b4 100644 --- a/src/SPV3D/SPV3D_ViewModel.cxx +++ b/src/SPV3D/SPV3D_ViewModel.cxx @@ -63,18 +63,11 @@ // VSR: Uncomment below line to allow texture background support in PV3D viewer #define PV3D_ENABLE_TEXTURED_BACKGROUND -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SPV3D_ViewModel" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ SPV3D_ViewModel::SPV3D_ViewModel() { - DBG_FUN(); mySelectionEnabled = true; } @@ -83,13 +76,11 @@ SPV3D_ViewModel::SPV3D_ViewModel() */ SPV3D_ViewModel::~SPV3D_ViewModel() { - DBG_FUN(); } void SPV3D_ViewModel::initialize() { - DBG_FUN(); } void SPV3D_ViewModel::render() const @@ -103,7 +94,6 @@ void SPV3D_ViewModel::render() const */ SUIT_ViewWindow* SPV3D_ViewModel::createView( SUIT_Desktop* theDesktop ) { - DBG_FUN(); SPV3D_ViewWindow* aViewWindow = new SPV3D_ViewWindow(theDesktop, this); aViewWindow->SetSelectionEnabled( isSelectionEnabled() ); @@ -127,7 +117,6 @@ SUIT_ViewWindow* SPV3D_ViewModel::createView( SUIT_Desktop* theDesktop ) */ void SPV3D_ViewModel::setViewManager(SUIT_ViewManager* theViewManager) { - DBG_FUN(); SUIT_ViewModel::setViewManager(theViewManager); if ( !theViewManager ) @@ -151,8 +140,6 @@ void SPV3D_ViewModel::setViewManager(SUIT_ViewManager* theViewManager) */ void SPV3D_ViewModel::contextMenuPopup( QMenu */*thePopup*/ ) { - DBG_FUN(); - // NYI } @@ -180,8 +167,6 @@ void SPV3D_ViewModel::onMouseRelease(SUIT_ViewWindow* /*vw*/, QMouseEvent* /*eve */ void SPV3D_ViewModel::enableSelection(bool isEnabled) { - DBG_FUN(); - ARG(isEnabled); mySelectionEnabled = isEnabled; //!! To be done for view windows if (SUIT_ViewManager* aViewManager = getViewManager()) { @@ -217,8 +202,6 @@ pqView *SPV3D_ViewModel::getView() const */ void SPV3D_ViewModel::Display( const SALOME_PV3DPrs* prs ) { - DBG_FUN(); - if(const SPV3D_Prs* aPrs = dynamic_cast( prs )) { if( !aPrs->GetRepresentation() ) @@ -252,8 +235,6 @@ void SPV3D_ViewModel::Display( const SALOME_PV3DPrs* prs ) */ void SPV3D_ViewModel::Erase( const SALOME_PV3DPrs* prs, const bool /*forced*/ ) { - DBG_FUN(); - // NYI - hide a source if(const SPV3D_Prs* aPrs = dynamic_cast( prs )){ if(aPrs->IsNull()) @@ -272,8 +253,6 @@ void SPV3D_ViewModel::Erase( const SALOME_PV3DPrs* prs, const bool /*forced*/ ) */ void SPV3D_ViewModel::EraseAll( SALOME_Displayer* d, const bool forced ) { - DBG_FUN(); - SALOME_View::EraseAll( d, forced ); if(SPV3D_ViewWindow* aViewWindow = dynamic_cast(getViewManager()->getActiveView())) aViewWindow->EraseAll(); @@ -286,8 +265,6 @@ void SPV3D_ViewModel::EraseAll( SALOME_Displayer* d, const bool forced ) */ SALOME_Prs* SPV3D_ViewModel::CreatePrs( const char* entry ) { - DBG_FUN(); - ARG(entry); if(SPV3D_ViewWindow* aViewWindow = dynamic_cast(getViewManager()->getActiveView())) { return aViewWindow->findOrCreatePrs( entry ); @@ -320,14 +297,11 @@ void SPV3D_ViewModel::GetVisible( SALOME_ListIO &/*theList*/ ) */ void SPV3D_ViewModel::Repaint() { - DBG_FUN(); - // NYI } void SPV3D_ViewModel::onViewCreated( SUIT_ViewWindow */*view*/) { - DBG_FUN(); #ifdef VGL_WORKAROUND if ( SPV3D_ViewWindow* svw = dynamic_cast( view ) ) QTimer::singleShot(500, [svw] () { svw->Repaint(); } ); @@ -337,19 +311,13 @@ void SPV3D_ViewModel::onViewCreated( SUIT_ViewWindow */*view*/) { //----------------------------------------------------------------------------- void SPV3D_ViewModel::onSourceCreated(pqPipelineSource* source) { - MSGEL("-----> SLOT(onSourceCreated)"); - DBG_FUN(); - std::string sourceXMLName(source->getSourceProxy()->GetXMLName()); - SHOW(sourceXMLName); - SHOW((sourceXMLName=="CubeSource")); pqObjectBuilder* builder = pqApplicationCore::instance()->getObjectBuilder(); if (sourceXMLName == "XMLPolyDataReader" || sourceXMLName == "GeometryGenerator" || sourceXMLName == "ShapeSource" || sourceXMLName == "CubeSource") { if (this->GeometrySource) { if (this->GeometrySource == source) { - MSGEL("ERROR: onSourceCreated called more than once for same source!!"); } else builder->destroy(this->GeometrySource); @@ -367,9 +335,6 @@ void SPV3D_ViewModel::onSourceCreated(pqPipelineSource* source) //----------------------------------------------------------------------------- void SPV3D_ViewModel::showSelectedMode() { - MSGEL("-----> SLOT(showSelectedMode)"); - DBG_FUN(); - vtkNew controller; pqView* activeView = pqActiveObjects::instance().activeView(); if (activeView) diff --git a/src/SPV3D/SPV3D_ViewWindow.cxx b/src/SPV3D/SPV3D_ViewWindow.cxx index b8f00272a..5bf2d895d 100644 --- a/src/SPV3D/SPV3D_ViewWindow.cxx +++ b/src/SPV3D/SPV3D_ViewWindow.cxx @@ -59,16 +59,9 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SPV3D_ViewWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - // Use workaround for rendering transparent object over MESA #define USE_WORKAROUND_FOR_MESA - /*! Constructor */ @@ -76,7 +69,6 @@ SPV3D_ViewWindow::SPV3D_ViewWindow(SUIT_Desktop* theDesktop, SPV3D_ViewModel* th PV3DViewer_ViewWindow(theDesktop, theModel), myModel(theModel) { - DBG_FUN(); } #include @@ -280,7 +272,6 @@ SPV3D_EXPORTSPV3DData *SPV3D_ViewWindow::isEntryAlreadyExist( const char* entry */ SPV3D_ViewWindow::~SPV3D_ViewWindow() { - DBG_FUN(); } bool SPV3D_ViewWindow::isVisible(const Handle(SALOME_InteractiveObject)& theIObject) @@ -302,7 +293,6 @@ bool SPV3D_ViewWindow::isVisible(const Handle(SALOME_InteractiveObject)& theIObj void SPV3D_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& /*theIO*/, bool /*theImmediatly*/) { - DBG_FUN(); } /*! @@ -313,7 +303,6 @@ void SPV3D_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& /*theIO*/ void SPV3D_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& /*theIO*/, bool /*theImmediatly*/) { - DBG_FUN(); } /*! @@ -322,7 +311,6 @@ void SPV3D_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& /*theIO*/, */ void SPV3D_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& /*theIO*/) { - DBG_FUN(); } @@ -331,7 +319,6 @@ void SPV3D_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& /*the */ void SPV3D_ViewWindow::DisplayAll() { - DBG_FUN(); } /*! @@ -339,7 +326,6 @@ void SPV3D_ViewWindow::DisplayAll() */ void SPV3D_ViewWindow::EraseAll() { - DBG_FUN(); for(auto& prs : myPrs) { prs.second->Hide(); @@ -363,7 +349,6 @@ void SPV3D_ViewWindow::Repaint(bool )//(bool theUpdateTrihedron) */ void SPV3D_ViewWindow::SetSelectionEnabled( bool /*theEnable*/ ) { - DBG_FUN(); } /*! @@ -395,7 +380,6 @@ void SPV3D_ViewWindow::onMousePressed(QMouseEvent* event) */ void SPV3D_ViewWindow::onMouseReleased(QMouseEvent* event) { - DBG_FUN(); emit mouseReleased( this, event ); } @@ -412,7 +396,6 @@ void SPV3D_ViewWindow::onMouseMoving(QMouseEvent* event) */ void SPV3D_ViewWindow::onMouseDoubleClicked( QMouseEvent* event ) { - MSGEL("-----> emit mouseDoubleClicked <-----"); emit mouseDoubleClicked( this, event ); } @@ -421,8 +404,6 @@ void SPV3D_ViewWindow::onMouseDoubleClicked( QMouseEvent* event ) */ void SPV3D_ViewWindow::showEvent( QShowEvent * theEvent ) { - DBG_FUN(); - MSGEL("-----> emit Show <-----"); emit Show( theEvent ); } @@ -431,7 +412,5 @@ void SPV3D_ViewWindow::showEvent( QShowEvent * theEvent ) */ void SPV3D_ViewWindow::hideEvent( QHideEvent * theEvent ) { - DBG_FUN(); - MSGEL("-----> emit Hide <-----"); emit Hide( theEvent ); } diff --git a/src/SUIT/MBDebug.h b/src/SUIT/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/SUIT/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/SUIT/MBSUIT.h b/src/SUIT/MBSUIT.h deleted file mode 100644 index 25e331eeb..000000000 --- a/src/SUIT/MBSUIT.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef MBSUIT_H -#define MBSUIT_H - -#include "SUIT_DataObject.h" - - -//========================================================================== -static void DumpVar(const char *szName, const SUIT_DataObject *value) { - if (value) { - DLOG << "[DataObj]: " << szName << "=" << (void*)value << " name=\"" << value->name().toStdString() << "\" level=" << value->level() - << " pos=" << value->position() << " #child=" << value->childCount() << " what=\"" << value->whatsThis().toStdString() << "\"" << std::endl; - } - else { - DLOG << "[DataObj]: " << szName << "=null" << std::endl; - } -} - -#endif // MBSUIT_H \ No newline at end of file diff --git a/src/SUIT/SUIT_ActionOperation.cxx b/src/SUIT/SUIT_ActionOperation.cxx index 3fab6d9dd..1dc646855 100644 --- a/src/SUIT/SUIT_ActionOperation.cxx +++ b/src/SUIT/SUIT_ActionOperation.cxx @@ -26,12 +26,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SUIT_ActionOperation" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor. */ @@ -39,7 +33,6 @@ SUIT_ActionOperation::SUIT_ActionOperation( SUIT_Application* app ) : SUIT_Operation( app ), myAction( 0 ) { - DBG_FUN(); } /*! @@ -47,7 +40,6 @@ myAction( 0 ) */ SUIT_ActionOperation::~SUIT_ActionOperation() { - DBG_FUN(); } /*! @@ -65,7 +57,6 @@ void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon, const QString& menuText, QKeySequence accel, QObject* parent, bool toggle ) { - MSGEL("...SUIT_ActionOperation::setAction(\"" << text.toStdString() << "\", \"" << menuText.toStdString() << "\""); setAction( new QtxAction( text, icon, menuText, accel, parent, toggle ) ); } @@ -75,7 +66,6 @@ void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon, void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText, QKeySequence accel, QObject* parent, bool toggle ) { - MSGEL("...SUIT_ActionOperation::setAction(\"" << text.toStdString() << "\", \"" << menuText.toStdString() << "\""); setAction( new QtxAction( text, menuText, accel, parent, toggle ) ); } diff --git a/src/SUIT/SUIT_Application.cxx b/src/SUIT/SUIT_Application.cxx index 048b98087..07c933c68 100644 --- a/src/SUIT/SUIT_Application.cxx +++ b/src/SUIT/SUIT_Application.cxx @@ -38,12 +38,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SUIT_Application" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! \class StatusLabel @@ -67,7 +61,6 @@ SUIT_Application::SUIT_Application() myStatusLabel( 0 ), myPostRoutines( QList() ) { - DBG_FUN(); if ( SUIT_Session::session() ) SUIT_Session::session()->insertApplication( this ); } @@ -77,7 +70,6 @@ SUIT_Application::SUIT_Application() */ SUIT_Application::~SUIT_Application() { - DBG_FUN(); SUIT_Study* s = myStudy; setActiveStudy( 0 ); delete s; @@ -111,8 +103,6 @@ bool SUIT_Application::isPossibleToClose( bool& ) */ void SUIT_Application::closeApplication() { - DBG_FUN(); - MSGEL("-----> emit applicationClosed <-----"); emit applicationClosed( this ); } @@ -137,7 +127,6 @@ QString SUIT_Application::applicationVersion() const */ void SUIT_Application::start() { - DBG_FUN(); if ( desktop() ) desktop()->show(); @@ -151,9 +140,6 @@ void SUIT_Application::start() */ bool SUIT_Application::useFile( const QString& theFileName ) { - DBG_FUN(); - ARG(theFileName); - createEmptyStudy(); SUIT_Study* study = activeStudy(); @@ -173,7 +159,6 @@ bool SUIT_Application::useFile( const QString& theFileName ) */ void SUIT_Application::createEmptyStudy() { - DBG_FUN(); if ( !activeStudy() ) setActiveStudy( createNewStudy() ); } @@ -216,8 +201,6 @@ SUIT_ShortcutMgr* SUIT_Application::shortcutMgr() const */ void SUIT_Application::putInfo( const QString& msg, const int msec ) { - DBG_FUN(); - ARG(msg); if ( !desktop() ) return; @@ -243,7 +226,6 @@ void SUIT_Application::putInfo( const QString& msg, const int msec ) */ void SUIT_Application::onInfoClear() { - DBG_FUN(); if ( !myStatusLabel ) return; @@ -267,7 +249,6 @@ void SUIT_Application::updateCommandsStatus() */ SUIT_Application* SUIT_Application::startApplication( int argc, char** argv ) const { - DBG_FUN(); return startApplication( objectName(), argc, argv ); } @@ -279,8 +260,6 @@ SUIT_Application* SUIT_Application::startApplication( int argc, char** argv ) co */ SUIT_Application* SUIT_Application::startApplication( const QString& name, int argc, char** argv ) const { - DBG_FUN(); - ARG(name); SUIT_Session* session = SUIT_Session::session(); if ( !session ) return 0; @@ -294,7 +273,6 @@ SUIT_Application* SUIT_Application::startApplication( const QString& name, int a */ void SUIT_Application::setDesktop( SUIT_Desktop* desk ) { - DBG_FUN(); if ( myDesktop == desk ) return; @@ -317,7 +295,6 @@ void SUIT_Application::setDesktop( SUIT_Desktop* desk ) */ SUIT_Study* SUIT_Application::createNewStudy() { - DBG_FUN(); return new SUIT_Study( this ); } @@ -327,7 +304,6 @@ SUIT_Study* SUIT_Application::createNewStudy() */ void SUIT_Application::setActiveStudy( SUIT_Study* study ) { - DBG_FUN(); if ( myStudy == study ) return; @@ -691,7 +667,6 @@ QAction* SUIT_Application::createAction( const int id, const QString& text, cons QObject* parent, const bool toggle, QObject* reciever, const char* member, const QString& shortcutAction ) { - MSGEL("...SUIT_Application::createAction(menu=\"" << menu.toStdString() << "\", text=\"" << text.toStdString() << "\""); QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction ); a->setStatusTip( tip ); @@ -710,7 +685,6 @@ QAction* SUIT_Application::createAction( const int id, const QString& text, cons */ int SUIT_Application::registerAction( const int id, QAction* a ) { - MSGEL("...registerAction(" << id << ")"); int ident = actionId( a ); if ( ident != -1 ) return ident; @@ -750,8 +724,6 @@ QAction* SUIT_Application::separator() void SUIT_Application::onDesktopActivated() { - DBG_FUN(); - MSGEL("-----> emit activated <-----"); emit activated( this ); } @@ -773,7 +745,6 @@ void SUIT_Application::onHelpContextModule( const QString& /*theComponentName*/, void SUIT_Application::addPostRoutine( PostRoutine theRoutine ) { - DBG_FUN(); if ( !myPostRoutines.contains( theRoutine ) ) myPostRoutines << theRoutine; } diff --git a/src/SUIT/SUIT_DataBrowser.cxx b/src/SUIT/SUIT_DataBrowser.cxx index a9ee7a47c..190e4a633 100644 --- a/src/SUIT/SUIT_DataBrowser.cxx +++ b/src/SUIT/SUIT_DataBrowser.cxx @@ -26,13 +26,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SUIT_DataBrowser" -#include "MBDebug.h" -#include "MBSUIT.h" -//--------------------------------------------------------- - /*! \class SUIT_DataBrowser \brief Object browser customization. @@ -45,7 +38,6 @@ SUIT_DataBrowser::SUIT_DataBrowser( QWidget* parent ) : OB_Browser( parent ) { - DBG_FUN(); init( 0 ); } @@ -57,8 +49,6 @@ SUIT_DataBrowser::SUIT_DataBrowser( QWidget* parent ) SUIT_DataBrowser::SUIT_DataBrowser( SUIT_DataObject* root, QWidget* parent ) : OB_Browser( parent ) { - DBG_FUN(); - ARG(root); init( root ); } @@ -67,7 +57,6 @@ SUIT_DataBrowser::SUIT_DataBrowser( SUIT_DataObject* root, QWidget* parent ) */ SUIT_DataBrowser::~SUIT_DataBrowser() { - DBG_FUN(); } /*! @@ -95,8 +84,6 @@ SUIT_DataObject* SUIT_DataBrowser::root() const */ void SUIT_DataBrowser::setRoot( SUIT_DataObject* r ) { - DBG_FUN(); - ARG(r); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) m->setRoot( r ); @@ -124,8 +111,6 @@ bool SUIT_DataBrowser::autoUpdate() const */ void SUIT_DataBrowser::setAutoUpdate( const bool on ) { - DBG_FUN(); - ARG(on); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) m->setAutoUpdate( on ); @@ -147,8 +132,6 @@ bool SUIT_DataBrowser::updateModified() const */ void SUIT_DataBrowser::setUpdateModified( const bool on ) { - DBG_FUN(); - ARG(on); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) m->setUpdateModified( on ); @@ -162,8 +145,6 @@ void SUIT_DataBrowser::setUpdateModified( const bool on ) */ void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool /*autoOpen*/ ) { - DBG_FUN(); - ARG(obj); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) { m->updateTree( obj ); @@ -174,7 +155,6 @@ void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool /*autoOpen*/ if (myAutoSizeColumns) adjustColumnsWidth(); } - MSGEL("-----> emit updated <-----"); emit updated(); } @@ -244,9 +224,6 @@ void SUIT_DataBrowser::getSelected( DataObjectList& lst ) const */ void SUIT_DataBrowser::setSelected( const SUIT_DataObject* obj, const bool append ) { - DBG_FUN(); - ARG(obj); - ARG(append); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) { @@ -276,8 +253,6 @@ bool modelIndexLessThan(const QModelIndex& lhs, const QModelIndex& rhs) */ void SUIT_DataBrowser::setSelected( const DataObjectList& lst, const bool append ) { - DBG_FUN(); - ARG(append); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) { @@ -315,7 +290,6 @@ void SUIT_DataBrowser::ensureVisible( SUIT_DataObject* obj ) */ void SUIT_DataBrowser::ensureVisible( const DataObjectList& lst ) { - DBG_FUN(); QtxTreeView* tv = treeView(); SUIT_AbstractModel* treeModel = dynamic_cast( model() ); if ( !tv || !treeModel ) @@ -335,7 +309,6 @@ void SUIT_DataBrowser::ensureVisible( const DataObjectList& lst ) */ void SUIT_DataBrowser::contextMenuPopup( QMenu* menu ) { - DBG_FUN(); createPopupMenu( menu ); } @@ -373,7 +346,6 @@ void SUIT_DataBrowser::setAutoSizeColumns( const bool on ) */ void SUIT_DataBrowser::contextMenuEvent( QContextMenuEvent* e ) { - DBG_FUN(); contextMenuRequest( e ); } @@ -396,8 +368,6 @@ void SUIT_DataBrowser::setResizeOnExpandItem( const bool on ) */ void SUIT_DataBrowser::init( SUIT_DataObject* root ) { - DBG_FUN(); - ARG(root); SUIT_ProxyModel* m = new SUIT_ProxyModel( root, this ); connect( m, SIGNAL( modelUpdated() ), this, SLOT( onModelUpdated() ) ); @@ -458,7 +428,6 @@ void SUIT_DataBrowser::init( SUIT_DataObject* root ) */ void SUIT_DataBrowser::onModelUpdated() { - DBG_FUN(); setModified(); } @@ -470,14 +439,11 @@ void SUIT_DataBrowser::onModelUpdated() */ void SUIT_DataBrowser::onClicked( const QModelIndex& index ) { - DBG_FUN(); - MSGEL("in:[MdlIdx]: index={row=" << index.row() << ", col=" << index.column() << "}"); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) { SUIT_DataObject* obj = m->object( index ); if ( obj ) { - SHOW(obj); emit( clicked( obj ) ); m->emitClicked(obj, index); } @@ -492,13 +458,10 @@ void SUIT_DataBrowser::onClicked( const QModelIndex& index ) */ void SUIT_DataBrowser::onDblClicked( const QModelIndex& index ) { - DBG_FUN(); - MSGEL("in:[MdlIdx]: index={row=" << index.row() << ", col=" << index.column() << "}"); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) { SUIT_DataObject* obj = m->object( index ); - SHOW(obj); if ( obj ) emit( doubleClicked( obj ) ); } } @@ -509,7 +472,6 @@ void SUIT_DataBrowser::onDblClicked( const QModelIndex& index ) */ void SUIT_DataBrowser::onExpanded( const QModelIndex& /*index*/ ) { - DBG_FUN(); if (myResizeOnExpandItem) { adjustFirstColumnWidth(); adjustColumnsWidth(); @@ -521,7 +483,6 @@ void SUIT_DataBrowser::onExpanded( const QModelIndex& /*index*/ ) \internal */ void SUIT_DataBrowser::onStartEditing() { - DBG_FUN(); DataObjectList sel = getSelected(); SUIT_ProxyModel* m = qobject_cast( model() ); if(treeView() && m && sel.count() == 1){ diff --git a/src/SUIT/SUIT_SelectionMgr.cxx b/src/SUIT/SUIT_SelectionMgr.cxx index 008bdab38..17dfa646c 100644 --- a/src/SUIT/SUIT_SelectionMgr.cxx +++ b/src/SUIT/SUIT_SelectionMgr.cxx @@ -25,12 +25,6 @@ #include "SUIT_Selector.h" #include "SUIT_SelectionFilter.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SUIT_SelectionMgr" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!\class SUIT_SelectionMgr * Provide selection manager. Manipulate by selection filters, modes, data owners. */ @@ -42,13 +36,11 @@ myIterations( Feedback ? 1 : 0 ), myAutoDelFilter( false ), myIsSelChangeEnabled( true ) { - DBG_FUN(); } /*!destructor. mySelectors auto delete.*/ SUIT_SelectionMgr::~SUIT_SelectionMgr() { - DBG_FUN(); while( !mySelectors.empty() ) { SelectorList::iterator it = mySelectors.begin(); delete *it; @@ -58,7 +50,6 @@ SUIT_SelectionMgr::~SUIT_SelectionMgr() /*!Add selector \a sel to selectors list,if it's not exists in list.*/ void SUIT_SelectionMgr::installSelector( SUIT_Selector* sel ) { - DBG_FUN(); if ( sel && !mySelectors.contains( sel ) ) mySelectors.append( sel ); } @@ -66,14 +57,12 @@ void SUIT_SelectionMgr::installSelector( SUIT_Selector* sel ) /*!Remove selector \a sel from list.*/ void SUIT_SelectionMgr::removeSelector( SUIT_Selector* sel ) { - DBG_FUN(); mySelectors.removeAll( sel ); } /*!Gets selectors list to \a lst.*/ void SUIT_SelectionMgr::selectors( QList& lst ) const { - DBG_FUN(); lst.clear(); for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it ) lst.append( *it ); @@ -82,8 +71,6 @@ void SUIT_SelectionMgr::selectors( QList& lst ) const /*!Gets selectors list to \a lst with type \a typ.*/ void SUIT_SelectionMgr::selectors( const QString& typ, QList& lst ) const { - DBG_FUN(); - ARG(typ); lst.clear(); for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it ) { @@ -96,9 +83,6 @@ void SUIT_SelectionMgr::selectors( const QString& typ, QList& ls */ void SUIT_SelectionMgr::setEnabled( const bool on, const QString& typ ) { - DBG_FUN(); - ARG(on); - ARG(typ); for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it ) { if ( typ.isEmpty() || (*it)->type() == typ ) @@ -110,8 +94,6 @@ void SUIT_SelectionMgr::setEnabled( const bool on, const QString& typ ) */ void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst, const QString& type, const bool onlyOne ) const { - DBG_FUN(); - ARG(type); lst.clear(); for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it ) @@ -147,7 +129,6 @@ void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst, const QString& typ */ void SUIT_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const bool append ) { - DBG_FUN(); SUIT_DataOwnerPtrList owners; filterOwners( lst, owners ); @@ -168,7 +149,6 @@ void SUIT_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const boo */ void SUIT_SelectionMgr::clearSelected() { - DBG_FUN(); setSelected( SUIT_DataOwnerPtrList() ); } @@ -176,7 +156,6 @@ void SUIT_SelectionMgr::clearSelected() */ void SUIT_SelectionMgr::selectionChanged( SUIT_Selector* sel ) { - DBG_FUN(); if ( !sel || !myIsSelChangeEnabled || !sel->isEnabled() ) return; @@ -229,8 +208,6 @@ void SUIT_SelectionMgr::selectionModes( QList& vals ) const */ void SUIT_SelectionMgr::setSelectionModes( const int mode ) { - DBG_FUN(); - ARG(mode); QList lst; lst.append( mode ); setSelectionModes( lst ); @@ -240,7 +217,6 @@ void SUIT_SelectionMgr::setSelectionModes( const int mode ) */ void SUIT_SelectionMgr::setSelectionModes( const QList& lst ) { - DBG_FUN(); mySelModes = lst; } @@ -248,8 +224,6 @@ void SUIT_SelectionMgr::setSelectionModes( const QList& lst ) */ void SUIT_SelectionMgr::appendSelectionModes( const int mode ) { - DBG_FUN(); - ARG(mode); QList lst; lst.append( mode ); appendSelectionModes( lst ); @@ -259,7 +233,6 @@ void SUIT_SelectionMgr::appendSelectionModes( const int mode ) */ void SUIT_SelectionMgr::appendSelectionModes( const QList& lst ) { - DBG_FUN(); QMap map; for ( QList::const_iterator it = mySelModes.begin(); it != mySelModes.end(); ++it ) map.insert( *it, 0 ); @@ -275,8 +248,6 @@ void SUIT_SelectionMgr::appendSelectionModes( const QList& lst ) */ void SUIT_SelectionMgr::removeSelectionModes( const int mode ) { - DBG_FUN(); - ARG(mode); QList lst; lst.append( mode ); removeSelectionModes( lst ); @@ -286,7 +257,6 @@ void SUIT_SelectionMgr::removeSelectionModes( const int mode ) */ void SUIT_SelectionMgr::removeSelectionModes( const QList& lst ) { - DBG_FUN(); QMap map; for ( QList::const_iterator it = mySelModes.begin(); it != mySelModes.end(); ++it ) map.insert( *it, 0 ); @@ -334,7 +304,6 @@ bool SUIT_SelectionMgr::hasFilter( SUIT_SelectionFilter* f ) const */ void SUIT_SelectionMgr::installFilter( SUIT_SelectionFilter* f, const bool updateSelection ) { - DBG_FUN(); if ( !hasFilter( f ) ) { SUIT_DataOwnerPtrList selOwners; @@ -352,7 +321,6 @@ void SUIT_SelectionMgr::installFilter( SUIT_SelectionFilter* f, const bool updat */ void SUIT_SelectionMgr::removeFilter( SUIT_SelectionFilter* f ) { - DBG_FUN(); if ( !myFilters.contains( f ) ) return; @@ -366,7 +334,6 @@ void SUIT_SelectionMgr::removeFilter( SUIT_SelectionFilter* f ) */ void SUIT_SelectionMgr::clearFilters() { - DBG_FUN(); if ( autoDeleteFilter() ) { for ( SelFilterList::const_iterator it = myFilters.begin(); it != myFilters.end(); ++it ) @@ -387,8 +354,6 @@ bool SUIT_SelectionMgr::autoDeleteFilter() const */ void SUIT_SelectionMgr::setAutoDeleteFilter( const bool on ) { - DBG_FUN(); - ARG(on); myAutoDelFilter = on; } @@ -402,4 +367,4 @@ void SUIT_SelectionMgr::filterOwners( const SUIT_DataOwnerPtrList& in, SUIT_Data if ( isOk( *it ) ) out.append( *it ); } -} +} \ No newline at end of file diff --git a/src/SUIT/SUIT_Selector.cxx b/src/SUIT/SUIT_Selector.cxx index 29376dc2c..0d103479c 100644 --- a/src/SUIT/SUIT_Selector.cxx +++ b/src/SUIT/SUIT_Selector.cxx @@ -26,12 +26,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SUIT_Selector" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!\class SUIT_Selector::Destroyer Class provide the watching for qobject parent class of the selector. */ @@ -49,18 +43,14 @@ private: SUIT_Selector* mySelector; }; -#undef MBCLASSNAME -#define MBCLASSNAME "SUIT_Selector::Destroyer" SUIT_Selector::Destroyer::Destroyer( SUIT_Selector* s, QObject* p ) : QObject( p ), mySelector( s ) { - DBG_FUN(); } SUIT_Selector::Destroyer::~Destroyer() { - DBG_FUN(); SUIT_Selector* s = mySelector; mySelector = 0; if ( s ) @@ -74,12 +64,9 @@ SUIT_Selector* SUIT_Selector::Destroyer::selector() const void SUIT_Selector::Destroyer::setSelector( SUIT_Selector* s ) { - DBG_FUN(); mySelector = s; } -#undef MBCLASSNAME -#define MBCLASSNAME "SUIT_Selector" /*!\class SUIT_Selector * Class provide selector for data owners. */ @@ -94,7 +81,6 @@ SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr, QObject* parent ) myAutoBlock( true ), myDestroyer( 0 ) { - DBG_FUN(); if ( selMgr ) selMgr->installSelector( this ); @@ -107,7 +93,6 @@ SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr, QObject* parent ) */ SUIT_Selector::~SUIT_Selector() { - DBG_FUN(); if ( selectionMgr() ) selectionMgr()->removeSelector( this ); @@ -140,8 +125,6 @@ bool SUIT_Selector::isEnabled() const */ void SUIT_Selector::setEnabled( const bool on ) { - DBG_FUN(); - ARG(on); myEnabled = on; } @@ -158,8 +141,6 @@ bool SUIT_Selector::autoBlock() const */ void SUIT_Selector::setAutoBlock( const bool on ) { - DBG_FUN(); - ARG(on); myAutoBlock = on; } @@ -177,7 +158,6 @@ void SUIT_Selector::selected( SUIT_DataOwnerPtrList& lst ) const */ void SUIT_Selector::setSelected( const SUIT_DataOwnerPtrList& lst ) { - DBG_FUN(); if ( !isEnabled() ) return; @@ -194,7 +174,6 @@ void SUIT_Selector::setSelected( const SUIT_DataOwnerPtrList& lst ) */ void SUIT_Selector::selectionChanged() { - DBG_FUN(); if ( selectionMgr() && isEnabled() && ( !autoBlock() || !myBlock ) ) selectionMgr()->selectionChanged( this ); } @@ -225,4 +204,4 @@ void SUIT_Selector::selectionModes( QList& lst ) const QObject* SUIT_Selector::owner() const { return myDestroyer ? myDestroyer->parent() : 0; -} +} \ No newline at end of file diff --git a/src/SUIT/SUIT_Session.cxx b/src/SUIT/SUIT_Session.cxx index 3a3b85d96..dbacd417f 100644 --- a/src/SUIT/SUIT_Session.cxx +++ b/src/SUIT/SUIT_Session.cxx @@ -36,13 +36,6 @@ #include #endif -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SUIT_Session" -#include "MBDebug.h" -#include "MBSUIT.h" -//--------------------------------------------------------- - SUIT_Session* SUIT_Session::mySession = 0; /*! Constructor.*/ @@ -55,7 +48,6 @@ SUIT_Session::SUIT_Session() myExitStatus( NORMAL ), myExitFlags ( 0 ) { - DBG_FUN(); SUIT_ASSERT( !mySession ) mySession = this; @@ -64,7 +56,6 @@ SUIT_Session::SUIT_Session() /*!destructor. Clear applications list and set mySession to zero.*/ SUIT_Session::~SUIT_Session() { - DBG_FUN(); for ( AppList::iterator it = myAppList.begin(); it != myAppList.end(); ++it ) delete *it; @@ -90,8 +81,6 @@ SUIT_Session* SUIT_Session::session() SUIT_Application* SUIT_Session::startApplication( const QString& name, int /*args*/, char** /*argv*/ ) { - DBG_FUN(); - ARG(name); AppLib libHandle = 0; QString appName = applicationName( name ); @@ -177,7 +166,6 @@ QList SUIT_Session::applications() const void SUIT_Session::insertApplication( SUIT_Application* app ) { - DBG_FUN(); if ( !app || myAppList.contains( app ) ) return; @@ -236,7 +224,6 @@ SUIT_ResourceMgr* SUIT_Session::resourceMgr() const */ void SUIT_Session::onApplicationClosed( SUIT_Application* theApp ) { - DBG_FUN(); emit applicationClosed( theApp ); myAppList.removeAll( theApp ); @@ -257,8 +244,6 @@ void SUIT_Session::onApplicationClosed( SUIT_Application* theApp ) */ void SUIT_Session::closeSession( int mode, int flags ) { - DBG_FUN(); - ARG(mode); AppList apps = myAppList; for ( AppList::const_iterator it = apps.begin(); it != apps.end(); ++it ) { @@ -329,8 +314,6 @@ QString SUIT_Session::lastError() const */ SUIT_Session::AppLib SUIT_Session::loadLibrary( const QString& name, QString& libName ) { - DBG_FUN(); - ARG(name); QString libFile = SUIT_Tools::library( name ); libName = libFile; @@ -370,8 +353,6 @@ QString SUIT_Session::applicationName( const QString& str ) const */ SUIT_ResourceMgr* SUIT_Session::createResourceMgr( const QString& appName ) const { - DBG_FUN(); - ARG(appName); return new SUIT_ResourceMgr( applicationName( appName ) ); } @@ -380,6 +361,5 @@ SUIT_ResourceMgr* SUIT_Session::createResourceMgr( const QString& appName ) cons */ void SUIT_Session::onApplicationActivated( SUIT_Application* app ) { - DBG_FUN(); myActiveApp = app; -} +} \ No newline at end of file diff --git a/src/SUIT/SUIT_ViewModel.cxx b/src/SUIT/SUIT_ViewModel.cxx index 928ade89b..6a3201b94 100644 --- a/src/SUIT/SUIT_ViewModel.cxx +++ b/src/SUIT/SUIT_ViewModel.cxx @@ -25,12 +25,6 @@ #include "SUIT_ViewModel.h" #include "SUIT_ViewWindow.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SUIT_ViewModel" -#include "MBDebug.h" -//--------------------------------------------------------- - SUIT_ViewModel::InteractionStyle2StatesMap SUIT_ViewModel::myStateMap; SUIT_ViewModel::InteractionStyle2ButtonsMap SUIT_ViewModel::myButtonMap; @@ -39,7 +33,6 @@ static bool isInitialized = false; /*!Constructor.*/ SUIT_ViewModel::SUIT_ViewModel() { - DBG_FUN(); if ( !isInitialized ) { isInitialized = true; @@ -76,7 +69,6 @@ SUIT_ViewModel::SUIT_ViewModel() /*!Destructor..*/ SUIT_ViewModel::~SUIT_ViewModel() { - DBG_FUN(); } /*!Create new instance of view window on desktop \a theDesktop. @@ -84,7 +76,6 @@ SUIT_ViewModel::~SUIT_ViewModel() */ SUIT_ViewWindow* SUIT_ViewModel::createView(SUIT_Desktop* theDesktop) { - DBG_FUN(); return new SUIT_ViewWindow(theDesktop); } @@ -93,7 +84,6 @@ SUIT_ViewWindow* SUIT_ViewModel::createView(SUIT_Desktop* theDesktop) */ void SUIT_ViewModel::setViewManager(SUIT_ViewManager* theViewManager) { - DBG_FUN(); myViewManager = theViewManager; } @@ -127,4 +117,4 @@ void SUIT_ViewModel::getHotButton( InteractionStyle theInteractionStyle, HotOper { theState = myStateMap[theInteractionStyle][theOper]; theButton = myButtonMap[theInteractionStyle][theOper]; -} +} \ No newline at end of file diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index a552f78b4..7480df9ea 100644 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -42,12 +42,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SUIT_ViewWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!\class SUIT_ViewWindow * Class provide view window. */ @@ -59,7 +53,6 @@ const int DUMP_EVENT = QEvent::User + 123; SUIT_ViewWindow::SUIT_ViewWindow( SUIT_Desktop* theDesktop ) : QMainWindow( theDesktop ), myManager( 0 ), myIsDropDown( true ), mySyncAction( 0 ) { - DBG_FUN(); myDesktop = theDesktop; setWindowIcon( myDesktop ? myDesktop->windowIcon() : QApplication::windowIcon() ); @@ -74,7 +67,6 @@ SUIT_ViewWindow::SUIT_ViewWindow( SUIT_Desktop* theDesktop ) /*! Destructor.*/ SUIT_ViewWindow::~SUIT_ViewWindow() { - DBG_FUN(); } /*! @@ -83,7 +75,6 @@ SUIT_ViewWindow::~SUIT_ViewWindow() */ void SUIT_ViewWindow::setViewManager( SUIT_ViewManager* theManager ) { - DBG_FUN(); myManager = theManager; } @@ -100,7 +91,6 @@ SUIT_ViewManager* SUIT_ViewWindow::getViewManager() const */ QImage SUIT_ViewWindow::dumpView() { - DBG_FUN(); return QImage(); } @@ -112,9 +102,6 @@ QImage SUIT_ViewWindow::dumpView() */ bool SUIT_ViewWindow::dumpViewToFormat( const QImage& img, const QString& fileName, const QString& format ) { - DBG_FUN(); - ARG(fileName); - ARG(format); if( img.isNull() ) return false; @@ -146,7 +133,6 @@ bool SUIT_ViewWindow::dumpViewToFormat( const QString& fileName, const QString& */ void SUIT_ViewWindow::setDestructiveClose( const bool on ) { - DBG_FUN(); setAttribute( Qt::WA_DeleteOnClose, on ); } @@ -154,7 +140,6 @@ void SUIT_ViewWindow::setDestructiveClose( const bool on ) */ void SUIT_ViewWindow::closeEvent( QCloseEvent* e ) { - DBG_FUN(); e->ignore(); emit tryClosing( this ); if ( closable() ) emit closing( this ); @@ -164,7 +149,6 @@ void SUIT_ViewWindow::closeEvent( QCloseEvent* e ) */ void SUIT_ViewWindow::contextMenuEvent( QContextMenuEvent* e ) { - DBG_FUN(); e->ignore(); QMainWindow::contextMenuEvent( e ); @@ -180,7 +164,6 @@ void SUIT_ViewWindow::contextMenuEvent( QContextMenuEvent* e ) */ void SUIT_ViewWindow::onDumpView() { - DBG_FUN(); // VSV (TRIPOLI dev): next line commented: causes error messages //QApplication::postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ) ) ); QApplication::postEvent( this, new QEvent( (QEvent::Type)DUMP_EVENT ) ); @@ -275,7 +258,6 @@ QString SUIT_ViewWindow::getVisualParameters() */ void SUIT_ViewWindow::setVisualParameters( const QString& /*parameters*/ ) { - DBG_FUN(); } /*! @@ -376,7 +358,6 @@ SUIT_CameraProperties SUIT_ViewWindow::cameraProperties() */ void SUIT_ViewWindow::synchronize( SUIT_ViewWindow* /*otherWindow*/ ) { - DBG_FUN(); // base implementation does nothing } @@ -390,7 +371,6 @@ void SUIT_ViewWindow::synchronize( SUIT_ViewWindow* /*otherWindow*/ ) */ QAction* SUIT_ViewWindow::synchronizeAction() { - DBG_FUN(); if ( !mySyncAction ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); mySyncAction = new QtxAction( tr( "MNU_SYNCHRONIZE_VIEW" ), @@ -419,7 +399,6 @@ void SUIT_ViewWindow::emitViewModified() */ void SUIT_ViewWindow::updateSyncViews() { - DBG_FUN(); SUIT_CameraProperties props = cameraProperties(); if ( !props.isValid() ) return; @@ -477,7 +456,6 @@ void SUIT_ViewWindow::updateSyncViews() */ void SUIT_ViewWindow::onSynchronizeView( bool /*checked*/ ) { - DBG_FUN(); QAction* a = qobject_cast( sender() ); if ( a ) { synchronizeView( this, a->data().toInt() ); @@ -490,7 +468,6 @@ void SUIT_ViewWindow::onSynchronizeView( bool /*checked*/ ) */ void SUIT_ViewWindow::synchronizeView( SUIT_ViewWindow* viewWindow, int id ) { - DBG_FUNC(); SUIT_ViewWindow* sourceView = 0; QList otherViews; @@ -575,8 +552,6 @@ void SUIT_ViewWindow::synchronizeView( SUIT_ViewWindow* viewWindow, int id ) void SUIT_ViewWindow::setVisible( bool on ) { - DBG_FUN(); - ARG(on); // This is a workaround to avoid showing view window as a top-level window // before re-parenting it to workstack (issue #23467). // See SUIT_Desktop::childEvent(). @@ -585,4 +560,4 @@ void SUIT_ViewWindow::setVisible( bool on ) QApplication::sendPostedEvents( 0, QEvent::ChildPolished ); if ( !property( "blockShow" ).toBool() ) QMainWindow::setVisible( on ); -} +} \ No newline at end of file diff --git a/src/SVTK/MBDebug.h b/src/SVTK/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/SVTK/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/SVTK/SVTK_Prs.cxx b/src/SVTK/SVTK_Prs.cxx index f81c88832..fcb3f4fe8 100644 --- a/src/SVTK/SVTK_Prs.cxx +++ b/src/SVTK/SVTK_Prs.cxx @@ -28,19 +28,11 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SVTK_Prs" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Default constructor */ SVTK_Prs::SVTK_Prs( const char* entry ) : SALOME_VTKPrs(entry), myObjects( 0 ) { - DBG_FUN(); - ARG(entry); } /*! @@ -48,8 +40,6 @@ SVTK_Prs::SVTK_Prs( const char* entry ) : SALOME_VTKPrs(entry), myObjects( 0 ) */ SVTK_Prs::SVTK_Prs( const char* entry, const vtkActor* obj ) : SALOME_VTKPrs(entry) { - DBG_FUN(); - ARG(entry); AddObject( obj ); } @@ -58,7 +48,6 @@ SVTK_Prs::SVTK_Prs( const char* entry, const vtkActor* obj ) : SALOME_VTKPrs(ent */ SVTK_Prs:: ~SVTK_Prs() { - DBG_FUN(); if ( myObjects ) myObjects->Delete(); } @@ -75,7 +64,6 @@ vtkActorCollection* SVTK_Prs::GetObjects() const */ void SVTK_Prs::AddObject( const vtkActor* obj ) { - DBG_FUN(); if ( !myObjects) myObjects = vtkActorCollection::New(); myObjects->AddItem( (vtkActor*)obj ); diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 693ae6c5d..3d8aa0aa4 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -49,12 +49,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SVTK_Renderer" -#include "MBDebug.h" -//--------------------------------------------------------- - // undefining min and max because CASCADE's defines them and // it clashes with std::min(), std::max() included in utilities.h #undef min @@ -84,7 +78,6 @@ SVTK_Renderer myTrihedronSize(105), myIsTrihedronRelative(true) { - DBG_FUN(); myDevice->Delete(); myTransform->Delete(); @@ -167,7 +160,6 @@ SVTK_Renderer SVTK_Renderer ::~SVTK_Renderer() { - DBG_FUN(); VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors()); vtkActorCollection* anActors = aCopy.GetActors(); vtkActorCollection* anActors2 = vtkActorCollection::New(); @@ -200,7 +192,6 @@ SVTK_Renderer void* theClientData, void* vtkNotUsed(theCallData)) { - DBG_FUNC(); SVTK_Renderer* self = reinterpret_cast(theClientData); switch(theEvent){ @@ -234,7 +225,6 @@ SVTK_Renderer ::Initialize(vtkRenderWindowInteractor* theInteractor, SVTK_Selector* theSelector) { - DBG_FUN(); myInteractor = theInteractor; mySelector = theSelector; SetSelectionTolerance(); @@ -247,7 +237,6 @@ void SVTK_Renderer ::AddActor(VTKViewer_Actor* theActor, bool theIsAdjustActors) { - DBG_FUN(); if(SALOME_Actor* anActor = dynamic_cast(theActor)){ anActor->SetInteractor(myInteractor); anActor->SetTransform(GetTransform()); @@ -277,7 +266,6 @@ void SVTK_Renderer ::RemoveActor(VTKViewer_Actor* theActor, bool theIsAdjustActors) { - DBG_FUN(); if(SALOME_Actor* anActor = dynamic_cast(theActor)){ // Order of the calls are important because VTKViewer_Actor::RemoveFromRender // can leads do destruction of the actor @@ -338,8 +326,6 @@ void SVTK_Renderer ::SetScale( double theScale[3] ) { - DBG_FUN(); - MSGEL("in:[dbl]: theScale=[" << theScale[0] << ", " << theScale[1] << ", " << theScale[2] << "]"); myTransform->SetMatrixScale( theScale[0], theScale[1], theScale[2] ); AdjustActors(); @@ -423,7 +409,6 @@ bool SVTK_Renderer ::OnAdjustActors() { - DBG_FUN(); bool aTDisplayed = IsTrihedronDisplayed(); bool aCDisplayed = IsCubeAxesDisplayed(); @@ -499,7 +484,6 @@ void SVTK_Renderer ::AdjustActors() { - DBG_FUN(); if(OnAdjustActors()) ::ResetCameraClippingRange(GetDevice()); } @@ -580,8 +564,6 @@ SVTK_Renderer void SVTK_Renderer ::SetTrihedronVisibility( const bool show ) { - DBG_FUN(); - ARG(show); if(show) myTrihedron->VisibilityOn(); else @@ -648,7 +630,6 @@ void SVTK_Renderer ::OnResetView() { - DBG_FUN(); int aTrihedronIsVisible = IsTrihedronDisplayed(); int aCubeAxesIsVisible = IsCubeAxesDisplayed(); @@ -682,7 +663,6 @@ void SVTK_Renderer ::OnFitAll() { - DBG_FUN(); int aTrihedronWasVisible = false; int aCubeAxesWasVisible = false; @@ -722,7 +702,6 @@ SVTK_Renderer */ void SVTK_Renderer::onFitSelection() { - DBG_FUN(); vtkActorCollection* aSelectedCollection = vtkActorCollection::New(); VTK::ActorCollectionCopy aCopy( GetDevice()->GetActors() ); @@ -749,7 +728,6 @@ void SVTK_Renderer::onFitSelection() void SVTK_Renderer::OnFitIObjects(const SALOME_ListIO& objects) { - DBG_FUN(); vtkActorCollection* aSelectedCollection = vtkActorCollection::New(); VTK::ActorCollectionCopy aCopy( GetDevice()->GetActors() ); @@ -792,7 +770,6 @@ void SVTK_Renderer ::OnResetClippingRange() { - DBG_FUN(); return; ::ResetCameraClippingRange(GetDevice()); } @@ -804,7 +781,6 @@ void SVTK_Renderer ::OnFrontView() { - DBG_FUN(); vtkCamera* aCamera = GetDevice()->GetActiveCamera(); aCamera->SetPosition(1,0,0); aCamera->SetViewUp(0,0,1); @@ -819,7 +795,6 @@ void SVTK_Renderer ::OnBackView() { - DBG_FUN(); vtkCamera* aCamera = GetDevice()->GetActiveCamera(); aCamera->SetPosition(-1,0,0); aCamera->SetViewUp(0,0,1); @@ -834,7 +809,6 @@ void SVTK_Renderer ::OnTopView() { - DBG_FUN(); vtkCamera* aCamera = GetDevice()->GetActiveCamera(); aCamera->SetPosition(0,0,1); aCamera->SetViewUp(0,1,0); @@ -849,7 +823,6 @@ void SVTK_Renderer ::OnBottomView() { - DBG_FUN(); vtkCamera* aCamera = GetDevice()->GetActiveCamera(); aCamera->SetPosition(0,0,-1); aCamera->SetViewUp(0,1,0); @@ -864,7 +837,6 @@ void SVTK_Renderer ::OnLeftView() { - DBG_FUN(); vtkCamera* aCamera = GetDevice()->GetActiveCamera(); aCamera->SetPosition(0,-1,0); aCamera->SetViewUp(0,0,1); @@ -880,7 +852,6 @@ void SVTK_Renderer ::onClockWiseView() { - DBG_FUN(); vtkCamera* aCamera = GetDevice()->GetActiveCamera(); aCamera->Roll(-90); aCamera->OrthogonalizeViewUp(); @@ -893,7 +864,6 @@ void SVTK_Renderer ::onAntiClockWiseView() { - DBG_FUN(); vtkCamera* aCamera = GetDevice()->GetActiveCamera(); aCamera->Roll(90); aCamera->OrthogonalizeViewUp(); @@ -906,7 +876,6 @@ void SVTK_Renderer ::OnRightView() { - DBG_FUN(); vtkCamera* aCamera = GetDevice()->GetActiveCamera(); aCamera->SetPosition(0,1,0); aCamera->SetViewUp(0,0,1); diff --git a/src/SVTK/SVTK_Selector.cxx b/src/SVTK/SVTK_Selector.cxx index 35cd1ff4f..79b46a20b 100644 --- a/src/SVTK/SVTK_Selector.cxx +++ b/src/SVTK/SVTK_Selector.cxx @@ -39,12 +39,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SVTK_Selector" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! \return new SVTK_Selector @@ -53,11 +47,9 @@ SVTK_Selector* SVTK_Selector ::New() { - DBG_FUNC(); return new SVTK_SelectorDef(); } -#define MBCLASSNAME "SVTK_SelectorDef" /*! Default constructor */ @@ -66,7 +58,6 @@ SVTK_SelectorDef myPicker(vtkPicker::New()), myCellPicker(vtkCellPicker::New()) { - DBG_FUN(); mySelectionMode = ActorSelection; myDynamicPreselection = true; myPreselectionEnabled = true; @@ -82,7 +73,6 @@ SVTK_SelectorDef SVTK_SelectorDef ::~SVTK_SelectorDef() { - DBG_FUN(); } /*! @@ -112,7 +102,6 @@ void SVTK_SelectorDef ::SetSelectionMode(Selection_Mode theMode) { - DBG_FUN(); if(mySelectionMode != theMode){ mySelectionMode = theMode; myMapIOSubIndex.clear(); @@ -128,7 +117,6 @@ void SVTK_SelectorDef ::ClearIObjects() { - DBG_FUN(); myIO2Actors.clear(); myIObjects.clear(); myMapIOSubIndex.clear(); @@ -178,7 +166,6 @@ bool SVTK_SelectorDef ::AddIObject(const Handle(SALOME_InteractiveObject)& theIO) { - DBG_FUN(); if(!IsSelected(theIO)){ myIObjects.insert(theIO); return true; @@ -194,7 +181,6 @@ bool SVTK_SelectorDef ::AddIObject(SALOME_Actor* theActor) { - DBG_FUN(); const Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); bool anIsIOBound = IsSelected(anIO); @@ -216,7 +202,6 @@ bool SVTK_SelectorDef ::RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO) { - DBG_FUN(); bool anIsIOBound = myIObjects.find(theIO) != myIObjects.end(); myIObjects.erase(theIO); @@ -235,7 +220,6 @@ bool SVTK_SelectorDef ::RemoveIObject(SALOME_Actor* theActor) { - DBG_FUN(); const Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); bool anIsActorBound = myIO2Actors.find(anIO) != myIO2Actors.end(); @@ -374,7 +358,6 @@ SVTK_SelectorDef const SVTK_TIndexedMapOfVtkId& theIndices, bool theIsModeShift) { - DBG_FUN(); TMapIOSubIndex::iterator aMapIter = myMapIOSubIndex.find(theIO); if(aMapIter == myMapIOSubIndex.end()){ TIndexedMapOfInteger anEmpty; @@ -410,7 +393,6 @@ SVTK_SelectorDef const SVTK_TVtkIDsMap& theIndices, bool theIsModeShift) { - DBG_FUN(); TMapIOSubIndex::iterator aMapIter = myMapIOSubIndex.find(theIO); if(aMapIter == myMapIOSubIndex.end()){ TIndexedMapOfInteger anEmpty; @@ -447,8 +429,6 @@ SVTK_SelectorDef int theIndex, bool theIsModeShift) { - DBG_FUN(); - ARG(theIndex); TMapIOSubIndex::iterator anIter = myMapIOSubIndex.find(theIO); if(anIter == myMapIOSubIndex.end()){ TIndexedMapOfInteger anEmpty; @@ -484,8 +464,6 @@ SVTK_SelectorDef ::RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, int theIndex) { - DBG_FUN(); - ARG(theIndex); if(IsIndexSelected(theIO,theIndex)){ TMapIOSubIndex::iterator anIter = myMapIOSubIndex.find(theIO); SVTK_TIndexedMapOfVtkId& aMapIndex = anIter->second.myMap; @@ -500,7 +478,6 @@ void SVTK_SelectorDef ::ClearIndex() { - DBG_FUN(); myMapIOSubIndex.clear(); } @@ -543,7 +520,6 @@ SVTK_SelectorDef const SVTK_IndexedMapOfVtkIds& theIds, bool theIsModeShift) { - DBG_FUN(); TMapIOSubCompositeIndex::iterator aMapIter = myMapIOSubCompositeIndex.find( theIO ); if( aMapIter == myMapIOSubCompositeIndex.end() ) { SVTK_IndexedMapOfVtkIds anEmpty; @@ -576,7 +552,6 @@ SVTK_SelectorDef SVTK_ListOfVtk theIds, bool theIsModeShift) { - DBG_FUN(); TMapIOSubCompositeIndex::iterator anIter = myMapIOSubCompositeIndex.find( theIO ); if( anIter == myMapIOSubCompositeIndex.end() ) { SVTK_IndexedMapOfVtkIds anEmpty; @@ -611,7 +586,6 @@ SVTK_SelectorDef ::RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, SVTK_ListOfVtk theIds ) { - DBG_FUN(); if(IsCompositeIndexSelected( theIO, theIds ) ) { TMapIOSubCompositeIndex::iterator anIter = myMapIOSubCompositeIndex.find( theIO ); SVTK_IndexedMapOfVtkIds& aMapIndex = anIter->second; @@ -644,7 +618,6 @@ void SVTK_SelectorDef ::ClearCompositeIndex() { - DBG_FUN(); myMapIOSubCompositeIndex.clear(); } @@ -657,7 +630,6 @@ void SVTK_SelectorDef ::SetFilter(const Handle(VTKViewer_Filter)& theFilter) { - DBG_FUN(); myFilters.insert(TFilters::value_type(theFilter->GetId(),theFilter)); } @@ -680,7 +652,6 @@ void SVTK_SelectorDef ::RemoveFilter(const TFilterID theId) { - DBG_FUN(); if(IsFilterPresent(theId)) myFilters.erase(theId); } @@ -727,7 +698,6 @@ vtkActorCollection* SVTK_SelectorDef ::Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const { - DBG_FUN(); vtkActorCollection* aListActors = NULL; if ( GetDynamicPreSelection() ) { diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 0a6b4142e..ddecab3dd 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -39,12 +39,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SVTK_SignalHandler" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ @@ -53,7 +47,6 @@ SVTK_SignalHandler QObject(theMainWindow), myMainWindow(theMainWindow) { - DBG_FUN(); SVTK_RenderWindowInteractor* anInteractor = theMainWindow->GetInteractor(); connect(anInteractor,SIGNAL(KeyPressed(QKeyEvent*)), @@ -80,7 +73,6 @@ SVTK_SignalHandler SVTK_SignalHandler ::~SVTK_SignalHandler() { - DBG_FUN(); } /*! @@ -101,7 +93,6 @@ void SVTK_SignalHandler ::Repaint(bool theUpdateTrihedron) { - DBG_FUN(); myMainWindow->Repaint(theUpdateTrihedron); } @@ -151,7 +142,6 @@ void SVTK_SignalHandler ::onSelectionChanged() { - DBG_FUN(); VTK::ActorCollectionCopy aCopy(myMainWindow->getRenderer()->GetActors()); vtkActorCollection* anActors = aCopy.GetActors(); @@ -170,8 +160,6 @@ SVTK_SignalHandler myMainWindow->Repaint(false); } - -#define MBCLASSNAME "SVTK_View" /*! Constructor */ @@ -179,7 +167,6 @@ SVTK_View ::SVTK_View(SVTK_ViewWindow* theMainWindow) : SVTK_SignalHandler(theMainWindow) { - DBG_FUN(); } /*! @@ -188,7 +175,6 @@ SVTK_View SVTK_View ::~SVTK_View() { - DBG_FUN(); } /*! @@ -198,7 +184,6 @@ void SVTK_View ::unHighlightAll() { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEach(aCopy.GetActors(), @@ -218,7 +203,6 @@ SVTK_View bool theIsHighlight, bool /*theIsUpdate*/ ) { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEachIf(aCopy.GetActors(), @@ -235,8 +219,6 @@ Handle(SALOME_InteractiveObject) SVTK_View ::FindIObject(const char* theEntry) { - DBG_FUN(); - ARG(theEntry); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); SALOME_Actor* anActor = @@ -348,8 +330,6 @@ SVTK_View ::rename(const Handle(SALOME_InteractiveObject)& theIObject, const QString& theName) { - DBG_FUN(); - ARG(theName); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEachIf(aCopy.GetActors(), @@ -376,8 +356,6 @@ void SVTK_View ::SetDisplayMode(int theMode) { - DBG_FUN(); - ARG(theMode); if(theMode == 0) ChangeRepresentationToWireframe(); else if (theMode == 1) @@ -399,8 +377,6 @@ SVTK_View ::SetDisplayMode(const Handle(SALOME_InteractiveObject)& theIObject, int theMode) { - DBG_FUN(); - ARG(theMode); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEachIf(aCopy.GetActors(), @@ -416,7 +392,6 @@ void SVTK_View ::ChangeRepresentationToWireframe() { - DBG_FUN(); VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ChangeRepresentationToWireframe(aCopy.GetActors()); } @@ -428,7 +403,6 @@ void SVTK_View ::ChangeRepresentationToSurface() { - DBG_FUN(); VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ChangeRepresentationToSurface(aCopy.GetActors()); } @@ -440,7 +414,6 @@ void SVTK_View ::ChangeRepresentationToSurfaceWithEdges() { - DBG_FUN(); VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ChangeRepresentationToSurfaceWithEdges(aCopy.GetActors()); } @@ -453,7 +426,6 @@ void SVTK_View ::ChangeRepresentationToWireframe(vtkActorCollection* theCollection) { - DBG_FUN(); using namespace SVTK; ForEach(theCollection, TSetFunction @@ -469,7 +441,6 @@ void SVTK_View ::ChangeRepresentationToSurface(vtkActorCollection* theCollection) { - DBG_FUN(); using namespace SVTK; ForEach(theCollection, TSetFunction @@ -485,7 +456,6 @@ void SVTK_View ::ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* theCollection) { - DBG_FUN(); using namespace SVTK; ForEach(theCollection, TSetFunction @@ -521,7 +491,6 @@ void SVTK_View ::EraseAll() { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEach(aCopy.GetActors(), @@ -536,7 +505,6 @@ void SVTK_View ::DisplayAll() { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEach(aCopy.GetActors(), @@ -554,7 +522,6 @@ SVTK_View ::Erase(SALOME_Actor* theActor, bool theIsUpdate) { - DBG_FUN(); SVTK::TErase()(theActor); if(theIsUpdate) @@ -572,7 +539,6 @@ SVTK_View ::Erase(const Handle(SALOME_InteractiveObject)& theIObject, bool theIsUpdate) { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEachIf(aCopy.GetActors(), @@ -590,7 +556,6 @@ SVTK_View ::Display(SALOME_Actor* theActor, bool theIsUpdate) { - DBG_FUN(); GetRenderer()->AddActor(theActor); theActor->SetVisibility(true); @@ -606,7 +571,6 @@ SVTK_View ::Display(const Handle(SALOME_InteractiveObject)& theIObject, bool theIsUpdate) { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEachIf(aCopy.GetActors(), @@ -624,7 +588,6 @@ void SVTK_View ::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject) { - DBG_FUN(); EraseAll(); Display(theIObject); } @@ -654,7 +617,6 @@ SVTK_View ::Remove(const Handle(SALOME_InteractiveObject)& theIObject, bool theIsUpdate) { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEachIf(aCopy.GetActors(), @@ -672,7 +634,6 @@ SVTK_View ::Remove(SALOME_Actor* theActor, bool theIsUpdate) { - DBG_FUN(); GetRenderer()->RemoveActor(theActor); if(theIsUpdate) Repaint(); @@ -685,7 +646,6 @@ void SVTK_View ::RemoveAll(bool theIsUpdate) { - DBG_FUN(); vtkRenderer* aRenderer = getRenderer(); VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); if(vtkActorCollection* anActors = aCopy.GetActors()){ @@ -731,7 +691,6 @@ SVTK_View ::SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject, float theTrans) { - DBG_FUN(); double anOpacity = 1.0 - theTrans; using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); @@ -751,7 +710,6 @@ SVTK_View ::SetColor(const Handle(SALOME_InteractiveObject)& theIObject, const QColor& theColor) { - DBG_FUN(); double aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.}; using namespace SVTK; @@ -796,7 +754,6 @@ SVTK_View ::SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject, vtkProperty* thePropF, vtkProperty* thePropB) { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); std::vector aProps; @@ -852,7 +809,6 @@ SVTK_View */ void SVTK_View::GetVisible( SALOME_ListIO& theList ) { - DBG_FUN(); using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); ForEach(aCopy.GetActors(), diff --git a/src/SVTK/SVTK_ViewManager.cxx b/src/SVTK/SVTK_ViewManager.cxx index d4a3a3fed..c2001ec00 100644 --- a/src/SVTK/SVTK_ViewManager.cxx +++ b/src/SVTK/SVTK_ViewManager.cxx @@ -25,19 +25,12 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SVTK_ViewManager" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ SVTK_ViewManager::SVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop ) : SUIT_ViewManager( study, theDesktop, new SVTK_Viewer() ) { - DBG_FUN(); setTitle( VTKViewer_ViewManager::tr( "VTK_VIEW_TITLE" ) ); } @@ -46,7 +39,6 @@ SVTK_ViewManager::SVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop */ SVTK_ViewManager::~SVTK_ViewManager() { - DBG_FUN(); } /*! diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index 35e31564e..67519dd80 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -51,18 +51,11 @@ // VSR: Uncomment below line to allow texture background support in VTK viewer #define VTK_ENABLE_TEXTURED_BACKGROUND -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SVTK_Viewer" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Constructor */ SVTK_Viewer::SVTK_Viewer() { - DBG_FUN(); myTrihedronSize = 105; myTrihedronRelative = true; myIsStaticTrihedronVisible = true; @@ -87,7 +80,6 @@ SVTK_Viewer::SVTK_Viewer() */ SVTK_Viewer::~SVTK_Viewer() { - DBG_FUN(); } /*! Get data for supported background modes: gradient types, identifiers and supported image formats */ @@ -139,7 +131,6 @@ QColor SVTK_Viewer::backgroundColor() const //! Set background color to the viewer [obsolete] void SVTK_Viewer::setBackgroundColor( const QColor& c ) { - DBG_FUN(); Qtx::BackgroundData bg = background(); bg.setColor( c ); setBackground( bg ); @@ -159,7 +150,6 @@ Qtx::BackgroundData SVTK_Viewer::background() const */ void SVTK_Viewer::setBackground( const Qtx::BackgroundData& theBackground ) { - DBG_FUN(); myDefaultBackground = theBackground.isValid() ? theBackground : Qtx::BackgroundData( Qt::black ); QVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ @@ -176,7 +166,6 @@ void SVTK_Viewer::setBackground( const Qtx::BackgroundData& theBackground ) */ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop ) { - DBG_FUN(); TViewWindow* aViewWindow = new TViewWindow(theDesktop); aViewWindow->Initialize(this); @@ -279,8 +268,6 @@ int SVTK_Viewer::projectionMode() const */ void SVTK_Viewer::setProjectionMode( const int theMode ) { - DBG_FUN(); - ARG(theMode); if ( myProjMode != theMode ) { if ( theMode != SVTK_ViewWindow::Stereo ) myProjMode = theMode; @@ -365,8 +352,6 @@ bool SVTK_Viewer::isQuadBufferSupport() const */ void SVTK_Viewer::setQuadBufferSupport( const bool theEnable ) { - DBG_FUN(); - ARG(theEnable); if ( myQuadBufferSupport != theEnable ) { myQuadBufferSupport = theEnable; @@ -531,7 +516,6 @@ void SVTK_Viewer::setSpacemouseButtons( const int theBtn1, const int theBtn2, co */ void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager) { - DBG_FUN(); SUIT_ViewModel::setViewManager(theViewManager); if ( !theViewManager ) @@ -555,7 +539,6 @@ void SVTK_Viewer::setViewManager(SUIT_ViewManager* theViewManager) */ void SVTK_Viewer::contextMenuPopup( QMenu* thePopup ) { - DBG_FUN(); thePopup->addAction( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) ); thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) ); @@ -595,8 +578,6 @@ void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* /*vw*/, QMouseEvent* /*event*/ */ void SVTK_Viewer::enableSelection(bool isEnabled) { - DBG_FUN(); - ARG(isEnabled); mySelectionEnabled = isEnabled; //!! To be done for view windows @@ -683,7 +664,6 @@ void SVTK_Viewer::onChangeBackground() */ void SVTK_Viewer::Display( const SALOME_VTKPrs* prs ) { - DBG_FUN(); // try do downcast object if(const SVTK_Prs* aPrs = dynamic_cast( prs )){ if(aPrs->IsNull()) @@ -728,7 +708,6 @@ void SVTK_Viewer::Display( const SALOME_VTKPrs* prs ) */ void SVTK_Viewer::Erase( const SALOME_VTKPrs* prs, const bool forced ) { - DBG_FUN(); // try do downcast object if(const SVTK_Prs* aPrs = dynamic_cast( prs )){ if(aPrs->IsNull()) @@ -768,7 +747,6 @@ void SVTK_Viewer::Erase( const SALOME_VTKPrs* prs, const bool forced ) */ void SVTK_Viewer::EraseAll( SALOME_Displayer* d, const bool forced ) { - DBG_FUN(); QVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) @@ -816,8 +794,6 @@ void SVTK_Viewer::EraseAll( SALOME_Displayer* d, const bool forced ) */ SALOME_Prs* SVTK_Viewer::CreatePrs( const char* entry ) { - DBG_FUN(); - ARG(entry); SVTK_Prs* prs = new SVTK_Prs( entry ); if ( entry ) { if(SVTK_ViewWindow* aViewWindow = dynamic_cast(getViewManager()->getActiveView())) @@ -861,7 +837,6 @@ bool SVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& io ) */ void SVTK_Viewer::GetVisible( SALOME_ListIO& theList ) { - DBG_FUN(); // here we collect object if it is disaplaed even one view QVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) @@ -876,7 +851,6 @@ void SVTK_Viewer::GetVisible( SALOME_ListIO& theList ) */ void SVTK_Viewer::Repaint() { - DBG_FUN(); // if (theUpdateTrihedron) onAdjustTrihedron(); QVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) @@ -888,18 +862,15 @@ void SVTK_Viewer::Repaint() void SVTK_Viewer::onActorAdded(VTKViewer_Actor* theActor) { - DBG_FUN(); emit actorAdded((SVTK_ViewWindow*)sender(), theActor); } void SVTK_Viewer::onActorRemoved(VTKViewer_Actor* theActor) { - DBG_FUN(); emit actorRemoved((SVTK_ViewWindow*)sender(), theActor); } void SVTK_Viewer::onViewCreated( SUIT_ViewWindow* view) { - DBG_FUN(); #ifdef VGL_WORKAROUND if ( SVTK_ViewWindow* svw = dynamic_cast( view ) ) QTimer::singleShot(500, [svw] () { svw->Repaint(); } ); diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 0d3e7ca71..3f2b5bbd6 100644 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -112,12 +112,6 @@ #include #endif -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SVTK_ViewWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - // Use workaround for rendering transparent object over MESA #define USE_WORKAROUND_FOR_MESA @@ -151,7 +145,6 @@ SVTK_ViewWindow::SVTK_ViewWindow(SUIT_Desktop* theDesktop): myEventCallbackCommand(vtkCallbackCommand::New()), myDumpImage(QImage()) { - DBG_FUN(); setWindowFlags( windowFlags() & ~Qt::Window ); // specific of vtkSmartPointer myKeyFreeInteractorStyle->Delete(); @@ -162,7 +155,6 @@ SVTK_ViewWindow::SVTK_ViewWindow(SUIT_Desktop* theDesktop): */ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) { - DBG_FUN(); myModel = theModel; myInteractor = new SVTK_RenderWindowInteractor(this,"SVTK_RenderWindowInteractor"); @@ -281,7 +273,6 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) void SVTK_ViewWindow::Initialize(SVTK_View* theView, SVTK_ViewModelBase* theModel) { - DBG_FUN(); connect(theView,SIGNAL(KeyPressed(QKeyEvent*)), this,SLOT(onKeyPressed(QKeyEvent*)) ); connect(theView,SIGNAL(KeyReleased(QKeyEvent*)), @@ -307,7 +298,6 @@ void SVTK_ViewWindow::Initialize(SVTK_View* theView, */ SVTK_ViewWindow::~SVTK_ViewWindow() { - DBG_FUN(); myRecorder->Delete(); myAxesWidget->Delete(); } @@ -374,7 +364,6 @@ SVTK_Selector* SVTK_ViewWindow::GetSelector() const */ void SVTK_ViewWindow::onFrontView() { - DBG_FUN(); GetRenderer()->OnFrontView(); Repaint(); emit transformed( this ); @@ -385,7 +374,6 @@ void SVTK_ViewWindow::onFrontView() */ void SVTK_ViewWindow::onBackView() { - DBG_FUN(); GetRenderer()->OnBackView(); Repaint(); emit transformed( this ); @@ -396,7 +384,6 @@ void SVTK_ViewWindow::onBackView() */ void SVTK_ViewWindow::onTopView() { - DBG_FUN(); GetRenderer()->OnTopView(); Repaint(); emit transformed( this ); @@ -407,7 +394,6 @@ void SVTK_ViewWindow::onTopView() */ void SVTK_ViewWindow::onBottomView() { - DBG_FUN(); GetRenderer()->OnBottomView(); Repaint(); emit transformed( this ); @@ -418,7 +404,6 @@ void SVTK_ViewWindow::onBottomView() */ void SVTK_ViewWindow::onLeftView() { - DBG_FUN(); GetRenderer()->OnLeftView(); Repaint(); emit transformed( this ); @@ -429,7 +414,6 @@ void SVTK_ViewWindow::onLeftView() */ void SVTK_ViewWindow::onRightView() { - DBG_FUN(); GetRenderer()->OnRightView(); Repaint(); emit transformed( this ); @@ -440,7 +424,6 @@ void SVTK_ViewWindow::onRightView() */ void SVTK_ViewWindow::onClockWiseView() { - DBG_FUN(); GetRenderer()->onClockWiseView(); Repaint(); emit transformed( this ); @@ -451,7 +434,6 @@ void SVTK_ViewWindow::onClockWiseView() */ void SVTK_ViewWindow::onAntiClockWiseView() { - DBG_FUN(); GetRenderer()->onAntiClockWiseView(); Repaint(); emit transformed( this ); @@ -462,7 +444,6 @@ void SVTK_ViewWindow::onAntiClockWiseView() */ void SVTK_ViewWindow::onResetView() { - DBG_FUN(); GetRenderer()->OnResetView(); Repaint(); emit transformed( this ); @@ -473,7 +454,6 @@ void SVTK_ViewWindow::onResetView() */ void SVTK_ViewWindow::onFitAll() { - DBG_FUN(); GetRenderer()->OnFitAll(); Repaint(); emit transformed( this ); @@ -484,7 +464,6 @@ void SVTK_ViewWindow::onFitAll() */ void SVTK_ViewWindow::onFitSelection() { - DBG_FUN(); GetRenderer()->onFitSelection(); Repaint(); emit transformed( this ); @@ -495,7 +474,6 @@ void SVTK_ViewWindow::onFitSelection() */ void SVTK_ViewWindow::onFitIObjects(const SALOME_ListIO& objects) { - DBG_FUN(); GetRenderer()->OnFitIObjects(objects); Repaint(); emit transformed( this ); @@ -506,7 +484,6 @@ void SVTK_ViewWindow::onFitIObjects(const SALOME_ListIO& objects) */ void SVTK_ViewWindow::onSelectionChanged() { - DBG_FUN(); myView->onSelectionChanged(); } @@ -516,7 +493,6 @@ void SVTK_ViewWindow::onSelectionChanged() */ void SVTK_ViewWindow::SetSelectionMode(Selection_Mode theMode) { - DBG_FUN(); GetSelector()->SetSelectionMode(theMode); } @@ -584,8 +560,6 @@ Handle(SALOME_InteractiveObject) SVTK_ViewWindow::FindIObject(const char* theEnt void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO, bool theImmediatly) { - DBG_FUN(); - ARG(theImmediatly); myView->Display(theIO,theImmediatly); } @@ -597,8 +571,6 @@ void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO, void SVTK_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& theIO, bool theImmediatly) { - DBG_FUN(); - ARG(theImmediatly); myView->Erase(theIO,theImmediatly); } @@ -608,7 +580,6 @@ void SVTK_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& theIO, */ void SVTK_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO) { - DBG_FUN(); myView->DisplayOnly(theIO); } @@ -617,7 +588,6 @@ void SVTK_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO) */ void SVTK_ViewWindow::DisplayAll() { - DBG_FUN(); myView->DisplayAll(); } @@ -626,7 +596,6 @@ void SVTK_ViewWindow::DisplayAll() */ void SVTK_ViewWindow::EraseAll() { - DBG_FUN(); myView->EraseAll(); } @@ -636,7 +605,6 @@ void SVTK_ViewWindow::EraseAll() */ void SVTK_ViewWindow::setBackgroundColor( const QColor& c ) { - DBG_FUN(); Qtx::BackgroundData bg = background(); bg.setColor( c ); setBackground( bg ); @@ -656,7 +624,6 @@ QColor SVTK_ViewWindow::backgroundColor() const */ void SVTK_ViewWindow::setBackground( const Qtx::BackgroundData& bgData ) { - DBG_FUN(); bool ok = false; if ( bgData.isValid() ) { @@ -857,7 +824,6 @@ void SVTK_ViewWindow::GetScale( double theScale[3] ) */ void SVTK_ViewWindow::SetScale( double theScale[3] ) { - DBG_FUN(); GetRenderer()->SetScale( theScale ); Repaint(); emit transformed( this ); @@ -884,7 +850,6 @@ bool SVTK_ViewWindow::isCubeAxesDisplayed() */ void SVTK_ViewWindow::onViewTrihedron(bool show) { - DBG_FUN(); GetRenderer()->SetTrihedronVisibility(show); Repaint(); } @@ -928,8 +893,6 @@ double SVTK_ViewWindow::GetTrihedronSize() const */ void SVTK_ViewWindow::SetProjectionMode(const int theMode) { - DBG_FUN(); - ARG(theMode); QtxAction* aParallelAction = dynamic_cast( toolMgr()->action( ParallelModeId ) ); QtxAction* aProjectionAction = dynamic_cast( toolMgr()->action( ProjectionModeId ) ); QtxAction* aStereoAction = dynamic_cast( toolMgr()->action( StereoModeId ) ); @@ -1000,7 +963,6 @@ void SVTK_ViewWindow::SetProjectionMode(const int theMode) */ void SVTK_ViewWindow::SetStereoType(const int theType) { - DBG_FUN(); vtkRenderWindow* aWindow = getRenderWindow(); switch (theType ) { case CrystalEyes: @@ -1039,7 +1001,6 @@ void SVTK_ViewWindow::SetStereoType(const int theType) */ void SVTK_ViewWindow::SetAnaglyphFilter(const int theFilter) { - DBG_FUN(); vtkRenderWindow* aWindow = getRenderWindow(); switch (theFilter ) { case RedCyan: @@ -1060,7 +1021,6 @@ void SVTK_ViewWindow::SetAnaglyphFilter(const int theFilter) */ void SVTK_ViewWindow::SetQuadBufferSupport(const bool theEnable) { - DBG_FUN(); vtkRenderWindow* aWindow = getRenderWindow(); aWindow->SetStereoCapableWindow((int)theEnable); } @@ -1137,7 +1097,6 @@ void SVTK_ViewWindow::activateProjectionMode(int theMode) */ void SVTK_ViewWindow::SetInteractionStyle(const int theStyle) { - DBG_FUN(); onSwitchInteractionStyle( theStyle==1 ); } @@ -1147,7 +1106,6 @@ void SVTK_ViewWindow::SetInteractionStyle(const int theStyle) */ void SVTK_ViewWindow::SetZoomingStyle(const int theStyle) { - DBG_FUN(); onSwitchZoomingStyle( theStyle==1 ); } @@ -1157,7 +1115,6 @@ void SVTK_ViewWindow::SetZoomingStyle(const int theStyle) */ void SVTK_ViewWindow::SetPreSelectionMode( Preselection_Mode theMode ) { - DBG_FUN(); onSwitchPreSelectionMode( theMode ); } @@ -1167,7 +1124,6 @@ void SVTK_ViewWindow::SetPreSelectionMode( Preselection_Mode theMode ) */ void SVTK_ViewWindow::SetSelectionEnabled( bool theEnable ) { - DBG_FUN(); GetSelector()->SetSelectionEnabled( theEnable ); QtxAction* a = getAction( EnableSelectionId ); if ( a->isChecked() != theEnable) @@ -1191,7 +1147,6 @@ void SVTK_ViewWindow::SetSelectionEnabled( bool theEnable ) */ void SVTK_ViewWindow::onSwitchInteractionStyle(bool theOn) { - DBG_FUN(); if (theOn) { // check if style is already set if ( GetInteractorStyle() != myKeyFreeInteractorStyle.GetPointer() ) @@ -1222,7 +1177,6 @@ void SVTK_ViewWindow::onSwitchInteractionStyle(bool theOn) */ void SVTK_ViewWindow::onSwitchZoomingStyle( bool theOn ) { - DBG_FUN(); if( myDefaultInteractorStyle.GetPointer() ) myDefaultInteractorStyle->SetAdvancedZoomingEnabled( theOn ); if( myKeyFreeInteractorStyle.GetPointer() ) @@ -1240,7 +1194,6 @@ void SVTK_ViewWindow::onSwitchZoomingStyle( bool theOn ) */ void SVTK_ViewWindow::onSwitchPreSelectionMode( int theMode ) { - DBG_FUN(); GetSelector()->SetDynamicPreSelection( theMode == Dynamic_Preselection ); GetSelector()->SetPreSelectionEnabled( theMode != Preselection_Disabled ); @@ -1256,7 +1209,6 @@ void SVTK_ViewWindow::onSwitchPreSelectionMode( int theMode ) */ void SVTK_ViewWindow::onEnableSelection( bool on ) { - DBG_FUN(); SVTK_Viewer* aViewer = dynamic_cast(myModel); if(aViewer) aViewer->enableSelection(on); @@ -1269,7 +1221,6 @@ void SVTK_ViewWindow::onEnableSelection( bool on ) */ void SVTK_ViewWindow::SetIncrementalSpeed(const int theValue, const int theMode) { - DBG_FUN(); if ( (SVTK_InteractorStyle*)GetInteractorStyle() ) ((SVTK_InteractorStyle*)GetInteractorStyle())->SetIncrementSpeed(theValue, theMode); } @@ -1284,7 +1235,6 @@ void SVTK_ViewWindow::SetSpacemouseButtons(const int theBtn1, const int theBtn2, const int theBtn3) { - DBG_FUN(); int val = theBtn1; myEventDispatcher->InvokeEvent(SVTK::SetSMDecreaseSpeedEvent, &val); val = theBtn2; @@ -1331,7 +1281,6 @@ void SVTK_ViewWindow::onAdjustCubeAxes() void SVTK_ViewWindow::synchronize(SVTK_ViewWindow* otherViewWindow ) { - DBG_FUN(); if ( otherViewWindow ) { bool blocked = blockSignals( true ); doSetVisualParameters( otherViewWindow->getVisualParameters(), true ); @@ -1368,7 +1317,6 @@ void SVTK_ViewWindow::onMousePressed(QMouseEvent* event) */ void SVTK_ViewWindow::onMouseReleased(QMouseEvent* event) { - DBG_FUN(); emit mouseReleased( this, event ); } @@ -1395,7 +1343,6 @@ void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor, bool theUpdate, bool theIsAdjustActors ) { - DBG_FUN(); GetRenderer()->AddActor(theActor, theIsAdjustActors); if(theUpdate) Repaint(); @@ -1409,7 +1356,6 @@ void SVTK_ViewWindow::RemoveActor( VTKViewer_Actor* theActor, bool theUpdate, bool theIsAdjustActors ) { - DBG_FUN(); GetRenderer()->RemoveActor(theActor, theIsAdjustActors); if ( myDefaultInteractorStyle ) myDefaultInteractorStyle->FreeActors(); @@ -1712,7 +1658,6 @@ void getGradAxisVisualParams( QXmlStreamWriter& writer, vtkAxisActor2D* actor, Q void setGradAxisVisualParams(QXmlStreamReader& reader, vtkAxisActor2D* actor) { - DBG_FUNC(); if ( !actor ) return; @@ -1810,7 +1755,6 @@ void setGradAxisVisualParams(QXmlStreamReader& reader, vtkAxisActor2D* actor) */ void setGradAxisVisualParams( vtkAxisActor2D* actor, const QString& params ) { - DBG_FUNC(); if ( !actor ) return; @@ -1953,7 +1897,6 @@ QString SVTK_ViewWindow::getVisualParameters() */ void SVTK_ViewWindow::setVisualParameters( const QString& parameters ) { - DBG_FUN(); //printf("#### %s\n", qPrintable(parameters)); SVTK_RenderWindowInteractor* anInteractor = GetInteractor(); if ( anInteractor->isVisible() ) { @@ -1970,7 +1913,6 @@ void SVTK_ViewWindow::setVisualParameters( const QString& parameters ) */ void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters, bool baseParamsOnly ) { - DBG_FUN(); double pos[3], focalPnt[3], viewUp[3], parScale = 1.0, scale[3]; @@ -2170,7 +2112,6 @@ void SVTK_ViewWindow::activateStartPointSelection( Selection_Mode theSelectionMo */ void SVTK_ViewWindow::onProjectionMode( QAction* theAction ) { - DBG_FUN(); int aMode = Parallel; if (theAction == toolMgr()->action( ProjectionModeId )) aMode = Projection; @@ -2191,7 +2132,6 @@ void SVTK_ViewWindow::onProjectionMode( QAction* theAction ) */ void SVTK_ViewWindow::onStereoMode( bool activate ) { - DBG_FUN(); if (activate) { toolMgr()->action( ProjectionModeId )->setChecked(true); vtkCamera* aCamera = getRenderer()->GetActiveCamera(); @@ -2225,7 +2165,6 @@ void SVTK_ViewWindow::onStereoMode( bool activate ) */ void SVTK_ViewWindow::onProjectionMode() { - DBG_FUN(); if (toolMgr()->action( ParallelModeId )->isChecked()) SetProjectionMode( Parallel); if (toolMgr()->action( ProjectionModeId )->isChecked()) @@ -2245,7 +2184,6 @@ void SVTK_ViewWindow::SetEventDispatcher(vtkObject* theDispatcher) */ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) { - DBG_FUN(); QtxAction* anAction; QtxActionToolMgr* mgr = toolMgr(); @@ -2797,7 +2735,6 @@ void SVTK_ViewWindow::onViewParameters(bool theIsActivate) */ void SVTK_ViewWindow::showEvent( QShowEvent * theEvent ) { - DBG_FUN(); emit Show( theEvent ); } @@ -2806,7 +2743,6 @@ void SVTK_ViewWindow::showEvent( QShowEvent * theEvent ) */ void SVTK_ViewWindow::hideEvent( QHideEvent * theEvent ) { - DBG_FUN(); emit Hide( theEvent ); } @@ -2825,7 +2761,6 @@ void SVTK_ViewWindow::ProcessEvents(vtkObject* vtkNotUsed(theObject), void* theClientData, void* /*theCallData*/) { - DBG_FUNC(); SVTK_ViewWindow* self = reinterpret_cast(theClientData); if(self) self->emitTransformed(); @@ -2884,7 +2819,6 @@ SUIT_CameraProperties SVTK_ViewWindow::cameraProperties() */ void SVTK_ViewWindow::synchronize( SUIT_ViewWindow* theView ) { - DBG_FUN(); bool blocked = blockSignals( true ); SUIT_CameraProperties aProps = theView->cameraProperties(); diff --git a/src/SalomeApp/MBDebug.h b/src/SalomeApp/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/SalomeApp/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index f61cb71b3..1e9492add 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -113,12 +113,6 @@ #include #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SalomeApp_Application" -#include "MBDebug.h" -//--------------------------------------------------------- - std::unique_ptr SalomeApp_Application::_ns; /*!Internal class that updates object browser item properties */ @@ -206,7 +200,6 @@ namespace /*!Constructor.*/ SalomeApp_Application::SalomeApp_Application(SALOME_NamingService_Abstract *ns):myIsCloseFromExit( false ),myToIgnoreMessages( false ) { - DBG_FUN(); if(!ns) _ns.reset(new SALOME_NamingService(orb())); else @@ -218,7 +211,6 @@ SalomeApp_Application::SalomeApp_Application(SALOME_NamingService_Abstract *ns): */ SalomeApp_Application::~SalomeApp_Application() { - DBG_FUN(); // Do not destroy. It's a singleton ! //SALOME_EventFilter::Destroy(); } @@ -245,7 +237,6 @@ QStringList __getArgsList(QString argsString) /*!Start application.*/ void SalomeApp_Application::start() { - DBG_FUN(); // process the command line options before start: to createActions in accordance to the options static bool isFirst = true; if ( isFirst ) { @@ -337,7 +328,6 @@ void SalomeApp_Application::start() /*!Create actions:*/ void SalomeApp_Application::createActions() { - DBG_FUN(); LightApp_Application::createActions(); SUIT_Desktop* desk = desktop(); @@ -430,7 +420,6 @@ void SalomeApp_Application::createActions() */ void SalomeApp_Application::onExit() { - DBG_FUN(); //MessageLocker ml( myToIgnoreMessages ); bool killServers = false; @@ -452,7 +441,6 @@ void SalomeApp_Application::onExit() /*!SLOT. Create a document.*/ void SalomeApp_Application::onNewDoc() { - DBG_FUN(); MessageLocker ml( myToIgnoreMessages ); LightApp_Application::onNewDoc(); @@ -461,7 +449,6 @@ void SalomeApp_Application::onNewDoc() /*!SLOT. Load document.*/ void SalomeApp_Application::onLoadDoc() { - DBG_FUN(); MessageLocker ml( myToIgnoreMessages ); QString studyName; @@ -522,7 +509,6 @@ void SalomeApp_Application::onLoadDoc() /*!SLOT. Unload document.*/ void SalomeApp_Application::onUnloadDoc( bool ask ) { - DBG_FUN(); if ( ask ) { activeStudy()->abortAllOperations(); if ( activeStudy()->isModified() ) { @@ -548,7 +534,6 @@ void SalomeApp_Application::onUnloadDoc( bool ask ) /*!SLOT. Create new study and load script*/ void SalomeApp_Application::onNewWithScript() { - DBG_FUN(); QStringList filtersList; filtersList.append(tr("PYTHON_FILES_FILTER")); filtersList.append(tr("ALL_FILES_FILTER")); @@ -577,8 +562,6 @@ void SalomeApp_Application::onNewWithScript() /*!SLOT. Load document with \a aName.*/ bool SalomeApp_Application::onLoadDoc( const QString& aName ) { - DBG_FUN(); - ARG(aName); if ( !LightApp_Application::closeDoc() ) return false; @@ -615,8 +598,6 @@ bool SalomeApp_Application::onLoadDoc( const QString& aName ) /*!SLOT. Parse message for desktop.*/ void SalomeApp_Application::onDesktopMessage( const QString& message ) { - DBG_FUN(); - ARG(message); if ( myToIgnoreMessages ) return; // a message from SALOMEDS is caused by GUI action @@ -651,8 +632,6 @@ void SalomeApp_Application::onDesktopMessage( const QString& message ) /*!On module activation action.*/ void SalomeApp_Application::onModuleActivation( const QString& modName ) { - DBG_FUN(); - ARG(modName); if (!activeStudy() && !modName.isEmpty()) getStudy()->Init(); @@ -662,7 +641,6 @@ void SalomeApp_Application::onModuleActivation( const QString& modName ) /*!SLOT. Copy objects to study maneger from selection maneger..*/ void SalomeApp_Application::onCopy() { - DBG_FUN(); LightApp_Application::onCopy(); SALOME_ListIO list; @@ -694,7 +672,6 @@ void SalomeApp_Application::onCopy() /*!SLOT. Paste objects to study maneger from selection manager.*/ void SalomeApp_Application::onPaste() { - DBG_FUN(); LightApp_Application::onPaste(); SALOME_ListIO list; @@ -742,7 +719,6 @@ bool SalomeApp_Application::isPossibleToClose( bool& closePermanently ) /*! Check if the study is locked */ void SalomeApp_Application::onCloseDoc( bool ask ) { - DBG_FUN(); if(getStudy()->IsStudyLocked()) { if ( SUIT_MessageBox::question( desktop(), QObject::tr( "WRN_WARNING" ), @@ -762,7 +738,6 @@ void SalomeApp_Application::onCloseDoc( bool ask ) /*!SLOT. Reload document from the file.*/ bool SalomeApp_Application::onReopenDoc() { - DBG_FUN(); MessageLocker ml( myToIgnoreMessages ); return LightApp_Application::onReopenDoc(); @@ -772,7 +747,6 @@ bool SalomeApp_Application::onReopenDoc() /*!SLOT. Load document.*/ void SalomeApp_Application::onOpenDoc() { - DBG_FUN(); MessageLocker ml( myToIgnoreMessages ); LightApp_Application::onOpenDoc(); @@ -781,8 +755,6 @@ void SalomeApp_Application::onOpenDoc() /*!SLOT. Load document.*/ bool SalomeApp_Application::onOpenDoc(const QString& name) { - DBG_FUN(); - ARG(name); MessageLocker ml( myToIgnoreMessages ); return LightApp_Application::onOpenDoc(name); @@ -791,7 +763,6 @@ bool SalomeApp_Application::onOpenDoc(const QString& name) /*!Sets enable or disable some actions on selection changed.*/ void SalomeApp_Application::onSelectionChanged() { - DBG_FUN(); SALOME_ListIO list; LightApp_SelectionMgr* mgr = selectionMgr(); mgr->selectedObjects(list); @@ -824,7 +795,6 @@ void SalomeApp_Application::onSelectionChanged() /*!Delete references.*/ void SalomeApp_Application::onDeleteInvalidReferences() { - DBG_FUN(); SALOME_ListIO aList; LightApp_SelectionMgr* mgr = selectionMgr(); mgr->selectedObjects( aList, QString(), false ); @@ -852,7 +822,6 @@ void SalomeApp_Application::onDeleteInvalidReferences() /*!Private SLOT. */ void SalomeApp_Application::onOpenWith() { - DBG_FUN(); QApplication::setOverrideCursor( Qt::WaitCursor ); SALOME_ListIO aList; LightApp_SelectionMgr* mgr = selectionMgr(); @@ -876,7 +845,6 @@ void SalomeApp_Application::onOpenWith() */ SUIT_Study* SalomeApp_Application::createNewStudy() { - DBG_FUN(); SalomeApp_Study* aStudy = new SalomeApp_Study( this ); // Set up processing of major study-related events @@ -901,7 +869,6 @@ SUIT_Study* SalomeApp_Application::createNewStudy() */ void SalomeApp_Application::updateCommandsStatus() { - DBG_FUN(); LightApp_Application::updateCommandsStatus(); // Dump study menu @@ -982,7 +949,6 @@ public: /*!Private SLOT. On dump study.*/ void SalomeApp_Application::onDumpStudy( ) { - DBG_FUN(); SalomeApp_Study* appStudy = dynamic_cast( activeStudy() ); if ( !appStudy ) return; @@ -1037,7 +1003,6 @@ void SalomeApp_Application::onDumpStudy( ) /*!Private SLOT. On load script.*/ void SalomeApp_Application::onLoadScript( ) { - DBG_FUN(); if ( getStudy()->GetProperties()->IsLocked() ) { SUIT_MessageBox::warning( desktop(), QObject::tr("WRN_WARNING"), @@ -1070,7 +1035,6 @@ void SalomeApp_Application::onLoadScript( ) /*!Private SLOT. On save GUI state.*/ void SalomeApp_Application::onSaveGUIState() { - DBG_FUN(); SalomeApp_Study* study = dynamic_cast( activeStudy() ); if ( study ) { SalomeApp_VisualState( this ).storeState(); @@ -1083,8 +1047,6 @@ void SalomeApp_Application::onSaveGUIState() /*!Public SLOT. Performs some actions when dockable windows are triggered.*/ void SalomeApp_Application::onDockWindowVisibilityChanged( bool theIsVisible ) { - DBG_FUN(); - ARG(theIsVisible); LightApp_Application::onDockWindowVisibilityChanged( theIsVisible ); QAction* send = ::qobject_cast( sender() ); if ( !send ) @@ -1097,8 +1059,6 @@ void SalomeApp_Application::onDockWindowVisibilityChanged( bool theIsVisible ) /*!Create window.*/ QWidget* SalomeApp_Application::createWindow( const int flag ) { - DBG_FUN(); - ARG(flag); QWidget* wid = 0; #ifndef DISABLE_PYCONSOLE if ( flag != WT_PyConsole ) wid = LightApp_Application::createWindow(flag); @@ -1202,7 +1162,6 @@ QWidget* SalomeApp_Application::createWindow( const int flag ) /*!Create preferences.*/ void SalomeApp_Application::createPreferences( LightApp_Preferences* pref ) { - DBG_FUN(); LightApp_Application::createPreferences(pref); if ( !pref ) @@ -1232,7 +1191,6 @@ void SalomeApp_Application::createPreferences( LightApp_Preferences* pref ) /*!Update desktop title.*/ void SalomeApp_Application::updateDesktopTitle() { - DBG_FUN(); QString aTitle = applicationName(); QString aVer = applicationVersion(); if ( !aVer.isEmpty() ) @@ -1250,13 +1208,11 @@ void SalomeApp_Application::updateDesktopTitle() { } } - SHOW(aTitle); desktop()->setWindowTitle( aTitle ); } int SalomeApp_Application::closeChoice( const QString& /*docName*/ ) { - DBG_FUN(); QStringList buttons; QMap choices; int idx = 0; @@ -1282,8 +1238,6 @@ int SalomeApp_Application::closeChoice( const QString& /*docName*/ ) bool SalomeApp_Application::closeAction( const int choice, bool& closePermanently ) { - DBG_FUN(); - ARG(choice); bool res = true; switch( choice ) { @@ -1314,8 +1268,6 @@ bool SalomeApp_Application::closeAction( const int choice, bool& closePermanentl int SalomeApp_Application::openChoice( const QString& aName ) { - DBG_FUN(); - ARG(aName); int choice = LightApp_Application::openChoice( aName ); if ( QFileInfo( aName ).exists() ) { @@ -1346,9 +1298,6 @@ int SalomeApp_Application::openChoice( const QString& aName ) bool SalomeApp_Application::openAction( const int aChoice, const QString& aName ) { - DBG_FUN(); - ARG(aChoice); - ARG(aName); bool res = false; int choice = aChoice; switch ( choice ) @@ -1381,7 +1330,6 @@ bool SalomeApp_Application::openAction( const int aChoice, const QString& aName */ QMap SalomeApp_Application::activateModuleActions() const { - DBG_FUN(); QMap opmap = LightApp_Application::activateModuleActions(); opmap.insert( LoadStudyId, tr( "ACTIVATE_MODULE_OP_LOAD" ) ); @@ -1401,8 +1349,6 @@ QMap SalomeApp_Application::activateModuleActions() const */ void SalomeApp_Application::moduleActionSelected( const int id ) { - DBG_FUN(); - ARG(id); switch ( id ) { case LoadStudyId: onLoadDoc(); @@ -1458,7 +1404,6 @@ SALOME_LifeCycleCORBA* SalomeApp_Application::lcc() /*!Private SLOT. On preferences.*/ void SalomeApp_Application::onProperties() { - DBG_FUN(); SalomeApp_Study* study = dynamic_cast( activeStudy() ); if( !study ) return; @@ -1481,8 +1426,6 @@ void SalomeApp_Application::onProperties() /*!Insert items in popup, which necessary for current application*/ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title ) { - DBG_FUN(); - ARG(type); LightApp_SelectionMgr* mgr = selectionMgr(); bool cacheIsOn = mgr->isSelectionCacheEnabled(); mgr->setSelectionCacheEnabled( true ); @@ -1585,8 +1528,6 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop 3. update object browser if it exists */ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) { - DBG_FUN(); - ARG(updateModels); // update "non-existing" (not loaded yet) data models SalomeApp_Study* study = dynamic_cast(activeStudy()); if ( study ) @@ -1619,7 +1560,6 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) /*!Display Catalog Genenerator dialog */ void SalomeApp_Application::onCatalogGen() { - DBG_FUN(); ToolsGUI_CatalogGeneratorDlg aDlg( desktop() ); aDlg.exec(); } @@ -1627,7 +1567,6 @@ void SalomeApp_Application::onCatalogGen() /*!Display Registry Display dialog */ void SalomeApp_Application::onRegDisplay() { - DBG_FUN(); CORBA::ORB_var anOrb = orb(); ToolsGUI_RegWidget* regWnd = ToolsGUI_RegWidget::GetRegWidget( anOrb, desktop() ); regWnd->show(); @@ -1638,7 +1577,6 @@ void SalomeApp_Application::onRegDisplay() /*!find original object by double click on item */ void SalomeApp_Application::onDblClick( SUIT_DataObject* theObj ) { - DBG_FUN(); // Issue 21379: References are supported at LightApp_DataObject level LightApp_DataObject* obj = dynamic_cast( theObj ); @@ -1656,7 +1594,6 @@ void SalomeApp_Application::onDblClick( SUIT_DataObject* theObj ) if ( !aSelectedIndexes.isEmpty() ) ob->treeView()->scrollTo( aSelectedIndexes.first() ); } - MSGEL("-----> emit objectDoubleClicked <-----"); emit objectDoubleClicked( theObj ); } @@ -1666,8 +1603,6 @@ void SalomeApp_Application::onDblClick( SUIT_DataObject* theObj ) */ SUIT_ViewManager* SalomeApp_Application::newViewManager(const QString& type) { - DBG_FUN(); - ARG(type); return createViewManager(type); } @@ -1693,7 +1628,6 @@ int getSelectedSavePoint( const LightApp_SelectionMgr* selMgr ) /*!Called on Restore GUI State popup command*/ void SalomeApp_Application::onRestoreGUIState() { - DBG_FUN(); int savePoint = ::getSelectedSavePoint( selectionMgr() ); if ( savePoint == -1 ) return; @@ -1703,7 +1637,6 @@ void SalomeApp_Application::onRestoreGUIState() /*!Called on Delete GUI State popup command*/ void SalomeApp_Application::onDeleteGUIState() { - DBG_FUN(); int savePoint = ::getSelectedSavePoint( selectionMgr() ); if ( savePoint == -1 ) return; @@ -1718,7 +1651,6 @@ void SalomeApp_Application::onDeleteGUIState() /*!Called on New study operation*/ void SalomeApp_Application::onStudyCreated( SUIT_Study* study ) { - DBG_FUN(); LightApp_Application::onStudyCreated( study ); //#ifndef DISABLE_PYCONSOLE @@ -1734,7 +1666,6 @@ void SalomeApp_Application::onStudyCreated( SUIT_Study* study ) /*!Called on Open study operation*/ void SalomeApp_Application::onStudyOpened( SUIT_Study* study ) { - DBG_FUN(); LightApp_Application::onStudyOpened( study ); //#ifndef DISABLE_PYCONSOLE @@ -1756,7 +1687,6 @@ void SalomeApp_Application::onStudyOpened( SUIT_Study* study ) /*! updateSavePointDataObjects: syncronize data objects that correspond to save points (gui states)*/ void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study ) { - DBG_FUN(); SUIT_DataBrowser* ob = objectBrowser(); LightApp_SelectionMgr* selMgr = selectionMgr(); @@ -1851,8 +1781,6 @@ bool SalomeApp_Application::checkDataObject(LightApp_DataObject* theObj) */ bool SalomeApp_Application::useStudy( const QString& theName ) { - DBG_FUN(); - ARG(theName); createEmptyStudy(); SalomeApp_Study* aStudy = dynamic_cast( activeStudy() ); bool res = false; @@ -1866,7 +1794,6 @@ bool SalomeApp_Application::useStudy( const QString& theName ) /*! Show/hide object browser colums according to preferences */ void SalomeApp_Application::objectBrowserColumnsVisibility() { - DBG_FUN(); if ( objectBrowser() ) for ( int i = SalomeApp_DataObject::EntryId; i < SalomeApp_DataObject::LastId; i++ ) { @@ -1879,7 +1806,6 @@ void SalomeApp_Application::objectBrowserColumnsVisibility() /*! Set SalomeApp_NoteBook pointer */ void SalomeApp_Application::setNoteBook( SalomeApp_NoteBook* theNoteBook ) { - DBG_FUN(); myNoteBook = theNoteBook; } @@ -1909,7 +1835,6 @@ SalomeApp_NoteBook* SalomeApp_Application::getNoteBook() const */ void SalomeApp_Application::createExtraActions() { - DBG_FUN(); myExtActions.clear(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); @@ -1947,7 +1872,6 @@ void SalomeApp_Application::createExtraActions() */ void SalomeApp_Application::onExtAction() { - DBG_FUN(); QAction* aAction = ::qobject_cast(sender()); if (!aAction) return; @@ -2001,8 +1925,6 @@ bool SalomeApp_Application::renameAllowed( const QString& entry) const */ bool SalomeApp_Application::renameObject( const QString& /*entry*/, const QString& name ) { - DBG_FUN(); - ARG(name); SalomeApp_Study* aStudy = dynamic_cast( activeStudy() ); int savePoint = ::getSelectedSavePoint( selectionMgr() ); @@ -2029,7 +1951,6 @@ bool SalomeApp_Application::renameObject( const QString& /*entry*/, const QStrin //============================================================================ void SalomeApp_Application::onUpdateStudy() { - DBG_FUN(); QApplication::setOverrideCursor( Qt::WaitCursor ); if( !updateStudy() ) @@ -2046,7 +1967,6 @@ void SalomeApp_Application::onUpdateStudy() //============================================================================ bool SalomeApp_Application::updateStudy() { - DBG_FUN(); SalomeApp_Study* study = dynamic_cast( activeStudy() ); if ( !study || !myNoteBook ) return false; @@ -2134,9 +2054,6 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript, const QString& theStudyName, bool theIsStudySaved ) { - DBG_FUN(); - ARG(theDumpScript); - ARG(theStudyName); bool ok = true; // create a new study @@ -2188,11 +2105,9 @@ bool SalomeApp_Application::onRestoreStudy( const QString& theDumpScript, */ void SalomeApp_Application::afterCloseDoc() { - DBG_FUN(); #ifndef DISABLE_PYCONSOLE // emit signal to restore study from Python script if ( myNoteBook ) { - MSGEL("-----> emit dumpedStudyClosed <-----"); emit dumpedStudyClosed( myNoteBook->getDumpedStudyScript(), myNoteBook->getDumpedStudyName(), myNoteBook->isDumpedStudySaved() ); @@ -2203,7 +2118,6 @@ void SalomeApp_Application::afterCloseDoc() bool SalomeApp_Application::canOpenDoc( const QString& url ) { - DBG_FUN(); _PTR(Study) aStudyDS = getStudy(); if ( aStudyDS ) return aStudyDS->CanOpen( url.toUtf8().data() ); @@ -2223,7 +2137,6 @@ bool SalomeApp_Application::checkExistingDoc() PyConsole_Interp* SalomeApp_Application::createPyInterp() { - DBG_FUN(); return new SalomeApp_PyInterp( resourceMgr() ); } @@ -2231,7 +2144,6 @@ PyConsole_Interp* SalomeApp_Application::createPyInterp() void SalomeApp_Application::ensureShaperIsActivated() { - DBG_FUN(); SalomeApp_Study* study = dynamic_cast(activeStudy()); _PTR(Study) studyDS = getStudy(); if ( study && studyDS ) @@ -2250,9 +2162,6 @@ void SalomeApp_Application::ensureShaperIsActivated() void SalomeApp_Application::addCatalogue( const QString& moduleName, const QString& catalogue ) { - DBG_FUN(); - ARG(moduleName); - ARG(catalogue); CORBA::Object_var obj = namingService()->Resolve( "/Kernel/ModulCatalog" ); SALOME_ModuleCatalog::ModuleCatalog_var moduleCatalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow( obj ); QFileInfo fi( catalogue ); diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index 407573510..18893bb9c 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -38,12 +38,6 @@ #include #include CORBA_SERVER_HEADER(SALOME_Exception) -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SalomeApp_DataModel" -#include "MBDebug.h" -//--------------------------------------------------------- - typedef _PTR(SObject) kerPtr; typedef SUIT_DataObject* suitPtr; @@ -81,7 +75,6 @@ SalomeApp_DataModelSync::SalomeApp_DataModelSync( _PTR( Study ) aStudy, SUIT_Dat : myStudy( aStudy ), myRoot( aRoot ) { - DBG_FUN(); } /*! @@ -89,7 +82,6 @@ SalomeApp_DataModelSync::SalomeApp_DataModelSync( _PTR( Study ) aStudy, SUIT_Dat */ bool SalomeApp_DataModelSync::isCorrect( const kerPtr& so ) const { - DBG_FUN(); #ifdef WITH_SALOMEDS_OBSERVER // with GUI observers this function is not needed anymore return true; @@ -118,7 +110,6 @@ suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so, const suitPtr& parent, const suitPtr& after ) const { - DBG_FUN(); if( !isCorrect( so ) ) return 0; @@ -142,7 +133,6 @@ suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so, */ void SalomeApp_DataModelSync::deleteItemWithChildren( const suitPtr& p ) const { - DBG_FUN(); if( !p ) return; @@ -193,7 +183,6 @@ suitPtr SalomeApp_DataModelSync::nullTrg() const */ QList SalomeApp_DataModelSync::children( const kerPtr& obj ) const { - DBG_FUN(); QList ch; _PTR( GenericAttribute ) anAttr; @@ -228,7 +217,6 @@ QList SalomeApp_DataModelSync::children( const kerPtr& obj ) const */ QList SalomeApp_DataModelSync::children( const suitPtr& p ) const { - DBG_FUN(); QList ch; if ( p ) ch = p->children(); @@ -250,7 +238,6 @@ suitPtr SalomeApp_DataModelSync::parent( const suitPtr& p ) const */ void SalomeApp_DataModelSync::updateItem( const kerPtr&, const suitPtr& ) const { - DBG_FUN(); } /*! @@ -277,7 +264,6 @@ void showTree( SUIT_DataObject* root ) SalomeApp_DataModel::SalomeApp_DataModel( CAM_Module* theModule ) : LightApp_DataModel( theModule ) { - DBG_FUN(); } /*! @@ -285,7 +271,6 @@ SalomeApp_DataModel::SalomeApp_DataModel( CAM_Module* theModule ) */ SalomeApp_DataModel::~SalomeApp_DataModel() { - DBG_FUN(); } /*! @@ -293,8 +278,6 @@ SalomeApp_DataModel::~SalomeApp_DataModel() */ bool SalomeApp_DataModel::open( const QString& name, CAM_Study* study, QStringList ) { - DBG_FUN(); - ARG(name); SalomeApp_Study* aDoc = dynamic_cast( study ); if ( !aDoc ) return false; @@ -317,7 +300,6 @@ bool SalomeApp_DataModel::open( const QString& name, CAM_Study* study, QStringLi */ bool SalomeApp_DataModel::create( CAM_Study* theStudy ) { - DBG_FUN(); update(NULL, (LightApp_Study*)theStudy); return true; } @@ -327,7 +309,6 @@ bool SalomeApp_DataModel::create( CAM_Study* theStudy ) */ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) { - DBG_FUN(); SalomeApp_Study* aSStudy = dynamic_cast(study); LightApp_RootObject* studyRoot = 0; _PTR(SComponent) sobj; @@ -362,7 +343,6 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) */ SUIT_DataObject* SalomeApp_DataModel::synchronize( const _PTR( SComponent )& sobj, SalomeApp_Study* study ) { - DBG_FUNC(); if( !study || !study->root() || !sobj ) return 0; @@ -400,7 +380,6 @@ SUIT_DataObject* SalomeApp_DataModel::synchronize( const _PTR( SComponent )& sob */ void SalomeApp_DataModel::updateTree( const _PTR( SComponent )& comp, SalomeApp_Study* study ) { - DBG_FUN(); SalomeApp_ModuleObject* aNewRoot = dynamic_cast( synchronize( comp, study ) ); if( aNewRoot ) { @@ -422,7 +401,6 @@ SalomeApp_Module* SalomeApp_DataModel::getModule() const */ SalomeApp_Study* SalomeApp_DataModel::getStudy() const { - DBG_FUN(); if(!root()) return 0; LightApp_RootObject* aRoot = dynamic_cast( root()->root() ); if ( !aRoot ) @@ -438,7 +416,6 @@ SalomeApp_Study* SalomeApp_DataModel::getStudy() const */ QString SalomeApp_DataModel::getRootEntry( SalomeApp_Study* study ) const { - DBG_FUN(); QString anEntry; if ( root() && root()->root() ) { // data model already in a study SalomeApp_DataObject* anObj = dynamic_cast( root() ); diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index 7786cb9c1..7b53c2b5c 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -50,23 +50,15 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SalomeApp_Module" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!Constructor.*/ SalomeApp_Module::SalomeApp_Module( const QString& name ) : LightApp_Module( name ) { - DBG_FUN(); } /*!Destructor.*/ SalomeApp_Module::~SalomeApp_Module() { - DBG_FUN(); } /*!Gets application.*/ @@ -78,14 +70,12 @@ SalomeApp_Application* SalomeApp_Module::getApp() const /*!Create new instance of data model and return it.*/ CAM_DataModel* SalomeApp_Module::createDataModel() { - DBG_FUN(); return new SalomeApp_DataModel(this); } /*!Create and return instance of LightApp_Selection.*/ LightApp_Selection* SalomeApp_Module::createSelection() const { - DBG_FUN(); return LightApp_Module::createSelection(); } @@ -97,7 +87,6 @@ LightApp_Selection* SalomeApp_Module::createSelection() const */ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_ListIO& dest ) const { - DBG_FUN(); SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); if( !study ) { @@ -148,7 +137,6 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li */ void SalomeApp_Module::storeVisualParameters(int /*savePoint*/) { - DBG_FUN(); } /*! @@ -159,5 +147,4 @@ void SalomeApp_Module::storeVisualParameters(int /*savePoint*/) */ void SalomeApp_Module::restoreVisualParameters(int /*savePoint*/) { - DBG_FUN(); } diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 7068de0a1..c5a054551 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -60,12 +60,6 @@ #include #include CORBA_SERVER_HEADER(SALOME_Exception) -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "SalomeApp_Study" -#include "MBDebug.h" -//--------------------------------------------------------- - //#define NOTIFY_BY_EVENT class ObserverEvent : public QEvent @@ -90,7 +84,6 @@ public: Observer_i( SalomeApp_Study* aStudy):QObject(aStudy) { - DBG_FUN(); myStudy=aStudy; fillEntryMap(); } @@ -103,7 +96,6 @@ public: virtual void notifyObserverID(const char* theID, CORBA::Long event) { - DBG_FUN(); #ifdef NOTIFY_BY_EVENT QCoreApplication::postEvent(this,new ObserverEvent(theID,event)); #else @@ -113,7 +105,6 @@ public: virtual bool event(QEvent *event) { - DBG_FUN(); if (event->type() == QEvent::User ) { //START_TIMING(notify); @@ -130,7 +121,6 @@ public: switch(event) { case 1: { //Add sobject - MSGEL("...Add SObject: theID=\"" << theID << "\", event=" << event); _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID(theID); _PTR(SComponent) aSComp = aSObj->GetFatherComponent(); @@ -292,7 +282,6 @@ public: } case 2: { // Remove sobject - MSGEL("...Remove SObject: theID=\"" << theID << "\", event=" << event); EntryMapIter it = entry2SuitObject.find( theID ); if ( it != entry2SuitObject.end() ) { @@ -311,7 +300,6 @@ public: } case 0: { //modify sobject - MSGEL("...Modify SObject: theID=\"" << theID << "\", event=" << event); //MESSAGE("Want to modify an object " << theID); EntryMapIter it = entry2SuitObject.find( theID ); if ( it != entry2SuitObject.end() ) @@ -327,7 +315,6 @@ public: } case 5: //IOR of the object modified { - MSGEL("...IOR of SObject modified: theID=\"" << theID << "\", event=" << event); EntryMapIter it = entry2SuitObject.find( theID ); if ( it != entry2SuitObject.end() ) suit_obj = it->second; @@ -351,7 +338,6 @@ public: #ifndef DISABLE_PYCONSOLE case 6: //NoteBook variables were modified { - MSGEL("...NoteBook variable modified: theID=\"" << theID << "\", event=" << event); myStudy->onNoteBookVarUpdate( QString( theID.c_str() ) ); break; } @@ -363,7 +349,6 @@ public: private: void fillEntryMap() { - DBG_FUN(); entry2SuitObject.clear(); SUIT_DataObject* o = myStudy->root(); while (o) { @@ -406,7 +391,6 @@ private: SalomeApp_Study::SalomeApp_Study( SUIT_Application* app ) : LightApp_Study( app ), myObserver( 0 ) { - DBG_FUN(); myStudyDS = SalomeApp_Application::getStudy(); } @@ -415,7 +399,6 @@ SalomeApp_Study::SalomeApp_Study( SUIT_Application* app ) */ SalomeApp_Study::~SalomeApp_Study() { - DBG_FUN(); if ( myObserver ) { PortableServer::ObjectId_var oid = myObserver->_default_POA()->servant_to_id( myObserver ); myObserver->_default_POA()->deactivate_object( oid.in() ); @@ -426,9 +409,6 @@ SalomeApp_Study::~SalomeApp_Study() #ifndef DISABLE_PYCONSOLE void SalomeApp_Study::onNoteBookVarUpdate( QString theVarName) { - DBG_FUN(); - ARG(theVarName); - MSGEL("-----> emit notebookVarUpdate(\"" << theVarName.toStdString() << "\") <-----"); emit notebookVarUpdated( theVarName ); } #endif @@ -438,7 +418,6 @@ void SalomeApp_Study::onNoteBookVarUpdate( QString theVarName) */ QString SalomeApp_Study::studyName() const { - DBG_FUN(); // redefined from SUIT_Study to update study name properly since // it can be changed outside of GUI // TEMPORARILY SOLUTION: better to be implemented with help of SALOMEDS observers @@ -468,8 +447,6 @@ _PTR(Study) SalomeApp_Study::studyDS() const */ bool SalomeApp_Study::createDocument( const QString& theStr ) { - DBG_FUN(); - ARG(theStr); MESSAGE( "createDocument" ); setStudyName( QString::fromUtf8(myStudyDS->URL().c_str()) ); @@ -489,7 +466,6 @@ bool SalomeApp_Study::createDocument( const QString& theStr ) myStudyDS->attach(myObserver->_this(),true); #endif - MSGEL("-----> emit created <-----"); emit created( this ); return aRet; @@ -501,8 +477,6 @@ bool SalomeApp_Study::createDocument( const QString& theStr ) */ bool SalomeApp_Study::openDocument( const QString& theFileName ) { - DBG_FUN(); - ARG(theFileName); MESSAGE( "openDocument" ); // read HDF file @@ -553,7 +527,6 @@ bool SalomeApp_Study::openDocument( const QString& theFileName ) res = CAM_Study::openDocument( theFileName ); - MSGEL("-----> emit opened <-----"); emit opened( this ); myStudyDS->IsSaved(true); @@ -574,8 +547,6 @@ bool SalomeApp_Study::openDocument( const QString& theFileName ) */ bool SalomeApp_Study::loadDocument( const QString& theStudyName ) { - DBG_FUN(); - ARG(theStudyName); MESSAGE( "loadDocument" ); setRoot( new SalomeApp_RootObject( this ) ); // create myRoot @@ -595,7 +566,6 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName ) //rnv: to fix the "0051779: TC7.2.0: Save operation works incorrectly for study loaded from data server" // mark study as "not saved" after call openDocument( ... ) method. setIsSaved(false); - MSGEL("-----> emit opened <-----"); emit opened( this ); // myRoot is set to Object Browser here // this will build a SUIT_DataObject-s tree under myRoot member field @@ -627,8 +597,6 @@ bool SalomeApp_Study::loadDocument( const QString& theStudyName ) */ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) { - DBG_FUN(); - ARG(theFileName); bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", false ); if ( store ) SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState(); @@ -662,10 +630,8 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) res = res && saveStudyData(theFileName, 0); // 0 means persistence file - if ( res ) { - MSGEL("-----> emit saved <-----"); + if ( res ) emit saved( this ); - } return res; } @@ -675,7 +641,6 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) */ bool SalomeApp_Study::saveDocument() { - DBG_FUN(); bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", true ); if ( store ) SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState(); @@ -707,10 +672,8 @@ bool SalomeApp_Study::saveDocument() bool res = studyDS()->Save( isMultiFile, isAscii ) && CAM_Study::saveDocument(); res = res && saveStudyData(studyName(), 0); // 0 means persistence file - if ( res ) { - MSGEL("-----> emit saved <-----"); + if ( res ) emit saved( this ); - } return res; } @@ -720,8 +683,6 @@ bool SalomeApp_Study::saveDocument() */ void SalomeApp_Study::closeDocument(bool permanently) { - DBG_FUN(); - ARG(permanently); LightApp_Study::closeDocument(permanently); // close SALOMEDS document @@ -760,8 +721,6 @@ bool SalomeApp_Study::dump( const QString& theFileName, bool isMultiFile, bool toSaveGUI ) { - DBG_FUN(); - ARG(theFileName); int savePoint = 0; _PTR(AttributeParameter) ap; _PTR(IParameters) ip = ClientFactory::getIParameters(ap); @@ -833,7 +792,6 @@ bool SalomeApp_Study::isModified() const */ void SalomeApp_Study::Modified() { - DBG_FUN(); myStudyDS->Modified(); LightApp_Study::Modified(); } @@ -857,9 +815,6 @@ bool SalomeApp_Study::isSaved() const */ void SalomeApp_Study::saveModuleData( QString theModuleName, int type, QStringList theListOfFiles ) { - DBG_FUN(); - ARG(theModuleName); - ARG(type); int aNb = theListOfFiles.count(); if ( aNb == 0 ) return; @@ -882,9 +837,6 @@ void SalomeApp_Study::saveModuleData( QString theModuleName, int type, QStringLi */ void SalomeApp_Study::openModuleData( QString theModuleName, int type, QStringList& theListOfFiles ) { - DBG_FUN(); - ARG(theModuleName); - ARG(type); std::vector aListOfFiles = GetListOfFiles( theModuleName.toStdString().c_str(), type ); int i, aLength = (int)aListOfFiles.size() - 1; //!< TODO: conversion from size_t to int @@ -904,7 +856,6 @@ void SalomeApp_Study::openModuleData( QString theModuleName, int type, QStringLi */ bool SalomeApp_Study::saveStudyData( const QString& /*theFileName*/, int type ) { - DBG_FUN(); ModelList list; dataModels( list ); QListIterator it( list ); while ( it.hasNext() ){ @@ -923,7 +874,6 @@ bool SalomeApp_Study::saveStudyData( const QString& /*theFileName*/, int type ) */ bool SalomeApp_Study::openStudyData( const QString& /*theFileName*/, int /*type*/ ) { - DBG_FUN(); return true; } @@ -939,7 +889,6 @@ bool SalomeApp_Study::openStudyData( const QString& /*theFileName*/, int /*type* CAM_ModuleObject* SalomeApp_Study::createModuleObject( LightApp_DataModel* theDataModel, SUIT_DataObject* theParent ) const { - DBG_FUN(); SalomeApp_Study* that = const_cast( this ); // Ensure that SComponent instance is published in the study for the given module @@ -977,7 +926,6 @@ CAM_ModuleObject* SalomeApp_Study::createModuleObject( LightApp_DataModel* theDa */ void SalomeApp_Study::dataModelInserted (const CAM_DataModel* dm) { - DBG_FUN(); MESSAGE("SalomeApp_Study::dataModelInserted() : module name() = " << dm->module()->name().toStdString()); CAM_Study::dataModelInserted(dm); @@ -990,7 +938,6 @@ void SalomeApp_Study::dataModelInserted (const CAM_DataModel* dm) */ void SalomeApp_Study::addComponent(const CAM_DataModel* dm) { - DBG_FUN(); SalomeApp_Module* aModule = dynamic_cast( dm->module() ); // 1. aModule == 0 means that this is a light module (no CORBA enigine) if (!aModule) { @@ -1038,8 +985,6 @@ void SalomeApp_Study::addComponent(const CAM_DataModel* dm) */ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm ) { - DBG_FUN(); - ARG(studyName); if (!dm) return false; @@ -1113,9 +1058,6 @@ bool SalomeApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm */ std::vector SalomeApp_Study::GetListOfFiles( const char* theModuleName, int type ) const { - DBG_FUN(); - ARG(theModuleName); - ARG(type); // Issue 21377 - using separate engine for each type of light module SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance( theModuleName, false ); if (aDefaultEngine) @@ -1135,9 +1077,6 @@ std::vector SalomeApp_Study::GetListOfFiles( const char* theModuleN void SalomeApp_Study::SetListOfFiles ( const char* theModuleName, int type, const std::vector theListOfFiles ) { - DBG_FUN(); - ARG(theModuleName); - ARG(type); // Issue 21377 - using separate engine for each type of light module SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance( theModuleName, false ); if (aDefaultEngine) @@ -1149,8 +1088,6 @@ void SalomeApp_Study::SetListOfFiles ( const char* theModuleName, int type, */ std::string SalomeApp_Study::GetTmpDir ( const char* theURL, const bool isMultiFile ) { - DBG_FUN(); - ARG(theURL); std::string anURLDir = SALOMEDS_Tool::GetDirFromPath(theURL); std::string aTmpDir = isMultiFile ? anURLDir : SALOMEDS_Tool::GetTmpDir(); return aTmpDir; @@ -1161,8 +1098,6 @@ std::string SalomeApp_Study::GetTmpDir ( const char* theURL, const bool isMulti */ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, bool isMultiFile, bool force ) { - DBG_FUN(); - ARG(theModuleName); if (isMultiFile) return; @@ -1193,8 +1128,6 @@ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, bool isM */ void SalomeApp_Study::updateFromNotebook( const QString& theFileName, bool isSaved ) { - DBG_FUN(); - ARG(theFileName); setStudyName(theFileName); studyDS()->URL(theFileName.toStdString()); setIsSaved( isSaved ); @@ -1203,8 +1136,6 @@ void SalomeApp_Study::updateFromNotebook( const QString& theFileName, bool isSav LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry ) { - DBG_FUN(); - ARG(theEntry); LightApp_DataObject* o = 0; if ( myObserver ) { o = dynamic_cast( myObserver->findObject( theEntry.toUtf8().constData() ) ); @@ -1221,7 +1152,6 @@ LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry */ void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj ) { - DBG_FUN(); _PTR(StudyBuilder) sb = studyDS()->NewBuilder(); std::vector<_PTR(SObject)> aRefs = studyDS()->FindDependances( obj ); for( size_t i=0, n=aRefs.size(); iFindObjectID( entry.toStdString() ); _PTR(SObject) refobj; @@ -1276,8 +1204,6 @@ bool SalomeApp_Study::isComponent( const QString& entry ) const */ void SalomeApp_Study::children( const QString& entry, QStringList& child_entries ) const { - DBG_FUN(); - ARG(entry); _PTR(SObject) SO = studyDS()->FindObjectID( entry.toStdString() ); _PTR(ChildIterator) anIter ( studyDS()->NewChildIterator( SO ) ); anIter->InitEx( true ); @@ -1295,7 +1221,6 @@ void SalomeApp_Study::children( const QString& entry, QStringList& child_entries */ void SalomeApp_Study::components( QStringList& comps ) const { - DBG_FUN(); for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() ) { _PTR(SComponent) aComponent ( it->Value() ); @@ -1312,8 +1237,6 @@ void SalomeApp_Study::components( QStringList& comps ) const */ QString SalomeApp_Study::centry( const QString& comp ) const { - DBG_FUN(); - ARG(comp); QString e; for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More() && e.isEmpty(); it->Next() ) { @@ -1321,7 +1244,6 @@ QString SalomeApp_Study::centry( const QString& comp ) const if ( aComponent && comp == aComponent->ComponentDataType().c_str() ) e = aComponent->GetID().c_str(); } - RET(e); return e; } @@ -1330,7 +1252,6 @@ QString SalomeApp_Study::centry( const QString& comp ) const */ std::vector SalomeApp_Study::getSavePoints() { - DBG_FUN(); std::vector v; _PTR(SObject) so = studyDS()->FindComponent( getVisualComponentName().toLatin1().constData() ); @@ -1353,8 +1274,6 @@ std::vector SalomeApp_Study::getSavePoints() */ void SalomeApp_Study::removeSavePoint(int savePoint) { - DBG_FUN(); - ARG(savePoint); if(savePoint <= 0) return; _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint); _PTR(SObject) so = AP->GetSObject(); @@ -1377,9 +1296,6 @@ QString SalomeApp_Study::getNameOfSavePoint(int savePoint) */ void SalomeApp_Study::setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint) { - DBG_FUN(); - ARG(savePoint); - ARG(nameOfSavePoint); _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint); _PTR(IParameters) ip = ClientFactory::getIParameters(AP); ip->setProperty("AP_SAVEPOINT_NAME", nameOfSavePoint.toStdString()); @@ -1390,8 +1306,6 @@ void SalomeApp_Study::setNameOfSavePoint(int savePoint, const QString& nameOfSav */ void SalomeApp_Study::restoreState(int savePoint) { - DBG_FUN(); - ARG(savePoint); SalomeApp_VisualState((SalomeApp_Application*)application()).restoreState(savePoint); } @@ -1401,7 +1315,6 @@ void SalomeApp_Study::restoreState(int savePoint) */ void SalomeApp_Study::updateModelRoot( const CAM_DataModel* dm ) { - DBG_FUN(); LightApp_Study::updateModelRoot( dm ); // calling updateSavePointDataObjects in order to set correct order of "Gui states" object diff --git a/src/VTKViewer/MBDebug.h b/src/VTKViewer/MBDebug.h deleted file mode 100644 index bde273ff5..000000000 --- a/src/VTKViewer/MBDebug.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef MBDebug_HeaderFile -#define MBDebug_HeaderFile - -//--------------------------------------------------------------- -// Usage of the logging facilities: -// -// (1) At the beginning of each class file to be debugged, there -// should be a static string variable defined with the name -// of the class. Then, include the "MBDebug.h" header file. -// -// //--------------------------------------------------------- -// #define USE_DEBUG -// //#define MB_IGNORE_QT -// #define MBCLASSNAME "ClassName" -// #include "MBDebug.h" -// //--------------------------------------------------------- -// -// (2) At the beginning of each class method, call the DBG_FUN -// macro. -// -// int ClassName::MyMethod(int x) -// { -// DBG_FUN(); -// ... -// } -// -// NOTE: For static methods, call the DBG_FUNC() macro!! -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// This debugging/logging class is a "header-only" solution and -// does NOT require any additional implementation (.cpp) file! -//--------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef MB_IGNORE_QT -# include -#endif - -//--------------------------------------------------------------- -// Set the debug flags dependent on the preprocessor definitions -//--------------------------------------------------------------- -#ifdef USE_DEBUG -# define MBS_DEBUG_FLAG MBDebug::DF_DEBUG -#else -# define MBS_DEBUG_FLAG 0 -#endif /*DEBUG*/ - -#define MBS_DBG_FLAGS (MBS_DEBUG_FLAG) - - -//--------------------------------------------------------------- -// Define the global debug macros -//--------------------------------------------------------------- -#define DLOG MBDebug::LogPrint() -#define RETURN(var) { RET(var); return (var); } - -#ifdef USE_DEBUG - -# define DBG_FUN() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS, (void*)this) -# define DBG_FUNC() MBDebug _dbg(MBCLASSNAME, __FUNCTION__, MBS_DBG_FLAGS) -# define DBG_FUNB(blk) MBDebug _dbg(MBCLASSNAME, blk, MBS_DBG_FLAGS) -# define MSGEL(txt) MBDebug::LogPrint() << txt << std::endl -# define PRINT(txt) MBDebug::LogPrint() << txt -# define SHOW2(var,typ) DumpVar(#var,(typ)(var)) -# define SHOW(var) DumpVar(#var,var) -# define ARG(var) do { PRINT("in:"); DumpVar(#var,var); } while (0) -# define ARG2(var,typ) do { PRINT("in:"); DumpVar(#var,(typ)(var)); } while (0) -# define RET(var) do { PRINT("out:"); DumpVar(#var,var); } while (0) -# define MSG(txt) MBDebug::LogPrint() << txt - -#else /*!USE_DEBUG*/ - -# define DBG_FUN() -# define DBG_FUNC() -# define DBG_FUNB(blk) -# define MSGEL(txt) -# define PRINT(txt) -# define SHOW2(var,typ) -# define SHOW(var) -# define ARG(var) -# define ARG2(var,typ) -# define RET(var) -# define MSG(txt) - -#endif /*USE_DEBUG*/ - - -//--------------------------------------------------------------- -// Declare the debugging and profiling class -//--------------------------------------------------------------- -class MBDebug -{ -public: - enum { - DF_NONE = 0x00, // no debug - DF_DEBUG = 0x01 // debug a function - }; - - MBDebug(const char* aClassName, const char* aFuncName, const short aFlag, void* aThis=NULL) - :mClassName(aClassName),mFuncName(aFuncName),mThis(aThis),mFlags((unsigned char)aFlag) - { - if (mFlags & (DF_DEBUG)) - { - std::cout << "{ENTER: " << mClassName + "::" + mFuncName; - if (mThis) std::cout << "(this=" << mThis << ")"; - std::cout << std::endl; - } - } - virtual ~MBDebug() - { - if (mFlags & (DF_DEBUG)) - std::cout << "}LEAVE: " << mClassName << "::" << mFuncName << std::endl; - } - - // Log file output management - static std::ostream& LogPrint() { return std::cout; } - -private: - std::string mClassName; // Name of class to be debugged - std::string mFuncName; // Name of function to be debugged - void* mThis; // The "this" pointer to the class being debugged - unsigned char mFlags; // Debug mode flags -}; - - - -#define YesNo(b) (b ? "Yes" : "No") - - - -inline std::string w2s(std::wstring ws) -{ - using convert_typeX = std::codecvt_utf8; - std::wstring_convert converterX; - return(converterX.to_bytes(ws)); -} - -// Primitive types -inline void DumpVar(const char *szName, char value) -{ - DLOG << "[chr]: " << szName << "='" << value << "'" << std::endl; -} - -inline void DumpVar(const char *szName, bool value) -{ - DLOG << "[bool]: " << szName << "=" << (value ? "true" : "false") << std::endl; -} - -inline void DumpVar(const char *szName, short value) -{ - DLOG << "[shrt]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, int value) -{ - DLOG << "[int]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, long value) -{ - DLOG << "[long]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, double value) -{ - DLOG << "[dbl]: " << szName << "=" << value << std::endl; -} - -inline void DumpVar(const char *szName, unsigned char value) -{ - DLOG << "[byte]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned short value) -{ - DLOG << "[word]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned int value) -{ - DLOG << "[uint]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, unsigned long value) -{ - DLOG << "[dword]: " << szName << "=0x" << std::hex << value << std::dec << std::endl; -} - -inline void DumpVar(const char *szName, const char* value) -{ - DLOG << "[str]: " << szName << "=\"" << (value ? value : "") << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::string &value) -{ - DLOG << "[Str]: " << szName << "=\"" << value << "\"" << std::endl; -} - -inline void DumpVar(const char *szName, const std::wstring &value) -{ - DLOG << "[WStr]: " << szName << "=\"" << w2s(value) << "\"" << std::endl; -} - -#ifndef MB_IGNORE_QT -inline void DumpVar(const char *szName, const QString &value) -{ - DLOG << "[QStr]: " << szName << "=\"" << value.toStdString() << "\"" << std::endl; -} -#endif - -inline void DumpVar(const char *szName, const void* value) -{ - DLOG << "[ptr]: " << szName << "=" << value << std::endl; -} - - -// Collection of primitive types -inline void DumpVar(const char *szName, const std::set &values) -{ - DLOG << "[intSet]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << *it; - DLOG << "]" << std::endl; -} - -inline void DumpVar(const char *szName, const std::list& values) -{ - DLOG << "[boolList]: " << szName << "={" << values.size() << "}["; - bool bFirst = true; - for (auto it=values.cbegin(); it!=values.cend(); ++it) - DLOG << (bFirst ? "" : ",") << (*it ? "Y" : "N"); - DLOG << "]" << std::endl; -} - - -#endif // MBDebug_HeaderFile - diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index 8c054bb2d..1c40f6601 100644 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -44,12 +44,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_Actor" -#include "MBDebug.h" -//--------------------------------------------------------- - #if defined __GNUC__ #if __GNUC__ == 2 #define __GNUC_2__ @@ -80,7 +74,6 @@ VTKViewer_Actor myIsPreselected(false), myIsHighlighted(false) { - DBG_FUN(); VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor, myPolygonOffsetUnits); @@ -94,7 +87,6 @@ VTKViewer_Actor VTKViewer_Actor ::~VTKViewer_Actor() { - DBG_FUN(); SetPreviewProperty(NULL); myGeomFilter->Delete(); @@ -126,9 +118,7 @@ void VTKViewer_Actor ::setName(const char* theName) { - DBG_FUN(); myName = theName; - ARG(myName); } /*! @@ -138,7 +128,6 @@ void VTKViewer_Actor ::AddToRender(vtkRenderer* theRenderer) { - DBG_FUN(); theRenderer->AddActor(this); } @@ -149,7 +138,6 @@ void VTKViewer_Actor ::RemoveFromRender(vtkRenderer* theRenderer) { - DBG_FUN(); theRenderer->RemoveActor(this); } @@ -169,7 +157,6 @@ void VTKViewer_Actor ::SetTransform(VTKViewer_Transform* theTransform) { - DBG_FUN(); myTransformFilter->SetTransform(theTransform); } @@ -181,7 +168,6 @@ void VTKViewer_Actor ::SetMapper(vtkMapper* theMapper) { - DBG_FUN(); InitPipeLine(theMapper); } @@ -192,7 +178,6 @@ void VTKViewer_Actor ::InitPipeLine(vtkMapper* theMapper) { - DBG_FUN(); if(theMapper){ int anId = 0; myPassFilter[ anId ]->SetInputData( theMapper->GetInput() ); @@ -226,9 +211,6 @@ void VTKViewer_Actor ::Render(vtkRenderer *ren, vtkMapper* m) { - //DBG_FUN(); - MSGEL("...VTKViewer_Actor::Render()"); - if(vtkDataSet* aDataSet = GetInput()){ static double PERCENTS_OF_DETAILS = 0.50; vtkIdType aNbOfPoints = vtkIdType(aDataSet->GetNumberOfPoints()*PERCENTS_OF_DETAILS); @@ -262,7 +244,6 @@ void VTKViewer_Actor ::SetResolveCoincidentTopology(bool theIsResolve) { - DBG_FUN(); myIsResolveCoincidentTopology = theIsResolve; } @@ -275,7 +256,6 @@ VTKViewer_Actor ::SetPolygonOffsetParameters(double factor, double units) { - DBG_FUN(); myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; } @@ -387,8 +367,6 @@ void VTKViewer_Actor ::SetRepresentation(int theMode) { - DBG_FUN(); - ARG(theMode); using namespace VTKViewer::Representation; switch(myRepresentation){ case Points : @@ -524,8 +502,6 @@ void VTKViewer_Actor ::SetInfinitive(bool theIsInfinite) { - DBG_FUN(); - ARG(theIsInfinite); myIsInfinite = theIsInfinite; } @@ -605,8 +581,6 @@ void VTKViewer_Actor ::SetOpacity(double theOpacity) { - DBG_FUN(); - ARG(theOpacity); myOpacity = theOpacity; GetProperty()->SetOpacity(theOpacity); } @@ -628,8 +602,6 @@ VTKViewer_Actor double g, double b) { - DBG_FUN(); - MSGEL("RGB=(" << r << ", " << g << ", " << b << ")"); GetProperty()->SetColor(r,g,b); } @@ -640,7 +612,6 @@ void VTKViewer_Actor ::SetColor(const double theRGB[3]) { - MSGEL("RGB=(" << theRGB[0] << ", " << theRGB[1] << ", " << theRGB[2] << ")"); SetColor(theRGB[0],theRGB[1],theRGB[2]); } @@ -707,8 +678,6 @@ void VTKViewer_Actor ::setDisplayMode(int theMode) { - DBG_FUN(); - ARG(theMode); SetRepresentation(theMode + 1); myDisplayMode = GetRepresentation() - 1; } @@ -751,7 +720,6 @@ void VTKViewer_Actor ::SetPreSelected(bool thePreselect) { - //DBG_FUN(); myIsPreselected = thePreselect; } @@ -769,7 +737,6 @@ VTKViewer_Actor * On/Off representation 2D quadratic element as arked polygon */ void VTKViewer_Actor::SetQuadraticArcMode(bool theFlag){ - DBG_FUN(); myGeomFilter->SetQuadraticArcMode(theFlag); } @@ -783,7 +750,6 @@ bool VTKViewer_Actor::GetQuadraticArcMode() const{ * Set Max angle for representation 2D quadratic element as arked polygon */ void VTKViewer_Actor::SetQuadraticArcAngle(double theMaxAngle){ - DBG_FUN(); myGeomFilter->SetQuadraticArcAngle(theMaxAngle); } diff --git a/src/VTKViewer/VTKViewer_AppendFilter.cxx b/src/VTKViewer/VTKViewer_AppendFilter.cxx index ce86cf6ed..52fb68958 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.cxx +++ b/src/VTKViewer/VTKViewer_AppendFilter.cxx @@ -38,12 +38,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_AppendFilter" -#include "MBDebug.h" -//--------------------------------------------------------- - #if defined __GNUC__ #if __GNUC__ == 2 #define __GNUC_2__ @@ -55,22 +49,17 @@ vtkStandardNewMacro(VTKViewer_AppendFilter) VTKViewer_AppendFilter ::VTKViewer_AppendFilter() { - DBG_FUN(); myDoMappingFlag = false; } VTKViewer_AppendFilter ::~VTKViewer_AppendFilter() -{ - DBG_FUN(); -} +{} void VTKViewer_AppendFilter ::SetDoMappingFlag(const bool theFlag) { - DBG_FUN(); - ARG(theFlag); if(myDoMappingFlag == theFlag) return; @@ -90,7 +79,6 @@ void VTKViewer_AppendFilter ::SetSharedPointsDataSet(vtkPointSet* thePointsDataSet) { - DBG_FUN(); if(GetSharedPointsDataSet() == thePointsDataSet) return; @@ -113,7 +101,6 @@ VTKViewer_AppendFilter vtkInformationVector **inputVector, vtkInformationVector *outputVector) { - DBG_FUN(); int aRet = 0; if(GetSharedPointsDataSet()) aRet = MakeOutput(request,inputVector,outputVector); @@ -131,7 +118,6 @@ void VTKViewer_AppendFilter ::DoMapping() { - DBG_FUN(); myNodeRanges.clear(); myCellRanges.clear(); @@ -272,7 +258,6 @@ VTKViewer_AppendFilter vtkInformationVector **inputVector, vtkInformationVector *outputVector) { - DBG_FUN(); int idx; vtkIdType numPts, numCells, cellId; // vtkCellData *cd; @@ -348,7 +333,6 @@ VTKViewer_AppendFilter int VTKViewer_AppendFilter::FillInputPortInformation(int, vtkInformation *info) { - DBG_FUN(); info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet"); info->Set(vtkAlgorithm::INPUT_IS_REPEATABLE(), 1); return 1; diff --git a/src/VTKViewer/VTKViewer_ArcBuilder.cxx b/src/VTKViewer/VTKViewer_ArcBuilder.cxx index 781a1fbbc..aae0074f9 100644 --- a/src/VTKViewer/VTKViewer_ArcBuilder.cxx +++ b/src/VTKViewer/VTKViewer_ArcBuilder.cxx @@ -38,12 +38,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_ArcBuilder" -#include "MBDebug.h" -//--------------------------------------------------------- - #define PRECISION 10e-4 #define ANGLE_PRECISION 0.5 //#define _MY_DEBUG_ @@ -236,7 +230,6 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1, myAngle(theAngle), myStatus(Arc_Error) { - DBG_FUN(); Vec V1(thePnt2.GetXYZ().X()-thePnt1.GetXYZ().X(), thePnt2.GetXYZ().Y()-thePnt1.GetXYZ().Y(), thePnt2.GetXYZ().Z()-thePnt1.GetXYZ().Z()); @@ -356,9 +349,7 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1, * Destructor */ VTKViewer_ArcBuilder::~VTKViewer_ArcBuilder() -{ - DBG_FUN(); -} +{} /* @@ -366,7 +357,6 @@ VTKViewer_ArcBuilder::~VTKViewer_ArcBuilder() */ vtkUnstructuredGrid* VTKViewer_ArcBuilder::BuildGrid(const PntList& theList) const { - DBG_FUN(); int aListsize = (int)theList.size(); //!< TODO: conversion from size_t to int vtkUnstructuredGrid* aGrid = NULL; @@ -402,7 +392,6 @@ vtkUnstructuredGrid* VTKViewer_ArcBuilder::TransformGrid(vtkUnstructuredGrid* theGrid, const Vec& theAxis, const double angle) const { - DBG_FUN(); vtkTransform *aTransform = vtkTransform::New(); aTransform->RotateWXYZ(angle, theAxis.GetXYZ().X(), theAxis.GetXYZ().Y(), theAxis.GetXYZ().Z()); vtkTransformFilter* aTransformFilter = vtkTransformFilter::New(); @@ -434,7 +423,6 @@ double InterpolateScalarValue(int index, int count, double firstValue, double mi vtkUnstructuredGrid* VTKViewer_ArcBuilder::BuildArc(std::vector& theScalarValues) { - DBG_FUN(); double x1 = myPnt1.GetXYZ().X(); double x2 = myPnt2.GetXYZ().X(); double x3 = myPnt3.GetXYZ().X(); double y1 = myPnt1.GetXYZ().Y(); double y2 = myPnt2.GetXYZ().Y(); double y3 = myPnt3.GetXYZ().Y(); double z = myPnt1.GetXYZ().Z(); //Points on plane || XOY diff --git a/src/VTKViewer/VTKViewer_CellCenters.cxx b/src/VTKViewer/VTKViewer_CellCenters.cxx index 1414e1220..12125e091 100644 --- a/src/VTKViewer/VTKViewer_CellCenters.cxx +++ b/src/VTKViewer/VTKViewer_CellCenters.cxx @@ -33,12 +33,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_CellCenters" -#include "MBDebug.h" -//--------------------------------------------------------- - vtkStandardNewMacro(VTKViewer_CellCenters) /*! @@ -52,7 +46,6 @@ vtkStandardNewMacro(VTKViewer_CellCenters) */ VTKViewer_CellCenters::VTKViewer_CellCenters() { - DBG_FUN(); } /*! @@ -63,7 +56,6 @@ int VTKViewer_CellCenters::RequestData( vtkInformationVector **inputVector, vtkInformationVector *outputVector) { - DBG_FUN(); // get the info objects vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); vtkInformation *outInfo = outputVector->GetInformationObject(0); diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index 787b9e143..b857571df 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -43,12 +43,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_Triangulator" -#include "MBDebug.h" -//--------------------------------------------------------- - #ifdef _DEBUG_ static int DEBUG_TRIA_EXECUTE = 0; #else @@ -90,16 +84,13 @@ VTKViewer_Triangulator myPointIds(NULL), myFaceIds(vtkIdList::New()), myPoints(vtkPoints::New()) -{ - DBG_FUN(); -} +{} //---------------------------------------------------------------------------- VTKViewer_Triangulator ::~VTKViewer_Triangulator() { - DBG_FUN(); myCellIds->Delete(); myFaceIds->Delete(); myPoints->Delete(); @@ -112,7 +103,6 @@ VTKViewer_Triangulator ::InitPoints(vtkUnstructuredGrid *theInput, vtkIdType theCellId) { - DBG_FUN(); myPoints->Reset(); myPoints->Modified(); // the VTK bug @@ -215,7 +205,6 @@ VTKViewer_Triangulator std::vector< std::vector >& theDimension2VTK2ObjIds, bool theIsCheckConvex) { - DBG_FUN(); vtkPoints *aPoints = InitPoints(theInput, theCellId); vtkIdType aNumPts = GetNbOfPoints(); if(DEBUG_TRIA_EXECUTE) cout<<"Triangulator - aNumPts = "<Allocate(VTK_CELL_SIZE); myTriangulator->PreSortedOff(); } @@ -622,7 +609,6 @@ VTKViewer_OrderedTriangulator VTKViewer_OrderedTriangulator ::~VTKViewer_OrderedTriangulator() { - DBG_FUN(); myTriangle->Delete(); myBoundaryTris->Delete(); myTriangulator->Delete(); @@ -635,7 +621,6 @@ VTKViewer_OrderedTriangulator ::InitPoints(vtkUnstructuredGrid *theInput, vtkIdType theCellId) { - DBG_FUN(); myBoundaryTris->Reset(); vtkPoints* aPoints = VTKViewer_Triangulator::InitPoints(theInput, theCellId); @@ -703,7 +688,6 @@ VTKViewer_OrderedTriangulator } -#define MBCLASSNAME "VTKViewer_DelaunayTriangulator" //---------------------------------------------------------------------------- VTKViewer_DelaunayTriangulator ::VTKViewer_DelaunayTriangulator(): @@ -712,7 +696,6 @@ VTKViewer_DelaunayTriangulator myDelaunay3D(vtkDelaunay3D::New()), myPolyData(NULL) { - DBG_FUN(); myUnstructuredGrid->Initialize(); myUnstructuredGrid->Allocate(); myUnstructuredGrid->SetPoints(myPoints); @@ -727,7 +710,6 @@ VTKViewer_DelaunayTriangulator VTKViewer_DelaunayTriangulator ::~VTKViewer_DelaunayTriangulator() { - DBG_FUN(); myUnstructuredGrid->Delete(); myGeometryFilter->Delete(); myDelaunay3D->Delete(); @@ -740,7 +722,6 @@ VTKViewer_DelaunayTriangulator ::InitPoints(vtkUnstructuredGrid *theInput, vtkIdType theCellId) { - DBG_FUN(); vtkPoints* aPoints = VTKViewer_Triangulator::InitPoints(theInput, theCellId); myPoints->Modified(); diff --git a/src/VTKViewer/VTKViewer_DataSetMapper.cxx b/src/VTKViewer/VTKViewer_DataSetMapper.cxx index dbf6f6e1e..4ffd3c270 100644 --- a/src/VTKViewer/VTKViewer_DataSetMapper.cxx +++ b/src/VTKViewer/VTKViewer_DataSetMapper.cxx @@ -23,18 +23,11 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_DataSetMapper" -#include "MBDebug.h" -//--------------------------------------------------------- - vtkStandardNewMacro(VTKViewer_DataSetMapper) //---------------------------------------------------------------------------- VTKViewer_DataSetMapper::VTKViewer_DataSetMapper() { - DBG_FUN(); this->MarkerEnabled = false; this->BallEnabled = false; this->BallScale = 1; @@ -46,13 +39,11 @@ VTKViewer_DataSetMapper::VTKViewer_DataSetMapper() //---------------------------------------------------------------------------- VTKViewer_DataSetMapper::~VTKViewer_DataSetMapper() { - DBG_FUN(); } //---------------------------------------------------------------------------- void VTKViewer_DataSetMapper::Render(vtkRenderer *ren, vtkActor *act) { - DBG_FUN(); // just to create VTKViewer_PolyDataMapper instead of vtkPolyDataMapper if( this->PolyDataMapper == NULL ) { @@ -77,7 +68,6 @@ void VTKViewer_DataSetMapper::Render(vtkRenderer *ren, vtkActor *act) //----------------------------------------------------------------------------- void VTKViewer_DataSetMapper::SetMarkerEnabled( bool theMarkerEnabled ) { - DBG_FUN(); this->MarkerEnabled = theMarkerEnabled; if( this->PolyDataMapper ) if( VTKViewer_PolyDataMapper* aMapper = dynamic_cast( this->PolyDataMapper ) ) @@ -88,7 +78,6 @@ void VTKViewer_DataSetMapper::SetMarkerEnabled( bool theMarkerEnabled ) //----------------------------------------------------------------------------- void VTKViewer_DataSetMapper::SetBallEnabled( bool theBallEnabled ) { - DBG_FUN(); this->BallEnabled = theBallEnabled; if( this->PolyDataMapper ) if( VTKViewer_PolyDataMapper* aMapper = dynamic_cast( this->PolyDataMapper ) ) @@ -98,7 +87,6 @@ void VTKViewer_DataSetMapper::SetBallEnabled( bool theBallEnabled ) //----------------------------------------------------------------------------- void VTKViewer_DataSetMapper::SetBallScale( double theBallScale ) { - DBG_FUN(); this->BallScale = theBallScale; if( this->PolyDataMapper ) if( VTKViewer_PolyDataMapper* aMapper = dynamic_cast( this->PolyDataMapper ) ) @@ -108,7 +96,6 @@ void VTKViewer_DataSetMapper::SetBallScale( double theBallScale ) //---------------------------------------------------------------------------- void VTKViewer_DataSetMapper::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale ) { - DBG_FUN(); this->MarkerType = theMarkerType; this->MarkerScale = theMarkerScale; if( this->PolyDataMapper ) @@ -119,7 +106,6 @@ void VTKViewer_DataSetMapper::SetMarkerStd( VTK::MarkerType theMarkerType, VTK:: //---------------------------------------------------------------------------- void VTKViewer_DataSetMapper::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture ) { - DBG_FUN(); this->MarkerType = VTK::MT_USER; this->MarkerId = theMarkerId; this->MarkerTexture = theMarkerTexture; diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx index 23c0dbd26..0cc0d1883 100644 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx @@ -39,12 +39,6 @@ #include "utilities.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_ExtractUnstructuredGrid" -#include "MBDebug.h" -//--------------------------------------------------------- - #if defined __GNUC__ #if __GNUC__ == 2 #define __GNUC_2__ @@ -58,20 +52,14 @@ vtkStandardNewMacro(VTKViewer_ExtractUnstructuredGrid) VTKViewer_ExtractUnstructuredGrid::VTKViewer_ExtractUnstructuredGrid(): myExtractionMode(eCells), myChangeMode(ePassAll), myStoreMapping( false ), myPassAll( false ) -{ - DBG_FUN(); -} +{} VTKViewer_ExtractUnstructuredGrid::~VTKViewer_ExtractUnstructuredGrid() -{ - DBG_FUN(); -} +{} void VTKViewer_ExtractUnstructuredGrid::RegisterCell(vtkIdType theCellId) { - DBG_FUN(); - ARG2(theCellId, long); if ( myCellIds.insert(theCellId).second ) Modified(); } @@ -79,8 +67,6 @@ void VTKViewer_ExtractUnstructuredGrid::RegisterCell(vtkIdType theCellId) void VTKViewer_ExtractUnstructuredGrid::RegisterCellsWithType(vtkIdType theCellType) { - DBG_FUN(); - ARG2(theCellType, long); if ( myCellTypes.insert(theCellType).second ) Modified(); } @@ -88,8 +74,6 @@ void VTKViewer_ExtractUnstructuredGrid::RegisterCellsWithType(vtkIdType theCellT void VTKViewer_ExtractUnstructuredGrid::SetStoreMapping(int theStoreMapping) { - DBG_FUN(); - ARG(theStoreMapping); if ( myStoreMapping != ( theStoreMapping != 0 )) { myStoreMapping = theStoreMapping != 0; @@ -109,7 +93,6 @@ vtkIdType VTKViewer_ExtractUnstructuredGrid::GetInputId(vtkIdType theOutId) cons void VTKViewer_ExtractUnstructuredGrid::BuildOut2InMap() { - DBG_FUN(); if ( myPassAll || !myOut2InId.empty() ) return; vtkUnstructuredGrid *anInput = dynamic_cast< vtkUnstructuredGrid*>( this->GetInput() ); @@ -310,7 +293,6 @@ inline vtkIdType InsertCell(vtkUnstructuredGrid *theInput, VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId/*, VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId*/) { - //DBG_FUNC(); vtkCell *aCell = theInput->GetCell(theCellId); vtkIdType aCellType = aCell->GetCellType(); vtkIdType aCellId = -1; @@ -368,7 +350,6 @@ inline void InsertPointCell(vtkCellArray *theConnectivity, VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId/*, VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId*/) { - //DBG_FUNC(); theIdList->SetId(0,theCellId); theConnectivity->InsertNextCell(theIdList); theCellTypesArray->InsertNextValue(VTK_VERTEX); @@ -383,7 +364,6 @@ int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(re vtkInformationVector **inputVector, vtkInformationVector *outputVector) { - DBG_FUN(); // get the info objects vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); vtkInformation *outInfo = outputVector->GetInformationObject(0); diff --git a/src/VTKViewer/VTKViewer_Filter.cxx b/src/VTKViewer/VTKViewer_Filter.cxx index 6e5d019bb..2acbfdab5 100644 --- a/src/VTKViewer/VTKViewer_Filter.cxx +++ b/src/VTKViewer/VTKViewer_Filter.cxx @@ -26,12 +26,6 @@ #include "VTKViewer_Filter.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_Filter" -#include "MBDebug.h" -//--------------------------------------------------------- - IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, Standard_Transient) /*! @@ -43,14 +37,12 @@ IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, Standard_Transient) /*!Constructor.*/ VTKViewer_Filter::VTKViewer_Filter() { - DBG_FUN(); myActor = 0; } /*!Virtual Destructor.*/ VTKViewer_Filter::~VTKViewer_Filter() { - DBG_FUN(); } /*!Check correctness of \a theCellId for actor \a theActor by @@ -70,7 +62,5 @@ bool VTKViewer_Filter::IsValid( VTKViewer_Actor* theActor, const vtkIdType theCe */ void VTKViewer_Filter::SetActor( VTKViewer_Actor* theActor ) { - DBG_FUN(); - ARG2(theActor, void*); myActor = theActor; } diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index 385420787..b038c3206 100644 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -59,12 +59,6 @@ #include "utilities.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_GeometryFilter" -#include "MBDebug.h" -//--------------------------------------------------------- - #if defined __GNUC__ #if __GNUC__ == 2 #define __GNUC_2__ @@ -111,7 +105,6 @@ VTKViewer_GeometryFilter myMaxArcAngle(2), myIsBuildArc(false) { - DBG_FUN(); static int forceDelegateToVtk = -1; if ( forceDelegateToVtk < 0 ) { @@ -124,9 +117,7 @@ VTKViewer_GeometryFilter VTKViewer_GeometryFilter ::~VTKViewer_GeometryFilter() -{ - DBG_FUN(); -} +{} /*! * \brief Return true for only one volume including a given edge @@ -179,7 +170,6 @@ struct vtkExcludedFaces // computed in vtkGeometryFilter::UnstructuredGridExecute) and original cell ids (mesh cells) void VTKViewer_GeometryFilter ::FillVTK2ObjIds(vtkPolyData *output) { - DBG_FUN(); vtkDataArray* vtkOriginalCellIds = output->GetCellData()->GetArray("vtkOriginalCellIds"); @@ -202,7 +192,6 @@ VTKViewer_GeometryFilter vtkInformationVector **inputVector, vtkInformationVector *outputVector) { - DBG_FUN(); // get the info objects vtkInformation *inInfo = inputVector[0]->GetInformationObject(0); @@ -320,9 +309,8 @@ int VTKViewer_GeometryFilter ::UnstructuredGridExecute(vtkDataSet *dataSetInput, vtkPolyData *output, - vtkInformation * /*outInfo*/) + vtkInformation */*outInfo*/) { - DBG_FUN(); vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput; vtkCellArray *Connectivity = input->GetCells(); // Check input @@ -1373,7 +1361,6 @@ VTKViewer_GeometryFilter TVectorId& /*theVTK2ObjIds*/, TMapOfVectorId& theDimension2VTK2ObjIds ) { - //DBG_FUNC(); //theVTK2ObjIds.push_back( theCellId ); int aDimension = 0; @@ -1404,8 +1391,6 @@ void VTKViewer_GeometryFilter ::SetInside(int theShowInside) { - DBG_FUN(); - ARG(theShowInside); if(myShowInside == theShowInside) return; @@ -1425,8 +1410,6 @@ void VTKViewer_GeometryFilter ::SetWireframeMode(int theIsWireframeMode) { - DBG_FUN(); - ARG(theIsWireframeMode); if(myIsWireframeMode == theIsWireframeMode) return; @@ -1446,8 +1429,6 @@ void VTKViewer_GeometryFilter ::SetStoreMapping(int theStoreMapping) { - DBG_FUN(); - ARG(theStoreMapping); if(myStoreMapping == theStoreMapping) return; @@ -1477,7 +1458,6 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId, TMapOfVectorId& theDimension2VTK2ObjIds, bool triangulate) { - DBG_FUN(); vtkIdType aCellType = VTK_POLYGON; vtkIdType *aNewPoints = NULL; vtkIdType aNbPoints = 0; @@ -1660,8 +1640,6 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId, void VTKViewer_GeometryFilter::SetQuadraticArcMode(bool theFlag) { - DBG_FUN(); - ARG(theFlag); if(myIsBuildArc != theFlag) { myIsBuildArc = theFlag; this->Modified(); @@ -1674,8 +1652,6 @@ bool VTKViewer_GeometryFilter::GetQuadraticArcMode() const void VTKViewer_GeometryFilter::SetQuadraticArcAngle(double theMaxAngle) { - DBG_FUN(); - ARG(theMaxAngle); if(myMaxArcAngle != theMaxAngle) { myMaxArcAngle = theMaxAngle; this->Modified(); @@ -1698,8 +1674,6 @@ int VTKViewer_GeometryFilter::GetAppendCoincident3D() const { } void VTKViewer_GeometryFilter::SetAppendCoincident3D(int theFlag) { - DBG_FUN(); - ARG(theFlag); if(myAppendCoincident3D != theFlag){ myAppendCoincident3D = theFlag; this->Modified(); diff --git a/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx b/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx index e715f96d5..1d4091556 100644 --- a/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx +++ b/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx @@ -47,17 +47,10 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_OpenGLRenderer" -#include "MBDebug.h" -//--------------------------------------------------------- - vtkStandardNewMacro(VTKViewer_OpenGLRenderer) VTKViewer_OpenGLRenderer::VTKViewer_OpenGLRenderer() { - DBG_FUN(); this->GradientType = HorizontalGradient; #ifdef VTK_OPENGL2 @@ -72,12 +65,10 @@ VTKViewer_OpenGLRenderer::VTKViewer_OpenGLRenderer() VTKViewer_OpenGLRenderer::~VTKViewer_OpenGLRenderer() { - DBG_FUN(); } void VTKViewer_OpenGLRenderer::SetGradientType( const int theGradientType ) { - DBG_FUN(); this->GradientType = theGradientType; } @@ -170,8 +161,6 @@ void VTKViewer_OpenGLRenderer::GetCornersColor(Vec2D& cornersColor) void VTKViewer_OpenGLRenderer::Clear(void) { - MSGEL("...VTKViewer_OpenGLRenderer::Clear()"); - vtkOpenGLRenderer::Clear(); #ifdef VTK_OPENGL2 if (this->OpenGLHelper.IsInitialized()) diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx index 487931d8a..c0a4fe207 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx @@ -46,12 +46,6 @@ #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_PolyDataMapper" -#include "MBDebug.h" -//--------------------------------------------------------- - #ifndef WIN32 # ifndef GLX_GLXEXT_LEGACY # define GLX_GLXEXT_LEGACY @@ -126,7 +120,6 @@ void MessageCallback( GLenum /*source*/, //----------------------------------------------------------------------------- VTKViewer_PolyDataMapper::VTKViewer_PolyDataMapper() { - DBG_FUN(); Q_INIT_RESOURCE( VTKViewer ); this->ExtensionsInitialized = ES_None; @@ -156,7 +149,6 @@ VTKViewer_PolyDataMapper::VTKViewer_PolyDataMapper() //----------------------------------------------------------------------------- VTKViewer_PolyDataMapper::~VTKViewer_PolyDataMapper() { - DBG_FUN(); if( PointSpriteTexture > 0 ) glDeleteTextures( 1, &PointSpriteTexture ); @@ -168,7 +160,6 @@ VTKViewer_PolyDataMapper::~VTKViewer_PolyDataMapper() //----------------------------------------------------------------------------- int VTKViewer_PolyDataMapper::InitShader() { - DBG_FUN(); #ifdef VTK_OPENGL2 #if defined(WIN32) && defined(UNICODE) std::wstring wFilePath = std::wstring(_wgetenv(L"GUI_ROOT_DIR")) + L"/share/salome/resources/gui/Point"; @@ -221,8 +212,6 @@ int VTKViewer_PolyDataMapper::InitShader() //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::SetMarkerEnabled( bool theMarkerEnabled ) { - DBG_FUN(); - ARG(theMarkerEnabled); if( this->MarkerEnabled == theMarkerEnabled ) return; @@ -236,10 +225,6 @@ namespace VTK { //---------------------------------------------------------------------------- vtkSmartPointer MakeTexture( const char* theMainTexture, const char* theAlphaTexture ) { - DBG_FUNC(); - ARG(theMainTexture); - ARG(theAlphaTexture); - if( !theMainTexture || !theAlphaTexture ) return 0; @@ -300,7 +285,6 @@ bool VTKViewer_PolyDataMapper::GetBallEnabled() //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::SetBallEnabled( bool theBallEnabled ) { - DBG_FUN(); if( this->BallEnabled == theBallEnabled ) return; else @@ -333,8 +317,6 @@ double VTKViewer_PolyDataMapper::GetBallScale() //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::SetBallScale( double theBallScale ) { - DBG_FUN(); - ARG(theBallScale); if( this->BallScale == theBallScale ) return; this->BallScale = theBallScale; @@ -343,7 +325,6 @@ void VTKViewer_PolyDataMapper::SetBallScale( double theBallScale ) //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale ) { - DBG_FUN(); if( this->MarkerType == theMarkerType && this->MarkerScale == theMarkerScale ) return; @@ -376,7 +357,6 @@ void VTKViewer_PolyDataMapper::SetMarkerStd( VTK::MarkerType theMarkerType, VTK: //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture ) { - DBG_FUN(); if( this->MarkerType == VTK::MT_USER && this->MarkerId == theMarkerId ) return; @@ -411,7 +391,6 @@ int VTKViewer_PolyDataMapper::GetMarkerTexture() //----------------------------------------------------------------------------- int VTKViewer_PolyDataMapper::InitExtensions() { - DBG_FUN(); #ifdef VTK_OPENGL2 int n = 0; std::ostringstream strm; @@ -441,7 +420,6 @@ int VTKViewer_PolyDataMapper::InitExtensions() //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::InitPointSprites() { - DBG_FUN(); glEnable( GL_POINT_SPRITE_ARB ); glEnable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB ); @@ -466,7 +444,6 @@ void VTKViewer_PolyDataMapper::InitPointSprites() //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::CleanupPointSprites() { - DBG_FUN(); glPopAttrib(); glDisable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB ); @@ -476,7 +453,6 @@ void VTKViewer_PolyDataMapper::CleanupPointSprites() //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::InitTextures() { - DBG_FUN(); if( !this->ImageData.GetPointer() ) return; @@ -514,7 +490,6 @@ void VTKViewer_PolyDataMapper::InitTextures() //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::RenderPiece( vtkRenderer* ren, vtkActor* act ) { - DBG_FUN(); bool isUsePointSprites = (this->MarkerEnabled && this->MarkerType != VTK::MT_NONE) || this->BallEnabled; if( isUsePointSprites ) @@ -843,7 +818,6 @@ namespace VTK //----------------------------------------------------------------------------- int VTKViewer_PolyDataMapper::Draw( vtkRenderer* ren, vtkActor* act ) { - DBG_FUN(); int noAbort = 1; if( (!this->MarkerEnabled || this->MarkerType == VTK::MT_NONE || !this->ImageData.GetPointer()) && !this->BallEnabled) return MAPPER_SUPERCLASS::Draw( ren, act ); @@ -870,7 +844,6 @@ void VTKViewer_PolyDataMapper::RenderPieceDraw( vtkRenderer* ren, vtkActor* act #endif void VTKViewer_PolyDataMapper::InternalDraw(vtkRenderer* ren, vtkActor* act ) { - DBG_FUN(); vtkUnsignedCharArray* colors = NULL; vtkPolyData* input = this->GetInput(); vtkPoints* points; diff --git a/src/VTKViewer/VTKViewer_RenderWindow.cxx b/src/VTKViewer/VTKViewer_RenderWindow.cxx index b1af3d1b2..61499c944 100644 --- a/src/VTKViewer/VTKViewer_RenderWindow.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindow.cxx @@ -36,12 +36,6 @@ #include #endif -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_RenderWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!Constructor. Create render window with parant \a parent and name \a name. *\param parent - parent window *\param name - render window name. @@ -49,7 +43,6 @@ VTKViewer_RenderWindow::VTKViewer_RenderWindow(QWidget* parent, const char* name) : QWidget(parent, Qt::FramelessWindowHint ) { - DBG_FUN(); setObjectName( name ); setAttribute( Qt::WA_DeleteOnClose ); @@ -65,7 +58,6 @@ QWidget(parent, Qt::FramelessWindowHint ) /*!Destructor.*/ VTKViewer_RenderWindow::~VTKViewer_RenderWindow() { - DBG_FUN(); myRW->Delete(); } @@ -78,9 +70,7 @@ void VTKViewer_RenderWindow::paintEvent(QPaintEvent* /*theEvent*/) /*!Resize render window.*/ void VTKViewer_RenderWindow::resizeEvent(QResizeEvent* /*theEvent*/) { - DBG_FUN(); int aWidth = myRW->GetSize()[0], aHeight = myRW->GetSize()[1]; - MSGEL("size = " << aWidth << " x " << aHeight); if(vtkRenderWindowInteractor* aRWI = myRW->GetInteractor()) aRWI->UpdateSize(width(), height()); if(aWidth != width() || aHeight != height()){ @@ -150,7 +140,6 @@ void VTKViewer_RenderWindow::wheelEvent(QWheelEvent* event) /*!Reaction on change background color.*/ void VTKViewer_RenderWindow::onChangeBackgroundColor() { - DBG_FUN(); //float red, green, blue; double backint[3]; @@ -173,7 +162,6 @@ void VTKViewer_RenderWindow::onChangeBackgroundColor() /*!Emit content menu requested.*/ void VTKViewer_RenderWindow::contextMenuEvent ( QContextMenuEvent * e ) { - DBG_FUN(); if ( e->reason() != QContextMenuEvent::Mouse ) emit contextMenuRequested( e ); } diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx index 3f4218e80..6629447e1 100644 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx @@ -54,16 +54,9 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_RenderWindowInteractor" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Create new instance of VTKViewer_RenderWindowInteractor*/ VTKViewer_RenderWindowInteractor* VTKViewer_RenderWindowInteractor::New() { - DBG_FUNC(); vtkObject *ret = vtkObjectFactory::CreateInstance("VTKViewer_RenderWindowInteractor") ; if( ret ) { return dynamic_cast(ret) ; @@ -74,7 +67,6 @@ VTKViewer_RenderWindowInteractor* VTKViewer_RenderWindowInteractor::New() /*!Constructor.*/ VTKViewer_RenderWindowInteractor::VTKViewer_RenderWindowInteractor() { - DBG_FUN(); this->Enabled = 0 ; this->mTimer = new QTimer( this ) ; myDisplayMode = 0; @@ -107,7 +99,6 @@ VTKViewer_RenderWindowInteractor::VTKViewer_RenderWindowInteractor() /*!Destructor.*/ VTKViewer_RenderWindowInteractor::~VTKViewer_RenderWindowInteractor() { - DBG_FUN(); delete mTimer ; if ( GetRenderWindow() ) { @@ -150,7 +141,6 @@ void VTKViewer_RenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent) */ void VTKViewer_RenderWindowInteractor::Initialize() { - DBG_FUN(); // // We cannot do much unless there is a render window // associated with this interactor. @@ -204,7 +194,6 @@ void VTKViewer_RenderWindowInteractor::Initialize() /*!Sets view window and add to it selection actors.*/ void VTKViewer_RenderWindowInteractor::setViewWindow(VTKViewer_ViewWindow* theViewWnd){ - DBG_FUN(); myViewWnd = theViewWnd; if ( myViewWnd ) { @@ -217,7 +206,6 @@ void VTKViewer_RenderWindowInteractor::setViewWindow(VTKViewer_ViewWindow* theVi /*!Move selection actors to view window.*/ void VTKViewer_RenderWindowInteractor::MoveInternalActors() { - DBG_FUN(); myViewWnd->MoveActor(myCellActor); myViewWnd->MoveActor(myEdgeActor); myViewWnd->MoveActor(myPointActor); @@ -225,7 +213,6 @@ void VTKViewer_RenderWindowInteractor::MoveInternalActors() /*!Sets interactor style.*/ void VTKViewer_RenderWindowInteractor::SetInteractorStyle(vtkInteractorObserver *theInteractor){ - DBG_FUN(); myInteractorStyle = dynamic_cast(theInteractor); vtkRenderWindowInteractor::SetInteractorStyle(theInteractor); } @@ -239,7 +226,6 @@ void VTKViewer_RenderWindowInteractor::SetInteractorStyle(vtkInteractorObserver void VTKViewer_RenderWindowInteractor::SetSelectionProp(const double& theRed, const double& theGreen, const double& theBlue, const int& theWidth) { - DBG_FUN(); myCellActor->GetProperty()->SetColor(theRed, theGreen, theBlue); myCellActor->GetProperty()->SetLineWidth(theWidth); @@ -253,7 +239,6 @@ void VTKViewer_RenderWindowInteractor::SetSelectionProp(const double& theRed, co */ void VTKViewer_RenderWindowInteractor::SetSelectionTolerance(const double& theTolNodes, const double& theTolItems) { - DBG_FUN(); myTolNodes = theTolNodes; myTolItems = theTolItems; @@ -274,7 +259,6 @@ void VTKViewer_RenderWindowInteractor::SetSelectionTolerance(const double& theTo */ void VTKViewer_RenderWindowInteractor::Enable() { - DBG_FUN(); // // Do not need to do anything if already enabled. // @@ -289,7 +273,6 @@ void VTKViewer_RenderWindowInteractor::Enable() /*!See Enable().*/ void VTKViewer_RenderWindowInteractor::Disable() { - DBG_FUN(); if( ! this->Enabled ) { return ; } @@ -305,7 +288,6 @@ void VTKViewer_RenderWindowInteractor::Disable() */ void VTKViewer_RenderWindowInteractor::Start() { - DBG_FUN(); // // We do not allow this interactor to control the // event loop. Only the QtApplication objects are @@ -410,7 +392,6 @@ void VTKViewer_RenderWindowInteractor::LeftButtonPressed(const QMouseEvent *even *If render window enabled. */ void VTKViewer_RenderWindowInteractor::LeftButtonReleased(const QMouseEvent *event) { - DBG_FUN(); if( ! this->Enabled ) { return ; } @@ -437,7 +418,6 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonPressed(const QMouseEvent *ev *If render window enabled. */ void VTKViewer_RenderWindowInteractor::MiddleButtonReleased(const QMouseEvent *event) { - DBG_FUN(); if( ! this->Enabled ) { return ; } @@ -464,7 +444,6 @@ void VTKViewer_RenderWindowInteractor::RightButtonPressed(const QMouseEvent *eve *Emit context menu requested, if interactor style state equal VTK_INTERACTOR_STYLE_CAMERA_NONE. */ void VTKViewer_RenderWindowInteractor::RightButtonReleased(const QMouseEvent *event) { - DBG_FUN(); if( ! this->Enabled ) { return ; } @@ -501,7 +480,6 @@ int VTKViewer_RenderWindowInteractor::GetDisplayMode() { /*!Sets display mode.*/ void VTKViewer_RenderWindowInteractor::SetDisplayMode(int theMode) { - DBG_FUN(); if(theMode == 0) ChangeRepresentationToWireframe(); else if (theMode == 1) @@ -516,7 +494,6 @@ void VTKViewer_RenderWindowInteractor::SetDisplayMode(int theMode) { /*!Change all actors to wireframe*/ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe() { - DBG_FUN(); using namespace VTK; ActorCollectionCopy aCopy(GetRenderer()->GetActors()); ChangeRepresentationToWireframe(aCopy.GetActors()); @@ -525,7 +502,6 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe() /*!Change all actors to surface*/ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface() { - DBG_FUN(); using namespace VTK; ActorCollectionCopy aCopy(GetRenderer()->GetActors()); ChangeRepresentationToSurface(aCopy.GetActors()); @@ -534,7 +510,6 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface() /*!Change all actors to surface with edges*/ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges() { - DBG_FUN(); using namespace VTK; ActorCollectionCopy aCopy(GetRenderer()->GetActors()); ChangeRepresentationToSurfaceWithEdges(aCopy.GetActors()); @@ -545,7 +520,6 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges() */ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe(vtkActorCollection* theCollection) { - DBG_FUN(); using namespace VTK; ForEach(theCollection, TSetFunction @@ -558,7 +532,6 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe(vtkActorC */ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface(vtkActorCollection* theCollection) { - DBG_FUN(); using namespace VTK; ForEach(theCollection, TSetFunction @@ -571,7 +544,6 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface(vtkActorCol */ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* theCollection) { - DBG_FUN(); using namespace VTK; ForEach(theCollection, TSetFunction @@ -590,7 +562,6 @@ vtkRenderer* VTKViewer_RenderWindowInteractor::GetRenderer() /*!Do nothing*/ void VTKViewer_RenderWindowInteractor::EraseAll() { - DBG_FUN(); } /*!Display all actors. @@ -598,7 +569,6 @@ void VTKViewer_RenderWindowInteractor::EraseAll() */ void VTKViewer_RenderWindowInteractor::DisplayAll() { - DBG_FUN(); using namespace VTK; ActorCollectionCopy aCopy(GetRenderer()->GetActors()); ForEach(aCopy.GetActors(),TSetVisibility(true)); @@ -609,13 +579,11 @@ void VTKViewer_RenderWindowInteractor::DisplayAll() /*!Do nothing*/ void VTKViewer_RenderWindowInteractor::Erase( VTKViewer_Actor* /*SActor*/, bool /*update*/) { - DBG_FUN(); } /*!Remove \a SActor from renderer and emit update window, if \a updateViewer - true*/ void VTKViewer_RenderWindowInteractor::Remove( VTKViewer_Actor* SActor, bool updateViewer ) { - DBG_FUN(); if ( SActor != 0 ) { GetRenderer()->RemoveViewProp( SActor ); @@ -629,7 +597,6 @@ void VTKViewer_RenderWindowInteractor::Remove( VTKViewer_Actor* SActor, bool upd */ void VTKViewer_RenderWindowInteractor::RemoveAll( const bool updateViewer ) { - DBG_FUN(); using namespace VTK; vtkRenderer* aRenderer = GetRenderer(); ActorCollectionCopy aCopy(aRenderer->GetActors()); @@ -655,7 +622,6 @@ void VTKViewer_RenderWindowInteractor::RemoveAll( const bool updateViewer ) */ void VTKViewer_RenderWindowInteractor::Display( VTKViewer_Actor* theActor, bool update) { - DBG_FUN(); GetRenderer()->AddActor(theActor); theActor->SetVisibility(true); @@ -681,7 +647,6 @@ struct TUpdateAction{ /*!Update all actors from renderer and emit render window modified.*/ void VTKViewer_RenderWindowInteractor::Update() { - DBG_FUN(); using namespace VTK; vtkRenderer* aRen = GetRenderer(); ActorCollectionCopy aCopy(aRen->GetActors()); @@ -742,7 +707,6 @@ void VTKViewer_RenderWindowInteractor::setActorData(const TIndexedMapOfVtkId& th VTKViewer_Actor * theActor, TUpdateActor theFun) { - DBG_FUN(); (*theFun)(theMapIndex,theMapActor,theActor); double aPos[3]; theMapActor->GetPosition(aPos); diff --git a/src/VTKViewer/VTKViewer_Utilities.cxx b/src/VTKViewer/VTKViewer_Utilities.cxx index 29879ba1c..8fc6451db 100644 --- a/src/VTKViewer/VTKViewer_Utilities.cxx +++ b/src/VTKViewer/VTKViewer_Utilities.cxx @@ -32,18 +32,11 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_Utilities" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!@see vtkRenderer::ResetCamera(double bounds[6]) method*/ void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) -{ - DBG_FUNC(); +{ if(!theRenderer) return; @@ -116,7 +109,6 @@ int ComputeVisiblePropBounds(vtkRenderer* theRenderer, double theBounds[6]) { - DBG_FUNC(); VTK::ActorCollectionCopy aCopy(theRenderer->GetActors()); vtkActorCollection* aCollection = aCopy.GetActors(); return ComputeBounds( aCollection, theBounds ); @@ -126,7 +118,6 @@ ComputeVisiblePropBounds(vtkRenderer* theRenderer, int ComputeBounds(vtkActorCollection* theCollection, double theBounds[6]) { - DBG_FUNC(); int aCount = 0; theBounds[0] = theBounds[2] = theBounds[4] = VTK_FLOAT_MAX; @@ -185,7 +176,6 @@ ComputeBounds(vtkActorCollection* theCollection, double theBounds[6]) void ResetCameraClippingRange(vtkRenderer* theRenderer) { - DBG_FUNC(); if(!theRenderer || !theRenderer->VisibleActorCount()) return; vtkCamera* anActiveCamera = theRenderer->GetActiveCamera(); @@ -231,7 +221,6 @@ ComputeTrihedronSize( vtkRenderer* theRenderer, const double theSize, const double theSizeInPercents ) { - DBG_FUNC(); // calculating diagonal of visible props of the renderer double bnd[ 6 ]; if ( ComputeVisiblePropBounds( theRenderer, bnd ) == 0 ) @@ -255,7 +244,6 @@ ComputeTrihedronSize( vtkRenderer* theRenderer, bool IsBBEmpty(vtkRenderer* theRenderer) { - DBG_FUNC(); if(!theRenderer) return false; @@ -298,8 +286,6 @@ bool isBoundValid(double* theBounds) { bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3]) { - //DBG_FUNC(); - MSGEL("...ComputeBBCenter()"); theCenter[0] = theCenter[1] = theCenter[2] = 0.0; if(!theRenderer) diff --git a/src/VTKViewer/VTKViewer_ViewManager.cxx b/src/VTKViewer/VTKViewer_ViewManager.cxx index 33e488943..60a44b36b 100644 --- a/src/VTKViewer/VTKViewer_ViewManager.cxx +++ b/src/VTKViewer/VTKViewer_ViewManager.cxx @@ -23,25 +23,17 @@ #include "VTKViewer_ViewManager.h" #include "VTKViewer_ViewModel.h" -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_ViewManager" -#include "MBDebug.h" -//--------------------------------------------------------- - /*!Constructor.Initialize SIUT_ViewManager by \a study and \a theDesktop. * Create new instance of VTKViewer_Viewer and set view model by it. */ VTKViewer_ViewManager::VTKViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop ) : SUIT_ViewManager( study, theDesktop, new VTKViewer_Viewer() ) { - DBG_FUN(); setTitle( tr( "VTK_VIEW_TITLE" ) ); } /*!Destructor.*/ VTKViewer_ViewManager::~VTKViewer_ViewManager() { - DBG_FUN(); /*!Do nothing.*/ } diff --git a/src/VTKViewer/VTKViewer_ViewModel.cxx b/src/VTKViewer/VTKViewer_ViewModel.cxx index 1c1569ae8..027dd0da6 100644 --- a/src/VTKViewer/VTKViewer_ViewModel.cxx +++ b/src/VTKViewer/VTKViewer_ViewModel.cxx @@ -35,18 +35,11 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_Viewer" -#include "MBDebug.h" -//--------------------------------------------------------- - // VSR: Uncomment below line to allow texture background support in VTK viewer #define VTK_ENABLE_TEXTURED_BACKGROUND bool _InitializeVtkWarningsCall() { - DBG_FUNC(); char* isOn = getenv( "VTK_WARNINGS_IS_ON" ); if ( !isOn || strcmp( isOn, "1" ) ) vtkObject::GlobalWarningDisplayOff(); @@ -61,19 +54,16 @@ VTKViewer_Viewer::VTKViewer_Viewer() : SUIT_ViewModel(), myDefaultBackground( Qtx::BackgroundData( Qt::black ) ) { - DBG_FUN(); } /*!Destructor.*/ VTKViewer_Viewer::~VTKViewer_Viewer() { - DBG_FUN(); } /*! Get data for supported background modes: gradient types, identifiers and supported image formats */ QString VTKViewer_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QIntList& txtList ) { - DBG_FUNC(); gradList << tr( "GT_HORIZONTALGRADIENT" ) << tr( "GT_VERTICALGRADIENT" ) << tr( "GT_FIRSTDIAGONALGRADIENT" ) @@ -105,7 +95,6 @@ QColor VTKViewer_Viewer::backgroundColor() const /*!Sets background color [obsolete]*/ void VTKViewer_Viewer::setBackgroundColor( const QColor& c ) { - DBG_FUN(); Qtx::BackgroundData bg = background(); bg.setColor( c ); setBackground( bg ); @@ -120,14 +109,12 @@ Qtx::BackgroundData VTKViewer_Viewer::background() const /*!Sets default background data.*/ void VTKViewer_Viewer::setBackground( const Qtx::BackgroundData& theBackground ) { - DBG_FUN(); myDefaultBackground = theBackground.isValid() ? theBackground : Qtx::BackgroundData( Qt::black ); } /*!Create new instance of VTKViewer_ViewWindow, sets background color and return pointer to it.*/ SUIT_ViewWindow* VTKViewer_Viewer::createView( SUIT_Desktop* theDesktop ) { - DBG_FUN(); VTKViewer_ViewWindow* vw = new VTKViewer_ViewWindow( theDesktop, this ); vw->setBackground( myDefaultBackground ); return vw; @@ -136,7 +123,6 @@ SUIT_ViewWindow* VTKViewer_Viewer::createView( SUIT_Desktop* theDesktop ) /*!Sets view manager and connect slots.*/ void VTKViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager) { - DBG_FUN(); SUIT_ViewModel::setViewManager(theViewManager); connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*))); @@ -151,7 +137,6 @@ void VTKViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager) /*!Insert context into popup menu.*/ void VTKViewer_Viewer::contextMenuPopup(QMenu* thePopup) { - DBG_FUN(); thePopup->addAction( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) ); thePopup->addAction( tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) ); @@ -223,8 +208,6 @@ void VTKViewer_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event) /*!Sets flag to enable selection \a isEnable.*/ void VTKViewer_Viewer::enableSelection(bool isEnabled) { - DBG_FUN(); - ARG(isEnabled); mySelectionEnabled = isEnabled; //!! To be done for view windows } @@ -232,8 +215,6 @@ void VTKViewer_Viewer::enableSelection(bool isEnabled) /*!Sets flag to multi selection enable \a isEnable.*/ void VTKViewer_Viewer::enableMultiselection(bool isEnable) { - DBG_FUN(); - ARG(isEnable); myMultiSelectionEnabled = isEnable; //!! To be done for view windows } @@ -249,7 +230,6 @@ void VTKViewer_Viewer::onDumpView() /*!On change back ground color event.*/ void VTKViewer_Viewer::onChangeBackground() { - DBG_FUN(); VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView()); if ( !aView ) return; @@ -278,7 +258,6 @@ void VTKViewer_Viewer::onChangeBackground() /*!On show tool bar event.*/ void VTKViewer_Viewer::onShowToolbar() { - DBG_FUN(); VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView()); if ( aView ) aView->getToolBar()->show(); diff --git a/src/VTKViewer/VTKViewer_ViewWindow.cxx b/src/VTKViewer/VTKViewer_ViewWindow.cxx index 0f710a24f..0a02c85f5 100644 --- a/src/VTKViewer/VTKViewer_ViewWindow.cxx +++ b/src/VTKViewer/VTKViewer_ViewWindow.cxx @@ -51,12 +51,6 @@ #include #include -//--------------------------------------------------------- -#define USE_DEBUG -#define MBCLASSNAME "VTKViewer_ViewWindow" -#include "MBDebug.h" -//--------------------------------------------------------- - /*! Construction*/ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop, VTKViewer_Viewer* theModel, @@ -64,8 +58,6 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop, VTKViewer_RenderWindowInteractor* rw ) : SUIT_ViewWindow( theDesktop ) { - DBG_FUN(); - myModel = theModel; myTrihedron = VTKViewer_Trihedron::New(); @@ -137,7 +129,6 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop, /*!Destructor.*/ VTKViewer_ViewWindow::~VTKViewer_ViewWindow() { - DBG_FUN(); myTransform->Delete(); // In order to ensure that the interactor unregisters // this RenderWindow, we assign a NULL RenderWindow to @@ -184,14 +175,12 @@ void VTKViewer_ViewWindow::activateGlobalPanning() /*!Activates 'fit area' transformation*/ void VTKViewer_ViewWindow::activateWindowFit() { - DBG_FUN(); myRWInteractor->GetInteractorStyle()->startFitArea(); } /*!Create actions:*/ void VTKViewer_ViewWindow::createActions() { - DBG_FUN(); if (!myActionsMap.isEmpty()) return; SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); @@ -328,7 +317,6 @@ void VTKViewer_ViewWindow::createActions() /*!Create tool bar.*/ void VTKViewer_ViewWindow::createToolBar() { - DBG_FUN(); myToolBar->addAction( myActionsMap[DumpId] ); myToolBar->addAction( myActionsMap[TrihedronShowId] ); @@ -364,7 +352,6 @@ void VTKViewer_ViewWindow::createToolBar() /*!On front view event.*/ void VTKViewer_ViewWindow::onFrontView() { - DBG_FUN(); vtkCamera* camera = myRenderer->GetActiveCamera(); camera->SetPosition(1,0,0); camera->SetViewUp(0,0,1); @@ -375,7 +362,6 @@ void VTKViewer_ViewWindow::onFrontView() /*!On back view slot.*/ void VTKViewer_ViewWindow::onBackView() { - DBG_FUN(); vtkCamera* camera = myRenderer->GetActiveCamera(); camera->SetPosition(-1,0,0); camera->SetViewUp(0,0,1); @@ -386,7 +372,6 @@ void VTKViewer_ViewWindow::onBackView() /*!On back view slot.*/ void VTKViewer_ViewWindow::onTopView() { - DBG_FUN(); vtkCamera* camera = myRenderer->GetActiveCamera(); camera->SetPosition(0,0,1); camera->SetViewUp(0,1,0); @@ -397,7 +382,6 @@ void VTKViewer_ViewWindow::onTopView() /*!On bottom view slot.*/ void VTKViewer_ViewWindow::onBottomView() { - DBG_FUN(); vtkCamera* camera = myRenderer->GetActiveCamera(); camera->SetPosition(0,0,-1); camera->SetViewUp(0,1,0); @@ -408,7 +392,6 @@ void VTKViewer_ViewWindow::onBottomView() /*!On left view slot.*/ void VTKViewer_ViewWindow::onLeftView() { - DBG_FUN(); vtkCamera* camera = myRenderer->GetActiveCamera(); camera->SetPosition(0,-1,0); camera->SetViewUp(0,0,1); @@ -419,7 +402,6 @@ void VTKViewer_ViewWindow::onLeftView() /*!On right view slot.*/ void VTKViewer_ViewWindow::onRightView() { - DBG_FUN(); vtkCamera* camera = myRenderer->GetActiveCamera(); camera->SetPosition(0,1,0); camera->SetViewUp(0,0,1); @@ -432,7 +414,6 @@ void VTKViewer_ViewWindow::onRightView() */ void VTKViewer_ViewWindow::onClockWiseView() { - DBG_FUN(); vtkCamera* aCamera = myRenderer->GetActiveCamera(); aCamera->Roll(-90); aCamera->OrthogonalizeViewUp(); @@ -444,7 +425,6 @@ void VTKViewer_ViewWindow::onClockWiseView() */ void VTKViewer_ViewWindow::onAntiClockWiseView() { - DBG_FUN(); vtkCamera* aCamera = myRenderer->GetActiveCamera(); aCamera->Roll(90); aCamera->OrthogonalizeViewUp(); @@ -454,7 +434,6 @@ void VTKViewer_ViewWindow::onAntiClockWiseView() /*!On reset view slot.*/ void VTKViewer_ViewWindow::onResetView() { - DBG_FUN(); int aTriedronIsVisible = isTrihedronDisplayed(); myTrihedron->SetVisibility( VTKViewer_Trihedron::eOnlyLineOn ); ::ResetCamera(myRenderer,true); @@ -472,7 +451,6 @@ void VTKViewer_ViewWindow::onResetView() /*!On fit all slot.*/ void VTKViewer_ViewWindow::onFitAll() { - DBG_FUN(); myRWInteractor->GetInteractorStyle()->ViewFitAll(); Repaint(); } @@ -480,7 +458,6 @@ void VTKViewer_ViewWindow::onFitAll() /*!On fit selection slot.*/ void VTKViewer_ViewWindow::onFitSelection() { - DBG_FUN(); myRWInteractor->GetInteractorStyle()->ViewFitSelection(); Repaint(); } @@ -488,7 +465,6 @@ void VTKViewer_ViewWindow::onFitSelection() /*!Set background color of the viewport [obsolete]*/ void VTKViewer_ViewWindow::setBackgroundColor( const QColor& c ) { - DBG_FUN(); Qtx::BackgroundData bg = background(); bg.setColor( c ); setBackground( bg ); @@ -503,7 +479,6 @@ QColor VTKViewer_ViewWindow::backgroundColor() const /*!Set background of the viewport*/ void VTKViewer_ViewWindow::setBackground( const Qtx::BackgroundData& bgData ) { - DBG_FUN(); bool ok = false; if ( bgData.isValid() ) { @@ -746,7 +721,6 @@ void VTKViewer_ViewWindow::onMouseDoubleClicked( QMouseEvent* event ) *Move Internal actors, if \a theMoveInternalActors is true. */ void VTKViewer_ViewWindow::InsertActor( VTKViewer_Actor* theActor, bool theMoveInternalActors ){ - DBG_FUN(); theActor->AddToRender(myRenderer); theActor->SetTransform(myTransform); if(theMoveInternalActors) @@ -757,7 +731,6 @@ void VTKViewer_ViewWindow::InsertActor( VTKViewer_Actor* theActor, bool theMoveI *@see InsertActor( VTKViewer_Actor* theActor, bool theMoveInternalActors ) */ void VTKViewer_ViewWindow::AddActor( VTKViewer_Actor* theActor, bool theUpdate /*=false*/ ){ - DBG_FUN(); InsertActor(theActor); if(theUpdate) Repaint(); @@ -765,7 +738,6 @@ void VTKViewer_ViewWindow::AddActor( VTKViewer_Actor* theActor, bool theUpdate / /*!Remove \a theActor from renderer and pepaint, if \a theUpdate is true.*/ void VTKViewer_ViewWindow::RemoveActor( VTKViewer_Actor* theActor, bool theUpdate /*=false*/ ){ - DBG_FUN(); theActor->RemoveFromRender(myRenderer); if(theUpdate) Repaint(); @@ -774,7 +746,6 @@ void VTKViewer_ViewWindow::RemoveActor( VTKViewer_Actor* theActor, bool theUpdat /*!@see RemoveActor() and InsertActor().*/ void VTKViewer_ViewWindow::MoveActor( VTKViewer_Actor* theActor) { - DBG_FUN(); RemoveActor(theActor); InsertActor(theActor,true); } @@ -782,7 +753,6 @@ void VTKViewer_ViewWindow::MoveActor( VTKViewer_Actor* theActor) /*!On trihedron show slot.*/ void VTKViewer_ViewWindow::onTrihedronShow() { - DBG_FUN(); if (isTrihedronDisplayed()) myTrihedron->VisibilityOff(); else @@ -821,7 +791,6 @@ QString VTKViewer_ViewWindow::getVisualParameters() */ void VTKViewer_ViewWindow::setVisualParameters( const QString& parameters ) { - DBG_FUN(); QStringList paramsLst = parameters.split( '*' ); if ( paramsLst.size() == 13 ) { double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];