From 80440382aee9df5cdaa4cf16a9cd229ff8e3ad27 Mon Sep 17 00:00:00 2001 From: enk Date: Fri, 29 Jul 2005 07:34:45 +0000 Subject: [PATCH] Update comments --- src/CAM/CAM_Module.cxx | 97 +++++++++++++++++++++++++- src/CAM/CAM_Module.h | 3 + src/SUIT/SUIT_ActionOperation.cxx | 33 +++++++-- src/SUIT/SUIT_ActionOperation.h | 23 +++--- src/SUIT/SUIT_DataObject.cxx | 9 +++ src/SUIT/SUIT_DataObject.h | 3 + src/SUIT/SUIT_DataObjectIterator.cxx | 32 ++++++++- src/SUIT/SUIT_DataObjectIterator.h | 3 + src/SUIT/SUIT_DataObjectKey.cxx | 52 ++++++++++++-- src/SUIT/SUIT_Desktop.cxx | 28 ++++++++ src/SUIT/SUIT_ExceptionHandler.cxx | 13 ++++ src/SUIT/SUIT_PopupClient.cxx | 19 +++-- src/SUIT/SUIT_PopupClient.h | 2 +- src/SUIT/SUIT_SelectionMgr.cxx | 52 ++++++++++++++ src/SUIT/SUIT_Selector.cxx | 40 +++++++++++ src/SUIT/SUIT_Session.h | 12 ++-- src/SUIT/SUIT_Study.cxx | 67 ++++++++++++++++++ src/SUIT/SUIT_ToolButton.cxx | 18 ++--- src/SUIT/SUIT_ToolButton.h | 3 - src/SUIT/SUIT_ViewManager.cxx | 52 +++++++++----- src/SUIT/SUIT_ViewManager.h | 1 - src/SUIT/SUIT_ViewModel.cxx | 25 ++++--- src/SUIT/SUIT_ViewModel.h | 8 +-- src/SUIT/SUIT_ViewWindow.cxx | 27 +++---- src/SUIT/utilities.h | 24 +++---- src/VTKViewer/VTKViewer_ViewWindow.cxx | 80 ++++++++++++++------- 26 files changed, 597 insertions(+), 129 deletions(-) diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index a01e60285..46ac007ee 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -8,6 +8,7 @@ #include #include +/*!Icon.*/ static const char* ModuleIcon[] = { "20 20 2 1", " c None", @@ -186,7 +187,15 @@ int CAM_Module::createTool( const QString& name ) return toolMgr()->createToolBar( name ); } - +/*! Create tool. Register action \a a with id \a id. + * Insert QAction to tool manager. + *\param a - QAction + *\param tBar - integer + *\param id - integer + *\param idx - integer + *\retval integer id of new action in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int idx ) { if ( !toolMgr() ) @@ -197,6 +206,15 @@ int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int return intId != -1 ? regId : -1; } +/*! Create tool. Register action \a a with id \a id. + * Insert QAction to tool manager. + *\param a - QAction + *\param tBar - QString& + *\param id - integer + *\param idx - integer + *\retval integer id of new action in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx ) { if ( !toolMgr() ) @@ -207,6 +225,15 @@ int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const return intId != -1 ? regId : -1; } +/*! Create tool. + * Insert QAction with id \a id from action map(myActionMap) to tool manager. + *\param a - QAction + *\param tBar - integer + *\param id - integer + *\param idx - integer + *\retval integer id of new action in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createTool( const int id, const int tBar, const int idx ) { if ( !toolMgr() ) @@ -216,6 +243,15 @@ int CAM_Module::createTool( const int id, const int tBar, const int idx ) return intId != -1 ? id : -1; } +/*! Create tool. + * Insert QAction with id \a id from action map(myActionMap) to tool manager. + *\param a - QAction + *\param tBar - QString& + *\param id - integer + *\param idx - integer + *\retval integer id of new action in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createTool( const int id, const QString& tBar, const int idx ) { if ( !toolMgr() ) @@ -225,6 +261,16 @@ int CAM_Module::createTool( const int id, const QString& tBar, const int idx ) return intId != -1 ? id : -1; } +/*! Create menu. + * Insert submenu \a subMenu to menu manager. + *\param subMenu - QString& + *\param menu - integer + *\param id - integer + *\param group - integer + *\param index - integer + *\retval integer id of new menu in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int index ) { @@ -234,6 +280,16 @@ int CAM_Module::createMenu( const QString& subMenu, const int menu, return menuMgr()->insert( subMenu, menu, group, index ); } +/*! Create menu. + * Insert submenu \a subMenu to menu manager. + *\param subMenu - QString& + *\param menu - QString& + *\param id - integer + *\param group - integer + *\param index - integer + *\retval integer id of new menu in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int index ) { @@ -243,6 +299,17 @@ int CAM_Module::createMenu( const QString& subMenu, const QString& menu, return menuMgr()->insert( subMenu, menu, group, index ); } + +/*! Create menu. Register action \a a with id \a id. + * Insert QAction to menu manager. + *\param a - Qaction + *\param menu - integer + *\param id - integer + *\param group - integer + *\param index - integer + *\retval integer id of new menu in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int index ) { if ( !a || !menuMgr() ) @@ -253,6 +320,16 @@ int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int return intId != -1 ? regId : -1; } +/*! Create menu. Register action \a a with id \a id. + * Insert QAction to menu manager. + *\param a - Qaction + *\param menu - QString& + *\param id - integer + *\param group - integer + *\param index - integer + *\retval integer id of new menu in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int index ) { if ( !a || !menuMgr() ) @@ -263,6 +340,15 @@ int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const return intId != -1 ? regId : -1; } +/*! Create menu. + * Insert QAction with id \a id from action map(myActionMap) to menu manager. + *\param menu - integer + *\param id - integer + *\param group - integer + *\param index - integer + *\retval integer id of new menu in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createMenu( const int id, const int menu, const int group, const int index ) { if ( !menuMgr() ) @@ -272,6 +358,15 @@ int CAM_Module::createMenu( const int id, const int menu, const int group, const return intId != -1 ? id : -1; } +/*! Create menu. + * Insert QAction with id \a id from action map(myActionMap) to menu manager. + *\param menu - QString& + *\param id - integer + *\param group - integer + *\param index - integer + *\retval integer id of new menu in tool manager. + *\retval Return -1 if something wrong. + */ int CAM_Module::createMenu( const int id, const QString& menu, const int group, const int index ) { if ( !menuMgr() ) diff --git a/src/CAM/CAM_Module.h b/src/CAM/CAM_Module.h index 85d1b347a..feff5c1f4 100755 --- a/src/CAM/CAM_Module.h +++ b/src/CAM/CAM_Module.h @@ -18,6 +18,9 @@ class QtxActionToolMgr; #pragma warning( disable: 4251 ) #endif +/*! + * Class provide support of tool and menu managers. + */ class CAM_EXPORT CAM_Module : public QObject { Q_OBJECT diff --git a/src/SUIT/SUIT_ActionOperation.cxx b/src/SUIT/SUIT_ActionOperation.cxx index bce87298f..c003ec5ac 100644 --- a/src/SUIT/SUIT_ActionOperation.cxx +++ b/src/SUIT/SUIT_ActionOperation.cxx @@ -4,34 +4,51 @@ #include +/*! + Constructor. +*/ SUIT_ActionOperation::SUIT_ActionOperation( SUIT_Application* app ) : SUIT_Operation( app ), myAction( 0 ) { } +/*! + Destructor. +*/ SUIT_ActionOperation::~SUIT_ActionOperation() { } +/*! + Gets action. +*/ QtxAction* SUIT_ActionOperation::action() const { return myAction; } +/*!Set action. + * Create new instance of QtxAction and set. + */ void SUIT_ActionOperation::setAction( const QString& text, const QIconSet& icon, - const QString& menuText, QKeySequence accel, + const QString& menuText, QKeySequence accel, QObject* parent, const char* name, bool toggle ) { setAction( new QtxAction( text, icon, menuText, accel, parent, name, toggle ) ); } +/*!Set action. + * Create new instance of QtxAction and set. + */ void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText, - QKeySequence accel, QObject* parent, const char* name, bool toggle ) + QKeySequence accel, QObject* parent, const char* name, bool toggle ) { setAction( new QtxAction(text, menuText, accel, parent, name, toggle ) ); } +/*!Set action. + */ void SUIT_ActionOperation::setAction( QtxAction* a ) { if ( myAction == a ) @@ -44,6 +61,9 @@ void SUIT_ActionOperation::setAction( QtxAction* a ) connect( myAction, SIGNAL( activated() ), SLOT( start() ) ); } +/*! Add action to widget \a wid. + *\retval TRUE - successful, FALSE - not successful. + */ bool SUIT_ActionOperation::addTo( QWidget* wid ) { if ( !action() ) @@ -52,6 +72,9 @@ bool SUIT_ActionOperation::addTo( QWidget* wid ) return action()->addTo( wid ); } +/*! Add action to widget \a wid. + *\retval TRUE - successful, FALSE - not successful. + */ bool SUIT_ActionOperation::addTo( QWidget* wid, int idx ) { if ( !action() ) @@ -60,8 +83,10 @@ bool SUIT_ActionOperation::addTo( QWidget* wid, int idx ) return action()->addTo( wid, idx ); } +/*! Set status tip for action. +*/ void SUIT_ActionOperation::setStatusTip( const QString& tip ) { - if ( action() ) - action()->setStatusTip( tip ); + if ( action() ) + action()->setStatusTip( tip ); } diff --git a/src/SUIT/SUIT_ActionOperation.h b/src/SUIT/SUIT_ActionOperation.h index 8fc3139f5..90ee85337 100644 --- a/src/SUIT/SUIT_ActionOperation.h +++ b/src/SUIT/SUIT_ActionOperation.h @@ -5,6 +5,7 @@ class QtxAction; +/*!Provide support QtxAction*/ class SUIT_EXPORT SUIT_ActionOperation : public SUIT_Operation { Q_OBJECT @@ -15,19 +16,21 @@ public: QtxAction* action() const; - /** @name GUI management*/ //@{ - virtual void setAction( const QString& text, const QIconSet& icon, const QString& menuText, - QKeySequence accel, QObject* parent, const char* name = 0, bool toggle = false ); + /** @name GUI management*/ + //@{ + virtual void setAction( const QString& text, const QIconSet& icon, const QString& menuText, + QKeySequence accel, QObject* parent, const char* name = 0, bool toggle = false ); - virtual void setAction( const QString& text, const QString& menuText, QKeySequence accel, - QObject* parent, const char* name = 0, bool toggle = false ); + virtual void setAction( const QString& text, const QString& menuText, QKeySequence accel, + QObject* parent, const char* name = 0, bool toggle = false ); virtual void setAction( QtxAction* theAction ); - bool addTo( QWidget* theWidget ); - bool addTo( QWidget* theWidget, int thePos ); - - void setStatusTip( const QString& theTip );//@} - + bool addTo( QWidget* theWidget ); + bool addTo( QWidget* theWidget, int thePos ); + + void setStatusTip( const QString& theTip ); + //@} + private: QtxAction* myAction; diff --git a/src/SUIT/SUIT_DataObject.cxx b/src/SUIT/SUIT_DataObject.cxx index a19b16e7c..7fdc04631 100755 --- a/src/SUIT/SUIT_DataObject.cxx +++ b/src/SUIT/SUIT_DataObject.cxx @@ -485,6 +485,9 @@ myOwner( o ) { } +/*! + Destructor. +*/ SUIT_DataObject::Signal::~Signal() { SUIT_DataObject* o = myOwner; @@ -496,11 +499,17 @@ SUIT_DataObject::Signal::~Signal() } } +/*! + Set owner \a o. +*/ void SUIT_DataObject::Signal::setOwner( SUIT_DataObject* o ) { myOwner = o; } +/*! + emit signal destroed owner. +*/ void SUIT_DataObject::Signal::emitSignal() { if ( myOwner ) diff --git a/src/SUIT/SUIT_DataObject.h b/src/SUIT/SUIT_DataObject.h index eef2fb87b..8b76beaaf 100755 --- a/src/SUIT/SUIT_DataObject.h +++ b/src/SUIT/SUIT_DataObject.h @@ -18,6 +18,9 @@ typedef QPtrListIterator DataObjectListIterator; #pragma warning( disable:4251 ) #endif +/*! + Class provide support data object. +*/ class SUIT_EXPORT SUIT_DataObject { public: diff --git a/src/SUIT/SUIT_DataObjectIterator.cxx b/src/SUIT/SUIT_DataObjectIterator.cxx index 2b2869a59..43010ce21 100644 --- a/src/SUIT/SUIT_DataObjectIterator.cxx +++ b/src/SUIT/SUIT_DataObjectIterator.cxx @@ -1,5 +1,8 @@ #include "SUIT_DataObjectIterator.h" +/*! + Constructor. +*/ SUIT_DataObjectIterator::SUIT_DataObjectIterator( SUIT_DataObject* root, const int det, const bool fromTrueRoot ) : myRoot( root ), myDetourType( det ), @@ -11,6 +14,9 @@ myCurrentLevel( 0 ) myCurrent = myExtremeChild = myRoot; } +/*! + Gets parent for object \a obj. +*/ SUIT_DataObject* SUIT_DataObjectIterator::parent( SUIT_DataObject* obj ) const { SUIT_DataObject* result = 0; @@ -19,6 +25,9 @@ SUIT_DataObject* SUIT_DataObjectIterator::parent( SUIT_DataObject* obj ) const return result; } +/*! + Increment operator. +*/ void SUIT_DataObjectIterator::operator++() { SUIT_DataObject* aNext = 0; @@ -86,21 +95,33 @@ void SUIT_DataObjectIterator::operator++() } } +/*! + Gets current data object. +*/ SUIT_DataObject* SUIT_DataObjectIterator::current() const { return myCurrent; } +/*! + Gets depth of current lavel. +*/ int SUIT_DataObjectIterator::depth() const { return myCurrentLevel; } +/*! + Gets detour type. +*/ int SUIT_DataObjectIterator::detour() const { return myDetourType; } +/*! + Gets global sibling for object \a obj +*/ SUIT_DataObject* SUIT_DataObjectIterator::globalSibling( SUIT_DataObject* obj, bool next ) const { SUIT_DataObject* par; @@ -124,6 +145,10 @@ SUIT_DataObject* SUIT_DataObjectIterator::globalSibling( SUIT_DataObject* obj, b return 0; } +/*! + * Gets first or last data object from list. + * Get firls, if \a FromLeft == true, else last. + */ SUIT_DataObject* SUIT_DataObjectIterator::extreme( DataObjectList& aList, bool FromLeft ) const { if ( FromLeft ) @@ -132,7 +157,9 @@ SUIT_DataObject* SUIT_DataObjectIterator::extreme( DataObjectList& aList, bool F return aList.getLast(); } - +/*! + Constructor. +*/ SUIT_DataObjectLevelIterator::SUIT_DataObjectLevelIterator( SUIT_DataObject* root, int start, int end, bool LeftToRight ) : SUIT_DataObjectIterator( root, LeftToRight ? BreadthLeft : BreadthRight ) @@ -147,6 +174,9 @@ SUIT_DataObjectLevelIterator::SUIT_DataObjectLevelIterator( SUIT_DataObject* roo SUIT_DataObjectIterator::operator++(); } +/*! + Increment operator. +*/ void SUIT_DataObjectLevelIterator::operator++() { if ( myCurrent ) diff --git a/src/SUIT/SUIT_DataObjectIterator.h b/src/SUIT/SUIT_DataObjectIterator.h index fbb9d0470..91b3f5350 100644 --- a/src/SUIT/SUIT_DataObjectIterator.h +++ b/src/SUIT/SUIT_DataObjectIterator.h @@ -3,6 +3,9 @@ #include "SUIT_DataObject.h" +/*! + Class provide data object iterator. +*/ class SUIT_EXPORT SUIT_DataObjectIterator { public: diff --git a/src/SUIT/SUIT_DataObjectKey.cxx b/src/SUIT/SUIT_DataObjectKey.cxx index 3f6a7148f..6ce6db227 100755 --- a/src/SUIT/SUIT_DataObjectKey.cxx +++ b/src/SUIT/SUIT_DataObjectKey.cxx @@ -10,30 +10,40 @@ #define _typeinfo type_info #endif +/*!\class SUIT_DataObjectKey + * Key for personal idetfication of SUIT_DataObject. + */ + /*! - Class: SUIT_DataObjectKey - Descr: Key for personal idetfication of SUIT_DataObject. + Constructor. */ - SUIT_DataObjectKey::SUIT_DataObjectKey() : refCounter( 0 ) { } +/*! + Destructor. +*/ SUIT_DataObjectKey::~SUIT_DataObjectKey() { } +/*!\class SUIT_DataObjectKeyHandle + * Wrapper around the pointer of class SUIT_DataObjectKey. + */ + /*! - Class: SUIT_DataObjectKeyHandle - Descr: Wrapper around the pointer of class SUIT_DataObjectKey. + Constructor. */ - SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle() : myKey( 0 ) { } +/*! + Copy Constructor. +*/ SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle( const SUIT_DataObjectKeyHandle& other ) : myKey( other.myKey ) { @@ -42,27 +52,44 @@ SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle( const SUIT_DataObjectKeyHand beginScope(); } +/*! + Constructor. Initialize by key \a key. +*/ SUIT_DataObjectKeyHandle::SUIT_DataObjectKeyHandle( SUIT_DataObjectKey* key ) : myKey( key ) { beginScope(); } +/*! + Destructor. +*/ SUIT_DataObjectKeyHandle::~SUIT_DataObjectKeyHandle() { nullify(); } +/*! + * Checks: Is key null? + *\retval TRUE - if null, esle false. +*/ bool SUIT_DataObjectKeyHandle::isNull() const { return !myKey; } +/*! + Nullify key. +*/ void SUIT_DataObjectKeyHandle::nullify() { endScope(); } +/*! + * Operator less. + *\retval boolean. TRUE - If current key less than \a kw. + */ bool SUIT_DataObjectKeyHandle::operator<( const SUIT_DataObjectKeyHandle& kw ) const { if ( myKey == kw.myKey ) @@ -83,6 +110,10 @@ bool SUIT_DataObjectKeyHandle::operator<( const SUIT_DataObjectKeyHandle& kw ) c return myKey->isLess( kw.myKey ); } +/*! + * Operator is equal. + *\retval boolean. TRUE - If current key equal \a kw. + */ bool SUIT_DataObjectKeyHandle::operator==( const SUIT_DataObjectKeyHandle& kw ) const { if ( myKey == kw.myKey ) @@ -97,6 +128,9 @@ bool SUIT_DataObjectKeyHandle::operator==( const SUIT_DataObjectKeyHandle& kw ) return myKey->isEqual( kw.myKey ); } +/*! + * Copy value of key \a kw to current. + */ SUIT_DataObjectKeyHandle& SUIT_DataObjectKeyHandle::operator=( const SUIT_DataObjectKeyHandle& kw ) { if ( myKey != kw.myKey ) @@ -110,12 +144,18 @@ SUIT_DataObjectKeyHandle& SUIT_DataObjectKeyHandle::operator=( const SUIT_DataOb return *this; } +/*! + * Inctrement reference counter for current key. + */ void SUIT_DataObjectKeyHandle::beginScope() { if ( myKey ) myKey->refCounter++; } +/*! + * Decrement reference counter for current key. + */ void SUIT_DataObjectKeyHandle::endScope() { if ( !myKey ) diff --git a/src/SUIT/SUIT_Desktop.cxx b/src/SUIT/SUIT_Desktop.cxx index 4f72bd885..4ff86a88d 100755 --- a/src/SUIT/SUIT_Desktop.cxx +++ b/src/SUIT/SUIT_Desktop.cxx @@ -12,6 +12,16 @@ #include #include +/*!\class SUIT_Desktop + * Provide desktop management:\n + * \li menu manager + * \li tool manager + * \li windows + */ + +/*! + Constructor. +*/ SUIT_Desktop::SUIT_Desktop() : QtxMainWindow() { @@ -19,10 +29,16 @@ SUIT_Desktop::SUIT_Desktop() myToolMgr = new QtxActionToolMgr( this ); } +/*! + Destructor. +*/ SUIT_Desktop::~SUIT_Desktop() { } +/*! + Emit on event \a e. +*/ bool SUIT_Desktop::event( QEvent* e ) { if ( !e ) @@ -41,12 +57,18 @@ bool SUIT_Desktop::event( QEvent* e ) return QMainWindow::event( e ); } +/*! + Close event \a e. +*/ void SUIT_Desktop::closeEvent( QCloseEvent* e ) { emit closing( this, e ); e->ignore(); } +/*! + Child event. +*/ void SUIT_Desktop::childEvent( QChildEvent* e ) { if ( e->type() == QEvent::ChildInserted && parentArea() && @@ -56,11 +78,17 @@ void SUIT_Desktop::childEvent( QChildEvent* e ) QtxMainWindow::childEvent( e ); } +/*! + Gets menu manager. +*/ QtxActionMenuMgr* SUIT_Desktop::menuMgr() const { return myMenuMgr; } +/*! + Gets tool manager. +*/ QtxActionToolMgr* SUIT_Desktop::toolMgr() const { return myToolMgr; diff --git a/src/SUIT/SUIT_ExceptionHandler.cxx b/src/SUIT/SUIT_ExceptionHandler.cxx index 4f92fd5b6..331c26449 100755 --- a/src/SUIT/SUIT_ExceptionHandler.cxx +++ b/src/SUIT/SUIT_ExceptionHandler.cxx @@ -4,16 +4,29 @@ #include +/*!\class SUIT_ExceptionHandler + * Show exception message on error handler. + */ + +/*! + Checks: is internal handle on object \a o? +*/ bool SUIT_ExceptionHandler::handle( QObject* o, QEvent* e ) { return internalHandle( o, e ); } +/*! + Checks: is internal handle on object \a o? +*/ bool SUIT_ExceptionHandler::internalHandle( QObject* o, QEvent* e ) { return qApp ? qApp->QApplication::notify( o, e ) : false; } +/*! + Show error message \a mgs, if application is not null. +*/ void SUIT_ExceptionHandler::showMessage( const QString& title, const QString& msg ) { if ( !qApp ) diff --git a/src/SUIT/SUIT_PopupClient.cxx b/src/SUIT/SUIT_PopupClient.cxx index 8714bfe64..c9e532793 100644 --- a/src/SUIT/SUIT_PopupClient.cxx +++ b/src/SUIT/SUIT_PopupClient.cxx @@ -14,6 +14,9 @@ SUIT_PopupClient::~SUIT_PopupClient() delete mySignal; } +/*! + Connect popup request. +*/ bool SUIT_PopupClient::connectPopupRequest( QObject* reciever, const char* slot ) { if ( !reciever || !slot ) @@ -24,6 +27,9 @@ bool SUIT_PopupClient::connectPopupRequest( QObject* reciever, const char* slot reciever, slot ); } +/*! + Disconnect popup request. +*/ bool SUIT_PopupClient::disconnectPopupRequest( QObject* reciever, const char* slot ) { if ( !reciever || !slot || !mySignal ) @@ -32,16 +38,19 @@ bool SUIT_PopupClient::disconnectPopupRequest( QObject* reciever, const char* sl reciever, slot ); } +/*! + Send signal on context menu request. +*/ void SUIT_PopupClient::contextMenuRequest( QContextMenuEvent* e ) { if ( mySignal ) mySignal->sendSignal( this, e ); } -/* - Class: SUIT_PopupClient::Signal [internal] - Descr: invoke signal which is connected to reciever in SUIT_PopupClient -*/ +/*! + * \class SUIT_PopupClient::Signal + * Descr: invoke signal which is connected to reciever in SUIT_PopupClient + */ /*! constructor*/ SUIT_PopupClient::Signal::Signal() @@ -53,6 +62,8 @@ SUIT_PopupClient::Signal::Signal() SUIT_PopupClient::Signal::~Signal() {} +/*! Send signal to \a client on context menu request \a e. + */ void SUIT_PopupClient::Signal::sendSignal( SUIT_PopupClient* client, QContextMenuEvent* e ) { emit contextMenuRequest( client, e ); diff --git a/src/SUIT/SUIT_PopupClient.h b/src/SUIT/SUIT_PopupClient.h index 4ea4a5957..1a081c101 100644 --- a/src/SUIT/SUIT_PopupClient.h +++ b/src/SUIT/SUIT_PopupClient.h @@ -8,7 +8,7 @@ class QPopupMenu; class QContextMenuEvent; -/*!Class: SUIT_PopupClient [public] \n +/*!\class SUIT_PopupClient * Descr: Base class for instances which creates popup menu on QContextMenuEvent */ class SUIT_EXPORT SUIT_PopupClient diff --git a/src/SUIT/SUIT_SelectionMgr.cxx b/src/SUIT/SUIT_SelectionMgr.cxx index 6711e5797..c7f8465cc 100755 --- a/src/SUIT/SUIT_SelectionMgr.cxx +++ b/src/SUIT/SUIT_SelectionMgr.cxx @@ -1,5 +1,9 @@ #include "SUIT_SelectionMgr.h" +/*!\class SUIT_SelectionMgr + * Provide selection manager. Manipulate by selection filters, modes, data owners. + */ + /*!constructor. initialize myIterations and myIsSelChangeEnabled.*/ SUIT_SelectionMgr::SUIT_SelectionMgr( const bool Feedback ) : myIterations( Feedback ? 1 : 0 ), @@ -13,17 +17,20 @@ SUIT_SelectionMgr::~SUIT_SelectionMgr() mySelectors.setAutoDelete( true ); } +/*!Add selector \a sel to selectors list,if it's not exists in list.*/ void SUIT_SelectionMgr::installSelector( SUIT_Selector* sel ) { if ( sel && !mySelectors.contains( sel ) ) mySelectors.append( sel ); } +/*!Remove selector \a sel from list.*/ void SUIT_SelectionMgr::removeSelector( SUIT_Selector* sel ) { mySelectors.remove( sel ); } +/*!Gets selectors list to \a lst.*/ void SUIT_SelectionMgr::selectors( QPtrList& lst ) const { lst.clear(); @@ -31,6 +38,7 @@ void SUIT_SelectionMgr::selectors( QPtrList& lst ) const lst.append( it.current() ); } +/*!Gets selectors list to \a lst with type \a typ.*/ void SUIT_SelectionMgr::selectors( const QString& typ, QPtrList& lst ) const { lst.clear(); @@ -41,6 +49,8 @@ void SUIT_SelectionMgr::selectors( const QString& typ, QPtrList& } } +/*! Sets ebabled to \a on for all data owners with type \a typ. +*/ void SUIT_SelectionMgr::setEnabled( const bool on, const QString& typ ) { for ( SelectorListIterator it( mySelectors ); it.current(); ++it ) @@ -50,6 +60,8 @@ void SUIT_SelectionMgr::setEnabled( const bool on, const QString& typ ) } } +/*! Gets selected data owners from list with type \a type to list \a lst. +*/ void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst, const QString& type ) const { lst.clear(); @@ -71,6 +83,8 @@ void SUIT_SelectionMgr::selected( SUIT_DataOwnerPtrList& lst, const QString& typ } } +/*! Sets selected data owners from \a lst and append to list, if \a append - true. +*/ void SUIT_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const bool append ) { SUIT_DataOwnerPtrList owners; @@ -89,11 +103,15 @@ void SUIT_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const boo } } +/*! Clear selected data owners. +*/ void SUIT_SelectionMgr::clearSelected() { setSelected( SUIT_DataOwnerPtrList() ); } +/*! On selection \a sel changed. +*/ void SUIT_SelectionMgr::selectionChanged( SUIT_Selector* sel ) { if ( !sel || !myIsSelChangeEnabled || !sel->isEnabled() ) @@ -121,16 +139,22 @@ void SUIT_SelectionMgr::selectionChanged( SUIT_Selector* sel ) emit selectionChanged(); } +/*! Checks: Is selection manager has selection mode \a mode? +*/ bool SUIT_SelectionMgr::hasSelectionMode( const int mode ) const { return mySelModes.contains( mode ); } +/*! Gets selection modes to list \a vals. +*/ void SUIT_SelectionMgr::selectionModes( QValueList& vals ) const { vals = mySelModes; } +/*! Set selection mode \a mode to list of selection modes. +*/ void SUIT_SelectionMgr::setSelectionModes( const int mode ) { QValueList lst; @@ -138,11 +162,15 @@ void SUIT_SelectionMgr::setSelectionModes( const int mode ) setSelectionModes( lst ); } +/*! Sets selection modes list from \a lst. +*/ void SUIT_SelectionMgr::setSelectionModes( const QValueList& lst ) { mySelModes = lst; } +/*! Append selection mode \a mode to list of selection modes. +*/ void SUIT_SelectionMgr::appendSelectionModes( const int mode ) { QValueList lst; @@ -150,6 +178,8 @@ void SUIT_SelectionMgr::appendSelectionModes( const int mode ) appendSelectionModes( lst ); } +/*! Append selection modes \a lst list. +*/ void SUIT_SelectionMgr::appendSelectionModes( const QValueList& lst ) { QMap map; @@ -163,6 +193,8 @@ void SUIT_SelectionMgr::appendSelectionModes( const QValueList& lst ) } } +/*! Remove selection mode \a mode from list. +*/ void SUIT_SelectionMgr::removeSelectionModes( const int mode ) { QValueList lst; @@ -170,6 +202,8 @@ void SUIT_SelectionMgr::removeSelectionModes( const int mode ) removeSelectionModes( lst ); } +/*! Remove selection modea \a lst from list. +*/ void SUIT_SelectionMgr::removeSelectionModes( const QValueList& lst ) { QMap map; @@ -184,6 +218,8 @@ void SUIT_SelectionMgr::removeSelectionModes( const QValueList& lst ) mySelModes.append( iter.key() ); } +/*! Checks data owner is ok? +*/ bool SUIT_SelectionMgr::isOk( const SUIT_DataOwner* owner ) const { if ( !owner ) @@ -196,6 +232,8 @@ bool SUIT_SelectionMgr::isOk( const SUIT_DataOwner* owner ) const return ok; } +/*! Checks data owner pointer is ok? +*/ bool SUIT_SelectionMgr::isOk( const SUIT_DataOwnerPtr& ptr ) const { if ( ptr.isNull() ) @@ -204,11 +242,15 @@ bool SUIT_SelectionMgr::isOk( const SUIT_DataOwnerPtr& ptr ) const return isOk( ptr.operator->() ); } +/*! Checks selection manager has filter \a f? +*/ bool SUIT_SelectionMgr::hasFilter( SUIT_SelectionFilter* f ) const { return myFilters.contains( f ); } +/*! Install filter \a f and set selected, if \a update = true. +*/ void SUIT_SelectionMgr::installFilter( SUIT_SelectionFilter* f, const bool updateSelection ) { if ( !hasFilter( f ) ) @@ -224,26 +266,36 @@ void SUIT_SelectionMgr::installFilter( SUIT_SelectionFilter* f, const bool updat } } +/*! Remove filter \a f from filters list. +*/ void SUIT_SelectionMgr::removeFilter( SUIT_SelectionFilter* f ) { myFilters.remove( f ); } +/*! Clear filters list. +*/ void SUIT_SelectionMgr::clearFilters() { myFilters.clear(); } +/*! Sets auto delete filter. +*/ bool SUIT_SelectionMgr::autoDeleteFilter() const { return myFilters.autoDelete(); } +/*! Sets auto delete filter to \a on. +*/ void SUIT_SelectionMgr::setAutoDeleteFilter( const bool on ) { myFilters.setAutoDelete( on ); } +/*! Gets good data owners list to \a out from \a in. +*/ void SUIT_SelectionMgr::filterOwners( const SUIT_DataOwnerPtrList& in, SUIT_DataOwnerPtrList& out ) const { out.clear(); diff --git a/src/SUIT/SUIT_Selector.cxx b/src/SUIT/SUIT_Selector.cxx index de78e4945..cbef90b02 100755 --- a/src/SUIT/SUIT_Selector.cxx +++ b/src/SUIT/SUIT_Selector.cxx @@ -2,6 +2,13 @@ #include "SUIT_SelectionMgr.h" +/*!\class SUIT_Selector + * Class provide selector for data owners. + */ + +/*! + Constructor. +*/ SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr, QObject* parent ) : QObject( parent ), mySelMgr( selMgr ), @@ -13,43 +20,67 @@ myAutoBlock( true ) selMgr->installSelector( this ); } +/*! + Destructor. +*/ SUIT_Selector::~SUIT_Selector() { if ( selectionMgr() ) selectionMgr()->removeSelector( this ); } +/*! + Gets selection manager. +*/ SUIT_SelectionMgr* SUIT_Selector::selectionMgr() const { return mySelMgr; } +/*! + Checks: Is selctor enabled? +*/ bool SUIT_Selector::isEnabled() const { return myEnabled; } +/*! + Sets selctor anbled to \a on. +*/ void SUIT_Selector::setEnabled( const bool on ) { myEnabled = on; } +/*! + Checks: Is selector auto block? +*/ bool SUIT_Selector::autoBlock() const { return myAutoBlock; } +/*! + Sets selctor autoblock to \a on. +*/ void SUIT_Selector::setAutoBlock( const bool on ) { myAutoBlock = on; } +/*! + Puts to \a lst selection list of data owners. +*/ void SUIT_Selector::selected( SUIT_DataOwnerPtrList& lst ) const { lst.clear(); getSelection( lst ); } +/*! + Puts to selection list of data owners \a lst.. +*/ void SUIT_Selector::setSelected( const SUIT_DataOwnerPtrList& lst ) { if ( !isEnabled() ) @@ -63,12 +94,18 @@ void SUIT_Selector::setSelected( const SUIT_DataOwnerPtrList& lst ) myBlock = block; } +/*! + On selection changed. +*/ void SUIT_Selector::selectionChanged() { if ( selectionMgr() && isEnabled() && ( !autoBlock() || !myBlock ) ) selectionMgr()->selectionChanged( this ); } +/*! + Checks: Is selection manager has selection mode \a mode? +*/ bool SUIT_Selector::hasSelectionMode( const int mode ) const { if ( !selectionMgr() ) @@ -77,6 +114,9 @@ bool SUIT_Selector::hasSelectionMode( const int mode ) const return selectionMgr()->hasSelectionMode( mode ); } +/*! + Puts to list \a lst selection modes from selection manager. +*/ void SUIT_Selector::selectionModes( QValueList& lst ) const { if ( selectionMgr() ) diff --git a/src/SUIT/SUIT_Session.h b/src/SUIT/SUIT_Session.h index 7496955f3..1ec8bd638 100755 --- a/src/SUIT/SUIT_Session.h +++ b/src/SUIT/SUIT_Session.h @@ -20,16 +20,14 @@ class SUIT_ResourceMgr; class SUIT_ExceptionHandler; -/*! - The class Sesssion manages launching of Applications. Application must be returned - by static function "createApplication" in external library. The Library must be loaded with - loadLibrary method and after that application can be started. -*/ - #ifdef WNT #pragma warning( disable:4251 ) #endif - +/*! + The class Sesssion manages launching of Applications. Application must be returned \n + by static function "createApplication" in external library. The Library must be loaded with \n + loadLibrary method and after that application can be started. +*/ class SUIT_EXPORT SUIT_Session: public QObject { Q_OBJECT diff --git a/src/SUIT/SUIT_Study.cxx b/src/SUIT/SUIT_Study.cxx index 61ca4f5f9..a2679a5f5 100755 --- a/src/SUIT/SUIT_Study.cxx +++ b/src/SUIT/SUIT_Study.cxx @@ -6,6 +6,11 @@ #include "SUIT_MessageBox.h" #include "SUIT_Application.h" +/*!\class SUIT_Study + * Support study management. Object management. Operation management. + */ + +/*!Constructor.*/ SUIT_Study::SUIT_Study( SUIT_Application* app ) : QObject(), myApp( app ), @@ -21,47 +26,72 @@ myName( "" ) myOperations.setAutoDelete( false ); } +/*!Destructor.*/ SUIT_Study::~SUIT_Study() { delete myRoot; myRoot = 0; } +/*! + *\retval study id. + */ int SUIT_Study::id() const { return myId; } +/*! + *\retval root data object. + */ SUIT_DataObject* SUIT_Study::root() const { return myRoot; } +/*! + *\retval Application. + */ SUIT_Application* SUIT_Study::application() const { return myApp; } +/*! + *\retval study name + */ QString SUIT_Study::studyName() const { return myName; } +/*! + *\retval active operation. + */ SUIT_Operation* SUIT_Study::activeOperation() const { return myOperations.current(); } +/*! + *\retval TRUE - if study saved, else FALSE. + */ bool SUIT_Study::isSaved() const { return myIsSaved; } +/*! + *\retval TRUE - if study modified, else FALSE. + */ bool SUIT_Study::isModified() const { return myIsModified; } +/*! + *Close document. NOT IMPLEMENTED. + */ void SUIT_Study::closeDocument(bool permanently) { } @@ -73,6 +103,9 @@ void SUIT_Study::createDocument() */ } +/*! + * Open document. Sets file name. return true. + */ bool SUIT_Study::openDocument( const QString& fileName ) { myName = fileName; @@ -82,6 +115,9 @@ bool SUIT_Study::openDocument( const QString& fileName ) return true; } +/*! + * Save document as \a fileName. Set file name. + */ bool SUIT_Study::saveDocumentAs( const QString& fileName ) { myName = fileName; @@ -91,11 +127,17 @@ bool SUIT_Study::saveDocumentAs( const QString& fileName ) return true; } +/*! + *\retval TRUE - if document saved successful, else FALSE. + */ bool SUIT_Study::saveDocument() { return saveDocumentAs( myName ); } +/*! + *Abort all operations. + */ void SUIT_Study::abortAllOperations() { SUIT_Operation* aOperation = 0; @@ -106,25 +148,40 @@ void SUIT_Study::abortAllOperations() } } +/*! + Update study. NOT IMPLEMENTED HERE. + */ void SUIT_Study::update() { } +/*! + Emit study modified. + */ void SUIT_Study::sendChangesNotification() { emit studyModified( this ); } +/*! + Set study saved to \a on. + */ void SUIT_Study::setIsSaved( const bool on ) { myIsSaved = on; } +/*! + Set study modified to \a on. + */ void SUIT_Study::setIsModified( const bool on ) { myIsModified = on; } +/*! + Set root object. + */ void SUIT_Study::setRoot( SUIT_DataObject* obj ) { if ( myRoot == obj ) @@ -134,11 +191,17 @@ void SUIT_Study::setRoot( SUIT_DataObject* obj ) myRoot = obj; } +/*! + Set study name. + */ void SUIT_Study::setStudyName( const QString& name ) { myName = name; } +/*! + Stop operation. + */ void SUIT_Study::stopOperation() { myOperations.pop(); @@ -147,6 +210,10 @@ void SUIT_Study::stopOperation() myIsModified = true; } +/*! + * Set can start operation \a theOperation. + *\retval FALSE - if can't start. + */ bool SUIT_Study::canStartOperation( SUIT_Operation* theOperation ) { SUIT_Operation* anActiveOperation = (SUIT_Operation*)activeOperation(); diff --git a/src/SUIT/SUIT_ToolButton.cxx b/src/SUIT/SUIT_ToolButton.cxx index a56591b17..1fd8aac5b 100755 --- a/src/SUIT/SUIT_ToolButton.cxx +++ b/src/SUIT/SUIT_ToolButton.cxx @@ -4,6 +4,7 @@ #include #include +/*!Constructor.*/ SUIT_ToolButton::SUIT_ToolButton( QWidget *parent, const char *name, bool changeItemAfterClick) @@ -13,7 +14,7 @@ SUIT_ToolButton::SUIT_ToolButton( QWidget *parent, initialize(); } - +/*!Constructor.*/ SUIT_ToolButton::SUIT_ToolButton( const QPixmap & pm, const QString &textLabel, const QString& grouptext, @@ -29,7 +30,7 @@ SUIT_ToolButton::SUIT_ToolButton( const QPixmap & pm, } -//******************************************************************************** +/*!Initialize tool buttons.*/ void SUIT_ToolButton::initialize() { mySignal = NULL; @@ -39,7 +40,7 @@ void SUIT_ToolButton::initialize() setPopupDelay(250); } -//******************************************************************************** +/*!drawButton is redefined to draw DownArrow*/ void SUIT_ToolButton::drawButton( QPainter * p ) { QToolButton::drawButton(p); @@ -53,7 +54,7 @@ void SUIT_ToolButton::drawButton( QPainter * p ) } -//******************************************************************************** +/*! Add action into popup*/ void SUIT_ToolButton::AddAction(QAction* theAction) { bool aIsFirst = false; @@ -73,8 +74,7 @@ void SUIT_ToolButton::AddAction(QAction* theAction) theAction->addTo( myPopup ); } - -//******************************************************************************** +/*! Sets myPopup item with theIndex as current*/ void SUIT_ToolButton::SetItem(int theIndex) { int anId = myPopup->idAt(theIndex); @@ -92,7 +92,9 @@ void SUIT_ToolButton::SetItem(int theIndex) } } -//******************************************************************************** +/*!Public SLOT. + * On select action (icon and text set with id = \a theItemID) + */ void SUIT_ToolButton::OnSelectAction(int theItemID) { if (myChangeItemAfterClick) @@ -111,7 +113,7 @@ void SUIT_ToolButton::OnSelectAction(int theItemID) -//******************************************************************************** +/*!On mouse release event.*/ void SUIT_ToolButton::mouseReleaseEvent ( QMouseEvent * theEvent) { QToolButton::mouseReleaseEvent(theEvent); diff --git a/src/SUIT/SUIT_ToolButton.h b/src/SUIT/SUIT_ToolButton.h index 5a0e78430..329316316 100755 --- a/src/SUIT/SUIT_ToolButton.h +++ b/src/SUIT/SUIT_ToolButton.h @@ -24,13 +24,10 @@ public: bool changeItemAfterClick = true ); //@} - /*!drawButton is redefined to draw DownArrow*/ void drawButton( QPainter * pQPainter); - /*! Add action into popup*/ void AddAction(QAction* theAction); - /*! Sets myPopup item with theIndex as current*/ void SetItem(int theIndex); public slots: diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index 619881571..66ebcf7c0 100755 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -11,7 +11,11 @@ #include #endif -//*************************************************************** +/*!\class SUIT_ViewManager. + * Class provide manipulation with view windows. + */ + +/*!Constructor.*/ SUIT_ViewManager::SUIT_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop, SUIT_ViewModel* theViewModel ) @@ -31,7 +35,7 @@ myStudy( NULL ) connect( myStudy, SIGNAL( destroyed() ), this, SLOT( onDeleteStudy() ) ); } -//*************************************************************** +/*!Destructor.*/ SUIT_ViewManager::~SUIT_ViewManager() { if (myViewModel) { @@ -40,7 +44,7 @@ SUIT_ViewManager::~SUIT_ViewManager() } } -//*************************************************************** +/*!Sets view model \a theViewModel to view manager.*/ void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel) { if (myViewModel && myViewModel != theViewModel) { @@ -52,14 +56,14 @@ void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel) myViewModel->setViewManager(this); } -//*************************************************************** +/*!Sets view name for view window \a theView.*/ void SUIT_ViewManager::setViewName(SUIT_ViewWindow* theView) { int aPos = myViews.find(theView); theView->setCaption(myTitle + QString(":%1").arg(aPos+1)); } -//*************************************************************** +/*! Creates View, adds it into list of views and returns just created view window*/ SUIT_ViewWindow* SUIT_ViewManager::createViewWindow() { SUIT_ViewWindow* aView = myViewModel->createView(myDesktop); @@ -86,13 +90,15 @@ SUIT_ViewWindow* SUIT_ViewManager::createViewWindow() return aView; } -//*************************************************************** +/*!Create view window.*/ void SUIT_ViewManager::createView() { createViewWindow(); } -//*************************************************************** +/*!Insert view window to view manager. + *\retval false - if something wrong, else true. + */ bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView) { unsigned int aSize = myViews.size(); @@ -141,15 +147,17 @@ bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView) return false; } - -//*************************************************************** +/*!Emit delete view. Remove view window \a theView from view manager. +*/ void SUIT_ViewManager::onDeleteView(SUIT_ViewWindow* theView) { emit deleteView(theView); removeView(theView); } -//*************************************************************** +/*!Remove view window \a theView from view manager. + *And close the last view, if it has \a theView. +*/ void SUIT_ViewManager::removeView(SUIT_ViewWindow* theView) { theView->disconnect(this); @@ -161,13 +169,14 @@ void SUIT_ViewManager::removeView(SUIT_ViewWindow* theView) emit lastViewClosed(this); } -//*************************************************************** +/*!Emit on \a theEvent mouse pressed in \a theView.*/ void SUIT_ViewManager::onMousePressed(SUIT_ViewWindow* theView, QMouseEvent* theEvent) { emit mousePress(theView, theEvent); } -//*************************************************************** +/*!Emit activated for view \a view. +*/ void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view) { if (view) { @@ -182,7 +191,8 @@ void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view) } } -//*************************************************************** +/*!Close all views. +*/ void SUIT_ViewManager::closeAllViews() { unsigned int aSize = myViews.size(); @@ -192,33 +202,37 @@ void SUIT_ViewManager::closeAllViews() } } - -//*************************************************************** +/*! + *\retval QString - type of view model. + */ QString SUIT_ViewManager::getType() const { return (!myViewModel)? "": myViewModel->getType(); } -//*************************************************************** +/*! + *\retval SUIT_Study* - current study. + */ SUIT_Study* SUIT_ViewManager::study() const { return myStudy; } -//*************************************************************** +/*! + * Sets stydy to NULL. + */ void SUIT_ViewManager::onDeleteStudy() { myStudy = NULL; } -//*************************************************************** void SUIT_ViewManager::onContextMenuRequested( QContextMenuEvent* e ) { /*! invoke method of SUIT_PopupClient, which notifies about popup*/ contextMenuRequest( e ); } -//*************************************************************** +/*!Context menu popup for \a popup.*/ void SUIT_ViewManager::contextMenuPopup( QPopupMenu* popup ) { SUIT_ViewModel* vm = getViewModel(); diff --git a/src/SUIT/SUIT_ViewManager.h b/src/SUIT/SUIT_ViewManager.h index 8370b7d5b..eb82e0b7a 100755 --- a/src/SUIT/SUIT_ViewManager.h +++ b/src/SUIT/SUIT_ViewManager.h @@ -44,7 +44,6 @@ public: QString getTitle() const { return myTitle;} void setTitle(QString theTitle) { myTitle = theTitle; } - /*! Creates View, adds it into list of views and returns just created view window*/ SUIT_ViewWindow* createViewWindow(); public slots: diff --git a/src/SUIT/SUIT_ViewModel.cxx b/src/SUIT/SUIT_ViewModel.cxx index daaf0edfa..cbf1194a5 100755 --- a/src/SUIT/SUIT_ViewModel.cxx +++ b/src/SUIT/SUIT_ViewModel.cxx @@ -4,14 +4,12 @@ #include "SUIT_ViewModel.h" -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// SUIT_ViewModel::StatesMap SUIT_ViewModel::myStateMap; SUIT_ViewModel::ButtonsMap SUIT_ViewModel::myButtonMap; static bool isInitialized = false; +/*!Constructor.*/ SUIT_ViewModel::SUIT_ViewModel() { if (!isInitialized) { @@ -32,27 +30,38 @@ SUIT_ViewModel::SUIT_ViewModel() myViewManager = 0; } +/*!Destructor..*/ SUIT_ViewModel::~SUIT_ViewModel() { } -//*************************************************************** +/*!Create new instance of view window on desktop \a theDesktop. + *\retval SUIT_ViewWindow* - created view window pointer. + */ SUIT_ViewWindow* SUIT_ViewModel::createView(SUIT_Desktop* theDesktop) { return new SUIT_ViewWindow(theDesktop); } -//********************************************************************* +/*! Sets hot button + *\param theOper - hot operation + *\param theState - adding state to state map operations. + *\param theButton - adding state to button map operations. + */ void SUIT_ViewModel::setHotButton(HotOperation theOper, Qt::ButtonState theState, - Qt::ButtonState theButton) + Qt::ButtonState theButton) { myStateMap[theOper] = theState; myButtonMap[theOper] = theButton; } -//********************************************************************* +/*! Gets hot button for operation \a theOper. + *\param theOper - input hot operation + *\param theState - output state from state map operations. + *\param theButton - output state from button map operations. +*/ void SUIT_ViewModel::getHotButton(HotOperation theOper, Qt::ButtonState& theState, - Qt::ButtonState& theButton) + Qt::ButtonState& theButton) { theState = myStateMap[theOper]; theButton = myButtonMap[theOper]; diff --git a/src/SUIT/SUIT_ViewModel.h b/src/SUIT/SUIT_ViewModel.h index 82af77687..c3c658233 100755 --- a/src/SUIT/SUIT_ViewModel.h +++ b/src/SUIT/SUIT_ViewModel.h @@ -9,17 +9,15 @@ #include #include +#ifdef WIN32 +#pragma warning( disable:4251 ) +#endif /*! * This object manages the definition and behaviour of a View Window. \n * In case of definition of this object in an external lib that lib must \n * have an exported function "createViewModel" which returns newly created \n * instance of SUIT_ViewModel. */ - -#ifdef WIN32 -#pragma warning( disable:4251 ) -#endif - class SUIT_EXPORT SUIT_ViewModel : public QObject { Q_OBJECT diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index 7886b415b..73e310d02 100755 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -13,45 +13,50 @@ #include "qpopupmenu.h" #include "qapplication.h" -// Dump view custom event -const int DUMP_EVENT = QEvent::User + 123; +/*!\class SUIT_ViewWindow + * Class provide view window. + */ -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// +/*! Dump view custom event*/ +const int DUMP_EVENT = QEvent::User + 123; +/*! Constructor.*/ SUIT_ViewWindow::SUIT_ViewWindow(SUIT_Desktop* theDesktop) : QMainWindow( theDesktop, "SUIT_ViewWindow", Qt::WDestructiveClose ) { myDesktop = theDesktop; } - +/*! Destructor.*/ SUIT_ViewWindow::~SUIT_ViewWindow() { } -//*************************************************************** +/*! Close event \a theEvent. +*/ void SUIT_ViewWindow::closeEvent(QCloseEvent* theEvent) { QMainWindow::closeEvent( theEvent ); emit closing( this ); } -//**************************************************************** +/*! Context menu requested for event \a e. +*/ void SUIT_ViewWindow::contextMenuEvent ( QContextMenuEvent * e ) { if ( e->reason() != QContextMenuEvent::Mouse ) emit contextMenuRequested( e ); } -//**************************************************************** +/*! Post events on dump view. +*/ void SUIT_ViewWindow::onDumpView() { qApp->postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ), TRUE ) ); qApp->postEvent( this, new QCustomEvent( DUMP_EVENT ) ); } -//**************************************************************** +/*! Reaction view window on event \a e. +*/ bool SUIT_ViewWindow::event( QEvent* e ) { if ( e->type() == DUMP_EVENT ) { @@ -82,5 +87,3 @@ bool SUIT_ViewWindow::event( QEvent* e ) } return QMainWindow::event( e ); } - -//**************************************************************** diff --git a/src/SUIT/utilities.h b/src/SUIT/utilities.h index d29e35a5b..cfc5ed0e5 100755 --- a/src/SUIT/utilities.h +++ b/src/SUIT/utilities.h @@ -38,15 +38,15 @@ #include "LocalTraceBufferPool.hxx" -/*! - * For each message to put in the trace, a specific ostingstream object is - * created and destroyed automatically at the end of the message macro. - * The insert function of LocalTraceBufferPool class gets a buffer in a - * buffer pool (unique with the help of mutexes and semaphores) and copy the - * message in the buffer. - * This buffer is read later by a specific thread in charge of trace print. - * Order of trace entries is globally respected. Nevertheless, if there are - * several threads waiting for a free buffer to trace, the order of +/** \file utilities.h + * For each message to put in the trace, a specific ostingstream object is \n + * created and destroyed automatically at the end of the message macro. \n + * The insert function of LocalTraceBufferPool class gets a buffer in a \n + * buffer pool (unique with the help of mutexes and semaphores) and copy the \n + * message in the buffer.\n + * This buffer is read later by a specific thread in charge of trace print.\n + * Order of trace entries is globally respected. Nevertheless, if there are \n + * several threads waiting for a free buffer to trace, the order of \n * thread waken up is not garanteed (no fifo or priority rules in Linux Kernel) */ @@ -90,8 +90,8 @@ << " at " << __TIME__ << MESS_END } #ifdef _DEBUG_ -// --- the following MACROS are useful at debug time - +/** @name the following MACROS are useful at debug time*/ +//@{ #define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END} #define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var <Delete(); } +/*!Checks: is trihedron displayed.*/ bool VTKViewer_ViewWindow::isTrihedronDisplayed(){ return myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn; } -/*! - Activates 'zooming' transformation -*/ +/*!Activates 'zooming' transformation*/ void VTKViewer_ViewWindow::activateZoom() { myRWInteractor->GetInteractorStyle()->startZoom(); } -/*! - Activates 'panning' transformation -*/ +/*!Activates 'panning' transformation*/ void VTKViewer_ViewWindow::activatePanning() { myRWInteractor->GetInteractorStyle()->startPan(); } -/*! - Activates 'rotation' transformation -*/ +/*!Activates 'rotation' transformation*/ void VTKViewer_ViewWindow::activateRotation() { myRWInteractor->GetInteractorStyle()->startRotate(); } +/*!Activate global panning.*/ void VTKViewer_ViewWindow::activateGlobalPanning() { //if(myTrihedron->GetVisibleActorCount(myRenderer)) myRWInteractor->GetInteractorStyle()->startGlobalPan(); } -/*! - Activates 'fit area' transformation -*/ +/*!Activates 'fit area' transformation*/ void VTKViewer_ViewWindow::activateWindowFit() { myRWInteractor->GetInteractorStyle()->startFitArea(); } +/*!Create actions:*/ void VTKViewer_ViewWindow::createActions() { if (!myActionsMap.isEmpty()) return; @@ -167,99 +162,105 @@ void VTKViewer_ViewWindow::createActions() QtxAction* aAction; - // Dump view + //! \li Dump view aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ), tr( "MNU_DUMP_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_DUMP_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView())); myActionsMap[ DumpId ] = aAction; - // FitAll + //! \li FitAll aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ), tr( "MNU_FITALL" ), 0, this); aAction->setStatusTip(tr("DSC_FITALL")); connect(aAction, SIGNAL(activated()), this, SLOT(onFitAll())); myActionsMap[ FitAllId ] = aAction; - // FitRect + //! \li FitRect aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ), tr( "MNU_FITRECT" ), 0, this); aAction->setStatusTip(tr("DSC_FITRECT")); connect(aAction, SIGNAL(activated()), this, SLOT(activateWindowFit())); myActionsMap[ FitRectId ] = aAction; - // Zoom + //! \li Zoom aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ), tr( "MNU_ZOOM_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_ZOOM_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(activateZoom())); myActionsMap[ ZoomId ] = aAction; - // Panning + //! \li Panning aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ), tr( "MNU_PAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_PAN_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(activatePanning())); myActionsMap[ PanId ] = aAction; - // Global Panning + //! \li Global Panning aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ), tr( "MNU_GLOBALPAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning())); myActionsMap[ GlobalPanId ] = aAction; - // Rotation + //! \li Rotation aAction = new QtxAction(tr("MNU_ROTATE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ), tr( "MNU_ROTATE_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_ROTATE_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(activateRotation())); myActionsMap[ RotationId ] = aAction; - // Projections + //! \li Projections aAction = new QtxAction(tr("MNU_FRONT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ), tr( "MNU_FRONT_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_FRONT_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onFrontView())); myActionsMap[ FrontId ] = aAction; + //! \li Back view aAction = new QtxAction(tr("MNU_BACK_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ), tr( "MNU_BACK_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_BACK_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onBackView())); myActionsMap[ BackId ] = aAction; + //! \li Top view aAction = new QtxAction(tr("MNU_TOP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ), tr( "MNU_TOP_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_TOP_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onTopView())); myActionsMap[ TopId ] = aAction; + //! \li Bottom view aAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ), tr( "MNU_BOTTOM_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_BOTTOM_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onBottomView())); myActionsMap[ BottomId ] = aAction; + //! \li Left view aAction = new QtxAction(tr("MNU_LEFT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ), tr( "MNU_LEFT_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_LEFT_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onLeftView())); myActionsMap[ LeftId ] = aAction; + //! \li Right view aAction = new QtxAction(tr("MNU_RIGHT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ), tr( "MNU_RIGHT_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_RIGHT_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onRightView())); myActionsMap[ RightId ] = aAction; - // Reset + //! \li Reset aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ), tr( "MNU_RESET_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_RESET_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onResetView())); myActionsMap[ ResetId ] = aAction; + //! \li Trihedron shown aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ), tr( "MNU_SHOW_TRIHEDRON" ), 0, this); aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON")); @@ -267,6 +268,7 @@ void VTKViewer_ViewWindow::createActions() myActionsMap[ TrihedronShowId ] = aAction; } +/*!Create tool bar.*/ void VTKViewer_ViewWindow::createToolBar() { myActionsMap[DumpId]->addTo(myToolBar); @@ -294,6 +296,7 @@ void VTKViewer_ViewWindow::createToolBar() myActionsMap[ResetId]->addTo(myToolBar); } +/*!On front view event.*/ void VTKViewer_ViewWindow::onFrontView() { vtkCamera* camera = myRenderer->GetActiveCamera(); @@ -303,6 +306,7 @@ void VTKViewer_ViewWindow::onFrontView() onFitAll(); } +/*!On back view slot.*/ void VTKViewer_ViewWindow::onBackView() { vtkCamera* camera = myRenderer->GetActiveCamera(); @@ -312,6 +316,7 @@ void VTKViewer_ViewWindow::onBackView() onFitAll(); } +/*!On back view slot.*/ void VTKViewer_ViewWindow::onTopView() { vtkCamera* camera = myRenderer->GetActiveCamera(); @@ -321,6 +326,7 @@ void VTKViewer_ViewWindow::onTopView() onFitAll(); } +/*!On bottom view slot.*/ void VTKViewer_ViewWindow::onBottomView() { vtkCamera* camera = myRenderer->GetActiveCamera(); @@ -330,6 +336,7 @@ void VTKViewer_ViewWindow::onBottomView() onFitAll(); } +/*!On left view slot.*/ void VTKViewer_ViewWindow::onLeftView() { vtkCamera* camera = myRenderer->GetActiveCamera(); @@ -339,6 +346,7 @@ void VTKViewer_ViewWindow::onLeftView() onFitAll(); } +/*!On right view slot.*/ void VTKViewer_ViewWindow::onRightView() { vtkCamera* camera = myRenderer->GetActiveCamera(); @@ -348,6 +356,7 @@ void VTKViewer_ViewWindow::onRightView() onFitAll(); } +/*!On reset view slot.*/ void VTKViewer_ViewWindow::onResetView() { int aTriedronIsVisible = isTrihedronDisplayed(); @@ -364,24 +373,21 @@ void VTKViewer_ViewWindow::onResetView() Repaint(); } +/*!On fit all slot.*/ void VTKViewer_ViewWindow::onFitAll() { myRWInteractor->GetInteractorStyle()->ViewFitAll(); Repaint(); } -/*! - Set background of the viewport -*/ +/*!Set background of the viewport*/ void VTKViewer_ViewWindow::setBackgroundColor( const QColor& color ) { if ( myRenderer ) myRenderer->SetBackground( color.red()/255., color.green()/255., color.blue()/255. ); } -/*! - Returns background of the viewport -*/ +/*!Returns background of the viewport*/ QColor VTKViewer_ViewWindow::backgroundColor() const { float backint[3]; @@ -392,22 +398,26 @@ QColor VTKViewer_ViewWindow::backgroundColor() const return SUIT_ViewWindow::backgroundColor(); } +/*!Repaint window. If \a theUpdateTrihedron is true - recalculate trihedron.*/ void VTKViewer_ViewWindow::Repaint(bool theUpdateTrihedron) { if (theUpdateTrihedron) onAdjustTrihedron(); myRenderWindow->update(); } +/*!Get scale of transformation filter.*/ void VTKViewer_ViewWindow::GetScale( double theScale[3] ) { myTransform->GetScale( theScale ); } +/*!Set scale of transformation filter and repaint window.*/ void VTKViewer_ViewWindow::SetScale( double theScale[3] ) { myTransform->SetMatrixScale( theScale[0], theScale[1], theScale[2] ); myRWInteractor->Render(); Repaint(); } +/*!Calculation trihedron size.*/ void VTKViewer_ViewWindow::onAdjustTrihedron(){ if( !isTrihedronDisplayed() ) return; @@ -445,36 +455,45 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){ ::ResetCameraClippingRange(myRenderer); } +/*!Emit key pressed.*/ void VTKViewer_ViewWindow::onKeyPressed(QKeyEvent* event) { emit keyPressed( this, event ); } +/*!Emit key released.*/ void VTKViewer_ViewWindow::onKeyReleased(QKeyEvent* event) { emit keyReleased( this, event ); } +/*!Emit key pressed.*/ void VTKViewer_ViewWindow::onMousePressed(QMouseEvent* event) { emit mousePressed(this, event); } +/*!Emit mouse released.*/ void VTKViewer_ViewWindow::onMouseReleased(QMouseEvent* event) { emit mouseReleased( this, event ); } +/*!Emit mouse moving.*/ void VTKViewer_ViewWindow::onMouseMoving(QMouseEvent* event) { emit mouseMoving( this, event ); } +/*!Emit mouse double clicked.*/ void VTKViewer_ViewWindow::onMouseDoubleClicked( QMouseEvent* event ) { emit mouseDoubleClicked( this, event ); } +/*!Insert actor to renderer and transformation filter. + *Move Internal actors, if \a theMoveInternalActors is true. + */ void VTKViewer_ViewWindow::InsertActor( VTKViewer_Actor* theActor, bool theMoveInternalActors ){ theActor->AddToRender(myRenderer); theActor->SetTransform(myTransform); @@ -482,24 +501,30 @@ void VTKViewer_ViewWindow::InsertActor( VTKViewer_Actor* theActor, bool theMoveI myRWInteractor->MoveInternalActors(); } +/*!Add actor.Repaint window if \a theUpdate is true. + *@see InsertActor( VTKViewer_Actor* theActor, bool theMoveInternalActors ) + */ void VTKViewer_ViewWindow::AddActor( VTKViewer_Actor* theActor, bool theUpdate /*=false*/ ){ InsertActor(theActor); if(theUpdate) Repaint(); } +/*!Remove \a theActor from renderer and pepaint, if \a theUpdate is true.*/ void VTKViewer_ViewWindow::RemoveActor( VTKViewer_Actor* theActor, bool theUpdate /*=false*/ ){ theActor->RemoveFromRender(myRenderer); if(theUpdate) Repaint(); } +/*!@see RemoveActor() and InsertActor().*/ void VTKViewer_ViewWindow::MoveActor( VTKViewer_Actor* theActor) { RemoveActor(theActor); InsertActor(theActor,true); } +/*!On trihedron show slot.*/ void VTKViewer_ViewWindow::onTrihedronShow() { if (isTrihedronDisplayed()) @@ -509,6 +534,7 @@ void VTKViewer_ViewWindow::onTrihedronShow() myRenderWindow->update(); } +/*!Dump view.*/ QImage VTKViewer_ViewWindow::dumpView() { QPixmap px = QPixmap::grabWindow( myRenderWindow->winId() ); -- 2.39.2