From: asl Date: Thu, 4 May 2006 07:33:15 +0000 (+0000) Subject: doxygen comments X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=57fe54128eb96c24beaf87c08b5c2ef7e6d21595;p=modules%2Fgui.git doxygen comments --- diff --git a/src/LogWindow/LogWindow.cxx b/src/LogWindow/LogWindow.cxx index 0b846b720..e0de7b355 100755 --- a/src/LogWindow/LogWindow.cxx +++ b/src/LogWindow/LogWindow.cxx @@ -36,7 +36,9 @@ #define DEFAULT_SEPARATOR "***" -//**************************************************************** +/*! + Converts rich text to plain text +*/ static QString plainText( const QString& richText ) { QString aText = richText; @@ -53,8 +55,9 @@ static QString plainText( const QString& richText ) return aText; } -//**************************************************************** - +/*! + Default constructor +*/ LogWindow::LogWindow( QWidget* parent ) : QFrame( parent ), SUIT_PopupClient() @@ -83,10 +86,16 @@ SUIT_PopupClient() createActions(); } +/*! + Destructor +*/ LogWindow::~LogWindow() { } +/*! + Custom event handler +*/ bool LogWindow::eventFilter( QObject* o, QEvent* e ) { if ( o == myView->viewport() && e->type() == QEvent::ContextMenu ) @@ -97,6 +106,10 @@ bool LogWindow::eventFilter( QObject* o, QEvent* e ) return QFrame::eventFilter( o, e ); } +/*! + Sets banner (title of message log) + \param banner - new title +*/ void LogWindow::setBanner( const QString& banner ) { myBanner = banner; @@ -104,6 +117,10 @@ void LogWindow::setBanner( const QString& banner ) clear( false ); } +/*! + Set separator (line printing between messages) + \param separator - new separator +*/ void LogWindow::setSeparator( const QString& separator ) { mySeparator = separator; @@ -111,6 +128,11 @@ void LogWindow::setSeparator( const QString& separator ) clear( false ); } +/*! + Puts message to log window + \param message - text of message + \addSeparator - if it is true, then separator is added to tail of message log +*/ void LogWindow::putMessage( const QString& message, bool addSeparator ) { myView->append( message ); @@ -124,6 +146,10 @@ void LogWindow::putMessage( const QString& message, bool addSeparator ) myView->scrollToBottom(); } +/*! + Clears message log + \param clearHistory - if it is true, then also history is cleared +*/ void LogWindow::clear( bool clearHistory ) { myView->clear(); @@ -139,6 +165,10 @@ void LogWindow::clear( bool clearHistory ) myBannerSize = 0; } +/*! + Saves log to file + \param fileName - name of file +*/ bool LogWindow::saveLog( const QString& fileName ) { QFile file( fileName ); @@ -160,6 +190,9 @@ bool LogWindow::saveLog( const QString& fileName ) return true; } +/*! + Creates actions +*/ void LogWindow::createActions() { QAction* a = new QAction( "", tr( "&Copy" ), 0, this ); @@ -183,6 +216,9 @@ void LogWindow::createActions() myActions.insert( SaveToFileId, a ); } +/*! + Redefined virtual method for popup filling +*/ void LogWindow::contextMenuPopup( QPopupMenu* popup ) { myActions[ CopyId ]->addTo( popup ); @@ -199,6 +235,9 @@ void LogWindow::contextMenuPopup( QPopupMenu* popup ) updateActions(); } +/*! + Updates enable status of actions +*/ void LogWindow::updateActions() { int paraFrom, paraTo, indexFrom, indexTo; @@ -212,6 +251,9 @@ void LogWindow::updateActions() myActions[ SaveToFileId ]->setEnabled( myHistory.count() > 0 ); } +/*! + SLOT: called if user click "Save" in popup +*/ void LogWindow::onSaveToFile() { SUIT_Application* app = SUIT_Session::session()->activeApplication(); @@ -233,17 +275,26 @@ void LogWindow::onSaveToFile() SUIT_MessageBox::error1( this, tr( "Error" ), tr( "Can't save file" ), tr( "OK" ) ); } +/*! + SLOT: called if user click "Select all" in popup +*/ void LogWindow::onSelectAll() { if ( myView ) myView->selectAll(); } +/*! + SLOT: called if user click "Clear" in popup +*/ void LogWindow::onClear() { clear( false ); } +/*! + SLOT: called if user click "Copy" in popup +*/ void LogWindow::onCopy() { if ( myView ) diff --git a/src/LogWindow/LogWindow.h b/src/LogWindow/LogWindow.h index 44001e068..c6aeeecc6 100755 --- a/src/LogWindow/LogWindow.h +++ b/src/LogWindow/LogWindow.h @@ -52,6 +52,10 @@ class QAction; class QTextBrowser; +/*! + \class LogWindow + Widget, showing logs message. Allows to show, to clear, to copy messages and to save then to file +*/ class LOGWINDOW_EXPORT LogWindow : public QFrame, public SUIT_PopupClient { Q_OBJECT diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index ed8f8d2ec..d40b80568 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -438,7 +438,7 @@ bool OCCViewer_Viewer::highlight( const Handle(AIS_InteractiveObject)& obj, } /*! - Unhilights all object in viewer + Unhilights all objects in viewer \param updateviewer - update current viewer */ bool OCCViewer_Viewer::unHighlightAll( bool updateviewer ) diff --git a/src/PyInterp/PyInterp_Dispatcher.cxx b/src/PyInterp/PyInterp_Dispatcher.cxx index 3d5067dba..d772c34a2 100755 --- a/src/PyInterp/PyInterp_Dispatcher.cxx +++ b/src/PyInterp/PyInterp_Dispatcher.cxx @@ -22,10 +22,6 @@ using namespace std; PyInterp_Dispatcher* PyInterp_Dispatcher::myInstance = 0; -////////////////////////////////////////////////////////// -// class : PyInterp_Request -////////////////////////////////////////////////////////// - void PyInterp_Request::process() { safeExecute(); @@ -89,20 +85,12 @@ void PyInterp_LockRequest::safeExecute() } } -////////////////////////////////////////////////////////// -// class : PyInterp_Event -////////////////////////////////////////////////////////// - PyInterp_Event::~PyInterp_Event() { PyInterp_Request::Destroy( myRequest ); myRequest = 0; } -////////////////////////////////////////////////////////// -// class : PyInterp_Dispatcher -////////////////////////////////////////////////////////// - PyInterp_Dispatcher* PyInterp_Dispatcher::Get() { if ( !myInstance ) diff --git a/src/PyInterp/PyInterp_Dispatcher.h b/src/PyInterp/PyInterp_Dispatcher.h index a7a4ae72f..412c97194 100755 --- a/src/PyInterp/PyInterp_Dispatcher.h +++ b/src/PyInterp/PyInterp_Dispatcher.h @@ -25,9 +25,6 @@ class PyInterp_base; class PyInterp_Watcher; class PyInterp_Dispatcher; -////////////////////////////////////////////////////////// -// class : PyInterp_Request -////////////////////////////////////////////////////////// class PYINTERP_EXPORT PyInterp_Request { friend class PyInterp_Dispatcher; @@ -88,9 +85,6 @@ private: PyInterp_base* myInterp; }; -////////////////////////////////////////////////////////// -// class : PyInterp_Event -////////////////////////////////////////////////////////// class PYINTERP_EXPORT PyInterp_Event : public QCustomEvent { PyInterp_Event(); @@ -111,9 +105,6 @@ private: PyInterp_Request* myRequest; }; -////////////////////////////////////////////////////////// -// class : PyInterp_Dispatcher -////////////////////////////////////////////////////////// class PYINTERP_EXPORT PyInterp_Dispatcher : protected QThread { PyInterp_Dispatcher(); // private constructor diff --git a/src/SALOME_PY/SalomePy.cxx b/src/SALOME_PY/SalomePy.cxx index 69ef49106..c12d61c24 100755 --- a/src/SALOME_PY/SalomePy.cxx +++ b/src/SALOME_PY/SalomePy.cxx @@ -45,15 +45,15 @@ using namespace std; -////////////////////////////////////////////////////////////////////////////// -// VSR : 19.04.05 : Reimplemented for new SALOME GUI (SUIT-based) -// All methods are implemented using Event mechanism: -// - getRenderer() -// - getRenderWindow() -// - getRenderWindowInteractor() -// These methods open new VTK viewer if there is no one opened. -// In case of error methods return None object in Python. -////////////////////////////////////////////////////////////////////////////// +/*! + VSR : 19.04.05 : Reimplemented for new SALOME GUI (SUIT-based) + All methods are implemented using Event mechanism: + - getRenderer() + - getRenderWindow() + - getRenderWindowInteractor() + These methods open new VTK viewer if there is no one opened. + In case of error methods return None object in Python. +*/ static PyObject* GetPyClass(const char* theClassName){ static PyObject *aVTKModule = NULL; diff --git a/src/SALOME_SWIG/SALOMEGUI_Swig.cxx b/src/SALOME_SWIG/SALOMEGUI_Swig.cxx index 5052bdce5..ea767e60b 100644 --- a/src/SALOME_SWIG/SALOMEGUI_Swig.cxx +++ b/src/SALOME_SWIG/SALOMEGUI_Swig.cxx @@ -53,22 +53,22 @@ using namespace std; -////////////////////////////////////////////////////////////////////////////// -// asv : 3.12.04 : added checking for NULL GUI objects in almost all methods. -// In the scope of fixing bug PAL6869. -////////////////////////////////////////////////////////////////////////////// -// (PR : modify comments) -// Instance of this class is created every time "import salome" line is typed -// - in IAPP embedded Python interpretor (SALOME_Session_Server executable), -// - in inline Python nodes in Supervisor (in SALOME_Container executable), -// - in stand-alone Python console outside any executable. -// SALOME GUI(desktop and other objects) is only available in SALOME_Session_Server -////////////////////////////////////////////////////////////////////////////// -// VSR : 19.04.05 : Reimplemented for new SALOME GUI (SUIT-based) -// All methods are implemeted using Event mechanism. -// Display/Erase methods use SALOME_Prs/SALOME_View mechanism. It is currently -// implemented only for OCC and VTK viewers. -////////////////////////////////////////////////////////////////////////////// +/*! + asv : 3.12.04 : added checking for NULL GUI objects in almost all methods. + In the scope of fixing bug PAL6869. + + (PR : modify comments) + Instance of this class is created every time "import salome" line is typed + - in IAPP embedded Python interpretor (SALOME_Session_Server executable), + - in inline Python nodes in Supervisor (in SALOME_Container executable), + - in stand-alone Python console outside any executable. + SALOME GUI(desktop and other objects) is only available in SALOME_Session_Server + + VSR : 19.04.05 : Reimplemented for new SALOME GUI (SUIT-based) + All methods are implemeted using Event mechanism. + Display/Erase methods use SALOME_Prs/SALOME_View mechanism. It is currently + implemented only for OCC and VTK viewers. +*/ /*! getApplication() @@ -120,6 +120,10 @@ public: myResult = (bool)( getApplication() && getApplication()->desktop() ); } }; + +/*! + \return true if GUI is available. +*/ bool SALOMEGUI_Swig::hasDesktop() { return ProcessEvent( new THasDesktopEvent() ); @@ -160,6 +164,10 @@ public: } } }; + +/*! + \return active study's ID or 0 if there is no active study. +*/ int SALOMEGUI_Swig::getActiveStudyId() { return ProcessEvent( new TGetActiveStudyIdEvent() ); @@ -180,6 +188,10 @@ public: } } }; + +/*! + \return active study's name or NULL if there is no active study. +*/ const char* SALOMEGUI_Swig::getActiveStudyName() { string result = ProcessEvent( new TGetActiveStudyNameEvent() ); @@ -200,6 +212,10 @@ public: myResult = anApp->namingService()->Resolve("/Kernel/ModulCatalog"); } }; + +/*! + \return the name of the component by its user name. +*/ const char* SALOMEGUI_Swig::getComponentName( const char* componentUserName ) { CORBA::Object_var anObject = ProcessEvent(new TGetModulCatalogEvent()); @@ -259,6 +275,10 @@ public: } } }; + +/*! + \return the number of selected objects. +*/ int SALOMEGUI_Swig::SelectedCount() { return ProcessEvent( new TSelectedCountEvent() ); @@ -296,6 +316,10 @@ public: } } }; + +/*! + \return the selected object entry by the given index. +*/ const char* SALOMEGUI_Swig::getSelected( int index ) { QString result = ProcessEvent( new TGetSelectedEvent( index ) ); @@ -536,6 +560,11 @@ public: } } }; + +/*! + \return TRUE if the object with given entry is in the current viewer. + VSR: For the current moment implemented for OCC and VTK viewers only. +*/ bool SALOMEGUI_Swig::IsInCurrentView( const char* theEntry ) { return ProcessEvent( new TIsInViewerEvent( theEntry ) ); diff --git a/src/SUITApp/SUITApp_Application.cxx b/src/SUITApp/SUITApp_Application.cxx index 744d84acc..84f267953 100644 --- a/src/SUITApp/SUITApp_Application.cxx +++ b/src/SUITApp/SUITApp_Application.cxx @@ -31,6 +31,9 @@ #include #endif +/*! + Constructor +*/ SUITApp_Application::SUITApp_Application( int& argc, char** argv, SUIT_ExceptionHandler* hand ) : QApplication( argc, argv ), myExceptHandler( hand ) @@ -45,6 +48,9 @@ myExceptHandler( hand ) delete strTbl; } +/*! + Constructor +*/ SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand ) : QApplication( argc, argv, type ), myExceptHandler( hand ) @@ -54,17 +60,30 @@ myExceptHandler( hand ) installTranslator( strTbl ); } +/*! + Sends event to receiver + \return the value that is returned from the receiver's event handler + \param e - event + \param receiver - receiver +*/ bool SUITApp_Application::notify( QObject* receiver, QEvent* e ) { return myExceptHandler ? myExceptHandler->handle( receiver, e ) : QApplication::notify( receiver, e ); } +/*! + Changes exception handler + \param hand - new handler +*/ void SUITApp_Application::setHandler( SUIT_ExceptionHandler* hand ) { myExceptHandler = hand; } +/*! + \return exception handler +*/ SUIT_ExceptionHandler* SUITApp_Application::handler() const { return myExceptHandler; diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index 6cdfca241..21b032c31 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -176,7 +176,9 @@ SetStoreMapping(bool theStoreMapping) } - +/*! + \return time of modification +*/ unsigned long int SVTK_DeviceActor ::GetMTime() @@ -207,14 +209,20 @@ SVTK_DeviceActor myTransformFilter->SetTransform(theTransform); } - +/*! + \return true if actor is shrinkable +*/ bool SVTK_DeviceActor ::IsShrunkable() { return myIsShrinkable; } - + +/*! + Changes shrinkable state of actor + theIsShrinkable - new shrinkable state +*/ void SVTK_DeviceActor ::SetShrinkable(bool theIsShrinkable) @@ -222,6 +230,9 @@ SVTK_DeviceActor myIsShrinkable = theIsShrinkable; } +/*! + \return true if actor is shrunkable +*/ bool SVTK_DeviceActor ::IsShrunk() @@ -229,6 +240,9 @@ SVTK_DeviceActor return myIsShrunk; } +/*! + Insert shrink filter into pipeline +*/ void SVTK_DeviceActor ::SetShrink() @@ -243,6 +257,9 @@ SVTK_DeviceActor } } +/*! + Remove shrink filter from pipeline +*/ void SVTK_DeviceActor ::UnShrink() @@ -255,6 +272,9 @@ SVTK_DeviceActor } } +/*! + \return shrink factor +*/ vtkFloatingPointType SVTK_DeviceActor ::GetShrinkFactor() @@ -262,6 +282,10 @@ SVTK_DeviceActor return myShrinkFilter->GetShrinkFactor(); } +/*! + Changes shrink factor + \param theValue - new shrink factor +*/ void SVTK_DeviceActor ::SetShrinkFactor(vtkFloatingPointType theValue) @@ -270,7 +294,10 @@ SVTK_DeviceActor } - +/*! + Set representation (VTK_SURFACE, VTK_POINTS, VTK_WIREFRAME and so on) + param theMode - new mode +*/ void SVTK_DeviceActor ::SetRepresentation(SVTK::Representation::Type theMode) @@ -322,6 +349,9 @@ SVTK_DeviceActor myRepresentation = theMode; } +/*! + \return current representation mode +*/ SVTK::Representation::Type SVTK_DeviceActor ::GetRepresentation() @@ -329,6 +359,9 @@ SVTK_DeviceActor return myRepresentation; } +/*! + \return default point size +*/ vtkFloatingPointType SVTK_DeviceActor ::GetDefaultPointSize() @@ -336,6 +369,9 @@ SVTK_DeviceActor return 5; } +/*! + \return default line width +*/ vtkFloatingPointType SVTK_DeviceActor ::GetDefaultLineWidth() @@ -343,7 +379,9 @@ SVTK_DeviceActor return 3; } - +/*! + \return true if actor is shaded +*/ bool SVTK_DeviceActor ::IsShaded() @@ -351,6 +389,10 @@ SVTK_DeviceActor return myIsShaded; } +/*! + Sets shaded state of actor + \param theShaded - new shaded state +*/ void SVTK_DeviceActor ::SetShaded(bool theShaded) @@ -358,7 +400,9 @@ SVTK_DeviceActor myIsShaded = theShaded; } - +/*! + Maps VTK index of a node to corresponding object index +*/ int SVTK_DeviceActor ::GetNodeObjId(int theVtkID) @@ -366,6 +410,9 @@ SVTK_DeviceActor return theVtkID; } +/*! + Get coordinates of a node for given object index +*/ vtkFloatingPointType* SVTK_DeviceActor ::GetNodeCoord(int theObjID) @@ -374,6 +421,9 @@ SVTK_DeviceActor } +/*! + Get corresponding #vtkCell for given object index +*/ vtkCell* SVTK_DeviceActor ::GetElemCell(int theObjID) @@ -381,6 +431,9 @@ SVTK_DeviceActor return GetInput()->GetCell(theObjID); } +/*! + Maps VTK index of a cell to corresponding object index +*/ int SVTK_DeviceActor ::GetElemObjId(int theVtkID) @@ -388,7 +441,9 @@ SVTK_DeviceActor return theVtkID; } - +/*! + Renders actor +*/ void SVTK_DeviceActor ::Render(vtkRenderer *ren, vtkMapper* m) @@ -410,7 +465,10 @@ SVTK_DeviceActor } } - +/*! + Set polygon offset parameters + \param factor, units - Opengl polygon offset parameters +*/ void SVTK_DeviceActor ::SetPolygonOffsetParameters(vtkFloatingPointType factor, @@ -420,6 +478,10 @@ SVTK_DeviceActor myPolygonOffsetUnits = units; } +/*! + Get polygon offset parameters + \param factor, units - Opengl polygon offset parameters +*/ void SVTK_DeviceActor ::GetPolygonOffsetParameters(vtkFloatingPointType& factor, diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index 50d12ef45..4921f63f9 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -109,6 +109,9 @@ QVTK_RenderWindowInteractor } +/*! + \return corresponding render window interactor +*/ vtkGenericRenderWindowInteractor* QVTK_RenderWindowInteractor ::GetDevice() @@ -116,6 +119,9 @@ QVTK_RenderWindowInteractor return myDevice.GetPointer(); } +/*! + \return corresponding render window +*/ vtkRenderWindow* QVTK_RenderWindowInteractor ::getRenderWindow() @@ -169,6 +175,9 @@ QVTK_RenderWindowInteractor GetDevice()->UpdateSize(w,h); } +/*! + Custom paint event handler +*/ void QVTK_RenderWindowInteractor ::paintEvent( QPaintEvent* theEvent ) @@ -177,6 +186,9 @@ QVTK_RenderWindowInteractor } +/*! + Custom resize event handler +*/ void QVTK_RenderWindowInteractor ::resizeEvent( QResizeEvent* theEvent ) @@ -208,12 +220,18 @@ QVTK_RenderWindowInteractor } + +/*! + Custom context menu event handler +*/ void QVTK_RenderWindowInteractor ::contextMenuEvent( QContextMenuEvent* event ) {} - +/*! + Custom mouse move event handler +*/ void QVTK_RenderWindowInteractor ::mouseMoveEvent( QMouseEvent* event ) @@ -226,6 +244,9 @@ QVTK_RenderWindowInteractor } +/*! + Custom mouse press event handler +*/ void QVTK_RenderWindowInteractor ::mousePressEvent( QMouseEvent* event ) @@ -243,6 +264,9 @@ QVTK_RenderWindowInteractor } +/*! + Custom mouse release event handler +*/ void QVTK_RenderWindowInteractor ::mouseReleaseEvent( QMouseEvent *event ) @@ -261,12 +285,18 @@ QVTK_RenderWindowInteractor } +/*! + Custom mouse double click event handler +*/ void QVTK_RenderWindowInteractor ::mouseDoubleClickEvent( QMouseEvent* event ) {} +/*! + Custom mouse wheel event handler +*/ void QVTK_RenderWindowInteractor ::wheelEvent( QWheelEvent* event ) @@ -276,6 +306,9 @@ QVTK_RenderWindowInteractor } +/*! + Custom key press event handler +*/ void QVTK_RenderWindowInteractor ::keyPressEvent( QKeyEvent* event ) @@ -287,6 +320,9 @@ QVTK_RenderWindowInteractor GetDevice()->CharEvent(); } +/*! + Custom key release event handler +*/ void QVTK_RenderWindowInteractor ::keyReleaseEvent( QKeyEvent * event ) @@ -298,6 +334,9 @@ QVTK_RenderWindowInteractor } +/*! + Custom enter event handler +*/ void QVTK_RenderWindowInteractor ::enterEvent( QEvent* event ) @@ -309,6 +348,9 @@ QVTK_RenderWindowInteractor GetDevice()->EnterEvent(); } +/*! + Custom leave event handler +*/ void QVTK_RenderWindowInteractor ::leaveEvent( QEvent * ) @@ -454,6 +496,10 @@ SVTK_RenderWindowInteractor return GetRenderer()->GetDevice(); } +/*! + Changes renderer + \param theRenderer - new renderer +*/ void SVTK_RenderWindowInteractor ::SetRenderer(SVTK_Renderer* theRenderer) @@ -471,6 +517,10 @@ SVTK_RenderWindowInteractor } +/*! + Changes interactor style + \param theStyle - new interactor style +*/ void SVTK_RenderWindowInteractor ::InitInteractorStyle(vtkInteractorStyle* theStyle) @@ -525,6 +575,10 @@ SVTK_RenderWindowInteractor } +/*! + Changes selector + \param theSelector - new selector +*/ void SVTK_RenderWindowInteractor ::SetSelector(SVTK_Selector* theSelector) @@ -580,6 +634,9 @@ SVTK_RenderWindowInteractor } +/*! + Emits signal selectionChanged() +*/ void SVTK_RenderWindowInteractor ::onEmitSelectionChanged() @@ -588,6 +645,9 @@ SVTK_RenderWindowInteractor } +/*! + Custom mouse move event handler +*/ void SVTK_RenderWindowInteractor ::mouseMoveEvent( QMouseEvent* event ) @@ -599,6 +659,9 @@ SVTK_RenderWindowInteractor } +/*! + Custom mouse press event handler +*/ void SVTK_RenderWindowInteractor ::mousePressEvent( QMouseEvent* event ) @@ -610,6 +673,9 @@ SVTK_RenderWindowInteractor } +/*! + Custom mouse release event handler +*/ void SVTK_RenderWindowInteractor ::mouseReleaseEvent( QMouseEvent *event ) @@ -621,6 +687,9 @@ SVTK_RenderWindowInteractor } +/*! + Custom mouse double click event handler +*/ void SVTK_RenderWindowInteractor ::mouseDoubleClickEvent( QMouseEvent* event ) @@ -632,6 +701,9 @@ SVTK_RenderWindowInteractor } +/*! + Custom mouse wheel event handler +*/ void SVTK_RenderWindowInteractor ::wheelEvent( QWheelEvent* event ) @@ -647,7 +719,9 @@ SVTK_RenderWindowInteractor emit WheelMoved( event ); } - +/*! + Custom key press event handler +*/ void SVTK_RenderWindowInteractor ::keyPressEvent( QKeyEvent* event ) @@ -658,6 +732,9 @@ SVTK_RenderWindowInteractor emit KeyPressed( event ); } +/*! + Custom key release event handler +*/ void SVTK_RenderWindowInteractor ::keyReleaseEvent( QKeyEvent * event ) @@ -668,6 +745,9 @@ SVTK_RenderWindowInteractor emit KeyReleased( event ); } +/*! + Custom context menu event handler +*/ void SVTK_RenderWindowInteractor ::contextMenuEvent( QContextMenuEvent* event ) diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index e379b90b1..853ad34ca 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -373,6 +373,9 @@ CheckBndBox(const vtkFloatingPointType theBounds[6]) return false; } +/*! + Adjusts size of actors +*/ bool SVTK_Renderer ::OnAdjustActors() @@ -444,6 +447,9 @@ SVTK_Renderer return false; } +/*! + Adjusts size of actors +*/ void SVTK_Renderer ::AdjustActors() @@ -452,6 +458,12 @@ SVTK_Renderer ::ResetCameraClippingRange(GetDevice()); } +/*! + Set size of the trihedron + \param theSize - new size + \param theRelative - if it is true, then size is mesured in percents from bounding box of the scene, + otherwise - in viewer units +*/ void SVTK_Renderer ::SetTrihedronSize(int theSize, const bool theRelative) @@ -463,6 +475,9 @@ SVTK_Renderer } } +/*! + \return size of the trihedron in percents from bounding box of the scene +*/ int SVTK_Renderer ::GetTrihedronSize() const @@ -470,6 +485,9 @@ SVTK_Renderer return myTrihedronSize; } +/*! + \return true if the size of the trihedron is relative +*/ bool SVTK_Renderer ::IsTrihedronRelative() const @@ -477,6 +495,9 @@ SVTK_Renderer return myIsTrihedronRelative; } +/*! + \return trihedron control +*/ VTKViewer_Trihedron* SVTK_Renderer ::GetTrihedron() @@ -484,6 +505,9 @@ SVTK_Renderer return myTrihedron.GetPointer(); } +/*! + \return true if trihedron is displayed +*/ bool SVTK_Renderer ::IsTrihedronDisplayed() @@ -491,6 +515,9 @@ SVTK_Renderer return myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn; } +/*! + Toggle trihedron visibility +*/ void SVTK_Renderer ::OnViewTrihedron() @@ -501,6 +528,9 @@ SVTK_Renderer myTrihedron->VisibilityOn(); } +/*! + Adjust size of the trihedron to the bounding box of the scene +*/ void SVTK_Renderer ::OnAdjustTrihedron() @@ -508,7 +538,9 @@ SVTK_Renderer AdjustActors(); } - +/*! + \return graduated rules control +*/ SVTK_CubeAxesActor2D* SVTK_Renderer ::GetCubeAxes() @@ -516,6 +548,9 @@ SVTK_Renderer return myCubeAxes.GetPointer(); } +/*! + \return true if graduated rules displayed +*/ bool SVTK_Renderer ::IsCubeAxesDisplayed() @@ -523,6 +558,9 @@ SVTK_Renderer return myCubeAxes->GetVisibility() == 1; } +/*! + Toggle graduated rules visibility +*/ void SVTK_Renderer ::OnViewCubeAxes() @@ -533,6 +571,9 @@ SVTK_Renderer myCubeAxes->VisibilityOn(); } +/*! + Adjust size of the graduated rules to the bounding box of the scene +*/ void SVTK_Renderer ::OnAdjustCubeAxes() @@ -540,7 +581,9 @@ SVTK_Renderer AdjustActors(); } - +/*! + Sets camera into predefined state +*/ void SVTK_Renderer ::OnResetView() @@ -571,7 +614,9 @@ SVTK_Renderer aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale()); } - +/*! + Fit all presentation in the scene into the window +*/ void SVTK_Renderer ::OnFitAll() @@ -610,7 +655,9 @@ SVTK_Renderer ::ResetCameraClippingRange(GetDevice()); } - +/*! + Reset camera clipping range to adjust the range to the bounding box of the scene +*/ void SVTK_Renderer ::OnResetClippingRange() @@ -619,7 +666,9 @@ SVTK_Renderer ::ResetCameraClippingRange(GetDevice()); } - +/*! + To reset direction of the camera to front view +*/ void SVTK_Renderer ::OnFrontView() @@ -631,6 +680,9 @@ SVTK_Renderer this->OnFitAll(); } +/*! + To reset direction of the camera to back view +*/ void SVTK_Renderer ::OnBackView() @@ -642,6 +694,9 @@ SVTK_Renderer this->OnFitAll(); } +/*! + To reset direction of the camera to top view +*/ void SVTK_Renderer ::OnTopView() @@ -653,6 +708,9 @@ SVTK_Renderer this->OnFitAll(); } +/*! + To reset direction of the camera to bottom view +*/ void SVTK_Renderer ::OnBottomView() @@ -664,6 +722,9 @@ SVTK_Renderer this->OnFitAll(); } +/*! + To reset direction of the camera to left view +*/ void SVTK_Renderer ::OnLeftView() @@ -675,6 +736,9 @@ SVTK_Renderer this->OnFitAll(); } +/*! + To reset direction of the camera to right view +*/ void SVTK_Renderer ::OnRightView() diff --git a/src/SVTK/SVTK_Selector.cxx b/src/SVTK/SVTK_Selector.cxx index 22a32c6dd..b2813a41c 100644 --- a/src/SVTK/SVTK_Selector.cxx +++ b/src/SVTK/SVTK_Selector.cxx @@ -36,6 +36,9 @@ #include +/*! + \return new SVTK_Selector +*/ SVTK_Selector* SVTK_Selector ::New() @@ -43,17 +46,26 @@ SVTK_Selector return new SVTK_SelectorDef(); } +/*! + Default constructor +*/ SVTK_SelectorDef ::SVTK_SelectorDef() { mySelectionMode = ActorSelection; } +/*! + Destructor +*/ SVTK_SelectorDef ::~SVTK_SelectorDef() { } +/*! + To invoke selectionChanged signals +*/ void SVTK_SelectorDef ::StartPickCallback() @@ -61,6 +73,9 @@ SVTK_SelectorDef this->InvokeEvent(vtkCommand::StartPickEvent,NULL); } +/*! + To invoke selectionChanged signals +*/ void SVTK_SelectorDef ::EndPickCallback() @@ -68,6 +83,9 @@ SVTK_SelectorDef this->InvokeEvent(vtkCommand::EndPickEvent,NULL); } +/*! + To change current Selection_Mode (as outside effect, it invokes selectionChange signal) +*/ void SVTK_SelectorDef ::SetSelectionMode(Selection_Mode theMode) @@ -79,6 +97,9 @@ SVTK_SelectorDef } } +/*! + Clear selection +*/ void SVTK_SelectorDef ::ClearIObjects() @@ -88,6 +109,9 @@ SVTK_SelectorDef myMapIOSubIndex.clear(); } +/*! + \return true if the SALOME_InteractiveObject presents into selection +*/ bool SVTK_SelectorDef ::IsSelected(const Handle(SALOME_InteractiveObject)& theIO) const @@ -95,6 +119,9 @@ SVTK_SelectorDef return !theIO.IsNull() && (myIObjects.find(theIO) != myIObjects.end()); } +/*! + \return true if the SALOME_Actor presents into selection +*/ bool SVTK_SelectorDef ::IsSelected(SALOME_Actor* theActor) const @@ -103,6 +130,10 @@ SVTK_SelectorDef return IsSelected(anIO) && myIO2Actors.find(anIO) != myIO2Actors.end(); } +/*! + \return corresponding SALOME_Actor for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject +*/ SALOME_Actor* SVTK_SelectorDef ::GetActor(const Handle(SALOME_InteractiveObject)& theIO) const @@ -113,6 +144,10 @@ SVTK_SelectorDef return NULL; } +/*! + Adds SALOME_InteractiveObject into selection + \param theIO - SALOME_InteractiveObject +*/ bool SVTK_SelectorDef ::AddIObject(const Handle(SALOME_InteractiveObject)& theIO) @@ -124,6 +159,10 @@ SVTK_SelectorDef return false; } +/*! + Adds SALOME_Actor into selection + \param theActor - SALOME_Actor +*/ bool SVTK_SelectorDef ::AddIObject(SALOME_Actor* theActor) @@ -141,6 +180,10 @@ SVTK_SelectorDef return !anIsIOBound || !anIsActorBound; } +/*! + Removes SALOME_InteractiveObject from selection + \param theIO - SALOME_InteractiveObject +*/ bool SVTK_SelectorDef ::RemoveIObject(const Handle(SALOME_InteractiveObject)& theIO) @@ -154,6 +197,10 @@ SVTK_SelectorDef return anIsIOBound; } +/*! + Removes SALOME_Actor from selection + \param theActor - SALOME_Actor +*/ bool SVTK_SelectorDef ::RemoveIObject(SALOME_Actor* theActor) @@ -167,6 +214,9 @@ SVTK_SelectorDef return RemoveIObject(anIO) || anIsActorBound; } +/*! + \return list of all SALOME_InteractiveObject presenting in selection +*/ const SALOME_ListIO& SVTK_SelectorDef ::StoredIObjects() const @@ -180,6 +230,9 @@ SVTK_SelectorDef return myIObjectList; } +/*! + \return number of selected objects +*/ int SVTK_SelectorDef ::IObjectCount() const @@ -187,6 +240,10 @@ SVTK_SelectorDef return myIObjects.size(); } +/*! + \return true if the SALOME_InteractiveObject has a subselection + \param theIO - SALOME_InteractiveObject +*/ bool SVTK_SelectorDef ::HasIndex( const Handle(SALOME_InteractiveObject)& theIO) const @@ -194,6 +251,10 @@ SVTK_SelectorDef return myMapIOSubIndex.find(theIO) != myMapIOSubIndex.end(); } +/*! + Gets indices of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject +*/ void SVTK_SelectorDef ::GetIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -206,6 +267,11 @@ SVTK_SelectorDef theIndex.Clear(); } +/*! + \return true if the index presents in subselection + \param theIO - SALOME_InteractiveObject + \param theIndex - index +*/ bool SVTK_SelectorDef ::IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, @@ -245,7 +311,12 @@ removeIndex(TColStd_IndexedMapOfInteger& theMapIndex, return anId; } - +/*! + Changes indices of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject + \param theIndices - indices + \param theIsModeShift - if it is false, then map will be cleared before indices are added +*/ bool SVTK_SelectorDef ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -275,6 +346,12 @@ SVTK_SelectorDef } +/*! + Changes indices of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject + \param theIndices - indices + \param theIsModeShift - if it is false, then map will be cleared before indices are added +*/ bool SVTK_SelectorDef ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -305,6 +382,12 @@ SVTK_SelectorDef } +/*! + Changes indices of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject + \param theIndex - index + \param theIsModeShift - if it is false, then map will be cleared before indices are added +*/ bool SVTK_SelectorDef ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -336,6 +419,11 @@ SVTK_SelectorDef } +/*! + Removes index of subselection for SALOME_InteractiveObject + \param theIO - SALOME_InteractiveObject + \param theIndex - index +*/ void SVTK_SelectorDef ::RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -348,6 +436,9 @@ SVTK_SelectorDef } } +/*! + Clears all indices of subselection +*/ void SVTK_SelectorDef ::ClearIndex() @@ -355,6 +446,10 @@ SVTK_SelectorDef myMapIOSubIndex.clear(); } +/*! + To apply a filter on the selection + \param theFilter - new filter +*/ void SVTK_SelectorDef ::SetFilter(const Handle(VTKViewer_Filter)& theFilter) @@ -362,6 +457,10 @@ SVTK_SelectorDef myFilters.insert(TFilters::value_type(theFilter->GetId(),theFilter)); } +/*! + \return true if filter with given number is applyed + \param theId - filter id +*/ bool SVTK_SelectorDef ::IsFilterPresent(const TFilterID theId) const @@ -369,6 +468,10 @@ SVTK_SelectorDef return myFilters.find(theId) != myFilters.end(); } +/*! + To remove a filter from the selection + \param theId - filter id +*/ void SVTK_SelectorDef ::RemoveFilter(const TFilterID theId) @@ -377,6 +480,12 @@ SVTK_SelectorDef myFilters.erase(theId); } +/*! + \return true if the index satisfy installed filters + \param theActor - actor + \param theId - filter id + \param theIsNode - whether it is node +*/ bool SVTK_SelectorDef ::IsValid(SALOME_Actor* theActor, @@ -393,6 +502,10 @@ SVTK_SelectorDef return true; } +/*! + \return filter by it's id + \param theId - filter id +*/ Handle(VTKViewer_Filter) SVTK_SelectorDef ::GetFilter(const TFilterID theId) const diff --git a/src/SVTK/SVTK_Selector.h b/src/SVTK/SVTK_Selector.h index 37ec0acb1..f476ae786 100644 --- a/src/SVTK/SVTK_Selector.h +++ b/src/SVTK/SVTK_Selector.h @@ -127,7 +127,7 @@ public: GetIndex( const Handle(SALOME_InteractiveObject)& theIO, TColStd_IndexedMapOfInteger& theIndex ) = 0; - //! Change indexes of subslection for given #SALOME_InteractiveObject + //! Change indices of subselection for given #SALOME_InteractiveObject virtual bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, @@ -154,7 +154,7 @@ public: RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, int theIndex) = 0; - //! Check, if the given index is present in subslection + //! Check, if the given index is present in subselection virtual bool IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, diff --git a/src/Style/SalomeStyle.cxx b/src/Style/SalomeStyle.cxx index 8126eb8ec..a7f0479f5 100644 --- a/src/Style/SalomeStyle.cxx +++ b/src/Style/SalomeStyle.cxx @@ -129,16 +129,25 @@ static const char* const minimize_xpm[] = { Descr: Style for SALOME platform */ +/*! + Constructor +*/ SalomeStyle::SalomeStyle() : myTitleParent( 0 ) { qApp->installEventFilter( this ); } +/*! + Destructor +*/ SalomeStyle::~SalomeStyle() { } +/*! + Delayed initialization of style +*/ void SalomeStyle::polish( QWidget* w ) { if ( !w ) @@ -182,6 +191,9 @@ void SalomeStyle::polish( QWidget* w ) PARENT_STYLE::polish( w ); } +/*! + Custom event filter +*/ bool SalomeStyle::eventFilter( QObject* o, QEvent* e ) { if ( e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut ) @@ -223,6 +235,12 @@ double linear( double x ) return x; } +/*! + Mixes two colors, part of first is 1-t, part of second is t + \param t - part parameter + \param c1, c2 - colors + \param res - result color +*/ void SalomeStyle::mix( const double t, const QColor& c1, const QColor& c2, QColor& res ) { if( t<0.0 || t>1.0 ) @@ -234,6 +252,11 @@ void SalomeStyle::mix( const double t, const QColor& c1, const QColor& c2, QColo res.setRgb( r, g, b ); } +/*! + Mixes two colors, part of first is 1-t, part of second is t + \param t - part parameter + \param rgb1, rgb2 - colors (result is stored in rgb1) +*/ void SalomeStyle::mix( const double t, QRgb& rgb1, const QRgb& rgb2 ) { if( t<0.0 || t>1.0 ) @@ -247,6 +270,12 @@ void SalomeStyle::mix( const double t, QRgb& rgb1, const QRgb& rgb2 ) rgb1 = qRgba( c[0][0], c[0][1], c[0][2], qAlpha( rgb1 ) ); } +/*! + Mixes colors of pixmap points with other color + \param t - part parameter + \param pix - pixmap to be processed + \param col - other color +*/ void SalomeStyle::mix( const double t, QPixmap& pix, const QColor& col ) { if( t<0.0 || t>1.0 ) @@ -277,6 +306,11 @@ void SalomeStyle::mix( const double t, QPixmap& pix, const QColor& col ) pix = anImage; } +/*! + Converts pixmap to grayscale + \param pix - pixmap to be processed + \param k - factor (gray value after conversion will be multiplied on it and truncated by 255.0) +*/ void SalomeStyle::toGrayscale( QPixmap& pix, double k ) { QImage anImage = pix.convertToImage(); @@ -306,6 +340,14 @@ void SalomeStyle::toGrayscale( QPixmap& pix, double k ) pix = anImage; } +/*! + Draws gradient filling + \param p - painter + \param r - rect + \param c1, c2 - two colors of gradient + \param d - direction of gradient + \param f - gradient function (maps co-ordinate to part parameter) +*/ void SalomeStyle::drawGradient( QPainter* p, const QRect& r, const QColor& c1, const QColor& c2, const Direction d, gradient_func f ) const @@ -338,6 +380,15 @@ void SalomeStyle::drawGradient( QPainter* p, const QRect& r, p->restore(); } +/*! + Draws primitive element + \param pe - type of primitive element + \param p - painter + \param r - rect + \param cg - group of colors + \param flags - is used to control how the PrimitiveElement is drawn + \param opt - can be used to control how various PrimitiveElements are drawn +*/ void SalomeStyle::drawPrimitive( PrimitiveElement pe, QPainter* p, const QRect& r, const QColorGroup& cg, SFlags flags, const QStyleOption& opt ) const { @@ -551,6 +602,16 @@ void SalomeStyle::drawPrimitive( PrimitiveElement pe, QPainter* p, const QRect& } } +/*! + Draws control element + \param element - type of control element + \param p - painter + \param widget - widget + \param r - rect + \param cg - group of colors + \param flags - is used to control how the element is drawn + \param opt - can be used to control how various elements are drawn +*/ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidget* widget, const QRect& r, const QColorGroup& cg, SFlags flags, const QStyleOption& opt ) const { @@ -1058,6 +1119,11 @@ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidge } } +/*! + \return the sub-area for the widget in logical coordinates + \param subrect - type of sub area + \param w - widget +*/ QRect SalomeStyle::subRect( SubRect subrect, const QWidget* w ) const { QRect r = PARENT_STYLE::subRect( subrect, w ); @@ -1076,6 +1142,16 @@ QRect SalomeStyle::subRect( SubRect subrect, const QWidget* w ) const return r; } +/*! + Draws the ComplexControl + \param control - type of complex control element + \param p - painter + \param widget - widget + \param r - rect + \param cg - group of colors + \param flags, controls, active - is used to control how the element is drawn + \param opt - can be used to control how various elements are drawn +*/ void SalomeStyle::drawComplexControl( ComplexControl control, QPainter* p, const QWidget* widget, const QRect& r, const QColorGroup& cg, SFlags flags, SCFlags controls, SCFlags active, const QStyleOption& opt ) const @@ -1127,6 +1203,12 @@ void SalomeStyle::drawComplexControl( ComplexControl control, QPainter* p, const } } +/*! + \return pixmap by type + \param st - type of pixmap + \param w - widget + \param opt - style option flags +*/ QPixmap SalomeStyle::stylePixmap( StylePixmap st, const QWidget* w, const QStyleOption& opt ) const { switch ( st ) @@ -1145,6 +1227,11 @@ QPixmap SalomeStyle::stylePixmap( StylePixmap st, const QWidget* w, const QStyle } } +/*! + \return the pixel size + \param pm - type of pixel metrics + \param widget - widget +*/ int SalomeStyle::pixelMetric( PixelMetric pm, const QWidget* widget ) const { int ret = 0; @@ -1186,6 +1273,12 @@ int SalomeStyle::pixelMetric( PixelMetric pm, const QWidget* widget ) const return ret; } +/*! + \return corrected title text + \param txt - title text + \param w - possible width + \param fm - font metrics +*/ QString SalomeStyle::titleText( const QString& txt, const int W, const QFontMetrics& fm ) const { QString res = txt.stripWhiteSpace(); @@ -1205,22 +1298,31 @@ QString SalomeStyle::titleText( const QString& txt, const int W, const QFontMetr /*! Class: SalomeStylePlugin [Internal] - Descr: Plugin for Qt style mechanism + Constructor */ - SalomeStylePlugin::SalomeStylePlugin() { } +/*! + Destructor +*/ SalomeStylePlugin::~SalomeStylePlugin() { } +/*! + \return keys of styles of plugin +*/ QStringList SalomeStylePlugin::keys() const { return QStringList() << "salome"; } +/*! + \return just created style + \param str - style key +*/ QStyle* SalomeStylePlugin::create( const QString& str ) { if ( str == "salome" )