From: eap Date: Fri, 11 Dec 2009 09:38:45 +0000 (+0000) Subject: untabify X-Git-Tag: WSDL_Dev_V1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2baec2662b895acd7273f5bb0ce15786b6cbf006;p=modules%2Fgui.git untabify --- diff --git a/src/CAF/CAF_Application.cxx b/src/CAF/CAF_Application.cxx index d92c181d9..0083bc22a 100755 --- a/src/CAF/CAF_Application.cxx +++ b/src/CAF/CAF_Application.cxx @@ -165,15 +165,15 @@ void CAF_Application::createActions() QtxListAction* editUndo = new QtxListAction( tr( "TOT_APP_EDIT_UNDO" ), - resMgr->loadPixmap( "STD", tr( "ICON_EDIT_UNDO" ) ), - tr( "MEN_APP_EDIT_UNDO" ), Qt::CTRL+Qt::Key_Z, desk ); + resMgr->loadPixmap( "STD", tr( "ICON_EDIT_UNDO" ) ), + tr( "MEN_APP_EDIT_UNDO" ), Qt::CTRL+Qt::Key_Z, desk ); editUndo->setStatusTip( tr( "PRP_APP_EDIT_UNDO" ) ); registerAction( EditUndoId, editUndo ); QtxListAction* editRedo = new QtxListAction( tr( "TOT_APP_EDIT_REDO" ), - resMgr->loadPixmap( "STD", tr( "ICON_EDIT_REDO" ) ), - tr( "MEN_APP_EDIT_REDO" ), Qt::CTRL+Qt::Key_Y, desk ); + resMgr->loadPixmap( "STD", tr( "ICON_EDIT_REDO" ) ), + tr( "MEN_APP_EDIT_REDO" ), Qt::CTRL+Qt::Key_Y, desk ); editRedo->setStatusTip( tr( "PRP_APP_EDIT_REDO" ) ); registerAction( EditRedoId, editRedo ); @@ -247,8 +247,8 @@ bool CAF_Application::onUndo( int numActions ) { if ( !undo( cafStudy ) ) { - ok = false; - break; + ok = false; + break; } numActions--; } @@ -275,8 +275,8 @@ bool CAF_Application::onRedo( int numActions ) { if ( !redo( cafStudy ) ) { - ok = false; - break; + ok = false; + break; } numActions--; } diff --git a/src/CAF/CAF_Study.cxx b/src/CAF/CAF_Study.cxx index fa5dd5787..3fe00aee1 100755 --- a/src/CAF/CAF_Study.cxx +++ b/src/CAF/CAF_Study.cxx @@ -379,7 +379,7 @@ bool CAF_Study::undo() } catch ( Standard_Failure ) { SUIT_MessageBox::critical(application()->desktop(), tr( "ERR_ERROR" ), - tr( "ERR_DOC_UNDO" )); + tr( "ERR_DOC_UNDO" )); return false; } return true; @@ -403,7 +403,7 @@ bool CAF_Study::redo() } catch ( Standard_Failure ) { SUIT_MessageBox::critical( application()->desktop(), tr( "ERR_ERROR" ), - tr( "ERR_DOC_REDO" ) ); + tr( "ERR_DOC_REDO" ) ); return false; } return true; diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index 0e7585504..980031237 100755 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -127,7 +127,7 @@ CAM_Module* CAM_Application::module( const QString& modName ) const { CAM_Module* mod = 0; for ( QList::const_iterator it = myModules.begin(); - it != myModules.end() && !mod; ++it ) + it != myModules.end() && !mod; ++it ) if ( (*it)->moduleName() == modName ) mod = *it; return mod; @@ -151,7 +151,7 @@ void CAM_Application::modules( CAM_Application::ModuleList& out ) const out.clear(); for ( QList::const_iterator it = myModules.begin(); - it != myModules.end(); ++it ) + it != myModules.end(); ++it ) out.append( *it ); } @@ -171,13 +171,13 @@ void CAM_Application::modules( QStringList& lst, const bool loaded ) const if ( loaded ) { for ( QList::const_iterator it = myModules.begin(); - it != myModules.end(); ++it ) + it != myModules.end(); ++it ) lst.append( (*it)->moduleName() ); } else { for ( ModuleInfoList::const_iterator it = myInfoList.begin(); - it != myInfoList.end(); ++it ) + it != myInfoList.end(); ++it ) lst.append( (*it).title ); } } @@ -202,7 +202,7 @@ void CAM_Application::addModule( CAM_Module* mod ) ModuleList newList; for ( ModuleInfoList::const_iterator it = myInfoList.begin(); - it != myInfoList.end(); ++it ) + it != myInfoList.end(); ++it ) { if ( (*it).title == mod->moduleName() ) newList.append( mod ); @@ -215,7 +215,7 @@ void CAM_Application::addModule( CAM_Module* mod ) } for ( QList::const_iterator it = myModules.begin(); - it != myModules.end(); ++it ) + it != myModules.end(); ++it ) { if ( !newList.contains( *it ) ) newList.append( *it ); @@ -244,9 +244,9 @@ void CAM_Application::loadModules() else { QString wrn = tr( "Can not load module %1" ).arg( (*it).title ); if ( desktop() && desktop()->isVisible() ) - SUIT_MessageBox::critical( desktop(), tr( "Loading modules" ), wrn ); + SUIT_MessageBox::critical( desktop(), tr( "Loading modules" ), wrn ); else - qWarning( qPrintable( wrn ) ); + qWarning( qPrintable( wrn ) ); } } } @@ -382,7 +382,7 @@ bool CAM_Application::activateModule( CAM_Module* mod ) { // .... } - } + } myModule = mod; if ( myModule ){ @@ -394,9 +394,9 @@ bool CAM_Application::activateModule( CAM_Module* mod ) myModule->setToolShown( false ); QString wrn = tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ); if ( desktop() && desktop()->isVisible() ) - SUIT_MessageBox::critical( desktop(), tr( "ERROR_TLT" ), wrn ); + SUIT_MessageBox::critical( desktop(), tr( "ERROR_TLT" ), wrn ); else - qWarning( qPrintable( wrn ) ); + qWarning( qPrintable( wrn ) ); myModule = 0; return false; } @@ -592,7 +592,7 @@ void CAM_Application::readModuleList() QStringList mods = modules.split( QRegExp( "[:|,\\s]" ), QString::SkipEmptyParts ); for ( int i = 0; i < mods.count(); i++ ) { if ( !mods[i].trimmed().isEmpty() ) - modList.append( mods[i].trimmed() ); + modList.append( mods[i].trimmed() ); } } @@ -656,9 +656,9 @@ void CAM_Application::readModuleList() SUIT_MessageBox::warning( desktop(), tr( "Warning" ), tr( "Modules list is empty" ) ); else { - printf( "****************************************************************\n" ); - printf( "* Warning: modules list is empty.\n" ); - printf( "****************************************************************\n" ); + printf( "****************************************************************\n" ); + printf( "* Warning: modules list is empty.\n" ); + printf( "****************************************************************\n" ); } } } diff --git a/src/CAM/CAM_DataModel.cxx b/src/CAM/CAM_DataModel.cxx index a9c5142fd..dff6f3bb5 100755 --- a/src/CAM/CAM_DataModel.cxx +++ b/src/CAM/CAM_DataModel.cxx @@ -94,13 +94,13 @@ void CAM_DataModel::setRoot( const CAM_DataObject* newRoot ) if ( myRoot ) myRoot->disconnect( SIGNAL( destroyed( SUIT_DataObject* ) ), - this, SLOT( onDestroyed( SUIT_DataObject* ) ) ); + this, SLOT( onDestroyed( SUIT_DataObject* ) ) ); myRoot = (CAM_DataObject*)newRoot; if ( myRoot ) myRoot->connect( SIGNAL( destroyed( SUIT_DataObject* ) ), - this, SLOT( onDestroyed( SUIT_DataObject* ) ) ); + this, SLOT( onDestroyed( SUIT_DataObject* ) ) ); emit rootChanged( this ); } @@ -139,8 +139,8 @@ void CAM_DataModel::onDestroyed( SUIT_DataObject* obj ) \return \c true if data model is loaded successfully */ bool CAM_DataModel::open( const QString& /*name*/, - CAM_Study* /*study*/, - QStringList /*files*/ ) + CAM_Study* /*study*/, + QStringList /*files*/ ) { return true; } @@ -171,8 +171,8 @@ bool CAM_DataModel::save( QStringList& ) \return \c true if data model is saved successfully */ bool CAM_DataModel::saveAs( const QString& /*name*/, - CAM_Study* /*study*/, - QStringList& /*files*/ ) + CAM_Study* /*study*/, + QStringList& /*files*/ ) { return true; } diff --git a/src/CASCatch/CASCatch_CatchSignals.cxx b/src/CASCatch/CASCatch_CatchSignals.cxx index 90f90d55b..9d5c588f7 100644 --- a/src/CASCatch/CASCatch_CatchSignals.cxx +++ b/src/CASCatch/CASCatch_CatchSignals.cxx @@ -173,7 +173,7 @@ void CASCatch_CatchSignals::Activate() #endif act.sa_handler = (SIG_PFV) &SegvHandler ; -#ifdef SA_SIGINFO // OSF,SOLARIS,IRIX +#ifdef SA_SIGINFO // OSF,SOLARIS,IRIX act.sa_flags = act.sa_flags | SA_SIGINFO ; # ifdef SOLARIS act.sa_sigaction = (void(*)(int, siginfo_t *, void*)) &SegvHandler ; diff --git a/src/DDS/DDS_DicItem.cxx b/src/DDS/DDS_DicItem.cxx index 6a8954546..87603cd5b 100644 --- a/src/DDS/DDS_DicItem.cxx +++ b/src/DDS/DDS_DicItem.cxx @@ -199,7 +199,7 @@ Standard_Real DDS_DicItem::GetMinValue() const /*! \brief Get the minimum value of the parameter for the specified units system \a theSystem. - + Returned value is converted to SI. \param theUnitsSystem units system @@ -774,9 +774,9 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element { // Read the text in the element "value" //LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild(); - LDOM_Node aNode = aListItemValue.getFirstChild(); - const LDOM_Text& aText = (const LDOM_Text&) aNode; - LDOM_Text aListItemTxt(aText); + LDOM_Node aNode = aListItemValue.getFirstChild(); + const LDOM_Text& aText = (const LDOM_Text&) aNode; + LDOM_Text aListItemTxt(aText); if ( !aListItemTxt.isNull() ) { // adding ID and text value to sequence @@ -855,12 +855,12 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element LDOMString v = attr.getValue(); if( v.Type()==LDOMBasicString::LDOM_Integer ) { - Standard_Integer ival; - v.GetInteger( ival ); - value = TCollection_ExtendedString( ival ); + Standard_Integer ival; + v.GetInteger( ival ); + value = TCollection_ExtendedString( ival ); } else - value = ( Standard_CString )v.GetString(); + value = ( Standard_CString )v.GetString(); } else continue; @@ -894,7 +894,7 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element else if ( anUnitData.myUnits.ToCString()[0] ) // treat '%' as unit with scale 100 anUnitData.myScale = 0.01; } - catch( Standard_Failure ) { + catch( Standard_Failure ) { anUnitData.myUnits.Clear(); } diff --git a/src/Event/SALOME_Event.cxx b/src/Event/SALOME_Event.cxx index 60a5dc254..43b11026c 100755 --- a/src/Event/SALOME_Event.cxx +++ b/src/Event/SALOME_Event.cxx @@ -136,7 +136,7 @@ void SALOME_CustomEvent::setData( void* data ) \class SALOME_Event \brief The class which encapsulates data and functionality required for posting component-specific events to perform arbitrary operations - in the main GUI thread. + in the main GUI thread. SALOME_Event objects can be posted by any thread belonging to the GUI process. diff --git a/src/Event/SALOME_Event.h b/src/Event/SALOME_Event.h index 849368073..0c6fb56cf 100644 --- a/src/Event/SALOME_Event.h +++ b/src/Event/SALOME_Event.h @@ -75,7 +75,7 @@ public: TResult myResult; typedef TResult (TObject::* TAction)(); TMemFunEvent(TObject* theObject, TAction theAction, - TResult theResult = TResult()): + TResult theResult = TResult()): myObject(theObject), myAction(theAction), myResult(theResult) @@ -114,7 +114,7 @@ public: TResult myResult; typedef TResult (TObject::* TAction)(TArg); TMemFun1ArgEvent(TObject* theObject, TAction theAction, TArg theArg, - TResult theResult = TResult()): + TResult theResult = TResult()): myObject(theObject), myAction(theAction), myResult(theResult), @@ -158,8 +158,8 @@ public: TResult myResult; typedef TResult (TObject::* TAction)(TArg,TArg1); TMemFun2ArgEvent(TObject* theObject, TAction theAction, - TArg theArg, TArg1 theArg1, - TResult theResult = TResult()): + TArg theArg, TArg1 theArg1, + TResult theResult = TResult()): myObject(theObject), myAction(theAction), myResult(theResult), diff --git a/src/GLViewer/GLViewer_BaseObjects.h b/src/GLViewer/GLViewer_BaseObjects.h index 464c63049..5c5ee929b 100644 --- a/src/GLViewer/GLViewer_BaseObjects.h +++ b/src/GLViewer/GLViewer_BaseObjects.h @@ -178,7 +178,7 @@ public: //! Export numbers of highlighted/selected lines void exportNumbers( QList& high, QList& unhigh, - QList& sel, QList& unsel ); + QList& sel, QList& unsel ); //! Returns numbers of selected lines QList getSelectedElements() { return mySelNumbers; } diff --git a/src/GLViewer/GLViewer_Compass.cxx b/src/GLViewer/GLViewer_Compass.cxx index 9ceee0874..47e0fcddc 100644 --- a/src/GLViewer/GLViewer_Compass.cxx +++ b/src/GLViewer/GLViewer_Compass.cxx @@ -112,7 +112,7 @@ void GLViewer_Compass::setArrowWidthTop( const int WidthTop ) void GLViewer_Compass::setArrowWidthBottom( const int WidthBot ) { if( WidthBot > myArrowWidthTop || WidthBot < 1 ) - return; + return; myArrowWidthBottom=WidthBot; } diff --git a/src/GLViewer/GLViewer_Context.cxx b/src/GLViewer/GLViewer_Context.cxx index c839a22f0..403e694cd 100644 --- a/src/GLViewer/GLViewer_Context.cxx +++ b/src/GLViewer/GLViewer_Context.cxx @@ -210,10 +210,10 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) if ( !Append ) { for( it = mySelectedObjects.begin(), itEnd = mySelectedObjects.end() ; it != itEnd; ++it ) - if( myLastPicked != *it ) + if( myLastPicked != *it ) { - updateAll = (*it)->unselect() || updateAll; - aList.append( *it ); + updateAll = (*it)->unselect() || updateAll; + aList.append( *it ); } if( updateAll || myUpdateAll ) @@ -257,10 +257,10 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) if ( !Append ) { for( it = mySelectedObjects.begin(), itEnd = mySelectedObjects.end() ; it != itEnd; ++it ) - if ( myLastPicked != *it ) + if ( myLastPicked != *it ) { - updateAll = (*it)->unselect() || updateAll; - aList.append( *it ); + updateAll = (*it)->unselect() || updateAll; + aList.append( *it ); } if( updateAll || myUpdateAll ) diff --git a/src/GLViewer/GLViewer_Drawer.cxx b/src/GLViewer/GLViewer_Drawer.cxx index 5da2863e2..43d4c2c13 100644 --- a/src/GLViewer/GLViewer_Drawer.cxx +++ b/src/GLViewer/GLViewer_Drawer.cxx @@ -516,25 +516,25 @@ void GLViewer_Drawer::destroyAllTextures() */ void GLViewer_Drawer::setAntialiasing(const bool on) { - if (on) - { + if (on) + { glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); - glEnable(GL_POINT_SMOOTH); - glEnable(GL_LINE_SMOOTH); - glEnable(GL_POLYGON_SMOOTH); - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable (GL_BLEND); - } - else - { - glDisable(GL_POINT_SMOOTH); - glDisable(GL_LINE_SMOOTH); - glDisable(GL_POLYGON_SMOOTH); - glBlendFunc (GL_ONE, GL_ZERO); - glDisable (GL_BLEND); - } + glEnable(GL_POINT_SMOOTH); + glEnable(GL_LINE_SMOOTH); + glEnable(GL_POLYGON_SMOOTH); + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable (GL_BLEND); + } + else + { + glDisable(GL_POINT_SMOOTH); + glDisable(GL_LINE_SMOOTH); + glDisable(GL_POLYGON_SMOOTH); + glBlendFunc (GL_ONE, GL_ZERO); + glDisable (GL_BLEND); + } } /*! Loads texture from file @@ -949,7 +949,7 @@ bool GLViewer_Drawer::translateToEMF( HDC hDC, GLViewer_CoordSystem* aViewerCS, \param fillingColor - color of filling */ void GLViewer_Drawer::drawRectangle( GLViewer_Rect* rect, GLfloat lineWidth, GLfloat gap, - QColor color, bool filled, QColor fillingColor ) + QColor color, bool filled, QColor fillingColor ) { if( !rect ) return; @@ -1014,7 +1014,7 @@ void GLViewer_Drawer::drawContour( const GLViewer_PntList& pntList, QColor color \param isStripe - enables line stipple */ void GLViewer_Drawer::drawContour( GLViewer_Rect* rect, QColor color, GLfloat lineWidth, - GLushort pattern, bool isStripe ) + GLushort pattern, bool isStripe ) { float x1 = rect->left(); float x2 = rect->right(); @@ -1137,9 +1137,9 @@ void GLViewer_Drawer::drawCross( GLfloat x, GLfloat y, QColor color ) \param filled - drawn as filled */ void GLViewer_Drawer::drawArrow( const GLfloat red, const GLfloat green, const GLfloat blue, - GLfloat lineWidth, - GLfloat staff, GLfloat length, GLfloat width, - GLfloat x, GLfloat y, GLfloat angle, GLboolean filled ) + GLfloat lineWidth, + GLfloat staff, GLfloat length, GLfloat width, + GLfloat x, GLfloat y, GLfloat angle, GLboolean filled ) { GLfloat vx1 = x; GLfloat vy1 = y + staff + length; diff --git a/src/GLViewer/GLViewer_Drawer.h b/src/GLViewer/GLViewer_Drawer.h index 89a3ed58f..03c1ec8d5 100644 --- a/src/GLViewer/GLViewer_Drawer.h +++ b/src/GLViewer/GLViewer_Drawer.h @@ -236,8 +236,8 @@ public: //! Returns object priority int getPriority() const { return myPriority; } - //! The function enables and disables antialiasing in Open GL (for points, lines and polygons). - void setAntialiasing(const bool on); + //! The function enables and disables antialiasing in Open GL (for points, lines and polygons). + void setAntialiasing(const bool on); //! Clears all generated textures static void destroyAllTextures(); @@ -342,7 +342,7 @@ public: */ void drawText( const QString& text, GLfloat xPos, - GLfloat yPos, + GLfloat yPos, const QColor& color, QFont* aFont, int theSeparator, @@ -359,8 +359,8 @@ public: *\param smallFont - font format */ void drawGLText( QString text, - float x, - float y, + float x, + float y, int hPosition = GLText_Center, int vPosition = GLText_Center, QColor color = Qt::black, @@ -404,7 +404,7 @@ protected: //! Draw basic primitives: rectangle, contour, polygon, vertex, cross, arrow //* with predefined color static void drawRectangle( GLViewer_Rect*, GLfloat, GLfloat = 0, QColor = Qt::black, - bool = false, QColor = Qt::white ); + bool = false, QColor = Qt::white ); static void drawContour( GLViewer_Rect*, QColor, GLfloat, GLushort, bool ); static void drawContour( const GLViewer_PntList&, QColor, GLfloat ); static void drawPolygon( GLViewer_Rect*, QColor, GLushort, bool ); @@ -412,8 +412,8 @@ protected: static void drawVertex( GLfloat, GLfloat, QColor ); static void drawCross( GLfloat, GLfloat, QColor ); static void drawArrow( const GLfloat red, const GLfloat green, const GLfloat blue, - GLfloat, GLfloat, GLfloat, GLfloat, - GLfloat, GLfloat, GLfloat, GLboolean = GL_FALSE ); + GLfloat, GLfloat, GLfloat, GLfloat, + GLfloat, GLfloat, GLfloat, GLboolean = GL_FALSE ); //! Draw object text virtual void drawText( GLViewer_Object* theObject ); diff --git a/src/GLViewer/GLViewer_Grid.h b/src/GLViewer/GLViewer_Grid.h index 5d3f15e1d..e2dba9f47 100644 --- a/src/GLViewer/GLViewer_Grid.h +++ b/src/GLViewer/GLViewer_Grid.h @@ -58,10 +58,10 @@ public: * \param xScale and \param yScal - scale factors along x and y direction */ GLViewer_Grid( GLfloat width, GLfloat height, - GLfloat winW, GLfloat winH, - GLfloat xSize, GLfloat ySize, - GLfloat xPan, GLfloat yPan, - GLfloat xScale, GLfloat yScale ); + GLfloat winW, GLfloat winH, + GLfloat xSize, GLfloat ySize, + GLfloat xPan, GLfloat yPan, + GLfloat xScale, GLfloat yScale ); ~GLViewer_Grid(); //! Draws grid diff --git a/src/GLViewer/GLViewer_MimeData.cxx b/src/GLViewer/GLViewer_MimeData.cxx index 1fbe5e90a..345d686ac 100644 --- a/src/GLViewer/GLViewer_MimeData.cxx +++ b/src/GLViewer/GLViewer_MimeData.cxx @@ -204,7 +204,7 @@ QList GLViewer_MimeData::getObjects( QByteArray theArray, QStr for( j = 0; j < aObjNum; j++ ) { QByteArray aTempArray; - aTempArray.resize(aObjSizeList[j]); + aTempArray.resize(aObjSizeList[j]); for( ; anIndex < aCurIndex + aObjSizeList[j]; anIndex++ ) aTempArray[anIndex-aCurIndex] = theArray[anIndex]; aObjects.append( aTempArray ); diff --git a/src/GLViewer/GLViewer_Object.cxx b/src/GLViewer/GLViewer_Object.cxx index 6afe3be25..f998aefa7 100644 --- a/src/GLViewer/GLViewer_Object.cxx +++ b/src/GLViewer/GLViewer_Object.cxx @@ -168,8 +168,8 @@ QByteArray GLViewer_Object::getByteCopy() QByteArray aResult; aResult.resize( 2*anISize + sizeOf8Float + - aTypeLength + aToolTipLength + - aGLText.size() + aAspect.size() ); + aTypeLength + aToolTipLength + + aGLText.size() + aAspect.size() ); // puts 8 float values into the byte array char* aPointer = (char*)&aRectData; for( i = 0; i < sizeOf8Float; i++, aPointer++ ) diff --git a/src/GLViewer/GLViewer_Object.h b/src/GLViewer/GLViewer_Object.h index a694e88b6..b4499d38e 100644 --- a/src/GLViewer/GLViewer_Object.h +++ b/src/GLViewer/GLViewer_Object.h @@ -82,7 +82,7 @@ public: *\param isCircle - = true if sensitive area of detection is round */ virtual GLboolean highlight( GLfloat x, - GLfloat y, + GLfloat y, GLfloat tol, GLboolean isCircle = GL_FALSE ) = 0; //! Clears all highlight information diff --git a/src/GLViewer/GLViewer_ToolTip.cxx b/src/GLViewer/GLViewer_ToolTip.cxx index 0397cb122..c75d9acb4 100644 --- a/src/GLViewer/GLViewer_ToolTip.cxx +++ b/src/GLViewer/GLViewer_ToolTip.cxx @@ -48,7 +48,7 @@ GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent ) mypViewPort = theParent; //mypLabel = NULL; mypLabel = new QLabel( "Test", NULL, - Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint ); + Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint ); mypLabel->setObjectName("ObjectTipText"); mypLabel->setMargin( 1 ); //mypLabel->setAutoMask( FALSE ); @@ -146,9 +146,9 @@ bool GLViewer_ObjectTip::eventFilter( QObject* theObj, QEvent* e ) case QEvent::MouseButtonDblClick: case QEvent::KeyPress: case QEvent::KeyRelease: - // input - turn off tool tip mode - hideTipAndSleep(); - break;*/ + // input - turn off tool tip mode + hideTipAndSleep(); + break;*/ case QEvent::MouseMove: { //hideTipAndSleep(); diff --git a/src/GLViewer/GLViewer_Tools.h b/src/GLViewer/GLViewer_Tools.h index 222c27052..26e9835f5 100644 --- a/src/GLViewer/GLViewer_Tools.h +++ b/src/GLViewer/GLViewer_Tools.h @@ -39,8 +39,8 @@ class GLVIEWER_API GLViewer_Tools { public: - //GLViewer_Tools(); - //virtual ~GLViewer_Tools(); + //GLViewer_Tools(); + //virtual ~GLViewer_Tools(); //static }; diff --git a/src/GLViewer/GLViewer_ViewFrame.cxx b/src/GLViewer/GLViewer_ViewFrame.cxx index 4fa9bc876..94f705082 100644 --- a/src/GLViewer/GLViewer_ViewFrame.cxx +++ b/src/GLViewer/GLViewer_ViewFrame.cxx @@ -94,55 +94,55 @@ void GLViewer_ViewFrame::createActions() // Dump view aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_DUMP" ) ), - tr( "MNU_DUMP_VIEW" ), 0, this); + tr( "MNU_DUMP_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_DUMP_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView())); toolMgr()->registerAction( aAction, DumpId ); // FitAll aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITALL" ) ), - tr( "MNU_FITALL" ), 0, this); + tr( "MNU_FITALL" ), 0, this); aAction->setStatusTip(tr("DSC_FITALL")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll())); toolMgr()->registerAction( aAction, FitAllId ); // FitRect aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITAREA" ) ), - tr( "MNU_FITRECT" ), 0, this); + tr( "MNU_FITRECT" ), 0, this); aAction->setStatusTip(tr("DSC_FITRECT")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea())); toolMgr()->registerAction( aAction, FitRectId ); // FitSelect aAction = new QtxAction(tr("MNU_FITSELECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITSELECT" ) ), - tr( "MNU_FITSELECT" ), 0, this); + tr( "MNU_FITSELECT" ), 0, this); aAction->setStatusTip(tr("DSC_FITSELECT")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitSelect())); toolMgr()->registerAction( aAction, FitSelectId ); // Zoom aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_ZOOM" ) ), - tr( "MNU_ZOOM_VIEW" ), 0, this); + tr( "MNU_ZOOM_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_ZOOM_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom())); toolMgr()->registerAction( aAction, ZoomId ); // Panning aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_PAN" ) ), - tr( "MNU_PAN_VIEW" ), 0, this); + tr( "MNU_PAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_PAN_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan())); toolMgr()->registerAction( aAction, PanId ); // Global Panning aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_GLOBALPAN" ) ), - tr( "MNU_GLOBALPAN_VIEW" ), 0, this); + tr( "MNU_GLOBALPAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan())); toolMgr()->registerAction( aAction, GlobalPanId ); aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_RESET" ) ), - tr( "MNU_RESET_VIEW" ), 0, this); + tr( "MNU_RESET_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_RESET_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset())); toolMgr()->registerAction( aAction, ResetId ); diff --git a/src/GLViewer/GLViewer_ViewPort2d.cxx b/src/GLViewer/GLViewer_ViewPort2d.cxx index 0cd5b9371..4e4447b62 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.cxx +++ b/src/GLViewer/GLViewer_ViewPort2d.cxx @@ -1188,12 +1188,12 @@ void GLViewer_ViewPort2d::drawSelectByRect( int x, int y ) { myRectBand->hide(); /* erase */ - mypLastPoint->setX( x ); + mypLastPoint->setX( x ); mypLastPoint->setY( y ); - QRect aRect = selectionRect(); - myRectBand->setGeometry( aRect ); /* draw */ - myRectBand->setVisible( aRect.isValid() ); + QRect aRect = selectionRect(); + myRectBand->setGeometry( aRect ); /* draw */ + myRectBand->setVisible( aRect.isValid() ); } } @@ -1215,8 +1215,8 @@ void GLViewer_ViewPort2d::finishSelectByRect() mypFirstPoint = NULL; mypLastPoint = NULL; - delete myRectBand; - myRectBand = 0; + delete myRectBand; + myRectBand = 0; } } diff --git a/src/GLViewer/GLViewer_Viewer.cxx b/src/GLViewer/GLViewer_Viewer.cxx index 95647f30b..ca290be8e 100644 --- a/src/GLViewer/GLViewer_Viewer.cxx +++ b/src/GLViewer/GLViewer_Viewer.cxx @@ -873,7 +873,7 @@ void GLViewer_ViewSketcher::onSketch( SketchState state ) qAbs( myStart.x() - myCurr.x() ), qAbs( myStart.y() - myCurr.y() ) ); if ( !rect.isEmpty() ) { - if ( !sketchRect->isEmpty() && myRectBand ) + if ( !sketchRect->isEmpty() && myRectBand ) myRectBand->hide(); /* erase */ *sketchRect = rect; if ( state != Fin ) diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index d801cb642..f5d4e20ba 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -103,7 +103,7 @@ void GLViewer_Viewer2d::onChangeBgColor() return; GLViewer_ViewPort2d* vp = ( ( GLViewer_ViewPort2d* )getActiveView()->getViewPort() ); - QColor selColor = QColorDialog::getColor( vp->backgroundColor(), vp ); + QColor selColor = QColorDialog::getColor( vp->backgroundColor(), vp ); if ( selColor.isValid() ) { vp->setBackgroundColor( selColor ); } diff --git a/src/GLViewer/GLViewer_Viewer2d.h b/src/GLViewer/GLViewer_Viewer2d.h index 968aef8d3..b06ef330e 100644 --- a/src/GLViewer/GLViewer_Viewer2d.h +++ b/src/GLViewer/GLViewer_Viewer2d.h @@ -164,7 +164,7 @@ public: * output paper size \param aPType, with margins in mm */ virtual bool translateTo( VectorFileType aType, QString FileName, PaperType aPType, - double mmLeft, double mmRight, double mmTop, double mmBottom ); + double mmLeft, double mmRight, double mmTop, double mmBottom ); //bool isSketchingActive(); //int getSketchingType(); diff --git a/src/GLViewer/GLViewer_Widget.cxx b/src/GLViewer/GLViewer_Widget.cxx index 30e1fa915..2153cea3e 100644 --- a/src/GLViewer/GLViewer_Widget.cxx +++ b/src/GLViewer/GLViewer_Widget.cxx @@ -131,7 +131,7 @@ void GLViewer_Widget::setScale( GLfloat xScale, GLfloat yScale, GLfloat zScale ) \return start point of curren rotation of Window in OpenGL global scene */ void GLViewer_Widget::getRotationStart( GLfloat& rotationStartX, - GLfloat& rotationStartY, + GLfloat& rotationStartY, GLfloat& rotationStartZ ) { rotationStartX = myRotationStartX; @@ -143,7 +143,7 @@ void GLViewer_Widget::getRotationStart( GLfloat& rotationStartX, A function for installing the rotation angle of Window in OpenGL global scene in degree (Only in 2D) */ void GLViewer_Widget::setRotationStart( GLfloat rotationStartX, - GLfloat rotationStartY, + GLfloat rotationStartY, GLfloat rotationStartZ ) { myRotationStartX = rotationStartX; @@ -159,9 +159,9 @@ void GLViewer_Widget::setRotationStart( GLfloat rotationStartX, \param rotationCenterZ - center z */ void GLViewer_Widget::getRotation( GLfloat& rotationAngle, - GLfloat& rotationCenterX, - GLfloat& rotationCenterY, - GLfloat& rotationCenterZ ) + GLfloat& rotationCenterX, + GLfloat& rotationCenterY, + GLfloat& rotationCenterZ ) { rotationAngle = myRotationAngle; rotationCenterX = myRotationCenterX; @@ -177,9 +177,9 @@ void GLViewer_Widget::getRotation( GLfloat& rotationAngle, \param rotationCenterZ - center z */ void GLViewer_Widget::setRotation( GLfloat rotationAngle, - GLfloat rotationCenterX, - GLfloat rotationCenterY, - GLfloat rotationCenterZ ) + GLfloat rotationCenterX, + GLfloat rotationCenterY, + GLfloat rotationCenterZ ) { myRotationAngle = rotationAngle; myRotationCenterX = rotationCenterX; @@ -488,20 +488,20 @@ void AddImagePart( QFile& hFile, QImage& image, int w1, int w2, int h1, int h2, { uchar* theCurLine = image.scanLine( i ), cur; for( int j=w1; j<=w2; j++ ) - for( int k=0; k<3; k++ ) - { - cur = *(theCurLine+4*j+2-k); - *(line+cur_index) = hex( cur/16 ); //HI - *(line+cur_index+1) = hex( cur%16 ); //LO - full++; - cur_index+=2; - if( cur_index>=80 ) - { - aBuffer += line; - aBuffer += "\n"; - cur_index = 0; - } - } + for( int k=0; k<3; k++ ) + { + cur = *(theCurLine+4*j+2-k); + *(line+cur_index) = hex( cur/16 ); //HI + *(line+cur_index+1) = hex( cur%16 ); //LO + full++; + cur_index+=2; + if( cur_index>=80 ) + { + aBuffer += line; + aBuffer += "\n"; + cur_index = 0; + } + } } aBuffer += "> false 3 colorimage\n\n"; diff --git a/src/GLViewer/GLViewer_Widget.h b/src/GLViewer/GLViewer_Widget.h index 5a4d428e8..f073b7fd5 100644 --- a/src/GLViewer/GLViewer_Widget.h +++ b/src/GLViewer/GLViewer_Widget.h @@ -63,11 +63,11 @@ public: //! Returns scales on OpenGL scene along 3 directions /*! in 2d scene zScale = 1.0 */ void getScale( GLfloat& xScale, - GLfloat& yScale, - GLfloat& zScale ); + GLfloat& yScale, + GLfloat& zScale ); //! A function for installing the scales of OpenGL scene void setScale( GLfloat xScale, - GLfloat yScale, + GLfloat yScale, GLfloat zScaleGLfloat ); //! Returns offset parameters of Window in OpenGL global scene @@ -84,17 +84,17 @@ public: //! Returns start point of curren rotation of Window in OpenGL global scene void getRotationStart( GLfloat& rotationStartX, - GLfloat& rotationStartY, - GLfloat& rotationStartZ ); + GLfloat& rotationStartY, + GLfloat& rotationStartZ ); //! A function for installing the start point of curren rotation of Window in OpenGL global scene void setRotationStart( GLfloat rotationStartX, - GLfloat rotationStartY, - GLfloat rotationStartZ ); + GLfloat rotationStartY, + GLfloat rotationStartZ ); //! Returns parameters of current rotation void getRotation( GLfloat& rotationAngle, - GLfloat& rotationCenterX, - GLfloat& rotationCenterY, - GLfloat& rotationCenterZ ); + GLfloat& rotationCenterX, + GLfloat& rotationCenterY, + GLfloat& rotationCenterZ ); //! A function for installing the parameters of current rotation void setRotation( GLfloat, GLfloat, GLfloat, GLfloat ); diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 2b524699c..c08d3db60 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -174,7 +174,7 @@ static const char* imageEmptyIcon[] = { "20 20 1 1", -". c None", +". c None", "....................", "....................", "....................", @@ -307,11 +307,11 @@ LightApp_Application::LightApp_Application() { aFamily = *it; if ( famdb.contains(aFamily) ) - { - f.setFamily( aFamily ); - aResMgr->setValue( "PyConsole", "font", f ); - break; - } + { + f.setFamily( aFamily ); + aResMgr->setValue( "PyConsole", "font", f ); + break; + } } } @@ -369,16 +369,16 @@ QString LightApp_Application::applicationVersion() const if ( vf.open( QIODevice::ReadOnly ) ) { QString line( vf.readLine( 1024 ) ); - vf.close(); + vf.close(); - if ( !line.isEmpty() ) + if ( !line.isEmpty() ) { - while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) ) - line.remove( line.length() - 1, 1 ); + while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) ) + line.remove( line.length() - 1, 1 ); - int idx = line.lastIndexOf( ":" ); - if ( idx != -1 ) - _app_version = line.mid( idx + 1 ).trimmed(); + int idx = line.lastIndexOf( ":" ); + if ( idx != -1 ) + _app_version = line.mid( idx + 1 ).trimmed(); } } } @@ -443,9 +443,9 @@ void LightApp_Application::createActionForViewer( const int id, const int accel ) { QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), QIcon(), - tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), - tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), - accel, desktop(), false, this, SLOT( onNewWindow() ) ); + tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), + tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), + accel, desktop(), false, this, SLOT( onNewWindow() ) ); createMenu( a, parentId, -1 ); } @@ -459,8 +459,8 @@ void LightApp_Application::createActions() //! Preferences createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIcon(), - tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ), - Qt::CTRL+Qt::Key_R, desk, false, this, SLOT( onPreferences() ) ); + tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ), + Qt::CTRL+Qt::Key_R, desk, false, this, SLOT( onPreferences() ) ); //! Help for modules int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 ); @@ -487,14 +487,14 @@ void LightApp_Application::createActions() QStringList idxLst = QStringList() << modDir << "share" << "doc" << "salome" << "gui" << modName << "index.html"; QString indexFile = idxLst.join( QDir::separator() ); // index file if ( QFile::exists( indexFile ) ) { - QAction* a = createAction( id, tr( "%1 Help" ).arg( aModule ), - resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ), - tr( "%1 Help" ).arg( aModule ), - tr( "%1 Help" ).arg( aModule ), - 0, desk, false, this, SLOT( onHelpContentsModule() ) ); - a->setData( indexFile ); - createMenu( a, helpModuleMenu, -1 ); - id++; + QAction* a = createAction( id, tr( "%1 Help" ).arg( aModule ), + resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ), + tr( "%1 Help" ).arg( aModule ), + tr( "%1 Help" ).arg( aModule ), + 0, desk, false, this, SLOT( onHelpContentsModule() ) ); + a->setData( indexFile ); + createMenu( a, helpModuleMenu, -1 ); + id++; } } } @@ -542,10 +542,10 @@ void LightApp_Application::createActions() QPixmap icon = resMgr->loadPixmap( modName, iconName, false ); if ( icon.isNull() ) { - icon = modIcon; - INFOS ( "****************************************************************" << std::endl - << "* Icon for " << (*it).toLatin1().constData() << " not found. Using the default one." << std::endl - << "****************************************************************" << std::endl ); + icon = modIcon; + INFOS ( "****************************************************************" << std::endl + << "* Icon for " << (*it).toLatin1().constData() << " not found. Using the default one." << std::endl + << "****************************************************************" << std::endl ); } icon = Qtx::scaleIcon( icon, iconSize ); @@ -593,7 +593,7 @@ void LightApp_Application::createActions() #endif createAction( RenameId, tr( "TOT_RENAME" ), QIcon(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ), - Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) ); + Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) ); createMenu( RenameId, windowMenu, -1 ); int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 ); @@ -643,9 +643,9 @@ void LightApp_Application::onModuleActivation( const QString& modName ) putInfo( tr("INF_CANCELLED") ); LightApp_ModuleAction* moduleAction = - qobject_cast( action( ModulesListId ) ); + qobject_cast( action( ModulesListId ) ); if ( moduleAction ) - moduleAction->setActiveModule( QString() ); + moduleAction->setActiveModule( QString() ); cancelled = true; } } @@ -839,10 +839,10 @@ class RunBrowser: public QThread { public: RunBrowser( LightApp_Application* app, - const QString& theApp, - const QString& theParams, - const QString& theHelpFile, - const QString& theContext = QString() ) + const QString& theApp, + const QString& theParams, + const QString& theHelpFile, + const QString& theContext = QString() ) : myApp( theApp ), myParams( theParams ), #ifdef WIN32 @@ -861,16 +861,16 @@ public: if ( !myApp.isEmpty()) { QString aCommand = QString( "%1 %2 %3" ).arg( myApp, myParams, myHelpFile ); if ( !myContext.isEmpty() ) - aCommand += "#" + myContext; + aCommand += "#" + myContext; QProcess* proc = new QProcess(); proc->start( aCommand ); if ( !proc->waitForStarted() ) { - SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 ); - QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) ); - ce2000->setData( msg ); - QApplication::postEvent( myLApp, ce2000 ); + SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 ); + QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) ); + ce2000->setData( msg ); + QApplication::postEvent( myLApp, ce2000 ); } } } @@ -916,8 +916,8 @@ void LightApp_Application::onHelpContentsModule() else { if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No, - SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes ) + SUIT_MessageBox::Yes | SUIT_MessageBox::No, + SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes ) showPreferences( tr( "PREF_APP" ) ); } @@ -927,34 +927,34 @@ void LightApp_Application::onHelpContentsModule() SLOT: Displays help contents for choosen dialog */ void LightApp_Application::onHelpContextModule( const QString& theComponentName, - const QString& theFileName, - const QString& theContext ) + const QString& theFileName, + const QString& theContext ) { QString homeDir = ""; if ( !theComponentName.isEmpty() ) { QString dir = getenv( ( theComponentName + "_ROOT_DIR" ).toLatin1().constData() ); if ( !dir.isEmpty() ) homeDir = Qtx::addSlash( Qtx::addSlash( dir ) + - Qtx::addSlash( "share" ) + - Qtx::addSlash( "doc" ) + - Qtx::addSlash( "salome" ) + - Qtx::addSlash( "gui" ) + - Qtx::addSlash( theComponentName ) ); + Qtx::addSlash( "share" ) + + Qtx::addSlash( "doc" ) + + Qtx::addSlash( "salome" ) + + Qtx::addSlash( "gui" ) + + Qtx::addSlash( theComponentName ) ); } QString helpFile = QFileInfo( homeDir + theFileName ).absoluteFilePath(); SUIT_ResourceMgr* resMgr = resourceMgr(); - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif - QString anApp = resMgr->stringValue("ExternalBrowser", platform); + QString anApp = resMgr->stringValue("ExternalBrowser", platform); #ifdef WIN32 - QString quote("\""); - anApp.prepend( quote ); - anApp.append( quote ); + QString quote("\""); + anApp.prepend( quote ); + anApp.append( quote ); #endif QString aParams = resMgr->stringValue("ExternalBrowser", "parameters"); @@ -966,8 +966,8 @@ void LightApp_Application::onHelpContextModule( const QString& theComponentName, else { if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No, - SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes ) + SUIT_MessageBox::Yes | SUIT_MessageBox::No, + SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes ) showPreferences( tr( "PREF_APP" ) ); } } @@ -1032,8 +1032,8 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st f = resourceMgr()->fontValue( "PyConsole", "font" ); else { - f = ( ( PyConsole_Console* )wid )->font(); - resourceMgr()->setValue( "PyConsole", "font", f ); + f = ( ( PyConsole_Console* )wid )->font(); + resourceMgr()->setValue( "PyConsole", "font", f ); } } else @@ -1179,7 +1179,7 @@ void LightApp_Application::updateObjectBrowser( const bool updateModels ) study->dataModels( dm_list ); QListIterator it( dm_list ); while ( it.hasNext() ) { - CAM_DataModel* camDM = it.next(); + CAM_DataModel* camDM = it.next(); if ( camDM && camDM->inherits( "LightApp_DataModel" ) ) ((LightApp_DataModel*)camDM)->update(); } @@ -1322,13 +1322,13 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType vm->setProjectionMode( resMgr->integerValue( "VTKViewer", "projection_mode", vm->projectionMode() ) ); vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) ); vm->setTrihedronSize( resMgr->doubleValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ), - resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) ); + resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) ); vm->setInteractionStyle( resMgr->integerValue( "VTKViewer", "navigation_mode", vm->interactionStyle() ) ); vm->setIncrementalSpeed( resMgr->integerValue( "VTKViewer", "speed_value", vm->incrementalSpeed() ), - resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) ); + resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) ); vm->setSpacemouseButtons( resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", vm->spacemouseBtn(1) ), - resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ), - resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) ); + resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ), + resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) ); new LightApp_VTKSelector( vm, mySelMgr ); } #else @@ -1722,11 +1722,11 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const for ( QStringList::const_iterator it = modNameList.begin(); it != modNameList.end(); ++it ) { if ( !app->isLibExists( *it ) ) - continue; + continue; int modId = _prefs_->addPreference( *it ); if ( iconMap.contains( *it ) ) - _prefs_->setItemIcon( modId, Qtx::scaleIcon( resMgr->loadPixmap( moduleName( *it ), iconMap[*it], false ), 20 ) ); + _prefs_->setItemIcon( modId, Qtx::scaleIcon( resMgr->loadPixmap( moduleName( *it ), iconMap[*it], false ), 20 ) ); } ModuleList modList; @@ -1738,13 +1738,13 @@ LightApp_Preferences* LightApp_Application::preferences( const bool crt ) const CAM_Module* anItem = itr.next(); if ( anItem->inherits( "LightApp_Module" ) ) - mod = (LightApp_Module*)anItem; + mod = (LightApp_Module*)anItem; if ( mod && !_prefs_->hasModule( mod->moduleName() ) ) { - _prefs_->addPreference( mod->moduleName() ); - mod->createPreferences(); - that->emptyPreferences( mod->moduleName() ); + _prefs_->addPreference( mod->moduleName() ); + mod->createPreferences(); + that->emptyPreferences( mod->moduleName() ); } } } @@ -1812,7 +1812,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->addPreference( tr( "PREF_STORE_POS" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_positions" ); int autoSaveInterval = pref->addPreference( tr( "PREF_AUTO_SAVE" ), studyGroup, - LightApp_Preferences::IntSpin, "Study", "auto_save_interval" ); + LightApp_Preferences::IntSpin, "Study", "auto_save_interval" ); pref->setItemProperty( "min", 0, autoSaveInterval ); pref->setItemProperty( "max", 1440, autoSaveInterval ); pref->setItemProperty( "special", tr( "PREF_AUTO_SAVE_DISABLED" ), autoSaveInterval ); @@ -1850,21 +1850,21 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) // OCC Viewer int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occGroup, - LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" ); + LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" ); pref->setItemProperty( "min", 1.0E-06, occTS ); pref->setItemProperty( "max", 1000, occTS ); int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), occGroup, - LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" ); + LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" ); pref->setItemProperty( "min", 0, isoU ); pref->setItemProperty( "max", 100000, isoU ); pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup, - LightApp_Preferences::Color, "OCCViewer", "background" ); + LightApp_Preferences::Color, "OCCViewer", "background" ); int isoV = pref->addPreference( tr( "PREF_ISOS_V" ), occGroup, - LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_v" ); + LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_v" ); pref->setItemProperty( "min", 0, isoV ); pref->setItemProperty( "max", 100000, isoV ); @@ -1873,7 +1873,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "columns", 2, vtkGen ); int vtkProjMode = pref->addPreference( tr( "PREF_PROJECTION_MODE" ), vtkGen, - LightApp_Preferences::Selector, "VTKViewer", "projection_mode" ); + LightApp_Preferences::Selector, "VTKViewer", "projection_mode" ); QStringList aProjModeList; aProjModeList.append( tr("PREF_ORTHOGRAPHIC") ); aProjModeList.append( tr("PREF_PERSPECTIVE") ); @@ -1886,10 +1886,10 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "indexes", aModeIndexesList, vtkProjMode ); pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGen, - LightApp_Preferences::Color, "VTKViewer", "background" ); + LightApp_Preferences::Color, "VTKViewer", "background" ); int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGen, - LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" ); + LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" ); pref->setItemProperty( "min", 1.0E-06, vtkTS ); pref->setItemProperty( "max", 150, vtkTS ); @@ -1897,7 +1897,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGen, LightApp_Preferences::Bool, "VTKViewer", "relative_size" ); int vtkStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), vtkGen, - LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" ); + LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" ); QStringList aStyleModeList; aStyleModeList.append( tr("PREF_STANDARD_STYLE") ); aStyleModeList.append( tr("PREF_KEYFREE_STYLE") ); @@ -1908,13 +1908,13 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->addPreference( "", vtkGroup, LightApp_Preferences::Space ); int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen, - LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" ); + LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" ); pref->setItemProperty( "min", 1, vtkSpeed ); pref->setItemProperty( "max", 1000, vtkSpeed ); int vtkSpeedMode = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED_MODE" ), vtkGen, - LightApp_Preferences::Selector, "VTKViewer", "speed_mode" ); + LightApp_Preferences::Selector, "VTKViewer", "speed_mode" ); QStringList aSpeedModeList; aSpeedModeList.append( tr("PREF_ARITHMETIC") ); aSpeedModeList.append( tr("PREF_GEOMETRICAL") ); @@ -1925,14 +1925,14 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) int vtkSM = pref->addPreference( tr( "PREF_FRAME_SPACEMOUSE" ), vtkGroup, LightApp_Preferences::GroupBox ); pref->setItemProperty( "columns", 2, vtkSM ); int spacemousePref1 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_1" ), vtkSM, - LightApp_Preferences::Selector, "VTKViewer", - "spacemouse_func1_btn" ); //decrease_speed_increment + LightApp_Preferences::Selector, "VTKViewer", + "spacemouse_func1_btn" ); //decrease_speed_increment int spacemousePref2 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_2" ), vtkSM, - LightApp_Preferences::Selector, "VTKViewer", - "spacemouse_func2_btn" ); //increase_speed_increment + LightApp_Preferences::Selector, "VTKViewer", + "spacemouse_func2_btn" ); //increase_speed_increment int spacemousePref3 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_3" ), vtkSM, - LightApp_Preferences::Selector, "VTKViewer", - "spacemouse_func5_btn" ); //dominant_combined_switch + LightApp_Preferences::Selector, "VTKViewer", + "spacemouse_func5_btn" ); //dominant_combined_switch QStringList values; values.append( tr( "PREF_SPACEMOUSE_BTN_1" ) ); @@ -1969,7 +1969,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "columns", 2, vtkRec ); int modePref = pref->addPreference( tr( "PREF_RECORDING_MODE" ), vtkRec, - LightApp_Preferences::Selector, "VTKViewer", "recorder_mode" ); + LightApp_Preferences::Selector, "VTKViewer", "recorder_mode" ); values.clear(); values.append( tr( "PREF_SKIPPED_FRAMES" ) ); values.append( tr( "PREF_ALL_DISLPAYED_FRAMES" ) ); @@ -1980,26 +1980,26 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "indexes", indices, modePref ); int fpsPref = pref->addPreference( tr( "PREF_FPS" ), vtkRec, - LightApp_Preferences::DblSpin, "VTKViewer", "recorder_fps" ); + LightApp_Preferences::DblSpin, "VTKViewer", "recorder_fps" ); pref->setItemProperty( "min", 0.1, fpsPref ); pref->setItemProperty( "max", 100, fpsPref ); int qualityPref = pref->addPreference( tr( "PREF_QUALITY" ), vtkRec, - LightApp_Preferences::IntSpin, "VTKViewer", "recorder_quality" ); + LightApp_Preferences::IntSpin, "VTKViewer", "recorder_quality" ); pref->setItemProperty( "min", 1, qualityPref ); pref->setItemProperty( "max", 100, qualityPref ); pref->addPreference( tr( "PREF_PROGRESSIVE" ), vtkRec, - LightApp_Preferences::Bool, "VTKViewer", "recorder_progressive" ); + LightApp_Preferences::Bool, "VTKViewer", "recorder_progressive" ); int vtkGN = pref->addPreference( tr( "PREF_FRAME_GROUP_NAMES" ), vtkGroup, - LightApp_Preferences::GroupBox, "VTKViewer", "show_group_names" ); + LightApp_Preferences::GroupBox, "VTKViewer", "show_group_names" ); pref->setItemProperty( "columns", 2, vtkGN ); pref->addPreference( tr( "PREF_GROUP_NAMES_TEXT_COLOR" ), vtkGN, - LightApp_Preferences::Color, "VTKViewer", "group_names_text_color" ); + LightApp_Preferences::Color, "VTKViewer", "group_names_text_color" ); int transPref = pref->addPreference( tr( "PREF_GROUP_NAMES_TRANSPARENCY" ), vtkGN, - LightApp_Preferences::DblSpin, "VTKViewer", "group_names_transparency" ); + LightApp_Preferences::DblSpin, "VTKViewer", "group_names_transparency" ); pref->setItemProperty( "min", 0.0, transPref ); pref->setItemProperty( "max", 1.0, transPref ); @@ -2007,10 +2007,10 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) // Plot2d pref->addPreference( tr( "PREF_SHOW_LEGEND" ), plot2dGroup, - LightApp_Preferences::Bool, "Plot2d", "ShowLegend" ); + LightApp_Preferences::Bool, "Plot2d", "ShowLegend" ); int legendPosition = pref->addPreference( tr( "PREF_LEGEND_POSITION" ), plot2dGroup, - LightApp_Preferences::Selector, "Plot2d", "LegendPos" ); + LightApp_Preferences::Selector, "Plot2d", "LegendPos" ); aValuesList.clear(); anIndicesList.clear(); aValuesList << tr("PREF_LEFT") << tr("PREF_RIGHT") << tr("PREF_TOP") << tr("PREF_BOTTOM"); @@ -2020,7 +2020,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "indexes", anIndicesList, legendPosition ); int curveType = pref->addPreference( tr( "PREF_CURVE_TYPE" ), plot2dGroup, - LightApp_Preferences::Selector, "Plot2d", "CurveType" ); + LightApp_Preferences::Selector, "Plot2d", "CurveType" ); aValuesList.clear(); anIndicesList.clear(); aValuesList << tr("PREF_POINTS") << tr("PREF_LINES") << tr("PREF_SPLINE"); @@ -2030,7 +2030,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "indexes", anIndicesList, curveType ); int markerSize = pref->addPreference( tr( "PREF_MARKER_SIZE" ), plot2dGroup, - LightApp_Preferences::IntSpin, "Plot2d", "MarkerSize" ); + LightApp_Preferences::IntSpin, "Plot2d", "MarkerSize" ); pref->setItemProperty( "min", 0, markerSize ); pref->setItemProperty( "max", 100, markerSize ); @@ -2041,58 +2041,58 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) anIndicesList << 0 << 1 ; int horScale = pref->addPreference( tr( "PREF_HOR_AXIS_SCALE" ), plot2dGroup, - LightApp_Preferences::Selector, "Plot2d", "HorScaleMode" ); + LightApp_Preferences::Selector, "Plot2d", "HorScaleMode" ); pref->setItemProperty( "strings", aValuesList, horScale ); pref->setItemProperty( "indexes", anIndicesList, horScale ); int verScale = pref->addPreference( tr( "PREF_VERT_AXIS_SCALE" ), plot2dGroup, - LightApp_Preferences::Selector, "Plot2d", "VerScaleMode" ); + LightApp_Preferences::Selector, "Plot2d", "VerScaleMode" ); pref->setItemProperty( "strings", aValuesList, verScale ); pref->setItemProperty( "indexes", anIndicesList, verScale ); pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), plot2dGroup, - LightApp_Preferences::Color, "Plot2d", "Background" ); + LightApp_Preferences::Color, "Plot2d", "Background" ); int dirTab = pref->addPreference( tr( "PREF_TAB_DIRECTORIES" ), salomeCat ); int dirGroup = pref->addPreference( tr( "PREF_GROUP_DIRECTORIES" ), dirTab ); pref->addPreference( tr( "" ), dirGroup, - LightApp_Preferences::DirList, "FileDlg", "QuickDirList" ); + LightApp_Preferences::DirList, "FileDlg", "QuickDirList" ); /* VSR : 26/02/09 : temporarily comment : SUPERV is not migrated to Qt 4 pref->setItemProperty( "columns", 4, supervGroup ); pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), supervGroup, - LightApp_Preferences::Color, "SUPERVGraph", "Background" ); + LightApp_Preferences::Color, "SUPERVGraph", "Background" ); pref->addPreference( tr( "PREF_SUPERV_TITLE_COLOR" ), supervGroup, - LightApp_Preferences::Color, "SUPERVGraph", "Title" ); + LightApp_Preferences::Color, "SUPERVGraph", "Title" ); // pref->addPreference( tr( "PREF_SUPERV_CTRL_COLOR" ), supervGroup, -// LightApp_Preferences::Color, "SUPERVGraph", "Ctrl" ); +// LightApp_Preferences::Color, "SUPERVGraph", "Ctrl" ); ----> end VSR : 26/02/09 */ int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat ); int stGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SEARCH_TOOL" ), obTab ); pref->addPreference( tr( "PREF_AUTO_HIDE_SEARCH_TOOL" ), stGroup, LightApp_Preferences::Bool, - "ObjectBrowser", "auto_hide_search_tool" ); + "ObjectBrowser", "auto_hide_search_tool" ); int objSetGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SETTINGS" ), obTab ); pref->setItemProperty( "columns", 2, objSetGroup ); pref->addPreference( tr( "PREF_AUTO_SIZE_FIRST" ), objSetGroup, LightApp_Preferences::Bool, - "ObjectBrowser", "auto_size_first" ); + "ObjectBrowser", "auto_size_first" ); pref->addPreference( tr( "PREF_AUTO_SIZE" ), objSetGroup, LightApp_Preferences::Bool, - "ObjectBrowser", "auto_size" ); + "ObjectBrowser", "auto_size" ); pref->addPreference( tr( "PREF_RESIZE_ON_EXPAND_ITEM" ), objSetGroup, LightApp_Preferences::Bool, - "ObjectBrowser", "resize_on_expand_item" ); + "ObjectBrowser", "resize_on_expand_item" ); // MRU preferences int mruGroup = pref->addPreference( tr( "PREF_GROUP_MRU" ), genTab, LightApp_Preferences::Auto, "MRU", "show_mru" ); pref->setItemProperty( "columns", 4, mruGroup ); int mruVisCount = pref->addPreference( tr( "PREF_MRU_VISIBLE_COUNT" ), mruGroup, LightApp_Preferences::IntSpin, - "MRU", "visible_count" ); + "MRU", "visible_count" ); pref->setItemProperty( "min", 0, mruVisCount ); pref->setItemProperty( "max", 100, mruVisCount ); int mruLinkType = pref->addPreference( tr( "PREF_MRU_LINK_TYPE" ), mruGroup, LightApp_Preferences::Selector, - "MRU", "link_type" ); + "MRU", "link_type" ); aValuesList.clear(); anIndicesList.clear(); aValuesList << tr("PREF_MRU_LINK_AUTO") << tr("PREF_MRU_LINK_SHORT") << tr("PREF_MRU_LINK_FULL"); @@ -2125,7 +2125,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { SUIT_ViewModel* vm = it.next()->getViewModel(); if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) ) - continue; + continue; OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm; occVM->setTrihedronSize( sz ); @@ -2147,13 +2147,13 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { SUIT_ViewModel* vm = it.next()->getViewModel(); if ( !vm || !vm->inherits( "SVTK_Viewer" ) ) - continue; + continue; SVTK_Viewer* vtkVM = dynamic_cast( vm ); if( vtkVM ) { - vtkVM->setTrihedronSize( sz, isRelative ); - vtkVM->Repaint(); + vtkVM->setTrihedronSize( sz, isRelative ); + vtkVM->Repaint(); } } #endif @@ -2173,7 +2173,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { SUIT_ViewModel* vm = it.next()->getViewModel(); if ( !vm || !vm->inherits( "SVTK_Viewer" ) ) - continue; + continue; SVTK_Viewer* vtkVM = dynamic_cast( vm ); if( vtkVM ) vtkVM->setIncrementalSpeed( speed, mode ); @@ -2194,7 +2194,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { SUIT_ViewModel* vm = it.next()->getViewModel(); if ( !vm || !vm->inherits( "SVTK_Viewer" ) ) - continue; + continue; SVTK_Viewer* vtkVM = dynamic_cast( vm ); if( vtkVM ) vtkVM->setProjectionMode( mode ); @@ -2215,7 +2215,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { SUIT_ViewModel* vm = it.next()->getViewModel(); if ( !vm || !vm->inherits( "SVTK_Viewer" ) ) - continue; + continue; SVTK_Viewer* vtkVM = dynamic_cast( vm ); if( vtkVM ) vtkVM->setInteractionStyle( mode ); @@ -2226,8 +2226,8 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString #ifndef DISABLE_VTKVIEWER if ( sec == QString( "VTKViewer" ) && (param == QString( "spacemouse_func1_btn" ) || - param == QString( "spacemouse_func2_btn" ) || - param == QString( "spacemouse_func5_btn" ) ) ) + param == QString( "spacemouse_func2_btn" ) || + param == QString( "spacemouse_func5_btn" ) ) ) { int btn1 = resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", 1 ); int btn2 = resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", 2 ); @@ -2240,7 +2240,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { SUIT_ViewModel* vm = it.next()->getViewModel(); if ( !vm || !vm->inherits( "SVTK_Viewer" ) ) - continue; + continue; SVTK_Viewer* vtkVM = dynamic_cast( vm ); if( vtkVM ) vtkVM->setSpacemouseButtons( btn1, btn2, btn3 ); @@ -2261,7 +2261,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { OCCViewer_ViewManager* mgr = dynamic_cast( it.next() ); if( mgr && mgr->getOCCViewer() ) - mgr->getOCCViewer()->setIsos( u, v ); + mgr->getOCCViewer()->setIsos( u, v ); } } #endif @@ -2277,13 +2277,13 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString bool autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true ); ob->setAutoSizeFirstColumn( autoSizeFirst ); if ( autoSizeFirst ) - ob->adjustFirstColumnWidth(); + ob->adjustFirstColumnWidth(); } else if ( param=="auto_size" ) { bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false ); ob->setAutoSizeColumns(autoSize); if ( autoSize ) - ob->adjustColumnsWidth(); + ob->adjustColumnsWidth(); } else if ( param=="resize_on_expand_item" ) { bool resizeOnExpandItem = resMgr->booleanValue( "ObjectBrowser", "resize_on_expand_item", false ); @@ -2310,7 +2310,7 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString { if( param=="font" ) if( pythonConsole() ) - pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) ); + pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) ); } #endif @@ -2319,17 +2319,17 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString QtxMRUAction* mru = ::qobject_cast( action( MRUId ) ); if ( mru ) { if ( param == "visible_count" ) - mru->setVisibleCount( resMgr->integerValue( "MRU", "visible_count", 5 ) ); // 5 MRU items by default + mru->setVisibleCount( resMgr->integerValue( "MRU", "visible_count", 5 ) ); // 5 MRU items by default else if ( param == "max_count" ) - mru->setHistoryCount( resMgr->integerValue( "MRU", "max_count", -1 ) ); // unlimited history by default + mru->setHistoryCount( resMgr->integerValue( "MRU", "max_count", -1 ) ); // unlimited history by default else if ( param == "insert_mode" ) - mru->setInsertMode( resMgr->integerValue( "MRU", "insert_mode", 0 ) ); // QtxMRUAction::MoveFirst by default + mru->setInsertMode( resMgr->integerValue( "MRU", "insert_mode", 0 ) ); // QtxMRUAction::MoveFirst by default else if ( param == "link_type" ) - mru->setLinkType( resMgr->integerValue( "MRU", "link_type", 0 ) ); // QtxMRUAction::LinkAuto by default + mru->setLinkType( resMgr->integerValue( "MRU", "link_type", 0 ) ); // QtxMRUAction::LinkAuto by default else if ( param == "show_clear" ) - mru->setClearPossible( resMgr->booleanValue( "MRU", "show_clear", false ) ); // do not show "Clear" item by default + mru->setClearPossible( resMgr->booleanValue( "MRU", "show_clear", false ) ); // do not show "Clear" item by default else if ( param == "show_mru" ) - mru->setVisible( resMgr->booleanValue( "MRU", "show_mru", false ) ); // do not show MRU menu item by default + mru->setVisible( resMgr->booleanValue( "MRU", "show_mru", false ) ); // do not show MRU menu item by default } } } @@ -2548,7 +2548,7 @@ void LightApp_Application::updateWindows() for ( QMap::ConstIterator it = winMap.begin(); it != winMap.end(); ++it ) { if ( !dockWindow( it.key() ) ) - getWindow( it.key() ); + getWindow( it.key() ); } } @@ -2971,8 +2971,8 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const if( inf.exists() ) { - isLibFound = true; - break; + isLibFound = true; + break; } } @@ -3000,27 +3000,27 @@ bool LightApp_Application::isLibExists( const QString& moduleTitle ) const bool isPyLib = false, isPyGuiLib = false; QStringList::const_iterator anIt = paths.begin(), aLast = paths.end(); for( ; anIt!=aLast; anIt++ ) - { - QFileInfo inf( Qtx::addSlash( *anIt ) + pylib ); - QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui ); + { + QFileInfo inf( Qtx::addSlash( *anIt ) + pylib ); + QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui ); if(!isPythonLightModule) if( !isPyLib && inf.exists() ) isPyLib = true; - if( !isPyGuiLib && infgui.exists() ) - isPyGuiLib = true; + if( !isPyGuiLib && infgui.exists() ) + isPyGuiLib = true; - if ((isPyLib || isPythonLightModule ) && isPyGuiLib && isLibFound) - return true; - } + if ((isPyLib || isPythonLightModule ) && isPyGuiLib && isLibFound) + return true; + } printf( "****************************************************************\n" ); printf( "* Warning: python library for %s cannot be found:\n", moduleTitle.toLatin1().constData() ); if (!isPyLib) - printf( "* No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() ); + printf( "* No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() ); if (!isPyGuiLib) - printf( "* No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() ); + printf( "* No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() ); printf( "****************************************************************\n" ); return true; } @@ -3054,9 +3054,9 @@ bool LightApp_Application::event( QEvent* e ) SALOME_CustomEvent* ce = ( SALOME_CustomEvent* )e; QString* d = ( QString* )ce->data(); if( SUIT_MessageBox::question(0, tr("WRN_WARNING"), - d ? *d : "", - SUIT_MessageBox::Yes | SUIT_MessageBox::No, - SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes ) + d ? *d : "", + SUIT_MessageBox::Yes | SUIT_MessageBox::No, + SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes ) showPreferences( tr( "PREF_APP" ) ); if( d ) delete d; @@ -3070,9 +3070,9 @@ bool LightApp_Application::checkDataObject(LightApp_DataObject* theObj) { if (theObj) { - bool isSuitable = !theObj->entry().isEmpty() && - !theObj->componentDataType().isEmpty() && - !theObj->name().isEmpty(); + bool isSuitable = !theObj->entry().isEmpty() && + !theObj->componentDataType().isEmpty() && + !theObj->name().isEmpty(); return isSuitable; } @@ -3087,7 +3087,7 @@ int LightApp_Application::openChoice( const QString& aName ) { // Do you want to reload it? if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYOPEN" ).arg( aName ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ) == SUIT_MessageBox::Yes ) + SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ) == SUIT_MessageBox::Yes ) choice = OpenReload; } @@ -3106,20 +3106,20 @@ bool LightApp_Application::openAction( const int choice, const QString& aName ) QList appList = session->applications(); for ( QList::iterator it = appList.begin(); it != appList.end() && !app; ++it ) { - if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName ) - app = ::qobject_cast( *it ); + if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName ) + app = ::qobject_cast( *it ); } if ( app ) { - app->onCloseDoc( false ); - appList = session->applications(); - STD_Application* other = 0; - for ( QList::iterator it = appList.begin(); it != appList.end() && !other; ++it ) - other = ::qobject_cast( *it ); - - if ( other ) - res = other->onOpenDoc( aName ); + app->onCloseDoc( false ); + appList = session->applications(); + STD_Application* other = 0; + for ( QList::iterator it = appList.begin(); it != appList.end() && !other; ++it ) + other = ::qobject_cast( *it ); + + if ( other ) + res = other->onOpenDoc( aName ); } } break; diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index a1d1911e1..652c0528b 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -78,11 +78,11 @@ public: enum { MenuWindowId = 6 }; enum { RenameId = CAM_Application::UserID, - CloseId, CloseAllId, GroupAllId, - PreferencesId, MRUId, ModulesListId, + CloseId, CloseAllId, GroupAllId, + PreferencesId, MRUId, ModulesListId, NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId, NewQxGraphViewId, - NewQxSceneViewId = NewQxGraphViewId, StyleId, - UserID }; + NewQxSceneViewId = NewQxGraphViewId, StyleId, + UserID }; protected: enum { NewStudyId = 1, OpenStudyId }; @@ -112,10 +112,10 @@ public: virtual QString getFileFilter() const; virtual QString getFileName( bool open, const QString& initial, const QString& filters, - const QString& caption, QWidget* parent ); + const QString& caption, QWidget* parent ); virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ); virtual QStringList getOpenFileNames( const QString& initial, const QString& filters, - const QString& caption, QWidget* parent ); + const QString& caption, QWidget* parent ); void updateActions(); diff --git a/src/LightApp/LightApp_DataModel.cxx b/src/LightApp/LightApp_DataModel.cxx index 653256f95..f843e4a4a 100644 --- a/src/LightApp/LightApp_DataModel.cxx +++ b/src/LightApp/LightApp_DataModel.cxx @@ -41,7 +41,7 @@ LightApp_DataModel::LightApp_DataModel( CAM_Module* theModule ) { myGroupId = 0; if( module() ) - myGroupId = qHash( module()->name() ); + myGroupId = qHash( module()->name() ); } /*! @@ -206,5 +206,5 @@ void LightApp_DataModel::unregisterColumn( SUIT_DataBrowser* browser, const QStr { SUIT_AbstractModel* m = dynamic_cast( browser ? browser->model() : 0 ); if( m ) - m->unregisterColumn( groupId(), name ); + m->unregisterColumn( groupId(), name ); } diff --git a/src/LightApp/LightApp_DataObject.cxx b/src/LightApp/LightApp_DataObject.cxx index 504ae52f3..1ea74a77a 100644 --- a/src/LightApp/LightApp_DataObject.cxx +++ b/src/LightApp/LightApp_DataObject.cxx @@ -237,28 +237,28 @@ bool LightApp_DataObject::compare( const QVariant& left, const QVariant& right, bool result = true; bool calculated = false; for ( int i = 0; i < idsLeft.count() || i < idsRight.count(); i++ ) { - bool okLeft = true, okRight = true; - int lid = 0, rid = 0; - if ( i < idsLeft.count() ) - lid = idsLeft[i].toInt( &okLeft ); - if ( i < idsRight.count() ) - rid = idsRight[i].toInt( &okRight ); - if ( okLeft && okRight ) { - // both seem to be correct integer ID - return lid < rid; - } - else if ( okLeft || okRight ) { - // objects with correct (int) ID have higher priority - return okLeft; - } - else { - // both not integer ID - int r = QString::localeAwareCompare( idsLeft[i], idsRight[i] ); - if ( !calculated && r != 0 ) { - result = r < 0; - calculated = true; - } - } + bool okLeft = true, okRight = true; + int lid = 0, rid = 0; + if ( i < idsLeft.count() ) + lid = idsLeft[i].toInt( &okLeft ); + if ( i < idsRight.count() ) + rid = idsRight[i].toInt( &okRight ); + if ( okLeft && okRight ) { + // both seem to be correct integer ID + return lid < rid; + } + else if ( okLeft || okRight ) { + // objects with correct (int) ID have higher priority + return okLeft; + } + else { + // both not integer ID + int r = QString::localeAwareCompare( idsLeft[i], idsRight[i] ); + if ( !calculated && r != 0 ) { + result = r < 0; + calculated = true; + } + } } // we should reach this if the entries are exactly equal return result; diff --git a/src/LightApp/LightApp_Displayer.cxx b/src/LightApp/LightApp_Displayer.cxx index c050811d1..f0f40c5a4 100644 --- a/src/LightApp/LightApp_Displayer.cxx +++ b/src/LightApp/LightApp_Displayer.cxx @@ -98,13 +98,13 @@ void LightApp_Displayer::Redisplay( const QString& entry, const bool updateViewe SUIT_ViewModel* vmodel = vman->getViewModel(); if( !vmodel ) - continue; - + continue; + SALOME_View* view = dynamic_cast(vmodel); if( view && ( IsDisplayed( entry, view ) || view == GetActiveView() ) ) { - Erase( entry, true, false, view ); - Display( entry, updateViewer, view ); + Erase( entry, true, false, view ); + Display( entry, updateViewer, view ); } } } @@ -127,7 +127,7 @@ void LightApp_Displayer::Erase( const QString& entry, const bool forced, if ( prs ) { vf->Erase( prs, forced ); if ( updateViewer ) - vf->Repaint(); + vf->Repaint(); delete prs; // delete presentation because displayer is its owner } } @@ -207,8 +207,8 @@ SALOME_View* LightApp_Displayer::GetActiveView() if ( SUIT_Application* app = session->activeApplication() ) { if ( LightApp_Application* sApp = dynamic_cast( app ) ) { if( SUIT_ViewManager* vman = sApp->activeViewManager() ) { - if ( SUIT_ViewModel* vmod = vman->getViewModel() ) - return dynamic_cast( vmod ); + if ( SUIT_ViewModel* vmod = vman->getViewModel() ) + return dynamic_cast( vmod ); } } } @@ -236,8 +236,8 @@ bool LightApp_Displayer::canBeDisplayed( const QString& entry ) const if( SUIT_Application* app = session->activeApplication() ) if( LightApp_Application* sApp = dynamic_cast( app ) ) if( SUIT_ViewManager* vman = sApp->activeViewManager() ) - if( SUIT_ViewModel* vmod = vman->getViewModel() ) - viewerType = vmod->getType(); + if( SUIT_ViewModel* vmod = vman->getViewModel() ) + viewerType = vmod->getType(); return canBeDisplayed( entry, viewerType ); } diff --git a/src/LightApp/LightApp_EventFilter.cxx b/src/LightApp/LightApp_EventFilter.cxx index 30ea24f79..dbeb54835 100644 --- a/src/LightApp/LightApp_EventFilter.cxx +++ b/src/LightApp/LightApp_EventFilter.cxx @@ -54,14 +54,14 @@ bool LightApp_EventFilter::eventFilter( QObject* o, QEvent* e ) SUIT_Desktop* aDesktop = 0; while( parent ) - { - if ( aDesktop = dynamic_cast(parent) ) - break; - parent = parent->parentWidget(); - } + { + if ( aDesktop = dynamic_cast(parent) ) + break; + parent = parent->parentWidget(); + } if ( aDesktop ) - aDesktop->emitActivated(); + aDesktop->emitActivated(); } else if(e->type() == SALOME_EVENT) diff --git a/src/LightApp/LightApp_Module.h b/src/LightApp/LightApp_Module.h index 9d5b40562..c608497e5 100644 --- a/src/LightApp/LightApp_Module.h +++ b/src/LightApp/LightApp_Module.h @@ -119,8 +119,8 @@ protected: int addPreference( const QString& label ); int addPreference( const QString& label, const int pId, const int = LightApp_Preferences::Auto, - const QString& section = QString(), - const QString& param = QString() ); + const QString& section = QString(), + const QString& param = QString() ); QVariant preferenceProperty( const int, const QString& ) const; void setPreferenceProperty( const int, const QString&, const QVariant& ); diff --git a/src/LightApp/LightApp_ModuleDlg.cxx b/src/LightApp/LightApp_ModuleDlg.cxx index a675d7a8b..fe0864703 100644 --- a/src/LightApp/LightApp_ModuleDlg.cxx +++ b/src/LightApp/LightApp_ModuleDlg.cxx @@ -148,8 +148,8 @@ static const char* const default_icon[] = { \param icon module icon */ LightApp_ModuleDlg::LightApp_ModuleDlg( QWidget* parent, - const QString& component, - const QPixmap& icon ) + const QString& component, + const QPixmap& icon ) : QDialog ( parent ) { setModal( true ); @@ -242,7 +242,7 @@ QPushButton* LightApp_ModuleDlg::findButton( const int id ) const { QPushButton* btn = 0; for ( ButtonMap::ConstIterator it = myButtons.begin(); - it != myButtons.end() && !btn; ++it ) { + it != myButtons.end() && !btn; ++it ) { if ( it.value() == id ) btn = it.key(); } diff --git a/src/LightApp/LightApp_OBSelector.cxx b/src/LightApp/LightApp_OBSelector.cxx index ede0e004c..d6b98efcf 100644 --- a/src/LightApp/LightApp_OBSelector.cxx +++ b/src/LightApp/LightApp_OBSelector.cxx @@ -130,8 +130,8 @@ void LightApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const #ifndef DISABLE_SALOMEOBJECT Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject ( obj->entry().toLatin1().constData(), - obj->componentDataType().toLatin1().constData(), - obj->name().toLatin1().constData() ); + obj->componentDataType().toLatin1().constData(), + obj->name().toLatin1().constData() ); LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj ); #else LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() ); @@ -152,12 +152,12 @@ void LightApp_OBSelector::setSelection( const SUIT_DataOwnerPtrList& theList ) if ( !myBrowser ) return; - if( myEntries.count() == 0 || myModifiedTime < myBrowser->getModifiedTime() ) + if( myEntries.count() == 0 || myModifiedTime < myBrowser->getModifiedTime() ) fillEntries( myEntries ); DataObjectList objList; for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); - it != theList.end(); ++it ) { + it != theList.end(); ++it ) { const LightApp_DataOwner* owner = dynamic_cast( (*it).operator->() ); if ( owner && myEntries.contains( owner->entry() ) ) objList.append( myEntries[owner->entry()] ); diff --git a/src/LightApp/LightApp_Preferences.cxx b/src/LightApp/LightApp_Preferences.cxx index c97e2d6de..ecdb2579b 100644 --- a/src/LightApp/LightApp_Preferences.cxx +++ b/src/LightApp/LightApp_Preferences.cxx @@ -97,7 +97,7 @@ void LightApp_Preferences::onApply() void LightApp_Preferences::changedResources( const ResourceMap& map ) { for ( ResourceMap::ConstIterator it = map.begin(); - it != map.end(); ++it ) + it != map.end(); ++it ) { QString sec, param; it.key()->resource( sec, param ); diff --git a/src/LightApp/LightApp_PreferencesDlg.cxx b/src/LightApp/LightApp_PreferencesDlg.cxx index 748d42b54..b66fa3648 100644 --- a/src/LightApp/LightApp_PreferencesDlg.cxx +++ b/src/LightApp/LightApp_PreferencesDlg.cxx @@ -132,16 +132,16 @@ void LightApp_PreferencesDlg::onApply() void LightApp_PreferencesDlg::onDefault() { if( SUIT_MessageBox::Ok == SUIT_MessageBox::question( this, tr( "WARNING" ), tr( "DEFAULT_QUESTION" ), - SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel, - SUIT_MessageBox::Ok ) ) + SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel, + SUIT_MessageBox::Ok ) ) { if ( myPrefs && myPrefs->resourceMgr() ) - { + { QtxResourceMgr::WorkingMode prev = myPrefs->resourceMgr()->workingMode(); - myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues ); - myPrefs->retrieve(); + myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues ); + myPrefs->retrieve(); myPrefs->resourceMgr()->setWorkingMode( prev ); - } + } } } diff --git a/src/LightApp/LightApp_Selection.cxx b/src/LightApp/LightApp_Selection.cxx index 09fab94d7..b39d13121 100644 --- a/src/LightApp/LightApp_Selection.cxx +++ b/src/LightApp/LightApp_Selection.cxx @@ -76,11 +76,11 @@ void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr SUIT_Selector* selector = it.next(); if( selector->type() != client && selector->isEnabled() ) { - //mgr->selected( cur_sel, selector->type() ); + //mgr->selected( cur_sel, selector->type() ); selector->selected( cur_sel ); - SUIT_DataOwnerPtrList::const_iterator aLIt = cur_sel.begin(), aLLast = cur_sel.end(); - for( ; aLIt!=aLLast; aLIt++ ) - sel.append( *aLIt ); //check entry and don't append if such entry is in list already + SUIT_DataOwnerPtrList::const_iterator aLIt = cur_sel.begin(), aLLast = cur_sel.end(); + for( ; aLIt!=aLLast; aLIt++ ) + sel.append( *aLIt ); //check entry and don't append if such entry is in list already } } @@ -95,14 +95,14 @@ void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr if( sowner ) { entry = referencedToEntry( sowner->entry() ); - if( entries.contains( entry ) ) - continue; + if( entries.contains( entry ) ) + continue; - entries.insert( entry, 0 ); + entries.insert( entry, 0 ); myEntries.insert( num, entry ); - myIsReferences.insert( num, sowner->entry() != entry ); + myIsReferences.insert( num, sowner->entry() != entry ); processOwner( sowner ); - num++; + num++; } } } @@ -256,7 +256,7 @@ SUIT_ViewWindow* LightApp_Selection::activeVW() const if ( app ) { SUIT_Desktop* desk = app->desktop(); if ( desk ) - return desk->activeWindow(); + return desk->activeWindow(); } } return 0; diff --git a/src/LightApp/LightApp_SelectionMgr.cxx b/src/LightApp/LightApp_SelectionMgr.cxx index 1c389db58..9a40604d9 100644 --- a/src/LightApp/LightApp_SelectionMgr.cxx +++ b/src/LightApp/LightApp_SelectionMgr.cxx @@ -107,7 +107,7 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QStri } else { if( !entryMap.contains( entry ) && !owner->IO().IsNull() ) - theList.Append( owner->IO() ); + theList.Append( owner->IO() ); } entryMap.insert(checkEntry, 1); @@ -188,7 +188,7 @@ void LightApp_SelectionMgr::GetIndexes( const Handle(SALOME_InteractiveObject)& const LightApp_DataSubOwner* subOwner = dynamic_cast( (*itr).operator->() ); if ( subOwner ) if ( subOwner->entry() == QString(IObject->getEntry()) ) - theIndex.Add( subOwner->index() ); + theIndex.Add( subOwner->index() ); } } @@ -208,7 +208,7 @@ void LightApp_SelectionMgr::GetIndexes( const QString& theEntry, TColStd_Indexed const LightApp_DataSubOwner* subOwner = dynamic_cast( (*itr).operator->() ); if ( subOwner ) if ( subOwner->entry() == theEntry ) - theIndex.Add( subOwner->index() ); + theIndex.Add( subOwner->index() ); } } @@ -234,14 +234,14 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj const LightApp_DataOwner* owner = dynamic_cast( (*itr).operator->() ); if ( owner ) { - if ( owner->entry() != ioEntry ) - { - const LightApp_DataSubOwner* subOwner = dynamic_cast( owner ); - if ( subOwner ) - remainsOwners.append( new LightApp_DataSubOwner( subOwner->entry(), subOwner->index() ) ); - else - remainsOwners.append( new LightApp_DataOwner( owner->entry() ) ); - } + if ( owner->entry() != ioEntry ) + { + const LightApp_DataSubOwner* subOwner = dynamic_cast( owner ); + if ( subOwner ) + remainsOwners.append( new LightApp_DataSubOwner( subOwner->entry(), subOwner->index() ) ); + else + remainsOwners.append( new LightApp_DataOwner( owner->entry() ) ); + } } } } @@ -268,7 +268,7 @@ void LightApp_SelectionMgr::AddOrRemoveIndex( const Handle(SALOME_InteractiveObj select 'subobjects' with given indexes */ void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject)& IObject, - TColStd_IndexedMapOfInteger theIndex, bool append ) + TColStd_IndexedMapOfInteger theIndex, bool append ) { SUIT_DataOwnerPtrList aList; @@ -278,7 +278,7 @@ void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject { int i; for ( i = 1; i <= theIndex.Extent(); i++ ) - aList.append( new LightApp_DataSubOwner( QString(IObject->getEntry()), theIndex( i ) ) ); + aList.append( new LightApp_DataSubOwner( QString(IObject->getEntry()), theIndex( i ) ) ); } setSelected( aList, append ); @@ -296,13 +296,13 @@ void LightApp_SelectionMgr::selectObjects( MapIOOfMapOfInteger theMapIO, bool ap for ( ; it.More(); it.Next() ) { if ( it.Value().IsEmpty() ) - aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) ); + aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) ); else - { - int i; - for ( i = 1; i <= it.Value().Extent(); i++ ) - aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) ); - } + { + int i; + for ( i = 1; i <= it.Value().Extent(); i++ ) + aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) ); + } } setSelected( aList, append ); @@ -333,8 +333,8 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap ) if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) ) #endif { - anIndexes.Clear(); - //Bug 17269: GetIndexes( subOwner->entry(), anIndexes ); + anIndexes.Clear(); + //Bug 17269: GetIndexes( subOwner->entry(), anIndexes ); //Bug 17269: To avoid multiple calling of selected(aList) for ( SUIT_DataOwnerPtrList::const_iterator itr2 = itr; itr2 != aList.end(); ++itr2 ) { @@ -345,7 +345,7 @@ void LightApp_SelectionMgr::selectedSubOwners( MapEntryOfMapOfInteger& theMap ) anIndexes.Add( subOwner2->index() ); } // - theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes ); + theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes ); } } } diff --git a/src/LightApp/LightApp_SelectionMgr.h b/src/LightApp/LightApp_SelectionMgr.h index 57a4efbe7..9a6b11804 100644 --- a/src/LightApp/LightApp_SelectionMgr.h +++ b/src/LightApp/LightApp_SelectionMgr.h @@ -63,17 +63,17 @@ public: void setSelectedObjects( const SALOME_ListIO&, const bool = false ); void GetIndexes( const Handle(SALOME_InteractiveObject)& IObject, - TColStd_IndexedMapOfInteger& theIndex ); + TColStd_IndexedMapOfInteger& theIndex ); void GetIndexes( const QString& theEntry, - TColStd_IndexedMapOfInteger& theIndex ); + TColStd_IndexedMapOfInteger& theIndex ); //bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, void AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject, - const TColStd_MapOfInteger& theIndices, - bool modeShift ); + const TColStd_MapOfInteger& theIndices, + bool modeShift ); void selectObjects( const Handle(SALOME_InteractiveObject)& IObject, - TColStd_IndexedMapOfInteger theIndex, bool append ); + TColStd_IndexedMapOfInteger theIndex, bool append ); void selectObjects( MapIOOfMapOfInteger theMapIO, bool append ); void selectedSubOwners( MapEntryOfMapOfInteger& theMap ); diff --git a/src/LightApp/LightApp_ShowHideOp.cxx b/src/LightApp/LightApp_ShowHideOp.cxx index e6cefd5c0..a48129436 100644 --- a/src/LightApp/LightApp_ShowHideOp.cxx +++ b/src/LightApp/LightApp_ShowHideOp.cxx @@ -104,7 +104,7 @@ void LightApp_ShowHideOp::startOperation() { LightApp_Displayer* disp = LightApp_Displayer::FindDisplayer( app->moduleTitle( *anIt ), true ); if( disp ) - disp->EraseAll( false, false, 0 ); + disp->EraseAll( false, false, 0 ); } if( myActionType==ERASE_ALL ) { diff --git a/src/LightApp/LightApp_SwitchOp.cxx b/src/LightApp/LightApp_SwitchOp.cxx index 69fcb3282..3034bb80c 100755 --- a/src/LightApp/LightApp_SwitchOp.cxx +++ b/src/LightApp/LightApp_SwitchOp.cxx @@ -102,7 +102,7 @@ LightApp_Operation* LightApp_SwitchOp::operation( QWidget* theWg ) const SUIT_Operation* anOp = anIter.next(); if ( anOp && - anOp->inherits( "LightApp_Operation" ) && + anOp->inherits( "LightApp_Operation" ) && ((LightApp_Operation*)anOp)->dlg() == aDlg ) return ((LightApp_Operation*)anOp); } diff --git a/src/LightApp/LightApp_VTKSelector.cxx b/src/LightApp/LightApp_VTKSelector.cxx index cb27f6aee..625c6b70a 100644 --- a/src/LightApp/LightApp_VTKSelector.cxx +++ b/src/LightApp/LightApp_VTKSelector.cxx @@ -47,7 +47,7 @@ Constructor. */ LightApp_SVTKDataOwner::LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO, - SUIT_Desktop* theDesktop ) + SUIT_Desktop* theDesktop ) : LightApp_DataOwner( theIO ), myDesktop( theDesktop ) { @@ -137,7 +137,7 @@ LightApp_SVTKDataOwner::~LightApp_SVTKDataOwner() */ LightApp_VTKSelector ::LightApp_VTKSelector( SVTK_ViewModelBase* viewer, - SUIT_SelectionMgr* mgr ): + SUIT_SelectionMgr* mgr ): SUIT_Selector( mgr, viewer ), myViewer( viewer ) { @@ -188,17 +188,17 @@ LightApp_VTKSelector if(myViewer){ if(SUIT_ViewManager* aViewManager = myViewer->getViewManager()){ if(SVTK_ViewManager* aViewMgr = dynamic_cast(aViewManager)){ - if(SVTK_ViewWindow* aView = dynamic_cast(aViewMgr->getActiveView())){ - if(SVTK_Selector* aSelector = aView->GetSelector()){ - const SALOME_ListIO& aListIO = aSelector->StoredIObjects(); - SALOME_ListIteratorOfListIO anIter(aListIO); - for(; anIter.More(); anIter.Next()){ - Handle(SALOME_InteractiveObject) anIO = anIter.Value(); - if(anIO->hasEntry()) - aList.append(new LightApp_SVTKDataOwner(anIO,aViewMgr->getDesktop())); - } - } - } + if(SVTK_ViewWindow* aView = dynamic_cast(aViewMgr->getActiveView())){ + if(SVTK_Selector* aSelector = aView->GetSelector()){ + const SALOME_ListIO& aListIO = aSelector->StoredIObjects(); + SALOME_ListIteratorOfListIO anIter(aListIO); + for(; anIter.More(); anIter.Next()){ + Handle(SALOME_InteractiveObject) anIO = anIter.Value(); + if(anIO->hasEntry()) + aList.append(new LightApp_SVTKDataOwner(anIO,aViewMgr->getDesktop())); + } + } + } } } } @@ -214,45 +214,45 @@ LightApp_VTKSelector if(myViewer){ if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){ if(SVTK_ViewWindow* aView = dynamic_cast(aViewMgr->getActiveView())){ - if(SVTK_Selector* aSelector = aView->GetSelector()){ - SALOME_ListIO anAppendList; - const SALOME_ListIO& aStoredList = aSelector->StoredIObjects(); - SUIT_DataOwnerPtrList::const_iterator anIter = theList.begin(); - for(; anIter != theList.end(); ++anIter){ - const SUIT_DataOwner* aDataOwner = (*anIter).get(); - if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast(aDataOwner)){ - aSelector->SetSelectionMode(anOwner->GetMode()); - Handle(SALOME_InteractiveObject) anIO = anOwner->IO(); + if(SVTK_Selector* aSelector = aView->GetSelector()){ + SALOME_ListIO anAppendList; + const SALOME_ListIO& aStoredList = aSelector->StoredIObjects(); + SUIT_DataOwnerPtrList::const_iterator anIter = theList.begin(); + for(; anIter != theList.end(); ++anIter){ + const SUIT_DataOwner* aDataOwner = (*anIter).get(); + if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast(aDataOwner)){ + aSelector->SetSelectionMode(anOwner->GetMode()); + Handle(SALOME_InteractiveObject) anIO = anOwner->IO(); - aSelector->AddIObject(anIO); + aSelector->AddIObject(anIO); - anAppendList.Append(anIO); - aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false); - }else if(const LightApp_DataOwner* anOwner = dynamic_cast(aDataOwner)){ - Handle(SALOME_InteractiveObject) anIO = - new SALOME_InteractiveObject(anOwner->entry().toLatin1(),""); - aSelector->AddIObject(anIO); - anAppendList.Append(anIO); - } - } - // To remove IOs, which is not selected. - QMap< QString, Handle( SALOME_InteractiveObject )> toRemove; - SALOME_ListIteratorOfListIO anIt( aStoredList ); - for( ; anIt.More(); anIt.Next() ) - if( !anIt.Value().IsNull() ) - toRemove[ anIt.Value()->getEntry() ] = anIt.Value(); + anAppendList.Append(anIO); + aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false); + }else if(const LightApp_DataOwner* anOwner = dynamic_cast(aDataOwner)){ + Handle(SALOME_InteractiveObject) anIO = + new SALOME_InteractiveObject(anOwner->entry().toLatin1(),""); + aSelector->AddIObject(anIO); + anAppendList.Append(anIO); + } + } + // To remove IOs, which is not selected. + QMap< QString, Handle( SALOME_InteractiveObject )> toRemove; + SALOME_ListIteratorOfListIO anIt( aStoredList ); + for( ; anIt.More(); anIt.Next() ) + if( !anIt.Value().IsNull() ) + toRemove[ anIt.Value()->getEntry() ] = anIt.Value(); - anIt = SALOME_ListIteratorOfListIO(anAppendList); - for( ; anIt.More(); anIt.Next() ) - toRemove.remove( anIt.Value()->getEntry() ); + anIt = SALOME_ListIteratorOfListIO(anAppendList); + for( ; anIt.More(); anIt.Next() ) + toRemove.remove( anIt.Value()->getEntry() ); - QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(), - REnd = toRemove.end(); - for( ; RIt!=REnd; RIt++ ) - aSelector->RemoveIObject( RIt.value() ); - - aView->onSelectionChanged(); - } + QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(), + REnd = toRemove.end(); + for( ; RIt!=REnd; RIt++ ) + aSelector->RemoveIObject( RIt.value() ); + + aView->onSelectionChanged(); + } } } } diff --git a/src/OBJECT/SALOME_AISObject.hxx b/src/OBJECT/SALOME_AISObject.hxx index 56455d7ad..b94df74c8 100755 --- a/src/OBJECT/SALOME_AISObject.hxx +++ b/src/OBJECT/SALOME_AISObject.hxx @@ -83,7 +83,7 @@ Standard_EXPORT ~SALOME_AISObject(); // Standard_EXPORT friend Handle_Standard_Type& SALOME_AISObject_Type_(); Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; protected: diff --git a/src/OBJECT/SALOME_AISObject.ixx b/src/OBJECT/SALOME_AISObject.ixx index df3807805..dbf37bdbf 100755 --- a/src/OBJECT/SALOME_AISObject.ixx +++ b/src/OBJECT/SALOME_AISObject.ixx @@ -50,10 +50,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_AISObject_Type_() static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,NULL}; static Handle_Standard_Type _aType = new Standard_Type("SALOME_AISObject", - sizeof(SALOME_AISObject), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(SALOME_AISObject), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OBJECT/SALOME_AISShape.hxx b/src/OBJECT/SALOME_AISShape.hxx index ae878704b..9d5cc5a24 100755 --- a/src/OBJECT/SALOME_AISShape.hxx +++ b/src/OBJECT/SALOME_AISShape.hxx @@ -87,7 +87,7 @@ Standard_EXPORT ~SALOME_AISShape(); // Standard_EXPORT friend Handle_Standard_Type& SALOME_AISShape_Type_(); Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; protected: diff --git a/src/OBJECT/SALOME_AISShape.ixx b/src/OBJECT/SALOME_AISShape.ixx index e67417c06..1b68f13e4 100755 --- a/src/OBJECT/SALOME_AISShape.ixx +++ b/src/OBJECT/SALOME_AISShape.ixx @@ -52,10 +52,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_AISShape_Type_() static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,NULL}; static Handle_Standard_Type _aType = new Standard_Type("SALOME_AISShape", - sizeof(SALOME_AISShape), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(SALOME_AISShape), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx b/src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx index 4a9700188..5bb115dc4 100644 --- a/src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx +++ b/src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx @@ -86,7 +86,7 @@ Standard_EXPORT ~SALOME_DataMapNodeOfDataMapOfIOMapOfInteger(); // Standard_EXPORT friend Handle_Standard_Type& SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_Type_(); Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; protected: diff --git a/src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx b/src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx index 68dc7cad6..cf7b68692 100644 --- a/src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx +++ b/src/OBJECT/SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx @@ -69,10 +69,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_DataMapNodeOfDataMapOfIOMapOfIntege static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Type _aType = new Standard_Type("SALOME_DataMapNodeOfDataMapOfIOMapOfInteger", - sizeof(SALOME_DataMapNodeOfDataMapOfIOMapOfInteger), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(SALOME_DataMapNodeOfDataMapOfIOMapOfInteger), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OBJECT/SALOME_Filter.hxx b/src/OBJECT/SALOME_Filter.hxx index 29735f5da..808b0563b 100644 --- a/src/OBJECT/SALOME_Filter.hxx +++ b/src/OBJECT/SALOME_Filter.hxx @@ -75,7 +75,7 @@ Standard_EXPORT ~SALOME_Filter(); // Standard_EXPORT friend Handle_Standard_Type& SALOME_Filter_Type_(); Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; protected: diff --git a/src/OBJECT/SALOME_Filter.ixx b/src/OBJECT/SALOME_Filter.ixx index 1745ba8c4..59d5ba2a0 100644 --- a/src/OBJECT/SALOME_Filter.ixx +++ b/src/OBJECT/SALOME_Filter.ixx @@ -44,10 +44,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_Filter_Type_() static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; static Handle_Standard_Type _aType = new Standard_Type("SALOME_Filter", - sizeof(SALOME_Filter), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(SALOME_Filter), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OBJECT/SALOME_InteractiveObject.hxx b/src/OBJECT/SALOME_InteractiveObject.hxx index a888e1b73..ed938b853 100755 --- a/src/OBJECT/SALOME_InteractiveObject.hxx +++ b/src/OBJECT/SALOME_InteractiveObject.hxx @@ -73,8 +73,8 @@ public: // Standard_EXPORT SALOME_InteractiveObject(); Standard_EXPORT SALOME_InteractiveObject(const char* anEntry, - const char* aComponentDataType, - const char* aName = ""); + const char* aComponentDataType, + const char* aName = ""); Standard_EXPORT void setEntry(const char* anEntry) ; Standard_EXPORT const char* getEntry() ; Standard_EXPORT void setName(const char* aName) ; @@ -105,7 +105,7 @@ friend Standard_Boolean IsEqual(const Handle(SALOME_InteractiveObject)& anIO1, // Standard_EXPORT friend Handle_Standard_Type& SALOME_InteractiveObject_Type_(); Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; protected: diff --git a/src/OBJECT/SALOME_InteractiveObject.ixx b/src/OBJECT/SALOME_InteractiveObject.ixx index 31b640c7d..b7f7e93e7 100755 --- a/src/OBJECT/SALOME_InteractiveObject.ixx +++ b/src/OBJECT/SALOME_InteractiveObject.ixx @@ -44,10 +44,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_InteractiveObject_Type_() static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; static Handle_Standard_Type _aType = new Standard_Type("SALOME_InteractiveObject", - sizeof(SALOME_InteractiveObject), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(SALOME_InteractiveObject), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OBJECT/SALOME_ListNodeOfListIO.hxx b/src/OBJECT/SALOME_ListNodeOfListIO.hxx index e3579c28e..7c1fb3542 100644 --- a/src/OBJECT/SALOME_ListNodeOfListIO.hxx +++ b/src/OBJECT/SALOME_ListNodeOfListIO.hxx @@ -79,7 +79,7 @@ Standard_EXPORT ~SALOME_ListNodeOfListIO(); // Standard_EXPORT friend Handle_Standard_Type& SALOME_ListNodeOfListIO_Type_(); Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; protected: diff --git a/src/OBJECT/SALOME_ListNodeOfListIO_0.cxx b/src/OBJECT/SALOME_ListNodeOfListIO_0.cxx index f69e501e7..fa60f0edc 100644 --- a/src/OBJECT/SALOME_ListNodeOfListIO_0.cxx +++ b/src/OBJECT/SALOME_ListNodeOfListIO_0.cxx @@ -62,10 +62,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_ListNodeOfListIO_Type_() static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Type _aType = new Standard_Type("SALOME_ListNodeOfListIO", - sizeof(SALOME_ListNodeOfListIO), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(SALOME_ListNodeOfListIO), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OBJECT/SALOME_TypeFilter.hxx b/src/OBJECT/SALOME_TypeFilter.hxx index 178618c30..b4304ce89 100644 --- a/src/OBJECT/SALOME_TypeFilter.hxx +++ b/src/OBJECT/SALOME_TypeFilter.hxx @@ -79,7 +79,7 @@ Standard_EXPORT ~SALOME_TypeFilter(); // Standard_EXPORT friend Handle_Standard_Type& SALOME_TypeFilter_Type_(); Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; protected: diff --git a/src/OBJECT/SALOME_TypeFilter.ixx b/src/OBJECT/SALOME_TypeFilter.ixx index 6e2350a0d..8cc87c16b 100644 --- a/src/OBJECT/SALOME_TypeFilter.ixx +++ b/src/OBJECT/SALOME_TypeFilter.ixx @@ -46,10 +46,10 @@ Standard_EXPORT Handle_Standard_Type& SALOME_TypeFilter_Type_() static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Type _aType = new Standard_Type("SALOME_TypeFilter", - sizeof(SALOME_TypeFilter), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(SALOME_TypeFilter), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OCCViewer/OCCViewer_ClippingDlg.cxx b/src/OCCViewer/OCCViewer_ClippingDlg.cxx index 11213fd38..0a7e75f97 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.cxx +++ b/src/OCCViewer/OCCViewer_ClippingDlg.cxx @@ -325,7 +325,7 @@ void OCCViewer_ClippingDlg::ClickOnApply() qApp->processEvents(); myView->setCuttingPlane( true, SpinBox_X->value() , SpinBox_Y->value() , SpinBox_Z->value(), - SpinBox_Dx->value(), SpinBox_Dy->value(), SpinBox_Dz->value() ); + SpinBox_Dx->value(), SpinBox_Dy->value(), SpinBox_Dz->value() ); QApplication::restoreOverrideCursor(); @@ -496,7 +496,7 @@ void OCCViewer_ClippingDlg::displayPreview() intersector.Perform( gp_Lin( aCenter, aNormal), gp_Pln( aBasePnt, aNormal), Precision::Confusion() ); if ( intersector.IsDone() && intersector.NbPoints() == 1 ) - aBasePnt = intersector.Point( 1 ); + aBasePnt = intersector.Point( 1 ); } myPreviewPlane = new AIS_Plane( new Geom_Plane( aBasePnt, aNormal ) ); @@ -579,7 +579,7 @@ void OCCViewer_ClippingDlg::ReserveClippingPlane() { aView3d->InitActivePlanes(); if ( aView3d->MoreActivePlanes() ) - myClippingPlane = aView3d->ActivePlane(); + myClippingPlane = aView3d->ActivePlane(); } } diff --git a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx index f1980d61d..718e9a61c 100755 --- a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx +++ b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx @@ -43,7 +43,7 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O myKeyFlag = 0; int aQuantityOfItems = myParametersMap.count(); - + setFixedSize( 400, 300 ); QGridLayout* aGrid = new QGridLayout( this ); @@ -52,9 +52,9 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O QWidget* aWidget1 = new QWidget( this ); QWidget* aWidget2 = new QWidget( this ); - + QHBoxLayout* aLayout = new QHBoxLayout( aWidget1 ); - + myListBox = new QListWidget( aWidget1 ); myListBox->installEventFilter( this ); @@ -62,7 +62,7 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O myCurViewPort->getView()->SetBackgroundColor( Quantity_NOC_BLACK ); myListBox->setEditTriggers( QAbstractItemView::DoubleClicked ); - + if ( aQuantityOfItems ) { myListBox->clear(); @@ -81,7 +81,7 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O connect( myListBox, SIGNAL( itemClicked( QListWidgetItem* ) ), this, SLOT( changeImage( QListWidgetItem* ) ) ); connect( myListBox, SIGNAL( itemChanged( QListWidgetItem* ) ), this, SLOT( editItemText( QListWidgetItem* ) ) ); - + aLayout->addWidget( myListBox ); aLayout->addWidget( myCurViewPort, 30 ); @@ -90,8 +90,8 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O aButtonLayout->setSpacing( 5 ); QPushButton* theOk = new QPushButton( tr( "Ok" ), aWidget2 ); theOk->setAutoDefault( false ); - QPushButton* theCancel = new QPushButton( tr( "Cancel" ), aWidget2 ); theCancel->setAutoDefault( false ); - QPushButton* theDelete = new QPushButton( tr( "Delete" ), aWidget2 ); theDelete->setAutoDefault( false ); + QPushButton* theCancel = new QPushButton( tr( "Cancel" ), aWidget2 ); theCancel->setAutoDefault( false ); + QPushButton* theDelete = new QPushButton( tr( "Delete" ), aWidget2 ); theDelete->setAutoDefault( false ); QPushButton* theClearAll = new QPushButton( tr( "Clear List" ), aWidget2 ); theClearAll->setAutoDefault( false ); aButtonLayout->addWidget( theOk ); @@ -101,7 +101,7 @@ OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, O aGrid->addWidget( aWidget1, 0, 0 ); aGrid->addWidget( aWidget2, 1, 0 ); - + connect( theOk, SIGNAL( clicked() ), this, SLOT( OKpressed() ) ); connect( theCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( theDelete, SIGNAL( clicked() ), this, SLOT( deleteSelectedItems() ) ); @@ -130,25 +130,25 @@ void OCCViewer_CreateRestoreViewDlg::changeImage( QListWidgetItem* curItem ) { for( int i = 0; i < (int)myListBox->count(); i++ ) { - if( myListBox->item( i )->isSelected() && i != index ) - { - myListBox->clearSelection(); - if( i > index ) - { - lowLevel = index; - highLevel = i; - } - else - { - lowLevel = i; - highLevel = index; - } - for( int j = lowLevel; j <= highLevel; j++ ) - myListBox->item( j )->setSelected( TRUE ); - break; - } - if( myListBox->item( i )->isSelected() && i == index ) - myListBox->item( i )->setSelected( TRUE ); + if( myListBox->item( i )->isSelected() && i != index ) + { + myListBox->clearSelection(); + if( i > index ) + { + lowLevel = index; + highLevel = i; + } + else + { + lowLevel = i; + highLevel = index; + } + for( int j = lowLevel; j <= highLevel; j++ ) + myListBox->item( j )->setSelected( TRUE ); + break; + } + if( myListBox->item( i )->isSelected() && i == index ) + myListBox->item( i )->setSelected( TRUE ); } } @@ -186,18 +186,18 @@ void OCCViewer_CreateRestoreViewDlg::deleteSelectedItems() for( int i = 0; i < (int)myListBox->count(); i++ ) if( myListBox->item( i )->isSelected() && ( myListBox->item( i )->flags() & Qt::ItemIsEditable ) ) { - QListWidgetItem* anItemToDelete = myListBox->takeItem( i ); - delete anItemToDelete; - for( int j = i; j < (int)myParametersMap.count(); j++ ) - if( j != myParametersMap.count() - 1 ) - myParametersMap[ j ] = myParametersMap[ j + 1 ]; - else - myParametersMap.removeAt( j ); - if( i != myListBox->count() ) - curIndex = i; - else - curIndex = i - 1; - i--; + QListWidgetItem* anItemToDelete = myListBox->takeItem( i ); + delete anItemToDelete; + for( int j = i; j < (int)myParametersMap.count(); j++ ) + if( j != myParametersMap.count() - 1 ) + myParametersMap[ j ] = myParametersMap[ j + 1 ]; + else + myParametersMap.removeAt( j ); + if( i != myListBox->count() ) + curIndex = i; + else + curIndex = i - 1; + i--; } if( curIndex >= 0 ) { @@ -252,12 +252,12 @@ bool OCCViewer_CreateRestoreViewDlg::eventFilter( QObject* anObj, QEvent* anEv ) if( aKeyEv->key() == Qt::Key_Control ) { myKeyFlag = 1; - myListBox->setSelectionMode( QAbstractItemView::MultiSelection ); + myListBox->setSelectionMode( QAbstractItemView::MultiSelection ); } else if( aKeyEv->key() == Qt::Key_Shift ) { myKeyFlag = 2; - myListBox->setSelectionMode( QAbstractItemView::MultiSelection ); + myListBox->setSelectionMode( QAbstractItemView::MultiSelection ); } else myListBox->setSelectionMode( QAbstractItemView::SingleSelection ); diff --git a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.h b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.h index 1a08d04ea..bc67b5468 100755 --- a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.h +++ b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.h @@ -43,32 +43,32 @@ class QListWidgetItem; class OCCVIEWER_EXPORT OCCViewer_CreateRestoreViewDlg : public QDialog { - Q_OBJECT + Q_OBJECT public: - OCCViewer_CreateRestoreViewDlg( QWidget*, OCCViewer_Viewer* ); - virtual ~OCCViewer_CreateRestoreViewDlg(); + OCCViewer_CreateRestoreViewDlg( QWidget*, OCCViewer_Viewer* ); + virtual ~OCCViewer_CreateRestoreViewDlg(); - const viewAspectList& parameters() const; - viewAspect currentItem() const; - virtual bool eventFilter( QObject*, QEvent* ); + const viewAspectList& parameters() const; + viewAspect currentItem() const; + virtual bool eventFilter( QObject*, QEvent* ); public slots: - void OKpressed(); - void clearList(); - void editItemText( QListWidgetItem* ); - void changeImage( QListWidgetItem* ); - void deleteSelectedItems(); + void OKpressed(); + void clearList(); + void editItemText( QListWidgetItem* ); + void changeImage( QListWidgetItem* ); + void deleteSelectedItems(); signals: - void dlgOk(); + void dlgOk(); private: - int myKeyFlag; - QListWidget* myListBox; - OCCViewer_ViewPort3d* myCurViewPort; - viewAspect myCurrentItem; - viewAspectList myParametersMap; + int myKeyFlag; + QListWidget* myListBox; + OCCViewer_ViewPort3d* myCurViewPort; + viewAspect myCurrentItem; + viewAspectList myParametersMap; }; #ifdef WIN32 diff --git a/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx b/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx index 8d8b6b696..4e4f95d97 100644 --- a/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx +++ b/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx @@ -208,8 +208,8 @@ OCCViewer_SetRotationPointDlg } else myView->activateSetRotationSelected(myX->text().toDouble(), - myY->text().toDouble(), - myZ->text().toDouble()); + myY->text().toDouble(), + myZ->text().toDouble()); } void @@ -220,8 +220,8 @@ OCCViewer_SetRotationPointDlg mySelectPoint->toggle(); setCoords(); myView->activateSetRotationSelected(myX->text().toDouble(), - myY->text().toDouble(), - myZ->text().toDouble()); + myY->text().toDouble(), + myZ->text().toDouble()); } void @@ -241,12 +241,12 @@ OCCViewer_SetRotationPointDlg if ( !myIsBBCenter->isChecked() ) { if ( mySelectPoint->isChecked() - && - ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) ) + && + ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) ) mySelectPoint->toggle(); myView->activateSetRotationSelected(myX->text().toDouble(), - myY->text().toDouble(), - myZ->text().toDouble()); + myY->text().toDouble(), + myZ->text().toDouble()); } } diff --git a/src/OCCViewer/OCCViewer_SetRotationPointDlg.h b/src/OCCViewer/OCCViewer_SetRotationPointDlg.h index 03651d66c..cc3a907ae 100644 --- a/src/OCCViewer/OCCViewer_SetRotationPointDlg.h +++ b/src/OCCViewer/OCCViewer_SetRotationPointDlg.h @@ -41,7 +41,7 @@ class OCCVIEWER_EXPORT OCCViewer_SetRotationPointDlg : public QDialog public: OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* , QWidget* parent = 0, - const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0); + const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0); ~OCCViewer_SetRotationPointDlg(); void SetAction( QtxAction* theAction ) { myAction = theAction; } diff --git a/src/OCCViewer/OCCViewer_ToolTip.cxx b/src/OCCViewer/OCCViewer_ToolTip.cxx index 3efef8d2b..03ff55fff 100644 --- a/src/OCCViewer/OCCViewer_ToolTip.cxx +++ b/src/OCCViewer/OCCViewer_ToolTip.cxx @@ -41,7 +41,7 @@ OCCViewer_ToolTip::OCCViewer_ToolTip( OCCViewer_ViewWindow* wnd ) myWnd( wnd ) { connect( this, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ), - this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) ); + this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) ); } /*! diff --git a/src/OCCViewer/OCCViewer_Trihedron.cxx b/src/OCCViewer/OCCViewer_Trihedron.cxx index e875d9af9..3637ca04e 100755 --- a/src/OCCViewer/OCCViewer_Trihedron.cxx +++ b/src/OCCViewer/OCCViewer_Trihedron.cxx @@ -88,8 +88,8 @@ void OCCViewer_Trihedron::bounds( Graphic3d_CBounds& aMinMax ) const * Redefined method. Calculates the object presentation. */ void OCCViewer_Trihedron::Compute( const Handle( PrsMgr_PresentationManager3d )&, - const Handle( Prs3d_Presentation )& aPrs, - const Standard_Integer aMode ) + const Handle( Prs3d_Presentation )& aPrs, + const Standard_Integer aMode ) { if( aPrs.IsNull() ) return; @@ -102,7 +102,7 @@ void OCCViewer_Trihedron::Compute( const Handle( PrsMgr_PresentationManager3d )& * Redefined method. Does nothing. */ void OCCViewer_Trihedron::ComputeSelection( const Handle( SelectMgr_Selection )& theSelection, - const Standard_Integer theMode ) + const Standard_Integer theMode ) { } diff --git a/src/OCCViewer/OCCViewer_Trihedron.h b/src/OCCViewer/OCCViewer_Trihedron.h index 549e592e0..87ea6645f 100644 --- a/src/OCCViewer/OCCViewer_Trihedron.h +++ b/src/OCCViewer/OCCViewer_Trihedron.h @@ -39,11 +39,11 @@ public: virtual ~OCCViewer_Trihedron(); virtual void Compute( const Handle(PrsMgr_PresentationManager3d)&, - const Handle(Prs3d_Presentation)&, - const Standard_Integer ); + const Handle(Prs3d_Presentation)&, + const Standard_Integer ); virtual void ComputeSelection( const Handle( SelectMgr_Selection )&, - const Standard_Integer ); + const Standard_Integer ); virtual void bounds( Graphic3d_CBounds& ) const; diff --git a/src/OCCViewer/OCCViewer_VService.cxx b/src/OCCViewer/OCCViewer_VService.cxx index 02f104d7e..af826923d 100755 --- a/src/OCCViewer/OCCViewer_VService.cxx +++ b/src/OCCViewer/OCCViewer_VService.cxx @@ -84,9 +84,9 @@ return XServiceImageDevice; Create native view window for CasCade view [ static ] */ Handle(Aspect_Window) OCCViewer_VService::CreateWindow( const Handle(V3d_View)& view, - const Standard_Integer hiwin, - const Standard_Integer lowin, - const Xw_WindowQuality quality ) + const Standard_Integer hiwin, + const Standard_Integer lowin, + const Xw_WindowQuality quality ) { #ifdef WNT Handle(WNT_Window) viewWindow = new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin ); @@ -102,9 +102,9 @@ Handle(Aspect_Window) OCCViewer_VService::CreateWindow( const Handle(V3d_View)& Maps CasCade view to the window [ static ] */ void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view, - const Standard_Integer hiwin, - const Standard_Integer lowin, - const Xw_WindowQuality quality ) + const Standard_Integer hiwin, + const Standard_Integer lowin, + const Xw_WindowQuality quality ) { view->SetWindow( OCCViewer_VService::CreateWindow( view, hiwin, lowin, quality ) ); } @@ -113,13 +113,13 @@ void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view, Magnifies 'view' based on previous view [ static ] */ void OCCViewer_VService::SetMagnify( const Handle(V3d_View)& view, - const Standard_Integer hiwin, - const Standard_Integer lowin, - const Handle(V3d_View)& prevView, - const Standard_Integer x1, - const Standard_Integer y1, - const Standard_Integer x2, - const Standard_Integer y2, + const Standard_Integer hiwin, + const Standard_Integer lowin, + const Handle(V3d_View)& prevView, + const Standard_Integer x1, + const Standard_Integer y1, + const Standard_Integer x2, + const Standard_Integer y2, const Xw_WindowQuality aQuality ) { #ifdef WNT @@ -164,11 +164,11 @@ Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay Creates view 2D and maps it to the window [ static ] */ /*Handle(V2d_View) OCCViewer_VService::View2d( const Handle(V2d_Viewer)& aViewer, - const Standard_Integer hiwin, - const Standard_Integer lowin, - const Xw_WindowQuality aQuality, - const Standard_Boolean Update, - const Quantity_NameOfColor BackColor ) + const Standard_Integer hiwin, + const Standard_Integer lowin, + const Xw_WindowQuality aQuality, + const Standard_Boolean Update, + const Quantity_NameOfColor BackColor ) { #ifdef WNT Handle(WNT_GraphicDevice) GD = Handle(WNT_GraphicDevice)::DownCast(aViewer->Device()); @@ -189,11 +189,11 @@ Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay Creates view 2D and maps it to the window [ static ] */ /*Handle(V2d_View) OCCViewer_VService::dpsView2d( const Handle(V2d_Viewer)& aViewer, - const Standard_Integer hiwin, - const Standard_Integer lowin, - const Xw_WindowQuality aQuality, - const Standard_Boolean Update, - const Quantity_NameOfColor BackColor ) + const Standard_Integer hiwin, + const Standard_Integer lowin, + const Xw_WindowQuality aQuality, + const Standard_Boolean Update, + const Quantity_NameOfColor BackColor ) { #ifdef WNT Handle(WNT_GraphicDevice) GD = Handle(WNT_GraphicDevice)::DownCast(aViewer->Device()); @@ -215,8 +215,8 @@ Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay Creates viewer 2D [ static ] */ /*Handle(V2d_Viewer) OCCViewer_VService::Viewer2d( const Standard_CString aDisplay, - const Standard_ExtString aName, - const Standard_CString aDomain ) + const Standard_ExtString aName, + const Standard_CString aDomain ) { #ifdef WNT if ( XServiceDefault2dDevice.IsNull() ) @@ -232,9 +232,9 @@ Handle(V3d_Viewer) OCCViewer_VService::Viewer3d( const Standard_CString aDisplay Creates viewer 2D [ static ] */ /*Handle(V2d_Viewer) OCCViewer_VService::Viewer2d( const Standard_CString aDisplay, - const Handle(Graphic2d_View)& aView, - const Standard_ExtString aName, - const Standard_CString aDomain ) + const Handle(Graphic2d_View)& aView, + const Standard_ExtString aName, + const Standard_CString aDomain ) { #ifdef WNT if ( XServiceDefault2dDevice.IsNull() ) diff --git a/src/OCCViewer/OCCViewer_VService.h b/src/OCCViewer/OCCViewer_VService.h index 2e7b392f6..aa2889a13 100755 --- a/src/OCCViewer/OCCViewer_VService.h +++ b/src/OCCViewer/OCCViewer_VService.h @@ -95,9 +95,9 @@ public: // STATIC METHODS static Handle(Aspect_Window) CreateWindow( const Handle(V3d_View)& view, - const Standard_Integer hiwin, - const Standard_Integer lowin, - const Xw_WindowQuality quality ); + const Standard_Integer hiwin, + const Standard_Integer lowin, + const Xw_WindowQuality quality ); static void SetWindow( const Handle( V3d_View )& view, const Standard_Integer hiwin, diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 8f8e8fabf..9e9753410 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -180,7 +180,7 @@ void OCCViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager) SUIT_ViewModel::setViewManager(theViewManager); if (theViewManager) { connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), - this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*))); + this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*))); connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)), this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*))); @@ -415,7 +415,7 @@ void OCCViewer_Viewer::onClearViewAspects() */ void OCCViewer_Viewer::clearViewAspects() { - myViewAspects.clear(); + myViewAspects.clear(); } /*! @@ -423,7 +423,7 @@ void OCCViewer_Viewer::clearViewAspects() */ const viewAspectList& OCCViewer_Viewer::getViewAspects() { - return myViewAspects; + return myViewAspects; } /*! @@ -432,7 +432,7 @@ const viewAspectList& OCCViewer_Viewer::getViewAspects() */ void OCCViewer_Viewer::appendViewAspect( const viewAspect& aParams ) { - myViewAspects.append( aParams ); + myViewAspects.append( aParams ); } /*! @@ -441,7 +441,7 @@ void OCCViewer_Viewer::appendViewAspect( const viewAspect& aParams ) */ void OCCViewer_Viewer::updateViewAspects( const viewAspectList& aViewList ) { - myViewAspects = aViewList; + myViewAspects = aViewList; } /*! diff --git a/src/OCCViewer/OCCViewer_ViewModel.h b/src/OCCViewer/OCCViewer_ViewModel.h index dbddfa239..9bf960ef9 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.h +++ b/src/OCCViewer/OCCViewer_ViewModel.h @@ -44,25 +44,25 @@ class AIS_ListOfInteractive; struct viewAspect { public: - double scale; - double centerX; - double centerY; - double projX; - double projY; - double projZ; - double twist; - double atX; - double atY; - double atZ; - double eyeX; - double eyeY; - double eyeZ; + double scale; + double centerX; + double centerY; + double projX; + double projY; + double projZ; + double twist; + double atX; + double atY; + double atZ; + double eyeX; + double eyeY; + double eyeZ; double scaleX; double scaleY; double scaleZ; - QString name; - bool isVisible; - double size; + QString name; + bool isVisible; + double size; }; typedef QList viewAspectList; @@ -135,7 +135,7 @@ public: /* Selection management */ bool highlight( const Handle(AIS_InteractiveObject)&, bool, bool=true ); - bool unHighlightAll( bool=true ); + bool unHighlightAll( bool=true ); bool isInViewer( const Handle(AIS_InteractiveObject)&, bool=false ); bool isVisible( const Handle(AIS_InteractiveObject)& ); diff --git a/src/OCCViewer/OCCViewer_ViewPort.cxx b/src/OCCViewer/OCCViewer_ViewPort.cxx index bd6251137..f7b7f77a6 100755 --- a/src/OCCViewer/OCCViewer_ViewPort.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort.cxx @@ -52,11 +52,11 @@ struct CMapEntry { - CMapEntry(); - ~CMapEntry(); - Colormap cmap; - bool alloc; - XStandardColormap scmap; + CMapEntry(); + ~CMapEntry(); + Colormap cmap; + bool alloc; + XStandardColormap scmap; }; /*! @@ -64,9 +64,9 @@ struct CMapEntry */ CMapEntry::CMapEntry() { - cmap = 0; - alloc = false; - scmap.colormap = 0; + cmap = 0; + alloc = false; + scmap.colormap = 0; } /*! @@ -74,8 +74,8 @@ CMapEntry::CMapEntry() */ CMapEntry::~CMapEntry() { - if ( alloc ) - XFreeColormap( QX11Info::display(), cmap ); + if ( alloc ) + XFreeColormap( QX11Info::display(), cmap ); } static QMultiHash *cmap_dict = 0; @@ -83,13 +83,13 @@ static bool mesa_gl = false; static void cleanup_cmaps() { - if ( !cmap_dict ) - return; - //while (!cmap_dict->isEmpty()) - // cmap_dict->erase(cmap_dict->begin()); - cmap_dict->clear(); - delete cmap_dict; - cmap_dict = 0; + if ( !cmap_dict ) + return; + //while (!cmap_dict->isEmpty()) + // cmap_dict->erase(cmap_dict->begin()); + cmap_dict->clear(); + delete cmap_dict; + cmap_dict = 0; } static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) @@ -130,17 +130,17 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) { if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, hp_cmaps ) ) { - i = 0; - while ( i < n && x.cmap == 0 ) - { - if ( c[i].visualid == vi->visual->visualid ) - { - x.cmap = c[i].colormap; - x.scmap = c[i]; - } - i++; - } - XFree( (char*)c ); + i = 0; + while ( i < n && x.cmap == 0 ) + { + if ( c[i].visualid == vi->visual->visualid ) + { + x.cmap = c[i].colormap; + x.scmap = c[i]; + } + i++; + } + XFree( (char*)c ); } } } @@ -151,17 +151,17 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) { if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, XA_RGB_DEFAULT_MAP ) ) { - i = 0; - while ( i < n && x.cmap == 0 ) - { - if ( c[i].visualid == vi->visualid ) - { - x.cmap = c[i].colormap; - x.scmap = c[i]; - } - i++; - } - XFree( (char *)c ); + i = 0; + while ( i < n && x.cmap == 0 ) + { + if ( c[i].visualid == vi->visualid ) + { + x.cmap = c[i].colormap; + x.scmap = c[i]; + } + i++; + } + XFree( (char *)c ); } } } @@ -185,7 +185,7 @@ static Colormap choose_cmap( Display *dpy, XVisualInfo *vi ) OCCViewer_ViewPort::OCCViewer_ViewPort( QWidget* parent ) : QWidget( parent ) { - initialize(); + initialize(); } /*! @@ -193,7 +193,7 @@ OCCViewer_ViewPort::OCCViewer_ViewPort( QWidget* parent ) */ OCCViewer_ViewPort::~OCCViewer_ViewPort() { - cleanup(); + cleanup(); } /*! @@ -226,33 +226,33 @@ void OCCViewer_ViewPort::cleanup() void OCCViewer_ViewPort::selectVisualId() { #if !defined WNT - XVisualInfo* pVisualInfo; - if ( QX11Info::display() ) - { - /* Initialization with the default VisualID */ - Visual *v = DefaultVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ) ); - int visualID = XVisualIDFromVisual( v ); + XVisualInfo* pVisualInfo; + if ( QX11Info::display() ) + { + /* Initialization with the default VisualID */ + Visual *v = DefaultVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ) ); + int visualID = XVisualIDFromVisual( v ); - /* Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */ - int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None }; + /* Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */ + int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None }; - pVisualInfo = ::glXChooseVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ), visualAttr ); + pVisualInfo = ::glXChooseVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ), visualAttr ); - if ( isVisible() ) - hide(); + if ( isVisible() ) + hide(); - XSetWindowAttributes a; + XSetWindowAttributes a; - a.colormap = choose_cmap( QX11Info::display(), pVisualInfo ); /* find best colormap */ - a.background_pixel = QColormap::instance().pixel( backgroundColor() ); - a.border_pixel = QColormap::instance().pixel( Qt::black ); - Window p = RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) ); - if ( parentWidget() ) - p = parentWidget()->winId(); + a.colormap = choose_cmap( QX11Info::display(), pVisualInfo ); /* find best colormap */ + a.background_pixel = QColormap::instance().pixel( backgroundColor() ); + a.border_pixel = QColormap::instance().pixel( Qt::black ); + Window p = RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) ); + if ( parentWidget() ) + p = parentWidget()->winId(); - Window w; - /* if ( type == Type2D ) // creating simple X window for 2d + Window w; + /* if ( type == Type2D ) // creating simple X window for 2d { unsigned long xbackground = BlackPixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) ); @@ -264,59 +264,59 @@ void OCCViewer_ViewPort::selectVisualId() } else if ( type == Type3D ) { - w = XCreateWindow( QX11Info::display(), p, x(), y(), width(), height(), + w = XCreateWindow( QX11Info::display(), p, x(), y(), width(), height(), 0, pVisualInfo->depth, InputOutput, pVisualInfo->visual, CWBackPixel | CWBorderPixel | CWColormap, &a ); - } - else - return;*/ - w = XCreateWindow( QX11Info::display(), p, x(), y(), width(), height(), - 0, pVisualInfo->depth, InputOutput, pVisualInfo->visual, - CWBackPixel | CWBorderPixel | CWColormap, &a ); - - Window *cmw; - Window *cmwret; - int count; - if ( XGetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), &cmwret, &count ) ) - { - cmw = new Window[count+1]; - memcpy( (char*)cmw, (char*)cmwret, sizeof(Window) * count ); - XFree( (char*)cmwret ); + } + else + return;*/ + w = XCreateWindow( QX11Info::display(), p, x(), y(), width(), height(), + 0, pVisualInfo->depth, InputOutput, pVisualInfo->visual, + CWBackPixel | CWBorderPixel | CWColormap, &a ); + + Window *cmw; + Window *cmwret; + int count; + if ( XGetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), &cmwret, &count ) ) + { + cmw = new Window[count+1]; + memcpy( (char*)cmw, (char*)cmwret, sizeof(Window) * count ); + XFree( (char*)cmwret ); int i; - for ( i = 0; i < count; i++ ) - { - if ( cmw[i] == winId() ) /* replace old window */ - { - cmw[i] = w; - break; - } - } - - if ( i >= count ) /* append new window */ - cmw[count++] = w; - } - else - { - count = 1; - cmw = new Window[count]; - cmw[0] = w; - } - - /* Creating new window (with good VisualID) for this widget */ - create(w); - XSetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), cmw, count ); - delete[] cmw; - - if ( isVisible() ) + for ( i = 0; i < count; i++ ) + { + if ( cmw[i] == winId() ) /* replace old window */ + { + cmw[i] = w; + break; + } + } + + if ( i >= count ) /* append new window */ + cmw[count++] = w; + } + else + { + count = 1; + cmw = new Window[count]; + cmw[0] = w; + } + + /* Creating new window (with good VisualID) for this widget */ + create(w); + XSetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), cmw, count ); + delete[] cmw; + + if ( isVisible() ) show(); - if ( pVisualInfo ) + if ( pVisualInfo ) { - XFree( (char *)pVisualInfo ); - } - XFlush( QX11Info::display() ); - } + XFree( (char *)pVisualInfo ); + } + XFlush( QX11Info::display() ); + } #endif } @@ -353,7 +353,7 @@ bool OCCViewer_ViewPort::isSketchingEnabled() const */ void OCCViewer_ViewPort::setSketchingEnabled( bool enable ) { - myEnableSketching = enable; + myEnableSketching = enable; } /*! @@ -370,7 +370,7 @@ bool OCCViewer_ViewPort::isTransformEnabled() const */ void OCCViewer_ViewPort::setTransformEnabled( bool enable ) { - myEnableTransform = enable; + myEnableTransform = enable; } /*! @@ -426,12 +426,12 @@ void OCCViewer_ViewPort::keyReleaseEvent( QKeyEvent *e ) */ void OCCViewer_ViewPort::paintEvent( QPaintEvent* ) { - if ( myPaintersRedrawing ) - { - QPainter p( this ); - emit vpDrawExternal( &p ); - myPaintersRedrawing = false; - } + if ( myPaintersRedrawing ) + { + QPainter p( this ); + emit vpDrawExternal( &p ); + myPaintersRedrawing = false; + } } /*! @@ -439,8 +439,8 @@ void OCCViewer_ViewPort::paintEvent( QPaintEvent* ) */ void OCCViewer_ViewPort::redrawPainters() { - myPaintersRedrawing = true; - repaint(); + myPaintersRedrawing = true; + repaint(); } /*! @@ -463,14 +463,14 @@ QPaintEngine* OCCViewer_ViewPort::paintEngine() const */ /*void OCCViewer_ViewPort::onCreatePopup( QPopupMenu* popup ) { - if ( popup ) - { - QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this ); + if ( popup ) + { + QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this ); a->setStatusTip( tr( "PRP_VP_CHANGEBGR" ) ); - connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor())); - myPopupActions.append( a ); - a->addTo( popup ); - } + connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor())); + myPopupActions.append( a ); + a->addTo( popup ); + } }*/ /*! @@ -478,14 +478,14 @@ QPaintEngine* OCCViewer_ViewPort::paintEngine() const */ /*void OCCViewer_ViewPort::onDestroyPopup( QPopupMenu* popup ) { - if ( popup ) - { - for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() ) - a->removeFrom( popup ); - //while (!myPopupActions.isEmpty()) - // delete myPopupActions.takeFirst(); - myPopupActions.clear(); - } + if ( popup ) + { + for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() ) + a->removeFrom( popup ); + //while (!myPopupActions.isEmpty()) + // delete myPopupActions.takeFirst(); + myPopupActions.clear(); + } }*/ /*! diff --git a/src/OCCViewer/OCCViewer_ViewPort.h b/src/OCCViewer/OCCViewer_ViewPort.h index 74c22f68c..5f038cd11 100755 --- a/src/OCCViewer/OCCViewer_ViewPort.h +++ b/src/OCCViewer/OCCViewer_ViewPort.h @@ -55,67 +55,67 @@ public: virtual ~OCCViewer_ViewPort(); public: - void setSketchingEnabled( bool ); + void setSketchingEnabled( bool ); bool isSketchingEnabled() const; - void setTransformEnabled( bool ); + void setTransformEnabled( bool ); bool isTransformEnabled() const; virtual QColor backgroundColor() const; virtual void setBackgroundColor( const QColor& ); - void redrawPainters(); + void redrawPainters(); virtual void onUpdate(); virtual QPaintEngine* paintEngine() const; protected: -// enum ViewType { Type2D, Type3D }; - void selectVisualId(); +// enum ViewType { Type2D, Type3D }; + void selectVisualId(); // EVENTS virtual void paintEvent( QPaintEvent *); - virtual void mouseMoveEvent( QMouseEvent *); - virtual void mouseReleaseEvent( QMouseEvent *); - virtual void mousePressEvent( QMouseEvent *); - virtual void mouseDoubleClickEvent( QMouseEvent *); + virtual void mouseMoveEvent( QMouseEvent *); + virtual void mouseReleaseEvent( QMouseEvent *); + virtual void mousePressEvent( QMouseEvent *); + virtual void mouseDoubleClickEvent( QMouseEvent *); virtual void keyPressEvent( QKeyEvent *); virtual void keyReleaseEvent( QKeyEvent *); // TO BE REDEFINED - virtual void reset() = 0; - virtual void pan( int, int ) = 0; - virtual void setCenter( int, int ) = 0; - virtual void fitRect( const QRect& ) = 0; - virtual void zoom( int, int, int, int ) = 0; - virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0; + virtual void reset() = 0; + virtual void pan( int, int ) = 0; + virtual void setCenter( int, int ) = 0; + virtual void fitRect( const QRect& ) = 0; + virtual void zoom( int, int, int, int ) = 0; + virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0; // POPUP // void onCreatePopup( QPopupMenu* ); // void onDestroyPopup( QPopupMenu* ); protected slots: - virtual void onChangeBgColor(); + virtual void onChangeBgColor(); signals: - void vpKeyEvent( QKeyEvent* ); - void vpMouseEvent( QMouseEvent* ); - void vpDrawExternal( QPainter* ); + void vpKeyEvent( QKeyEvent* ); + void vpMouseEvent( QMouseEvent* ); + void vpDrawExternal( QPainter* ); void vpChangeBGColor( QColor ); private: - void initialize(); - void cleanup(); + void initialize(); + void cleanup(); protected: Handle(Aspect_Window) myWindow; - bool myEnableSketching; - bool myEnableTransform; - bool myPaintersRedrawing; /* set to draw externally */ + bool myEnableSketching; + bool myEnableTransform; + bool myPaintersRedrawing; /* set to draw externally */ QList myPopupActions; private: - static int nCounter; /* objects counter */ + static int nCounter; /* objects counter */ }; #ifdef WIN32 diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index 523018d33..40876920c 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -187,10 +187,10 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref ) /* Syncronize view types */ /* if ( tgtView->Type() != refView->Type() ) - { - setActive( refView->Type() ); - tgtView = getView(); - }*/ + { + setActive( refView->Type() ); + tgtView = getView(); + }*/ /* The following params are copied: - view type( ortho/persp ) @@ -244,7 +244,7 @@ void OCCViewer_ViewPort3d::setZSize( double zsize ) myActiveView->SetZSize( zsize ); /* if ( !myOrthoView.IsNull() ) myOrthoView->SetZSize( zsize ); - if ( !myPerspView.IsNull() ) + if ( !myPerspView.IsNull() ) myPerspView->SetZSize( zsize );*/ } @@ -271,7 +271,7 @@ void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color ) { if ( !activeView().IsNull() ) { activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255., - color.green()/255., color.blue()/255.); + color.green()/255., color.blue()/255.); activeView()->Update(); emit vpChangeBGColor( color ); } @@ -342,8 +342,8 @@ void OCCViewer_ViewPort3d::pan( int dx, int dy ) Inits 'rotation' transformation. [ protected ] */ void OCCViewer_ViewPort3d::startRotation( int x, int y, - int theRotationPointType, - const gp_Pnt& theSelectedPoint ) + int theRotationPointType, + const gp_Pnt& theSelectedPoint ) { if ( !activeView().IsNull() ) { myDegenerated = activeView()->DegenerateModeIsOn(); @@ -367,17 +367,17 @@ void OCCViewer_ViewPort3d::startRotation( int x, int y, ry = Standard_Real(activeView()->Convert(Y)); activeView()->Rotate( 0., 0., 0., - theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(), - Standard_True ); + theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(), + Standard_True ); Quantity_Ratio zRotationThreshold; zRotation = Standard_False; zRotationThreshold = 0.45; if( zRotationThreshold > 0. ) { - Standard_Real dx = Abs(sx - rx/2.); - Standard_Real dy = Abs(sy - ry/2.); - Standard_Real dd = zRotationThreshold * (rx + ry)/2.; - if( dx > dd || dy > dd ) zRotation = Standard_True; + Standard_Real dx = Abs(sx - rx/2.); + Standard_Real dy = Abs(sy - ry/2.); + Standard_Real dd = zRotationThreshold * (rx + ry)/2.; + if( dx > dd || dy > dd ) zRotation = Standard_True; } break; default: @@ -390,8 +390,8 @@ void OCCViewer_ViewPort3d::startRotation( int x, int y, Rotates the viewport. [ protected ] */ void OCCViewer_ViewPort3d::rotate( int x, int y, - int theRotationPointType, - const gp_Pnt& theSelectedPoint ) + int theRotationPointType, + const gp_Pnt& theSelectedPoint ) { if ( !activeView().IsNull() ) { switch ( theRotationPointType ) { @@ -401,19 +401,19 @@ void OCCViewer_ViewPort3d::rotate( int x, int y, case OCCViewer_ViewWindow::SELECTED: double dx, dy, dz; if( zRotation ) { - dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) - - atan2(sx-rx/2.,ry/2.-sy); - dx = dy = 0.; + dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) - + atan2(sx-rx/2.,ry/2.-sy); + dx = dy = 0.; } else { - dx = (Standard_Real(x) - sx) * Standard_PI/rx; - dy = (sy - Standard_Real(y)) * Standard_PI/ry; - dz = 0.; + dx = (Standard_Real(x) - sx) * Standard_PI/rx; + dy = (sy - Standard_Real(y)) * Standard_PI/ry; + dz = 0.; } activeView()->Rotate( dx, dy, dz, - theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(), - Standard_False ); + theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(), + Standard_False ); break; default: break; diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.h b/src/OCCViewer/OCCViewer_ViewPort3d.h index 41d2c6744..7cb9fb20c 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.h +++ b/src/OCCViewer/OCCViewer_ViewPort3d.h @@ -47,13 +47,13 @@ public: public: Handle(V3d_View) getView() const; - Handle(V3d_View) setView( const Handle(V3d_View)& ); + Handle(V3d_View) setView( const Handle(V3d_View)& ); Handle(V3d_Viewer) getViewer() const; void setAnimationMode(bool theDegenerated); - virtual void setBackgroundColor( const QColor& color); - virtual QColor backgroundColor() const; + virtual void setBackgroundColor( const QColor& color); + virtual QColor backgroundColor() const; // void setActive( V3d_TypeOfView ); virtual bool syncronize( const OCCViewer_ViewPort3d* ); @@ -64,21 +64,21 @@ public: virtual void onUpdate(); // TRANSFORMATIONS - virtual void reset(); - virtual void pan( int , int ); - virtual void setCenter( int , int ); - virtual void fitRect( const QRect& ); - virtual void zoom( int, int, int, int ); - virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ); - - void startRotation( int, int, int, const gp_Pnt& ); - void rotate( int, int, int, const gp_Pnt& ); - void endRotation(); + virtual void reset(); + virtual void pan( int , int ); + virtual void setCenter( int , int ); + virtual void fitRect( const QRect& ); + virtual void zoom( int, int, int, int ); + virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ); + + void startRotation( int, int, int, const gp_Pnt& ); + void rotate( int, int, int, const gp_Pnt& ); + void endRotation(); bool isBusy() {return myBusy;} // check that View Port is fully initialized protected: // EVENTS - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( QPaintEvent* ); virtual void resizeEvent( QResizeEvent* ); // initialization @@ -88,17 +88,17 @@ private: Handle(V3d_View) activeView() const; Handle(V3d_View) inactiveView() const; bool mapView( const Handle(V3d_View)& ); - bool setWindow( const Handle(V3d_View)& ); - bool mapped( const Handle(V3d_View)& ) const; + bool setWindow( const Handle(V3d_View)& ); + bool mapped( const Handle(V3d_View)& ) const; private: - Handle(V3d_View) myOrthoView; - Handle(V3d_View) myPerspView; - Handle(V3d_View) myActiveView; - bool myDegenerated; + Handle(V3d_View) myOrthoView; + Handle(V3d_View) myPerspView; + Handle(V3d_View) myActiveView; + bool myDegenerated; bool myAnimate; bool myBusy; - double myScale; + double myScale; }; #ifdef WIN32 diff --git a/src/OCCViewer/OCCViewer_ViewSketcher.cxx b/src/OCCViewer/OCCViewer_ViewSketcher.cxx index eec828a81..17ca4d8a7 100755 --- a/src/OCCViewer/OCCViewer_ViewSketcher.cxx +++ b/src/OCCViewer/OCCViewer_ViewSketcher.cxx @@ -255,7 +255,7 @@ void OCCViewer_RectSketcher::onMouse( QMouseEvent* e ) myResult = Accept; QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(), e->globalPos(), e->button(), - e->buttons(), e->modifiers() ) ); + e->buttons(), e->modifiers() ) ); } } @@ -432,7 +432,7 @@ void OCCViewer_PolygonSketcher::onMouse( QMouseEvent* e ) myResult = Reject; QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(), e->globalPos(), e->button(), - e->buttons(), e->modifiers() ) ); + e->buttons(), e->modifiers() ) ); } else if ( e->type() == QEvent::MouseButtonRelease && ( e->button() & myAddButton ) ) { @@ -540,7 +540,7 @@ bool OCCViewer_PolygonSketcher::isValid( const QPolygon* aPoints, const QPoint& } bool OCCViewer_PolygonSketcher::isIntersect( const QPoint& aStart1, const QPoint& anEnd1, - const QPoint& aStart2, const QPoint& anEnd2 ) const + const QPoint& aStart2, const QPoint& anEnd2 ) const { if ( ( aStart1 == aStart2 && anEnd1 == anEnd2 ) || ( aStart1 == anEnd2 && anEnd1 == aStart2 ) ) diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index ea102e914..977c462b8 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -198,7 +198,7 @@ const char* imageCrossCursor[] = { \param theModel OCC 3D viewer */ OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop* theDesktop, - OCCViewer_Viewer* theModel ) + OCCViewer_Viewer* theModel ) : SUIT_ViewWindow( theDesktop ) { myModel = theModel; @@ -360,65 +360,65 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent ) case ROTATE: if ( theEvent->button() == Qt::LeftButton ) { - myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint); - emit vpTransformationStarted ( ROTATE ); - } + myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint); + emit vpTransformationStarted ( ROTATE ); + } break; default: /* Try to activate a transformation */ switch ( getButtonState(theEvent) ) { case ZOOMVIEW: - activateZoom(); + activateZoom(); break; case PANVIEW: - activatePanning(); + activatePanning(); break; case ROTATE: - activateRotation(); - myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint); + activateRotation(); + myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint); break; default: if ( myRotationPointSelection ) { - if ( theEvent->button() == Qt::LeftButton ) - { - Handle(AIS_InteractiveContext) ic = myModel->getAISContext(); - ic->Select(); - for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() ) - { - TopoDS_Shape aShape = ic->SelectedShape(); - if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) - { - gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) ); - if ( mySetRotationPointDlg ) - { - myRotationPointSelection = false; - mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z()); - } - } - else - { - myCurrPointType = myPrevPointType; - break; - } - } - if ( ic->NbSelected() == 0 ) myCurrPointType = myPrevPointType; - if ( mySetRotationPointDlg ) mySetRotationPointDlg->toggleChange(); - ic->CloseAllContexts(); - myOperation = NOTHING; - myViewPort->setCursor( myCursor ); - myCursorIsHand = false; - myRotationPointSelection = false; - } + if ( theEvent->button() == Qt::LeftButton ) + { + Handle(AIS_InteractiveContext) ic = myModel->getAISContext(); + ic->Select(); + for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() ) + { + TopoDS_Shape aShape = ic->SelectedShape(); + if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) + { + gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) ); + if ( mySetRotationPointDlg ) + { + myRotationPointSelection = false; + mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z()); + } + } + else + { + myCurrPointType = myPrevPointType; + break; + } + } + if ( ic->NbSelected() == 0 ) myCurrPointType = myPrevPointType; + if ( mySetRotationPointDlg ) mySetRotationPointDlg->toggleChange(); + ic->CloseAllContexts(); + myOperation = NOTHING; + myViewPort->setCursor( myCursor ); + myCursorIsHand = false; + myRotationPointSelection = false; + } } else - emit mousePressed(this, theEvent); + emit mousePressed(this, theEvent); break; } /* notify that we start a transformation */ if ( transformRequested() ) - emit vpTransformationStarted ( myOperation ); + emit vpTransformationStarted ( myOperation ); } if ( transformRequested() ) setTransformInProcess( true ); @@ -438,7 +438,7 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent ) void OCCViewer_ViewWindow::activateZoom() { if ( !transformRequested() && !myCursorIsHand ) - myCursor = cursor(); /* save old cursor */ + myCursor = cursor(); /* save old cursor */ if ( myOperation != ZOOMVIEW ) { QPixmap zoomPixmap (imageZoomCursor); @@ -457,7 +457,7 @@ void OCCViewer_ViewWindow::activateZoom() void OCCViewer_ViewWindow::activatePanning() { if ( !transformRequested() && !myCursorIsHand ) - myCursor = cursor(); // save old cursor + myCursor = cursor(); // save old cursor if ( myOperation != PANVIEW ) { QCursor panCursor (Qt::SizeAllCursor); @@ -474,7 +474,7 @@ void OCCViewer_ViewWindow::activatePanning() void OCCViewer_ViewWindow::activateRotation() { if ( !transformRequested() && !myCursorIsHand ) - myCursor = cursor(); // save old cursor + myCursor = cursor(); // save old cursor if ( myOperation != ROTATE ) { QPixmap rotatePixmap (imageRotateCursor); @@ -666,7 +666,7 @@ void OCCViewer_ViewWindow::activateGlobalPanning() QCursor glPanCursor (globalPanPixmap); myCurScale = aView3d->Scale(); aView3d->FitAll(0.01, false); - myCursor = cursor(); // save old cursor + myCursor = cursor(); // save old cursor myViewPort->fitAll(); // fits view before selecting a new scene center setTransformRequested( PANGLOBAL ); myViewPort->setCursor( glPanCursor ); @@ -681,7 +681,7 @@ void OCCViewer_ViewWindow::activateGlobalPanning() void OCCViewer_ViewWindow::activateWindowFit() { if ( !transformRequested() && !myCursorIsHand ) - myCursor = cursor(); /* save old cursor */ + myCursor = cursor(); /* save old cursor */ if ( myOperation != WINDOWFIT ) { QCursor handCursor (Qt::PointingHandCursor); @@ -742,45 +742,45 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent ) int aState = theEvent->modifiers(); int aButton = theEvent->buttons(); if ( aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) { - myDrawRect = myEnableDrawMode; - if ( myDrawRect ) { - drawRect(); - if ( !myCursorIsHand ) { // we are going to sketch a rectangle - QCursor handCursor (Qt::PointingHandCursor); - myCursorIsHand = true; - myCursor = cursor(); - myViewPort->setCursor( handCursor ); - } - } + myDrawRect = myEnableDrawMode; + if ( myDrawRect ) { + drawRect(); + if ( !myCursorIsHand ) { // we are going to sketch a rectangle + QCursor handCursor (Qt::PointingHandCursor); + myCursorIsHand = true; + myCursor = cursor(); + myViewPort->setCursor( handCursor ); + } + } } else if ( aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) { - OCCViewer_ViewSketcher* sketcher = 0; - QList::Iterator it; - for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it ) - { - OCCViewer_ViewSketcher* sk = (*it); - if( sk->isDefault() && sk->sketchButton() == aButton ) - sketcher = sk; - } - if ( sketcher && myCurSketch == -1 ) - { - activateSketching( sketcher->type() ); - if ( mypSketcher ) - { - myCurSketch = mypSketcher->sketchButton(); - - if ( l_mbPressEvent ) - { - QApplication::sendEvent( getViewPort(), l_mbPressEvent ); - delete l_mbPressEvent; - l_mbPressEvent = 0; - } - QApplication::sendEvent( getViewPort(), theEvent ); - } - } + OCCViewer_ViewSketcher* sketcher = 0; + QList::Iterator it; + for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it ) + { + OCCViewer_ViewSketcher* sk = (*it); + if( sk->isDefault() && sk->sketchButton() == aButton ) + sketcher = sk; + } + if ( sketcher && myCurSketch == -1 ) + { + activateSketching( sketcher->type() ); + if ( mypSketcher ) + { + myCurSketch = mypSketcher->sketchButton(); + + if ( l_mbPressEvent ) + { + QApplication::sendEvent( getViewPort(), l_mbPressEvent ); + delete l_mbPressEvent; + l_mbPressEvent = 0; + } + QApplication::sendEvent( getViewPort(), theEvent ); + } + } } else - emit mouseMoving( this, theEvent ); + emit mouseMoving( this, theEvent ); } } } @@ -797,13 +797,13 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent) int prevState = myCurSketch; if(theEvent->button() == Qt::RightButton) { - QList::Iterator it; - for ( it = mySketchers.begin(); it != mySketchers.end() && myCurSketch != -1; ++it ) - { - OCCViewer_ViewSketcher* sk = (*it); - if( ( sk->sketchButton() & theEvent->button() ) && sk->sketchButton() == myCurSketch ) - myCurSketch = -1; - } + QList::Iterator it; + for ( it = mySketchers.begin(); it != mySketchers.end() && myCurSketch != -1; ++it ) + { + OCCViewer_ViewSketcher* sk = (*it); + if( ( sk->sketchButton() & theEvent->button() ) && sk->sketchButton() == myCurSketch ) + myCurSketch = -1; + } } emit mouseReleased(this, theEvent); @@ -1353,11 +1353,11 @@ void OCCViewer_ViewWindow::onAmbientToogle() { Handle(V3d_Light) light = viewer->DefinedLight(); if(light->Type() != V3d_AMBIENT) - { - Handle(V3d_View) aView3d = myViewPort->getView(); - if( aView3d->IsActiveLight(light) ) viewer->SetLightOff(light); - else viewer->SetLightOn(light); - } + { + Handle(V3d_View) aView3d = myViewPort->getView(); + if( aView3d->IsActiveLight(light) ) viewer->SetLightOff(light); + else viewer->SetLightOn(light); + } viewer->NextDefinedLights(); } viewer->Update(); @@ -1403,7 +1403,7 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem ) aView3d->SetAxialScale( anItem.scaleX, anItem.scaleY, anItem.scaleZ ); myModel->setTrihedronShown( anItem.isVisible ); myModel->setTrihedronSize( anItem.size ); - + myRestoreFlag = 0; } @@ -1451,8 +1451,8 @@ QImage OCCViewer_ViewWindow::dumpView() } bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img, - const QString& fileName, - const QString& format ) + const QString& fileName, + const QString& format ) { if ( format != "PS" && format != "EPS") return SUIT_ViewWindow::dumpViewToFormat( img, fileName, format ); @@ -1485,7 +1485,7 @@ QString OCCViewer_ViewWindow::filter() const \param dz Z coordinate of plane normal */ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x, const double y, const double z, - const double dx, const double dy, const double dz ) + const double dx, const double dy, const double dz ) { Handle(V3d_View) view = myViewPort->getView(); if ( view.IsNull() ) @@ -1570,7 +1570,7 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const params.scaleX = aScaleX; params.scaleY = aScaleY; params.scaleZ = aScaleZ; - params.name = aName; + params.name = aName; params.isVisible= isShown; params.size = size; @@ -1587,9 +1587,9 @@ QString OCCViewer_ViewWindow::getVisualParameters() viewAspect params = getViewParams(); QString retStr; retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", params.scale, - params.centerX, params.centerY, params.projX, params.projY, params.projZ, params.twist, - params.atX, params.atY, params.atZ, params.eyeX, params.eyeY, params.eyeZ, - params.scaleX, params.scaleY, params.scaleZ ); + params.centerX, params.centerY, params.projX, params.projY, params.projZ, params.twist, + params.atX, params.atY, params.atZ, params.eyeX, params.eyeY, params.eyeZ, + params.scaleX, params.scaleY, params.scaleZ ); retStr += QString().sprintf("*%u*%.2f", params.isVisible, params.size ); return retStr; } @@ -1746,19 +1746,19 @@ void OCCViewer_ViewWindow::onSketchingFinished() { case Rect: { - QRect* aRect = (QRect*)mypSketcher->data(); - if( aRect ) - { - int aLeft = aRect->left(); - int aRight = aRect->right(); - int aTop = aRect->top(); - int aBottom = aRect->bottom(); - - if( append ) - ic->ShiftSelect( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False ); - else - ic->Select( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False ); - } + QRect* aRect = (QRect*)mypSketcher->data(); + if( aRect ) + { + int aLeft = aRect->left(); + int aRight = aRect->right(); + int aTop = aRect->top(); + int aBottom = aRect->bottom(); + + if( append ) + ic->ShiftSelect( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False ); + else + ic->Select( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False ); + } } break; case Polygon: @@ -1766,21 +1766,21 @@ void OCCViewer_ViewWindow::onSketchingFinished() QPolygon* aPolygon = (QPolygon*)mypSketcher->data(); if( aPolygon ) { - int size = aPolygon->size(); - TColgp_Array1OfPnt2d anArray( 1, size ); - - QPolygon::Iterator it = aPolygon->begin(); - QPolygon::Iterator itEnd = aPolygon->end(); - for( int index = 1; it != itEnd; ++it, index++ ) - { - QPoint aPoint = *it; - anArray.SetValue( index, gp_Pnt2d( aPoint.x(), aPoint.y() ) ); - } - - if( append ) - ic->ShiftSelect( anArray, getViewPort()->getView(), Standard_False ); - else - ic->Select( anArray, getViewPort()->getView(), Standard_False ); + int size = aPolygon->size(); + TColgp_Array1OfPnt2d anArray( 1, size ); + + QPolygon::Iterator it = aPolygon->begin(); + QPolygon::Iterator itEnd = aPolygon->end(); + for( int index = 1; it != itEnd; ++it, index++ ) + { + QPoint aPoint = *it; + anArray.SetValue( index, gp_Pnt2d( aPoint.x(), aPoint.y() ) ); + } + + if( append ) + ic->ShiftSelect( anArray, getViewPort()->getView(), Standard_False ); + else + ic->Select( anArray, getViewPort()->getView(), Standard_False ); } } break; diff --git a/src/OCCViewer/OCCViewer_ViewWindow.h b/src/OCCViewer/OCCViewer_ViewWindow.h index b4c117b71..b9c736756 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.h +++ b/src/OCCViewer/OCCViewer_ViewWindow.h @@ -47,12 +47,12 @@ class OCCVIEWER_EXPORT OCCViewer_ViewWindow : public SUIT_ViewWindow public: enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, - ChangeRotationPointId, RotationId, + ChangeRotationPointId, RotationId, FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId, TrihedronShowId, AxialScaleId, AmbientId }; enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, - PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW, + PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW, FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW }; enum RotationPointType{ GRAVITY, SELECTED }; @@ -137,8 +137,8 @@ protected: void setTransformRequested ( OperationType ); /* Transformation is selected and already started */ - bool transformInProcess() const; - void setTransformInProcess( bool ); + bool transformInProcess() const; + void setTransformInProcess( bool ); void vpMousePressEvent(QMouseEvent* theEvent); void vpMouseReleaseEvent(QMouseEvent* theEvent); @@ -176,20 +176,20 @@ protected: gp_Pnt mySelectedPoint; bool myRotationPointSelection; - int myRestoreFlag; + int myRestoreFlag; - int myStartX; - int myStartY; - int myCurrX; - int myCurrY; + int myStartX; + int myStartY; + int myCurrX; + int myCurrY; - bool myEventStarted; // set when transformation is in process - bool myCursorIsHand; - bool myDrawRect; // set when a rect is used for selection or magnify - bool myEnableDrawMode; - bool myPaintersRedrawing; // set to draw with external painters + bool myEventStarted; // set when transformation is in process + bool myCursorIsHand; + bool myDrawRect; // set when a rect is used for selection or magnify + bool myEnableDrawMode; + bool myPaintersRedrawing; // set to draw with external painters - QCursor myCursor; + QCursor myCursor; double myCurScale; diff --git a/src/ObjBrowser/OB_Browser.cxx b/src/ObjBrowser/OB_Browser.cxx index 4fd97c7c0..0e8f33a63 100755 --- a/src/ObjBrowser/OB_Browser.cxx +++ b/src/ObjBrowser/OB_Browser.cxx @@ -91,7 +91,7 @@ OB_Browser::ToolTip::~ToolTip() void OB_Browser::ToolTip::maybeTip( const QPoint& pos ) { if ( !parentWidget() || !myBrowser || !myBrowser->isShowToolTips() ) - return; + return; QListView* lv = myBrowser->listView(); @@ -163,7 +163,7 @@ OB_Browser::OB_Browser( QWidget* parent, QAbstractItemModel* model ) setModel( model ); connect( myView, SIGNAL( selectionChanged() ), - this, SIGNAL( selectionChanged() ) ); + this, SIGNAL( selectionChanged() ) ); } @@ -758,7 +758,7 @@ void OB_Browser::restoreState( const DataObjectMap& selObjs, const DataObjectMap { bool parentOpen = true; if( item && item->parent() ) - parentOpen = item->parent()->isOpen(); + parentOpen = item->parent()->isOpen(); if ( openObjs[obj] && parentOpen ) lv->setOpen( item, true ); @@ -767,10 +767,10 @@ void OB_Browser::restoreState( const DataObjectMap& selObjs, const DataObjectMap { bool parentOpen = true; if( item && item->parent() ) - parentOpen = item->parent()->isOpen(); + parentOpen = item->parent()->isOpen(); if( parentOpen ) - lv->setOpen( item, true ); + lv->setOpen( item, true ); } if ( !curItem && ( curObj == obj || ( !curKey.isNull() && curKey == key )) ) @@ -984,12 +984,12 @@ void OB_Browser::createPopupMenu( QMenu* menu ) bool closed = false, opened = false; for ( QModelIndexList::Iterator it = indexes.begin(); - it != indexes.end() && !closed; ++it ) { + it != indexes.end() && !closed; ++it ) { closed = hasCollased( *it ); } for ( QModelIndexList::Iterator it = indexes.begin(); - it != indexes.end() && !opened; ++it ) { + it != indexes.end() && !opened; ++it ) { opened = hasExpanded( *it ); } @@ -1033,8 +1033,8 @@ bool OB_Browser::hasCollased( const QModelIndex& index ) const if ( !result && hasChildren ) { int rows = model()->rowCount( index ); for ( int i = 0; i < rows && !result; i ++ ) { - QModelIndex child = model()->index( i, 0, index ); - result = hasCollased( child ); + QModelIndex child = model()->index( i, 0, index ); + result = hasCollased( child ); } } } @@ -1055,8 +1055,8 @@ bool OB_Browser::hasExpanded( const QModelIndex& index ) const if ( !result && hasChildren ) { int rows = model()->rowCount( index ); for ( int i = 0; i < rows && !result; i ++ ) { - QModelIndex child = model()->index( i, 0, index ); - result = hasExpanded( child ); + QModelIndex child = model()->index( i, 0, index ); + result = hasExpanded( child ); } } } diff --git a/src/Plot2d/Plot2d.cxx b/src/Plot2d/Plot2d.cxx index 2be404b08..769a419db 100755 --- a/src/Plot2d/Plot2d.cxx +++ b/src/Plot2d/Plot2d.cxx @@ -156,7 +156,7 @@ Plot2d::LineType Plot2d::qwt2plotLine( Qt::PenStyle p ) \param width line width */ void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2, - Qt::PenStyle type, const QColor& color, int width ) + Qt::PenStyle type, const QColor& color, int width ) { painter->save(); QPen pen( type ); @@ -177,7 +177,7 @@ void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2, \param width line width */ void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2, - Plot2d::LineType type, const QColor& color, int width ) + Plot2d::LineType type, const QColor& color, int width ) { drawLine( painter, p1, p2, plot2qwtLine( type ), color, width ); } @@ -194,7 +194,7 @@ void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2, \param width line width */ void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2, - Qt::PenStyle type, const QColor& color, int width ) + Qt::PenStyle type, const QColor& color, int width ) { drawLine( painter, QPoint( x1, y1 ), QPoint( x2, y2 ), type, color, width ); } @@ -211,10 +211,10 @@ void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2, \param width line width */ void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2, - Plot2d::LineType type, const QColor& color, int width ) + Plot2d::LineType type, const QColor& color, int width ) { drawLine( painter, QPoint( x1, y1 ), QPoint( x2, y2 ), - plot2qwtLine( type), color, width ); + plot2qwtLine( type), color, width ); } /*! @@ -226,7 +226,7 @@ void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2, \param color marker color */ void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r, - QwtSymbol::Style type, const QColor& color ) + QwtSymbol::Style type, const QColor& color ) { painter->save(); painter->setPen( color ); @@ -314,7 +314,7 @@ void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r, \param color marker color */ void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r, - Plot2d::MarkerType type, const QColor& color ) + Plot2d::MarkerType type, const QColor& color ) { drawMarker( painter, p, r, plot2qwtMarker( type ), color ); } @@ -330,7 +330,7 @@ void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r, \param color marker color */ void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h, - QwtSymbol::Style type, const QColor& color ) + QwtSymbol::Style type, const QColor& color ) { drawMarker( painter, QPoint( x, y ), QRect( 0, 0, w, h ), type, color ); } @@ -346,7 +346,7 @@ void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h, \param color marker color */ void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h, - Plot2d::MarkerType type, const QColor& color ) + Plot2d::MarkerType type, const QColor& color ) { drawMarker( painter, QPoint( x, y ), QRect( 0, 0, w, h ), plot2qwtMarker( type ), color ); } diff --git a/src/Plot2d/Plot2d.h b/src/Plot2d/Plot2d.h index 9da6d8434..1800ee2eb 100755 --- a/src/Plot2d/Plot2d.h +++ b/src/Plot2d/Plot2d.h @@ -43,15 +43,15 @@ class QPainter; namespace Plot2d { typedef enum { None, - Circle, - Rectangle, - Diamond, - DTriangle, - UTriangle, - LTriangle, - RTriangle, - Cross, - XCross + Circle, + Rectangle, + Diamond, + DTriangle, + UTriangle, + LTriangle, + RTriangle, + Cross, + XCross } MarkerType; typedef enum { @@ -70,30 +70,30 @@ namespace Plot2d LineType qwt2plotLine( Qt::PenStyle ); void drawLine( QPainter*, const QPoint&, const QPoint&, - Qt::PenStyle = Qt::SolidLine, - const QColor& = Qt::black, int = 0 ); + Qt::PenStyle = Qt::SolidLine, + const QColor& = Qt::black, int = 0 ); void drawLine( QPainter*, const QPoint&, const QPoint&, - LineType = Solid, - const QColor& = Qt::black, int = 0 ); + LineType = Solid, + const QColor& = Qt::black, int = 0 ); void drawLine( QPainter*, int, int, int, int, - Qt::PenStyle = Qt::SolidLine, - const QColor& = Qt::black, int = 0 ); + Qt::PenStyle = Qt::SolidLine, + const QColor& = Qt::black, int = 0 ); void drawLine( QPainter*, int, int, int, int, - LineType = Solid, - const QColor& = Qt::black, int = 0 ); + LineType = Solid, + const QColor& = Qt::black, int = 0 ); void drawMarker( QPainter*, const QPoint&, const QRect&, - QwtSymbol::Style = QwtSymbol::Ellipse, - const QColor& = Qt::black ); + QwtSymbol::Style = QwtSymbol::Ellipse, + const QColor& = Qt::black ); void drawMarker( QPainter*, const QPoint&, const QRect&, - MarkerType = Circle, - const QColor& = Qt::black ); + MarkerType = Circle, + const QColor& = Qt::black ); void drawMarker( QPainter*, int, int, int, int, - QwtSymbol::Style = QwtSymbol::Ellipse, - const QColor& = Qt::black ); + QwtSymbol::Style = QwtSymbol::Ellipse, + const QColor& = Qt::black ); void drawMarker( QPainter*, int, int, int, int, - MarkerType = Circle, - const QColor& = Qt::black ); + MarkerType = Circle, + const QColor& = Qt::black ); } #if defined WIN32 diff --git a/src/Plot2d/Plot2d_Curve.h b/src/Plot2d/Plot2d_Curve.h index a8e4f98bf..c8a401502 100755 --- a/src/Plot2d/Plot2d_Curve.h +++ b/src/Plot2d/Plot2d_Curve.h @@ -68,7 +68,7 @@ public: pointList getPointList() const; void setData( const double*, const double*, - long, const QStringList& = QStringList() ); + long, const QStringList& = QStringList() ); double* horData() const; double* verData() const; diff --git a/src/Plot2d/Plot2d_SetupCurveDlg.cxx b/src/Plot2d/Plot2d_SetupCurveDlg.cxx index fd8f70053..384f5c259 100644 --- a/src/Plot2d/Plot2d_SetupCurveDlg.cxx +++ b/src/Plot2d/Plot2d_SetupCurveDlg.cxx @@ -255,7 +255,7 @@ QPixmap Plot2d_SetupCurveDlg::lineIcon( Plot2d::LineType type ) const px.fill( QColor( 255, 255, 255, 0 ) ); QPainter p( &px ); Plot2d::drawLine( &p, 5, sz.height()/2, sz.width()-5, sz.height()/2, type, - myLineCombo->palette().color( QPalette::Text ), 1 ); + myLineCombo->palette().color( QPalette::Text ), 1 ); return px; } @@ -271,7 +271,7 @@ QPixmap Plot2d_SetupCurveDlg::markerIcon( Plot2d::MarkerType type ) const px.fill( QColor( 255, 255, 255, 0 ) ); QPainter p( &px ); Plot2d::drawMarker( &p, sz.width()/2, sz.height()/2, MSIZE, MSIZE, type, - myMarkerCombo->palette().color( QPalette::Text ) ); + myMarkerCombo->palette().color( QPalette::Text ) ); return px; } @@ -287,11 +287,11 @@ void Plot2d_SetupCurveDlg::updatePreview() QPainter p( &px ); Plot2d::drawLine( &p, 5+MSIZE/2, sz.height()/2, sz.width()-5-MSIZE/2, sz.height()/2, - getLine(), getColor(), getLineWidth() ); + getLine(), getColor(), getLineWidth() ); Plot2d::drawMarker( &p, 5+MSIZE/2, sz.height()/2, MSIZE, MSIZE, - getMarker(), getColor() ); + getMarker(), getColor() ); Plot2d::drawMarker( &p, sz.width()-5-MSIZE/2, sz.height()/2, MSIZE, MSIZE, - getMarker(), getColor() ); + getMarker(), getColor() ); myPreview->setPixmap( px ); } diff --git a/src/Plot2d/Plot2d_SetupViewDlg.cxx b/src/Plot2d/Plot2d_SetupViewDlg.cxx index 211a2faea..7551bd561 100755 --- a/src/Plot2d/Plot2d_SetupViewDlg.cxx +++ b/src/Plot2d/Plot2d_SetupViewDlg.cxx @@ -57,8 +57,8 @@ const int MIN_SPIN_WIDTH = 70; \param secondAxisY if \c true, show widgets for the second (right) vertical axis */ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, - bool showDefCheck, - bool secondAxisY ) + bool showDefCheck, + bool secondAxisY ) : QDialog( parent ), mySecondAxisY( secondAxisY ) { diff --git a/src/Plot2d/Plot2d_ToolTip.cxx b/src/Plot2d/Plot2d_ToolTip.cxx index ba44643f7..99b52c73c 100644 --- a/src/Plot2d/Plot2d_ToolTip.cxx +++ b/src/Plot2d/Plot2d_ToolTip.cxx @@ -42,7 +42,7 @@ Plot2d_ToolTip::Plot2d_ToolTip( Plot2d_ViewFrame* frame, Plot2d_Plot2d* plot ) myPlot( plot ) { connect( this, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ), - this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) ); + this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) ); } Plot2d_ToolTip::~Plot2d_ToolTip() diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index a870b9f9d..d5958c31e 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -178,13 +178,13 @@ Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title ) // createActions(); connect( myPlot, SIGNAL( legendClicked( QwtPlotItem* ) ), - this, SIGNAL( legendClicked( QwtPlotItem* ) ) ); + this, SIGNAL( legendClicked( QwtPlotItem* ) ) ); // IPAL 21465 /* connect( myPlot->axisWidget( QwtPlot::xBottom ), SIGNAL( scaleDivChanged() ), - myPlot, SLOT( onScaleDivChanged() ) ); + myPlot, SLOT( onScaleDivChanged() ) ); connect( myPlot->axisWidget( QwtPlot::yLeft ), SIGNAL( scaleDivChanged() ), - myPlot, SLOT( onScaleDivChanged() ) ); + myPlot, SLOT( onScaleDivChanged() ) ); if (mySecondY) connect( myPlot->axisWidget( QwtPlot::yRight ), SIGNAL( scaleDivChanged() ), myPlot, SLOT( onScaleDivChanged() ) );*/ @@ -315,7 +315,7 @@ bool Plot2d_ViewFrame::eventFilter( QObject* watched, QEvent* e ) if ( plotMouseMoved( m ) ) return true; } - break; + break; } case QEvent::MouseButtonPress: { QMouseEvent* me = (QMouseEvent*)e; @@ -787,9 +787,9 @@ void Plot2d_ViewFrame::fitArea( const QRect& area ) "Fit Data" command for TUI interface */ void Plot2d_ViewFrame::fitData(const int mode, - const double xMin, const double xMax, - const double yMin, const double yMax, - double y2Min, double y2Max) + const double xMin, const double xMax, + const double yMin, const double yMax, + double y2Min, double y2Max) { if ( mode == 0 || mode == 2 ) { myPlot->setAxisScale( QwtPlot::yLeft, yMin, yMax ); @@ -805,8 +805,8 @@ void Plot2d_ViewFrame::fitData(const int mode, Gets current fit ranges for view frame */ void Plot2d_ViewFrame::getFitRanges(double& xMin,double& xMax, - double& yMin, double& yMax, - double& y2Min, double& y2Max) + double& yMin, double& yMax, + double& y2Min, double& y2Max) { int ixMin = myPlot->canvasMap( QwtPlot::xBottom ).transform( myPlot->canvasMap( QwtPlot::xBottom ).s1() ); int ixMax = myPlot->canvasMap( QwtPlot::xBottom ).transform( myPlot->canvasMap( QwtPlot::xBottom ).s2() ); @@ -830,8 +830,8 @@ void Plot2d_ViewFrame::getFitRanges(double& xMin,double& xMax, Gets current fit ranges by Curves */ void Plot2d_ViewFrame::getFitRangeByCurves(double& xMin,double& xMax, - double& yMin, double& yMax, - double& y2Min, double& y2Max) + double& yMin, double& yMax, + double& y2Min, double& y2Max) { CurveDict cdict = getCurves(); if ( !cdict.isEmpty() ) { @@ -1031,7 +1031,7 @@ void Plot2d_ViewFrame::onFitData() */ void Plot2d_ViewFrame::onChangeBackground() { - QColor selColor = QColorDialog::getColor ( backgroundColor(), this ); + QColor selColor = QColorDialog::getColor ( backgroundColor(), this ); if ( selColor.isValid() ) { setBackgroundColor( selColor ); } @@ -1910,7 +1910,7 @@ void Plot2d_Plot2d::onScaleDivChanged() QwtScaleDraw* aQwtSD = axisScaleDraw(axisId); Plot2d_ScaleDraw* aPlot2dSD = dynamic_cast(aQwtSD); if ( !aPlot2dSD && aPrecision > 6 || aPlot2dSD && aPlot2dSD->precision() != aPrecision ) - setAxisScaleDraw( axisId, new Plot2d_ScaleDraw(*aQwtSD, 'f', aPrecision) ); + setAxisScaleDraw( axisId, new Plot2d_ScaleDraw(*aQwtSD, 'f', aPrecision) ); } } } @@ -2076,7 +2076,7 @@ QString Plot2d_ViewFrame::getVisualParameters() getFitRanges( xmin, xmax, ymin, ymax, y2min, y2max ); QString retStr; retStr.sprintf( "%d*%d*%d*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", myXMode, - myYMode, mySecondY, xmin, xmax, ymin, ymax, y2min, y2max ); + myYMode, mySecondY, xmin, xmax, ymin, ymax, y2min, y2max ); return retStr; } @@ -2121,16 +2121,16 @@ void Plot2d_ViewFrame::incrementalPan( const int incrX, const int incrY ) { QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft ); myPlot->setAxisScale( QwtPlot::yLeft, - myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s1() )-incrY ), - myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() )-incrY ) ); + myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s1() )-incrY ), + myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() )-incrY ) ); myPlot->setAxisScale( QwtPlot::xBottom, - myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s1() )-incrX ), - myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() )-incrX ) ); + myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s1() )-incrX ), + myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() )-incrX ) ); if (mySecondY) { QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight ); myPlot->setAxisScale( QwtPlot::yRight, - myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s1() )-incrY ), - myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() )-incrY ) ); + myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s1() )-incrY ), + myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() )-incrY ) ); } myPlot->replot(); } @@ -2143,13 +2143,13 @@ void Plot2d_ViewFrame::incrementalZoom( const int incrX, const int incrY ) { QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft ); myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), - myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() ) + incrY ) ); + myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() ) + incrY ) ); myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), - myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() ) - incrX ) ); + myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() ) - incrX ) ); if (mySecondY) { QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight ); myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), - myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() ) + incrY ) ); + myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() ) + incrY ) ); } myPlot->replot(); } diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index 3308b6682..16aca311a 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -82,17 +82,17 @@ public: void fitAll(); void fitArea( const QRect& area ); void fitData(const int mode, - const double xMin, const double xMax, - const double yMin, const double yMax, - const double y2Min = 0, const double y2Max = 0); + const double xMin, const double xMax, + const double yMin, const double yMax, + const double y2Min = 0, const double y2Max = 0); void getFitRanges(double& xMin, double& xMax, - double& yMin, double& yMax, - double& y2Min, double& y2Max); + double& yMin, double& yMax, + double& y2Min, double& y2Max); void getFitRangeByCurves(double& xMin, double& xMax, - double& yMin, double& yMax, - double& y2Min, double& y2Max); + double& yMin, double& yMax, + double& y2Min, double& y2Max); /* view parameters */ void copyPreferences( Plot2d_ViewFrame* ); diff --git a/src/Plot2d/Plot2d_ViewManager.cxx b/src/Plot2d/Plot2d_ViewManager.cxx index 25280c5c9..374b777d6 100755 --- a/src/Plot2d/Plot2d_ViewManager.cxx +++ b/src/Plot2d/Plot2d_ViewManager.cxx @@ -63,7 +63,7 @@ bool Plot2d_ViewManager::insertView( SUIT_ViewWindow* theView ) Plot2d_ViewFrame* aViewFrame = view->getViewFrame(); Plot2d_Viewer* aViewer = getPlot2dModel(); connect( aViewFrame, SIGNAL( legendClicked( QwtPlotItem* ) ), - aViewer, SLOT( onLegendClicked( QwtPlotItem* ) ) ); + aViewer, SLOT( onLegendClicked( QwtPlotItem* ) ) ); } return res; } diff --git a/src/Plot2d/Plot2d_ViewModel.cxx b/src/Plot2d/Plot2d_ViewModel.cxx index 0786c6fa4..ccbf57cd5 100755 --- a/src/Plot2d/Plot2d_ViewModel.cxx +++ b/src/Plot2d/Plot2d_ViewModel.cxx @@ -229,6 +229,6 @@ void Plot2d_Viewer::setViewManager( SUIT_ViewManager* mgr ) { Plot2d_ViewManager* pmgr = ( Plot2d_ViewManager* )mgr; connect( pmgr, SIGNAL( cloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ), - this, SLOT( onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ) ); + this, SLOT( onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ) ); } } diff --git a/src/Plot2d/Plot2d_ViewWindow.cxx b/src/Plot2d/Plot2d_ViewWindow.cxx index 4f3dda2ca..33cc3fa46 100755 --- a/src/Plot2d/Plot2d_ViewWindow.cxx +++ b/src/Plot2d/Plot2d_ViewWindow.cxx @@ -69,7 +69,7 @@ Plot2d_ViewWindow::Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* t connect( myViewFrame, SIGNAL( vpModeVerChanged() ), this, SLOT( onChangeVerMode() ) ); connect( myViewFrame, SIGNAL( vpCurveChanged() ), this, SLOT( onChangeCurveMode() ) ); connect( myViewFrame, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ), - this, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ) ); + this, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ) ); myViewFrame->installEventFilter( this ); } @@ -186,9 +186,9 @@ void Plot2d_ViewWindow::createActions() // 1. Dump View aAction = new QtxAction( tr( "MNU_DUMP_VIEW" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ), + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ), tr( "MNU_DUMP_VIEW" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_DUMP_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onDumpView() ) ); mgr->registerAction( aAction, DumpId ); @@ -197,27 +197,27 @@ void Plot2d_ViewWindow::createActions() // 2.1. Fit All aAction = new QtxAction( tr( "MNU_FITALL" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ), + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ), tr( "MNU_FITALL" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_FITALL" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onFitAll() ) ); mgr->registerAction( aAction, FitAllId ); // 2.2. Fit Rect aAction = new QtxAction( tr( "MNU_FITRECT" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ), + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ), tr( "MNU_FITRECT" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_FITRECT" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onFitRect() ) ); mgr->registerAction( aAction, FitRectId ); // 2.3. Zoom aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ), + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ), tr( "MNU_ZOOM_VIEW" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onZoom() ) ); mgr->registerAction( aAction, ZoomId ); @@ -233,18 +233,18 @@ void Plot2d_ViewWindow::createActions() // 3.1. Panning aAction = new QtxAction( tr( "MNU_PAN_VIEW" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ), - tr( "MNU_PAN_VIEW" ), - 0, this); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ), + tr( "MNU_PAN_VIEW" ), + 0, this); aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onPanning() ) ); mgr->registerAction( aAction, PanId ); // 3.2. Global Panning aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ), + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ), tr( "MNU_GLOBALPAN_VIEW" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onGlobalPanning() ) ); mgr->registerAction( aAction, GlobalPanId ); @@ -259,27 +259,27 @@ void Plot2d_ViewWindow::createActions() // 4.1. Points aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_POINTS" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_POINTS" ) ), - tr( "MEN_PLOT2D_CURVES_POINTS" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_POINTS" ) ), + tr( "MEN_PLOT2D_CURVES_POINTS" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_POINTS" ) ); aAction->setCheckable( true ); mgr->registerAction( aAction, CurvPointsId ); // 4.2. Lines aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_LINES" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_LINES" ) ), - tr( "MEN_PLOT2D_CURVES_LINES" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_LINES" ) ), + tr( "MEN_PLOT2D_CURVES_LINES" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_LINES" ) ); aAction->setCheckable( true ); mgr->registerAction( aAction, CurvLinesId ); // 4.3. Splines aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_SPLINES" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_SPLINES" ) ), - tr( "MEN_PLOT2D_CURVES_SPLINES" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_SPLINES" ) ), + tr( "MEN_PLOT2D_CURVES_SPLINES" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_SPLINES" ) ); aAction->setCheckable( true ); mgr->registerAction( aAction, CurvSplinesId ); @@ -295,9 +295,9 @@ void Plot2d_ViewWindow::createActions() // 5.1. Linear aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LINEAR_HOR" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_HOR" ) ), - tr( "MEN_PLOT2D_MODE_LINEAR_HOR" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_HOR" ) ), + tr( "MEN_PLOT2D_MODE_LINEAR_HOR" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LINEAR_HOR" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewHorMode() ) ); aAction->setCheckable( true ); @@ -305,9 +305,9 @@ void Plot2d_ViewWindow::createActions() // 5.2. Logarithmic aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LOGARITHMIC_HOR" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" ) ), - tr( "MEN_PLOT2D_MODE_LOGARITHMIC_HOR" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" ) ), + tr( "MEN_PLOT2D_MODE_LOGARITHMIC_HOR" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_HOR" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewHorMode() ) ); aAction->setCheckable( true ); @@ -322,9 +322,9 @@ void Plot2d_ViewWindow::createActions() // 6.1. Linear aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LINEAR_VER" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_VER" ) ), - tr( "MEN_PLOT2D_MODE_LINEAR_VER" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_VER" ) ), + tr( "MEN_PLOT2D_MODE_LINEAR_VER" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LINEAR_VER" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewVerMode() ) ); aAction->setCheckable( true ); @@ -332,9 +332,9 @@ void Plot2d_ViewWindow::createActions() // 6.2. Logarithmic aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LOGARITHMIC_VER" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_VER" ) ), - tr( "MEN_PLOT2D_MODE_LOGARITHMIC_VER" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_VER" ) ), + tr( "MEN_PLOT2D_MODE_LOGARITHMIC_VER" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_VER" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewVerMode() ) ); aAction->setCheckable( true ); @@ -347,9 +347,9 @@ void Plot2d_ViewWindow::createActions() // 7. Legend aAction = new QtxAction( tr( "TOT_PLOT2D_SHOW_LEGEND" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SHOW_LEGEND" ) ), - tr( "MEN_PLOT2D_SHOW_LEGEND" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SHOW_LEGEND" ) ), + tr( "MEN_PLOT2D_SHOW_LEGEND" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_SHOW_LEGEND" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onLegend() ) ); aAction->setCheckable( true ); @@ -357,18 +357,18 @@ void Plot2d_ViewWindow::createActions() // 8. Settings aAction = new QtxAction( tr( "TOT_PLOT2D_SETTINGS" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SETTINGS" ) ), - tr( "MEN_PLOT2D_SETTINGS" ), - 0, this ); + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SETTINGS" ) ), + tr( "MEN_PLOT2D_SETTINGS" ), + 0, this ); aAction->setStatusTip( tr( "PRP_PLOT2D_SETTINGS" ) ); connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onSettings() ) ); mgr->registerAction( aAction, CurvSettingsId ); // 9. Clone aAction = new QtxAction( tr( "MNU_CLONE_VIEW" ), - aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ), + aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ), tr( "MNU_CLONE_VIEW" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_CLONE_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SIGNAL( cloneView() ) ); mgr->registerAction( aAction, CloneId ); @@ -601,8 +601,8 @@ QImage Plot2d_ViewWindow::dumpView() \param format image format ("BMP" [default], "JPEG", "JPG", "PNG") */ bool Plot2d_ViewWindow::dumpViewToFormat( const QImage& img, - const QString& fileName, - const QString& format ) + const QString& fileName, + const QString& format ) { bool res = myViewFrame ? myViewFrame->print( fileName, format ) : false; if( !res ) diff --git a/src/Plot2d/Plot2d_ViewWindow.h b/src/Plot2d/Plot2d_ViewWindow.h index 9ddd4c664..bd3c15dcb 100755 --- a/src/Plot2d/Plot2d_ViewWindow.h +++ b/src/Plot2d/Plot2d_ViewWindow.h @@ -48,14 +48,14 @@ class PLOT2D_EXPORT Plot2d_ViewWindow : public SUIT_ViewWindow public: enum { DumpId, - ScaleOpId, FitAllId, FitRectId, ZoomId, - MoveOpId, PanId, GlobalPanId, - PModeXLinearId, PModeXLogarithmicId, + ScaleOpId, FitAllId, FitRectId, ZoomId, + MoveOpId, PanId, GlobalPanId, + PModeXLinearId, PModeXLogarithmicId, PModeYLinearId, PModeYLogarithmicId, - CurvPointsId, CurvLinesId, CurvSplinesId, - LegendId, - CurvSettingsId, - CloneId }; + CurvPointsId, CurvLinesId, CurvSplinesId, + LegendId, + CurvSettingsId, + CloneId }; public: Plot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* ); @@ -98,8 +98,8 @@ public slots: protected: virtual QImage dumpView(); virtual bool dumpViewToFormat( const QImage&, - const QString&, - const QString& ); + const QString&, + const QString& ); virtual QString filter() const; signals: diff --git a/src/Prs/SALOME_Prs.cxx b/src/Prs/SALOME_Prs.cxx index 693c6e6d3..4b28dbe6b 100755 --- a/src/Prs/SALOME_Prs.cxx +++ b/src/Prs/SALOME_Prs.cxx @@ -19,10 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File: SALOME_Prs.cxx -// Created: Wed Apr 28 15:03:43 2004 -// Author: Sergey ANIKIN -// +// File: SALOME_Prs.cxx +// Created: Wed Apr 28 15:03:43 2004 +// Author: Sergey ANIKIN +// // #include "SALOME_Prs.h" diff --git a/src/PyConsole/PyConsole_Editor.cxx b/src/PyConsole/PyConsole_Editor.cxx index ae6563bb3..c437262da 100644 --- a/src/PyConsole/PyConsole_Editor.cxx +++ b/src/PyConsole/PyConsole_Editor.cxx @@ -134,9 +134,9 @@ public: \param sync if True the request is processed synchronously */ ExecCommand( PyInterp_Interp* theInterp, - const QString& theCommand, - PyConsole_Editor* theListener, - bool sync = false ) + const QString& theCommand, + PyConsole_Editor* theListener, + bool sync = false ) : PyInterp_LockRequest( theInterp, theListener, sync ), myCommand( theCommand ), myState( PyInterp_Event::ES_OK ) {} @@ -152,9 +152,9 @@ protected: { int ret = getInterp()->run( myCommand.toLatin1() ); if ( ret < 0 ) - myState = PyInterp_Event::ES_ERROR; + myState = PyInterp_Event::ES_ERROR; else if ( ret > 0 ) - myState = PyInterp_Event::ES_INCOMPLETE; + myState = PyInterp_Event::ES_INCOMPLETE; } } @@ -211,7 +211,7 @@ void staticCallback( void* data, char* c ) \param theParent parent widget */ PyConsole_Editor::PyConsole_Editor( PyConsole_Interp* theInterp, - QWidget* theParent ) + QWidget* theParent ) : QTextEdit( theParent ), myInterp( 0 ), myCmdInHistory( -1 ), @@ -276,7 +276,7 @@ void PyConsole_Editor::setIsSync( const bool on ) \param newBlock if True, then the string is printed on a new line */ void PyConsole_Editor::addText( const QString& str, - const bool newBlock ) + const bool newBlock ) { moveCursor( QTextCursor::End ); if ( newBlock ) @@ -413,11 +413,11 @@ void PyConsole_Editor::dropEvent( QDropEvent* event ) } // create new drop event and use it instead of the original QDropEvent de( pos, - event->possibleActions(), - event->mimeData(), - event->mouseButtons(), - event->keyboardModifiers(), - event->type() ); + event->possibleActions(), + event->mimeData(), + event->mouseButtons(), + event->keyboardModifiers(), + event->type() ); QTextEdit::dropEvent( &de ); // accept the original event event->acceptProposedAction(); @@ -527,7 +527,7 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // any printed key: just print it { if ( curLine < endLine || curCol < PROMPT_SIZE ) { - moveCursor( QTextCursor::End ); + moveCursor( QTextCursor::End ); } QTextEdit::keyPressEvent( event ); break; @@ -547,35 +547,35 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // - with + modifier keys pressed: scroll one row up { if ( ctrlPressed && shftPressed ) { - int value = verticalScrollBar()->value(); - int spacing = fontMetrics().lineSpacing(); - verticalScrollBar()->setValue( value > spacing ? value-spacing : 0 ); + int value = verticalScrollBar()->value(); + int spacing = fontMetrics().lineSpacing(); + verticalScrollBar()->setValue( value > spacing ? value-spacing : 0 ); } else if ( shftPressed || ctrlPressed ) { - if ( curLine > 0 ) - moveCursor( QTextCursor::Up, - shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); + if ( curLine > 0 ) + moveCursor( QTextCursor::Up, + shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); } else { - if ( myCmdInHistory < 0 && myHistory.count() > 0 ) { - // set history browsing mode - myCmdInHistory = myHistory.count(); - // remember current command - QTextBlock par = document()->end().previous(); - myCurrentCommand = par.text().remove( 0, PROMPT_SIZE ); - } - if ( myCmdInHistory > 0 ) { - myCmdInHistory--; - // get previous command in the history - QString previousCommand = myHistory.at( myCmdInHistory ); - // print previous command - moveCursor( QTextCursor::End ); - moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor ); - textCursor().removeSelectedText(); - addText( myPrompt + previousCommand ); - // move cursor to the end - moveCursor( QTextCursor::End ); - } + if ( myCmdInHistory < 0 && myHistory.count() > 0 ) { + // set history browsing mode + myCmdInHistory = myHistory.count(); + // remember current command + QTextBlock par = document()->end().previous(); + myCurrentCommand = par.text().remove( 0, PROMPT_SIZE ); + } + if ( myCmdInHistory > 0 ) { + myCmdInHistory--; + // get previous command in the history + QString previousCommand = myHistory.at( myCmdInHistory ); + // print previous command + moveCursor( QTextCursor::End ); + moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor ); + textCursor().removeSelectedText(); + addText( myPrompt + previousCommand ); + // move cursor to the end + moveCursor( QTextCursor::End ); + } } break; } @@ -587,40 +587,40 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // - with + modifier keys pressed: scroll one row down { if ( ctrlPressed && shftPressed ) { - int value = verticalScrollBar()->value(); - int maxval = verticalScrollBar()->maximum(); - int spacing = fontMetrics().lineSpacing(); - verticalScrollBar()->setValue( value+spacing < maxval ? value+spacing : maxval ); + int value = verticalScrollBar()->value(); + int maxval = verticalScrollBar()->maximum(); + int spacing = fontMetrics().lineSpacing(); + verticalScrollBar()->setValue( value+spacing < maxval ? value+spacing : maxval ); } else if ( shftPressed || ctrlPressed) { - if ( curLine < endLine ) - moveCursor( QTextCursor::Down, - shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); + if ( curLine < endLine ) + moveCursor( QTextCursor::Down, + shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); } else { - if ( myCmdInHistory >= 0 ) { - // get next command in the history - myCmdInHistory++; - QString nextCommand; - if ( myCmdInHistory < myHistory.count() ) { - // next command in history - nextCommand = myHistory.at( myCmdInHistory ); - } - else { - // end of history is reached - // last printed command - nextCommand = myCurrentCommand; - // unset history browsing mode - myCmdInHistory = -1; - } - // print next or current command - moveCursor( QTextCursor::End ); - moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor ); - textCursor().removeSelectedText(); - addText( myPrompt + nextCommand ); - // move cursor to the end - moveCursor( QTextCursor::End ); - } + if ( myCmdInHistory >= 0 ) { + // get next command in the history + myCmdInHistory++; + QString nextCommand; + if ( myCmdInHistory < myHistory.count() ) { + // next command in history + nextCommand = myHistory.at( myCmdInHistory ); + } + else { + // end of history is reached + // last printed command + nextCommand = myCurrentCommand; + // unset history browsing mode + myCmdInHistory = -1; + } + // print next or current command + moveCursor( QTextCursor::End ); + moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor ); + textCursor().removeSelectedText(); + addText( myPrompt + nextCommand ); + // move cursor to the end + moveCursor( QTextCursor::End ); + } } break; } @@ -633,11 +633,11 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) { QString txt = textCursor().block().text(); if ( !shftPressed && isCommand( txt ) && curCol <= PROMPT_SIZE ) { - moveCursor( QTextCursor::Up ); - moveCursor( QTextCursor::EndOfBlock ); + moveCursor( QTextCursor::Up ); + moveCursor( QTextCursor::EndOfBlock ); } else { - QTextEdit::keyPressEvent( event ); + QTextEdit::keyPressEvent( event ); } break; } @@ -650,21 +650,21 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) { QString txt = textCursor().block().text(); if ( !shftPressed ) { - if ( curCol < txt.length() ) { - if ( isCommand( txt ) && curCol < PROMPT_SIZE ) { - cur.setPosition( cur.block().position() + PROMPT_SIZE ); - setTextCursor( cur ); - break; - } - } - else { - if ( curLine < endLine && isCommand( textCursor().block().next().text() ) ) { - cur.setPosition( cur.position() + PROMPT_SIZE+1 ); - setTextCursor( cur ); - horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() ); - break; - } - } + if ( curCol < txt.length() ) { + if ( isCommand( txt ) && curCol < PROMPT_SIZE ) { + cur.setPosition( cur.block().position() + PROMPT_SIZE ); + setTextCursor( cur ); + break; + } + } + else { + if ( curLine < endLine && isCommand( textCursor().block().next().text() ) ) { + cur.setPosition( cur.position() + PROMPT_SIZE+1 ); + setTextCursor( cur ); + horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() ); + break; + } + } } QTextEdit::keyPressEvent( event ); break; @@ -677,49 +677,49 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // - with + modifier keys pressed: scroll one page up { if ( ctrlPressed && shftPressed ) { - verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepSub); + verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepSub); } else if ( shftPressed || ctrlPressed ) { - bool moved = false; - qreal lastY = cursorRect( cur ).top(); - qreal distance = 0; - // move using movePosition to keep the cursor's x - do { - qreal y = cursorRect( cur ).top(); - distance += qAbs( y - lastY ); - lastY = y; - moved = cur.movePosition( QTextCursor::Up, - shftPressed ? QTextCursor::KeepAnchor : - QTextCursor::MoveAnchor ); - } while ( moved && distance < viewport()->height() ); - if ( moved ) { - cur.movePosition( QTextCursor::Down, - shftPressed ? QTextCursor::KeepAnchor : - QTextCursor::MoveAnchor ); - verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub ); - } - setTextCursor( cur ); + bool moved = false; + qreal lastY = cursorRect( cur ).top(); + qreal distance = 0; + // move using movePosition to keep the cursor's x + do { + qreal y = cursorRect( cur ).top(); + distance += qAbs( y - lastY ); + lastY = y; + moved = cur.movePosition( QTextCursor::Up, + shftPressed ? QTextCursor::KeepAnchor : + QTextCursor::MoveAnchor ); + } while ( moved && distance < viewport()->height() ); + if ( moved ) { + cur.movePosition( QTextCursor::Down, + shftPressed ? QTextCursor::KeepAnchor : + QTextCursor::MoveAnchor ); + verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub ); + } + setTextCursor( cur ); } else { - if ( myCmdInHistory < 0 && myHistory.count() > 0 ) { - // set history browsing mode - myCmdInHistory = myHistory.count(); - // remember current command - QTextBlock par = document()->end().previous(); - myCurrentCommand = par.text().remove( 0, PROMPT_SIZE ); - } - if ( myCmdInHistory > 0 ) { - myCmdInHistory = 0; - // get very first command in the history - QString firstCommand = myHistory.at( myCmdInHistory ); - // print first command - moveCursor( QTextCursor::End ); - moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor ); - textCursor().removeSelectedText(); - addText( myPrompt + firstCommand ); - // move cursor to the end - moveCursor( QTextCursor::End ); - } + if ( myCmdInHistory < 0 && myHistory.count() > 0 ) { + // set history browsing mode + myCmdInHistory = myHistory.count(); + // remember current command + QTextBlock par = document()->end().previous(); + myCurrentCommand = par.text().remove( 0, PROMPT_SIZE ); + } + if ( myCmdInHistory > 0 ) { + myCmdInHistory = 0; + // get very first command in the history + QString firstCommand = myHistory.at( myCmdInHistory ); + // print first command + moveCursor( QTextCursor::End ); + moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor ); + textCursor().removeSelectedText(); + addText( myPrompt + firstCommand ); + // move cursor to the end + moveCursor( QTextCursor::End ); + } } break; } @@ -731,41 +731,41 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // - with + modifier keys pressed: scroll one page down { if ( ctrlPressed && shftPressed ) { - verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepAdd); + verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepAdd); } else if ( shftPressed || ctrlPressed ) { - bool moved = false; - qreal lastY = cursorRect( cur ).top(); - qreal distance = 0; - // move using movePosition to keep the cursor's x - do { - qreal y = cursorRect( cur ).top(); - distance += qAbs( y - lastY ); - lastY = y; - moved = cur.movePosition( QTextCursor::Down, - shftPressed ? QTextCursor::KeepAnchor : - QTextCursor::MoveAnchor ); - } while ( moved && distance < viewport()->height() ); - if ( moved ) { - cur.movePosition( QTextCursor::Up, - shftPressed ? QTextCursor::KeepAnchor : - QTextCursor::MoveAnchor ); - verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub ); - } - setTextCursor( cur ); + bool moved = false; + qreal lastY = cursorRect( cur ).top(); + qreal distance = 0; + // move using movePosition to keep the cursor's x + do { + qreal y = cursorRect( cur ).top(); + distance += qAbs( y - lastY ); + lastY = y; + moved = cur.movePosition( QTextCursor::Down, + shftPressed ? QTextCursor::KeepAnchor : + QTextCursor::MoveAnchor ); + } while ( moved && distance < viewport()->height() ); + if ( moved ) { + cur.movePosition( QTextCursor::Up, + shftPressed ? QTextCursor::KeepAnchor : + QTextCursor::MoveAnchor ); + verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub ); + } + setTextCursor( cur ); } else { - if ( myCmdInHistory >= 0 ) { - // unset history browsing mode - myCmdInHistory = -1; - // print current command - moveCursor( QTextCursor::End ); - moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor ); - textCursor().removeSelectedText(); - addText( myPrompt + myCurrentCommand ); - // move cursor to the end - moveCursor( QTextCursor::End ); - } + if ( myCmdInHistory >= 0 ) { + // unset history browsing mode + myCmdInHistory = -1; + // print current command + moveCursor( QTextCursor::End ); + moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor ); + textCursor().removeSelectedText(); + addText( myPrompt + myCurrentCommand ); + // move cursor to the end + moveCursor( QTextCursor::End ); + } } break; } @@ -777,29 +777,29 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // - with + modifier keys pressed: move cursor to the very first symbol with selection { if ( ctrlPressed ) { - moveCursor( QTextCursor::Start, - shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); + moveCursor( QTextCursor::Start, + shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); } else { - QString txt = textCursor().block().text(); - if ( isCommand( txt ) ) { - if ( shftPressed ) { - if ( curCol > PROMPT_SIZE ) { - cur.movePosition( QTextCursor::StartOfLine, QTextCursor::KeepAnchor ); - cur.movePosition( QTextCursor::Right, QTextCursor::KeepAnchor, PROMPT_SIZE ); - } - } - else { - cur.movePosition( QTextCursor::StartOfLine ); - cur.movePosition( QTextCursor::Right, QTextCursor::MoveAnchor, PROMPT_SIZE ); - } - setTextCursor( cur ); - } - else { - moveCursor( QTextCursor::StartOfBlock, - shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); - } - horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() ); + QString txt = textCursor().block().text(); + if ( isCommand( txt ) ) { + if ( shftPressed ) { + if ( curCol > PROMPT_SIZE ) { + cur.movePosition( QTextCursor::StartOfLine, QTextCursor::KeepAnchor ); + cur.movePosition( QTextCursor::Right, QTextCursor::KeepAnchor, PROMPT_SIZE ); + } + } + else { + cur.movePosition( QTextCursor::StartOfLine ); + cur.movePosition( QTextCursor::Right, QTextCursor::MoveAnchor, PROMPT_SIZE ); + } + setTextCursor( cur ); + } + else { + moveCursor( QTextCursor::StartOfBlock, + shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); + } + horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() ); } break; } @@ -811,7 +811,7 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // - with + modifier keys pressed: move cursor to the very last symbol with selection { moveCursor( ctrlPressed ? QTextCursor::End : QTextCursor::EndOfBlock, - shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); + shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor ); break; } case Qt::Key_Backspace : @@ -822,27 +822,27 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // works only for last (command) line { if ( cur.hasSelection() ) { - cut(); + cut(); } else if ( cur.position() > document()->end().previous().position() + PROMPT_SIZE ) { - if ( shftPressed ) { - moveCursor( QTextCursor::PreviousWord, QTextCursor::KeepAnchor ); - textCursor().removeSelectedText(); - } - else if ( ctrlPressed ) { - cur.setPosition( document()->end().previous().position() + PROMPT_SIZE, - QTextCursor::KeepAnchor ); - setTextCursor( cur ); - textCursor().removeSelectedText(); - } - else { - QTextEdit::keyPressEvent( event ); - } + if ( shftPressed ) { + moveCursor( QTextCursor::PreviousWord, QTextCursor::KeepAnchor ); + textCursor().removeSelectedText(); + } + else if ( ctrlPressed ) { + cur.setPosition( document()->end().previous().position() + PROMPT_SIZE, + QTextCursor::KeepAnchor ); + setTextCursor( cur ); + textCursor().removeSelectedText(); + } + else { + QTextEdit::keyPressEvent( event ); + } } else { - cur.setPosition( document()->end().previous().position() + PROMPT_SIZE ); - setTextCursor( cur ); - horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() ); + cur.setPosition( document()->end().previous().position() + PROMPT_SIZE ); + setTextCursor( cur ); + horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() ); } break; } @@ -854,25 +854,25 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // works only for last (command) line { if ( cur.hasSelection() ) { - cut(); + cut(); } else if ( cur.position() > document()->end().previous().position() + PROMPT_SIZE-1 ) { - if ( shftPressed ) { - moveCursor( QTextCursor::NextWord, QTextCursor::KeepAnchor ); - textCursor().removeSelectedText(); - } - else if ( ctrlPressed ) { - moveCursor( QTextCursor::EndOfBlock, QTextCursor::KeepAnchor ); - textCursor().removeSelectedText(); - } - else { - QTextEdit::keyPressEvent( event ); - } + if ( shftPressed ) { + moveCursor( QTextCursor::NextWord, QTextCursor::KeepAnchor ); + textCursor().removeSelectedText(); + } + else if ( ctrlPressed ) { + moveCursor( QTextCursor::EndOfBlock, QTextCursor::KeepAnchor ); + textCursor().removeSelectedText(); + } + else { + QTextEdit::keyPressEvent( event ); + } } else { - cur.setPosition( document()->end().previous().position() + PROMPT_SIZE ); - setTextCursor( cur ); - horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() ); + cur.setPosition( document()->end().previous().position() + PROMPT_SIZE ); + setTextCursor( cur ); + horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() ); } break; } @@ -882,13 +882,13 @@ void PyConsole_Editor::keyPressEvent( QKeyEvent* event ) // - with modifier key pressed: paste() to the command line { if ( ctrlPressed ) { - copy(); + copy(); } else if ( shftPressed ) { - paste(); + paste(); } else - QTextEdit::keyPressEvent( event ); + QTextEdit::keyPressEvent( event ); break; } } @@ -997,7 +997,7 @@ void PyConsole_Editor::onPyInterpChanged( PyConsole_Interp* interp ) viewport()->unsetCursor(); // stop event loop (if running) if( myEventLoop) - myEventLoop->exit(); + myEventLoop->exit(); } else { // clear contents diff --git a/src/PyInterp/PyInterp_Watcher.h b/src/PyInterp/PyInterp_Watcher.h index ffa8d8e9a..242dc4100 100755 --- a/src/PyInterp/PyInterp_Watcher.h +++ b/src/PyInterp/PyInterp_Watcher.h @@ -34,7 +34,7 @@ // Private class that keeps track of destructions of request listeners class PYINTERP_EXPORT PyInterp_Watcher : public QObject -{ +{ Q_OBJECT public: diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index f0b532fa2..a9163e978 100755 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -478,7 +478,7 @@ bool Qtx::rmDir( const QString& thePath ) { QFileInfo inf = *it; if ( inf.fileName() == "." || inf.fileName() == ".." ) - continue; + continue; stat = stat && rmDir( inf.absoluteFilePath() ); } stat = stat && aDir.rmdir( thePath ); @@ -559,7 +559,7 @@ bool Qtx::dos2unix( const QString& absName ) if ( nbwri != outcnt ) { ::fclose( src ); - ::fclose( tgt ); + ::fclose( tgt ); QFile::remove( QString( temp ) ); return false; } @@ -695,20 +695,20 @@ QString Qtx::makeEnvVarSubst( const QString& str, const SubstMode mode ) { QString envName = findEnvVar( res, start, len ); if ( envName.isNull() ) - break; + break; QString newStr; if ( ::getenv( envName.toLatin1() ) || mode == Always ) - newStr = QString( ::getenv( envName.toLatin1() ) ); + newStr = QString( ::getenv( envName.toLatin1() ) ); if ( newStr.isNull() ) { - if ( ignoreMap.contains( envName ) ) - { - start += len; - continue; - } - ignoreMap.insert( envName, 0 ); + if ( ignoreMap.contains( envName ) ) + { + start += len; + continue; + } + ignoreMap.insert( envName, 0 ); } res.replace( start, len, newStr ); } @@ -1249,25 +1249,25 @@ bool Qtx::stringToLinearGradient( const QString& str, QLinearGradient& gradient // spread type if ( vals.count() > 5 ) { - QString spread = vals[ 5 ].trimmed().toLower(); - if ( spread == "pad" || spread == "0" ) - gradient.setSpread( QGradient::PadSpread ); - else if ( spread == "repeat" || spread == "2" ) - gradient.setSpread( QGradient::RepeatSpread ); - else if ( spread == "reflect" || spread == "1" ) - gradient.setSpread( QGradient::ReflectSpread ); + QString spread = vals[ 5 ].trimmed().toLower(); + if ( spread == "pad" || spread == "0" ) + gradient.setSpread( QGradient::PadSpread ); + else if ( spread == "repeat" || spread == "2" ) + gradient.setSpread( QGradient::RepeatSpread ); + else if ( spread == "reflect" || spread == "1" ) + gradient.setSpread( QGradient::ReflectSpread ); } // stop points QGradientStops stops; for ( int i = 6; i < vals.count(); i+=2 ) { - bool bOk5, bOk6 = false; - QColor c; - double stop = vals[i].toDouble( &bOk5 ); - if ( i+1 < vals.count() ) - bOk6 = stringToColor( vals[ i+1 ], c ); - if ( bOk5 && stop >= 0.0 && stop <= 1.0 && bOk6 && c.isValid() ) - stops.append( QGradientStop( stop, c ) ); + bool bOk5, bOk6 = false; + QColor c; + double stop = vals[i].toDouble( &bOk5 ); + if ( i+1 < vals.count() ) + bOk6 = stringToColor( vals[ i+1 ], c ); + if ( bOk5 && stop >= 0.0 && stop <= 1.0 && bOk6 && c.isValid() ) + stops.append( QGradientStop( stop, c ) ); } gradient.setStops( stops ); success = true; @@ -1303,25 +1303,25 @@ bool Qtx::stringToRadialGradient( const QString& str, QRadialGradient& gradient // spread type if ( vals.count() > 6 ) { - QString spread = vals[ 6 ].trimmed().toLower(); - if ( spread == "pad" || spread == "0" ) - gradient.setSpread( QGradient::PadSpread ); - else if ( spread == "repeat" || spread == "2" ) - gradient.setSpread( QGradient::RepeatSpread ); - else if ( spread == "reflect" || spread == "1" ) - gradient.setSpread( QGradient::ReflectSpread ); + QString spread = vals[ 6 ].trimmed().toLower(); + if ( spread == "pad" || spread == "0" ) + gradient.setSpread( QGradient::PadSpread ); + else if ( spread == "repeat" || spread == "2" ) + gradient.setSpread( QGradient::RepeatSpread ); + else if ( spread == "reflect" || spread == "1" ) + gradient.setSpread( QGradient::ReflectSpread ); } // stop points QGradientStops stops; for ( int i = 7; i < vals.count(); i+=2 ) { - bool bOk7, bOk8 = false; - QColor c; - double stop = vals[i].toDouble( &bOk7 ); - if ( i+1 < vals.count() ) - bOk8 = stringToColor( vals[ i+1 ], c ); - if ( bOk7 && stop >= 0.0 && stop <= 1.0 && bOk8 && c.isValid() ) - stops.append( QGradientStop( stop, c ) ); + bool bOk7, bOk8 = false; + QColor c; + double stop = vals[i].toDouble( &bOk7 ); + if ( i+1 < vals.count() ) + bOk8 = stringToColor( vals[ i+1 ], c ); + if ( bOk7 && stop >= 0.0 && stop <= 1.0 && bOk8 && c.isValid() ) + stops.append( QGradientStop( stop, c ) ); } gradient.setStops( stops ); success = true; @@ -1355,25 +1355,25 @@ bool Qtx::stringToConicalGradient( const QString& str, QConicalGradient& gradien // spread type if ( vals.count() > 4 ) { - QString spread = vals[ 4 ].trimmed().toLower(); - if ( spread == "pad" || spread == "0" ) - gradient.setSpread( QGradient::PadSpread ); - else if ( spread == "repeat" || spread == "2" ) - gradient.setSpread( QGradient::RepeatSpread ); - else if ( spread == "reflect" || spread == "1" ) - gradient.setSpread( QGradient::ReflectSpread ); + QString spread = vals[ 4 ].trimmed().toLower(); + if ( spread == "pad" || spread == "0" ) + gradient.setSpread( QGradient::PadSpread ); + else if ( spread == "repeat" || spread == "2" ) + gradient.setSpread( QGradient::RepeatSpread ); + else if ( spread == "reflect" || spread == "1" ) + gradient.setSpread( QGradient::ReflectSpread ); } // stop points QGradientStops stops; for ( int i = 5; i < vals.count(); i+=2 ) { - bool bOk4, bOk5 = false; - QColor c; - double stop = vals[i].toDouble( &bOk4 ); - if ( i+1 < vals.count() ) - bOk5 = stringToColor( vals[ i+1 ], c ); - if ( bOk4 && stop >= 0.0 && stop <= 1.0 && bOk5 && c.isValid() ) - stops.append( QGradientStop( stop, c ) ); + bool bOk4, bOk5 = false; + QColor c; + double stop = vals[i].toDouble( &bOk4 ); + if ( i+1 < vals.count() ) + bOk5 = stringToColor( vals[ i+1 ], c ); + if ( bOk4 && stop >= 0.0 && stop <= 1.0 && bOk5 && c.isValid() ) + stops.append( QGradientStop( stop, c ) ); } gradient.setStops( stops ); success = true; diff --git a/src/Qtx/Qtx.h b/src/Qtx/Qtx.h index 69bcd4aca..b5dd9f2ef 100755 --- a/src/Qtx/Qtx.h +++ b/src/Qtx/Qtx.h @@ -100,16 +100,16 @@ public: }; typedef enum { - Shown, //!< column should be always visible - Hidden, //!< column should be always hidden - Toggled //!< it should be possible to show/hide the column with help of popup menu + Shown, //!< column should be always visible + Hidden, //!< column should be always hidden + Toggled //!< it should be possible to show/hide the column with help of popup menu } Appropriate; //!< appropriate status //! Environment variables substitution mode typedef enum { - Always, //!< substitute environment variable by it's value if variable exists, and "" otherwise - Never, //!< keep environment variable as is without any substitution - Auto //!< substitute environment variable by it's value if variable exists, and keep it as is otherwise + Always, //!< substitute environment variable by it's value if variable exists, and "" otherwise + Never, //!< keep environment variable as is without any substitution + Auto //!< substitute environment variable by it's value if variable exists, and keep it as is otherwise } SubstMode; static QString toQString( const char*, const int = -1 ); diff --git a/src/Qtx/QtxActionGroup.cxx b/src/Qtx/QtxActionGroup.cxx index eeea9d777..eb651239d 100644 --- a/src/Qtx/QtxActionGroup.cxx +++ b/src/Qtx/QtxActionGroup.cxx @@ -203,7 +203,7 @@ void QtxActionGroup::onTriggered( QAction* a ) { QtxComboBox* cb = ::qobject_cast( *it ); if ( cb ) - cb->setCurrentId( id ); + cb->setCurrentId( id ); } } @@ -226,7 +226,7 @@ void QtxActionGroup::updateAction( QWidget* w ) QList lst = actions(); for ( QList::iterator it = lst.begin(); it != lst.end(); ++it ) - w->removeAction( *it ); + w->removeAction( *it ); } } else @@ -237,7 +237,7 @@ void QtxActionGroup::updateAction( QWidget* w ) else { QList lst = actions(); for ( QList::iterator it = lst.begin(); it != lst.end(); ++it ) - w->removeAction( *it ); + w->removeAction( *it ); } } } diff --git a/src/Qtx/QtxActionMenuMgr.cxx b/src/Qtx/QtxActionMenuMgr.cxx index 8e2951292..90acf3ff7 100644 --- a/src/Qtx/QtxActionMenuMgr.cxx +++ b/src/Qtx/QtxActionMenuMgr.cxx @@ -71,9 +71,9 @@ QtxActionMenuMgr::MenuNode::MenuNode() \param _group menu node group ID */ QtxActionMenuMgr::MenuNode::MenuNode( MenuNode* p, - const int _id, - const int _idx, - const int _group ) + const int _id, + const int _idx, + const int _group ) : parent( p ), id( _id ), idx( _idx ), group( _group ), visible( true ), emptyEnabled( 0 ) { if ( p ) @@ -886,7 +886,7 @@ void QtxActionMenuMgr::updateMenu( MenuNode* startNode, const bool rec, const bo { a = foralit.next(); if ( !mw->actions().contains( a ) ) - foralit.remove(); + foralit.remove(); } } QList alist = mw->actions(); diff --git a/src/Qtx/QtxActionMgr.h b/src/Qtx/QtxActionMgr.h index f80591374..b4b2fa68f 100644 --- a/src/Qtx/QtxActionMgr.h +++ b/src/Qtx/QtxActionMgr.h @@ -113,7 +113,7 @@ public: Reader* reader() const; virtual int append( const QString&, const bool, - const ItemAttributes&, const int ) = 0; + const ItemAttributes&, const int ) = 0; virtual void connect( QAction* ) const; virtual bool loadPixmap( const QString&, QPixmap& ) const; @@ -121,7 +121,7 @@ public: protected: static int intValue( const ItemAttributes&, const QString&, const int ); static QString strValue( const ItemAttributes&, const QString&, - const QString& = QString() ); + const QString& = QString() ); private: QtxActionMgr::Reader* myReader; //!< actions reader }; diff --git a/src/Qtx/QtxActionToolMgr.cxx b/src/Qtx/QtxActionToolMgr.cxx index 45a28aa04..8b209ecff 100644 --- a/src/Qtx/QtxActionToolMgr.cxx +++ b/src/Qtx/QtxActionToolMgr.cxx @@ -104,7 +104,7 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW } int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::ToolBarAreas dockAreas, - int tid, QMainWindow* mw ) + int tid, QMainWindow* mw ) { static int _toolBarId = -1; @@ -429,8 +429,8 @@ bool QtxActionToolMgr::containsAction( const int id, const int tid ) const { const NodeList& list = it.value().nodes; for ( NodeList::const_iterator nit = list.begin(); nit != list.end(); ++nit ) - if ( (*nit).id == id ) - return true; + if ( (*nit).id == id ) + return true; } } return false; diff --git a/src/Qtx/QtxActionToolMgr.h b/src/Qtx/QtxActionToolMgr.h index 5f81e6e21..e38aae58b 100644 --- a/src/Qtx/QtxActionToolMgr.h +++ b/src/Qtx/QtxActionToolMgr.h @@ -66,7 +66,7 @@ public: int createToolBar( const QString&, int = -1, QMainWindow* = 0 ); int createToolBar( const QString&, bool, Qt::ToolBarAreas = Qt::AllToolBarAreas, - int = -1, QMainWindow* = 0 ); + int = -1, QMainWindow* = 0 ); void removeToolBar( const QString& ); void removeToolBar( const int ); diff --git a/src/Qtx/QtxColorScale.cxx b/src/Qtx/QtxColorScale.cxx index 409110080..3b1cbef93 100755 --- a/src/Qtx/QtxColorScale.cxx +++ b/src/Qtx/QtxColorScale.cxx @@ -530,7 +530,7 @@ QSize QtxColorScale::sizeHint() const \return color scale size */ QSize QtxColorScale::calculateSize( const bool min, const int flags, const bool title, - const bool labels, const bool colors ) const + const bool labels, const bool colors ) const { int num = intervalsNumber(); @@ -585,7 +585,7 @@ QSize QtxColorScale::calculateSize( const bool min, const int flags, const bool { QPainter p( (QtxColorScale*)this ); if ( scaleWidth ) - srt->setTextWidth( scaleWidth ); + srt->setTextWidth( scaleWidth ); titleHeight = (int)srt->size().height() + spacer; titleWidth = (int)srt->size().width() + 10; @@ -615,9 +615,9 @@ QPixmap QtxColorScale::dump() const { bool scale = ( myDumpMode == ScaleDump || myDumpMode == FullDump ); bool label = ( myDumpMode == ScaleDump || myDumpMode == FullDump ) && - labelPosition() != None; + labelPosition() != None; bool title = ( myDumpMode == TitleDump || myDumpMode == FullDump ) && - titlePosition() != None; + titlePosition() != None; QColor bgc = palette().color( backgroundRole() ); QPainter p; p.begin( &aPix ); @@ -666,9 +666,9 @@ QPixmap QtxColorScale::dump( const QColor& bg, const int w, const int h ) const QSize sz = calculateSize( false, myFlags & ~WrapTitle, title, label, scale ); if ( W < 0 ) - W = sz.width(); + W = sz.width(); if ( H < 0 ) - H = sz.height(); + H = sz.height(); } aPix = QPixmap( W, H ); @@ -724,8 +724,8 @@ void QtxColorScale::drawContents( QPainter* p ) QRect aDrawRect = contentsRect(); drawScale( p, false/*testFlags( Transparent )*/, aDrawRect.x(), - aDrawRect.y(), aDrawRect.width(), aDrawRect.height(), - titlePosition() != None, labelPosition() != None, true ); + aDrawRect.y(), aDrawRect.width(), aDrawRect.height(), + titlePosition() != None, labelPosition() != None, true ); } /*! @@ -906,13 +906,13 @@ void QtxColorScale::drawScale( QPainter* p, const QColor& bg, const bool transp, int pos2 = lab - 1 - i2; if ( filter && !( pos1 % filter ) ) { - p->drawText( x, (int)( Y + i1 * step + ascent + offset ), labels[i1] ); - last1 = i1; + p->drawText( x, (int)( Y + i1 * step + ascent + offset ), labels[i1] ); + last1 = i1; } if ( filter && !( pos2 % filter ) ) { - p->drawText( x, (int)( Y + i2 * step + ascent + offset ), labels[i2] ); - last2 = i2; + p->drawText( x, (int)( Y + i2 * step + ascent + offset ), labels[i2] ); + last2 = i2; } i1++; i2--; @@ -922,8 +922,8 @@ void QtxColorScale::drawScale( QPainter* p, const QColor& bg, const bool transp, while ( pos <= i2 && i0 == -1 ) { if ( filter && !( pos % filter ) && - qAbs( pos - last1 ) >= filter && qAbs( pos - last2 ) >= filter ) - i0 = pos; + qAbs( pos - last1 ) >= filter && qAbs( pos - last2 ) >= filter ) + i0 = pos; pos++; } diff --git a/src/Qtx/QtxColorScale.h b/src/Qtx/QtxColorScale.h index 8b601adbf..91bdd458a 100755 --- a/src/Qtx/QtxColorScale.h +++ b/src/Qtx/QtxColorScale.h @@ -137,12 +137,12 @@ private: double getNumber( const int ) const; QTextDocument* textDocument( const int ) const; void drawScale( QPainter*, const bool, const int, const int, - const int, const int, const bool, const bool, const bool ) const; + const int, const int, const bool, const bool, const bool ) const; void drawScale( QPainter*, const QColor&, const bool, - const int, const int, const int, const int, - const bool, const bool, const bool ) const; + const int, const int, const int, const int, + const bool, const bool, const bool ) const; QSize calculateSize( const bool, const int, - const bool, const bool, const bool ) const; + const bool, const bool, const bool ) const; private: double myMin; //!< lower limit diff --git a/src/Qtx/QtxDialog.cxx b/src/Qtx/QtxDialog.cxx index 3200b7851..a2b86279b 100755 --- a/src/Qtx/QtxDialog.cxx +++ b/src/Qtx/QtxDialog.cxx @@ -260,7 +260,7 @@ void QtxDialog::Area::layoutButtons() { buttonId[mit.value()] = mit.key(); if ( mit.key() >= 0 ) - src.append( mit.value() ); + src.append( mit.value() ); } } @@ -321,7 +321,7 @@ void QtxDialog::Area::layoutButtons() { buttonLayout->addWidget( other[i] ); if ( aPolicy == QtxDialog::Uniform && i < (int)other.count() - 1 ) - buttonLayout->addStretch( 1 ); + buttonLayout->addStretch( 1 ); } } @@ -446,10 +446,10 @@ QtxDialog::QtxDialog( QWidget* parent, bool modal, bool allowResize, const int f #endif ( ( allowResize #ifdef WIN32 - // in qwidget_win.cpp flag WStyle_ContextHelp will be unset in WStyle_MinMax in switched ON - && !( wf & Qt::WindowContextHelpButtonHint ) + // in qwidget_win.cpp flag WStyle_ContextHelp will be unset in WStyle_MinMax in switched ON + && !( wf & Qt::WindowContextHelpButtonHint ) #endif - ) ? Qt::WindowMaximizeButtonHint : 0 ) ) ), + ) ? Qt::WindowMaximizeButtonHint : 0 ) ) ), myInited( false ), mySender( 0 ), myAlignment( 0 ), @@ -1051,7 +1051,7 @@ void QtxDialog::removeButton( const int id ) for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it ) { if ( it.key() < 0 ) - map.insert( it.key(), it.value() ); + map.insert( it.key(), it.value() ); } } else if ( myButton.contains( id ) ) @@ -1212,7 +1212,7 @@ QtxDialog::ButtonMap QtxDialog::buttons( const int f ) const { for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end(); ++it ) if ( f == -1 || ( it.key() >= 0 && f & it.key() ) ) - retmap.insert( it.key(), it.value() ); + retmap.insert( it.key(), it.value() ); } return retmap; } @@ -1541,7 +1541,7 @@ void QtxDialog::adjustButtons() const QList& lst = aIt.value()->buttons(); for ( QList::const_iterator bIt = lst.begin(); bIt != lst.end(); ++bIt ) if ( (*bIt)->isVisibleTo( this ) ) - minWidth = qMax( minWidth, (*bIt)->sizeHint().width() ); + minWidth = qMax( minWidth, (*bIt)->sizeHint().width() ); } for ( AreaMap::Iterator aItr = myArea.begin(); aItr != myArea.end(); ++aItr ) @@ -1549,7 +1549,7 @@ void QtxDialog::adjustButtons() const QList& lst = aItr.value()->buttons(); for ( QList::const_iterator bItr = lst.begin(); bItr != lst.end(); ++bItr ) if ( (*bItr)->isVisibleTo( this ) ) - (*bItr)->setMinimumWidth( minWidth ); + (*bItr)->setMinimumWidth( minWidth ); } } diff --git a/src/Qtx/QtxDialog.h b/src/Qtx/QtxDialog.h index bd5824924..e35487f38 100755 --- a/src/Qtx/QtxDialog.h +++ b/src/Qtx/QtxDialog.h @@ -48,41 +48,41 @@ class QTX_EXPORT QtxDialog : public QDialog public: //! Buttons alignment type typedef enum { Position, //!< buttons are placed according their position - Expand, //!< buttons occupy all available space - Uniform //!< buttons are uniformly placed in the area + Expand, //!< buttons occupy all available space + Uniform //!< buttons are uniformly placed in the area } PlacePolicy; //! Buttons area typedef enum { TopArea, //!< horizontal area at the top side of the dialog box - BottomArea, //!< horizontal area at the bottom side of the dialog box - LeftArea, //!< vertical area at the left side of the dialog box - RightArea //!< vertical area at the right side of the dialog box + BottomArea, //!< horizontal area at the bottom side of the dialog box + LeftArea, //!< vertical area at the left side of the dialog box + RightArea //!< vertical area at the right side of the dialog box } ButtonArea; //! Button position typedef enum { Left, //!< set button left-most - Right, //!< set button right-most - Center, //!< place button in the center - Top = Left, //!< set button top-most - Bottom = Right //!< set button bottom-most + Right, //!< set button right-most + Center, //!< place button in the center + Top = Left, //!< set button top-most + Bottom = Right //!< set button bottom-most } ButtonPosition; //! Button ID flags typedef enum { None = 0x00000000, //!< no button used - OK = 0x00000001, //!< OK button - Apply = 0x00000002, //!< Apply button - Cancel = 0x00000004, //!< Cancel button - Yes = 0x00000008, //!< Yes button - No = 0x00000010, //!< No button - Close = 0x00000020, //!< Close button - Help = 0x00000040, //!< Help button - OKCancel = OK | Cancel, //!< OK & Cancel button - YesNo = Yes | No, //!< Yes & No buttons - Standard = OK | Cancel | Help, //!< OK, Cancel & Help buttons - All = Standard | YesNo | Apply | Close //!< all buttons + OK = 0x00000001, //!< OK button + Apply = 0x00000002, //!< Apply button + Cancel = 0x00000004, //!< Cancel button + Yes = 0x00000008, //!< Yes button + No = 0x00000010, //!< No button + Close = 0x00000020, //!< Close button + Help = 0x00000040, //!< Help button + OKCancel = OK | Cancel, //!< OK & Cancel button + YesNo = Yes | No, //!< Yes & No buttons + Standard = OK | Cancel | Help, //!< OK, Cancel & Help buttons + All = Standard | YesNo | Apply | Close //!< all buttons } ButtonFlags; //! Dialog box flags typedef enum { Accept = 0x000001, //!< allow dialog box accepting control - Reject = 0x000002, //!< allow dialog box rejecting control - AlignOnce = 0x000004, //!< align dialog box only when it is first time shown - SetFocus = 0x000008 //!< allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget) + Reject = 0x000002, //!< allow dialog box rejecting control + AlignOnce = 0x000004, //!< align dialog box only when it is first time shown + SetFocus = 0x000008 //!< allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget) } DialogFlags; public: diff --git a/src/Qtx/QtxDockAction.h b/src/Qtx/QtxDockAction.h index fbc1b2d39..756cbd314 100755 --- a/src/Qtx/QtxDockAction.h +++ b/src/Qtx/QtxDockAction.h @@ -46,8 +46,8 @@ class QTX_EXPORT QtxDockAction : public QtxAction public: //! Dock windows type. enum { ToolBar, //!< list toolbars only - DockWidget, //!< list dockable windows only - Both //!< list toolbars and dockable windows + DockWidget, //!< list dockable windows only + Both //!< list toolbars and dockable windows } DockType; public: diff --git a/src/Qtx/QtxDockWidget.cxx b/src/Qtx/QtxDockWidget.cxx index a14b2fd40..a7adfc5d1 100644 --- a/src/Qtx/QtxDockWidget.cxx +++ b/src/Qtx/QtxDockWidget.cxx @@ -269,7 +269,7 @@ void QtxDockWidget::Watcher::updateVisibility() if ( l ) { for ( int i = 0; i < (int)l->count() && !vis; i++ ) - vis = l->itemAt( i ) && l->itemAt( i )->widget() && l->itemAt( i )->widget()->isVisibleTo( myCont ); + vis = l->itemAt( i ) && l->itemAt( i )->widget() && l->itemAt( i )->widget()->isVisibleTo( myCont ); } } diff --git a/src/Qtx/QtxDoubleSpinBox.cxx b/src/Qtx/QtxDoubleSpinBox.cxx index 87d5b6008..dad449f6c 100644 --- a/src/Qtx/QtxDoubleSpinBox.cxx +++ b/src/Qtx/QtxDoubleSpinBox.cxx @@ -65,7 +65,7 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( QWidget* parent ) myPrecision(0) { connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); } /*! @@ -90,7 +90,7 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, QWidget setSingleStep( step ); connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); } /*! @@ -116,7 +116,7 @@ QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, int pre setSingleStep( step ); connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); } /*! @@ -275,30 +275,30 @@ QValidator::State QtxDoubleSpinBox::validate( QString& str, int& pos ) const else { if ( str.length() >= overhead && str.startsWith( pref ) && - str.right( suff.length() ) == suff ) - { - QString core = str.mid( pref.length(), str.length() - overhead ); - int corePos = pos - pref.length(); - state = v.validate( core, corePos ); - pos = corePos + pref.length(); - str.replace( pref.length(), str.length() - overhead, core ); - } + str.right( suff.length() ) == suff ) + { + QString core = str.mid( pref.length(), str.length() - overhead ); + int corePos = pos - pref.length(); + state = v.validate( core, corePos ); + pos = corePos + pref.length(); + str.replace( pref.length(), str.length() - overhead, core ); + } else - { - state = v.validate( str, pos ); - if ( state == QValidator::Invalid ) - { - QString special = this->specialValueText().trimmed(); - QString candidate = str.trimmed(); - if ( special.startsWith( candidate ) ) - { - if ( candidate.length() == special.length() ) - state = QValidator::Acceptable; - else - state = QValidator::Intermediate; - } - } - } + { + state = v.validate( str, pos ); + if ( state == QValidator::Invalid ) + { + QString special = this->specialValueText().trimmed(); + QString candidate = str.trimmed(); + if ( special.startsWith( candidate ) ) + { + if ( candidate.length() == special.length() ) + state = QValidator::Acceptable; + else + state = QValidator::Intermediate; + } + } + } } return state; } diff --git a/src/Qtx/QtxEvalExpr.cxx b/src/Qtx/QtxEvalExpr.cxx index 3f8630d82..140a3173a 100644 --- a/src/Qtx/QtxEvalExpr.cxx +++ b/src/Qtx/QtxEvalExpr.cxx @@ -445,7 +445,7 @@ bool QtxEvalParser::prepare( const QString& expr, Postfix& post ) mLen = 0; if ( oPos != pos && cPos != pos ) { - int i; + int i; for ( i = pos + 1; i < (int)expr.length(); i++ ) { if ( expr[i].isSpace() ) @@ -2309,7 +2309,7 @@ QtxEvalExpr::Error QtxEvalSetSets::calculate( const QString& op, QVariant& v1, Q v1 = res; } else - v1 = QVariant( v2.toList().contains( v1 ) ); + v1 = QVariant( v2.toList().contains( v1 ) ); } } return err; @@ -2417,8 +2417,8 @@ int QtxEvalSetConst::priority( const QString& /*op*/, bool /*isBin*/ ) const \return error code (QtxEvalExpr::Error) */ QtxEvalExpr::Error QtxEvalSetConst::isValid( const QString& /*op*/, - const QVariant::Type /*t1*/, - const QVariant::Type /*t2*/ ) const + const QVariant::Type /*t1*/, + const QVariant::Type /*t2*/ ) const { return QtxEvalExpr::InvalidOperation; } diff --git a/src/Qtx/QtxIntSpinBox.cxx b/src/Qtx/QtxIntSpinBox.cxx index 426e31bb9..02a92596e 100755 --- a/src/Qtx/QtxIntSpinBox.cxx +++ b/src/Qtx/QtxIntSpinBox.cxx @@ -62,7 +62,7 @@ QtxIntSpinBox::QtxIntSpinBox( QWidget* parent ) { setCorrectionMode( QSpinBox::CorrectToNearestValue ); connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); } /*! @@ -86,7 +86,7 @@ QtxIntSpinBox::QtxIntSpinBox( int min, int max, int step, QWidget* parent ) setCorrectionMode( QSpinBox::CorrectToNearestValue ); connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); } /*! diff --git a/src/Qtx/QtxListAction.cxx b/src/Qtx/QtxListAction.cxx index b63f0fcd1..6162a28fe 100755 --- a/src/Qtx/QtxListAction.cxx +++ b/src/Qtx/QtxListAction.cxx @@ -587,7 +587,7 @@ QtxListAction::QtxListAction( QObject* parent ) \param parent parent object */ QtxListAction::QtxListAction( const QIcon& icon, const QString& menuText, - int accel, QObject* parent ) + int accel, QObject* parent ) : QtxAction( menuText, icon, menuText, accel, parent ), myFrame( 0 ) { @@ -615,7 +615,7 @@ QtxListAction::QtxListAction( const QString& menuText, int accel, QObject* paren \param parent parent object */ QtxListAction::QtxListAction( const QString& text, const QString& menuText, - int accel, QObject* parent ) + int accel, QObject* parent ) : QtxAction( text, menuText, accel, parent ), myFrame( 0 ) { @@ -631,7 +631,7 @@ QtxListAction::QtxListAction( const QString& text, const QString& menuText, \param parent parent object */ QtxListAction::QtxListAction( const QString& text, const QIcon& icon, - const QString& menuText, int accel, QObject* parent ) + const QString& menuText, int accel, QObject* parent ) : QtxAction( text, icon, menuText, accel, parent ), myFrame( 0 ) { diff --git a/src/Qtx/QtxLogoMgr.cxx b/src/Qtx/QtxLogoMgr.cxx index bed55bebc..52e29f908 100644 --- a/src/Qtx/QtxLogoMgr.cxx +++ b/src/Qtx/QtxLogoMgr.cxx @@ -392,7 +392,7 @@ void QtxLogoMgr::generate() { logoLab->setPixmap( (*it).pix ); // if ( !pix.mask().isNull() ) -// logoLab->setMask( pix.mask() ); +// logoLab->setMask( pix.mask() ); } logoLab->setScaledContents( false ); diff --git a/src/Qtx/QtxMRUAction.cxx b/src/Qtx/QtxMRUAction.cxx index d6f6f3d11..b3f5c89a7 100755 --- a/src/Qtx/QtxMRUAction.cxx +++ b/src/Qtx/QtxMRUAction.cxx @@ -378,7 +378,7 @@ void QtxMRUAction::saveLinks( QtxResourceMgr* resMgr, const QString& section, co for ( QStringList::const_iterator it = items.begin(); it != items.end(); ++it ) { if ( (*it).startsWith( itemPrefix ) ) - resMgr->remove( section, *it ); + resMgr->remove( section, *it ); } } @@ -408,8 +408,8 @@ void QtxMRUAction::saveLinks( QtxResourceMgr* resMgr, const QString& section, co int counter = 0; for ( QStringList::const_iterator iter = lst.begin(); - iter != lst.end() && ( myHistoryCount < 0 || counter < myHistoryCount ); - ++iter, counter++ ) + iter != lst.end() && ( myHistoryCount < 0 || counter < myHistoryCount ); + ++iter, counter++ ) resMgr->setValue( section, itemPrefix + QString().sprintf( "%03d", counter ), *iter ); } @@ -467,9 +467,9 @@ void QtxMRUAction::updateMenu() { QString shortName = Qtx::file( myLinks[i] ); if ( map.contains( shortName ) ) - map[shortName]++; + map[shortName]++; else - map.insert( shortName, 0 ); + map.insert( shortName, 0 ); } } @@ -482,7 +482,7 @@ void QtxMRUAction::updateMenu() case LinkAuto: linkName = Qtx::file( *it ); if ( map.contains( linkName ) && map[linkName] ) - linkName = *it; + linkName = *it; break; case LinkShort: linkName = Qtx::file( *it ); diff --git a/src/Qtx/QtxMRUAction.h b/src/Qtx/QtxMRUAction.h index 2611593d5..93a5a231c 100755 --- a/src/Qtx/QtxMRUAction.h +++ b/src/Qtx/QtxMRUAction.h @@ -42,14 +42,14 @@ class QTX_EXPORT QtxMRUAction : public QtxAction public: //! Items insertion policy typedef enum { MoveFirst, //!< put the specified item to the beginning - MoveLast, //!< put the specified item to the end - AddFirst, //!< if specified item doesn't exist, add it to the beginning - AddLast //!< if specified item doesn't exist, add it to the end + MoveLast, //!< put the specified item to the end + AddFirst, //!< if specified item doesn't exist, add it to the beginning + AddLast //!< if specified item doesn't exist, add it to the end } InsertionMode; typedef enum { LinkAuto, //!< put the full path of link into the menu if link file names of severals link are same - LinkShort, //!< put the only file name of link into the menu - LinkFull //!< put the full path of link into the menu + LinkShort, //!< put the only file name of link into the menu + LinkFull //!< put the full path of link into the menu } LinkType; public: diff --git a/src/Qtx/QtxMainWindow.cxx b/src/Qtx/QtxMainWindow.cxx index ac0053e5b..5802f6b1a 100644 --- a/src/Qtx/QtxMainWindow.cxx +++ b/src/Qtx/QtxMainWindow.cxx @@ -309,7 +309,7 @@ void QtxMainWindow::retrieveGeometry( const QString& str ) if ( xOk ) { if ( xp ) - x = screen.width() * qMax( qMin( x, 100 ), 0 ) / 100; + x = screen.width() * qMax( qMin( x, 100 ), 0 ) / 100; x = ( xs > 0 ? x : screen.right() - x - rect.width() ) + frameGeometry().x() - geometry().x(); } @@ -320,7 +320,7 @@ void QtxMainWindow::retrieveGeometry( const QString& str ) if ( yOk ) { if ( yp ) - y = screen.height() * qMax( qMin( y, 100 ), 0 ) / 100; + y = screen.height() * qMax( qMin( y, 100 ), 0 ) / 100; y = ( ys > 0 ? y : screen.bottom() - y - rect.height() ) + frameGeometry().y() - geometry().y(); } diff --git a/src/Qtx/QtxMultiAction.cxx b/src/Qtx/QtxMultiAction.cxx index 9859c9e32..21f85f53b 100644 --- a/src/Qtx/QtxMultiAction.cxx +++ b/src/Qtx/QtxMultiAction.cxx @@ -53,7 +53,7 @@ public: if ( e->type() == QEvent::Leave ) { QToolButton* tb = qobject_cast( o ); if ( tb ) - tb->setDown( false ); + tb->setDown( false ); } return QObject::eventFilter( o, e ); } diff --git a/src/Qtx/QtxPagePrefMgr.cxx b/src/Qtx/QtxPagePrefMgr.cxx index 35c84807d..3a346ec3b 100644 --- a/src/Qtx/QtxPagePrefMgr.cxx +++ b/src/Qtx/QtxPagePrefMgr.cxx @@ -2085,7 +2085,7 @@ QtxPagePrefEditItem::QtxPagePrefEditItem( const QString& title, QtxPreferenceIte */ QtxPagePrefEditItem::QtxPagePrefEditItem( const int type, const QString& title, QtxPreferenceItem* parent, const QString& sect, - const QString& param ) + const QString& param ) : QtxPageNamedPrefItem( title, parent, sect, param ), myType( type ) { @@ -2618,7 +2618,7 @@ QtxPagePrefSpinItem::QtxPagePrefSpinItem( const QString& title, QtxPreferenceIte */ QtxPagePrefSpinItem::QtxPagePrefSpinItem( const int type, const QString& title, QtxPreferenceItem* parent, const QString& sect, - const QString& param ) + const QString& param ) : QtxPageNamedPrefItem( title, parent, sect, param ), myType( type ) { @@ -2988,7 +2988,7 @@ void QtxPagePrefSpinItem::updateSpinBox() \param param resource file parameter associated with the preference item */ QtxPagePrefTextItem::QtxPagePrefTextItem( QtxPreferenceItem* parent, const QString& sect, - const QString& param ) + const QString& param ) : QtxPageNamedPrefItem( QString(), parent, sect, param ) { myEditor = new QTextEdit(); @@ -3102,7 +3102,7 @@ void QtxPagePrefColorItem::retrieve() */ QtxPagePrefFontItem::QtxPagePrefFontItem( const int feat, const QString& title, QtxPreferenceItem* parent, const QString& sect, - const QString& param ) + const QString& param ) : QtxPageNamedPrefItem( title, parent, sect, param ) { setControl( myFont = new QtxFontEdit( feat ) ); diff --git a/src/Qtx/QtxPathDialog.cxx b/src/Qtx/QtxPathDialog.cxx index 684d0a40d..e344862bd 100755 --- a/src/Qtx/QtxPathDialog.cxx +++ b/src/Qtx/QtxPathDialog.cxx @@ -340,7 +340,7 @@ bool QtxPathDialog::isValid() bool QtxPathDialog::acceptData() const { bool ok = true; - + QWidget* parent = (QWidget*)this; FileEntryMap::ConstIterator it; @@ -351,7 +351,7 @@ bool QtxPathDialog::acceptData() const if ( entry.edit->text().isEmpty() ) { QMessageBox::critical( parent, windowTitle(), tr( "File name not specified" ), - QMessageBox::Ok, QMessageBox::NoButton ); + QMessageBox::Ok, QMessageBox::NoButton ); ok = false; } else switch ( entry.mode ) @@ -359,44 +359,44 @@ bool QtxPathDialog::acceptData() const case OpenFile: if ( !fileInfo.exists() ) { - QMessageBox::critical( parent, windowTitle(), tr( "File \"%1\" does not exist" ).arg( fileInfo.filePath() ), - QMessageBox::Ok, QMessageBox::NoButton ); - ok = false; + QMessageBox::critical( parent, windowTitle(), tr( "File \"%1\" does not exist" ).arg( fileInfo.filePath() ), + QMessageBox::Ok, QMessageBox::NoButton ); + ok = false; } break; case SaveFile: if ( fileInfo.exists() ) - ok = QMessageBox::warning( parent, windowTitle(), tr( "File \"%1\" already exist. Do you want to overwrite it?" ).arg( fileInfo.filePath() ), - QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes; + ok = QMessageBox::warning( parent, windowTitle(), tr( "File \"%1\" already exist. Do you want to overwrite it?" ).arg( fileInfo.filePath() ), + QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes; break; case OpenDir: if ( !fileInfo.exists() || !fileInfo.isDir() ) { - QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" does not exist" ).arg( fileInfo.filePath() ), - QMessageBox::Ok, QMessageBox::NoButton ); - ok = false; + QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" does not exist" ).arg( fileInfo.filePath() ), + QMessageBox::Ok, QMessageBox::NoButton ); + ok = false; } break; case SaveDir: if ( fileInfo.exists() && !fileInfo.isDir() ) { - QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ), - QMessageBox::Ok, QMessageBox::NoButton ); - ok = false; + QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ), + QMessageBox::Ok, QMessageBox::NoButton ); + ok = false; } break; case NewDir: if ( fileInfo.exists() ) { - if ( !fileInfo.isDir() ) - { - QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ), - QMessageBox::Ok, QMessageBox::NoButton ); - ok = false; - } - else if ( QDir( fileInfo.filePath() ).count() > 2 ) - ok = QMessageBox::warning( parent, windowTitle(), tr( "Directory \"%1\" not empty. Do you want to remove all files in this directory?" ).arg( fileInfo.filePath() ), - QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes; + if ( !fileInfo.isDir() ) + { + QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ), + QMessageBox::Ok, QMessageBox::NoButton ); + ok = false; + } + else if ( QDir( fileInfo.filePath() ).count() > 2 ) + ok = QMessageBox::warning( parent, windowTitle(), tr( "Directory \"%1\" not empty. Do you want to remove all files in this directory?" ).arg( fileInfo.filePath() ), + QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes; } break; default: @@ -461,7 +461,7 @@ void QtxPathDialog::setFileName( const int id, const QString& txt, const bool au { int mode; QLineEdit* le = fileEntry( id, mode ); - + if ( le ) { if ( autoExt && ( mode == OpenFile || mode == SaveFile ) ) @@ -539,7 +539,7 @@ QLineEdit* QtxPathDialog::fileEntry( const int theId, int& theMode ) const \return created file entry ID */ int QtxPathDialog::createFileEntry( const QString& lab, const int mode, - const QString& filter, const int id ) + const QString& filter, const int id ) { int num = id; if ( num == -1 ) @@ -668,7 +668,7 @@ QStringList QtxPathDialog::filterWildCards( const QString& theFilter ) const for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { if ( (*it).indexOf( "." ) != -1 ) - res.append( (*it).trimmed() ); + res.append( (*it).trimmed() ); } } return res; @@ -720,7 +720,7 @@ bool QtxPathDialog::hasVisibleChildren( QWidget* wid ) const for ( QObjectList::const_iterator it = aChildren.begin(); it != aChildren.end() && !res; ++it ) { if ( (*it)->isWidgetType() ) - res = ((QWidget*)(*it))->isVisibleTo( wid ); + res = ((QWidget*)(*it))->isVisibleTo( wid ); } } return res; diff --git a/src/Qtx/QtxPathDialog.h b/src/Qtx/QtxPathDialog.h index a963d9e08..faf9335ae 100755 --- a/src/Qtx/QtxPathDialog.h +++ b/src/Qtx/QtxPathDialog.h @@ -95,7 +95,7 @@ private: void initialize(); void updateVisibility(); QStringList prepareFilters( const QString& ) const; - bool hasVisibleChildren( QWidget* ) const; + bool hasVisibleChildren( QWidget* ) const; QStringList filterWildCards( const QString& ) const; QString autoExtension( const QString&, const QString& = QString() ) const; diff --git a/src/Qtx/QtxPathListEdit.cxx b/src/Qtx/QtxPathListEdit.cxx index e15173b89..8ba42c264 100644 --- a/src/Qtx/QtxPathListEdit.cxx +++ b/src/Qtx/QtxPathListEdit.cxx @@ -505,24 +505,24 @@ bool QtxPathListEdit::validate( const bool quietMode ) if (found) { if (found != myLastSelected) { // it is forbidden to add directory more then once - if ( !quietMode ) - QMessageBox::critical(this, - tr("Error"), - tr("Directory already specified."), - tr("Ok")); - myEdit->setFocus(); + if ( !quietMode ) + QMessageBox::critical(this, + tr("Error"), + tr("Directory already specified."), + tr("Ok")); + myEdit->setFocus(); return false; } } else { if (!dir.exists()) { - if ( !quietMode && QMessageBox::information(this, - tr("Warning"), - tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()), - tr("Yes"), tr("No"), QString(), 1, 1) == 1) { - myEdit->setFocus(); + if ( !quietMode && QMessageBox::information(this, + tr("Warning"), + tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()), + tr("Yes"), tr("No"), QString(), 1, 1) == 1) { + myEdit->setFocus(); return false; - } + } } // append appendDir(myLastSelected, dir.absPath()); diff --git a/src/Qtx/QtxPopupMgr.cxx b/src/Qtx/QtxPopupMgr.cxx index 343f09314..bccd7f399 100644 --- a/src/Qtx/QtxPopupMgr.cxx +++ b/src/Qtx/QtxPopupMgr.cxx @@ -51,11 +51,11 @@ bool operator<( const QVariant& v1, const QVariant& v2 ) { const QList& aList1 = v1.toList(), aList2 = v2.toList(); QList::const_iterator anIt1 = aList1.begin(), aLast1 = aList1.end(), - anIt2 = aList2.begin(), aLast2 = aList2.end(); + anIt2 = aList2.begin(), aLast2 = aList2.end(); for ( ; anIt1 != aLast1 && anIt2 != aLast2; anIt1++, anIt2++ ) { - if ( (*anIt1) != (*anIt2) ) - return (*anIt1)<(*anIt2); + if ( (*anIt1) != (*anIt2) ) + return (*anIt1)<(*anIt2); } return anIt1 == aLast1 && anIt2 != aLast2; } @@ -85,7 +85,7 @@ public: const ItemAttributes&, const int ); virtual QString rule( const ItemAttributes&, - const QtxPopupMgr::RuleType = VisibleRule ) const; + const QtxPopupMgr::RuleType = VisibleRule ) const; private: QtxPopupMgr* myMgr; @@ -189,7 +189,7 @@ int QtxPopupMgr::PopupCreator::append( const QString& tag, const bool subMenu, \return rule for the menu item corresponding to the rule type */ QString QtxPopupMgr::PopupCreator::rule( const ItemAttributes& /*attr*/, - const QtxPopupMgr::RuleType /*ruleType*/ ) const + const QtxPopupMgr::RuleType /*ruleType*/ ) const { return QString(); } @@ -288,7 +288,7 @@ void QtxPopupMgr::setSelection( QtxPopupSelection* sel ) if ( mySelection ) mySelection->setParent( this ); connect( mySelection, SIGNAL( destroyed( QObject* ) ), - this, SLOT( onSelectionDestroyed( QObject* ) ) ); + this, SLOT( onSelectionDestroyed( QObject* ) ) ); QtxActionMgr::triggerUpdate(); } @@ -514,18 +514,18 @@ bool QtxPopupMgr::isSatisfied( QAction* act, const RuleType ruleType ) const for ( int i = 0; i < mySelection->count() && !res; i++ ) { QList c; - for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 ) + for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 ) c.append( parameter( *anIt1, i ) ); aCorteges.insert( c, 0 ); } for ( QMap, int>::const_iterator anIt = aCorteges.begin(); anIt != aCorteges.end(); ++anIt ) { - const QList& aCortege = anIt.key(); - QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end(); - QList::const_iterator anIt2 = aCortege.begin(); - for ( ; anIt1 != aLast1; anIt1++, anIt2++ ) - p->setParameter( *anIt1, *anIt2 ); - res = res || result( p ); + const QList& aCortege = anIt.key(); + QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end(); + QList::const_iterator anIt2 = aCortege.begin(); + for ( ; anIt1 != aLast1; anIt1++, anIt2++ ) + p->setParameter( *anIt1, *anIt2 ); + res = res || result( p ); } } else @@ -726,9 +726,9 @@ QVariant QtxPopupSelection::parameter( const QString& str ) const { QVariant v = parameter( i, par ); if ( v.isValid() ) - QtxEvalSetSets::add( set, v ); + QtxEvalSetSets::add( set, v ); else - return QVariant(); + return QVariant(); } return set; } diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index a273d8bce..addc1dce1 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -683,24 +683,24 @@ bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap c #A03C3C", -", c #99393A", +" c None", +". c #111111", +"+ c #0A0A0A", +"@ c #161616", +"# c #ACACAC", +"$ c #FC6D6E", +"% c #FB6364", +"& c #F25B5C", +"* c #EA5859", +"= c #C1494A", +"- c #B64545", +"; c #AB4040", +"> c #A03C3C", +", c #99393A", " . ", " +@+ ..# ", " +$+# .$.... ", @@ -71,20 +71,20 @@ const char* const first_xpm[] = { const char* const last_xpm[] = { "16 16 14 1", -" c None", -". c #111111", -"+ c #0A0A0A", -"@ c #161616", -"# c #FC6D6E", -"$ c #ACACAC", -"% c #FB6364", -"& c #F25B5C", -"* c #EA5859", -"= c #C1494A", -"- c #B64545", -"; c #AB4040", -"> c #A03C3C", -", c #99393A", +" c None", +". c #111111", +"+ c #0A0A0A", +"@ c #161616", +"# c #FC6D6E", +"$ c #ACACAC", +"% c #FB6364", +"& c #F25B5C", +"* c #EA5859", +"= c #C1494A", +"- c #B64545", +"; c #AB4040", +"> c #A03C3C", +", c #99393A", " . ", " .. +@+ ", " ....#. +#+$", @@ -104,18 +104,18 @@ const char* const last_xpm[] = { const char* const prev_xpm[] = { "16 16 12 1", -" c None", -". c #111111", -"+ c #ACACAC", -"@ c #FC6D6E", -"# c #FB6364", -"$ c #F25B5C", -"% c #EA5859", -"& c #C1494A", -"* c #B64545", -"= c #AB4040", -"- c #A03C3C", -"; c #99393A", +" c None", +". c #111111", +"+ c #ACACAC", +"@ c #FC6D6E", +"# c #FB6364", +"$ c #F25B5C", +"% c #EA5859", +"& c #C1494A", +"* c #B64545", +"= c #AB4040", +"- c #A03C3C", +"; c #99393A", " . ", " ..+ ", " .@...... ", @@ -135,18 +135,18 @@ const char* const prev_xpm[] = { const char* const next_xpm[] = { "16 16 12 1", -" c None", -". c #111111", -"+ c #FC6D6E", -"@ c #FB6364", -"# c #F25B5C", -"$ c #EA5859", -"% c #C1494A", -"& c #B64545", -"* c #ACACAC", -"= c #AB4040", -"- c #A03C3C", -"; c #99393A", +" c None", +". c #111111", +"+ c #FC6D6E", +"@ c #FB6364", +"# c #F25B5C", +"$ c #EA5859", +"% c #C1494A", +"& c #B64545", +"* c #ACACAC", +"= c #AB4040", +"- c #A03C3C", +"; c #99393A", " . ", " .. ", " ......+. ", @@ -166,14 +166,14 @@ const char* const next_xpm[] = { const char* const close_xpm[] = { "16 16 8 1", -" c None", -". c #D73727", -"+ c #E17765", -"@ c #E7957F", -"# c #DE6F48", -"$ c #DF7B4F", -"% c #FAE9E4", -"& c #FFFFFF", +" c None", +". c #D73727", +"+ c #E17765", +"@ c #E7957F", +"# c #DE6F48", +"$ c #DF7B4F", +"% c #FAE9E4", +"& c #FFFFFF", " ", " ............ ", " .+@@@@@@@@@@+. ", @@ -828,9 +828,9 @@ void QtxSearchTool::find( const QString& what, int where ) QPalette p = myData->palette(); p.setColor( QPalette::Active, - QPalette::Base, - QApplication::palette( myData ).color( QPalette::Active, - QPalette::Base ) ); + QPalette::Base, + QApplication::palette( myData ).color( QPalette::Active, + QPalette::Base ) ); bool found = true; if ( mySearcher && !what.isEmpty() ) @@ -1041,7 +1041,7 @@ void QtxSearchTool::updateShortcuts() for ( it = myShortcuts.begin(), i = 0; it != myShortcuts.end(); ++it, i++ ) { (*it)->setEnabled( isEnabled() && ( i < 3 && myActivators & StandardKey || - i > 2 && myActivators & HotKey ) ); + i > 2 && myActivators & HotKey ) ); } } @@ -1408,8 +1408,8 @@ QModelIndexList QtxTreeViewSearcher::findItems( const QString& text, QtxSearchTo if ( myView->model() ) return myView->model()->match( myView->model()->index( 0, myColumn ), - Qt::DisplayRole, - s, -1, fl ); + Qt::DisplayRole, + s, -1, fl ); return QModelIndexList(); } @@ -1422,8 +1422,8 @@ QModelIndexList QtxTreeViewSearcher::findItems( const QString& text, QtxSearchTo appropriate item */ QModelIndex QtxTreeViewSearcher::findNearest( const QModelIndex& index, - const QModelIndexList& lst, - bool direction ) + const QModelIndexList& lst, + bool direction ) { if ( direction ) { @@ -1432,7 +1432,7 @@ QModelIndex QtxTreeViewSearcher::findNearest( const QModelIndex& index, { QModelIndex found = it.next(); if ( compareIndices( found, index ) > 0 ) - return found; + return found; } } else @@ -1443,7 +1443,7 @@ QModelIndex QtxTreeViewSearcher::findNearest( const QModelIndex& index, { QModelIndex found = it.previous(); if ( compareIndices( found, index ) < 0 ) - return found; + return found; } } return QModelIndex(); @@ -1494,7 +1494,7 @@ QString QtxTreeViewSearcher::getId( const QModelIndex& index ) and positive value otherwise */ int QtxTreeViewSearcher::compareIndices( const QModelIndex& left, - const QModelIndex& right ) + const QModelIndex& right ) { QString leftId = getId( left ); QString rightId = getId( right ); diff --git a/src/Qtx/QtxSplash.cxx b/src/Qtx/QtxSplash.cxx index f3610af52..465a42bae 100644 --- a/src/Qtx/QtxSplash.cxx +++ b/src/Qtx/QtxSplash.cxx @@ -266,9 +266,9 @@ void QtxSplash::setError( const QString& error, const QString& title, const int if ( mySplash ) { mySplash->setError( code ); QMessageBox::critical( mySplash, - title.isEmpty() ? tr( "Error" ) : title, - error, - tr( "&OK" ) ); + title.isEmpty() ? tr( "Error" ) : title, + error, + tr( "&OK" ) ); } else { printf( "QtxSplash::error: %s\n",error.toLatin1().constData() ); @@ -552,7 +552,7 @@ int QtxSplash::progressFlags() const \sa progressColors() */ void QtxSplash::setProgressColors( const QColor& startColor, - const QColor& endColor, + const QColor& endColor, const Qt::Orientation orientation ) { if ( !startColor.isValid() ) @@ -907,19 +907,19 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section ) fl = 0; QStringList opts = pf.split( QRegExp( "," ), QString::SkipEmptyParts ); for ( int i = 0; i < opts.count(); i++ ) { - QString opt = opts[i].trimmed().toLower(); - if ( opt == "left" ) - fl = fl | LeftSide; - else if ( opt == "right" ) - fl = fl | RightSide; - else if ( opt == "top" ) - fl = fl | TopSide; - else if ( opt == "bottom" ) - fl = fl | BottomSide; - else if ( opt == "left_to_right" ) - fl = fl | LeftToRight; - else if ( opt == "right_to_left" ) - fl = fl | RightToLeft; + QString opt = opts[i].trimmed().toLower(); + if ( opt == "left" ) + fl = fl | LeftSide; + else if ( opt == "right" ) + fl = fl | RightSide; + else if ( opt == "top" ) + fl = fl | TopSide; + else if ( opt == "bottom" ) + fl = fl | BottomSide; + else if ( opt == "left_to_right" ) + fl = fl | LeftToRight; + else if ( opt == "right_to_left" ) + fl = fl | RightToLeft; } } setProgressFlags( fl ); @@ -946,23 +946,23 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section ) fl = 0; QStringList opts = al.split( QRegExp( "," ), QString::SkipEmptyParts ); for ( int i = 0; i < opts.count(); i++ ) { - QString opt = opts[i].trimmed().toLower(); - if ( opt == "left" ) - fl = fl | Qt::AlignLeft; - else if ( opt == "right" ) - fl = fl | Qt::AlignRight; - else if ( opt == "top" ) - fl = fl | Qt::AlignTop; - else if ( opt == "bottom" ) - fl = fl | Qt::AlignBottom; - else if ( opt == "hcenter" ) - fl = fl | Qt::AlignHCenter; - else if ( opt == "vcenter" ) - fl = fl | Qt::AlignVCenter; - else if ( opt == "justify" ) - fl = fl | Qt::AlignJustify; - else if ( opt == "center" ) - fl = fl | Qt::AlignCenter; + QString opt = opts[i].trimmed().toLower(); + if ( opt == "left" ) + fl = fl | Qt::AlignLeft; + else if ( opt == "right" ) + fl = fl | Qt::AlignRight; + else if ( opt == "top" ) + fl = fl | Qt::AlignTop; + else if ( opt == "bottom" ) + fl = fl | Qt::AlignBottom; + else if ( opt == "hcenter" ) + fl = fl | Qt::AlignHCenter; + else if ( opt == "vcenter" ) + fl = fl | Qt::AlignVCenter; + else if ( opt == "justify" ) + fl = fl | Qt::AlignJustify; + else if ( opt == "center" ) + fl = fl | Qt::AlignCenter; } } setTextAlignment( fl ); @@ -978,17 +978,17 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section ) setProgressColors( lgrad ); } else if ( resMgr->value( resSection, "progress_color", rgrad ) || - resMgr->value( resSection, "progress_colors", rgrad ) ) { + resMgr->value( resSection, "progress_colors", rgrad ) ) { // radial gradient-colored progress bar setProgressColors( rgrad ); } else if ( resMgr->value( resSection, "progress_color", cgrad ) || - resMgr->value( resSection, "progress_colors", cgrad ) ) { + resMgr->value( resSection, "progress_colors", cgrad ) ) { // conical gradient-colored progress bar setProgressColors( cgrad ); } else if ( resMgr->value( resSection, "progress_color", pc ) || - resMgr->value( resSection, "progress_colors", pc ) ) { + resMgr->value( resSection, "progress_colors", pc ) ) { // one/two-colored progress bar QStringList colors = pc.split( "|", QString::SkipEmptyParts ); QColor c1, c2; @@ -1000,12 +1000,12 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section ) bool bOk; gt = colors[2].toInt( &bOk ); if ( bOk ) { - if ( gt == 0 ) - o = Qt::Horizontal; + if ( gt == 0 ) + o = Qt::Horizontal; } else { - if ( colors[2].toLower().startsWith( "h" ) ) - o = Qt::Horizontal; + if ( colors[2].toLower().startsWith( "h" ) ) + o = Qt::Horizontal; } } setProgressColors( c1, c2, o ); @@ -1046,8 +1046,8 @@ void QtxSplash::readSettings( QtxResourceMgr* resMgr, const QString& section ) \sa message(), constantInfo(), setConstantInfo() */ void QtxSplash::setMessage( const QString& msg, - int alignment, - const QColor& color ) + int alignment, + const QColor& color ) { myMessage = msg; myAlignment = alignment; @@ -1219,17 +1219,17 @@ void QtxSplash::drawProgressBar( QPainter* p ) QLinearGradient lg; const QLinearGradient* other = static_cast( progressColors() ); if ( checkGradient( other ) ) { - // gradient is defined in relative coordinates [0.0 - 1.0] - lg.setStart( r.left() + r.width() * other->start().x(), - r.top() + r.height() * other->start().y() ); - lg.setFinalStop( r.left() + r.width() * other->finalStop().x(), - r.top() + r.height() * other->finalStop().y() ); + // gradient is defined in relative coordinates [0.0 - 1.0] + lg.setStart( r.left() + r.width() * other->start().x(), + r.top() + r.height() * other->start().y() ); + lg.setFinalStop( r.left() + r.width() * other->finalStop().x(), + r.top() + r.height() * other->finalStop().y() ); } else { - // gradient is defined in absolute coordinates - // according to its dimensions - lg.setStart( r.topLeft() + other->start() ); - lg.setFinalStop( r.topLeft() + other->finalStop() ); + // gradient is defined in absolute coordinates + // according to its dimensions + lg.setStart( r.topLeft() + other->start() ); + lg.setFinalStop( r.topLeft() + other->finalStop() ); } lg.setStops( other->stops() ); @@ -1244,17 +1244,17 @@ void QtxSplash::drawProgressBar( QPainter* p ) QRadialGradient rg; const QRadialGradient* other = static_cast( progressColors() ); if ( checkGradient( other ) ) { - // gradient is defined in relative coordinates [0.0 - 1.0] - rg.setCenter( r.left() + r.width() * other->center().x(), - r.top() + r.height() * other->center().y() ); - rg.setFocalPoint( r.left() + r.width() * other->focalPoint().x(), - r.top() + r.height() * other->focalPoint().y() ); + // gradient is defined in relative coordinates [0.0 - 1.0] + rg.setCenter( r.left() + r.width() * other->center().x(), + r.top() + r.height() * other->center().y() ); + rg.setFocalPoint( r.left() + r.width() * other->focalPoint().x(), + r.top() + r.height() * other->focalPoint().y() ); } else { - // gradient is defined in absolute coordinates - // according to its dimensions - rg.setCenter( r.topLeft() + other->center() ); - rg.setFocalPoint( r.topLeft() + other->focalPoint() ); + // gradient is defined in absolute coordinates + // according to its dimensions + rg.setCenter( r.topLeft() + other->center() ); + rg.setFocalPoint( r.topLeft() + other->focalPoint() ); } // only width is taken into account for the radius in relative mode @@ -1272,14 +1272,14 @@ void QtxSplash::drawProgressBar( QPainter* p ) QConicalGradient cg; const QConicalGradient* other = static_cast( progressColors() ); if ( checkGradient( other ) ) { - // gradient is defined in relative coordinates [0.0 - 1.0] - cg.setCenter( r.left() + r.width() * other->center().x(), - r.top() + r.height() * other->center().y() ); + // gradient is defined in relative coordinates [0.0 - 1.0] + cg.setCenter( r.left() + r.width() * other->center().x(), + r.top() + r.height() * other->center().y() ); } else { - // gradient is defined in absolute coordinates - // according to its dimensions - cg.setCenter( r.topLeft() + other->center() ); + // gradient is defined in absolute coordinates + // according to its dimensions + cg.setCenter( r.topLeft() + other->center() ); } cg.setAngle( other->angle() ); diff --git a/src/Qtx/QtxSplash.h b/src/Qtx/QtxSplash.h index 07475c65a..66431803e 100644 --- a/src/Qtx/QtxSplash.h +++ b/src/Qtx/QtxSplash.h @@ -95,8 +95,8 @@ public: int progressFlags() const; void setProgressColors( const QColor&, - const QColor& = QColor(), - const Qt::Orientation = Qt::Vertical ); + const QColor& = QColor(), + const Qt::Orientation = Qt::Vertical ); void setProgressColors( const QGradient& ); const QGradient* progressColors() const; @@ -126,8 +126,8 @@ public: public slots: void setMessage( const QString&, - const int, - const QColor& = QColor() ); + const int, + const QColor& = QColor() ); void setMessage( const QString& ); void clear(); diff --git a/src/Qtx/QtxTable.cxx b/src/Qtx/QtxTable.cxx index fe2ba2ed8..63ab2b30a 100644 --- a/src/Qtx/QtxTable.cxx +++ b/src/Qtx/QtxTable.cxx @@ -154,7 +154,7 @@ bool QtxTable::eventFilter( QObject* o, QEvent* e ) if ( o == myHeaderEditor && e->type() == QEvent::KeyPress && isHeaderEditing() ) { - QKeyEvent* ke = (QKeyEvent*)e; + QKeyEvent* ke = (QKeyEvent*)e; if ( ke->key() == Key_Escape ) { endHeaderEdit( false ); @@ -173,8 +173,8 @@ bool QtxTable::eventFilter( QObject* o, QEvent* e ) if ( o == myHeaderEditor && e->type() == QEvent::FocusOut && isHeaderEditing() && ((QFocusEvent*)e)->reason() != QFocusEvent::Popup ) { - endHeaderEdit(); - return true; + endHeaderEdit(); + return true; } if ( e->type() == QEvent::Wheel && isHeaderEditing() ) diff --git a/src/Qtx/QtxToolBar.cxx b/src/Qtx/QtxToolBar.cxx index 6154653fe..23c1ca52b 100644 --- a/src/Qtx/QtxToolBar.cxx +++ b/src/Qtx/QtxToolBar.cxx @@ -101,8 +101,8 @@ bool QtxToolBar::Watcher::eventFilter( QObject* o, QEvent* e ) bool updVis = ( o != myCont && ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent || e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) ) || ( o == myCont && ( e->type() == QEvent::ChildRemoved || e->type() == QEvent::Show || - e->type() == QEvent::ShowToParent || e->type() == QEvent::ActionAdded || - e->type() == QEvent::ActionRemoved ) ); + e->type() == QEvent::ShowToParent || e->type() == QEvent::ActionAdded || + e->type() == QEvent::ActionRemoved ) ); if ( updVis ) { diff --git a/src/Qtx/QtxToolTip.cxx b/src/Qtx/QtxToolTip.cxx index 61007661b..c05ad1449 100755 --- a/src/Qtx/QtxToolTip.cxx +++ b/src/Qtx/QtxToolTip.cxx @@ -48,21 +48,21 @@ QtxToolTip::QtxToolTip( QWidget* parent ) palette.setColor( backgroundRole(), QColor( 255, 255, 231 ) ); setPalette( palette ); - myWidgetRegion = QRect( -1, -1, -1, -1 ); + myWidgetRegion = QRect( -1, -1, -1, -1 ); - setFrameShape( QFrame::Panel ); - setFrameShadow( QFrame::Plain ); + setFrameShape( QFrame::Panel ); + setFrameShadow( QFrame::Plain ); parent->setMouseTracking( true ); - parent->installEventFilter( this ); - installEventFilter( this ); + parent->installEventFilter( this ); + installEventFilter( this ); - mySleepTimer = new QTimer( this ); + mySleepTimer = new QTimer( this ); mySleepTimer->setSingleShot( true ); - myWakeUpTimer = new QTimer( this ); + myWakeUpTimer = new QTimer( this ); myWakeUpTimer->setSingleShot( true ); - connect( mySleepTimer, SIGNAL( timeout() ), this, SLOT( onSleepTimeOut() ) ); - connect( myWakeUpTimer, SIGNAL( timeout() ), this, SLOT( onWakeUpTimeOut() ) ); + connect( mySleepTimer, SIGNAL( timeout() ), this, SLOT( onSleepTimeOut() ) ); + connect( myWakeUpTimer, SIGNAL( timeout() ), this, SLOT( onWakeUpTimeOut() ) ); myWakeUpDelayTime = 700; myShowDelayTime = 5000; @@ -80,49 +80,49 @@ QtxToolTip::~QtxToolTip() */ bool QtxToolTip::eventFilter( QObject* o, QEvent* e ) { - if ( ( e->type() == QEvent::Destroy ) || ( e->type() == QEvent::Close ) || ( e->type() == QEvent::Hide ) ) - { - hideTip(); - } - if ( e->type() == QEvent::Leave ) - { - if ( isVisible() && ( o == this ) ) - hideTip(); - myWakeUpTimer->stop(); - } - if ( e->type() == QEvent::MouseMove ) - { - QMouseEvent* me = (QMouseEvent*)e; - QPoint thePos = parentWidget()->mapFromGlobal( me->globalPos() ); - if ( myWakeUpTimer->isActive() ) - { - myWakeUpTimer->stop(); - myWakeUpTimer->start( myWakeUpDelayTime ); - } - if ( isVisible() ) - { - if ( !myWidgetRegion.contains( thePos ) ) + if ( ( e->type() == QEvent::Destroy ) || ( e->type() == QEvent::Close ) || ( e->type() == QEvent::Hide ) ) + { + hideTip(); + } + if ( e->type() == QEvent::Leave ) + { + if ( isVisible() && ( o == this ) ) + hideTip(); + myWakeUpTimer->stop(); + } + if ( e->type() == QEvent::MouseMove ) + { + QMouseEvent* me = (QMouseEvent*)e; + QPoint thePos = parentWidget()->mapFromGlobal( me->globalPos() ); + if ( myWakeUpTimer->isActive() ) + { + myWakeUpTimer->stop(); + myWakeUpTimer->start( myWakeUpDelayTime ); + } + if ( isVisible() ) + { + if ( !myWidgetRegion.contains( thePos ) ) { - hideTip(); + hideTip(); myWidgetRegion = QRect( -1, -1, -1, -1 ); } - } - else - { - if ( !myWidgetRegion.isValid() || myWidgetRegion.contains( thePos ) ) - myWakeUpTimer->start( myWakeUpDelayTime ); - } - } - if ( e->type() == QEvent::KeyPress ) - { - hideTip(); - } - if ( o == parent() && ( e->type() == QEvent::MouseButtonPress || + } + else + { + if ( !myWidgetRegion.isValid() || myWidgetRegion.contains( thePos ) ) + myWakeUpTimer->start( myWakeUpDelayTime ); + } + } + if ( e->type() == QEvent::KeyPress ) + { + hideTip(); + } + if ( o == parent() && ( e->type() == QEvent::MouseButtonPress || e->type() == QEvent::MouseButtonRelease ) ) - { - hideTip(); - } - return false; + { + hideTip(); + } + return false; } /*! @@ -133,10 +133,10 @@ bool QtxToolTip::eventFilter( QObject* o, QEvent* e ) */ void QtxToolTip::showTip( const QPoint& aPos, const QString& text, const QRect& aWidgetRegion ) { - QFontMetrics theFM = fontMetrics(); - int theHeight = theFM.height(); - int theWidth = theFM.width( text ) + 2; - showTip( QRect( QPoint( aPos.x(), aPos.y() + 10 ), QSize( theWidth, theHeight ) ), text, aWidgetRegion ); + QFontMetrics theFM = fontMetrics(); + int theHeight = theFM.height(); + int theWidth = theFM.width( text ) + 2; + showTip( QRect( QPoint( aPos.x(), aPos.y() + 10 ), QSize( theWidth, theHeight ) ), text, aWidgetRegion ); } /*! @@ -147,12 +147,12 @@ void QtxToolTip::showTip( const QPoint& aPos, const QString& text, const QRect& */ void QtxToolTip::showTip( const QRect& aRegion, const QString& text, const QRect& aWidgetRegion ) { - setText( text ); - myWidgetRegion = aWidgetRegion; - setGeometry( aRegion ); - if ( myShowDelayTime != 0 ) - mySleepTimer->start( myShowDelayTime ); - show(); + setText( text ); + myWidgetRegion = aWidgetRegion; + setGeometry( aRegion ); + if ( myShowDelayTime != 0 ) + mySleepTimer->start( myShowDelayTime ); + show(); } /*! @@ -160,9 +160,9 @@ void QtxToolTip::showTip( const QRect& aRegion, const QString& text, const QRect */ void QtxToolTip::hideTip() { - hide(); + hide(); myWidgetRegion = QRect( -1, -1, -1, -1 ); - mySleepTimer->stop(); + mySleepTimer->stop(); } /*! @@ -172,23 +172,23 @@ void QtxToolTip::hideTip() */ void QtxToolTip::maybeTip( const QPoint& pos ) { - QString text; - QRect textRegion, theRegion( -1, -1, -1, -1 ); - QFont theFnt = font(); + QString text; + QRect textRegion, theRegion( -1, -1, -1, -1 ); + QFont theFnt = font(); emit maybeTip( pos, text, theFnt, textRegion, theRegion ); if ( theRegion.isValid() ) - { - setFont( theFnt ); - int margin = lineWidth() + indent(); - QRect dspRegion( QPoint( textRegion.x() - margin, textRegion.y() ), - QSize( textRegion.width() + 2 * margin, textRegion.height() ) ); - QRect tipRegion( parentWidget()->mapToGlobal( dspRegion.topLeft() ), dspRegion.size() ); - if ( tipRegion.left() < 0 ) - tipRegion.translate( -1 * tipRegion.left(), 0 ); - showTip( tipRegion, text, theRegion ); - } + { + setFont( theFnt ); + int margin = lineWidth() + indent(); + QRect dspRegion( QPoint( textRegion.x() - margin, textRegion.y() ), + QSize( textRegion.width() + 2 * margin, textRegion.height() ) ); + QRect tipRegion( parentWidget()->mapToGlobal( dspRegion.topLeft() ), dspRegion.size() ); + if ( tipRegion.left() < 0 ) + tipRegion.translate( -1 * tipRegion.left(), 0 ); + showTip( tipRegion, text, theRegion ); + } } /*! @@ -196,8 +196,8 @@ void QtxToolTip::maybeTip( const QPoint& pos ) */ void QtxToolTip::onSleepTimeOut() { - mySleepTimer->stop(); - hideTip(); + mySleepTimer->stop(); + hideTip(); } /*! @@ -205,7 +205,7 @@ void QtxToolTip::onSleepTimeOut() */ void QtxToolTip::onWakeUpTimeOut() { - myWakeUpTimer->stop(); + myWakeUpTimer->stop(); QPoint pos = QCursor::pos(); if ( parentWidget() ) pos = parentWidget()->mapFromGlobal( pos ); @@ -217,12 +217,12 @@ void QtxToolTip::onWakeUpTimeOut() */ void QtxToolTip::mousePressEvent( QMouseEvent* e ) { - hideTip(); - QWidget* reciever = parentWidget(); - QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonPress, - reciever->mapFromGlobal( e->globalPos() ), - e->button(), e->buttons(), Qt::KeypadModifier ); - QApplication::sendEvent( reciever, me ); + hideTip(); + QWidget* reciever = parentWidget(); + QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonPress, + reciever->mapFromGlobal( e->globalPos() ), + e->button(), e->buttons(), Qt::KeypadModifier ); + QApplication::sendEvent( reciever, me ); } /*! @@ -230,12 +230,12 @@ void QtxToolTip::mousePressEvent( QMouseEvent* e ) */ void QtxToolTip::mouseDoubleClickEvent( QMouseEvent* e ) { - hideTip(); - QWidget* reciever = parentWidget(); - QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonDblClick, - reciever->mapFromGlobal( e->globalPos() ), - e->button(), e->buttons(), Qt::KeypadModifier ); - QApplication::sendEvent( reciever, me ); + hideTip(); + QWidget* reciever = parentWidget(); + QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonDblClick, + reciever->mapFromGlobal( e->globalPos() ), + e->button(), e->buttons(), Qt::KeypadModifier ); + QApplication::sendEvent( reciever, me ); } /*! diff --git a/src/Qtx/QtxToolTip.h b/src/Qtx/QtxToolTip.h index 1af9afe9a..b8586b6f6 100755 --- a/src/Qtx/QtxToolTip.h +++ b/src/Qtx/QtxToolTip.h @@ -33,20 +33,20 @@ class QTimer; class QTX_EXPORT QtxToolTip : public QLabel { - Q_OBJECT + Q_OBJECT public: - QtxToolTip( QWidget* = 0 ); - virtual ~QtxToolTip(); + QtxToolTip( QWidget* = 0 ); + virtual ~QtxToolTip(); - void hideTip(); + void hideTip(); - virtual void showTip( const QPoint& aPos, + virtual void showTip( const QPoint& aPos, const QString& text, const QRect& aWidgetRegion ); - virtual void showTip( const QRect& aRegion, + virtual void showTip( const QRect& aRegion, const QString& text, const QRect& aWidgetRegion ); - virtual bool eventFilter( QObject* o, QEvent* e ); + virtual bool eventFilter( QObject* o, QEvent* e ); void setWakeUpDelayTime( int ); void setShowDelayTime( int ); @@ -58,21 +58,21 @@ signals: void maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ); protected slots: - void onSleepTimeOut(); - void onWakeUpTimeOut(); + void onSleepTimeOut(); + void onWakeUpTimeOut(); protected: - virtual void maybeTip( const QPoint& ); - virtual void mousePressEvent( QMouseEvent* ); - virtual void mouseDoubleClickEvent( QMouseEvent* ); + virtual void maybeTip( const QPoint& ); + virtual void mousePressEvent( QMouseEvent* ); + virtual void mouseDoubleClickEvent( QMouseEvent* ); QTimer* sleepTimer() const; QTimer* wakeUpTimer() const; private: - QTimer* myWakeUpTimer; - QTimer* mySleepTimer; - QRect myWidgetRegion; + QTimer* myWakeUpTimer; + QTimer* mySleepTimer; + QRect myWidgetRegion; int myShowDelayTime; int myWakeUpDelayTime; diff --git a/src/Qtx/QtxTreeView.cxx b/src/Qtx/QtxTreeView.cxx index 6e6ef8baf..f0ff8d0b8 100644 --- a/src/Qtx/QtxTreeView.cxx +++ b/src/Qtx/QtxTreeView.cxx @@ -110,13 +110,13 @@ void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e ) QIcon icon; if ( iconData.isValid() ) { if ( qVariantCanConvert( iconData ) ) - icon = qVariantValue( iconData ); + icon = qVariantValue( iconData ); else if ( qVariantCanConvert( iconData ) ) - icon = qVariantValue( iconData ); + icon = qVariantValue( iconData ); } if( ( !lab.isEmpty() || !icon.isNull() ) && - appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true ) - { + appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true ) + { QAction* a = menu.addAction( icon, lab ); a->setCheckable( true ); a->setChecked( !isSectionHidden( i ) ); @@ -141,15 +141,15 @@ void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e ) setClickable( a->isChecked() ); QtxTreeView* view = qobject_cast( parent() ); if ( view ) { - view->emitSortingEnabled( a->isChecked() ); - if ( a->isChecked() ) { - connect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) ); - view->sortByColumn( sortIndicatorSection(), sortIndicatorOrder() ); - } - else { - disconnect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) ); - view->sortByColumn( 0, Qt::AscendingOrder ); - } + view->emitSortingEnabled( a->isChecked() ); + if ( a->isChecked() ) { + connect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) ); + view->sortByColumn( sortIndicatorSection(), sortIndicatorOrder() ); + } + else { + disconnect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) ); + view->sortByColumn( 0, Qt::AscendingOrder ); + } } } } @@ -315,7 +315,7 @@ void QtxTreeView::onHeaderClicked( int column ) \param deselected previous selection */ void QtxTreeView::selectionChanged( const QItemSelection& selected, - const QItemSelection& deselected ) + const QItemSelection& deselected ) { QTreeView::selectionChanged( selected, deselected ); emit( selectionChanged() ); @@ -384,15 +384,15 @@ void QtxTreeView::setModel( QAbstractItemModel* m ) QTreeView::setModel( m ); if ( model() ) connect( model(), SIGNAL( headerDataChanged( Qt::Orientation, int, int ) ), - this, SLOT( onAppropriate( Qt::Orientation, int, int ) ) ); + this, SLOT( onAppropriate( Qt::Orientation, int, int ) ) ); } void QtxTreeView::onAppropriate( Qt::Orientation orient, int first, int last ) { if( orient==Qt::Horizontal ) for( int i=first; i<=last; i++ ) - { - int appr = model()->headerData( i, orient, Qtx::AppropriateRole ).toInt(); - header()->setSectionHidden( i, appr==Qtx::Hidden ); - } + { + int appr = model()->headerData( i, orient, Qtx::AppropriateRole ).toInt(); + header()->setSectionHidden( i, appr==Qtx::Hidden ); + } } diff --git a/src/Qtx/QtxValidator.cxx b/src/Qtx/QtxValidator.cxx index 6529d9e2d..e4fec68e3 100644 --- a/src/Qtx/QtxValidator.cxx +++ b/src/Qtx/QtxValidator.cxx @@ -102,7 +102,7 @@ QtxDoubleValidator::QtxDoubleValidator( QObject* parent ) \param parent parent object */ QtxDoubleValidator::QtxDoubleValidator( const double bot, const double top, - const int dec, QObject* parent ) + const int dec, QObject* parent ) : QDoubleValidator( bot, top, dec, parent ) { } diff --git a/src/Qtx/QtxWorkspaceAction.cxx b/src/Qtx/QtxWorkspaceAction.cxx index d2d517977..be6db8a1b 100644 --- a/src/Qtx/QtxWorkspaceAction.cxx +++ b/src/Qtx/QtxWorkspaceAction.cxx @@ -251,12 +251,12 @@ void QtxWorkspaceAction::cascade() ws->cascade(); - int w = ws->width(); - int h = ws->height(); + int w = ws->width(); + int h = ws->height(); - QWidgetList winList = ws->windowList(); + QWidgetList winList = ws->windowList(); for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it ) - (*it)->resize( int( w * 0.8 ), int( h * 0.8 ) ); + (*it)->resize( int( w * 0.8 ), int( h * 0.8 ) ); } /*! diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index d9409bb51..b1da1a5a8 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -372,7 +372,7 @@ void CloseButton::paintEvent( QPaintEvent* ) QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ), isEnabled() ? underMouse() ? QIcon::Active : QIcon::Normal - : QIcon::Disabled, + : QIcon::Disabled, isDown() ? QIcon::On : QIcon::Off ); style()->drawItemPixmap( &p, r, Qt::AlignCenter, pm ); } @@ -445,7 +445,7 @@ void QtxWorkstackSplitter::saveState( QDataStream& stream ) const { QtxWorkstackArea* area = ::qobject_cast( wid ); if ( area ) - area->saveState( stream ); + area->saveState( stream ); } } } @@ -964,13 +964,13 @@ void QtxWorkstackArea::customEvent( QEvent* e ) if ( activeWidget()->focusWidget()->hasFocus() ) { QFocusEvent in( QEvent::FocusIn ); - QApplication::sendEvent( this, &in ); - } + QApplication::sendEvent( this, &in ); + } else { activeWidget()->focusWidget()->setFocus(); - myBar->updateActiveState(); - } + myBar->updateActiveState(); + } } } break; @@ -1912,7 +1912,7 @@ void QtxWorkstack::Split( QWidget* wid, const Qt::Orientation o, const SplitType { area->removeWidget( wid_i ); newArea->insertWidget( wid_i ); - wid_i->showMaximized(); + wid_i->showMaximized(); } } break; @@ -1926,7 +1926,7 @@ void QtxWorkstack::Split( QWidget* wid, const Qt::Orientation o, const SplitType { area->removeWidget( *itr ); newArea->insertWidget( *itr ); - (*itr)->showMaximized(); + (*itr)->showMaximized(); } } break; @@ -2024,7 +2024,7 @@ void QtxWorkstack::Attract( QWidget* wid1, QWidget* wid2, const bool all ) area1->insertWidget( *itr2, wid1_ind + 1 ); else area1->insertWidget( *itr2, ind ); - (*itr2)->showMaximized(); + (*itr2)->showMaximized(); } } else @@ -2907,7 +2907,7 @@ QtxWorkstackArea* QtxWorkstack::createArea( QWidget* parent ) const connect( area, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) ); connect( area, SIGNAL( activated( QWidget* ) ), this, SLOT( onWindowActivated( QWidget* ) ) ); connect( area, SIGNAL( contextMenuRequested( QWidget*, QPoint ) ), - this, SLOT( onContextMenuRequested( QWidget*, QPoint ) ) ); + this, SLOT( onContextMenuRequested( QWidget*, QPoint ) ) ); connect( area, SIGNAL( deactivated( QtxWorkstackArea* ) ), this, SLOT( onDeactivated( QtxWorkstackArea* ) ) ); return area; @@ -3095,7 +3095,7 @@ bool QtxWorkstack::restoreState( QDataStream& stream ) { QtxWorkstackChild* c = *itr; if ( !c->widget() ) - continue; + continue; map.insert( c->widget()->objectName(), c ); diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index fa1ad83c7..7571e18a8 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -59,21 +59,21 @@ class QTX_EXPORT QtxWorkstack : public QWidget public: //! Workstack actions (context menu items) enum { SplitVertical = 0x01, //!< "Split vertically" menu item - SplitHorizontal = 0x02, //!< "Split horizontally" menu item - Close = 0x04, //!< "Close" menu item - Rename = 0x08, //!< "Rename" menu item - All = SplitVertical | SplitHorizontal | - Close | Rename //!< all menu items + SplitHorizontal = 0x02, //!< "Split horizontally" menu item + Close = 0x04, //!< "Close" menu item + Rename = 0x08, //!< "Rename" menu item + All = SplitVertical | SplitHorizontal | + Close | Rename //!< all menu items }; enum { VersionMarker = 0x01, - SplitMarker = 0x02, - AreaMarker = 0x04, - WidgetMarker = 0x08 + SplitMarker = 0x02, + AreaMarker = 0x04, + WidgetMarker = 0x08 }; enum { Horizontal = 0x01, - Visible = 0x02 + Visible = 0x02 }; //! Workstack splitting type @@ -165,7 +165,7 @@ private: void distributeSpace( QSplitter* ) const; int setPosition( QWidget* wid, QSplitter* split, const Qt::Orientation o, - const int need_pos, const int splitter_pos ); + const int need_pos, const int splitter_pos ); private: QPointer myWin; //!< active widget @@ -265,7 +265,7 @@ protected: private: //! Custom events enum { ActivateWidget = QEvent::User, //!< activate widget event - FocusWidget, //!< focus receiving widget event + FocusWidget, //!< focus receiving widget event MakeCurrent, RestoreWidget }; diff --git a/src/Qtx/QtxWorkstackAction.cxx b/src/Qtx/QtxWorkstackAction.cxx index 0686ce4a8..cd4769593 100644 --- a/src/Qtx/QtxWorkstackAction.cxx +++ b/src/Qtx/QtxWorkstackAction.cxx @@ -49,13 +49,13 @@ QtxWorkstackAction::QtxWorkstackAction( QtxWorkstack* ws, QObject* parent ) insertAction( myWorkstack->action( QtxWorkstack::SplitVertical ), SplitVertical ); else insertAction( new QtxAction( tr( "Split the active window on two vertical parts" ), - tr( "Split vertically" ), 0, this ), SplitVertical ); + tr( "Split vertically" ), 0, this ), SplitVertical ); if ( myWorkstack ) insertAction( myWorkstack->action( QtxWorkstack::SplitHorizontal ), SplitHorizontal ); else insertAction( new QtxAction( tr( "Split the active window on two horizontal parts" ), - tr( "Split horizontally" ), 0, this ), SplitHorizontal ); + tr( "Split horizontally" ), 0, this ), SplitHorizontal ); connect( this, SIGNAL( triggered( int ) ), this, SLOT( onTriggered( int ) ) ); diff --git a/src/QxGraph/QxGraph_CanvasView.cxx b/src/QxGraph/QxGraph_CanvasView.cxx index 54ebc3b49..558186175 100644 --- a/src/QxGraph/QxGraph_CanvasView.cxx +++ b/src/QxGraph/QxGraph_CanvasView.cxx @@ -194,15 +194,15 @@ void QxGraph_CanvasView::contentsMousePressEvent(QMouseEvent* theEvent) int aCursorType; if ( anActItem && anActItem->isResizable(myPoint,aCursorType) ) { // resize itself only active items if it is resizable - anActItem->beforeResizing(aCursorType); - myCurrentItem = *it; - return; + anActItem->beforeResizing(aCursorType); + myCurrentItem = *it; + return; } else if ( anActItem && anActItem->isMoveable() ) { // move itself only active items if it is moveable - anActItem->beforeMoving(); - myCurrentItem = *it; - return; + anActItem->beforeMoving(); + myCurrentItem = *it; + return; } } } @@ -218,7 +218,7 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent) if ( myOperation == PANVIEW ) { // Panning scrollBy(myGlobalPoint.x() - aGlobalPoint.x(), - myGlobalPoint.y() - aGlobalPoint.y()); + myGlobalPoint.y() - aGlobalPoint.y()); myGlobalPoint = aGlobalPoint; myMovingDone = true; return; @@ -282,7 +282,7 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent) if ( anActItem ) anActItem->setTMatrix(m); (*it)->show(); } - + myGlobalPoint = aGlobalPoint; myMovingDone = true; @@ -303,12 +303,12 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent) if ( myCurrentItem->x() && myCurrentItem->y() ) { double cx = myCurrentItem->x() - myPoint.x(); double cy = myCurrentItem->y() - myPoint.y(); - + if (aPoint.x()+cx < 0) aPoint.setX(-(int)cx); if (aPoint.y()+cy < 0) aPoint.setY(-(int)cy); } myCurrentItem->moveBy(aPoint.x() - myPoint.x(), - aPoint.y() - myPoint.y()); + aPoint.y() - myPoint.y()); myMovingDone = true; myPoint = aPoint; canvas()->update(); @@ -339,53 +339,53 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent) QxGraph_ActiveItem* anActItem = dynamic_cast( *it ); if (!isHilightPerformed && anActItem) { - // hilight - anActItem->hilight(aPoint); - if (anActItem != myHilightedItem) { - if (myHilightedItem) - myHilightedItem->hilight(aPoint, false); - myHilightedItem = anActItem; - } - isHilightPerformed = true; - - // show tooltip - QxGraph_ToolTip* aToolTip = new QxGraph_ToolTip(this); - aToolTip->maybeTip(aPoint); + // hilight + anActItem->hilight(aPoint); + if (anActItem != myHilightedItem) { + if (myHilightedItem) + myHilightedItem->hilight(aPoint, false); + myHilightedItem = anActItem; + } + isHilightPerformed = true; + + // show tooltip + QxGraph_ToolTip* aToolTip = new QxGraph_ToolTip(this); + aToolTip->maybeTip(aPoint); } int aCursorType; if ( anActItem && anActItem->isResizable(aPoint,aCursorType) ) { - // set resize cursor - QCursor resizeCursor; - switch (aCursorType) - { - case 1: //left - case 3: //right - resizeCursor = QCursor(Qt::SizeHorCursor); - break; - case 2: //top - case 4: //bottom - resizeCursor = QCursor(Qt::SizeVerCursor); - break; - case 5: //left-top - case 7: //right-bottom - resizeCursor = QCursor(Qt::SizeFDiagCursor); - break; - case 6: //right-top - case 8: //left-bottom - resizeCursor = QCursor(Qt::SizeBDiagCursor); - break; - default : - resizeCursor = QCursor(Qt::ArrowCursor); - break; - } - setCursor(resizeCursor); - return; + // set resize cursor + QCursor resizeCursor; + switch (aCursorType) + { + case 1: //left + case 3: //right + resizeCursor = QCursor(Qt::SizeHorCursor); + break; + case 2: //top + case 4: //bottom + resizeCursor = QCursor(Qt::SizeVerCursor); + break; + case 5: //left-top + case 7: //right-bottom + resizeCursor = QCursor(Qt::SizeFDiagCursor); + break; + case 6: //right-top + case 8: //left-bottom + resizeCursor = QCursor(Qt::SizeBDiagCursor); + break; + default : + resizeCursor = QCursor(Qt::ArrowCursor); + break; + } + setCursor(resizeCursor); + return; } else { - // reset old cursor - setCursor(QCursor(Qt::ArrowCursor)); - return; + // reset old cursor + setCursor(QCursor(Qt::ArrowCursor)); + return; } } @@ -396,7 +396,7 @@ void QxGraph_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent) } if ( cursor().shape() == Qt::SizeVerCursor || cursor().shape() == Qt::SizeHorCursor - || cursor().shape() == Qt::SizeBDiagCursor || cursor().shape() == Qt::SizeFDiagCursor) + || cursor().shape() == Qt::SizeBDiagCursor || cursor().shape() == Qt::SizeFDiagCursor) setCursor(QCursor(Qt::ArrowCursor)); } } @@ -530,20 +530,20 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent) QxGraph_ActiveItem* anActItem = dynamic_cast( *it ); if (!isSelectionPerformed && anActItem) { - anActItem->select(aPoint); - if (anActItem != mySelectedItem) - { - if (mySelectedItem && isSelectedItemInCanvas() && - !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false); - mySelectedItem = anActItem; - - // unhilight hilighted item if selection was performed - if (myHilightedItem) { - myHilightedItem->hilight(aPoint, false); - myHilightedItem = 0; - } - } - isSelectionPerformed = true; + anActItem->select(aPoint); + if (anActItem != mySelectedItem) + { + if (mySelectedItem && isSelectedItemInCanvas() && + !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false); + mySelectedItem = anActItem; + + // unhilight hilighted item if selection was performed + if (myHilightedItem) { + myHilightedItem->hilight(aPoint, false); + myHilightedItem = 0; + } + } + isSelectionPerformed = true; } } @@ -551,17 +551,17 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent) { if ( mySelectedItem ) { - if ( isSelectedItemInCanvas() ) mySelectedItem->select(aPoint, false); - mySelectedItem = 0; + if ( isSelectedItemInCanvas() ) mySelectedItem->select(aPoint, false); + mySelectedItem = 0; } // Background popup printf("Background popup\n"); QContextMenuEvent aEvent( QContextMenuEvent::Mouse, - theEvent->pos(), theEvent->globalPos(), - theEvent->state() ); + theEvent->pos(), theEvent->globalPos(), + theEvent->state() ); if ( getViewWindow() ) - getViewWindow()->contextPopupEvent(&aEvent); // => emit contextMenuRequested( &aEvent ); + getViewWindow()->contextPopupEvent(&aEvent); // => emit contextMenuRequested( &aEvent ); } else { // show context popup for the selected item @@ -582,18 +582,18 @@ void QxGraph_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent) else { for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) { - QxGraph_ActiveItem* anActItem = dynamic_cast( *it ); - if (anActItem) - { - anActItem->select(aPoint); - if (anActItem != mySelectedItem) - { - if (mySelectedItem && isSelectedItemInCanvas() && - !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false); - mySelectedItem = anActItem; - } - break; - } + QxGraph_ActiveItem* anActItem = dynamic_cast( *it ); + if (anActItem) + { + anActItem->select(aPoint); + if (anActItem != mySelectedItem) + { + if (mySelectedItem && isSelectedItemInCanvas() && + !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false); + mySelectedItem = anActItem; + } + break; + } } } } @@ -743,17 +743,17 @@ void QxGraph_ToolTip::maybeTip(const QPoint& theMousePos) { QxGraph_ActiveItem* anActItem = dynamic_cast( *it ); if (anActItem) { - QRect aRect; - QString aText = anActItem->getToolTipText(theMousePos, aRect); - int avX, avY; - QWMatrix aWM = ((QCanvasView*)parentWidget())->worldMatrix(); - ((QCanvasView*)parentWidget())->contentsToViewport((int)(aRect.left()*aWM.m11()), - (int)(aRect.top()*aWM.m22()), - avX, avY); - QRect aTipRect(avX, avY, (int)(aRect.width()*aWM.m11()), (int)(aRect.height()*aWM.m22())); - if (!aText.isEmpty()) - tip(aTipRect, aText); - return; + QRect aRect; + QString aText = anActItem->getToolTipText(theMousePos, aRect); + int avX, avY; + QWMatrix aWM = ((QCanvasView*)parentWidget())->worldMatrix(); + ((QCanvasView*)parentWidget())->contentsToViewport((int)(aRect.left()*aWM.m11()), + (int)(aRect.top()*aWM.m22()), + avX, avY); + QRect aTipRect(avX, avY, (int)(aRect.width()*aWM.m11()), (int)(aRect.height()*aWM.m22())); + if (!aText.isEmpty()) + tip(aTipRect, aText); + return; } } } diff --git a/src/QxGraph/QxGraph_CanvasView.h b/src/QxGraph/QxGraph_CanvasView.h index 6c3a26cdc..20f355ee7 100644 --- a/src/QxGraph/QxGraph_CanvasView.h +++ b/src/QxGraph/QxGraph_CanvasView.h @@ -40,7 +40,7 @@ class QXGRAPH_EXPORT QxGraph_CanvasView : public QCanvasView { public: enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, PANGLOBAL, - WINDOWFIT, FITALLVIEW, RESETVIEW }; + WINDOWFIT, FITALLVIEW, RESETVIEW }; QxGraph_CanvasView(QxGraph_Canvas* theCanvas, QxGraph_ViewWindow* theViewWindow); virtual ~QxGraph_CanvasView(); diff --git a/src/QxGraph/QxGraph_Prs.cxx b/src/QxGraph/QxGraph_Prs.cxx index efe4687c0..5b8fcd0cb 100644 --- a/src/QxGraph/QxGraph_Prs.cxx +++ b/src/QxGraph/QxGraph_Prs.cxx @@ -45,12 +45,12 @@ QxGraph_Prs::QxGraph_Prs(QxGraph_Canvas* theCanvas): QxGraph_Prs::~QxGraph_Prs() { for ( DMode2ItemList::iterator it1 = myDisplayMap.begin(); - it1 != myDisplayMap.end(); - it1++ ) + it1 != myDisplayMap.end(); + it1++ ) { for ( std::list::iterator it2 = (*it1).second.begin(); - it2 != (*it1).second.end(); - it2++ ) + it2 != (*it1).second.end(); + it2++ ) { QCanvasItem* anItem = *it2; if ( anItem ) delete anItem; @@ -91,8 +91,8 @@ void QxGraph_Prs::show() update(); for ( std::list::iterator it = myDisplayMap[myDMode].begin(); - it != myDisplayMap[myDMode].end(); - it++ ) + it != myDisplayMap[myDMode].end(); + it++ ) { QCanvasItem* anItem = *it; if ( anItem ) @@ -108,17 +108,17 @@ void QxGraph_Prs::show() void QxGraph_Prs::hide() { for ( DMode2ItemList::iterator it1 = myDisplayMap.begin(); - it1 != myDisplayMap.end(); - it1++ ) + it1 != myDisplayMap.end(); + it1++ ) { for ( std::list::iterator it2 = (*it1).second.begin(); - it2 != (*it1).second.end(); - it2++ ) + it2 != (*it1).second.end(); + it2++ ) { QCanvasItem* anItem = *it2; if ( anItem ) { - anItem->setCanvas( 0 ); + anItem->setCanvas( 0 ); } } } diff --git a/src/QxGraph/QxGraph_ViewManager.cxx b/src/QxGraph/QxGraph_ViewManager.cxx index 261a48429..a003c04cf 100644 --- a/src/QxGraph/QxGraph_ViewManager.cxx +++ b/src/QxGraph/QxGraph_ViewManager.cxx @@ -25,8 +25,8 @@ Constructor */ QxGraph_ViewManager::QxGraph_ViewManager( SUIT_Study* theStudy, - SUIT_Desktop* theDesktop, - SUIT_ViewModel* theViewModel ) + SUIT_Desktop* theDesktop, + SUIT_ViewModel* theViewModel ) : SUIT_ViewManager( theStudy, theDesktop, theViewModel ) { } diff --git a/src/QxGraph/QxGraph_ViewWindow.cxx b/src/QxGraph/QxGraph_ViewWindow.cxx index f6f9ed8cf..2cc7ca689 100644 --- a/src/QxGraph/QxGraph_ViewWindow.cxx +++ b/src/QxGraph/QxGraph_ViewWindow.cxx @@ -126,42 +126,42 @@ void QxGraph_ViewWindow::createActions() // FitAll aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_FITALL" ) ), - tr( "MNU_FITALL" ), 0, this); + tr( "MNU_FITALL" ), 0, this); aAction->setStatusTip(tr("DSC_FITALL")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll())); myActionsMap[ FitAllId ] = aAction; // FitRect aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_FITAREA" ) ), - tr( "MNU_FITRECT" ), 0, this); + tr( "MNU_FITRECT" ), 0, this); aAction->setStatusTip(tr("DSC_FITRECT")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea())); myActionsMap[ FitRectId ] = aAction; // Zoom aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_ZOOM" ) ), - tr( "MNU_ZOOM_VIEW" ), 0, this); + tr( "MNU_ZOOM_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_ZOOM_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom())); myActionsMap[ ZoomId ] = aAction; // Panning aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_PAN" ) ), - tr( "MNU_PAN_VIEW" ), 0, this); + tr( "MNU_PAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_PAN_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan())); myActionsMap[ PanId ] = aAction; // Global Panning aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_GLOBALPAN" ) ), - tr( "MNU_GLOBALPAN_VIEW" ), 0, this); + tr( "MNU_GLOBALPAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan())); myActionsMap[ GlobalPanId ] = aAction; // Reset aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_RESET" ) ), - tr( "MNU_RESET_VIEW" ), 0, this); + tr( "MNU_RESET_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_RESET_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset())); myActionsMap[ ResetId ] = aAction; diff --git a/src/QxScene/QxScene_ViewManager.cxx b/src/QxScene/QxScene_ViewManager.cxx index d6846a4d9..38439ca34 100644 --- a/src/QxScene/QxScene_ViewManager.cxx +++ b/src/QxScene/QxScene_ViewManager.cxx @@ -29,8 +29,8 @@ Constructor */ QxScene_ViewManager::QxScene_ViewManager( SUIT_Study* theStudy, - SUIT_Desktop* theDesktop, - SUIT_ViewModel* theViewModel ) + SUIT_Desktop* theDesktop, + SUIT_ViewModel* theViewModel ) : SUIT_ViewManager( theStudy, theDesktop, theViewModel ) { DEBTRACE("QxScene_ViewManager::QxScene_ViewManager"); diff --git a/src/QxScene/QxScene_ViewWindow.cxx b/src/QxScene/QxScene_ViewWindow.cxx index 28d7d71d4..3c15b1dc7 100644 --- a/src/QxScene/QxScene_ViewWindow.cxx +++ b/src/QxScene/QxScene_ViewWindow.cxx @@ -88,7 +88,7 @@ void QxScene_ViewWindow::createActions() aAction = new QtxAction( tr( "MNU_FITALL" ), aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITALL" ) ), tr( "MNU_FITALL" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_FITALL" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitAll() ) ); mgr->registerAction( aAction, FitAllId ); @@ -97,16 +97,16 @@ void QxScene_ViewWindow::createActions() aAction = new QtxAction( tr( "MNU_FITRECT" ), aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITAREA" ) ), tr( "MNU_FITRECT" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_FITRECT" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitArea() ) ); mgr->registerAction( aAction, FitRectId ); // 2.3. Zoom aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ), - aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ), + aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ), tr( "MNU_ZOOM_VIEW" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewZoom() ) ); mgr->registerAction( aAction, ZoomId ); @@ -122,18 +122,18 @@ void QxScene_ViewWindow::createActions() // 3.1. Panning aAction = new QtxAction( tr( "MNU_PAN_VIEW" ), - aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ), - tr( "MNU_PAN_VIEW" ), - 0, this); + aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ), + tr( "MNU_PAN_VIEW" ), + 0, this); aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewPan() ) ); mgr->registerAction( aAction, PanId ); // 3.2. Global Panning aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ), - aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ), + aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ), tr( "MNU_GLOBALPAN_VIEW" ), - 0, this); + 0, this); aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewGlobalPan() ) ); mgr->registerAction( aAction, GlobalPanId ); @@ -146,9 +146,9 @@ void QxScene_ViewWindow::createActions() // reset aAction = new QtxAction( tr( "MNU_RESET_VIEW" ), - aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ), - tr( "MNU_RESET_VIEW" ), - 0, this); + aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ), + tr( "MNU_RESET_VIEW" ), + 0, this); aAction->setStatusTip( tr( "DSC_RESET_VIEW" ) ); connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewReset() ) ); mgr->registerAction( aAction, ResetId ); diff --git a/src/ResExporter/ResourceExporter.cxx b/src/ResExporter/ResourceExporter.cxx index 597059bde..9a4ebba2c 100644 --- a/src/ResExporter/ResourceExporter.cxx +++ b/src/ResExporter/ResourceExporter.cxx @@ -119,48 +119,48 @@ int main( int argc, char** argv ) for ( int i = 1; i < argc; i ++ ) { QString anArg = QString( argv[i] ).trimmed(); if ( anArg.startsWith( "-" ) ) { - anArg.remove( 0, 1 ); - if ( anArg.contains( ":" ) ) { - QStringList vals = anArg.split( ":", QString::SkipEmptyParts ); - QString section = vals[ 0 ].trimmed(); - QString param = vals[ 1 ].trimmed(); - if ( section.isEmpty() || param.isEmpty() ) continue; - resMgr->remove( section, param ); - } + anArg.remove( 0, 1 ); + if ( anArg.contains( ":" ) ) { + QStringList vals = anArg.split( ":", QString::SkipEmptyParts ); + QString section = vals[ 0 ].trimmed(); + QString param = vals[ 1 ].trimmed(); + if ( section.isEmpty() || param.isEmpty() ) continue; + resMgr->remove( section, param ); + } } else if ( anArg.contains( "+=" ) ) { - QStringList vals = anArg.split( "+=", QString::SkipEmptyParts ); - if ( vals[ 0 ].contains( ":" ) ) { - QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts ); - QString section = vals1[ 0 ].trimmed(); - QString param = vals1[ 1 ].trimmed(); - QString newValue = vals [ 1 ].trimmed(); - QString separ = ","; // default separator - if ( newValue.contains( "|" ) ) { - QStringList vals2 = newValue.split( "|", QString::SkipEmptyParts ); - newValue = vals2[ 0 ].trimmed(); - separ = vals2[ 1 ].trimmed(); - } - if ( section.isEmpty() || param.isEmpty() || newValue.isEmpty() || separ.isEmpty() ) continue; - QString value = resMgr->stringValue( section, param ); - QStringList valsOld = value.split( separ, QString::SkipEmptyParts ); - QStringList valsNew = newValue.split( separ, QString::SkipEmptyParts ); - for ( int i = 0; i < (int)valsNew.count(); i++ ) - if ( !valsOld.contains( valsNew[i] ) ) - valsOld.append( valsNew[i] ); - resMgr->setValue( section, param, valsOld.join( separ ) ); - } + QStringList vals = anArg.split( "+=", QString::SkipEmptyParts ); + if ( vals[ 0 ].contains( ":" ) ) { + QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts ); + QString section = vals1[ 0 ].trimmed(); + QString param = vals1[ 1 ].trimmed(); + QString newValue = vals [ 1 ].trimmed(); + QString separ = ","; // default separator + if ( newValue.contains( "|" ) ) { + QStringList vals2 = newValue.split( "|", QString::SkipEmptyParts ); + newValue = vals2[ 0 ].trimmed(); + separ = vals2[ 1 ].trimmed(); + } + if ( section.isEmpty() || param.isEmpty() || newValue.isEmpty() || separ.isEmpty() ) continue; + QString value = resMgr->stringValue( section, param ); + QStringList valsOld = value.split( separ, QString::SkipEmptyParts ); + QStringList valsNew = newValue.split( separ, QString::SkipEmptyParts ); + for ( int i = 0; i < (int)valsNew.count(); i++ ) + if ( !valsOld.contains( valsNew[i] ) ) + valsOld.append( valsNew[i] ); + resMgr->setValue( section, param, valsOld.join( separ ) ); + } } else if ( anArg.contains( "=" ) ) { - QStringList vals = anArg.split( "=", QString::SkipEmptyParts ); - if ( vals[ 0 ].contains( ":" ) ) { - QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts ); - QString section = vals1[ 0 ].trimmed(); - QString param = vals1[ 1 ].trimmed(); - QString value = vals [ 1 ].trimmed(); - if ( section.isEmpty() || param.isEmpty() ) continue; - resMgr->setValue( section, param, value ); - } + QStringList vals = anArg.split( "=", QString::SkipEmptyParts ); + if ( vals[ 0 ].contains( ":" ) ) { + QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts ); + QString section = vals1[ 0 ].trimmed(); + QString param = vals1[ 1 ].trimmed(); + QString value = vals [ 1 ].trimmed(); + if ( section.isEmpty() || param.isEmpty() ) continue; + resMgr->setValue( section, param, value ); + } } } resMgr->save(); diff --git a/src/SALOME_PY/SalomePy.cxx b/src/SALOME_PY/SalomePy.cxx index 5acd5a1e1..9e7db3d17 100755 --- a/src/SALOME_PY/SalomePy.cxx +++ b/src/SALOME_PY/SalomePy.cxx @@ -143,29 +143,29 @@ static SVTK_ViewWindow* GetVTKViewWindow( int toCreate = __FindOrCreate ) { // get active study LightApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); if ( aStudy ) { - // find or create VTK view manager - if ( toCreate == __Create ) { - SVTK_ViewManager* aVM = dynamic_cast( anApp->createViewManager( "VTKViewer" ) ); - if ( aVM ) { - aVW = dynamic_cast( aVM->getActiveView() ); - if ( !aVW ) - aVW = dynamic_cast( aVM->createViewWindow() ); - // VSR : When new view window is created it can be not active yet at this moment, - // so the following is a some workaround - if ( !aVW && !aVM->getViews().isEmpty() ) - aVW = dynamic_cast( aVM->getViews()[0] ); - } - } - else { - SVTK_ViewManager* aVM = dynamic_cast( anApp->getViewManager( "VTKViewer", toCreate == __FindOrCreate ) ); - if ( aVM ) { - aVW = dynamic_cast( aVM->getActiveView() ); - // VSR : When new view window is created it can be not active yet at this moment, - // so the following is a some workaround - if ( !aVW && !aVM->getViews().isEmpty() ) - aVW = dynamic_cast( aVM->getViews()[0] ); - } - } + // find or create VTK view manager + if ( toCreate == __Create ) { + SVTK_ViewManager* aVM = dynamic_cast( anApp->createViewManager( "VTKViewer" ) ); + if ( aVM ) { + aVW = dynamic_cast( aVM->getActiveView() ); + if ( !aVW ) + aVW = dynamic_cast( aVM->createViewWindow() ); + // VSR : When new view window is created it can be not active yet at this moment, + // so the following is a some workaround + if ( !aVW && !aVM->getViews().isEmpty() ) + aVW = dynamic_cast( aVM->getViews()[0] ); + } + } + else { + SVTK_ViewManager* aVM = dynamic_cast( anApp->getViewManager( "VTKViewer", toCreate == __FindOrCreate ) ); + if ( aVM ) { + aVW = dynamic_cast( aVM->getActiveView() ); + // VSR : When new view window is created it can be not active yet at this moment, + // so the following is a some workaround + if ( !aVW && !aVM->getViews().isEmpty() ) + aVW = dynamic_cast( aVM->getViews()[0] ); + } + } } } } @@ -340,8 +340,8 @@ extern "C" PyObject* libSalomePy_showTrihedron( PyObject* self, PyObject* args ) virtual void Execute() { if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) { - if ( aVTKViewWindow->isTrihedronDisplayed() != myShow ) - aVTKViewWindow->onViewTrihedron(); + if ( aVTKViewWindow->isTrihedronDisplayed() != myShow ) + aVTKViewWindow->onViewTrihedron(); } } }; @@ -373,7 +373,7 @@ extern "C" PyObject* libSalomePy_fitAll( PyObject* self, PyObject* args ) virtual void Execute() { if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) { - aVTKViewWindow->onFitAll(); + aVTKViewWindow->onFitAll(); } } }; @@ -402,23 +402,23 @@ extern "C" PyObject* libSalomePy_setView( PyObject* self, PyObject* args ) virtual void Execute() { if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) { - switch( myType ) { - case ViewFront: - aVTKViewWindow->onFrontView(); break; - case ViewBack: - aVTKViewWindow->onBackView(); break; - case ViewTop: - aVTKViewWindow->onTopView(); break; - case ViewBottom: - aVTKViewWindow->onBottomView(); break; - case ViewRight: - aVTKViewWindow->onRightView(); break; - case ViewLeft: - aVTKViewWindow->onLeftView(); break; - default: - PyErr_Format(PyExc_ValueError,"setView%: wrong parameter value; must be between %d and %d", ViewFront, ViewLeft ); - break; - } + switch( myType ) { + case ViewFront: + aVTKViewWindow->onFrontView(); break; + case ViewBack: + aVTKViewWindow->onBackView(); break; + case ViewTop: + aVTKViewWindow->onTopView(); break; + case ViewBottom: + aVTKViewWindow->onBottomView(); break; + case ViewRight: + aVTKViewWindow->onRightView(); break; + case ViewLeft: + aVTKViewWindow->onLeftView(); break; + default: + PyErr_Format(PyExc_ValueError,"setView%: wrong parameter value; must be between %d and %d", ViewFront, ViewLeft ); + break; + } } } }; @@ -452,7 +452,7 @@ extern "C" PyObject* libSalomePy_resetView( PyObject* self, PyObject* args ) virtual void Execute() { if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) { - aVTKViewWindow->onResetView(); + aVTKViewWindow->onResetView(); } } }; diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx index 80da8eb31..10d777ce2 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx @@ -122,7 +122,7 @@ QString SALOME_PYQT_Module::engineIOR() const { public: EngineIORReq( PyInterp_Interp* _py_interp, - SALOME_PYQT_Module* _obj ) + SALOME_PYQT_Module* _obj ) : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true) myObj( _obj ) {} @@ -207,8 +207,8 @@ void SALOME_PYQT_Module::onViewClosed( SUIT_ViewWindow* pview ) \param setting preference resource name */ void SALOME_PYQT_Module::preferenceChanged( const QString& module, - const QString& section, - const QString& setting ) + const QString& section, + const QString& setting ) { SALOME_PYQT_ModuleLight::preferenceChanged(module,section,setting); } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h index 7e8160e7e..74b190935 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h @@ -48,8 +48,8 @@ public: public slots: void preferenceChanged( const QString&, - const QString&, - const QString& ); + const QString&, + const QString& ); void onGUIEvent(); void onActiveViewChanged( SUIT_ViewWindow* ); void onViewClosed( SUIT_ViewWindow* ); diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx index 8c278a4bc..b9e9bed8d 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx @@ -137,19 +137,19 @@ public: XmlHandler( SALOME_PYQT_ModuleLight* module, const QString& fileName ); void createActions(); void createPopup ( QMenu* menu, - const QString& context, - const QString& parent, - const QString& object ); + const QString& context, + const QString& parent, + const QString& object ); void activateMenus( bool ); protected: void createToolBar ( QDomNode& parentNode ); void createMenu ( QDomNode& parentNode, - const int parentMenuId = -1, - QMenu* parentPopup = 0 ); + const int parentMenuId = -1, + QMenu* parentPopup = 0 ); void insertPopupItems( QDomNode& parentNode, - QMenu* menu ); + QMenu* menu ); private: SALOME_PYQT_ModuleLight* myModule; @@ -344,7 +344,7 @@ void SALOME_PYQT_ModuleLight::initialize( CAM_Application* app ) { public: InitializeReq( CAM_Application* _app, - SALOME_PYQT_ModuleLight* _obj ) + SALOME_PYQT_ModuleLight* _obj ) : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true) myApp( _app ), myObj( _obj ) {} @@ -396,7 +396,7 @@ bool SALOME_PYQT_ModuleLight::activateModule( SUIT_Study* theStudy ) { public: ActivateReq( SUIT_Study* _study, - SALOME_PYQT_ModuleLight* _obj ) + SALOME_PYQT_ModuleLight* _obj ) : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true) myStudy ( _study ), myObj ( _obj ) {} @@ -426,7 +426,7 @@ bool SALOME_PYQT_ModuleLight::activateModule( SUIT_Study* theStudy ) // connect preferences changing signal connect( getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ), - this, SLOT( preferenceChanged( const QString&, const QString&, const QString& ) ) ); + this, SLOT( preferenceChanged( const QString&, const QString&, const QString& ) ) ); // perform custom activation actions // CustomizeReq: request class for internal customize() operation @@ -434,7 +434,7 @@ bool SALOME_PYQT_ModuleLight::activateModule( SUIT_Study* theStudy ) { public: CustomizeReq( SUIT_Study* _study, - SALOME_PYQT_ModuleLight* _obj ) + SALOME_PYQT_ModuleLight* _obj ) : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true) myStudy ( _study ), myObj ( _obj ) {} @@ -472,7 +472,7 @@ bool SALOME_PYQT_ModuleLight::deactivateModule( SUIT_Study* theStudy ) // disconnect preferences changing signal disconnect( getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ), - this, SLOT( preferenceChanged( const QString&, const QString&, const QString& ) ) ); + this, SLOT( preferenceChanged( const QString&, const QString&, const QString& ) ) ); // perform internal deactivation // DeactivateReq: request class for internal deactivate() operation @@ -480,8 +480,8 @@ bool SALOME_PYQT_ModuleLight::deactivateModule( SUIT_Study* theStudy ) { public: DeactivateReq( PyInterp_Interp* _py_interp, - SUIT_Study* _study, - SALOME_PYQT_ModuleLight* _obj ) + SUIT_Study* _study, + SALOME_PYQT_ModuleLight* _obj ) : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true) myStudy ( _study ), myObj ( _obj ) {} @@ -529,8 +529,8 @@ bool SALOME_PYQT_ModuleLight::lastActivationStatus() const \param setting preference resource name */ void SALOME_PYQT_ModuleLight::preferenceChanged( const QString& module, - const QString& section, - const QString& setting ) + const QString& section, + const QString& setting ) { FuncMsg fmsg( "SALOME_PYQT_ModuleLight::preferenceChanged()" ); @@ -539,9 +539,9 @@ void SALOME_PYQT_ModuleLight::preferenceChanged( const QString& module, { public: Event( PyInterp_Interp* _py_interp, - SALOME_PYQT_ModuleLight* _obj, - const QString& _section, - const QString& _setting ) + SALOME_PYQT_ModuleLight* _obj, + const QString& _section, + const QString& _setting ) : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true) myObj ( _obj ), mySection( _section ), @@ -583,7 +583,7 @@ void SALOME_PYQT_ModuleLight::studyActivated() { public: StudyChangedReq( SUIT_Study* _study, - SALOME_PYQT_ModuleLight* _obj ) + SALOME_PYQT_ModuleLight* _obj ) : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true) myStudy ( _study ), myObj ( _obj ) {} @@ -625,8 +625,8 @@ void SALOME_PYQT_ModuleLight::onGUIEvent() { public: GUIEvent( PyInterp_Interp* _py_interp, - SALOME_PYQT_ModuleLight* _obj, - int _id ) + SALOME_PYQT_ModuleLight* _obj, + int _id ) : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true) myId ( _id ), myObj ( _obj ) {} @@ -657,8 +657,8 @@ void SALOME_PYQT_ModuleLight::onGUIEvent() \param title popup menu title (not used) */ void SALOME_PYQT_ModuleLight::contextMenuPopup( const QString& theContext, - QMenu* thePopupMenu, - QString& /*title*/ ) + QMenu* thePopupMenu, + QString& /*title*/ ) { FuncMsg fmsg( "SALOME_PYQT_ModuleLight::contextMenuPopup()" ); fmsg.message( QString( "context: %1" ).arg( theContext ) ); @@ -668,9 +668,9 @@ void SALOME_PYQT_ModuleLight::contextMenuPopup( const QString& theContext, { public: PopupMenuEvent( PyInterp_Interp* _py_interp, - SALOME_PYQT_ModuleLight* _obj, - const QString& _context, - QMenu* _popup ) + SALOME_PYQT_ModuleLight* _obj, + const QString& _context, + QMenu* _popup ) : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true) myContext( _context ), myPopup ( _popup ), @@ -708,7 +708,7 @@ void SALOME_PYQT_ModuleLight::createPreferences() { public: Event( PyInterp_Interp* _py_interp, - SALOME_PYQT_ModuleLight* _obj ) + SALOME_PYQT_ModuleLight* _obj ) : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true) myObj ( _obj ) {} @@ -793,9 +793,9 @@ void SALOME_PYQT_ModuleLight::preferencesChanged( const QString& section, const { public: Event( PyInterp_Interp* _py_interp, - SALOME_PYQT_ModuleLight* _obj, - const QString& _section, - const QString& _setting ) + SALOME_PYQT_ModuleLight* _obj, + const QString& _section, + const QString& _setting ) : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true) myObj ( _obj ), mySection( _section ), @@ -891,14 +891,14 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app ) PyObject* value; Py_ssize_t pos = 0; while ( PyDict_Next( res1, &pos, &key, &value ) ) { - // parse the return value - // it should be a map: {integer:integer} - int aKey, aValue; - if( key && PyInt_Check( key ) && value && PyInt_Check( value ) ) { - aKey = PyInt_AsLong( key ); - aValue = PyInt_AsLong( value ); - myWindowsMap[ aKey ] = aValue; - } + // parse the return value + // it should be a map: {integer:integer} + int aKey, aValue; + if( key && PyInt_Check( key ) && value && PyInt_Check( value ) ) { + aKey = PyInt_AsLong( key ); + aValue = PyInt_AsLong( value ); + myWindowsMap[ aKey ] = aValue; + } } } } @@ -921,10 +921,10 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app ) else if ( PyList_Check( res2 ) ) { int size = PyList_Size( res2 ); for ( int i = 0; i < size; i++ ) { - PyObject* value = PyList_GetItem( res2, i ); - if( value && PyString_Check( value ) ) { - myViewMgrList.append( PyString_AsString( value ) ); - } + PyObject* value = PyList_GetItem( res2, i ); + if( value && PyString_Check( value ) ) { + myViewMgrList.append( PyString_AsString( value ) ); + } } } } @@ -987,7 +987,7 @@ void SALOME_PYQT_ModuleLight::activate( SUIT_Study* theStudy ) if ( aDesk ) { connect( aDesk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ), - this, SLOT( onActiveViewChanged( SUIT_ViewWindow* ) ) ); + this, SLOT( onActiveViewChanged( SUIT_ViewWindow* ) ) ); // If a active window exists send activeViewChanged // If a getActiveView() in SalomePyQt available we no longer need this SUIT_ViewWindow* aView = aDesk->activeWindow(); @@ -1161,11 +1161,11 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the // call definePopup() Python module's function // this is obsolete function, used only for compatibility reasons PyObjWrapper res( PyObject_CallMethod( myModule, - (char*)"definePopup", - (char*)"sss", - theContext.toLatin1().constData(), - aObject.toLatin1().constData(), - aParent.toLatin1().constData() ) ); + (char*)"definePopup", + (char*)"sss", + theContext.toLatin1().constData(), + aObject.toLatin1().constData(), + aParent.toLatin1().constData() ) ); if( !res ) { PyErr_Print(); } @@ -1174,8 +1174,8 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the char *co, *ob, *pa; if( PyArg_ParseTuple( res, "sss", &co, &ob, &pa ) ) { aContext = co; - aObject = ob; - aParent = pa; + aObject = ob; + aParent = pa; } } } // if ( IsCallOldMethods ... ) @@ -1194,10 +1194,10 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the // then call Python module's createPopupMenu() method (for new modules) if ( PyObject_HasAttrString( myModule, "createPopupMenu" ) ) { PyObjWrapper res1( PyObject_CallMethod( myModule, - (char*)"createPopupMenu", - (char*)"Os", - sipPopup.get(), - theContext.toLatin1().constData() ) ); + (char*)"createPopupMenu", + (char*)"Os", + sipPopup.get(), + theContext.toLatin1().constData() ) ); if( !res1 ) { PyErr_Print(); } @@ -1207,12 +1207,12 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the // call customPopup() Python module's function // this is obsolete function, used only for compatibility reasons PyObjWrapper res2( PyObject_CallMethod( myModule, - (char*)"customPopup", - (char*)"Osss", - sipPopup.get(), - aContext.toLatin1().constData(), - aObject.toLatin1().constData(), - aParent.toLatin1().constData() ) ); + (char*)"customPopup", + (char*)"Osss", + sipPopup.get(), + aContext.toLatin1().constData(), + aObject.toLatin1().constData(), + aParent.toLatin1().constData() ) ); if( !res2 ) { PyErr_Print(); } @@ -1436,10 +1436,10 @@ void SALOME_PYQT_ModuleLight::prefChanged( const QString& section, const QString if ( PyObject_HasAttrString( myModule, "preferenceChanged" ) ) { PyObjWrapper res( PyObject_CallMethod( myModule, - (char*)"preferenceChanged", - (char*)"ss", - section.toLatin1().constData(), - setting.toLatin1().constData() ) ); + (char*)"preferenceChanged", + (char*)"ss", + section.toLatin1().constData(), + setting.toLatin1().constData() ) ); if( !res ) { PyErr_Print(); } @@ -1649,8 +1649,8 @@ int SALOME_PYQT_ModuleLight::actionId( const QAction* a ) const \return created action */ QAction* SALOME_PYQT_ModuleLight::createAction( const int id, const QString& text, const QString& icon, - const QString& menu, const QString& tip, const int key, - const bool toggle, QObject* parent ) + const QString& menu, const QString& tip, const int key, + const bool toggle, QObject* parent ) { QIcon anIcon = loadIcon( icon ); QAction* a = action( id ); @@ -1666,15 +1666,15 @@ QAction* SALOME_PYQT_ModuleLight::createAction( const int id, const QString& tex } else { a = LightApp_Module::createAction( id, - text, - anIcon, - menu, - tip, - key, - parent ? parent : this, - toggle, - this, - SLOT( onGUIEvent() ) ); + text, + anIcon, + menu, + tip, + key, + parent ? parent : this, + toggle, + this, + SLOT( onGUIEvent() ) ); } return a; } @@ -1745,7 +1745,7 @@ int SALOME_PYQT_ModuleLight::addPreference( const QString& label ) { return LightApp_Module::addPreference( label ); } - + /*! \brief Add preference. \param label preference name @@ -1756,9 +1756,9 @@ int SALOME_PYQT_ModuleLight::addPreference( const QString& label ) \return preference ID */ int SALOME_PYQT_ModuleLight::addPreference( const QString& label, - const int pId, const int type, - const QString& section, - const QString& param ) + const int pId, const int type, + const QString& section, + const QString& param ) { return LightApp_Module::addPreference( label, pId, type, section, param ); } @@ -1770,7 +1770,7 @@ int SALOME_PYQT_ModuleLight::addPreference( const QString& label, \return property value (invalid QVariant() if property is not found) */ QVariant SALOME_PYQT_ModuleLight::preferenceProperty( const int id, - const QString& prop ) const + const QString& prop ) const { QVariant v = LightApp_Module::preferenceProperty( id, prop ); return v; @@ -1783,8 +1783,8 @@ QVariant SALOME_PYQT_ModuleLight::preferenceProperty( const int id, \param var property value */ void SALOME_PYQT_ModuleLight::setPreferenceProperty( const int id, - const QString& prop, - const QVariant& var ) + const QString& prop, + const QVariant& var ) { LightApp_Module::setPreferenceProperty( id, prop, var ); } @@ -2044,7 +2044,7 @@ static int checkInt( const QString& value, const int def = -1, const int shift = \param fileName XML file path */ SALOME_PYQT_ModuleLight::XmlHandler::XmlHandler( SALOME_PYQT_ModuleLight* module, - const QString& fileName ) + const QString& fileName ) : myModule( module ) { if ( fileName.isEmpty() ) @@ -2092,9 +2092,9 @@ void SALOME_PYQT_ModuleLight::XmlHandler::createActions() \param context popup menu object name */ void SALOME_PYQT_ModuleLight::XmlHandler::createPopup( QMenu* menu, - const QString& context, - const QString& parent, - const QString& object ) + const QString& context, + const QString& parent, + const QString& object ) { // get document element QDomElement aDocElem = myDoc.documentElement(); @@ -2110,8 +2110,8 @@ void SALOME_PYQT_ModuleLight::XmlHandler::createPopup( QMenu* menu, QString prt = attribute( e, "parent-id" ); QString obj = attribute( e, "object-id" ); if ( ctx == context && prt == parent && obj == object ) { - insertPopupItems( n, menu ); - break; + insertPopupItems( n, menu ); + break; } } } @@ -2140,8 +2140,8 @@ void SALOME_PYQT_ModuleLight::XmlHandler::activateMenus( bool enable ) \param parentPopup parent popup menu (0 for top-level menu) */ void SALOME_PYQT_ModuleLight::XmlHandler::createMenu( QDomNode& parentNode, - const int parentMenuId, - QMenu* parentPopup ) + const int parentMenuId, + QMenu* parentPopup ) { if ( !myModule || parentNode.isNull() ) return; @@ -2152,70 +2152,70 @@ void SALOME_PYQT_ModuleLight::XmlHandler::createMenu( QDomNode& parentNode, int pid = checkInt( attribute( parentElement, "item-id" ) ); int ppos = checkInt( attribute( parentElement, "pos-id" ) ); int group = checkInt( attribute( parentElement, "group-id" ), - myModule->defaultMenuGroup() ); + myModule->defaultMenuGroup() ); if ( !plabel.isEmpty() ) { QMenu* popup = 0; int menuId = -1; // create menu menuId = myModule->createMenu( plabel, // label - parentMenuId, // parent menu ID, -1 for top-level menu - pid, // ID - group, // group ID - ppos ); // position + parentMenuId, // parent menu ID, -1 for top-level menu + pid, // ID + group, // group ID + ppos ); // position myMenuItems.append( menuId ); QDomNode node = parentNode.firstChild(); while ( !node.isNull() ) { - if ( node.isElement() ) { - QDomElement elem = node.toElement(); - QString aTagName = tagName( elem ); - if ( aTagName == "popup-item" ) { - int id = checkInt( attribute( elem, "item-id" ) ); - int pos = checkInt( attribute( elem, "pos-id" ) ); - int group = checkInt( attribute( elem, "group-id" ), - myModule->defaultMenuGroup() ); - QString label = attribute( elem, "label-id" ); - QString icon = attribute( elem, "icon-id" ); - QString tooltip = attribute( elem, "tooltip-id" ); - QString accel = attribute( elem, "accel-id" ); - bool toggle = checkBool( attribute( elem, "toggle-id" ) ); - - // -1 action ID is not allowed : it means that attribute is missed in the XML file! - // also check if the action with given ID is already created - if ( id != -1 ) { - // create menu action - QAction* action = myModule->createAction( id, // ID - tooltip, // tooltip - icon, // icon - label, // menu text - tooltip, // status-bar text - QKeySequence( accel ), // keyboard accelerator - toggle ); // toogled action - myModule->createMenu( action, // action - menuId, // parent menu ID - id, // ID (same as for createAction()) - group, // group ID - pos ); // position - } - } - else if ( aTagName == "submenu" ) { - // create sub-menu - createMenu( node, menuId, popup ); - } - else if ( aTagName == "separator" ) { - // create menu separator - int id = checkInt( attribute( elem, "item-id" ) ); // separator can have ID - int pos = checkInt( attribute( elem, "pos-id" ) ); - int group = checkInt( attribute( elem, "group-id" ), - myModule->defaultMenuGroup() ); - QAction* action = myModule->separator(); - myModule->createMenu( action, // separator action - menuId, // parent menu ID - id, // ID - group, // group ID - pos ); // position - } - } - node = node.nextSibling(); + if ( node.isElement() ) { + QDomElement elem = node.toElement(); + QString aTagName = tagName( elem ); + if ( aTagName == "popup-item" ) { + int id = checkInt( attribute( elem, "item-id" ) ); + int pos = checkInt( attribute( elem, "pos-id" ) ); + int group = checkInt( attribute( elem, "group-id" ), + myModule->defaultMenuGroup() ); + QString label = attribute( elem, "label-id" ); + QString icon = attribute( elem, "icon-id" ); + QString tooltip = attribute( elem, "tooltip-id" ); + QString accel = attribute( elem, "accel-id" ); + bool toggle = checkBool( attribute( elem, "toggle-id" ) ); + + // -1 action ID is not allowed : it means that attribute is missed in the XML file! + // also check if the action with given ID is already created + if ( id != -1 ) { + // create menu action + QAction* action = myModule->createAction( id, // ID + tooltip, // tooltip + icon, // icon + label, // menu text + tooltip, // status-bar text + QKeySequence( accel ), // keyboard accelerator + toggle ); // toogled action + myModule->createMenu( action, // action + menuId, // parent menu ID + id, // ID (same as for createAction()) + group, // group ID + pos ); // position + } + } + else if ( aTagName == "submenu" ) { + // create sub-menu + createMenu( node, menuId, popup ); + } + else if ( aTagName == "separator" ) { + // create menu separator + int id = checkInt( attribute( elem, "item-id" ) ); // separator can have ID + int pos = checkInt( attribute( elem, "pos-id" ) ); + int group = checkInt( attribute( elem, "group-id" ), + myModule->defaultMenuGroup() ); + QAction* action = myModule->separator(); + myModule->createMenu( action, // separator action + menuId, // parent menu ID + id, // ID + group, // group ID + pos ); // position + } + } + node = node.nextSibling(); } } } @@ -2238,40 +2238,40 @@ void SALOME_PYQT_ModuleLight::XmlHandler::createToolBar( QDomNode& parentNode ) int tbId = myModule->createTool( aLabel ); QDomNode node = parentNode.firstChild(); while ( !node.isNull() ) { - if ( node.isElement() ) { - QDomElement elem = node.toElement(); - QString aTagName = tagName( elem ); - if ( aTagName == "toolbutton-item" ) { - int id = checkInt( attribute( elem, "item-id" ) ); - int pos = checkInt( attribute( elem, "pos-id" ) ); - QString label = attribute( elem, "label-id" ); - QString icon = attribute( elem, "icon-id" ); - QString tooltip = attribute( elem, "tooltip-id" ); - QString accel = attribute( elem, "accel-id" ); - bool toggle = checkBool( attribute( elem, "toggle-id" ) ); - - // -1 action ID is not allowed : it means that attribute is missed in the XML file! - // also check if the action with given ID is already created + if ( node.isElement() ) { + QDomElement elem = node.toElement(); + QString aTagName = tagName( elem ); + if ( aTagName == "toolbutton-item" ) { + int id = checkInt( attribute( elem, "item-id" ) ); + int pos = checkInt( attribute( elem, "pos-id" ) ); + QString label = attribute( elem, "label-id" ); + QString icon = attribute( elem, "icon-id" ); + QString tooltip = attribute( elem, "tooltip-id" ); + QString accel = attribute( elem, "accel-id" ); + bool toggle = checkBool( attribute( elem, "toggle-id" ) ); + + // -1 action ID is not allowed : it means that attribute is missed in the XML file! + // also check if the action with given ID is already created if ( id != -1 ) { - // create toolbar action - QAction* action = myModule->createAction( id, // ID - tooltip, // tooltip - icon, // icon - label, // menu text - tooltip, // status-bar text - QKeySequence( accel ), // keyboard accelerator - toggle ); // toogled action - myModule->createTool( action, tbId, -1, pos ); - } - } - else if ( aTagName == "separatorTB" || aTagName == "separator" ) { - // create toolbar separator - int pos = checkInt( attribute( elem, "pos-id" ) ); - QAction* action = myModule->separator(); - myModule->createTool( action, tbId, -1, pos ); - } - } - node = node.nextSibling(); + // create toolbar action + QAction* action = myModule->createAction( id, // ID + tooltip, // tooltip + icon, // icon + label, // menu text + tooltip, // status-bar text + QKeySequence( accel ), // keyboard accelerator + toggle ); // toogled action + myModule->createTool( action, tbId, -1, pos ); + } + } + else if ( aTagName == "separatorTB" || aTagName == "separator" ) { + // create toolbar separator + int pos = checkInt( attribute( elem, "pos-id" ) ); + QAction* action = myModule->separator(); + myModule->createTool( action, tbId, -1, pos ); + } + } + node = node.nextSibling(); } } } @@ -2295,54 +2295,54 @@ void SALOME_PYQT_ModuleLight::XmlHandler::insertPopupItems( QDomNode& parentNode QString aTagName = tagName( elem ); QList actions = menu->actions(); if ( aTagName == "popup-item" ) { - // insert a command item - int id = checkInt( attribute( elem, "item-id" ) ); - int pos = checkInt( attribute( elem, "pos-id" ) ); - QString label = attribute( elem, "label-id" ); - QString icon = attribute( elem, "icon-id" ); - QString tooltip = attribute( elem, "tooltip-id" ); - QString accel = attribute( elem, "accel-id" ); - bool toggle = checkBool( attribute( elem, "toggle-id" ) ); - - // -1 action ID is not allowed : it means that attribute is missed in the XML file! - // also check if the action with given ID is already created - if ( id != -1 ) { - QAction* action = myModule->createAction( id, // ID - tooltip, // tooltip - icon, // icon - label, // menu text - tooltip, // status-bar text - QKeySequence( accel ), // keyboard accelerator - toggle ); // toogled action - QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0; - menu->insertAction( before, action ); - } + // insert a command item + int id = checkInt( attribute( elem, "item-id" ) ); + int pos = checkInt( attribute( elem, "pos-id" ) ); + QString label = attribute( elem, "label-id" ); + QString icon = attribute( elem, "icon-id" ); + QString tooltip = attribute( elem, "tooltip-id" ); + QString accel = attribute( elem, "accel-id" ); + bool toggle = checkBool( attribute( elem, "toggle-id" ) ); + + // -1 action ID is not allowed : it means that attribute is missed in the XML file! + // also check if the action with given ID is already created + if ( id != -1 ) { + QAction* action = myModule->createAction( id, // ID + tooltip, // tooltip + icon, // icon + label, // menu text + tooltip, // status-bar text + QKeySequence( accel ), // keyboard accelerator + toggle ); // toogled action + QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0; + menu->insertAction( before, action ); + } } else if ( aTagName == "submenu" ) { - // create sub-menu - ////int id = checkInt( attribute( elem, "item-id" ) ); // not used // - int pos = checkInt( attribute( elem, "pos-id" ) ); - QString label = attribute( elem, "label-id" ); - QString icon = attribute( elem, "icon-id" ); - - QIcon anIcon; - if ( !icon.isEmpty() ) { - QPixmap pixmap = myModule->getApp()->resourceMgr()->loadPixmap( myModule->name(), icon ); - if ( !pixmap.isNull() ) - anIcon = QIcon( pixmap ); + // create sub-menu + ////int id = checkInt( attribute( elem, "item-id" ) ); // not used // + int pos = checkInt( attribute( elem, "pos-id" ) ); + QString label = attribute( elem, "label-id" ); + QString icon = attribute( elem, "icon-id" ); + + QIcon anIcon; + if ( !icon.isEmpty() ) { + QPixmap pixmap = myModule->getApp()->resourceMgr()->loadPixmap( myModule->name(), icon ); + if ( !pixmap.isNull() ) + anIcon = QIcon( pixmap ); } - QMenu* newPopup = menu->addMenu( anIcon, label ); - QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0; - menu->insertMenu( before, newPopup ); - insertPopupItems( node, newPopup ); + QMenu* newPopup = menu->addMenu( anIcon, label ); + QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0; + menu->insertMenu( before, newPopup ); + insertPopupItems( node, newPopup ); } else if ( aTagName == "separator" ) { - // create menu separator - int pos = checkInt( attribute( elem, "pos-id" ) ); - QAction* action = myModule->separator(); - QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0; - menu->insertAction( before, action ); + // create menu separator + int pos = checkInt( attribute( elem, "pos-id" ) ); + QAction* action = myModule->separator(); + QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0; + menu->insertAction( before, action ); } } node = node.nextSibling(); @@ -2393,7 +2393,7 @@ void SALOME_PYQT_ModuleLight::saveEvent(QStringList& theListOfFiles) if ( PyObject_HasAttrString(myModule, "saveFiles") ) { PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"saveFiles", - (char*)"s", (*it).toLatin1().constData())); + (char*)"s", (*it).toLatin1().constData())); if( !res ) { PyErr_Print(); } @@ -2409,10 +2409,10 @@ void SALOME_PYQT_ModuleLight::saveEvent(QStringList& theListOfFiles) else if ( PyList_Check( res ) ) { int size = PyList_Size( res ); for ( int i = 0; i < size; i++ ) { - PyObject* value = PyList_GetItem( res, i ); - if( value && PyString_Check( value ) ) { - theListOfFiles.append( PyString_AsString( value ) ); - } + PyObject* value = PyList_GetItem( res, i ); + if( value && PyString_Check( value ) ) { + theListOfFiles.append( PyString_AsString( value ) ); + } } } } @@ -2475,7 +2475,7 @@ void SALOME_PYQT_ModuleLight::openEvent(QStringList theListOfFiles, bool &opened #endif if ( PyObject_HasAttrString(myModule , "openFiles") ) { PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"openFiles", - (char*)"O", sipList.get())); + (char*)"O", sipList.get())); if( !res || !PyBool_Check( res )) { PyErr_Print(); opened = false; diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h index 44c4a71e2..6326e1df8 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h @@ -88,30 +88,30 @@ public: int createTool( const int, const int, const int = -1 ); int createTool( const int, const QString&, const int = -1 ); int createTool( QAction*, const int, - const int = -1, const int = -1 ); + const int = -1, const int = -1 ); int createTool( QAction*, const QString&, - const int = -1, const int = -1 ); + const int = -1, const int = -1 ); int createMenu( const QString&, const int, - const int = -1, const int = -1, const int = -1 ); + const int = -1, const int = -1, const int = -1 ); int createMenu( const QString&, const QString&, - const int = -1, const int = -1, const int = -1 ); + const int = -1, const int = -1, const int = -1 ); int createMenu( const int, const int, - const int = -1, const int = -1 ); + const int = -1, const int = -1 ); int createMenu( const int, const QString&, - const int = -1, const int = -1 ); + const int = -1, const int = -1 ); int createMenu( QAction*, const int, - const int = -1, const int = -1, const int = -1 ); + const int = -1, const int = -1, const int = -1 ); int createMenu( QAction*, const QString&, - const int = -1, const int = -1, const int = -1 ); + const int = -1, const int = -1, const int = -1 ); QAction* separator(); QAction* action( const int ) const; int actionId( const QAction* ) const; QAction* createAction( const int, const QString&, const QString&, - const QString&, const QString&, const int, - const bool = false, QObject* = 0 ); + const QString&, const QString&, const int, + const bool = false, QObject* = 0 ); QtxActionGroup* createActionGroup( const int, const bool ); @@ -120,11 +120,11 @@ public: int addGlobalPreference( const QString& ); int addPreference( const QString& ); int addPreference( const QString&, const int, const int = LightApp_Preferences::Auto, - const QString& = QString(), - const QString& = QString() ); + const QString& = QString(), + const QString& = QString() ); QVariant preferenceProperty( const int, const QString& ) const; void setPreferenceProperty( const int, const QString&, - const QVariant& ); + const QVariant& ); void save(QStringList& theListOfFiles); @@ -133,9 +133,9 @@ public: /*create new SALOME_PYQT_DataObjectLight and return its entry*/ QString createObject(const QString& parent); QString createObject(const QString& name, - const QString& iconname, - const QString& tooltip, - const QString& parent); + const QString& iconname, + const QString& tooltip, + const QString& parent); /*Sets Name, Icon and Tool Tip for object*/ void setName(const QString& obj,const QString& iconname); void setIcon(const QString& obj,const QString& name); @@ -156,8 +156,8 @@ public slots: virtual bool activateModule( SUIT_Study* ); virtual bool deactivateModule( SUIT_Study* ); void preferenceChanged( const QString&, - const QString&, - const QString& ); + const QString&, + const QString& ); void onGUIEvent(); void onActiveViewChanged( SUIT_ViewWindow* ); diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index b6f0b19ca..b7efe52de 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -510,15 +510,15 @@ void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection ) if ( SUIT_Session::session() ) { if ( getActiveStudy() && myStudyId <= 0 ) myStudyId = getActiveStudy()->id(); - if ( myStudyId > 0 ) { + if ( myStudyId > 0 ) { QList apps = SUIT_Session::session()->applications(); QList::Iterator it; - for( it = apps.begin(); it != apps.end(); ++it ) { + for( it = apps.begin(); it != apps.end(); ++it ) { LightApp_Application* anApp = dynamic_cast( *it ); if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId ) { - anApp->updateObjectBrowser(); - return; - } + anApp->updateObjectBrowser(); + return; + } } } } @@ -560,10 +560,10 @@ void SalomePyQt::addStringSetting( const QString& name, const QString& value, bo virtual void Execute() { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - QStringList sl = myName.split( ":", QString::SkipEmptyParts ); - QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); - QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); - if ( !_sec.isEmpty() && !_nam.isEmpty() ) + QStringList sl = myName.split( ":", QString::SkipEmptyParts ); + QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); + QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); + if ( !_sec.isEmpty() && !_nam.isEmpty() ) resMgr->setValue( _sec, _nam, myValue ); } } @@ -599,10 +599,10 @@ void SalomePyQt::addIntSetting( const QString& name, const int value, bool autoV { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - QStringList sl = myName.split( ":", QString::SkipEmptyParts ); - QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); - QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); - if ( !_sec.isEmpty() && !_nam.isEmpty() ) + QStringList sl = myName.split( ":", QString::SkipEmptyParts ); + QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); + QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); + if ( !_sec.isEmpty() && !_nam.isEmpty() ) resMgr->setValue( _sec, _nam, myValue ); } } @@ -638,10 +638,10 @@ void SalomePyQt::addDoubleSetting( const QString& name, const double value, bool { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - QStringList sl = myName.split( ":", QString::SkipEmptyParts ); - QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); - QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); - if ( !_sec.isEmpty() && !_nam.isEmpty() ) + QStringList sl = myName.split( ":", QString::SkipEmptyParts ); + QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); + QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); + if ( !_sec.isEmpty() && !_nam.isEmpty() ) resMgr->setValue( _sec, _nam, myValue ); } } @@ -677,10 +677,10 @@ void SalomePyQt::addBoolSetting( const QString& name, const bool value, bool aut { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - QStringList sl = myName.split( ":", QString::SkipEmptyParts ); - QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); - QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); - if ( !_sec.isEmpty() && !_nam.isEmpty() ) + QStringList sl = myName.split( ":", QString::SkipEmptyParts ); + QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); + QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); + if ( !_sec.isEmpty() && !_nam.isEmpty() ) resMgr->setValue( _sec, _nam, myValue ); } } @@ -705,10 +705,10 @@ void SalomePyQt::removeSettings( const QString& name ) virtual void Execute() { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - QStringList sl = myName.split( ":", QString::SkipEmptyParts ); - QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); - QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); - if ( !_sec.isEmpty() && !_nam.isEmpty() ) + QStringList sl = myName.split( ":", QString::SkipEmptyParts ); + QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION ); + QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" ); + if ( !_sec.isEmpty() && !_nam.isEmpty() ) resMgr->remove( _sec, _nam ); } } @@ -771,7 +771,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - if ( !mySection.isEmpty() && !myName.isEmpty() ) + if ( !mySection.isEmpty() && !myName.isEmpty() ) resMgr->setValue( mySection, myName, myValue ); } } @@ -799,7 +799,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - if ( !mySection.isEmpty() && !myName.isEmpty() ) + if ( !mySection.isEmpty() && !myName.isEmpty() ) resMgr->setValue( mySection, myName, myValue ); } } @@ -829,7 +829,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - if ( !mySection.isEmpty() && !myName.isEmpty() ) + if ( !mySection.isEmpty() && !myName.isEmpty() ) resMgr->setValue( mySection, myName, myValue ); } } @@ -857,7 +857,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - if ( !mySection.isEmpty() && !myName.isEmpty() ) + if ( !mySection.isEmpty() && !myName.isEmpty() ) resMgr->setValue( mySection, myName, myValue ); } } @@ -885,7 +885,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - if ( !mySection.isEmpty() && !myName.isEmpty() ) + if ( !mySection.isEmpty() && !myName.isEmpty() ) resMgr->setValue( mySection, myName, myValue ); } } @@ -896,7 +896,7 @@ void SalomePyQt::addSetting( const QString& section, const QString& name, const /*! \fn int SalomePyQt::integerSetting( const QString& section, const QString& name, - const int def ); + const int def ); \brief Get integer setting from the application preferences. \param section resources file section name \param name setting name @@ -930,7 +930,7 @@ int SalomePyQt::integerSetting( const QString& section, const QString& name, con /*! \fn double SalomePyQt::doubleSetting( const QString& section, const QString& name, - const double def ); + const double def ); \brief Get double setting from the application preferences. \param section resources file section name \param name setting name @@ -964,7 +964,7 @@ double SalomePyQt::doubleSetting( const QString& section, const QString& name, c /*! \fn bool SalomePyQt::boolSetting( const QString& section, const QString& name, - const bool def ); + const bool def ); \brief Get boolean setting from the application preferences. \param section resources file section name \param name setting name @@ -998,7 +998,7 @@ bool SalomePyQt::boolSetting( const QString& section, const QString& name, const /*! \fn QString SalomePyQt::stringSetting( const QString& section, const QString& name, - const QString& def ); + const QString& def ); \brief Get string setting from the application preferences. \param section resources file section name \param name setting name @@ -1032,7 +1032,7 @@ QString SalomePyQt::stringSetting( const QString& section, const QString& name, /*! \fn QColor SalomePyQt::colorSetting( const QString& section, const QString& name, - const QColor def ); + const QColor def ); \brief Get color setting from the application preferences. \param section resources file section name \param name setting name @@ -1080,7 +1080,7 @@ void SalomePyQt::removeSetting( const QString& section, const QString& name ) { if ( SUIT_Session::session() ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - if ( !mySection.isEmpty() && !myName.isEmpty() ) + if ( !mySection.isEmpty() && !myName.isEmpty() ) resMgr->remove( mySection, myName ); } } @@ -1120,10 +1120,10 @@ bool SalomePyQt::hasSetting( const QString& section, const QString& name ) /*! \fn QString SalomePyQt::getFileName( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption, - bool open ); + const QString& initial, + const QStringList& filters, + const QString& caption, + bool open ); \brief Show 'Open/Save file' dialog box for file selection and return a user's choice (selected file name). \param parent parent widget @@ -1146,10 +1146,10 @@ public: QString myCaption; bool myOpen; TGetFileNameEvent( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption, - bool open ) + const QString& initial, + const QStringList& filters, + const QString& caption, + bool open ) : myParent ( parent ), myInitial( initial ), myFilters( filters ), @@ -1159,24 +1159,24 @@ public: { if ( LightApp_Application* anApp = getApplication() ) { myResult = anApp->getFileName( myOpen, myInitial, myFilters.join(";;"), - myCaption, myParent ); + myCaption, myParent ); } } }; QString SalomePyQt::getFileName( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption, - bool open ) + const QString& initial, + const QStringList& filters, + const QString& caption, + bool open ) { return ProcessEvent( new TGetFileNameEvent( parent, initial, filters, caption, open ) ); } /*! \fn QStringList SalomePyQt::getOpenFileNames( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption ); + const QString& initial, + const QStringList& filters, + const QString& caption ); \brief Show 'Open files' dialog box for multiple files selection and return a user's choice (selected file names list). \param parent parent widget @@ -1196,9 +1196,9 @@ public: QStringList myFilters; QString myCaption; TGetOpenFileNamesEvent( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption ) + const QString& initial, + const QStringList& filters, + const QString& caption ) : myParent ( parent ), myInitial( initial ), myFilters( filters ), @@ -1211,17 +1211,17 @@ public: } }; QStringList SalomePyQt::getOpenFileNames( QWidget* parent, - const QString& initial, - const QStringList& filters, - const QString& caption ) + const QString& initial, + const QStringList& filters, + const QString& caption ) { return ProcessEvent( new TGetOpenFileNamesEvent( parent, initial, filters, caption ) ); } /*! \fn QString SalomePyQt::getExistingDirectory( QWidget* parent, - const QString& initial, - const QString& caption ); + const QString& initial, + const QString& caption ); \brief Show 'Get Directory' dialog box for the directory selection and return a user's choice (selected directory name). \param parent parent widget @@ -1239,8 +1239,8 @@ public: QString myInitial; QString myCaption; TGetExistingDirectoryEvent( QWidget* parent, - const QString& initial, - const QString& caption ) + const QString& initial, + const QString& caption ) : myParent ( parent ), myInitial( initial ), myCaption( caption ) {} @@ -1252,8 +1252,8 @@ public: } }; QString SalomePyQt::getExistingDirectory( QWidget* parent, - const QString& initial, - const QString& caption ) + const QString& initial, + const QString& caption ) { return ProcessEvent( new TGetExistingDirectoryEvent( parent, initial, caption ) ); } @@ -1278,11 +1278,11 @@ public: { if ( LightApp_Application* anApp = getApplication() ) { if ( !myFileName.isEmpty() ) { - QPixmap pixmap = anApp->resourceMgr()->loadPixmap( myModule, + QPixmap pixmap = anApp->resourceMgr()->loadPixmap( myModule, QApplication::translate( myModule.toLatin1().data(), - myFileName.toLatin1().data() ) ); - if ( !pixmap.isNull() ) - myResult = QIcon( pixmap ); + myFileName.toLatin1().data() ) ); + if ( !pixmap.isNull() ) + myResult = QIcon( pixmap ); } } } @@ -1347,15 +1347,15 @@ public: SUIT_ViewManager* vm = anApp->activeViewManager(); if ( vm ) { SUIT_ViewWindow* vw = vm->getActiveView(); - if ( vw ) { + if ( vw ) { QImage im = vw->dumpView(); - if ( !im.isNull() && !myFileName.isEmpty() ) { + if ( !im.isNull() && !myFileName.isEmpty() ) { QString fmt = SUIT_Tools::extension( myFileName ).toUpper(); - if ( fmt.isEmpty() ) fmt = QString( "BMP" ); // default format - if ( fmt == "JPG" ) fmt = "JPEG"; - myResult = im.save( myFileName, fmt.toLatin1() ); + if ( fmt.isEmpty() ) fmt = QString( "BMP" ); // default format + if ( fmt == "JPG" ) fmt = "JPEG"; + myResult = im.save( myFileName, fmt.toLatin1() ); } - } + } } } } @@ -1676,11 +1676,11 @@ QAction* SalomePyQt::createSeparator() /*! \fn QAction* SalomePyQt::createAction( const int id, const QString& menuText, - const QString& tipText, - const QString& statusText, - const QString& icon, - const int key, - const bool toggle ) + const QString& tipText, + const QString& statusText, + const QString& icon, + const int key, + const bool toggle ) \brief Create an action which can be then used in the menu or toolbar. \param id the unique id action to be registered to \param menuText action text which should appear in menu @@ -1704,7 +1704,7 @@ public: int myKey; bool myToggle; TCreateActionEvent( const int id, const QString& menuText, const QString& tipText, - const QString& statusText, const QString& icon, const int key, const bool toggle ) + const QString& statusText, const QString& icon, const int key, const bool toggle ) : myResult( 0 ), myId( id ), myMenuText( menuText ), myTipText( tipText ), myStatusText( statusText ), myIcon( icon ), myKey( key ), myToggle( toggle ) {} virtual void Execute() @@ -1715,8 +1715,8 @@ public: } }; QAction* SalomePyQt::createAction( const int id, const QString& menuText, - const QString& tipText, const QString& statusText, - const QString& icon, const int key, const bool toggle ) + const QString& tipText, const QString& statusText, + const QString& icon, const int key, const bool toggle ) { return ProcessEvent( new TCreateActionEvent( id, menuText, tipText, statusText, icon, key, toggle ) ); } @@ -1855,7 +1855,7 @@ int SalomePyQt::addPreference( const QString& label ) /*! \fn int SalomePyQt::addPreference( const QString& label, const int pId, const int type, - const QString& section, const QString& param ); + const QString& section, const QString& param ); \brief Add module-related preferences. \param label preferences group name \param pId parent preferences group id @@ -1876,9 +1876,9 @@ public: QString mySection; QString myParam; TAddPrefParamEvent( const QString& label, - const int pId, const int type, - const QString& section, - const QString& param ) + const int pId, const int type, + const QString& section, + const QString& param ) : myResult( -1 ), myLabel( label ), myPId( pId ), myType( type ), mySection( section ), myParam ( param ) {} @@ -1890,7 +1890,7 @@ public: } }; int SalomePyQt::addPreference( const QString& label, const int pId, const int type, - const QString& section, const QString& param ) + const QString& section, const QString& param ) { return ProcessEvent( new TAddPrefParamEvent( label, pId, type, section, param ) ); } @@ -1931,8 +1931,8 @@ QVariant SalomePyQt::preferenceProperty( const int id, const QString& prop ) \param var preferences property value */ void SalomePyQt::setPreferenceProperty( const int id, - const QString& prop, - const QVariant& var ) + const QString& prop, + const QVariant& var ) { class TEvent: public SALOME_Event { @@ -1946,7 +1946,7 @@ void SalomePyQt::setPreferenceProperty( const int id, { SALOME_PYQT_ModuleLight* module = getActiveModule(); if ( module ) - module->setPreferenceProperty( myId, myProp, myVar ); + module->setPreferenceProperty( myId, myProp, myVar ); } }; ProcessVoidEvent( new TEvent( id, prop, var) ); @@ -1964,9 +1964,9 @@ void SalomePyQt::setPreferenceProperty( const int id, \param var preferences property value for the index \a idx */ void SalomePyQt::addPreferenceProperty( const int id, - const QString& prop, - const int idx, - const QVariant& var ) + const QString& prop, + const int idx, + const QVariant& var ) { class TEvent: public SALOME_Event { @@ -1981,30 +1981,30 @@ void SalomePyQt::addPreferenceProperty( const int id, { SALOME_PYQT_ModuleLight* module = getActiveModule(); if ( module ) { - QVariant var = module->preferenceProperty( myId, myProp ); - if ( var.isValid() ) { - if ( var.type() == QVariant::StringList ) { - QStringList sl = var.toStringList(); - if ( myIdx >= 0 && myIdx < sl.count() ) - sl[myIdx] = myVar.toString(); - else - sl.append( myVar.toString() ); - module->setPreferenceProperty( myId, myProp, sl ); - } - else if ( var.type() == QVariant::List ) { - QList vl = var.toList(); - if ( myIdx >= 0 && myIdx < vl.count() ) - vl[myIdx] = myVar; - else - vl.append( myVar ); - module->setPreferenceProperty( myId, myProp, vl ); - } - } - else { - QList vl; - vl.append( myVar ); - module->setPreferenceProperty( myId, myProp, vl ); - } + QVariant var = module->preferenceProperty( myId, myProp ); + if ( var.isValid() ) { + if ( var.type() == QVariant::StringList ) { + QStringList sl = var.toStringList(); + if ( myIdx >= 0 && myIdx < sl.count() ) + sl[myIdx] = myVar.toString(); + else + sl.append( myVar.toString() ); + module->setPreferenceProperty( myId, myProp, sl ); + } + else if ( var.type() == QVariant::List ) { + QList vl = var.toList(); + if ( myIdx >= 0 && myIdx < vl.count() ) + vl[myIdx] = myVar; + else + vl.append( myVar ); + module->setPreferenceProperty( myId, myProp, vl ); + } + } + else { + QList vl; + vl.append( myVar ); + module->setPreferenceProperty( myId, myProp, vl ); + } } } }; @@ -2029,9 +2029,9 @@ void SalomePyQt::message( const QString& msg, bool addSeparator ) virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - LogWindow* lw = anApp->logWindow(); - if ( lw ) - lw->putMessage( myMsg, myAddSep ); + LogWindow* lw = anApp->logWindow(); + if ( lw ) + lw->putMessage( myMsg, myAddSep ); } } }; @@ -2050,9 +2050,9 @@ void SalomePyQt::clearMessages() virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - LogWindow* lw = anApp->logWindow(); - if ( lw ) - lw->clear(); + LogWindow* lw = anApp->logWindow(); + if ( lw ) + lw->clear(); } } }; diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h index 47a3a24d6..0818fe7cf 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.h @@ -132,9 +132,9 @@ public: static QString createObject(const QString& parent = QString("")); static QString createObject(const QString& name, - const QString& iconname, - const QString& tooltip, - const QString& parent = QString("")); + const QString& iconname, + const QString& tooltip, + const QString& parent = QString("")); static void removeObject( const QString& obj); static void removeChild( const QString& obj = QString("")); @@ -160,23 +160,23 @@ public: static int createTool( QAction*, const QString&, const int = -1, const int = -1 ); static int createMenu( const QString&, const int = -1, - const int = -1, const int = -1, const int = -1 ); + const int = -1, const int = -1, const int = -1 ); static int createMenu( const QString&, const QString& = QString(), - const int = -1, const int = -1, const int = -1 ); + const int = -1, const int = -1, const int = -1 ); static int createMenu( const int, const int = -1, - const int = -1, const int = -1 ); + const int = -1, const int = -1 ); static int createMenu( const int, const QString& = QString(), - const int = -1, const int = -1 ); + const int = -1, const int = -1 ); static int createMenu( QAction*, const int, const int = -1, - const int = -1, const int = -1 ); + const int = -1, const int = -1 ); static int createMenu( QAction*, const QString&, const int = -1, - const int = -1, const int = -1 ); + const int = -1, const int = -1 ); static QAction* createSeparator(); static QAction* createAction( const int, const QString&, - const QString& = QString(), const QString& = QString(), - const QString& = QString(), const int = 0, const bool = false ); + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const int = 0, const bool = false ); static QtxActionGroup* createActionGroup( const int, const bool = true ); @@ -208,15 +208,15 @@ public: static int addPreference( const QString&, const int, const int = PT_Auto, const QString& = QString(), - const QString& = QString() ); + const QString& = QString() ); static QVariant preferenceProperty( const int, const QString& ); static void setPreferenceProperty( const int, const QString&, const QVariant& ); static void addPreferenceProperty( const int, - const QString&, - const int, - const QVariant& ); + const QString&, + const int, + const QVariant& ); static void message( const QString&, bool = true ); static void clearMessages(); diff --git a/src/SALOME_SWIG/SALOMEGUI_Swig.cxx b/src/SALOME_SWIG/SALOMEGUI_Swig.cxx index a471eed86..4d212eeb3 100644 --- a/src/SALOME_SWIG/SALOMEGUI_Swig.cxx +++ b/src/SALOME_SWIG/SALOMEGUI_Swig.cxx @@ -169,8 +169,8 @@ void SALOMEGUI_Swig::updateObjBrowser( bool /*updateSelection*/ ) virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - anApp->updateObjectBrowser(); - anApp->updateActions(); //SRN: added in order to update the toolbar + anApp->updateObjectBrowser(); + anApp->updateActions(); //SRN: added in order to update the toolbar } } }; @@ -292,19 +292,19 @@ public: LightApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); // for sure! LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); if ( aStudy && aSelMgr ) { - SUIT_DataOwnerPtrList aList; - aSelMgr->selected( aList ); - - for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); - itr != aList.end(); ++itr ) { - const LightApp_DataOwner* owner = - dynamic_cast( (*itr).operator->() ); - if( !owner ) - continue; - QString entry = owner->entry(); - if( !myResult.contains( entry ) ) - myResult.append( entry ); - } + SUIT_DataOwnerPtrList aList; + aSelMgr->selected( aList ); + + for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); + itr != aList.end(); ++itr ) { + const LightApp_DataOwner* owner = + dynamic_cast( (*itr).operator->() ); + if( !owner ) + continue; + QString entry = owner->entry(); + if( !myResult.contains( entry ) ) + myResult.append( entry ); + } } } } @@ -335,13 +335,13 @@ void SALOMEGUI_Swig::AddIObject( const char* theEntry ) virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - LightApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); // for sure! - LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); - if ( aStudy && aSelMgr ) { - SALOME_ListIO anIOList; - anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ); - aSelMgr->setSelectedObjects( anIOList, true ); - } + LightApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); // for sure! + LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); + if ( aStudy && aSelMgr ) { + SALOME_ListIO anIOList; + anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ); + aSelMgr->setSelectedObjects( anIOList, true ); + } } } }; @@ -362,25 +362,25 @@ void SALOMEGUI_Swig::RemoveIObject( const char* theEntry ) virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - LightApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); // for sure! - LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); - if ( aStudy && aSelMgr ) { - SALOME_ListIO anIOList; - // VSR: temporary solution, until LightApp_SelectionMgr::unsetSelectedObjects() method appears - // Lately this should be replaced by the following: - // anIOList.Append( new SALOME_InteractiveObject( myEntry, "", "" ) ); - // aSelMgr->unsetSelectedObjects( anIOList ); - /////////////////////////////////////////////// - aSelMgr->selectedObjects( anIOList ); - SALOME_ListIteratorOfListIO anIter( anIOList ); - for( ; anIter.More(); anIter.Next() ) { - if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) { - anIOList.Remove( anIter ); - aSelMgr->setSelectedObjects( anIOList, true ); - return; - } - } - } + LightApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); // for sure! + LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); + if ( aStudy && aSelMgr ) { + SALOME_ListIO anIOList; + // VSR: temporary solution, until LightApp_SelectionMgr::unsetSelectedObjects() method appears + // Lately this should be replaced by the following: + // anIOList.Append( new SALOME_InteractiveObject( myEntry, "", "" ) ); + // aSelMgr->unsetSelectedObjects( anIOList ); + /////////////////////////////////////////////// + aSelMgr->selectedObjects( anIOList ); + SALOME_ListIteratorOfListIO anIter( anIOList ); + for( ; anIter.More(); anIter.Next() ) { + if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) { + anIOList.Remove( anIter ); + aSelMgr->setSelectedObjects( anIOList, true ); + return; + } + } + } } } }; @@ -399,10 +399,10 @@ void SALOMEGUI_Swig::ClearIObjects() virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - LightApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); // for sure! - LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); - if ( aStudy && aSelMgr ) - aSelMgr->clearSelected(); + LightApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); // for sure! + LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr(); + if ( aStudy && aSelMgr ) + aSelMgr->clearSelected(); } } }; @@ -418,7 +418,7 @@ void SALOMEGUI_Swig::ClearIObjects() For the current moment implemented for OCC and VTK viewers only. \param theEntry object entry -*/ +*/ void SALOMEGUI_Swig::Display( const char* theEntry ) { class TEvent: public SALOME_Event @@ -428,12 +428,12 @@ void SALOMEGUI_Swig::Display( const char* theEntry ) TEvent( const char* theEntry ) : myEntry( theEntry ) {} virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - if ( window ) { - SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); - if ( view ) - view->Display( view->CreatePrs( myEntry.toLatin1() ) ); - } + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( view ) + view->Display( view->CreatePrs( myEntry.toLatin1() ) ); + } } } }; @@ -461,14 +461,14 @@ void SALOMEGUI_Swig::DisplayOnly( const char* theEntry ) virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - if ( window ) { - SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); - if ( view ) { - view->EraseAll( false ); - view->Display( view->CreatePrs( myEntry.toLatin1() ) ); - } - } + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( view ) { + view->EraseAll( false ); + view->Display( view->CreatePrs( myEntry.toLatin1() ) ); + } + } } } }; @@ -484,7 +484,7 @@ void SALOMEGUI_Swig::DisplayOnly( const char* theEntry ) For the current moment implemented for OCC and VTK viewers only. \param theEntry object entry -*/ +*/ void SALOMEGUI_Swig::Erase( const char* theEntry ) { class TEvent: public SALOME_Event @@ -495,12 +495,12 @@ void SALOMEGUI_Swig::Erase( const char* theEntry ) virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - if ( window ) { - SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); - if ( view ) - view->Erase( view->CreatePrs( myEntry.toLatin1() ) ); - } + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( view ) + view->Erase( view->CreatePrs( myEntry.toLatin1() ) ); + } } } }; @@ -525,19 +525,19 @@ void SALOMEGUI_Swig::DisplayAll() virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - LightApp_Study* study = dynamic_cast( anApp->activeStudy() ); // for sure! - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - LightApp_Module* activeModule = dynamic_cast( anApp->activeModule() ); - if ( study && window && activeModule ) { - SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); - if ( view ) { - for ( SUIT_DataObjectIterator it( activeModule->dataModel()->root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) { - LightApp_DataObject* obj = dynamic_cast( it.current() ); - if ( obj && !obj->entry().isEmpty() ) - view->Display( view->CreatePrs( obj->entry().toLatin1() ) ); - } - } - } + LightApp_Study* study = dynamic_cast( anApp->activeStudy() ); // for sure! + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + LightApp_Module* activeModule = dynamic_cast( anApp->activeModule() ); + if ( study && window && activeModule ) { + SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( view ) { + for ( SUIT_DataObjectIterator it( activeModule->dataModel()->root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) { + LightApp_DataObject* obj = dynamic_cast( it.current() ); + if ( obj && !obj->entry().isEmpty() ) + view->Display( view->CreatePrs( obj->entry().toLatin1() ) ); + } + } + } } } }; @@ -558,12 +558,12 @@ void SALOMEGUI_Swig::EraseAll() virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - if ( window ) { - SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); - if ( view ) - view->EraseAll( false ); - } + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( view ) + view->EraseAll( false ); + } } } }; @@ -593,11 +593,11 @@ public: if ( LightApp_Application* anApp = getApplication() ) { SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); if ( window ) { - SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); - if ( view ) { - SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() ); - myResult = !aPrs->IsNull(); - } + SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( view ) { + SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() ); + myResult = !aPrs->IsNull(); + } } } } @@ -619,12 +619,12 @@ void SALOMEGUI_Swig::UpdateView() virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - if ( window ) { - SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); - if ( view ) - view->Repaint(); - } + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( view ) + view->Repaint(); + } } } }; @@ -643,15 +643,15 @@ void SALOMEGUI_Swig::FitAll() virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - if ( window ) { - if ( dynamic_cast( window ) ) - ( dynamic_cast( window ) )->onFitAll(); - else if ( dynamic_cast( window ) ) - ( dynamic_cast( window ) )->onFitAll(); - else if ( dynamic_cast( window ) ) - ( dynamic_cast( window ) )->onFitAll(); - } + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + if ( dynamic_cast( window ) ) + ( dynamic_cast( window ) )->onFitAll(); + else if ( dynamic_cast( window ) ) + ( dynamic_cast( window ) )->onFitAll(); + else if ( dynamic_cast( window ) ) + ( dynamic_cast( window ) )->onFitAll(); + } } } }; @@ -670,17 +670,17 @@ void SALOMEGUI_Swig::ResetView() virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - if ( window ) { - if ( dynamic_cast( window ) ) - (dynamic_cast( window ))->onResetView(); - else if ( dynamic_cast( window ) ) - (dynamic_cast( window ))->onResetView(); - else if ( dynamic_cast( window ) ) - (dynamic_cast( window ))->onFitAll(); - // VSR: there is no 'ResetView' functionality for Plot2d viewer, - // so we use 'FitAll' instead. - } + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + if ( dynamic_cast( window ) ) + (dynamic_cast( window ))->onResetView(); + else if ( dynamic_cast( window ) ) + (dynamic_cast( window ))->onResetView(); + else if ( dynamic_cast( window ) ) + (dynamic_cast( window ))->onFitAll(); + // VSR: there is no 'ResetView' functionality for Plot2d viewer, + // so we use 'FitAll' instead. + } } } }; @@ -716,45 +716,45 @@ static void setView( int view ) virtual void Execute() { if ( LightApp_Application* anApp = getApplication() ) { - SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); - if ( window ) { - if ( dynamic_cast( window ) ) { - switch( myView ) { - case __ViewTop: - (dynamic_cast( window ))->onTopView(); break; - case __ViewBottom: - (dynamic_cast( window ))->onBottomView(); break; - case __ViewLeft: - (dynamic_cast( window ))->onLeftView(); break; - case __ViewRight: - (dynamic_cast( window ))->onRightView(); break; - case __ViewFront: - (dynamic_cast( window ))->onFrontView(); break; - case __ViewBack: - (dynamic_cast( window ))->onBackView(); break; - default: - break; - } - } - else if ( dynamic_cast( window ) ) { - switch( myView ) { - case __ViewTop: - (dynamic_cast( window ))->onTopView(); break; - case __ViewBottom: - (dynamic_cast( window ))->onBottomView(); break; - case __ViewLeft: - (dynamic_cast( window ))->onLeftView(); break; - case __ViewRight: - (dynamic_cast( window ))->onRightView(); break; - case __ViewFront: - (dynamic_cast( window ))->onFrontView(); break; - case __ViewBack: - (dynamic_cast( window ))->onBackView(); break; - default: - break; - } - } - } + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + if ( dynamic_cast( window ) ) { + switch( myView ) { + case __ViewTop: + (dynamic_cast( window ))->onTopView(); break; + case __ViewBottom: + (dynamic_cast( window ))->onBottomView(); break; + case __ViewLeft: + (dynamic_cast( window ))->onLeftView(); break; + case __ViewRight: + (dynamic_cast( window ))->onRightView(); break; + case __ViewFront: + (dynamic_cast( window ))->onFrontView(); break; + case __ViewBack: + (dynamic_cast( window ))->onBackView(); break; + default: + break; + } + } + else if ( dynamic_cast( window ) ) { + switch( myView ) { + case __ViewTop: + (dynamic_cast( window ))->onTopView(); break; + case __ViewBottom: + (dynamic_cast( window ))->onBottomView(); break; + case __ViewLeft: + (dynamic_cast( window ))->onLeftView(); break; + case __ViewRight: + (dynamic_cast( window ))->onRightView(); break; + case __ViewFront: + (dynamic_cast( window ))->onFrontView(); break; + case __ViewBack: + (dynamic_cast( window ))->onBackView(); break; + default: + break; + } + } + } } } }; diff --git a/src/SOCC/SOCC_ViewModel.cxx b/src/SOCC/SOCC_ViewModel.cxx index 49d9e53d2..c7a19b522 100755 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -386,16 +386,16 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs ) bDisplayed = true; // Set visibility flag - // Temporarily commented to avoid awful dependecy on SALOMEDS - // TODO: better mechanism of storing display/erse status in a study - // should be provided... - //Handle(SALOME_InteractiveObject) anObj = + // Temporarily commented to avoid awful dependecy on SALOMEDS + // TODO: better mechanism of storing display/erse status in a study + // should be provided... + //Handle(SALOME_InteractiveObject) anObj = // Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() ); //if ( !anObj.IsNull() && anObj->hasEntry() ) //{ - // if ( study ) - // ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this ); - //} + // if ( study ) + // ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this ); + //} break; } } @@ -508,7 +508,7 @@ void SOCC_Viewer::EraseAll( const bool forced ) AIS_ListIteratorOfListOfInteractive anIter( aList ); for ( ; anIter.More(); anIter.Next() ) { if ( isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron ) || - anIter.Value()->DynamicType() == STANDARD_TYPE( OCCViewer_Trihedron )) + anIter.Value()->DynamicType() == STANDARD_TYPE( OCCViewer_Trihedron )) continue; // erase an object @@ -521,11 +521,11 @@ void SOCC_Viewer::EraseAll( const bool forced ) // should be provided... //if ( !forced ) { // Handle(SALOME_InteractiveObject) anObj = - // Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() ); + // Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() ); // if ( !anObj.IsNull() && anObj->hasEntry() ) { - // if ( study ) - // ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this ); + // if ( study ) + // ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this ); // } //} } diff --git a/src/SOCC/SOCC_ViewModel.h b/src/SOCC/SOCC_ViewModel.h index 9eb1a0398..9c20035f5 100755 --- a/src/SOCC/SOCC_ViewModel.h +++ b/src/SOCC/SOCC_ViewModel.h @@ -41,7 +41,7 @@ public: virtual ~SOCC_Viewer(); /* Selection management */ - bool highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true ); + bool highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true ); bool isInViewer( const Handle(SALOME_InteractiveObject)&, bool=false ); void setColor( const Handle(SALOME_InteractiveObject)&, const QColor&, bool=true ); diff --git a/src/SOCC/SOCC_ViewWindow.cxx b/src/SOCC/SOCC_ViewWindow.cxx index 4fdb39108..71c2f2cef 100644 --- a/src/SOCC/SOCC_ViewWindow.cxx +++ b/src/SOCC/SOCC_ViewWindow.cxx @@ -30,7 +30,7 @@ */ SOCC_ViewWindow ::SOCC_ViewWindow( SUIT_Desktop* theDesktop, - OCCViewer_Viewer* theModel) + OCCViewer_Viewer* theModel) : OCCViewer_ViewWindow( theDesktop, theModel ) { } diff --git a/src/SPlot2d/SPlot2d_ViewModel.cxx b/src/SPlot2d/SPlot2d_ViewModel.cxx index 10afaed7c..c102f6b54 100644 --- a/src/SPlot2d/SPlot2d_ViewModel.cxx +++ b/src/SPlot2d/SPlot2d_ViewModel.cxx @@ -91,7 +91,7 @@ SPlot2d_Viewer::~SPlot2d_Viewer() Renames curve if it is found */ void SPlot2d_Viewer::rename( const Handle(SALOME_InteractiveObject)& IObject, - const QString& newName, Plot2d_ViewFrame* fr ) + const QString& newName, Plot2d_ViewFrame* fr ) { Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame(); if( !aViewFrame ) @@ -150,8 +150,8 @@ bool SPlot2d_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& IObject CurveDict::Iterator it = aCurves.begin(); for( ; it != aCurves.end(); ++it ) { SPlot2d_Curve* aCurve = dynamic_cast( it.value() ); - if(aCurve && aCurve->hasIO() && aCurve->getTableIO()->isSame(IObject)) - return 1; + if(aCurve && aCurve->hasIO() && aCurve->getTableIO()->isSame(IObject)) + return 1; } } } @@ -216,10 +216,10 @@ void SPlot2d_Viewer::Erase( const Handle(SALOME_InteractiveObject)& IObject, boo _PTR(SObject) aChildSO = aIter->Value(); _PTR(SObject) refSO; if ( aChildSO->ReferencedObject( refSO ) && refSO ) - aChildSO = refSO; + aChildSO = refSO; curve = getCurveByIO( new SALOME_InteractiveObject( aChildSO->GetID().c_str(), "") ); if ( curve ) - aViewFrame->eraseCurve( curve, update ); + aViewFrame->eraseCurve( curve, update ); } } */ @@ -350,7 +350,7 @@ Plot2d_ViewFrame* SPlot2d_Viewer::getActiveViewFrame() \param fr - viewframe */ SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObject)& theIObject, - Plot2d_ViewFrame* fr ) + Plot2d_ViewFrame* fr ) { if ( !theIObject.IsNull() ) { Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame(); @@ -359,10 +359,10 @@ SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObje CurveDict::Iterator it = aCurves.begin(); for( ; it != aCurves.end(); ++it ) { SPlot2d_Curve* aCurve = dynamic_cast( it.value() ); - if(aCurve) { - if ( aCurve->hasIO() && aCurve->getIO()->isSame( theIObject ) ) - return aCurve; - } + if(aCurve) { + if ( aCurve->hasIO() && aCurve->getIO()->isSame( theIObject ) ) + return aCurve; + } } } } diff --git a/src/SPlot2d/SPlot2d_ViewModel.h b/src/SPlot2d/SPlot2d_ViewModel.h index 2fc3491e0..861deddd7 100644 --- a/src/SPlot2d/SPlot2d_ViewModel.h +++ b/src/SPlot2d/SPlot2d_ViewModel.h @@ -58,7 +58,7 @@ public: virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop); - /* display */ + /* display */ void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true ); void DisplayOnly( const Handle(SALOME_InteractiveObject)& IObject ); void Erase( const Handle(SALOME_InteractiveObject)& IObject, bool update = true ); diff --git a/src/SPlot2d/SPlot2d_ViewWindow.cxx b/src/SPlot2d/SPlot2d_ViewWindow.cxx index ce235bfd9..187af80be 100644 --- a/src/SPlot2d/SPlot2d_ViewWindow.cxx +++ b/src/SPlot2d/SPlot2d_ViewWindow.cxx @@ -30,7 +30,7 @@ */ SPlot2d_ViewWindow ::SPlot2d_ViewWindow( SUIT_Desktop* theDesktop, - Plot2d_Viewer* theModel) + Plot2d_Viewer* theModel) : Plot2d_ViewWindow( theDesktop, theModel ) { } diff --git a/src/STD/STD.h b/src/STD/STD.h index ff0bd3e80..bf761c356 100755 --- a/src/STD/STD.h +++ b/src/STD/STD.h @@ -44,10 +44,10 @@ #if defined ( _DEBUG ) || defined ( DEBUG ) #include -#define STD_VERIFY(x) (assert(x)) -#define STD_ASSERT(x) (assert(x)) +#define STD_VERIFY(x) (assert(x)) +#define STD_ASSERT(x) (assert(x)) #else -#define STD_VERIFY(x) (x) +#define STD_VERIFY(x) (x) #define STD_ASSERT(x) #endif diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index 692a270bf..b24f79bcd 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -162,8 +162,8 @@ void STD_Application::createActions() Qt::CTRL+Qt::Key_O, desk, false, this, SLOT( onOpenDoc() ) ); createAction( FileReopenId, tr( "TOT_DESK_FILE_REOPEN" ), QIcon(), - tr( "MEN_DESK_FILE_REOPEN" ), tr( "PRP_DESK_FILE_REOPEN" ), - 0, desk, false, this, SLOT( onReopenDoc() ) ); + tr( "MEN_DESK_FILE_REOPEN" ), tr( "PRP_DESK_FILE_REOPEN" ), + 0, desk, false, this, SLOT( onReopenDoc() ) ); createAction( FileCloseId, tr( "TOT_DESK_FILE_CLOSE" ), resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ), @@ -340,8 +340,8 @@ bool STD_Application::onReopenDoc() if ( study && study->isSaved() ) { // ask user for the confirmation if ( SUIT_MessageBox::question( desktop(), tr( "REOPEN_STUDY" ), tr( "REOPEN_QUESTION" ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No - ) == SUIT_MessageBox::No ) + SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No + ) == SUIT_MessageBox::No ) return false; // remember study name @@ -506,13 +506,13 @@ bool STD_Application::openAction( const int choice, const QString& aName ) QList aAppList = aSession->applications(); for ( QList::iterator it = aAppList.begin(); it != aAppList.end() && !aApp; ++it ) { - if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName ) - aApp = *it; + if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName ) + aApp = *it; } if ( aApp ) - aApp->desktop()->activateWindow(); + aApp->desktop()->activateWindow(); else - res = false; + res = false; } break; case OpenNew: @@ -522,9 +522,9 @@ bool STD_Application::openAction( const int choice, const QString& aName ) { SUIT_Application* aApp = startApplication( 0, 0 ); if ( aApp ) - res = aApp->useFile( aName ); + res = aApp->useFile( aName ); if ( !res ) - aApp->closeApplication(); + aApp->closeApplication(); } break; case OpenCancel: @@ -854,7 +854,7 @@ void STD_Application::onConnectPopupRequest( SUIT_PopupClient* client, QContextM /*!\retval QString - return file name from dialog.*/ QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters, - const QString& caption, QWidget* parent ) + const QString& caption, QWidget* parent ) { if ( !parent ) parent = desktop(); @@ -876,9 +876,9 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q isOk = true; else { - int aEnd = aUsedFilter.lastIndexOf( ')' ); - int aStart = aUsedFilter.lastIndexOf( '(', aEnd ); - QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 ); + int aEnd = aUsedFilter.lastIndexOf( ')' ); + int aStart = aUsedFilter.lastIndexOf( '(', aEnd ); + QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 ); int idx = 0; QStringList extList; @@ -892,23 +892,23 @@ QString STD_Application::getFileName( bool open, const QString& initial, const Q if ( !extList.isEmpty() && !extList.contains( SUIT_Tools::extension( aName ) ) ) aName += QString( ".%1" ).arg( extList.first() ); - if ( QFileInfo( aName ).exists() ) + if ( QFileInfo( aName ).exists() ) { - int aAnswer = SUIT_MessageBox::question( desktop(), tr( "TIT_FILE_SAVEAS" ), - tr( "MSG_FILE_EXISTS" ).arg( aName ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel, SUIT_MessageBox::Yes ); - if ( aAnswer == SUIT_MessageBox::Cancel ) + int aAnswer = SUIT_MessageBox::question( desktop(), tr( "TIT_FILE_SAVEAS" ), + tr( "MSG_FILE_EXISTS" ).arg( aName ), + SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel, SUIT_MessageBox::Yes ); + if ( aAnswer == SUIT_MessageBox::Cancel ) { // cancelled aName = QString(); - isOk = true; + isOk = true; } - else if ( aAnswer == SUIT_MessageBox::No ) // not save to this file - anOldPath = aName; // not to return to the same initial dir at each "while" step - else // overwrite the existing file - isOk = true; + else if ( aAnswer == SUIT_MessageBox::No ) // not save to this file + anOldPath = aName; // not to return to the same initial dir at each "while" step + else // overwrite the existing file + isOk = true; } - else - isOk = true; + else + isOk = true; } } return aName; diff --git a/src/STD/STD_Application.h b/src/STD/STD_Application.h index 08d336918..6f8fc68fb 100755 --- a/src/STD/STD_Application.h +++ b/src/STD/STD_Application.h @@ -88,7 +88,7 @@ public: virtual QString getFileFilter() const { return QString(); } virtual QString getFileName( bool open, const QString& initial, const QString& filters, - const QString& caption, QWidget* parent ); + const QString& caption, QWidget* parent ); QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ); virtual void start(); diff --git a/src/STD/STD_MDIDesktop.cxx b/src/STD/STD_MDIDesktop.cxx index de0dcf880..1909349da 100755 --- a/src/STD/STD_MDIDesktop.cxx +++ b/src/STD/STD_MDIDesktop.cxx @@ -175,8 +175,8 @@ void STD_MDIDesktop::createActions() myWorkspaceAction = new QtxWorkspaceAction( workspace(), this ); myWorkspaceAction->setMenuActions( QtxWorkspaceAction::Cascade | QtxWorkspaceAction::Tile | - QtxWorkspaceAction::HTile | QtxWorkspaceAction::VTile | - QtxWorkspaceAction::Windows ); + QtxWorkspaceAction::HTile | QtxWorkspaceAction::VTile | + QtxWorkspaceAction::Windows ); // Cascade myWorkspaceAction->setIcon( QtxWorkspaceAction::Cascade, diff --git a/src/STD/STD_TabDesktop.cxx b/src/STD/STD_TabDesktop.cxx index 4bbd251a6..80a460bdb 100644 --- a/src/STD/STD_TabDesktop.cxx +++ b/src/STD/STD_TabDesktop.cxx @@ -62,11 +62,11 @@ myWorkstackAction( 0 ) SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); if ( resMgr ) { myWorkstack->setIcon( QtxWorkstack::SplitVertical, - resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) ); + resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) ); myWorkstack->setIcon( QtxWorkstack::SplitHorizontal, - resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) ); + resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) ); myWorkstack->setIcon( QtxWorkstack::Close, - resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) )); + resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) )); } connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ), @@ -138,18 +138,18 @@ void STD_TabDesktop::windowOperation( const int type ) void STD_TabDesktop::setWindowOperations( const int first, ... ) { va_list ints; - va_start( ints, first ); + va_start( ints, first ); - QList typeList; + QList typeList; - int cur = first; - while ( cur ) - { - typeList.append( cur ); - cur = va_arg( ints, int ); + int cur = first; + while ( cur ) + { + typeList.append( cur ); + cur = va_arg( ints, int ); } - setWindowOperations( typeList ); + setWindowOperations( typeList ); } /*! diff --git a/src/SUIT/SUIT_Accel.cxx b/src/SUIT/SUIT_Accel.cxx index f7babbb3f..d46df4a41 100644 --- a/src/SUIT/SUIT_Accel.cxx +++ b/src/SUIT/SUIT_Accel.cxx @@ -132,10 +132,10 @@ bool SUIT_Accel::eventFilter( QObject *obj, QEvent *event ) if ( vw ) { QString type = vw->getViewManager()->getViewModel()->getType(); if ( myMap.contains( type ) ) { - IdActionMap idActionMap = myMap[type]; - if ( idActionMap.contains( key ) ) { - return vw->onAccelAction( idActionMap[key] ); - } + IdActionMap idActionMap = myMap[type]; + if ( idActionMap.contains( key ) ) { + return vw->onAccelAction( idActionMap[key] ); + } } } } diff --git a/src/SUIT/SUIT_ActionOperation.cxx b/src/SUIT/SUIT_ActionOperation.cxx index f3f40ee59..a0e7dba28 100644 --- a/src/SUIT/SUIT_ActionOperation.cxx +++ b/src/SUIT/SUIT_ActionOperation.cxx @@ -53,7 +53,7 @@ QtxAction* SUIT_ActionOperation::action() const * Create new instance of QtxAction and set. */ void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon, - const QString& menuText, QKeySequence accel, + const QString& menuText, QKeySequence accel, QObject* parent, bool toggle ) { setAction( new QtxAction( text, icon, menuText, accel, parent, toggle ) ); @@ -63,7 +63,7 @@ void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon, * Create new instance of QtxAction and set. */ void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText, - QKeySequence accel, QObject* parent, bool toggle ) + QKeySequence accel, QObject* parent, bool toggle ) { setAction( new QtxAction( text, menuText, accel, parent, toggle ) ); } diff --git a/src/SUIT/SUIT_ActionOperation.h b/src/SUIT/SUIT_ActionOperation.h index f4f8e8951..1dd97fc5a 100644 --- a/src/SUIT/SUIT_ActionOperation.h +++ b/src/SUIT/SUIT_ActionOperation.h @@ -35,32 +35,32 @@ class QtxAction; /*!Provide support QtxAction*/ class SUIT_EXPORT SUIT_ActionOperation : public SUIT_Operation { - Q_OBJECT + Q_OBJECT public: - SUIT_ActionOperation( SUIT_Application* ); - virtual ~SUIT_ActionOperation(); + SUIT_ActionOperation( SUIT_Application* ); + virtual ~SUIT_ActionOperation(); - QtxAction* action() const; + QtxAction* action() const; - /** @name GUI management*/ - //@{ - virtual void setAction( const QString& text, const QIcon& icon, const QString& menuText, - QKeySequence accel, QObject* parent, bool toggle = false ); + /** @name GUI management*/ + //@{ + virtual void setAction( const QString& text, const QIcon& icon, const QString& menuText, + QKeySequence accel, QObject* parent, bool toggle = false ); - virtual void setAction( const QString& text, const QString& menuText, + virtual void setAction( const QString& text, const QString& menuText, QKeySequence accel, QObject* parent, bool toggle = false ); - virtual void setAction( QtxAction* theAction ); - - bool addTo( QWidget* theWidget ); + virtual void setAction( QtxAction* theAction ); + + bool addTo( QWidget* theWidget ); - void setStatusTip( const QString& theTip ); - //@} + void setStatusTip( const QString& theTip ); + //@} private: - QtxAction* myAction; + QtxAction* myAction; - friend class SUIT_Study; + friend class SUIT_Study; }; #endif diff --git a/src/SUIT/SUIT_Application.h b/src/SUIT/SUIT_Application.h index 98141edc5..37aa200b2 100755 --- a/src/SUIT/SUIT_Application.h +++ b/src/SUIT/SUIT_Application.h @@ -101,7 +101,7 @@ public: //! Invokes application-specific "Open/Save File" dialog and returns the selected file name. virtual QString getFileName( bool open, const QString& initial, const QString& filters, - const QString& caption, QWidget* parent ) = 0; + const QString& caption, QWidget* parent ) = 0; //! Invokes application-specific "Select Directory" dialog and returns the selected directory name. virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ) = 0; diff --git a/src/SUIT/SUIT_DataBrowser.cxx b/src/SUIT/SUIT_DataBrowser.cxx index 715f3a6fd..6a5902937 100644 --- a/src/SUIT/SUIT_DataBrowser.cxx +++ b/src/SUIT/SUIT_DataBrowser.cxx @@ -193,7 +193,7 @@ void SUIT_DataBrowser::getSelected( DataObjectList& lst ) const foreach( idx, sel ) { SUIT_DataObject* obj = m->object( idx ); if ( obj ) - lst.append( obj ); + lst.append( obj ); } } } @@ -232,7 +232,7 @@ void SUIT_DataBrowser::setSelected( const DataObjectList& lst, const bool append foreach( obj, lst ) { QModelIndex index = m->index( obj ); if ( index.isValid() ) - indexes.append( index ); + indexes.append( index ); } select( indexes, true, append ); // if !indexes.isEmpty() ??? } @@ -309,13 +309,13 @@ void SUIT_DataBrowser::init( SUIT_DataObject* root ) setModel( m ); setItemDelegate( qobject_cast( model() )->delegate() ); connect( treeView(), SIGNAL( sortingEnabled( bool ) ), - model(), SLOT( setSortingEnabled( bool ) ) ); + model(), SLOT( setSortingEnabled( bool ) ) ); connect( treeView(), SIGNAL( clicked( const QModelIndex& ) ), - this, SLOT( onClicked( const QModelIndex& ) ) ); + this, SLOT( onClicked( const QModelIndex& ) ) ); connect( treeView(), SIGNAL( doubleClicked( const QModelIndex& ) ), - this, SLOT( onDblClicked( const QModelIndex& ) ) ); + this, SLOT( onDblClicked( const QModelIndex& ) ) ); connect( treeView(), SIGNAL( expanded( const QModelIndex& ) ), - this, SLOT( onExpanded( const QModelIndex& ) ) ); + this, SLOT( onExpanded( const QModelIndex& ) ) ); myShortcut = new QShortcut( Qt::Key_F5, this, SIGNAL( requestUpdate() ), SIGNAL( requestUpdate() ) ); myAutoSizeFirstColumn = true; diff --git a/src/SUIT/SUIT_DataObject.cxx b/src/SUIT/SUIT_DataObject.cxx index 1c4fe33f2..9248bc3ed 100755 --- a/src/SUIT/SUIT_DataObject.cxx +++ b/src/SUIT/SUIT_DataObject.cxx @@ -677,7 +677,7 @@ bool SUIT_DataObject::customSorting( const int /*id*/ ) const \sa customSorting() */ bool SUIT_DataObject::compare( const QVariant& /*left*/, const QVariant& /*right*/, - const int /*id*/ ) const + const int /*id*/ ) const { return false; } @@ -807,7 +807,7 @@ SUIT_DataObject::Signal::Signal() SUIT_DataObject::Signal::~Signal() { for ( DataObjectList::Iterator it = myDelLaterObjects.begin(); - it != myDelLaterObjects.end(); ++it ) { + it != myDelLaterObjects.end(); ++it ) { delete *it; } myDelLaterObjects.clear(); diff --git a/src/SUIT/SUIT_FileDlg.cxx b/src/SUIT/SUIT_FileDlg.cxx index c60f4b6fc..6a2872cb4 100755 --- a/src/SUIT/SUIT_FileDlg.cxx +++ b/src/SUIT/SUIT_FileDlg.cxx @@ -39,9 +39,9 @@ filters << "Image files (*.bmp *.gif *.jpg )" << "All files (*)"; QString fileName = SUIT_FileDlg::getFileName( desktop(), QString(), - filters, - "Dump view", - false ); + filters, + "Dump view", + false ); if ( !fileName.isEmpty() ) { ... writing image to the file } @@ -51,8 +51,8 @@ filters << "*.cpp | *.cxx | *.c++" << "*.h | *.hpp | *.hxx"; QStringList fileNames = SUIT_FileDlg::getOpenFileName( desktop(), QString(), - filters, - QString() ); + filters, + QString() ); if ( !fileNames.isEmpty() ) { ... open files } @@ -140,13 +140,13 @@ SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool QStringList dirList; if ( resMgr ) - dirList = resMgr->stringValue( "FileDlg", "QuickDirList" ).split( ';', QString::SkipEmptyParts ); + dirList = resMgr->stringValue( "FileDlg", "QuickDirList" ).split( ';', QString::SkipEmptyParts ); if ( dirList.isEmpty() ) - dirList << QDir::homePath(); + dirList << QDir::homePath(); for ( int i = 0; i < dirList.count(); i++ ) - myQuickCombo->addItem( dirList[i] ); + myQuickCombo->addItem( dirList[i] ); } else { delete myQuickLab; myQuickLab = 0; @@ -293,7 +293,7 @@ QStringList SUIT_FileDlg::selectedFiles() const QString f = it.next(); QFileInfo finfo( f ); if ( !finfo.isDir() ) - it.setValue( addExtension( f ) ); + it.setValue( addExtension( f ) ); } } return files; @@ -351,7 +351,7 @@ QLineEdit* SUIT_FileDlg::lineEdit() const for ( int i = 0; i < editBoxes.count(); i++ ) { int widx = grid->indexOf( editBoxes[ i ] ); if ( widx >= 0 ) - idx = qMin( idx, widx ); + idx = qMin( idx, widx ); } if ( grid->itemAt( idx ) ) ebox = qobject_cast( grid->itemAt( idx )->widget() ); @@ -385,26 +385,26 @@ bool SUIT_FileDlg::acceptData() if ( txt == ".." ) { QDir dir = directory(); if ( dir.cdUp() ) { - setDirectory( dir ); - bool block = lineEdit()->blockSignals( true ); - lineEdit()->setText( ".." ); - lineEdit()->selectAll(); - lineEdit()->setFocus( Qt::OtherFocusReason ); - lineEdit()->blockSignals( block ); - return false; + setDirectory( dir ); + bool block = lineEdit()->blockSignals( true ); + lineEdit()->setText( ".." ); + lineEdit()->selectAll(); + lineEdit()->setFocus( Qt::OtherFocusReason ); + lineEdit()->blockSignals( block ); + return false; } } else if ( fileMode() != DirectoryOnly ) { QStringList fs = txt.split( " ", QString::SkipEmptyParts ); for ( int i = 0; i < fs.count(); i++ ) { - QString wc = fs.at( i ); - if ( wc.startsWith( "\"" ) && wc.endsWith( "\"" ) ) - wc = wc.mid( 1, wc.length()-2 ); - if ( hasWildCards( wc ) ) { - addFilter( wc ); - lineEdit()->clear(); - return false; - } + QString wc = fs.at( i ); + if ( wc.startsWith( "\"" ) && wc.endsWith( "\"" ) ) + wc = wc.mid( 1, wc.length()-2 ); + if ( hasWildCards( wc ) ) { + addFilter( wc ); + lineEdit()->clear(); + return false; + } } } } @@ -421,8 +421,8 @@ bool SUIT_FileDlg::acceptData() { QString fn = files.first(); if ( validator() ) { - bOk = isOpenDlg() ? validator()->canReadDir( fn, checkPermissions() ) : - validator()->canWriteDir( fn, checkPermissions() ); + bOk = isOpenDlg() ? validator()->canReadDir( fn, checkPermissions() ) : + validator()->canWriteDir( fn, checkPermissions() ); } break; } @@ -431,17 +431,17 @@ bool SUIT_FileDlg::acceptData() QString fn = files.first(); QFileInfo info( fn ); if ( info.isDir() ) { - setDirectory( info.absoluteFilePath() ); - if ( lineEdit() ) { - lineEdit()->selectAll(); - lineEdit()->setFocus( Qt::OtherFocusReason ); - } - return false; + setDirectory( info.absoluteFilePath() ); + if ( lineEdit() ) { + lineEdit()->selectAll(); + lineEdit()->setFocus( Qt::OtherFocusReason ); + } + return false; } // validation is not required if ( validator() ) { - bOk = isOpenDlg() ? validator()->canOpen( fn, checkPermissions() ) : - validator()->canSave( fn, checkPermissions() ); + bOk = isOpenDlg() ? validator()->canOpen( fn, checkPermissions() ) : + validator()->canSave( fn, checkPermissions() ); } break; } @@ -449,21 +449,21 @@ bool SUIT_FileDlg::acceptData() case ExistingFiles: { for ( int i = 0; i < files.count(); ++i ) { - QFileInfo info( files.at( i ) ); - if ( info.isDir() ) { - setDirectory( info.absoluteFilePath() ); - if ( lineEdit() ) { - lineEdit()->selectAll(); - lineEdit()->setFocus( Qt::OtherFocusReason ); - } - return false; - } - if ( validator() ) { - bOk = isOpenDlg() ? validator()->canOpen( files.at( i ), checkPermissions() ) : - validator()->canSave( files.at( i ), checkPermissions() ); - if ( !bOk ) - return false; - } + QFileInfo info( files.at( i ) ); + if ( info.isDir() ) { + setDirectory( info.absoluteFilePath() ); + if ( lineEdit() ) { + lineEdit()->selectAll(); + lineEdit()->setFocus( Qt::OtherFocusReason ); + } + return false; + } + if ( validator() ) { + bOk = isOpenDlg() ? validator()->canOpen( files.at( i ), checkPermissions() ) : + validator()->canSave( files.at( i ), checkPermissions() ); + if ( !bOk ) + return false; + } } break; } @@ -563,9 +563,9 @@ bool SUIT_FileDlg::processPath( const QString& path ) QFileInfo fi( path ); if ( fi.exists() ) { if ( fi.isFile() ) - selectFile( path ); + selectFile( path ); else if ( fi.isDir() ) - setDirectory( path ); + setDirectory( path ); return true; } QString dirPath = SUIT_Tools::dir( path, false ); @@ -652,12 +652,12 @@ void SUIT_FileDlg::addQuickDir() bool emptyAndHome = false; if ( dirList.count() > 0 ) { for ( int i = 0; i < dirList.count() && !found; i++ ) { - QDir aDir( dirList[i] ); - if ( aDir.canonicalPath().isNull() && dirList[i] == dir.absolutePath() || - !aDir.canonicalPath().isNull() && aDir.exists() && - aDir.canonicalPath() == dir.canonicalPath() ) { - found = true; - } + QDir aDir( dirList[i] ); + if ( aDir.canonicalPath().isNull() && dirList[i] == dir.absolutePath() || + !aDir.canonicalPath().isNull() && aDir.exists() && + aDir.canonicalPath() == dir.canonicalPath() ) { + found = true; + } } } else { @@ -668,7 +668,7 @@ void SUIT_FileDlg::addQuickDir() dirList.append( dp ); resMgr->setValue( "FileDlg", "QuickDirList", dirList.join( ";" ) ); if ( !emptyAndHome ) - myQuickCombo->addItem( dp ); + myQuickCombo->addItem( dp ); } } } @@ -683,11 +683,11 @@ void SUIT_FileDlg::polish() int maxBtnWidth = 0; for ( QList::const_iterator it = buttons.begin(); - it != buttons.end(); ++it ) + it != buttons.end(); ++it ) maxBtnWidth = qMax( maxBtnWidth, (*it)->sizeHint().width() ); for ( QList::const_iterator it = buttons.begin(); - it != buttons.end(); ++it ) { + it != buttons.end(); ++it ) { (*it)->setDefault( false ); (*it)->setAutoDefault( false ); (*it)->setFixedWidth( maxBtnWidth ); @@ -695,7 +695,7 @@ void SUIT_FileDlg::polish() QList views = findChildren(); for ( QList::const_iterator it = views.begin(); - it != views.end(); ++it ) { + it != views.end(); ++it ) { (*it)->setViewMode( QListView::ListMode ); } } @@ -735,8 +735,8 @@ void SUIT_FileDlg::polish() \sa getOpenFileNames(), getExistingDirectory() */ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, - const QStringList& filters, const QString& caption, - const bool open, const bool showQuickDir, + const QStringList& filters, const QString& caption, + const bool open, const bool showQuickDir, SUIT_FileValidator* validator ) { SUIT_FileDlg fd( parent, open, showQuickDir, true ); @@ -808,12 +808,12 @@ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, \sa getOpenFileNames(), getExistingDirectory() */ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, - const QString& filters, const QString& caption, - const bool open, const bool showQuickDir, + const QString& filters, const QString& caption, + const bool open, const bool showQuickDir, SUIT_FileValidator* validator ) { return getFileName( parent, initial, filters.split( ";;", QString::SkipEmptyParts ), - caption, open, showQuickDir, validator ); + caption, open, showQuickDir, validator ); } /*! @@ -846,9 +846,9 @@ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, \sa getFileName(), getExistingDirectory() */ QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& initial, - const QStringList& filters, const QString& caption, - const bool showQuickDir, - SUIT_FileValidator* validator ) + const QStringList& filters, const QString& caption, + const bool showQuickDir, + SUIT_FileValidator* validator ) { SUIT_FileDlg fd( parent, true, showQuickDir, true ); @@ -910,12 +910,12 @@ QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& init \sa getFileName(), getExistingDirectory() */ QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& initial, - const QString& filters, const QString& caption, - const bool showQuickDir, - SUIT_FileValidator* validator ) + const QString& filters, const QString& caption, + const bool showQuickDir, + SUIT_FileValidator* validator ) { return getOpenFileNames( parent, initial, filters.split( ";;", QString::SkipEmptyParts ), - caption, showQuickDir, validator ); + caption, showQuickDir, validator ); } /*! @@ -945,7 +945,7 @@ QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& init */ QString SUIT_FileDlg::getExistingDirectory( QWidget* parent, const QString& initial, const QString& caption, const bool showQuickDir, - SUIT_FileValidator* validator ) + SUIT_FileValidator* validator ) { SUIT_FileDlg fd( parent, true, showQuickDir, true ); diff --git a/src/SUIT/SUIT_FileDlg.h b/src/SUIT/SUIT_FileDlg.h index 2e0d02d99..72cfd756d 100755 --- a/src/SUIT/SUIT_FileDlg.h +++ b/src/SUIT/SUIT_FileDlg.h @@ -61,38 +61,38 @@ public: static QString getLastVisitedDirectory(); static QString getFileName( QWidget*, - const QString&, - const QStringList&, - const QString& = QString(), - const bool = true, - const bool = true, + const QString&, + const QStringList&, + const QString& = QString(), + const bool = true, + const bool = true, SUIT_FileValidator* = 0 ); static QString getFileName( QWidget*, - const QString&, - const QString&, - const QString& = QString(), - const bool = true, - const bool = true, + const QString&, + const QString&, + const QString& = QString(), + const bool = true, + const bool = true, SUIT_FileValidator* = 0 ); static QStringList getOpenFileNames( QWidget*, - const QString&, - const QStringList&, - const QString& = QString(), - const bool = true, - SUIT_FileValidator* = 0 ); + const QString&, + const QStringList&, + const QString& = QString(), + const bool = true, + SUIT_FileValidator* = 0 ); static QStringList getOpenFileNames( QWidget*, - const QString&, - const QString&, - const QString& = QString(), - const bool = true, - SUIT_FileValidator* = 0 ); + const QString&, + const QString&, + const QString& = QString(), + const bool = true, + SUIT_FileValidator* = 0 ); static QString getExistingDirectory( QWidget*, - const QString&, + const QString&, const QString& = QString(), - const bool = true, - SUIT_FileValidator* = 0 ); + const bool = true, + SUIT_FileValidator* = 0 ); static QString getLastVisitedPath(); diff --git a/src/SUIT/SUIT_FileValidator.cxx b/src/SUIT/SUIT_FileValidator.cxx index ee6c3d2ed..f56f2286d 100755 --- a/src/SUIT/SUIT_FileValidator.cxx +++ b/src/SUIT/SUIT_FileValidator.cxx @@ -60,13 +60,13 @@ bool SUIT_FileValidator::canOpen( const QString& fileName, bool checkPermission if ( !QFile::exists( fileName ) ) { if ( parent() ) SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_FILE_NOT_EXIST" ).arg( fileName ) ); + QObject::tr( "ERR_FILE_NOT_EXIST" ).arg( fileName ) ); return false; } if ( checkPermission && !QFileInfo( fileName ).isReadable() ) { if ( parent() ) SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_OPEN_PERMISSION_DENIED" ).arg( fileName ) ); + QObject::tr( "ERR_OPEN_PERMISSION_DENIED" ).arg( fileName ) ); return false; } return true; @@ -91,15 +91,15 @@ bool SUIT_FileValidator::canSave( const QString& fileName, bool checkPermission if ( QFile::exists( fileName ) ) { if ( parent() ) if ( SUIT_MessageBox::question( parent(), QObject::tr( "WRN_WARNING" ), - QObject::tr( "QUE_DOC_FILEEXISTS" ).arg( fileName ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No, - SUIT_MessageBox::No ) != SUIT_MessageBox::Yes ) - return false; + QObject::tr( "QUE_DOC_FILEEXISTS" ).arg( fileName ), + SUIT_MessageBox::Yes | SUIT_MessageBox::No, + SUIT_MessageBox::No ) != SUIT_MessageBox::Yes ) + return false; if ( checkPermission && !QFileInfo( fileName ).isWritable() ) { if ( parent() ) - SUIT_MessageBox::critical( myParent, QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) ); + SUIT_MessageBox::critical( myParent, QObject::tr( "ERR_ERROR" ), + QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) ); return false; } } @@ -107,13 +107,13 @@ bool SUIT_FileValidator::canSave( const QString& fileName, bool checkPermission QString dirName = SUIT_Tools::dir( fileName ); if ( !QFile::exists( dirName ) ) { SUIT_MessageBox::critical( parent(), QObject::tr( "WRN_WARNING" ), - QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) ); + QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) ); return false; } if ( checkPermission && !QFileInfo( dirName ).isWritable() ) { if ( parent() ) - SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) ); + SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), + QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) ); return false; } } @@ -137,19 +137,19 @@ bool SUIT_FileValidator::canReadDir( const QString& dirName, bool checkPermissio if ( !info.exists() ) { if ( parent() ) SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) ); + QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) ); return false; } if ( !info.isDir() ) { if ( parent() ) SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) ); + QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) ); return false; } if ( checkPermission && !info.isReadable() ) { if ( parent() ) SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_DIR_READ_PERMISSION_DENIED" ).arg( dirName ) ); + QObject::tr( "ERR_DIR_READ_PERMISSION_DENIED" ).arg( dirName ) ); return false; } return true; @@ -172,19 +172,19 @@ bool SUIT_FileValidator::canWriteDir( const QString& dirName, bool checkPermissi if ( !info.exists() ) { if ( parent() ) SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) ); + QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) ); return false; } if ( !info.isDir() ) { if ( parent() ) SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) ); + QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) ); return false; } if ( checkPermission && !info.isWritable() ) { if ( parent() ) SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ), - QObject::tr( "ERR_DIR_WRITE_PERMISSION_DENIED" ).arg( dirName ) ); + QObject::tr( "ERR_DIR_WRITE_PERMISSION_DENIED" ).arg( dirName ) ); return false; } return true; diff --git a/src/SUIT/SUIT_LicenseDlg.cxx b/src/SUIT/SUIT_LicenseDlg.cxx index 08358f5ea..816e82ca8 100755 --- a/src/SUIT/SUIT_LicenseDlg.cxx +++ b/src/SUIT/SUIT_LicenseDlg.cxx @@ -108,8 +108,8 @@ SUIT_LicenseDlg::SUIT_LicenseDlg( bool firstShow, QWidget* parent, const char* n } /*! - Name: ~SUIT_LicenseDlg [public] - Desc: Destructor + Name: ~SUIT_LicenseDlg [public] + Desc: Destructor */ SUIT_LicenseDlg::~SUIT_LicenseDlg() @@ -175,20 +175,20 @@ void SUIT_LicenseDlg::onPrint() // convert text to rich text format QString aFormattedText = Qt::convertFromPlainText( myTextEdit->toPlainText() ); - + QTextDocument aRichText( aFormattedText ); aRichText.setDefaultFont( aBodyFont ); /*QSimpleRichText aRichText( aFormattedText, - aBodyFont, - myTextEdit->context(), - myTextEdit->styleSheet(), - myTextEdit->mimeSourceFactory(), - aBody.height() ); + aBodyFont, + myTextEdit->context(), + myTextEdit->styleSheet(), + myTextEdit->mimeSourceFactory(), + aBody.height() ); */ aRichText.setPageSize( QSize( aBody.width(), aRichText.pageSize().height() ) ); - //aRichText.setWidth( &aPainter, aBody.width() ); + //aRichText.setWidth( &aPainter, aBody.width() ); QRect aView( aBody ); @@ -197,7 +197,7 @@ void SUIT_LicenseDlg::onPrint() do { // print page text aRichText.drawContents( &aPainter, aView ); - //aRichText.draw( &aPainter, aBody.left(), aBody.top(), aView, colorGroup() ); + //aRichText.draw( &aPainter, aBody.left(), aBody.top(), aView, colorGroup() ); aView.translate( 0, aBody.height() ); aPainter.translate( 0 , -aBody.height() ); @@ -206,10 +206,10 @@ void SUIT_LicenseDlg::onPrint() aPainter.setFont(aFooterFont); QString aFooter = QString("Page ") + QString::number(aPageIndex); aPainter.drawText( aView.right() - aPainter.fontMetrics().width( aFooter ), - aView.bottom() + aPainter.fontMetrics().ascent() + 5, aFooter ); + aView.bottom() + aPainter.fontMetrics().ascent() + 5, aFooter ); if ( aView.top() >= aRichText.size().height() ) - break; + break; aPrinter.newPage(); aPageIndex++; } while (true); diff --git a/src/SUIT/SUIT_MessageBox.cxx b/src/SUIT/SUIT_MessageBox.cxx index 46dfe4f73..cc4754efc 100755 --- a/src/SUIT/SUIT_MessageBox.cxx +++ b/src/SUIT/SUIT_MessageBox.cxx @@ -63,8 +63,8 @@ // show question message box with two standard buttons int result = SUIT_MessageBox::question(desktop(), "Error", "File already exists? Overwrite?", - SUIT_MessageBox::Yes | SUIT_MessageBox::No, - SUIT_MessageBox::No ); + SUIT_MessageBox::Yes | SUIT_MessageBox::No, + SUIT_MessageBox::No ); if ( result == SUIT_MessageBox::Yes ) overwriteFileFunction(); @@ -72,7 +72,7 @@ // default is second button and escape is third button int result = SUIT_MessageBox::critical(desktop(), "Hazard!", "The situation is critical! What to do?", - "Hide", "Run Away", "Stand still", 1, 2); + "Hide", "Run Away", "Stand still", 1, 2); switch ( result ) { case 0: @@ -89,8 +89,8 @@ // both default and escape buttons are set to first button ("Zero") int result = SUIT_MessageBox::information(desktop(), "Question", "Select your favourite number", - 0, 0, - "Zero", "One", "Two", "Three", "Four", "Five"); + 0, 0, + "Zero", "One", "Two", "Three", "Four", "Five"); useMyFavouriteNumberSomewhere( result ); \endcode */ @@ -230,7 +230,7 @@ SUIT_MessageBox::StandardButton SUIT_MessageBox::question( QWidget* parent, cons \return button id clicked by the user (QMessageBox::StandardButton) */ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text, - const QString& button ) + const QString& button ) { ButtonInfos lst; lst.append( ButtonInfo( 0, button ) ); @@ -251,7 +251,7 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr \return button id clicked by the user (QMessageBox::StandardButton) */ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text, - const QString& button ) + const QString& button ) { ButtonInfos lst; lst.append( ButtonInfo( 0, button ) ); @@ -272,7 +272,7 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri \return button id clicked by the user (QMessageBox::StandardButton) */ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text, - const QString& button ) + const QString& button ) { ButtonInfos lst; lst.append( ButtonInfo( 0, button ) ); @@ -298,7 +298,7 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q \return button id clicked by the user (QMessageBox::StandardButton) */ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text, - const QString& button ) + const QString& button ) { ButtonInfos lst; lst.append( ButtonInfo( 0, button ) ); @@ -329,15 +329,15 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr \return button used button id */ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; lst.append( ButtonInfo( id++, button1 ) ); lst.append( ButtonInfo( id++, button2 ) ); return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -364,15 +364,15 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr \return button used button id */ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; lst.append( ButtonInfo( id++, button1 ) ); lst.append( ButtonInfo( id++, button2 ) ); return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -399,15 +399,15 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri \return button used button id */ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; lst.append( ButtonInfo( id++, button1 ) ); lst.append( ButtonInfo( id++, button2 ) ); return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -434,15 +434,15 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q \return button used button id */ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; lst.append( ButtonInfo( id++, button1 ) ); lst.append( ButtonInfo( id++, button2 ) ); return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -470,9 +470,9 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr \return button used button id */ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const QString& button3, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; @@ -480,7 +480,7 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr lst.append( ButtonInfo( id++, button2 ) ); lst.append( ButtonInfo( id++, button3 ) ); return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -508,9 +508,9 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr \return button used button id */ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const QString& button3, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; @@ -518,7 +518,7 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri lst.append( ButtonInfo( id++, button2 ) ); lst.append( ButtonInfo( id++, button3 ) ); return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -546,9 +546,9 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri \return button used button id */ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const QString& button3, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; @@ -556,7 +556,7 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q lst.append( ButtonInfo( id++, button2 ) ); lst.append( ButtonInfo( id++, button3 ) ); return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -584,9 +584,9 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q \return button used button id */ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const QString& button3, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; @@ -594,7 +594,7 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr lst.append( ButtonInfo( id++, button2 ) ); lst.append( ButtonInfo( id++, button3 ) ); return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -624,9 +624,9 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr \return button used button id */ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, const QString& button4, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const QString& button3, const QString& button4, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; @@ -635,7 +635,7 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr lst.append( ButtonInfo( id++, button3 ) ); lst.append( ButtonInfo( id++, button4 ) ); return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -665,9 +665,9 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr \return button used button id */ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, const QString& button4, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const QString& button3, const QString& button4, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; @@ -676,7 +676,7 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri lst.append( ButtonInfo( id++, button3 ) ); lst.append( ButtonInfo( id++, button4 ) ); return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -706,9 +706,9 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri \return button used button id */ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, const QString& button4, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const QString& button3, const QString& button4, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; @@ -717,7 +717,7 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q lst.append( ButtonInfo( id++, button3 ) ); lst.append( ButtonInfo( id++, button4 ) ); return messageBox( SUIT_MessageBox::Information, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -747,9 +747,9 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q \return button used button id */ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, const QString& button4, - const int defaultButton, const int escapeButton ) + const QString& button1, const QString& button2, + const QString& button3, const QString& button4, + const int defaultButton, const int escapeButton ) { ButtonInfos lst; int id = 0; @@ -758,7 +758,7 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr lst.append( ButtonInfo( id++, button3 ) ); lst.append( ButtonInfo( id++, button4 ) ); return messageBox( SUIT_MessageBox::Question, parent, title, text, lst, - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -789,14 +789,14 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr \return button used button id */ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text, - const int defaultButton, const int escapeButton, - char* btn, ... ) + const int defaultButton, const int escapeButton, + char* btn, ... ) { va_list args; va_start( args, btn ); return messageBox( SUIT_MessageBox::Critical, parent, title, text, messageList( btn, args ), - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -827,14 +827,14 @@ int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QStr \return button used button id */ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text, - const int defaultButton, const int escapeButton, - char* btn, ... ) + const int defaultButton, const int escapeButton, + char* btn, ... ) { va_list args; va_start( args, btn ); return messageBox( SUIT_MessageBox::Warning, parent, title, text, messageList( btn, args ), - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -865,14 +865,14 @@ int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QStri \return button used button id */ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text, - const int defaultButton, const int escapeButton, - char* btn, ... ) + const int defaultButton, const int escapeButton, + char* btn, ... ) { va_list args; va_start( args, btn ); return messageBox( SUIT_MessageBox::Information, parent, title, text, messageList( btn, args ), - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -903,14 +903,14 @@ int SUIT_MessageBox::information( QWidget* parent, const QString& title, const Q \return button used button id */ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text, - const int defaultButton, const int escapeButton, - char* btn, ... ) + const int defaultButton, const int escapeButton, + char* btn, ... ) { va_list args; va_start( args, btn ); return messageBox( SUIT_MessageBox::Question, parent, title, text, messageList( btn, args ), - defaultButton, escapeButton ); + defaultButton, escapeButton ); } /*! @@ -950,10 +950,10 @@ SUIT_MessageBox::ButtonInfos SUIT_MessageBox::messageList( char* txt, va_list& a \return button used button id */ int SUIT_MessageBox::messageBox( Icon icon, QWidget* parent, - const QString& title, const QString& text, - const ButtonInfos& lst, - const int defaultButton, - const int escapeButton ) + const QString& title, const QString& text, + const ButtonInfos& lst, + const int defaultButton, + const int escapeButton ) { SUIT_MessageBox msgBox( icon, title, text, NoButton, parent ); diff --git a/src/SUIT/SUIT_MessageBox.h b/src/SUIT/SUIT_MessageBox.h index 6fb2e5164..d1f8f65c0 100755 --- a/src/SUIT/SUIT_MessageBox.h +++ b/src/SUIT/SUIT_MessageBox.h @@ -53,81 +53,81 @@ public: // message boxes with one custom button static int critical( QWidget* parent, const QString& title, const QString& text, - const QString& button ); + const QString& button ); static int warning( QWidget* parent, const QString& title, const QString& text, - const QString& button ); + const QString& button ); static int information( QWidget* parent, const QString& title, const QString& text, - const QString& button ); + const QString& button ); static int question( QWidget* parent, const QString& title, const QString& text, - const QString& button ); + const QString& button ); // message boxes with two custom buttons static int critical( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, + const int defaultButton = -1, const int escapeButton = -1 ); static int warning( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, + const int defaultButton = -1, const int escapeButton = -1 ); static int information( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, + const int defaultButton = -1, const int escapeButton = -1 ); static int question( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, + const int defaultButton = -1, const int escapeButton = -1 ); // message boxes with three custom buttons static int critical( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, const QString& button3, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, const QString& button3, + const int defaultButton = -1, const int escapeButton = -1 ); static int warning( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, const QString& button3, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, const QString& button3, + const int defaultButton = -1, const int escapeButton = -1 ); static int information( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, const QString& button3, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, const QString& button3, + const int defaultButton = -1, const int escapeButton = -1 ); static int question( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, const QString& button3, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, const QString& button3, + const int defaultButton = -1, const int escapeButton = -1 ); // message boxes with four custom buttons static int critical( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, const QString& button4, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, + const QString& button3, const QString& button4, + const int defaultButton = -1, const int escapeButton = -1 ); static int warning( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, const QString& button4, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, + const QString& button3, const QString& button4, + const int defaultButton = -1, const int escapeButton = -1 ); static int information( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, const QString& button4, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, + const QString& button3, const QString& button4, + const int defaultButton = -1, const int escapeButton = -1 ); static int question( QWidget* parent, const QString& title, const QString& text, - const QString& button1, const QString& button2, - const QString& button3, const QString& button4, - const int defaultButton = -1, const int escapeButton = -1 ); + const QString& button1, const QString& button2, + const QString& button3, const QString& button4, + const int defaultButton = -1, const int escapeButton = -1 ); // message boxes with arbitrary number of buttons static int critical( QWidget* parent, const QString& title, const QString& text, - const int defaultButton, const int escapeButton, - char*, ... ); + const int defaultButton, const int escapeButton, + char*, ... ); static int warning( QWidget* parent, const QString& title, const QString& text, - const int defaultButton, const int escapeButton, - char*, ... ); + const int defaultButton, const int escapeButton, + char*, ... ); static int information( QWidget* parent, const QString& title, const QString& text, - const int defaultButton, const int escapeButton, - char*, ... ); + const int defaultButton, const int escapeButton, + char*, ... ); static int question( QWidget* parent, const QString& title, const QString& text, - const int defaultButton, const int escapeButton, - char*, ... ); + const int defaultButton, const int escapeButton, + char*, ... ); private: class ButtonInfo { public: ButtonInfo( const int id, - const QString& text, - const ButtonRole role = ActionRole ) + const QString& text, + const ButtonRole role = ActionRole ) : myId( id ), myText( text ), myRole( role ) {} int id() const { return myId; } QString text() const { return myText; } @@ -142,10 +142,10 @@ private: private: static int messageBox( SUIT_MessageBox::Icon icon, QWidget* parent, - const QString& title, const QString& text, - const ButtonInfos& lst, - const int defaultButton = -1, - const int escapeButton = -1 ); + const QString& title, const QString& text, + const ButtonInfos& lst, + const int defaultButton = -1, + const int escapeButton = -1 ); static ButtonInfos messageList( char*, va_list& ); }; diff --git a/src/SUIT/SUIT_SelectionMgr.cxx b/src/SUIT/SUIT_SelectionMgr.cxx index 5b8595b8c..0999c1638 100755 --- a/src/SUIT/SUIT_SelectionMgr.cxx +++ b/src/SUIT/SUIT_SelectionMgr.cxx @@ -153,7 +153,7 @@ void SUIT_SelectionMgr::selectionChanged( SUIT_Selector* sel ) { // Temporary action(to avoid selection of the objects which don't pass the filters): //if ( *it != sel ) - (*it)->setSelected( newOwners ); + (*it)->setSelected( newOwners ); } } myIsSelChangeEnabled = true; diff --git a/src/SUIT/SUIT_Session.cxx b/src/SUIT/SUIT_Session.cxx index 8848a2c86..c2f264267 100755 --- a/src/SUIT/SUIT_Session.cxx +++ b/src/SUIT/SUIT_Session.cxx @@ -173,7 +173,7 @@ void SUIT_Session::insertApplication( SUIT_Application* app ) connect( app, SIGNAL( applicationClosed( SUIT_Application* ) ), this, SLOT( onApplicationClosed( SUIT_Application* ) ) ); connect( app, SIGNAL( activated( SUIT_Application* ) ), - this, SLOT( onApplicationActivated( SUIT_Application* ) ) ); + this, SLOT( onApplicationActivated( SUIT_Application* ) ) ); } /*! @@ -254,7 +254,7 @@ void SUIT_Session::closeSession( int mode, int flags ) { SUIT_Study* study = app->activeStudy(); if ( study->isModified() && study->isSaved() ) - study->saveDocument(); + study->saveDocument(); } else if ( mode == DONT_SAVE ) { diff --git a/src/SUIT/SUIT_Tools.cxx b/src/SUIT/SUIT_Tools.cxx index 6a72ad284..1fcd34766 100755 --- a/src/SUIT/SUIT_Tools.cxx +++ b/src/SUIT/SUIT_Tools.cxx @@ -39,10 +39,10 @@ void SUIT_Tools::trace( const char* lpszLog, const char* lpszFormat, ... ) tmpPath += QString( "Salome_trace" ); - FILE* pStream; + FILE* pStream; pStream = fopen( lpszLog ? lpszLog : (const char*)tmpPath.toLatin1(), "a" ); if ( pStream ) - { + { va_list argptr; va_start( argptr, lpszFormat ); fprintf( pStream, "- Trace %s [%d] : %s", __FILE__, __LINE__, lpszFormat ); @@ -55,7 +55,7 @@ void SUIT_Tools::trace( const char* lpszLog, const char* lpszFormat, ... ) /*! Creates a rect with TopLeft = ( min(x1,x2), min(y1,y2) ) and BottomRight = ( TopLeft + (x2-x1)(y2-y1) ) -*/ +*/ QRect SUIT_Tools::makeRect( const int x1, const int y1, const int x2, const int y2 ) { return QRect( qMin( x1, x2 ), qMin( y1, y2 ), qAbs( x2 - x1 ), qAbs( y2 - y1 ) ); diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index ef5f40b0d..3c32c174d 100755 --- a/src/SUIT/SUIT_TreeModel.cxx +++ b/src/SUIT/SUIT_TreeModel.cxx @@ -90,8 +90,8 @@ private: \param after tree item after each this one should be inserted */ SUIT_TreeModel::TreeItem::TreeItem( SUIT_DataObject* obj, - SUIT_TreeModel::TreeItem* parent, - SUIT_TreeModel::TreeItem* after ) + SUIT_TreeModel::TreeItem* parent, + SUIT_TreeModel::TreeItem* after ) : myParent( parent ), myObj( obj ) { @@ -123,7 +123,7 @@ SUIT_TreeModel::TreeItem::~TreeItem() \param after tree item after each \a child should be inserted */ void SUIT_TreeModel::TreeItem::insertChild( SUIT_TreeModel::TreeItem* child, - SUIT_TreeModel::TreeItem* after ) + SUIT_TreeModel::TreeItem* after ) { if ( !child ) return; @@ -303,8 +303,8 @@ SUIT_TreeModel::ItemPtr SUIT_TreeModel::TreeSync::nullTrg() const \return created item */ SUIT_TreeModel::ItemPtr SUIT_TreeModel::TreeSync::createItem( const ObjPtr& obj, - const ItemPtr& parent, - const ItemPtr& after ) const + const ItemPtr& parent, + const ItemPtr& after ) const { ItemPtr item = myModel ? myModel->createItem( obj, parent, after ) : 0; @@ -401,21 +401,21 @@ bool SUIT_TreeModel::TreeSync::needUpdate( const ItemPtr& item ) const /* update = ( item->text( 0 ) != obj->name() ) || myBrowser->needToUpdateTexts( item ); if ( !update ) { - // 2. check pixmap (compare serialNumber()-s) - QPixmap objPix = obj->icon(); - const QPixmap* itemPix = item->pixmap( 0 ); - update = ( objPix.isNull() && ( itemPix && !itemPix->isNull() ) ) || - ( !objPix.isNull() && ( !itemPix || itemPix->isNull() ) ); - if ( !update && !objPix.isNull() && itemPix && !itemPix->isNull() ) { - int aIconW = objPix.width(); - if( aIconW > 20 ) { - QWMatrix aM; - double aScale = 20.0 / aIconW; - aM.scale( aScale, aScale ); - objPix = objPix.xForm( aM ); - } - update = ( objPix.serialNumber() != itemPix->serialNumber() ); - } + // 2. check pixmap (compare serialNumber()-s) + QPixmap objPix = obj->icon(); + const QPixmap* itemPix = item->pixmap( 0 ); + update = ( objPix.isNull() && ( itemPix && !itemPix->isNull() ) ) || + ( !objPix.isNull() && ( !itemPix || itemPix->isNull() ) ); + if ( !update && !objPix.isNull() && itemPix && !itemPix->isNull() ) { + int aIconW = objPix.width(); + if( aIconW > 20 ) { + QWMatrix aM; + double aScale = 20.0 / aIconW; + aM.scale( aScale, aScale ); + objPix = objPix.xForm( aM ); + } + update = ( objPix.serialNumber() != itemPix->serialNumber() ); + } }*/ } } @@ -468,9 +468,9 @@ SUIT_TreeModel::~SUIT_TreeModel() { if ( autoDeleteTree() ) { SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); delete myRoot; } @@ -488,20 +488,20 @@ void SUIT_TreeModel::registerColumn( const int group_id, const QString& name, co bool found = false; for( int i=0, n=myColumns.size(); itext( id ); @@ -711,7 +711,7 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const // data background color for the specified column c = obj->color( SUIT_DataObject::Background, id ); if( !c.isValid() ) // default value - c = QApplication::palette().color( QPalette::Base ); + c = QApplication::palette().color( QPalette::Base ); c.setAlpha( 0 ); val = c; break; @@ -719,42 +719,42 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const // data foreground (text) color for the specified column c = obj->color( SUIT_DataObject::Foreground, id ); if( !c.isValid() ) // default value - c = QApplication::palette().color( QPalette::Foreground ); + c = QApplication::palette().color( QPalette::Foreground ); val = c; break; case BaseColorRole: // editor background color for the specified column c = obj->color( SUIT_DataObject::Base, id ); if( !c.isValid() ) // default value - c = QApplication::palette().color( QPalette::Base ); + c = QApplication::palette().color( QPalette::Base ); val = c; break; case TextColorRole: // editor foreground (text) color for the specified column c = obj->color( SUIT_DataObject::Text, id ); if( !c.isValid() ) // default value - c = QApplication::palette().color( QPalette::Text ); + c = QApplication::palette().color( QPalette::Text ); val = c; break; case HighlightRole: // adta object highlighted background color for the specified column c = obj->color( SUIT_DataObject::Highlight, id ); if( !c.isValid() ) // default value - c = QApplication::palette().color( QPalette::Highlight ); + c = QApplication::palette().color( QPalette::Highlight ); val = c; break; case HighlightedTextRole: // data object highlighted foreground (text) color for the specified column c = obj->color( SUIT_DataObject::HighlightedText, id ); if( !c.isValid() ) // default value - c = QApplication::palette().color( QPalette::HighlightedText ); + c = QApplication::palette().color( QPalette::HighlightedText ); val = c; break; case CheckStateRole: // data object checked state for the specified column // NOTE! three-state check is not supported currently if( obj->isCheckable( id ) ) - val = obj->isOn( id ) ? Qt::Checked : Qt::Unchecked; + val = obj->isOn( id ) ? Qt::Checked : Qt::Unchecked; break; case SizeHintRole: // data size hint @@ -776,7 +776,7 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const \sa data() */ bool SUIT_TreeModel::setData( const QModelIndex& index, - const QVariant& value, int role ) + const QVariant& value, int role ) { if ( index.isValid() && value.isValid() ) { SUIT_DataObject* obj = object( index ); @@ -784,15 +784,15 @@ bool SUIT_TreeModel::setData( const QModelIndex& index, // NOTE! only 'check state' data is supported by default switch ( role ) { case CheckStateRole: - // checked state - if ( obj->isCheckable( index.column() ) ) { - obj->setOn( value.toBool(), index.column() ); - emit( dataChanged( index, index ) ); - return true; - } - break; + // checked state + if ( obj->isCheckable( index.column() ) ) { + obj->setOn( value.toBool(), index.column() ); + emit( dataChanged( index, index ) ); + return true; + } + break; default: - break; + break; } } } @@ -842,7 +842,7 @@ QVariant SUIT_TreeModel::headerData( int column, Qt::Orientation orientation, in if ( root() && orientation == Qt::Horizontal ) { switch ( role ) - { + { case DisplayRole: // column title d = myColumns[column].myName; @@ -870,7 +870,7 @@ QVariant SUIT_TreeModel::headerData( int column, Qt::Orientation orientation, in \return model index */ QModelIndex SUIT_TreeModel::index( int row, int column, - const QModelIndex& parent ) const + const QModelIndex& parent ) const { if( hasIndex( row, column, parent ) ) { @@ -879,7 +879,7 @@ QModelIndex SUIT_TreeModel::index( int row, int column, { TreeItem* childItem = parentItem->child( row ); if( childItem ) - return createIndex( row, column, childItem ); + return createIndex( row, column, childItem ); } } return QModelIndex(); @@ -1006,16 +1006,16 @@ void SUIT_TreeModel::setAutoUpdate( const bool on ) return; SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); myAutoUpdate = on; if ( myAutoUpdate ) { SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); updateTree(); } @@ -1094,8 +1094,8 @@ void SUIT_TreeModel::updateTree( SUIT_DataObject* obj ) return; synchronize( obj, - treeItem( obj ), - SUIT_TreeModel::TreeSync( this ) ); + treeItem( obj ), + SUIT_TreeModel::TreeSync( this ) ); emit modelUpdated(); } @@ -1105,14 +1105,14 @@ void SUIT_TreeModel::updateTree( SUIT_DataObject* obj ) void SUIT_TreeModel::initialize() { SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); if ( autoUpdate() ) { SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ), - this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); + this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) ); } myItems.clear(); // ????? is it really necessary @@ -1182,8 +1182,8 @@ SUIT_DataObject* SUIT_TreeModel::object( const SUIT_TreeModel::TreeItem* item ) \return created tree item or 0 if item could not be created */ SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItem( SUIT_DataObject* obj, - SUIT_TreeModel::TreeItem* parent, - SUIT_TreeModel::TreeItem* after ) + SUIT_TreeModel::TreeItem* parent, + SUIT_TreeModel::TreeItem* after ) { if ( !obj ) return 0; @@ -1647,8 +1647,8 @@ SUIT_ItemDelegate::SUIT_ItemDelegate( QObject* parent ) \param index model index being rendered */ void SUIT_ItemDelegate::paint( QPainter* painter, - const QStyleOptionViewItem& option, - const QModelIndex& index ) const + const QStyleOptionViewItem& option, + const QModelIndex& index ) const { QStyleOptionViewItem opt = option; if ( index.isValid() ) { diff --git a/src/SUIT/SUIT_TreeModel.h b/src/SUIT/SUIT_TreeModel.h index 5c1565ce6..59828481e 100755 --- a/src/SUIT/SUIT_TreeModel.h +++ b/src/SUIT/SUIT_TreeModel.h @@ -173,9 +173,9 @@ private: typedef struct { QString myName; - QMap myIds; - QPixmap myIcon; - Qtx::Appropriate myAppropriate; + QMap myIds; + QPixmap myIcon; + Qtx::Appropriate myAppropriate; } ColumnInfo; @@ -247,8 +247,8 @@ public: SUIT_ItemDelegate( QObject* = 0 ); virtual void paint( QPainter*, const QStyleOptionViewItem&, - const QModelIndex& ) const; - + const QModelIndex& ) const; + virtual QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const; }; diff --git a/src/SUIT/SUIT_TreeSync.h b/src/SUIT/SUIT_TreeSync.h index 1369fde22..d2916992b 100644 --- a/src/SUIT/SUIT_TreeSync.h +++ b/src/SUIT/SUIT_TreeSync.h @@ -54,17 +54,17 @@ TrgItem synchronize( const SrcItem&, const TrgItem&, const TreeData& ); template QList< DiffItem > diffSiblings( const SrcItem&, - const TrgItem&, - const TreeData& ); + const TrgItem&, + const TreeData& ); template TrgItem createSubTree( const SrcItem&, const TrgItem&, const TrgItem&, const TreeData& ); template const typename QList::const_iterator findEqual( const SrcItem& it, - const typename QList::const_iterator& first, - const typename QList::const_iterator& last, - const TreeData& td ); + const typename QList::const_iterator& first, + const typename QList::const_iterator& last, + const TreeData& td ); // @@ -129,24 +129,24 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) for ( ; anIt != aLast; anIt++ ) { const DiffItem& item = *anIt; if ( item.mySrc == td.nullSrc() ) { - if ( item.myTrg == td.nullTrg() ) - qDebug( "error: both null" ); + if ( item.myTrg == td.nullTrg() ) + qDebug( "error: both null" ); else - // delete item - td.deleteItemWithChildren( item.myTrg ); + // delete item + td.deleteItemWithChildren( item.myTrg ); } else { - if ( item.myTrg == td.nullTrg() ) { - // add item (recursively) - TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td ); - if ( nitem != td.nullTrg() ) - lastItem = nitem; - } + if ( item.myTrg == td.nullTrg() ) { + // add item (recursively) + TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td ); + if ( nitem != td.nullTrg() ) + lastItem = nitem; + } else { - // update item - synchronize( item.mySrc, item.myTrg, td ); - lastItem = item.myTrg; - } + // update item + synchronize( item.mySrc, item.myTrg, td ); + lastItem = item.myTrg; + } } } return r2; @@ -177,9 +177,9 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) */ template const typename QList::const_iterator findEqual( const SrcItem& it, - const typename QList::const_iterator& first, - const typename QList::const_iterator& last, - const TreeData& td ) + const typename QList::const_iterator& first, + const typename QList::const_iterator& last, + const TreeData& td ) { typename QList::const_iterator cur = first; for ( ; cur != last; cur++ ) { @@ -199,7 +199,7 @@ const typename QList::const_iterator findEqual( const SrcItem& it, */ template QList< DiffItem > diffSiblings( const SrcItem& src, const TrgItem& trg, - const TreeData& td ) + const TreeData& td ) { //if( src==td.nullSrc() || trg==td.nullTrg() ) // return; @@ -219,10 +219,10 @@ QList< DiffItem > diffSiblings( const SrcItem& src, const TrgIt // target is found // mark all items before found one as "to be deleted" for ( typename QList::const_iterator it = cur; it != f; it++ ) { - DiffItem ndiff; - ndiff.mySrc = td.nullSrc(); - ndiff.myTrg = *it; // delete item - d.append( ndiff ); + DiffItem ndiff; + ndiff.mySrc = td.nullSrc(); + ndiff.myTrg = *it; // delete item + d.append( ndiff ); } cur = f; DiffItem ndiff; @@ -261,7 +261,7 @@ QList< DiffItem > diffSiblings( const SrcItem& src, const TrgIt */ template TrgItem createSubTree( const SrcItem& src, const TrgItem& parent, - const TrgItem& after, const TreeData& td ) + const TrgItem& after, const TreeData& td ) { if ( src == td.nullSrc() ) return td.nullTrg(); diff --git a/src/SUIT/SUIT_ViewModel.h b/src/SUIT/SUIT_ViewModel.h index baff2049e..dbc23627d 100755 --- a/src/SUIT/SUIT_ViewModel.h +++ b/src/SUIT/SUIT_ViewModel.h @@ -44,7 +44,7 @@ class SUIT_ViewManager; */ class SUIT_EXPORT SUIT_ViewModel : public QObject { - Q_OBJECT + Q_OBJECT public: enum HotOperation { PAN, ZOOM, ROTATE, FIT_AREA }; @@ -64,9 +64,9 @@ public: virtual void contextMenuPopup( QMenu* ) {} static void setHotButton( HotOperation theOper, Qt::KeyboardModifier theState, - Qt::MouseButton theButton ); + Qt::MouseButton theButton ); static void getHotButton( HotOperation theOper, Qt::KeyboardModifier& theState, - Qt::MouseButton& theButton ); + Qt::MouseButton& theButton ); protected: SUIT_ViewManager* myViewManager; diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index 8c507dafd..e0d3df793 100755 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -184,11 +184,11 @@ bool SUIT_ViewWindow::event( QEvent* e ) QString fileName = app->getFileName( false, QString(), filter(), tr( "TLT_DUMP_VIEW" ), 0 ); if ( !fileName.isEmpty() ) { - QString fmt = SUIT_Tools::extension( fileName ).toUpper(); - bOk = dumpViewToFormat( im, fileName, fmt ); + QString fmt = SUIT_Tools::extension( fileName ).toUpper(); + bOk = dumpViewToFormat( im, fileName, fmt ); } else - bOk = true; // cancelled + bOk = true; // cancelled } if ( !bOk ) SUIT_MessageBox::critical( this, tr( "ERROR" ), tr( "ERR_CANT_DUMP_VIEW" ) ); diff --git a/src/SUITApp/SUITApp.cxx b/src/SUITApp/SUITApp.cxx index b534f5683..604eff9c5 100644 --- a/src/SUITApp/SUITApp.cxx +++ b/src/SUITApp/SUITApp.cxx @@ -201,9 +201,9 @@ int main( int argc, char* argv[] ) iniFormat = true; else if ( !strcmp( argv[i], "--nosplash") ) noSplash = true; - else if ( !strcmp( argv[i], "--uselicense" ) ) + else if ( !strcmp( argv[i], "--uselicense" ) ) useLicense = true; - else + else argList.append( QString( argv[i] ) ); } @@ -250,31 +250,31 @@ int main( int argc, char* argv[] ) { if ( resMgr ) { - resMgr->loadLanguage( false ); - - splash = QtxSplash::splash( QPixmap() ); - splash->readSettings( resMgr ); - if ( splash->pixmap().isNull() ) { - delete splash; - splash = 0; - } - else { - QString appName = QObject::tr( "APP_NAME" ).trimmed(); - QString appVersion = QObject::tr( "APP_VERSION" ).trimmed(); - if ( appVersion == "APP_VERSION" ) - { - if ( appName == "APP_NAME" || appName.toLower() == "salome" ) - appVersion = salomeVersion(); - else - appVersion = ""; - } - splash->setOption( "%A", appName ); - splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) ); - splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) ); - splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) ); - splash->show(); - QApplication::instance()->processEvents(); - } + resMgr->loadLanguage( false ); + + splash = QtxSplash::splash( QPixmap() ); + splash->readSettings( resMgr ); + if ( splash->pixmap().isNull() ) { + delete splash; + splash = 0; + } + else { + QString appName = QObject::tr( "APP_NAME" ).trimmed(); + QString appVersion = QObject::tr( "APP_VERSION" ).trimmed(); + if ( appVersion == "APP_VERSION" ) + { + if ( appName == "APP_NAME" || appName.toLower() == "salome" ) + appVersion = salomeVersion(); + else + appVersion = ""; + } + splash->setOption( "%A", appName ); + splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) ); + splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) ); + splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) ); + splash->show(); + QApplication::instance()->processEvents(); + } } } @@ -300,13 +300,13 @@ int main( int argc, char* argv[] ) { Style_Salome::initialize( theApp->resourceMgr() ); if ( theApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) ) - Style_Salome::apply(); + Style_Salome::apply(); if ( !noExceptHandling ) app.setHandler( aSession->handler() ); if ( splash ) - splash->finish( theApp->desktop() ); + splash->finish( theApp->desktop() ); result = app.exec(); } diff --git a/src/SUITApp/SUITApp_Application.cxx b/src/SUITApp/SUITApp_Application.cxx index b0c4f9167..073fe0fc3 100644 --- a/src/SUITApp/SUITApp_Application.cxx +++ b/src/SUITApp/SUITApp_Application.cxx @@ -93,7 +93,7 @@ bool SUITApp_Application::notify( QObject* receiver, QEvent* e ) */ void SUITApp_Application::setHandler( SUIT_ExceptionHandler* hand ) { - myExceptHandler = hand; + myExceptHandler = hand; } /*! diff --git a/src/SUITApp/SUITApp_Application.h b/src/SUITApp/SUITApp_Application.h index 4921334d0..89e7e76ab 100644 --- a/src/SUITApp/SUITApp_Application.h +++ b/src/SUITApp/SUITApp_Application.h @@ -54,8 +54,8 @@ public: virtual bool notify( QObject* receiver, QEvent* e ); - SUIT_ExceptionHandler* handler() const; - void setHandler( SUIT_ExceptionHandler* ); + SUIT_ExceptionHandler* handler() const; + void setHandler( SUIT_ExceptionHandler* ); private: SUIT_ExceptionHandler* myExceptHandler; diff --git a/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx b/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx index 2a08d294b..9dd947fdc 100755 --- a/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx +++ b/src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx @@ -111,14 +111,14 @@ void SUPERVGraph_ViewFrame::createActions() // Panning aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ), - tr( "MNU_PAN_VIEW" ), 0, this); + tr( "MNU_PAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_PAN_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan())); myActionsMap[ PanId ] = aAction; // Reset aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ), - tr( "MNU_RESET_VIEW" ), 0, this); + tr( "MNU_RESET_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_RESET_VIEW")); connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset())); myActionsMap[ ResetId ] = aAction; @@ -308,7 +308,7 @@ void SUPERVGraph_ViewFrame::onAdjustTrihedron() \param name - new name */ void SUPERVGraph_ViewFrame::rename( const Handle(SALOME_InteractiveObject)& IObject, - QString newName ) + QString newName ) { // MESSAGE ( "SUPERVGraph_ViewFrame::rename" ) } @@ -329,7 +329,7 @@ void SUPERVGraph_ViewFrame::unHighlightAll() \param update - update current viewer */ void SUPERVGraph_ViewFrame::highlight( const Handle(SALOME_InteractiveObject)& IObject, - bool highlight, bool immediatly ) + bool highlight, bool immediatly ) { // MESSAGE ( "SUPERVGraph_ViewFrame::highlight" ) } diff --git a/src/SUPERVGraph/SUPERVGraph_ViewFrame.h b/src/SUPERVGraph/SUPERVGraph_ViewFrame.h index 8f5dc645c..2bbf9d8d7 100755 --- a/src/SUPERVGraph/SUPERVGraph_ViewFrame.h +++ b/src/SUPERVGraph/SUPERVGraph_ViewFrame.h @@ -79,17 +79,17 @@ class SUPERVGRAPH_EXPORT SUPERVGraph_ViewFrame : public SUIT_ViewWindow { /* interactive object management */ void highlight( const Handle(SALOME_InteractiveObject)& IObject, - bool highlight, bool immediatly = true ); + bool highlight, bool immediatly = true ); void unHighlightAll(); void rename( const Handle(SALOME_InteractiveObject)& IObject, - QString newName ); + QString newName ); bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject ); bool isVisible( const Handle(SALOME_InteractiveObject)& IObject ); /* selection */ Handle(SALOME_InteractiveObject) FindIObject(const char* Entry) { Handle(SALOME_InteractiveObject) o; return o; }; - /* display */ + /* display */ void Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){}; void DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject){}; void Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){}; diff --git a/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx b/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx index cf50f7e26..980eaa137 100644 --- a/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx +++ b/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx @@ -29,8 +29,8 @@ int SUPERVGraph_ViewManager::myMaxId = 0; Constructor */ SUPERVGraph_ViewManager::SUPERVGraph_ViewManager( SUIT_Study* theStudy, - SUIT_Desktop* theDesktop, - SUIT_ViewModel* theViewModel ) + SUIT_Desktop* theDesktop, + SUIT_ViewModel* theViewModel ) : SUIT_ViewManager( theStudy, theDesktop, theViewModel ) { myId = ++myMaxId; diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 07f52de15..b85f7c26f 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -81,8 +81,8 @@ namespace { int GetEdgeId(SALOME_Actor* theActor, - vtkPicker* thePicker, - int theObjId) + vtkPicker* thePicker, + int theObjId) { int anEdgeId = 0; if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) { @@ -90,15 +90,15 @@ namespace thePicker->GetPickPosition(aPickPosition); vtkFloatingPointType aMinDist = 1000000.0, aDist = 0; for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){ - if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){ - int subId; - vtkFloatingPointType pcoords[3], closestPoint[3], weights[3]; - aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights); - if (aDist < aMinDist) { - aMinDist = aDist; - anEdgeId = -1 - i; - } - } + if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){ + int subId; + vtkFloatingPointType pcoords[3], closestPoint[3], weights[3]; + aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights); + if (aDist < aMinDist) { + aMinDist = aDist; + anEdgeId = -1 - i; + } + } } } return anEdgeId; @@ -107,8 +107,8 @@ namespace inline bool CheckDimensionId(Selection_Mode theMode, - SALOME_Actor *theActor, - vtkIdType theObjId) + SALOME_Actor *theActor, + vtkIdType theObjId) { switch(theMode){ case CellSelection: @@ -202,8 +202,8 @@ SALOME_Actor QColor aForegroundColor = aResourceMgr->colorValue( "VTKViewer", "group_names_text_color", Qt::white ); myNameActor->SetForegroundColor(aForegroundColor.redF(), - aForegroundColor.greenF(), - aForegroundColor.blueF()); + aForegroundColor.greenF(), + aForegroundColor.blueF()); vtkFloatingPointType aGroupNamesTransparency = 0.5; aGroupNamesTransparency = aResourceMgr->doubleValue( "VTKViewer", "group_names_transparency", aGroupNamesTransparency ); @@ -257,7 +257,7 @@ void SALOME_Actor ::setName(const char* theName) { - if(hasIO()) + if(hasIO()) myIO->setName(theName); myNameActor->SetText(theName); Superclass::setName(theName); @@ -348,8 +348,8 @@ SALOME_Actor void SALOME_Actor ::SetPosition(vtkFloatingPointType _arg1, - vtkFloatingPointType _arg2, - vtkFloatingPointType _arg3) + vtkFloatingPointType _arg2, + vtkFloatingPointType _arg3) { Superclass::SetPosition(_arg1,_arg2,_arg3); @@ -430,20 +430,20 @@ SALOME_Actor mySelector->GetIndex( getIO(), aMapIndex ); switch( mySelectionMode ){ case NodeSelection: - myHighlightActor->GetProperty()->SetRepresentationToPoints(); - myHighlightActor->MapPoints( this, aMapIndex ); - break; + myHighlightActor->GetProperty()->SetRepresentationToPoints(); + myHighlightActor->MapPoints( this, aMapIndex ); + break; case EdgeOfCellSelection: - myHighlightActor->GetProperty()->SetRepresentationToWireframe(); - myHighlightActor->MapEdge( this, aMapIndex ); - break; + myHighlightActor->GetProperty()->SetRepresentationToWireframe(); + myHighlightActor->MapEdge( this, aMapIndex ); + break; case CellSelection: case EdgeSelection: case FaceSelection: case VolumeSelection: - myHighlightActor->GetProperty()->SetRepresentationToSurface(); - myHighlightActor->MapCells( this, aMapIndex ); - break; + myHighlightActor->GetProperty()->SetRepresentationToSurface(); + myHighlightActor->MapCells( this, aMapIndex ); + break; } myHighlightActor->SetVisibility( GetVisibility() && theIsHighlight ); } @@ -474,8 +474,8 @@ SALOME_Actor bool SALOME_Actor ::PreHighlight(vtkInteractorStyle *theInteractorStyle, - SVTK_SelectionEvent* theSelectionEvent, - bool theIsHighlight) + SVTK_SelectionEvent* theSelectionEvent, + bool theIsHighlight) { if ( !GetPickable() ) return false; @@ -499,8 +499,8 @@ SALOME_Actor theActors->InitTraversal(); while( vtkActor *ac = theActors->GetNextActor() ) if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) - if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) ) - anActor->SetPreSelected( false ); + if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) ) + anActor->SetPreSelected( false ); }else{ switch(aSelectionMode) { @@ -511,21 +511,21 @@ SALOME_Actor int aVtkId = myPointPicker->GetPointId(); if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) { - int anObjId = GetNodeObjId( aVtkId ); - myIsPreselected = (anObjId >= 0); - if(myIsPreselected){ - const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex(); - int anExtent = aMapIndex.Extent(); - anIsChanged |= (anExtent == 0 || anExtent > 0 && anObjId != aMapIndex(1)); - if(anIsChanged){ - TColStd_IndexedMapOfInteger aMapIndex; - aMapIndex.Add( anObjId ); - - myPreHighlightActor->GetProperty()->SetRepresentationToPoints(); - myPreHighlightActor->MapPoints( this, aMapIndex ); - } - myPreHighlightActor->SetVisibility( true ); - } + int anObjId = GetNodeObjId( aVtkId ); + myIsPreselected = (anObjId >= 0); + if(myIsPreselected){ + const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex(); + int anExtent = aMapIndex.Extent(); + anIsChanged |= (anExtent == 0 || anExtent > 0 && anObjId != aMapIndex(1)); + if(anIsChanged){ + TColStd_IndexedMapOfInteger aMapIndex; + aMapIndex.Add( anObjId ); + + myPreHighlightActor->GetProperty()->SetRepresentationToPoints(); + myPreHighlightActor->MapPoints( this, aMapIndex ); + } + myPreHighlightActor->SetVisibility( true ); + } } break; } @@ -539,23 +539,23 @@ SALOME_Actor int aVtkId = myCellPicker->GetCellId(); if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) && hasIO() ) { - int anObjId = GetElemObjId (aVtkId ); - if ( anObjId >= 0 ) { - myIsPreselected = CheckDimensionId(aSelectionMode,this,anObjId); - if(myIsPreselected){ - const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex(); - int anExtent = aMapIndex.Extent(); - anIsChanged |= (anExtent == 0 || anExtent > 0 && anObjId != aMapIndex(1)); - if(anIsChanged){ - TColStd_IndexedMapOfInteger aMapIndex; - aMapIndex.Add( anObjId ); - - myPreHighlightActor->GetProperty()->SetRepresentationToSurface(); - myPreHighlightActor->MapCells( this, aMapIndex ); - } - myPreHighlightActor->SetVisibility( true ); - } - } + int anObjId = GetElemObjId (aVtkId ); + if ( anObjId >= 0 ) { + myIsPreselected = CheckDimensionId(aSelectionMode,this,anObjId); + if(myIsPreselected){ + const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex(); + int anExtent = aMapIndex.Extent(); + anIsChanged |= (anExtent == 0 || anExtent > 0 && anObjId != aMapIndex(1)); + if(anIsChanged){ + TColStd_IndexedMapOfInteger aMapIndex; + aMapIndex.Add( anObjId ); + + myPreHighlightActor->GetProperty()->SetRepresentationToSurface(); + myPreHighlightActor->MapCells( this, aMapIndex ); + } + myPreHighlightActor->SetVisibility( true ); + } + } } break; } @@ -566,43 +566,43 @@ SALOME_Actor int aVtkId = myCellPicker->GetCellId(); if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId )) { - int anObjId = GetElemObjId( aVtkId ); - if ( anObjId >= 0 ) { - int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId); - myIsPreselected = anEdgeId < 0; - if(myIsPreselected){ - const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex(); - int anExtent = aMapIndex.Extent(); - anIsChanged |= (anExtent == 0 || anExtent == 1); - anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2))); - if(anIsChanged){ - TColStd_IndexedMapOfInteger aMapIndex; - aMapIndex.Add( anObjId ); - aMapIndex.Add( anEdgeId ); - - myPreHighlightActor->GetProperty()->SetRepresentationToWireframe(); - myPreHighlightActor->MapEdge( this, aMapIndex ); - } - myPreHighlightActor->SetVisibility( true ); - } - } + int anObjId = GetElemObjId( aVtkId ); + if ( anObjId >= 0 ) { + int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId); + myIsPreselected = anEdgeId < 0; + if(myIsPreselected){ + const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex(); + int anExtent = aMapIndex.Extent(); + anIsChanged |= (anExtent == 0 || anExtent == 1); + anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2))); + if(anIsChanged){ + TColStd_IndexedMapOfInteger aMapIndex; + aMapIndex.Add( anObjId ); + aMapIndex.Add( anEdgeId ); + + myPreHighlightActor->GetProperty()->SetRepresentationToWireframe(); + myPreHighlightActor->MapEdge( this, aMapIndex ); + } + myPreHighlightActor->SetVisibility( true ); + } + } } break; } case ActorSelection : { if( !mySelector->IsSelected( myIO ) ) { - SetPreSelected( true ); - - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); - vtkActorCollection* theActors = aCopy.GetActors(); - theActors->InitTraversal(); - while( vtkActor *anAct = theActors->GetNextActor() ) { - if( anAct != this ) - if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) ) - if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) ) - anActor->SetPreSelected( true ); - } + SetPreSelected( true ); + + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + vtkActorCollection* theActors = aCopy.GetActors(); + theActors->InitTraversal(); + while( vtkActor *anAct = theActors->GetNextActor() ) { + if( anAct != this ) + if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) ) + if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) ) + anActor->SetPreSelected( true ); + } } } default: @@ -622,8 +622,8 @@ SALOME_Actor bool SALOME_Actor ::Highlight(vtkInteractorStyle *theInteractorStyle, - SVTK_SelectionEvent* theSelectionEvent, - bool theIsHighlight) + SVTK_SelectionEvent* theSelectionEvent, + bool theIsHighlight) { if ( !GetPickable() || !mySelector ) return false; @@ -654,11 +654,11 @@ SALOME_Actor int aVtkId = myPointPicker->GetPointId(); if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) { - int anObjId = GetNodeObjId( aVtkId ); - if( anObjId >= 0 ) { - mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift ); - mySelector->AddIObject( this ); - } + int anObjId = GetNodeObjId( aVtkId ); + if( anObjId >= 0 ) { + mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift ); + mySelector->AddIObject( this ); + } } break; } @@ -672,13 +672,13 @@ SALOME_Actor int aVtkId = myCellPicker->GetCellId(); if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) { - int anObjId = GetElemObjId( aVtkId ); - if( anObjId >= 0 ) { - if ( CheckDimensionId(aSelectionMode,this,anObjId) ) { - mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift ); - mySelector->AddIObject( this ); - } - } + int anObjId = GetElemObjId( aVtkId ); + if( anObjId >= 0 ) { + if ( CheckDimensionId(aSelectionMode,this,anObjId) ) { + mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift ); + mySelector->AddIObject( this ); + } + } } break; } @@ -689,24 +689,24 @@ SALOME_Actor int aVtkId = myCellPicker->GetCellId(); if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) { - int anObjId = GetElemObjId( aVtkId ); - if( anObjId >= 0 ) { - int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId); - if( anEdgeId < 0 ) { - mySelector->AddOrRemoveIndex( myIO, anObjId, false ); - mySelector->AddOrRemoveIndex( myIO, anEdgeId, true ); - mySelector->AddIObject( this ); - } - } + int anObjId = GetElemObjId( aVtkId ); + if( anObjId >= 0 ) { + int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId); + if( anEdgeId < 0 ) { + mySelector->AddOrRemoveIndex( myIO, anObjId, false ); + mySelector->AddOrRemoveIndex( myIO, anEdgeId, true ); + mySelector->AddIObject( this ); + } + } } break; } case ActorSelection : { if( mySelector->IsSelected( myIO ) && anIsShift ) - mySelector->RemoveIObject( this ); + mySelector->RemoveIObject( this ); else { - mySelector->AddIObject( this ); + mySelector->AddIObject( this ); } break; } @@ -735,24 +735,24 @@ SALOME_Actor SVTK_RectPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this); TColStd_MapOfInteger anIndexes; if(aMapIter != aVectorIdsMap.end()){ - const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second; - vtkIdType anEnd = aVectorIds.size(); - for(vtkIdType anId = 0; anId < anEnd; anId++ ) { - int aPointId = aVectorIds[anId]; - if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) { - int anObjId = GetNodeObjId( aPointId ); - anIndexes.Add( anObjId ); - } - } + const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second; + vtkIdType anEnd = aVectorIds.size(); + for(vtkIdType anId = 0; anId < anEnd; anId++ ) { + int aPointId = aVectorIds[anId]; + if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) { + int anObjId = GetNodeObjId( aPointId ); + anIndexes.Add( anObjId ); + } + } } if( !anIndexes.IsEmpty() ) { - mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift ); - mySelector->AddIObject( this ); - anIndexes.Clear(); + mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift ); + mySelector->AddIObject( this ); + anIndexes.Clear(); } else - mySelector->RemoveIObject( this ); + mySelector->RemoveIObject( this ); break; } @@ -763,22 +763,22 @@ SALOME_Actor bool anIsPicked = true; for( int i = 0; i <= 1; i++ ) { - for( int j = 2; j <= 3; j++ ) { - for( int k = 4; k <= 5; k++ ) { - aRenderer->SetWorldPoint( aBounds[ i ], aBounds[ j ], aBounds[ k ], 1.0 ); - aRenderer->WorldToDisplay(); - aRenderer->GetDisplayPoint( aPnt ); - - if( aPnt[0] < x1 || aPnt[0] > x2 || aPnt[1] < y1 || aPnt[1] > y2 ) { - anIsPicked = false; - break; - } - } - } + for( int j = 2; j <= 3; j++ ) { + for( int k = 4; k <= 5; k++ ) { + aRenderer->SetWorldPoint( aBounds[ i ], aBounds[ j ], aBounds[ k ], 1.0 ); + aRenderer->WorldToDisplay(); + aRenderer->GetDisplayPoint( aPnt ); + + if( aPnt[0] < x1 || aPnt[0] > x2 || aPnt[1] < y1 || aPnt[1] > y2 ) { + anIsPicked = false; + break; + } + } + } } if( anIsPicked ) - mySelector->AddIObject(this); + mySelector->AddIObject(this); break; } @@ -794,27 +794,27 @@ SALOME_Actor SVTK_RectPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this); TColStd_MapOfInteger anIndexes; if(aMapIter != aVectorIdsMap.end()){ - const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second; - vtkIdType anEnd = aVectorIds.size(); - for(vtkIdType anId = 0; anId < anEnd; anId++ ) { - int aCellId = aVectorIds[anId]; - if ( !mySelector->IsValid( this, aCellId ) ) - continue; - - int anObjId = GetElemObjId( aCellId ); - if( anObjId != -1 ) - if ( CheckDimensionId(aSelectionMode,this,anObjId) ) { - anIndexes.Add(anObjId); - } - } + const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second; + vtkIdType anEnd = aVectorIds.size(); + for(vtkIdType anId = 0; anId < anEnd; anId++ ) { + int aCellId = aVectorIds[anId]; + if ( !mySelector->IsValid( this, aCellId ) ) + continue; + + int anObjId = GetElemObjId( aCellId ); + if( anObjId != -1 ) + if ( CheckDimensionId(aSelectionMode,this,anObjId) ) { + anIndexes.Add(anObjId); + } + } } if( !anIndexes.IsEmpty() ) { - mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift ); - mySelector->AddIObject( this ); - anIndexes.Clear(); + mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift ); + mySelector->AddIObject( this ); + anIndexes.Clear(); } else - mySelector->RemoveIObject( this ); + mySelector->RemoveIObject( this ); } default: break; @@ -901,17 +901,17 @@ SALOME_Actor { if( SALOME_Actor* anActor = dynamic_cast( aCollection->GetItemAsObject( anIndex ) ) ) { - if( anActor->IsDisplayNameActor() ) - { - anActor->SetNameActorOffset( anOffset ); - if( anActor->GetVisibility() ) - { - int aSize[2]; - anActor->GetNameActorSize( aRenderer, aSize ); - anOffset[0] = anOffset[0] + aSize[0]; - anOffset[1] = anOffset[1] + aSize[1]; - } - } + if( anActor->IsDisplayNameActor() ) + { + anActor->SetNameActorOffset( anOffset ); + if( anActor->GetVisibility() ) + { + int aSize[2]; + anActor->GetNameActorSize( aRenderer, aSize ); + anOffset[0] = anOffset[0] + aSize[0]; + anOffset[1] = anOffset[1] + aSize[1]; + } + } } } } diff --git a/src/SVTK/SALOME_Actor.h b/src/SVTK/SALOME_Actor.h index 1f458732d..a9081a208 100644 --- a/src/SVTK/SALOME_Actor.h +++ b/src/SVTK/SALOME_Actor.h @@ -106,8 +106,8 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor virtual void SetPosition(vtkFloatingPointType _arg1, - vtkFloatingPointType _arg2, - vtkFloatingPointType _arg3); + vtkFloatingPointType _arg2, + vtkFloatingPointType _arg3); //! Apply additional position virtual @@ -172,15 +172,15 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor virtual bool PreHighlight(vtkInteractorStyle* theInteractorStyle, - SVTK_SelectionEvent* theSelectionEvent, - bool theIsHighlight); + SVTK_SelectionEvent* theSelectionEvent, + bool theIsHighlight); //! To process highlight (called from #SVTK_InteractorStyle) virtual bool Highlight(vtkInteractorStyle* theInteractorStyle, - SVTK_SelectionEvent* theSelectionEvent, - bool theIsHighlight); + SVTK_SelectionEvent* theSelectionEvent, + bool theIsHighlight); //---------------------------------------------------------------------------- //! To get flag of displaying of name actor diff --git a/src/SVTK/SVTK_Actor.cxx b/src/SVTK/SVTK_Actor.cxx index 220b8e450..81577cba9 100644 --- a/src/SVTK/SVTK_Actor.cxx +++ b/src/SVTK/SVTK_Actor.cxx @@ -112,7 +112,7 @@ SVTK_Actor void SVTK_Actor ::MapCells(SALOME_Actor* theMapActor, - const TColStd_IndexedMapOfInteger& theMapIndex) + const TColStd_IndexedMapOfInteger& theMapIndex) { myUnstructuredGrid->Initialize(); myUnstructuredGrid->Allocate(); @@ -139,7 +139,7 @@ SVTK_Actor void SVTK_Actor ::MapPoints(SALOME_Actor* theMapActor, - const TColStd_IndexedMapOfInteger& theMapIndex) + const TColStd_IndexedMapOfInteger& theMapIndex) { myUnstructuredGrid->Initialize(); myUnstructuredGrid->Allocate(); @@ -150,10 +150,10 @@ SVTK_Actor for(vtkIdType i = 0; i < aNbOfParts; i++){ int aPartId = theMapIndex( i+1 ); if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){ - aPoints->SetPoint(i,aCoord); - // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK - // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON - myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i); + aPoints->SetPoint(i,aCoord); + // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK + // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON + myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i); } } myUnstructuredGrid->SetPoints(aPoints); @@ -168,7 +168,7 @@ SVTK_Actor void SVTK_Actor ::MapEdge(SALOME_Actor* theMapActor, - const TColStd_IndexedMapOfInteger& theMapIndex) + const TColStd_IndexedMapOfInteger& theMapIndex) { myUnstructuredGrid->Initialize(); myUnstructuredGrid->Allocate(); @@ -183,14 +183,14 @@ SVTK_Actor if(aCellId > 0){ if(vtkCell* aCell = theMapActor->GetElemCell(aCellId)){ - if(anEdgeId < 0){ - anEdgeId = -anEdgeId - 1; - int aNbOfEdges = aCell->GetNumberOfEdges(); - if(0 <= anEdgeId || anEdgeId < aNbOfEdges){ - if(vtkCell* anEdge = aCell->GetEdge(anEdgeId)) - myUnstructuredGrid->InsertNextCell(VTK_LINE,anEdge->GetPointIds()); - } - } + if(anEdgeId < 0){ + anEdgeId = -anEdgeId - 1; + int aNbOfEdges = aCell->GetNumberOfEdges(); + if(0 <= anEdgeId || anEdgeId < aNbOfEdges){ + if(vtkCell* anEdge = aCell->GetEdge(anEdgeId)) + myUnstructuredGrid->InsertNextCell(VTK_LINE,anEdge->GetPointIds()); + } + } } } } diff --git a/src/SVTK/SVTK_Actor.h b/src/SVTK/SVTK_Actor.h index eda8e2e3a..164e10a2b 100644 --- a/src/SVTK/SVTK_Actor.h +++ b/src/SVTK/SVTK_Actor.h @@ -63,17 +63,17 @@ public: //! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes void MapCells(SALOME_Actor* theMapActor, - const TColStd_IndexedMapOfInteger& theMapIndex); + const TColStd_IndexedMapOfInteger& theMapIndex); //! Allow to recostruct selected points from source SALOME_Actor and map of subindexes void MapPoints(SALOME_Actor* theMapActor, - const TColStd_IndexedMapOfInteger& theMapIndex); + const TColStd_IndexedMapOfInteger& theMapIndex); //! Allow to recostruct selected edges from source SALOME_Actor and map of subindexes void MapEdge(SALOME_Actor* theMapActor, - const TColStd_IndexedMapOfInteger& theMapIndex); + const TColStd_IndexedMapOfInteger& theMapIndex); const TColStd_IndexedMapOfInteger& GetMapIndex() const; diff --git a/src/SVTK/SVTK_CubeAxesActor2D.cxx b/src/SVTK/SVTK_CubeAxesActor2D.cxx index 51c1e956e..2a02bdd99 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.cxx +++ b/src/SVTK/SVTK_CubeAxesActor2D.cxx @@ -194,10 +194,10 @@ int SVTK_CubeAxesActor2D::RenderOverlay(vtkViewport *viewport) } static void ChangeValues(vtkFloatingPointType* aArray1, - vtkFloatingPointType* aArray2, - vtkFloatingPointType *aRange1, - vtkFloatingPointType* aRange2, - bool theY) + vtkFloatingPointType* aArray2, + vtkFloatingPointType *aRange1, + vtkFloatingPointType* aRange2, + bool theY) { vtkFloatingPointType tmp=-1000; if (!theY){ @@ -220,14 +220,14 @@ static void ChangeValues(vtkFloatingPointType* aArray1, } static void ChangeArrays(vtkFloatingPointType* xCoords, - vtkFloatingPointType* yCoords, - vtkFloatingPointType* zCoords, - vtkFloatingPointType* xRange, - vtkFloatingPointType* yRange, - vtkFloatingPointType* zRange, - const int xAxes, - const int yAxes, - const int zAxes) + vtkFloatingPointType* yCoords, + vtkFloatingPointType* zCoords, + vtkFloatingPointType* xRange, + vtkFloatingPointType* yRange, + vtkFloatingPointType* zRange, + const int xAxes, + const int yAxes, + const int zAxes) { if ( xAxes == 0 && yAxes == 2 && zAxes == 1) ChangeValues(yCoords,zCoords,yRange,zRange,true); @@ -417,8 +417,8 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) // if xAxes=0 yAxes=1 zAxes=2 - good situation if (!(xAxes == 0 && yAxes == 1 && zAxes == 2)) ChangeArrays(xCoords,yCoords,zCoords, - xRange,yRange,zRange, - xAxes,yAxes,zAxes); + xRange,yRange,zRange, + xAxes,yAxes,zAxes); double aTScale[3]; if(m_Transform.GetPointer() != NULL) diff --git a/src/SVTK/SVTK_CubeAxesDlg.cxx b/src/SVTK/SVTK_CubeAxesDlg.cxx index bcf79ef49..03c821dc7 100644 --- a/src/SVTK/SVTK_CubeAxesDlg.cxx +++ b/src/SVTK/SVTK_CubeAxesDlg.cxx @@ -213,10 +213,10 @@ void SVTK_CubeAxesDlg::AxisWidget::SetName(const QString& theName) } void SVTK_CubeAxesDlg::AxisWidget::SetNameFont(const QColor& theColor, - const int theFont, - const bool theIsBold, - const bool theIsItalic, - const bool theIsShadow) + const int theFont, + const bool theIsBold, + const bool theIsItalic, + const bool theIsShadow) { myNameFont->SetData(theColor, theFont, theIsBold, theIsItalic, theIsShadow); } @@ -375,11 +375,11 @@ bool SVTK_CubeAxesDlg::AxisWidget::Apply(vtkAxisActor2D* theActor) Constructor */ SVTK_CubeAxesDlg::SVTK_CubeAxesDlg(QtxAction* theAction, - SVTK_ViewWindow* theParent, - const char* theName): + SVTK_ViewWindow* theParent, + const char* theName): SVTK_DialogBase(theAction, - theParent, - theName), + theParent, + theName), myMainWindow(theParent) { setWindowTitle(tr("CAPTION")); diff --git a/src/SVTK/SVTK_CubeAxesDlg.h b/src/SVTK/SVTK_CubeAxesDlg.h index e481d0b49..9247771a6 100644 --- a/src/SVTK/SVTK_CubeAxesDlg.h +++ b/src/SVTK/SVTK_CubeAxesDlg.h @@ -52,8 +52,8 @@ class SVTK_CubeAxesDlg : public SVTK_DialogBase public: SVTK_CubeAxesDlg(QtxAction* theAction, - SVTK_ViewWindow* theParent, - const char* theName); + SVTK_ViewWindow* theParent, + const char* theName); virtual ~SVTK_CubeAxesDlg(); void Update(); diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index 30e5e8678..a3ce7ecef 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -66,7 +66,7 @@ SVTK_DeviceActor myIsResolveCoincidentTopology = true; vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor, - myPolygonOffsetUnits); + myPolygonOffsetUnits); myMapper = vtkDataSetMapper::New(); @@ -266,7 +266,7 @@ SVTK_DeviceActor int numPts = aDataSet->GetNumberOfPoints(); //It's impossible to use to apply "shrink" for "empty" dataset if (numCells < 1 || numPts < 1) - return; + return; myShrinkFilter->SetInput( aDataSet ); myPassFilter[ 1 ]->SetInput( myShrinkFilter->GetOutput() ); myIsShrunk = true; @@ -400,9 +400,9 @@ SVTK_DeviceActor void SVTK_DeviceActor ::GetFeatureEdgesFlags(bool& theIsFeatureEdges, - bool& theIsBoundaryEdges, - bool& theIsManifoldEdges, - bool& theIsNonManifoldEdges) + bool& theIsBoundaryEdges, + bool& theIsManifoldEdges, + bool& theIsNonManifoldEdges) { theIsFeatureEdges = myFeatureEdges->GetFeatureEdges(); theIsBoundaryEdges = myFeatureEdges->GetBoundaryEdges(); @@ -420,9 +420,9 @@ SVTK_DeviceActor void SVTK_DeviceActor ::SetFeatureEdgesFlags(bool theIsFeatureEdges, - bool theIsBoundaryEdges, - bool theIsManifoldEdges, - bool theIsNonManifoldEdges) + bool theIsBoundaryEdges, + bool theIsManifoldEdges, + bool theIsNonManifoldEdges) { myFeatureEdges->SetFeatureEdges(theIsFeatureEdges); myFeatureEdges->SetBoundaryEdges(theIsBoundaryEdges); @@ -616,7 +616,7 @@ SVTK_DeviceActor vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor, - myPolygonOffsetUnits); + myPolygonOffsetUnits); Superclass::Render(ren,m); vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); @@ -633,7 +633,7 @@ SVTK_DeviceActor void SVTK_DeviceActor ::SetPolygonOffsetParameters(vtkFloatingPointType factor, - vtkFloatingPointType units) + vtkFloatingPointType units) { myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; @@ -646,7 +646,7 @@ SVTK_DeviceActor void SVTK_DeviceActor ::GetPolygonOffsetParameters(vtkFloatingPointType& factor, - vtkFloatingPointType& units) + vtkFloatingPointType& units) { factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; diff --git a/src/SVTK/SVTK_DeviceActor.h b/src/SVTK/SVTK_DeviceActor.h index 18c8cee97..4b7f106c7 100644 --- a/src/SVTK/SVTK_DeviceActor.h +++ b/src/SVTK/SVTK_DeviceActor.h @@ -177,15 +177,15 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor virtual void GetFeatureEdgesFlags(bool& theIsFeatureEdges, - bool& theIsBoundaryEdges, - bool& theIsManifoldEdges, - bool& theIsNonManifoldEdges); + bool& theIsBoundaryEdges, + bool& theIsManifoldEdges, + bool& theIsNonManifoldEdges); virtual void SetFeatureEdgesFlags(bool theIsFeatureEdges, - bool theIsBoundaryEdges, - bool theIsManifoldEdges, - bool theIsNonManifoldEdges); + bool theIsBoundaryEdges, + bool theIsManifoldEdges, + bool theIsNonManifoldEdges); virtual bool @@ -260,9 +260,9 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor vtkFloatingPointType myPolygonOffsetUnits; void SetPolygonOffsetParameters(vtkFloatingPointType factor, - vtkFloatingPointType units); + vtkFloatingPointType units); void GetPolygonOffsetParameters(vtkFloatingPointType& factor, - vtkFloatingPointType& units); + vtkFloatingPointType& units); SVTK_DeviceActor(); ~SVTK_DeviceActor(); diff --git a/src/SVTK/SVTK_DialogBase.cxx b/src/SVTK/SVTK_DialogBase.cxx index faf49c962..33f0560d2 100644 --- a/src/SVTK/SVTK_DialogBase.cxx +++ b/src/SVTK/SVTK_DialogBase.cxx @@ -34,12 +34,12 @@ */ SVTK_DialogBase ::SVTK_DialogBase(QtxAction* theAction, - QWidget* theParent, - const char* theName, - bool theModal, - Qt::WindowFlags theWFalgs): + QWidget* theParent, + const char* theName, + bool theModal, + Qt::WindowFlags theWFalgs): QDialog(theParent, - theWFalgs | Qt::WindowTitleHint | Qt::WindowSystemMenuHint), + theWFalgs | Qt::WindowTitleHint | Qt::WindowSystemMenuHint), myAction(theAction) { setObjectName(theName); diff --git a/src/SVTK/SVTK_DialogBase.h b/src/SVTK/SVTK_DialogBase.h index 815f8ddf3..aef47cd33 100644 --- a/src/SVTK/SVTK_DialogBase.h +++ b/src/SVTK/SVTK_DialogBase.h @@ -40,10 +40,10 @@ class SVTK_EXPORT SVTK_DialogBase : public QDialog public: SVTK_DialogBase(QtxAction* theAction, - QWidget* theParent, - const char* theName = "", - bool theModal = FALSE, - Qt::WindowFlags theWFalgs = 0); + QWidget* theParent, + const char* theName = "", + bool theModal = FALSE, + Qt::WindowFlags theWFalgs = 0); ~SVTK_DialogBase(); diff --git a/src/SVTK/SVTK_FontWidget.cxx b/src/SVTK/SVTK_FontWidget.cxx index 679b8257e..e29ab2b27 100644 --- a/src/SVTK/SVTK_FontWidget.cxx +++ b/src/SVTK/SVTK_FontWidget.cxx @@ -116,10 +116,10 @@ void SVTK_FontWidget::SetData( const QColor& theColor, } void SVTK_FontWidget::GetData( QColor& theColor, - int& theFamily, - bool& theBold, - bool& theItalic, - bool& theShadow ) const + int& theFamily, + bool& theBold, + bool& theItalic, + bool& theShadow ) const { theColor = GetColor(); diff --git a/src/SVTK/SVTK_ImageWriter.cxx b/src/SVTK/SVTK_ImageWriter.cxx index 1d5eb76ff..2a3e1f052 100755 --- a/src/SVTK/SVTK_ImageWriter.cxx +++ b/src/SVTK/SVTK_ImageWriter.cxx @@ -38,10 +38,10 @@ static int MYDEBUG = 0; //---------------------------------------------------------------------------- SVTK_ImageWriter ::SVTK_ImageWriter(QSemaphore* theSemaphore, - vtkImageData* theImageData, - const std::string& theName, - int theProgressive, - int theQuality): + vtkImageData* theImageData, + const std::string& theName, + int theProgressive, + int theQuality): mySemaphore(theSemaphore), myImageData(theImageData), myName(theName), @@ -98,9 +98,9 @@ SVTK_ImageWriter myImageData->Delete(); if(MYDEBUG) cout<<"SVTK_ImageWriter::run "<< - "- this = "<(theClientData)){ if(SVTK_Recorder* aSelf = dynamic_cast(anObj)){ if(theEvent==vtkCommand::EndEvent){ - if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){ - aSelf->DoRecord(); - } + if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){ + aSelf->DoRecord(); + } } } } @@ -322,7 +322,7 @@ SVTK_Recorder inline int GetFrameIndex(double theStartTime, - double theFPS) + double theFPS) { double aTimeNow = vtkTimerLog::GetCurrentTime(); double aDelta = aTimeNow - theStartTime; @@ -350,8 +350,8 @@ SVTK_Recorder myFrameIndexes.back() = abs(myFrameIndexes.back()); double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS; if(MYDEBUG) - cout<<"SVTK_Recorder::DoRecord - aFrameIndex = "<onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); else { - QString platform; + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); } */ } @@ -176,7 +176,7 @@ bool SVTK_RecorderDlg::onBrowseFile() aFilter.append( tr( "FLT_ALL_FILES" ) ); QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter, - tr( "FILE_NAME" ), false ); + tr( "FILE_NAME" ), false ); if( aFileName.isNull() ) return false; diff --git a/src/SVTK/SVTK_RectPicker.cxx b/src/SVTK/SVTK_RectPicker.cxx index 1030e3db3..43fc897e8 100644 --- a/src/SVTK/SVTK_RectPicker.cxx +++ b/src/SVTK/SVTK_RectPicker.cxx @@ -64,11 +64,11 @@ namespace inline int Check(float* theZPtr, - int theSelection[4], - vtkFloatingPointType theTolerance, - vtkFloatingPointType theDZ, - int theDX, - int theDY) + int theSelection[4], + vtkFloatingPointType theTolerance, + vtkFloatingPointType theDZ, + int theDX, + int theDY) { int aRet = 0; vtkFloatingPointType aZ = -1.0; @@ -80,7 +80,7 @@ namespace // the selection window. aZ = GetZ(theZPtr,theSelection,theDX,theDY); if(aZ > theTolerance && aZ < 1.0 - theTolerance){ - aRet = fabs(aZ - theDZ) <= theTolerance; + aRet = fabs(aZ - theDZ) <= theTolerance; } } @@ -92,11 +92,11 @@ namespace //---------------------------------------------------------------------------- void SelectVisiblePoints(int theSelection[4], - vtkRenderer *theRenderer, - vtkDataSet *theInput, - SVTK_RectPicker::TVectorIds& theVisibleIds, - SVTK_RectPicker::TVectorIds& theInVisibleIds, - vtkFloatingPointType theTolerance) + vtkRenderer *theRenderer, + vtkDataSet *theInput, + SVTK_RectPicker::TVectorIds& theVisibleIds, + SVTK_RectPicker::TVectorIds& theInVisibleIds, + vtkFloatingPointType theTolerance) { theVisibleIds.clear(); theInVisibleIds.clear(); @@ -115,7 +115,7 @@ namespace // and handle the transformation ourselves. vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New(); aMatrix->DeepCopy( theRenderer->GetActiveCamera()-> - GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) ); + GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) ); // We grab the z-buffer for the selection region all at once and probe the resulting array. float *aZPtr = theRenderer->GetRenderWindow()-> @@ -132,7 +132,7 @@ namespace for(int iY = theSelection[1]; iY <= theSelection[3]; iY++){ //cout<MultiplyPoint(aX,aView); if(aView[3] == 0.0) - continue; + continue; theRenderer->SetViewPoint(aView[0]/aView[3], - aView[1]/aView[3], - aView[2]/aView[3]); + aView[1]/aView[3], + aView[2]/aView[3]); theRenderer->ViewToDisplay(); vtkFloatingPointType aDX[3]; @@ -158,52 +158,52 @@ namespace if(aDX[0] >= theSelection[0] && aDX[0] <= theSelection[2] && aDX[1] >= theSelection[1] && aDX[1] <= theSelection[3]) { - //cout<<"aPntId "< 0) - goto ADD_VISIBLE; - if(aRet < 0) - goto ADD_INVISIBLE; - - static int aMaxRadius = 5; - for(int aRadius = 1; aRadius < aMaxRadius; aRadius++){ - int aStartDX[2] = {aDX0 - aRadius, aDX1 - aRadius}; - for(int i = 0; i <= aRadius; i++){ - int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]++,aStartDX[1]); - if(aRet > 0) - goto ADD_VISIBLE; - if(aRet < 0) - goto ADD_INVISIBLE; - } - for(int i = 0; i <= aRadius; i++){ - int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]++); - if(aRet > 0) - goto ADD_VISIBLE; - if(aRet < 0) - goto ADD_INVISIBLE; - } - for(int i = 0; i <= aRadius; i++){ - int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]--,aStartDX[1]); - if(aRet > 0) - goto ADD_VISIBLE; - if(aRet < 0) - goto ADD_INVISIBLE; - } - for(int i = 0; i <= aRadius; i++){ - int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]--); - if(aRet > 0) - goto ADD_VISIBLE; - if(aRet < 0) - goto ADD_INVISIBLE; - } - } - if(false) - ADD_VISIBLE : theVisibleIds.push_back(aPntId); - if(false) - ADD_INVISIBLE : theInVisibleIds.push_back(aPntId); + //cout<<"aPntId "< 0) + goto ADD_VISIBLE; + if(aRet < 0) + goto ADD_INVISIBLE; + + static int aMaxRadius = 5; + for(int aRadius = 1; aRadius < aMaxRadius; aRadius++){ + int aStartDX[2] = {aDX0 - aRadius, aDX1 - aRadius}; + for(int i = 0; i <= aRadius; i++){ + int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]++,aStartDX[1]); + if(aRet > 0) + goto ADD_VISIBLE; + if(aRet < 0) + goto ADD_INVISIBLE; + } + for(int i = 0; i <= aRadius; i++){ + int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]++); + if(aRet > 0) + goto ADD_VISIBLE; + if(aRet < 0) + goto ADD_INVISIBLE; + } + for(int i = 0; i <= aRadius; i++){ + int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]--,aStartDX[1]); + if(aRet > 0) + goto ADD_VISIBLE; + if(aRet < 0) + goto ADD_INVISIBLE; + } + for(int i = 0; i <= aRadius; i++){ + int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]--); + if(aRet > 0) + goto ADD_VISIBLE; + if(aRet < 0) + goto ADD_INVISIBLE; + } + } + if(false) + ADD_VISIBLE : theVisibleIds.push_back(aPntId); + if(false) + ADD_INVISIBLE : theInVisibleIds.push_back(aPntId); } }//for all points @@ -218,7 +218,7 @@ namespace inline void GetCenter(const vtkFloatingPointType theBounds[6], - vtkFloatingPointType theCenter[3]) + vtkFloatingPointType theCenter[3]) { theCenter[0] = (theBounds[1] + theBounds[0]) / 2.0; theCenter[1] = (theBounds[3] + theBounds[2]) / 2.0; @@ -227,10 +227,10 @@ namespace void SelectVisibleCells(int theSelection[4], - vtkRenderer *theRenderer, - vtkDataSet *theInput, - SVTK_RectPicker::TVectorIds& theVectorIds, - vtkFloatingPointType theTolerance) + vtkRenderer *theRenderer, + vtkDataSet *theInput, + SVTK_RectPicker::TVectorIds& theVectorIds, + vtkFloatingPointType theTolerance) { theVectorIds.clear(); @@ -243,11 +243,11 @@ namespace SVTK_RectPicker::TVectorIds aVisiblePntIds; SVTK_RectPicker::TVectorIds anInVisiblePntIds; SelectVisiblePoints(theSelection, - theRenderer, - theInput, - aVisiblePntIds, - anInVisiblePntIds, - theTolerance); + theRenderer, + theInput, + aVisiblePntIds, + anInVisiblePntIds, + theTolerance); typedef std::set TIdsSet; TIdsSet aVisibleIds(aVisiblePntIds.begin(),aVisiblePntIds.end()); @@ -260,7 +260,7 @@ namespace // and handle the transformation ourselves. vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New(); aMatrix->DeepCopy(theRenderer->GetActiveCamera()-> - GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) ); + GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) ); for(vtkIdType aCellId = 0; aCellId < aNumCells; aCellId++){ vtkCell* aCell = theInput->GetCell(aCellId); @@ -276,11 +276,11 @@ namespace aMatrix->MultiplyPoint(aX,aView); if(aView[3] == 0.0) - continue; + continue; theRenderer->SetViewPoint(aView[0]/aView[3], - aView[1]/aView[3], - aView[2]/aView[3]); + aView[1]/aView[3], + aView[2]/aView[3]); theRenderer->ViewToDisplay(); vtkFloatingPointType aDX[3]; @@ -291,19 +291,19 @@ namespace aDX[1] >= theSelection[1] && aDX[1] <= theSelection[3]) { - //cout<<"aCellId = "<GetNumberOfPoints(); - bool anIsVisible = true; - for(vtkIdType anId = 0; anId < aNumPts; anId++){ - vtkIdType aPntId = aCell->GetPointId(anId); - //cout<GetNumberOfPoints(); + bool anIsVisible = true; + for(vtkIdType anId = 0; anId < aNumPts; anId++){ + vtkIdType aPntId = aCell->GetPointId(anId); + //cout<GetWorldPoint(); if ( aWorldCoords[3] != 0.0 ) { for (int i=0; i < 3; i++) { - thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3]; + thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3]; } } } @@ -359,8 +359,8 @@ SVTK_RectPicker vtkRenderer *theRenderer) { return Pick(theSelection[0], theSelection[1], theSelection[2], - theSelection2[0], theSelection2[1], theSelection2[2], - theRenderer); + theSelection2[0], theSelection2[1], theSelection2[2], + theRenderer); } int @@ -400,10 +400,10 @@ SVTK_RectPicker // Convert the selection point into world coordinates. // CalculatePickPosition(theRenderer, - theSelectionX, - theSelectionY, - aSelectionZ, - this->PickPosition); + theSelectionX, + theSelectionY, + aSelectionZ, + this->PickPosition); this->SelectionPoint2[0] = theSelectionX2; this->SelectionPoint2[1] = theSelectionY2; @@ -412,10 +412,10 @@ SVTK_RectPicker // Convert the selection point into world coordinates. // CalculatePickPosition(theRenderer, - theSelectionX2, - theSelectionY2, - aSelectionZ, - this->PickPosition2); + theSelectionX2, + theSelectionY2, + aSelectionZ, + this->PickPosition2); // Invoke start pick method if defined this->InvokeEvent(vtkCommand::StartPickEvent,NULL); @@ -436,41 +436,41 @@ SVTK_RectPicker vtkProp *aPropCandidate = aPath->GetLastNode()->GetProp(); if ( aPropCandidate->GetPickable() && aPropCandidate->GetVisibility() ) { anIsPickable = true; - anActor = vtkActor::SafeDownCast(aPropCandidate); - if ( anActor ) { + anActor = vtkActor::SafeDownCast(aPropCandidate); + if ( anActor ) { aMapper = anActor->GetMapper(); if ( anActor->GetProperty()->GetOpacity() <= 0.0 ) - anIsPickable = false; - } + anIsPickable = false; + } } if ( anIsPickable && aMapper && aMapper->GetInput()) { - int aSelectionPoint[4] = {int(theSelectionX), - int(theSelectionY), - int(theSelectionX2), - int(theSelectionY2)}; - if ( this->PickPoints ) { - TVectorIds& aVisibleIds = myPointIdsMap[anActor]; - TVectorIds anInVisibleIds; - SelectVisiblePoints(aSelectionPoint, - theRenderer, - aMapper->GetInput(), - aVisibleIds, - anInVisibleIds, - this->Tolerance); - if ( aVisibleIds.empty() ) { - myPointIdsMap.erase(myPointIdsMap.find(anActor)); - } - } else { - TVectorIds& aVectorIds = myCellIdsMap[anActor]; - SelectVisibleCells(aSelectionPoint, - theRenderer, - aMapper->GetInput(), - aVectorIds, - this->Tolerance); - if ( aVectorIds.empty() ) { - myCellIdsMap.erase(myCellIdsMap.find(anActor)); - } - } + int aSelectionPoint[4] = {int(theSelectionX), + int(theSelectionY), + int(theSelectionX2), + int(theSelectionY2)}; + if ( this->PickPoints ) { + TVectorIds& aVisibleIds = myPointIdsMap[anActor]; + TVectorIds anInVisibleIds; + SelectVisiblePoints(aSelectionPoint, + theRenderer, + aMapper->GetInput(), + aVisibleIds, + anInVisibleIds, + this->Tolerance); + if ( aVisibleIds.empty() ) { + myPointIdsMap.erase(myPointIdsMap.find(anActor)); + } + } else { + TVectorIds& aVectorIds = myCellIdsMap[anActor]; + SelectVisibleCells(aSelectionPoint, + theRenderer, + aMapper->GetInput(), + aVectorIds, + this->Tolerance); + if ( aVectorIds.empty() ) { + myCellIdsMap.erase(myCellIdsMap.find(anActor)); + } + } } } } diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index 01cc85cec..aa77c4d18 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -67,7 +67,7 @@ static bool FOCUS_UNDER_MOUSE = false; */ QVTK_RenderWindowInteractor ::QVTK_RenderWindowInteractor(QWidget* theParent, - const char* theName): + const char* theName): QWidget(theParent), myRenderWindow(vtkRenderWindow::New()) { @@ -221,13 +221,13 @@ QVTK_RenderWindowInteractor aRenderers->InitTraversal(); double aCoeff = 1.0; if(vtkRenderer *aRenderer = aRenderers->GetNextItem()) { - vtkCamera *aCamera = aRenderer->GetActiveCamera(); - double aScale = aCamera->GetParallelScale(); - if((aWidth - width())*(aHeight - height()) > 0) - aCoeff = sqrt(double(aWidth)/double(width())*double(height())/double(aHeight)); - else - aCoeff = double(aWidth)/double(width()); - aCamera->SetParallelScale(aScale*aCoeff); + vtkCamera *aCamera = aRenderer->GetActiveCamera(); + double aScale = aCamera->GetParallelScale(); + if((aWidth - width())*(aHeight - height()) > 0) + aCoeff = sqrt(double(aWidth)/double(width())*double(height())/double(aHeight)); + else + aCoeff = double(aWidth)/double(width()); + aCamera->SetParallelScale(aScale*aCoeff); } } } @@ -253,9 +253,9 @@ QVTK_RenderWindowInteractor ::mouseMoveEvent( QMouseEvent* event ) { GetDevice()->SetEventInformationFlipY(event->x(), - event->y(), - event->modifiers() & Qt::ControlModifier, - event->modifiers() & Qt::ShiftModifier); + event->y(), + event->modifiers() & Qt::ControlModifier, + event->modifiers() & Qt::ShiftModifier); GetDevice()->MouseMoveEvent(); } @@ -268,9 +268,9 @@ QVTK_RenderWindowInteractor ::mousePressEvent( QMouseEvent* event ) { GetDevice()->SetEventInformationFlipY(event->x(), - event->y(), - event->modifiers() & Qt::ControlModifier, - event->modifiers() & Qt::ShiftModifier); + event->y(), + event->modifiers() & Qt::ControlModifier, + event->modifiers() & Qt::ShiftModifier); if( event->button() & Qt::LeftButton ) GetDevice()->LeftButtonPressEvent(); else if( event->button() & Qt::MidButton ) @@ -288,9 +288,9 @@ QVTK_RenderWindowInteractor ::mouseReleaseEvent( QMouseEvent *event ) { GetDevice()->SetEventInformationFlipY(event->x(), - event->y(), - event->modifiers() & Qt::ControlModifier, - event->modifiers() & Qt::ShiftModifier); + event->y(), + event->modifiers() & Qt::ControlModifier, + event->modifiers() & Qt::ShiftModifier); if( event->button() & Qt::LeftButton ) GetDevice()->LeftButtonReleaseEvent(); @@ -330,8 +330,8 @@ QVTK_RenderWindowInteractor ::keyPressEvent( QKeyEvent* event ) { GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier, - event->modifiers() & Qt::ShiftModifier, - event->key()); + event->modifiers() & Qt::ShiftModifier, + event->key()); GetDevice()->KeyPressEvent(); GetDevice()->CharEvent(); } @@ -344,8 +344,8 @@ QVTK_RenderWindowInteractor ::keyReleaseEvent( QKeyEvent * event ) { GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier, - event->modifiers() & Qt::ShiftModifier, - event->key()); + event->modifiers() & Qt::ShiftModifier, + event->key()); GetDevice()->KeyReleaseEvent(); } @@ -448,13 +448,13 @@ QVTK_RenderWindowInteractor switch ( type ) { case SVTK_SpaceMouse::SpaceMouseMove: - GetDevice()->InvokeEvent( SVTK::SpaceMouseMoveEvent, anEvent.data ); - break; + GetDevice()->InvokeEvent( SVTK::SpaceMouseMoveEvent, anEvent.data ); + break; case SVTK_SpaceMouse::SpaceButtonPress: - GetDevice()->InvokeEvent( SVTK::SpaceMouseButtonEvent, &anEvent.button ); - break; + GetDevice()->InvokeEvent( SVTK::SpaceMouseButtonEvent, &anEvent.button ); + break; case SVTK_SpaceMouse::SpaceButtonRelease: - break; + break; } return true; // stop handling the event } @@ -470,7 +470,7 @@ QVTK_RenderWindowInteractor */ SVTK_RenderWindowInteractor ::SVTK_RenderWindowInteractor(QWidget* theParent, - const char* theName): + const char* theName): QVTK_RenderWindowInteractor(theParent,theName), myEventCallbackCommand(vtkCallbackCommand::New()) { @@ -488,8 +488,8 @@ SVTK_RenderWindowInteractor void SVTK_RenderWindowInteractor ::Initialize(vtkGenericRenderWindowInteractor* theDevice, - SVTK_Renderer* theRenderer, - SVTK_Selector* theSelector) + SVTK_Renderer* theRenderer, + SVTK_Selector* theSelector) { QVTK_RenderWindowInteractor::Initialize(theDevice); SetRenderer(theRenderer); @@ -630,8 +630,8 @@ SVTK_RenderWindowInteractor if(mySelector.GetPointer()) mySelector->AddObserver(vtkCommand::EndPickEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); } /*! @@ -640,9 +640,9 @@ SVTK_RenderWindowInteractor void SVTK_RenderWindowInteractor ::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { SVTK_RenderWindowInteractor* self = reinterpret_cast(theClientData); diff --git a/src/SVTK/SVTK_RenderWindowInteractor.h b/src/SVTK/SVTK_RenderWindowInteractor.h index 5f014cf13..b4aabaedc 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.h +++ b/src/SVTK/SVTK_RenderWindowInteractor.h @@ -68,7 +68,7 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget public: QVTK_RenderWindowInteractor(QWidget* theParent, - const char* theName); + const char* theName); ~QVTK_RenderWindowInteractor(); @@ -149,7 +149,7 @@ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteracto public: SVTK_RenderWindowInteractor(QWidget* theParent, - const char* theName); + const char* theName); ~SVTK_RenderWindowInteractor(); @@ -157,8 +157,8 @@ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteracto virtual void Initialize(vtkGenericRenderWindowInteractor* theDevice, - SVTK_Renderer* theRenderer, - SVTK_Selector* theSelector); + SVTK_Renderer* theRenderer, + SVTK_Selector* theSelector); //---------------------------------------------------------------------------- //! To get corresponding SVTK_Renderer instance @@ -238,9 +238,9 @@ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteracto static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); + unsigned long theEvent, + void* theClientData, + void* theCallData); // Used to process VTK events vtkSmartPointer myEventCallbackCommand; diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index d1c7e82e1..c070dec6c 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -144,14 +144,14 @@ SVTK_Renderer myEventCallbackCommand->SetClientData(this); myEventCallbackCommand->SetCallback(SVTK_Renderer::ProcessEvents); GetDevice()->AddObserver(vtkCommand::ConfigureEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); GetDevice()->AddObserver(vtkCommand::ResetCameraEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); GetDevice()->AddObserver(vtkCommand::ResetCameraClippingRangeEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); } /*! @@ -188,9 +188,9 @@ SVTK_Renderer void SVTK_Renderer ::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { SVTK_Renderer* self = reinterpret_cast(theClientData); @@ -223,7 +223,7 @@ SVTK_Renderer void SVTK_Renderer ::Initialize(vtkRenderWindowInteractor* theInteractor, - SVTK_Selector* theSelector) + SVTK_Selector* theSelector) { myInteractor = theInteractor; mySelector = theSelector; @@ -321,7 +321,7 @@ SVTK_Renderer while(vtkActor* anAct = anActors->GetNextActor()) if(SALOME_Actor* anActor = dynamic_cast(anAct)) if(anActor->isHighlighted() && !anActor->IsInfinitive()) - anActor->highlight(true); + anActor->highlight(true); } /*! @@ -330,9 +330,9 @@ SVTK_Renderer void SVTK_Renderer ::SetSelectionProp(const double& theRed, - const double& theGreen, - const double& theBlue, - const int& theWidth) + const double& theGreen, + const double& theBlue, + const int& theWidth) { myHighlightProperty->SetColor( theRed, theGreen, theBlue ); myHighlightProperty->SetLineWidth( theWidth ); @@ -345,9 +345,9 @@ SVTK_Renderer void SVTK_Renderer ::SetPreselectionProp(const double& theRed, - const double& theGreen, - const double& theBlue, - const int& theWidth) + const double& theGreen, + const double& theBlue, + const int& theWidth) { myPreHighlightProperty->SetColor( theRed, theGreen, theBlue ); myPreHighlightProperty->SetLineWidth( theWidth ); @@ -360,8 +360,8 @@ SVTK_Renderer void SVTK_Renderer ::SetSelectionTolerance(const double& theTolNodes, - const double& theTolCell, - const double& theTolObjects) + const double& theTolCell, + const double& theTolObjects) { myPointPicker->SetTolerance( theTolNodes ); myCellPicker->SetTolerance( theTolCell ); @@ -414,8 +414,8 @@ SVTK_Renderer vtkFloatingPointType aSize = myTrihedron->GetSize(); if ( IsTrihedronRelative() ) { - ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize); - myTrihedron->SetSize(aSize); + ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize); + myTrihedron->SetSize(aSize); } else myTrihedron->SetSize( myTrihedronSize ); @@ -426,17 +426,17 @@ SVTK_Renderer anActors->InitTraversal(); while(vtkActor* anAct = anActors->GetNextActor()){ if(SALOME_Actor* anActor = dynamic_cast(anAct)){ - if(anActor->IsResizable()) - anActor->SetSize(0.5*aSize); + if(anActor->IsResizable()) + anActor->SetSize(0.5*aSize); if(anActor->GetVisibility() && !anActor->IsInfinitive()){ - vtkFloatingPointType *aBounds = anActor->GetBounds(); + vtkFloatingPointType *aBounds = anActor->GetBounds(); if(CheckBndBox(aBounds)) - for(int i = 0; i < 5; i = i + 2){ - if(aBounds[i] < aNewBndBox[i]) - aNewBndBox[i] = aBounds[i]; - if(aBounds[i+1] > aNewBndBox[i+1]) - aNewBndBox[i+1] = aBounds[i+1]; - } + for(int i = 0; i < 5; i = i + 2){ + if(aBounds[i] < aNewBndBox[i]) + aNewBndBox[i] = aBounds[i]; + if(aBounds[i+1] > aNewBndBox[i+1]) + aNewBndBox[i+1] = aBounds[i+1]; + } } } } diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index 2d53e263f..b434996df 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -77,7 +77,7 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject virtual void Initialize(vtkRenderWindowInteractor* theInteractor, - SVTK_Selector* theSelector); + SVTK_Selector* theSelector); //---------------------------------------------------------------------------- //! Publishes pointed actor into the renderer @@ -107,22 +107,22 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject //! Applies color and size (PointSize and LineWidth) of primitives in selection mode void SetSelectionProp(const double& theRed = 1, - const double& theGreen = 1, - const double& theBlue = 0, - const int& theWidth = 5); + const double& theGreen = 1, + const double& theBlue = 0, + const int& theWidth = 5); //! Applies color and size (PointSize and LineWidth) of primitives in preselection mode void SetPreselectionProp(const double& theRed = 0, - const double& theGreen = 1, - const double& theBlue = 1, - const int& theWidth = 5); + const double& theGreen = 1, + const double& theBlue = 1, + const int& theWidth = 5); //! Setup requested tolerance for the picking void SetSelectionTolerance(const double& theTolNodes = 0.025, - const double& theTolCell = 0.001, - const double& theTolObjects = 0.025); + const double& theTolCell = 0.001, + const double& theTolObjects = 0.025); //---------------------------------------------------------------------------- //! Adjust all intenal actors (trihedron and graduated rules) to the scene diff --git a/src/SVTK/SVTK_Selector.h b/src/SVTK/SVTK_Selector.h index d6d3bfc50..9ffd5ee77 100644 --- a/src/SVTK/SVTK_Selector.h +++ b/src/SVTK/SVTK_Selector.h @@ -128,40 +128,40 @@ public: virtual void GetIndex( const Handle(SALOME_InteractiveObject)& theIO, - TColStd_IndexedMapOfInteger& theIndex ) = 0; - + TColStd_IndexedMapOfInteger& theIndex ) = 0; + //! Change indices of subselection for given #SALOME_InteractiveObject virtual bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, - const TColStd_IndexedMapOfInteger& theIndices, - bool theIsModeShift) = 0; + const TColStd_IndexedMapOfInteger& theIndices, + bool theIsModeShift) = 0; //! Change indexes of subslection for given #SALOME_InteractiveObject virtual bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, - const TColStd_MapOfInteger& theIndices, - bool theIsModeShift) = 0; + const TColStd_MapOfInteger& theIndices, + bool theIsModeShift) = 0; //! Change index of subslection for given #SALOME_InteractiveObject virtual bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, - int theIndex, - bool theIsModeShift) = 0; + int theIndex, + bool theIsModeShift) = 0; //! Change index of subslection for given #SALOME_InteractiveObject virtual void RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, - int theIndex) = 0; + int theIndex) = 0; //! Check, if the given index is present in subselection virtual bool IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, - int theIndex) const = 0; + int theIndex) const = 0; //! Clear subselection virtual @@ -195,8 +195,8 @@ public: virtual bool IsValid(SALOME_Actor* theActor, - const int theId, - const bool theIsNode = false) const = 0; + const int theId, + const bool theIsNode = false) const = 0; //---------------------------------------------------------------------------- virtual diff --git a/src/SVTK/SVTK_SelectorDef.h b/src/SVTK/SVTK_SelectorDef.h index bbb513c77..bed2189f0 100644 --- a/src/SVTK/SVTK_SelectorDef.h +++ b/src/SVTK/SVTK_SelectorDef.h @@ -107,31 +107,31 @@ public: virtual void GetIndex( const Handle(SALOME_InteractiveObject)& theIO, - TColStd_IndexedMapOfInteger& theIndex ); - + TColStd_IndexedMapOfInteger& theIndex ); + virtual bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, - const TColStd_IndexedMapOfInteger& theIndices, - bool theIsModeShift); + const TColStd_IndexedMapOfInteger& theIndices, + bool theIsModeShift); virtual bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, - const TColStd_MapOfInteger& theIndices, - bool theIsModeShift); + const TColStd_MapOfInteger& theIndices, + bool theIsModeShift); virtual bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, - int theIndex, - bool theIsModeShift); + int theIndex, + bool theIsModeShift); virtual void RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, - int theIndex); + int theIndex); virtual bool IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, - int theIndex) const; + int theIndex) const; virtual void ClearIndex(); @@ -156,8 +156,8 @@ public: virtual bool IsValid(SALOME_Actor* theActor, - const TFilterID theId, - const bool theIsNode = false) const; + const TFilterID theId, + const bool theIsNode = false) const; //---------------------------------------------------------------------------- virtual @@ -184,7 +184,7 @@ private: { bool operator()(const Handle(SALOME_InteractiveObject)& theRightIO, - const Handle(SALOME_InteractiveObject)& theLeftIO) const + const Handle(SALOME_InteractiveObject)& theLeftIO) const { return strcmp(theRightIO->getEntry(),theLeftIO->getEntry()) < 0; } diff --git a/src/SVTK/SVTK_SetRotationPointDlg.cxx b/src/SVTK/SVTK_SetRotationPointDlg.cxx index f7d2fafd3..d8048856a 100755 --- a/src/SVTK/SVTK_SetRotationPointDlg.cxx +++ b/src/SVTK/SVTK_SetRotationPointDlg.cxx @@ -52,11 +52,11 @@ using namespace std; */ SVTK_SetRotationPointDlg ::SVTK_SetRotationPointDlg(QtxAction* theAction, - SVTK_ViewWindow* theParent, - const char* theName): + SVTK_ViewWindow* theParent, + const char* theName): SVTK_DialogBase(theAction, - theParent, - theName), + theParent, + theName), myMainWindow(theParent), myPriority(0.0), myEventCallbackCommand(vtkCallbackCommand::New()), @@ -209,9 +209,9 @@ SVTK_SetRotationPointDlg void SVTK_SetRotationPointDlg ::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* theCallData) + unsigned long theEvent, + void* theClientData, + void* theCallData) { SVTK_SetRotationPointDlg* self = reinterpret_cast(theClientData); vtkFloatingPointType* aCoord = (vtkFloatingPointType*)theCallData; @@ -219,14 +219,14 @@ SVTK_SetRotationPointDlg switch ( theEvent ) { case SVTK::BBCenterChanged: if ( self->myIsBBCenter->isChecked() - || - IsBBEmpty(self->myMainWindow->getRenderer()) ) + || + IsBBEmpty(self->myMainWindow->getRenderer()) ) { if ( aCoord ) { - self->myX->setText( QString::number(aCoord[0]) ); - self->myY->setText( QString::number(aCoord[1]) ); - self->myZ->setText( QString::number(aCoord[2]) ); + self->myX->setText( QString::number(aCoord[0]) ); + self->myY->setText( QString::number(aCoord[1]) ); + self->myZ->setText( QString::number(aCoord[2]) ); } } break; @@ -310,12 +310,12 @@ SVTK_SetRotationPointDlg { if ( !myIsBBCenter->isChecked() ) { if ( mySelectPoint->isChecked() - && - ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) ) + && + ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) ) mySelectPoint->toggle(); vtkFloatingPointType aCenter[3] = {myX->text().toDouble(), - myY->text().toDouble(), - myZ->text().toDouble()}; + myY->text().toDouble(), + myZ->text().toDouble()}; myMainWindow->activateSetRotationSelected((void*)aCenter); } else diff --git a/src/SVTK/SVTK_SetRotationPointDlg.h b/src/SVTK/SVTK_SetRotationPointDlg.h index c1611cbf5..851013448 100755 --- a/src/SVTK/SVTK_SetRotationPointDlg.h +++ b/src/SVTK/SVTK_SetRotationPointDlg.h @@ -53,8 +53,8 @@ class SVTK_EXPORT SVTK_SetRotationPointDlg : public SVTK_DialogBase public: SVTK_SetRotationPointDlg(QtxAction* theAction, - SVTK_ViewWindow* theParent, - const char* theName); + SVTK_ViewWindow* theParent, + const char* theName); ~SVTK_SetRotationPointDlg(); diff --git a/src/SVTK/SVTK_SpaceMouse.cxx b/src/SVTK/SVTK_SpaceMouse.cxx index c8a99ee07..649e33989 100644 --- a/src/SVTK/SVTK_SpaceMouse.cxx +++ b/src/SVTK/SVTK_SpaceMouse.cxx @@ -120,8 +120,8 @@ int SVTK_SpaceMouse::setWindow( Display *display, Window window ) PropReturn = NULL; XGetWindowProperty( display, root, XCommandEvent, 0,1, 0, - AnyPropertyType, &type, &format, &NItems, - &BytesReturn, &PropReturn ); + AnyPropertyType, &type, &format, &NItems, + &BytesReturn, &PropReturn ); win = InputFocus; if ( PropReturn != NULL ) { @@ -172,7 +172,7 @@ int SVTK_SpaceMouse::close(Display *display) Custom event handler */ int SVTK_SpaceMouse::translateEvent( Display* display, XEvent* xEvent, MoveEvent* spaceMouseEvent, - double scale, double rScale ) + double scale, double rScale ) { if ( !spaceMouseOn ) return 0; @@ -181,17 +181,17 @@ int SVTK_SpaceMouse::translateEvent( Display* display, XEvent* xEvent, MoveEvent if ( xEvent->xclient.message_type == XMotionEvent ) { spaceMouseEvent->type = SpaceMouseMove; spaceMouseEvent->data[ x ] = - xEvent->xclient.data.s[2] * scale; + xEvent->xclient.data.s[2] * scale; spaceMouseEvent->data[ y ] = - xEvent->xclient.data.s[3] * scale; + xEvent->xclient.data.s[3] * scale; spaceMouseEvent->data[ z ] = - xEvent->xclient.data.s[4] * scale; + xEvent->xclient.data.s[4] * scale; spaceMouseEvent->data[ a ] = - xEvent->xclient.data.s[5] * rScale; + xEvent->xclient.data.s[5] * rScale; spaceMouseEvent->data[ b ] = - xEvent->xclient.data.s[6] * rScale; + xEvent->xclient.data.s[6] * rScale; spaceMouseEvent->data[ c ] = - xEvent->xclient.data.s[7] * rScale; + xEvent->xclient.data.s[7] * rScale; spaceMouseEvent->period = xEvent->xclient.data.s[8]; return 1; } diff --git a/src/SVTK/SVTK_Trihedron.cxx b/src/SVTK/SVTK_Trihedron.cxx index 65f337b33..f1a5ed8a9 100644 --- a/src/SVTK/SVTK_Trihedron.cxx +++ b/src/SVTK/SVTK_Trihedron.cxx @@ -54,10 +54,10 @@ SVTK_Trihedron if(aProp->GetVisibility()) if(SALOME_Actor* anActor = SALOME_Actor::SafeDownCast(aProp)) { if(!anActor->IsInfinitive()) - aCount++; + aCount++; } else if ( !OwnActor( aProp ) ) { - aCount++; + aCount++; } } return aCount; diff --git a/src/SVTK/SVTK_UpdateRateDlg.cxx b/src/SVTK/SVTK_UpdateRateDlg.cxx index 783b4a495..ae1329ca9 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.cxx +++ b/src/SVTK/SVTK_UpdateRateDlg.cxx @@ -65,10 +65,10 @@ namespace if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){ vtkFloatingPointType aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds(); if(aLastRenderTimeInSeconds > FLOAT_TOLERANCE){ - std::ostringstream aStr; - vtkFloatingPointType aFPS = 1.0 / aLastRenderTimeInSeconds; - aStr<GetVisibility()){ - myVTKMultiplier += theActor->GetAllocatedRenderTime(); - if(dynamic_cast(theActor)) - mySALOMEMultiplier += theActor->GetAllocatedRenderTime(); + myVTKMultiplier += theActor->GetAllocatedRenderTime(); + if(dynamic_cast(theActor)) + mySALOMEMultiplier += theActor->GetAllocatedRenderTime(); } } }; @@ -102,17 +102,17 @@ namespace inline vtkFloatingPointType AdjustUpdateRate(SVTK_RenderWindowInteractor* theRWInteractor, - vtkFloatingPointType theUpdateRate) + vtkFloatingPointType theUpdateRate) { if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); if(vtkActorCollection *anActorCollection = aCopy.GetActors()){ - TRenderTimeMultiplier aMultiplier; - using namespace VTK; - aMultiplier = ForEach(anActorCollection, - aMultiplier); - if(aMultiplier.mySALOMEMultiplier > FLOAT_TOLERANCE) - theUpdateRate *= aMultiplier.mySALOMEMultiplier / aMultiplier.myVTKMultiplier; + TRenderTimeMultiplier aMultiplier; + using namespace VTK; + aMultiplier = ForEach(anActorCollection, + aMultiplier); + if(aMultiplier.mySALOMEMultiplier > FLOAT_TOLERANCE) + theUpdateRate *= aMultiplier.mySALOMEMultiplier / aMultiplier.myVTKMultiplier; } } return theUpdateRate; @@ -131,11 +131,11 @@ namespace operator()(SALOME_Actor* theActor) { if(theActor->GetVisibility()){ - if(vtkMapper *aMapper = theActor->GetMapper()){ - if(vtkDataSet *aDataSet = aMapper->GetInput()){ - myCounter += aDataSet->GetNumberOfCells(); - } - } + if(vtkMapper *aMapper = theActor->GetMapper()){ + if(vtkDataSet *aDataSet = aMapper->GetInput()){ + myCounter += aDataSet->GetNumberOfCells(); + } + } } } }; @@ -149,11 +149,11 @@ namespace if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); if(vtkActorCollection *anActorCollection = aCopy.GetActors()){ - TCellsCounter aCounter; - using namespace VTK; - aCounter = ForEach(anActorCollection, - aCounter); - return QString::number(aCounter.myCounter); + TCellsCounter aCounter; + using namespace VTK; + aCounter = ForEach(anActorCollection, + aCounter); + return QString::number(aCounter.myCounter); } } @@ -166,11 +166,11 @@ namespace */ SVTK_UpdateRateDlg ::SVTK_UpdateRateDlg(QtxAction* theAction, - SVTK_ViewWindow* theParent, - const char* theName): + SVTK_ViewWindow* theParent, + const char* theName): SVTK_DialogBase(theAction, - theParent, - theName), + theParent, + theName), myPriority(0.0), myEventCallbackCommand(vtkCallbackCommand::New()), myRWInteractor(theParent->GetInteractor()), @@ -295,8 +295,8 @@ SVTK_UpdateRateDlg myEventCallbackCommand->SetCallback(SVTK_UpdateRateDlg::ProcessEvents); vtkRenderer *aRenderer = myRWInteractor->getRenderer(); aRenderer->AddObserver(vtkCommand::EndEvent, - myEventCallbackCommand.GetPointer(), - myPriority); + myEventCallbackCommand.GetPointer(), + myPriority); } /*! @@ -314,9 +314,9 @@ SVTK_UpdateRateDlg void SVTK_UpdateRateDlg ::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) { SVTK_UpdateRateDlg* self = reinterpret_cast(theClientData); diff --git a/src/SVTK/SVTK_UpdateRateDlg.h b/src/SVTK/SVTK_UpdateRateDlg.h index 1357b6434..ff2beced5 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.h +++ b/src/SVTK/SVTK_UpdateRateDlg.h @@ -51,8 +51,8 @@ class SVTK_UpdateRateDlg : public SVTK_DialogBase public: SVTK_UpdateRateDlg(QtxAction* theAction, - SVTK_ViewWindow* theParent, - const char* theName); + SVTK_ViewWindow* theParent, + const char* theName); ~SVTK_UpdateRateDlg(); diff --git a/src/SVTK/SVTK_View.h b/src/SVTK/SVTK_View.h index 7f3bf8a64..3535892b0 100644 --- a/src/SVTK/SVTK_View.h +++ b/src/SVTK/SVTK_View.h @@ -125,8 +125,8 @@ public: //! To highlight a VTK presentation with the same #SALOME_InteractiveObject void highlight(const Handle(SALOME_InteractiveObject)& IObject, - bool highlight, - bool immediatly = true); + bool highlight, + bool immediatly = true); //! To unhighlight all VTK presentations void @@ -146,7 +146,7 @@ public: void rename(const Handle(SALOME_InteractiveObject)& IObject, - const QString& newName); + const QString& newName); //---------------------------------------------------------------------------- // Displaymode management @@ -161,7 +161,7 @@ public: //! Switch representation wireframe/shading void SetDisplayMode(const Handle(SALOME_InteractiveObject)& IObject, - int theMode); + int theMode); //! Change all actors to wireframe void @@ -182,7 +182,7 @@ public: //! Change transparency void SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject, - float trans); + float trans); //! Get current transparency float @@ -191,7 +191,7 @@ public: //! Change color void SetColor(const Handle(SALOME_InteractiveObject)& theIObject, - const QColor& theColor); + const QColor& theColor); //! Get current color QColor @@ -214,15 +214,15 @@ public: //! To erase VTK presentation with defined #SALOME_InteractiveObject void Erase(const Handle(SALOME_InteractiveObject)& IObject, - bool immediatly = true); + bool immediatly = true); void Remove(const Handle(SALOME_InteractiveObject)& IObject, - bool immediatly = true); + bool immediatly = true); //! To display VTK presentation with defined #SALOME_InteractiveObject void Display(const Handle(SALOME_InteractiveObject)& IObject, - bool immediatly = true); + bool immediatly = true); //! To display VTK presentation with defined #SALOME_InteractiveObject and erase all anothers void @@ -231,38 +231,38 @@ public: //! To display the VTK presentation void Display(SALOME_Actor* SActor, - bool immediatly = true); + bool immediatly = true); //! To erase the VTK presentation void Erase(SALOME_Actor* SActor, - bool immediatly = true); + bool immediatly = true); //! To remove the VTK presentation void Remove(SALOME_Actor* SActor, - bool updateViewer = true); + bool updateViewer = true); //---------------------------------------------------------------------------- //! Redirect the request to #SVTK_Renderer::SetPreselectionProp void SetSelectionProp(const double& theRed = 1, - const double& theGreen = 1, - const double& theBlue = 0, - const int& theWidth = 5); + const double& theGreen = 1, + const double& theBlue = 0, + const int& theWidth = 5); //! Redirect the request to #SVTK_Renderer::SetPreselectionProp void SetPreselectionProp(const double& theRed = 0, - const double& theGreen = 1, - const double& theBlue = 1, - const int& theWidth = 5); + const double& theGreen = 1, + const double& theBlue = 1, + const int& theWidth = 5); //! Redirect the request to #SVTK_Renderer::SetPreselectionProp void SetSelectionTolerance(const double& theTolNodes = 0.025, - const double& theTolCell = 0.001, - const double& theTolObjects = 0.025); + const double& theTolCell = 0.001, + const double& theTolObjects = 0.025); protected: int myDisplayMode; diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index d772b6d91..3a8f22654 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -111,7 +111,7 @@ void SVTK_Viewer::setBackgroundColor( const QColor& theColor ) for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){ if(TViewWindow* aView = dynamic_cast(aViewWindow)){ - aView->setBackgroundColor(theColor); + aView->setBackgroundColor(theColor); } } } @@ -135,9 +135,9 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop ) aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) ); connect(aViewWindow, SIGNAL( actorAdded(VTKViewer_Actor*) ), - this, SLOT(onActorAdded(VTKViewer_Actor*))); + this, SLOT(onActorAdded(VTKViewer_Actor*))); connect(aViewWindow, SIGNAL( actorRemoved(VTKViewer_Actor*) ), - this, SLOT(onActorRemoved(VTKViewer_Actor*))); + this, SLOT(onActorRemoved(VTKViewer_Actor*))); return aViewWindow; } @@ -173,7 +173,7 @@ void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bo for ( uint i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) - aView->SetTrihedronSize( theSize, theRelative ); + aView->SetTrihedronSize( theSize, theRelative ); } } } @@ -201,8 +201,8 @@ void SVTK_Viewer::setProjectionMode( const int theMode ) QVector aViews = aViewManager->getViews(); for ( uint i = 0; i < aViews.count(); i++ ) { - if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) - aView->SetProjectionMode( theMode ); + if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) + aView->SetProjectionMode( theMode ); } } } @@ -229,7 +229,7 @@ void SVTK_Viewer::setInteractionStyle( const int theStyle ) for ( uint i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) - aView->SetInteractionStyle( theStyle ); + aView->SetInteractionStyle( theStyle ); } } } @@ -265,7 +265,7 @@ void SVTK_Viewer::setIncrementalSpeed( const int theValue, const int theMode ) for ( uint i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) - aView->SetIncrementalSpeed( theValue, theMode ); + aView->SetIncrementalSpeed( theValue, theMode ); } } } @@ -296,7 +296,7 @@ void SVTK_Viewer::setSpacemouseButtons( const int theBtn1, const int theBtn2, co for ( uint i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) - aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 ); + aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 ); } } } @@ -418,31 +418,31 @@ void SVTK_Viewer::Display( const SALOME_VTKPrs* prs ) // _PTR(Study) aStudy(getStudyDS()); anActorCollection->InitTraversal(); while(vtkActor* anActor = anActorCollection->GetNextActor()){ - if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){ - if(!anAct->ShouldBeDisplayed()) - continue; - // Set visibility flag + if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){ + if(!anAct->ShouldBeDisplayed()) + continue; + // Set visibility flag // Temporarily commented to avoid awful dependecy on SALOMEDS // TODO: better mechanism of storing display/erse status in a study // should be provided... - //Handle(SALOME_InteractiveObject) anObj = anAct->getIO(); - //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){ - // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this); - //} - // just display the object - QVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))){ - if(SVTK_View* aView = aViewWindow->getView()){ - aView->Display(anAct,false); - if(anAct->IsSetCamera()){ - vtkRenderer* aRenderer = aView->getRenderer(); - anAct->SetCamera( aRenderer->GetActiveCamera() ); - } - } - } - } - } + //Handle(SALOME_InteractiveObject) anObj = anAct->getIO(); + //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){ + // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this); + //} + // just display the object + QVector aViews = myViewManager->getViews(); + for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ + if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))){ + if(SVTK_View* aView = aViewWindow->getView()){ + aView->Display(anAct,false); + if(anAct->IsSetCamera()){ + vtkRenderer* aRenderer = aView->getRenderer(); + anAct->SetCamera( aRenderer->GetActiveCamera() ); + } + } + } + } + } } } } @@ -467,26 +467,26 @@ void SVTK_Viewer::Erase( const SALOME_VTKPrs* prs, const bool forced ) //_PTR(Study) aStudy(getStudyDS()); anActorCollection->InitTraversal(); while(vtkActor* anActor = anActorCollection->GetNextActor()) - if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){ - // Set visibility flag + if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){ + // Set visibility flag // Temporarily commented to avoid awful dependecy on SALOMEDS // TODO: better mechanism of storing display/erse status in a study // should be provided... - //Handle(SALOME_InteractiveObject) anObj = anAct->getIO(); - //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){ - // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this); - //} - // just display the object - QVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) - if(SVTK_View* aView = aViewWindow->getView()) - if ( forced ) - aView->Remove(anAct,false); - else - aView->Erase(anAct,forced); - } - } + //Handle(SALOME_InteractiveObject) anObj = anAct->getIO(); + //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){ + // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this); + //} + // just display the object + QVector aViews = myViewManager->getViews(); + for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ + if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) + if(SVTK_View* aView = aViewWindow->getView()) + if ( forced ) + aView->Remove(anAct,false); + else + aView->Erase(anAct,forced); + } + } } } } @@ -505,34 +505,34 @@ void SVTK_Viewer::EraseAll( const bool forced ) for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) if(SVTK_View* aView = aViewWindow->getView()){ - vtkRenderer* aRenderer = aView->getRenderer(); - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); - vtkActorCollection* anActorCollection = aCopy.GetActors(); - anActorCollection->InitTraversal(); - while(vtkActor* anActor = anActorCollection->GetNextActor()){ - if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){ - // Set visibility flag + vtkRenderer* aRenderer = aView->getRenderer(); + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + vtkActorCollection* anActorCollection = aCopy.GetActors(); + anActorCollection->InitTraversal(); + while(vtkActor* anActor = anActorCollection->GetNextActor()){ + if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){ + // Set visibility flag // Temporarily commented to avoid awful dependecy on SALOMEDS // TODO: better mechanism of storing display/erse status in a study // should be provided... - //Handle(SALOME_InteractiveObject) anObj = anAct->getIO(); - //if(!anObj.IsNull() && anObj->hasEntry() && aStudy) - // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this); - if(forced) - aRenderer->RemoveActor(anAct); - else{ - // just erase actor - anAct->SetVisibility( false ); - // erase dependent actors - vtkActorCollection* aCollection = vtkActorCollection::New(); - anAct->GetChildActors( aCollection ); - aCollection->InitTraversal(); - while(vtkActor* aSubAct = aCollection->GetNextActor()) - aSubAct->SetVisibility( false ); - aCollection->Delete(); - } - } - } + //Handle(SALOME_InteractiveObject) anObj = anAct->getIO(); + //if(!anObj.IsNull() && anObj->hasEntry() && aStudy) + // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this); + if(forced) + aRenderer->RemoveActor(anAct); + else{ + // just erase actor + anAct->SetVisibility( false ); + // erase dependent actors + vtkActorCollection* aCollection = vtkActorCollection::New(); + anAct->GetChildActors( aCollection ); + aCollection->InitTraversal(); + while(vtkActor* aSubAct = aCollection->GetNextActor()) + aSubAct->SetVisibility( false ); + aCollection->Delete(); + } + } + } } } Repaint(); @@ -548,17 +548,17 @@ SALOME_Prs* SVTK_Viewer::CreatePrs( const char* entry ) if ( entry ) { if(SVTK_ViewWindow* aViewWindow = dynamic_cast(getViewManager()->getActiveView())) if(SVTK_View* aView = aViewWindow->getView()){ - vtkRenderer* aRenderer = aView->getRenderer(); - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); - vtkActorCollection* theActors = aCopy.GetActors(); - theActors->InitTraversal(); - vtkActor* ac; - while( ( ac = theActors->GetNextActor() ) ) { - SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ); - if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) { - prs->AddObject( ac ); - } - } + vtkRenderer* aRenderer = aView->getRenderer(); + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + vtkActorCollection* theActors = aCopy.GetActors(); + theActors->InitTraversal(); + vtkActor* ac; + while( ( ac = theActors->GetNextActor() ) ) { + SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ); + if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) { + prs->AddObject( ac ); + } + } } } return prs; @@ -607,7 +607,7 @@ void SVTK_Viewer::Repaint() for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) if(TViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) if(SVTK_View* aView = aViewWindow->getView()) - aView->Repaint(); + aView->Repaint(); } diff --git a/src/SVTK/SVTK_ViewParameterDlg.cxx b/src/SVTK/SVTK_ViewParameterDlg.cxx index b4c4cabd9..8962fd29a 100755 --- a/src/SVTK/SVTK_ViewParameterDlg.cxx +++ b/src/SVTK/SVTK_ViewParameterDlg.cxx @@ -56,8 +56,8 @@ using namespace std; Constructor */ SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction, - SVTK_ViewWindow* theParent, - const char* theName): + SVTK_ViewWindow* theParent, + const char* theName): SVTK_DialogBase(theAction, theParent, theName), myMainWindow(theParent), myPriority(0.0), @@ -415,9 +415,9 @@ void SVTK_ViewParameterDlg::addObserver() Processes events */ void SVTK_ViewParameterDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* theCallData) + unsigned long theEvent, + void* theClientData, + void* theCallData) { SVTK_ViewParameterDlg* self = reinterpret_cast(theClientData); vtkFloatingPointType* aCoord; @@ -566,8 +566,8 @@ void SVTK_ViewParameterDlg::onFocalCoordChanged() vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera(); aCamera->SetFocalPoint(myFocalX->text().toDouble(), - myFocalY->text().toDouble(), - myFocalZ->text().toDouble()); + myFocalY->text().toDouble(), + myFocalZ->text().toDouble()); aCamera->OrthogonalizeViewUp(); myRWInteractor->getRenderer()->ResetCameraClippingRange(); @@ -586,8 +586,8 @@ void SVTK_ViewParameterDlg::onCameraCoordChanged() vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera(); aCamera->SetPosition(myCameraX->text().toDouble(), - myCameraY->text().toDouble(), - myCameraZ->text().toDouble()); + myCameraY->text().toDouble(), + myCameraZ->text().toDouble()); aCamera->OrthogonalizeViewUp(); myRWInteractor->getRenderer()->ResetCameraClippingRange(); @@ -618,8 +618,8 @@ void SVTK_ViewParameterDlg::onViewDirectionChanged() vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera(); aCamera->SetViewUp(myViewDirX->text().toDouble(), - myViewDirY->text().toDouble(), - myViewDirZ->text().toDouble()); + myViewDirY->text().toDouble(), + myViewDirZ->text().toDouble()); // update view myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST); @@ -716,7 +716,7 @@ void SVTK_ViewParameterDlg::updateCoordinates() // recompute focal point if (computePoint(pos, dir, dist, pnt)) { if (mySelectPoint->isChecked()) - mySelectPoint->toggle(); + mySelectPoint->toggle(); myBusy = true; myFocalX->setText(QString::number(pnt[0])); myFocalY->setText(QString::number(pnt[1])); @@ -728,9 +728,9 @@ void SVTK_ViewParameterDlg::updateCoordinates() } bool SVTK_ViewParameterDlg::computePoint(const double start[3], - const double dir[3], - const double dist, - double result[3]) + const double dir[3], + const double dist, + double result[3]) { double d = sqrt(dir[0]*dir[0]+dir[1]*dir[1]+dir[2]*dir[2]); if ( d < 0.0002 ) return false; diff --git a/src/SVTK/SVTK_ViewParameterDlg.h b/src/SVTK/SVTK_ViewParameterDlg.h index 3a6f3e8b0..8fac8ce35 100755 --- a/src/SVTK/SVTK_ViewParameterDlg.h +++ b/src/SVTK/SVTK_ViewParameterDlg.h @@ -55,8 +55,8 @@ class SVTK_EXPORT SVTK_ViewParameterDlg : public SVTK_DialogBase public: SVTK_ViewParameterDlg(QtxAction* theAction, - SVTK_ViewWindow* theParent, - const char* theName); + SVTK_ViewWindow* theParent, + const char* theName); ~SVTK_ViewParameterDlg(); @@ -106,7 +106,7 @@ protected: void setEnabled(QFrame* theWidget, const bool theState); bool computePoint(const double start[3], const double dir[3], - const double dist, double result[3]); + const double dist, double result[3]); void updateProjection(); void updateCoordinates(); diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index 3a07a757c..c3c0b20b7 100755 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -139,8 +139,8 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow /* interactive object management */ //! Redirect the request to #SVTK_View::highlight (to support old code) virtual void highlight(const Handle(SALOME_InteractiveObject)& theIO, - bool theIsHighlight = true, - bool theIsUpdate = true); + bool theIsHighlight = true, + bool theIsUpdate = true); //! Redirect the request to #SVTK_View::unHighlightAll (to support old code) virtual void unHighlightAll(); @@ -155,18 +155,18 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow //---------------------------------------------------------------------------- Handle(SALOME_InteractiveObject) FindIObject(const char* theEntry); - /* display */ + /* display */ //---------------------------------------------------------------------------- //! Redirect the request to #SVTK_View::Display (to support old code) virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject, - bool theImmediatly = true); + bool theImmediatly = true); //! Redirect the request to #SVTK_View::DisplayOnly (to support old code) virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject); //! Redirect the request to #SVTK_View::Erase (to support old code) virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject, - bool theImmediatly = true); + bool theImmediatly = true); //! Redirect the request to #SVTK_View::DisplayAll (to support old code) virtual void DisplayAll(); @@ -186,11 +186,11 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow //! Redirect the request to #SVTK_Renderer::AddActor virtual void AddActor(VTKViewer_Actor* theActor, - bool theIsUpdate = false); + bool theIsUpdate = false); //! Redirect the request to #SVTK_Renderer::RemoveActor virtual void RemoveActor(VTKViewer_Actor* theActor, - bool theIsUpdate = false); + bool theIsUpdate = false); //---------------------------------------------------------------------------- //! Redirect the request to #SVTK_Renderer::AdjustActors @@ -222,20 +222,20 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow //! Redirect the request to #SVTK_Renderer::SetSelectionProp virtual void SetSelectionProp(const double& theRed = 1, - const double& theGreen = 1, - const double& theBlue = 0, - const int& theWidth = 5); + const double& theGreen = 1, + const double& theBlue = 0, + const int& theWidth = 5); //! Redirect the request to #SVTK_Renderer::SetPreselectionProp virtual void SetPreselectionProp(const double& theRed = 0, - const double& theGreen = 1, - const double& theBlue = 1, - const int& theWidth = 5); + const double& theGreen = 1, + const double& theBlue = 1, + const int& theWidth = 5); //! Redirect the request to #SVTK_Renderer::SetSelectionTolerance virtual void SetSelectionTolerance(const double& theTolNodes = 0.025, - const double& theTolCell = 0.001, - const double& theTolObjects = 0.025); + const double& theTolCell = 0.001, + const double& theTolObjects = 0.025); //! Methods to save/restore visual parameters of a view (pan, zoom, etc.) virtual QString getVisualParameters(); @@ -343,7 +343,7 @@ protected slots: protected: virtual void Initialize(SVTK_View* theView, - SVTK_ViewModelBase* theModel); + SVTK_ViewModelBase* theModel); void doSetVisualParameters( const QString& ); void SetEventDispatcher(vtkObject* theDispatcher); @@ -360,11 +360,11 @@ protected: void createActions(SUIT_ResourceMgr* theResourceMgr); enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, - ChangeRotationPointId, RotationId, + ChangeRotationPointId, RotationId, FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, - ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate, - ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId, - StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId }; + ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate, + ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId, + StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId }; SVTK_View* myView; diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 0888b43ee..573f9e374 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -150,7 +150,7 @@ SalomeApp_Application::SalomeApp_Application() : LightApp_Application() { connect( desktop(), SIGNAL( message( const QString& ) ), - this, SLOT( onDesktopMessage( const QString& ) ) ); + this, SLOT( onDesktopMessage( const QString& ) ) ); setNoteBook(0); } @@ -180,7 +180,7 @@ void SalomeApp_Application::start() for (int i = 1; i < qApp->argc(); i++) { QRegExp rxs ("--study-hdf=(.+)"); if ( rxs.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) { - QString file = rxs.capturedTexts()[1]; + QString file = rxs.capturedTexts()[1]; QFileInfo fi ( file ); QString extension = fi.suffix().toLower(); if ( extension == "hdf" && fi.exists() ) @@ -204,12 +204,12 @@ void SalomeApp_Application::start() if ( pyfiles.count() > 0 && activeStudy() ) { SalomeApp_Study* appStudy = dynamic_cast( activeStudy() ); if ( appStudy ) { - _PTR(Study) aStudy = appStudy->studyDS(); - if ( !aStudy->GetProperties()->IsLocked() ) { + _PTR(Study) aStudy = appStudy->studyDS(); + if ( !aStudy->GetProperties()->IsLocked() ) { for (uint j = 0; j < pyfiles.count(); j++ ) { QFileInfo fi ( pyfiles[j] ); - PyConsole_Console* pyConsole = pythonConsole(); - if ( pyConsole ) { + PyConsole_Console* pyConsole = pythonConsole(); + if ( pyConsole ) { QString extension = fi.suffix().toLower(); if ( fi.exists() ) { // execute python script @@ -219,13 +219,13 @@ void SalomeApp_Application::start() else { // import python module QString command = QString( "import %1" ).arg( pyfiles[j] ); - if ( extension == "py" ) - command = QString( "import %1" ).arg( fi.completeBaseName() ); + if ( extension == "py" ) + command = QString( "import %1" ).arg( fi.completeBaseName() ); pyConsole->exec( command ); } } } - } + } } } } @@ -241,13 +241,13 @@ void SalomeApp_Application::createActions() //! Save GUI state // "Save GUI State" command is moved to VISU module // createAction( SaveGUIStateId, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIcon(), - // tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ), - // 0, desk, false, this, SLOT( onSaveGUIState() ) ); + // tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ), + // 0, desk, false, this, SLOT( onSaveGUIState() ) ); //! Dump study createAction( DumpStudyId, tr( "TOT_DESK_FILE_DUMP_STUDY" ), QIcon(), - tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ), - Qt::CTRL+Qt::Key_D, desk, false, this, SLOT( onDumpStudy() ) ); + tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ), + Qt::CTRL+Qt::Key_D, desk, false, this, SLOT( onDumpStudy() ) ); //! NoteBook createAction(NoteBookId, tr( "TOT_DESK_FILE_NOTEBOOK" ), QIcon(), @@ -256,29 +256,29 @@ void SalomeApp_Application::createActions() //! Load script createAction( LoadScriptId, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), QIcon(), - tr( "MEN_DESK_FILE_LOAD_SCRIPT" ), tr( "PRP_DESK_FILE_LOAD_SCRIPT" ), - Qt::CTRL+Qt::Key_T, desk, false, this, SLOT( onLoadScript() ) ); + tr( "MEN_DESK_FILE_LOAD_SCRIPT" ), tr( "PRP_DESK_FILE_LOAD_SCRIPT" ), + Qt::CTRL+Qt::Key_T, desk, false, this, SLOT( onLoadScript() ) ); //! Properties createAction( PropertiesId, tr( "TOT_DESK_PROPERTIES" ), QIcon(), - tr( "MEN_DESK_PROPERTIES" ), tr( "PRP_DESK_PROPERTIES" ), - Qt::CTRL+Qt::Key_P, desk, false, this, SLOT( onProperties() ) ); + tr( "MEN_DESK_PROPERTIES" ), tr( "PRP_DESK_PROPERTIES" ), + Qt::CTRL+Qt::Key_P, desk, false, this, SLOT( onProperties() ) ); //! Catalog Generator createAction( CatalogGenId, tr( "TOT_DESK_CATALOG_GENERATOR" ), QIcon(), - tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ), - Qt::SHIFT+Qt::Key_G, desk, false, this, SLOT( onCatalogGen() ) ); + tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ), + Qt::SHIFT+Qt::Key_G, desk, false, this, SLOT( onCatalogGen() ) ); //! Registry Display createAction( RegDisplayId, tr( "TOT_DESK_REGISTRY_DISPLAY" ), QIcon(), - tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ), - /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) ); + tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ), + /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) ); //SRN: BugID IPAL9021, add an action "Load" createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ), resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ), - tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ), - Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) ); + tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ), + Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) ); //SRN: BugID IPAL9021: End @@ -342,9 +342,9 @@ void SalomeApp_Application::onLoadDoc() while ( it.hasNext() && !isAlreadyOpen ) { SUIT_Application* aApp = it.next(); if( !aApp || !aApp->activeStudy() ) - continue; + continue; if ( aApp->activeStudy()->studyName() == studyName ) - isAlreadyOpen = true; + isAlreadyOpen = true; } if ( !isAlreadyOpen ) @@ -383,7 +383,7 @@ bool SalomeApp_Application::onLoadDoc( const QString& aName ) bool isAlreadyOpen = false; SalomeApp_Application* aApp = 0; for ( QList::iterator it = aAppList.begin(); - it != aAppList.end() && !isAlreadyOpen; ++it ) { + it != aAppList.end() && !isAlreadyOpen; ++it ) { aApp = dynamic_cast( *it ); if ( aApp && aApp->activeStudy()->studyName() == aName ) isAlreadyOpen = true; @@ -419,8 +419,8 @@ void SalomeApp_Application::onCopy() { _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry()); try { - studyMgr()->Copy(so); - onSelectionChanged(); + studyMgr()->Copy(so); + onSelectionChanged(); } catch(...) { } @@ -442,8 +442,8 @@ void SalomeApp_Application::onPaste() if ( stdDS->GetProperties()->IsLocked() ) { SUIT_MessageBox::warning( desktop(), - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_STUDY_LOCKED") ); + QObject::tr("WRN_WARNING"), + QObject::tr("WRN_STUDY_LOCKED") ); return; } @@ -452,9 +452,9 @@ void SalomeApp_Application::onPaste() { _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry()); try { - studyMgr()->Paste(so); - updateObjectBrowser( true ); - updateActions(); //SRN: BugID IPAL9377, case 3 + studyMgr()->Paste(so); + updateObjectBrowser( true ); + updateActions(); //SRN: BugID IPAL9377, case 3 } catch(...) { } @@ -478,10 +478,10 @@ void SalomeApp_Application::onCloseDoc( bool ask ) _PTR(Study) stdDS = study->studyDS(); if(stdDS && stdDS->IsStudyLocked()) { if ( SUIT_MessageBox::question( desktop(), - QObject::tr( "WRN_WARNING" ), - QObject::tr( "CLOSE_LOCKED_STUDY" ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No, - SUIT_MessageBox::No) == SUIT_MessageBox::No ) return; + QObject::tr( "WRN_WARNING" ), + QObject::tr( "CLOSE_LOCKED_STUDY" ), + SUIT_MessageBox::Yes | SUIT_MessageBox::No, + SUIT_MessageBox::No) == SUIT_MessageBox::No ) return; } } @@ -544,10 +544,10 @@ void SalomeApp_Application::onDeleteInvalidReferences() { _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject; while( aRefObj && aRefObj->ReferencedObject( anObj ) ) - aRefObj = anObj; + aRefObj = anObj; if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() ) - aStudyBuilder->RemoveReference( aSObject ); + aStudyBuilder->RemoveReference( aSObject ); } updateObjectBrowser(); } @@ -672,8 +672,8 @@ bool DumpStudyFileValidator::canSave(const QString& file, bool permissions) QFileInfo fi( file ); if ( !QRegExp( "[A-Za-z_][A-Za-z0-9_]*" ).exactMatch( fi.completeBaseName() ) ) { SUIT_MessageBox::critical( parent(), - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_FILE_NAME_BAD") ); + QObject::tr("WRN_WARNING"), + QObject::tr("WRN_FILE_NAME_BAD") ); return false; } return SUIT_FileValidator::canSave( file, permissions); @@ -705,24 +705,24 @@ void SalomeApp_Application::onDumpStudy( ) if ( !aFileName.isEmpty() ) { QFileInfo aFileInfo(aFileName); if( aFileInfo.isDir() ) // IPAL19257 - return; + return; int savePoint; _PTR(AttributeParameter) ap; _PTR(IParameters) ip = ClientFactory::getIParameters(ap); if(ip->isDumpPython(appStudy->studyDS())) ip->setDumpPython(appStudy->studyDS()); //Unset DumpPython flag. if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method - ip->setDumpPython(appStudy->studyDS()); - savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point + ip->setDumpPython(appStudy->studyDS()); + savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point } bool res = aStudy->DumpStudy( aFileInfo.absolutePath().toStdString(), - aFileInfo.baseName().toStdString(), toPublish); + aFileInfo.baseName().toStdString(), toPublish); if ( toSaveGUI ) - appStudy->removeSavePoint(savePoint); //SRN: remove the created temporary save point. + appStudy->removeSavePoint(savePoint); //SRN: remove the created temporary save point. if ( !res ) - SUIT_MessageBox::warning( desktop(), - QObject::tr("WRN_WARNING"), - tr("WRN_DUMP_STUDY_FAILED") ); + SUIT_MessageBox::warning( desktop(), + QObject::tr("WRN_WARNING"), + tr("WRN_DUMP_STUDY_FAILED") ); } } } @@ -755,8 +755,8 @@ void SalomeApp_Application::onLoadScript( ) if ( aStudy->GetProperties()->IsLocked() ) { SUIT_MessageBox::warning( desktop(), - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_STUDY_LOCKED") ); + QObject::tr("WRN_WARNING"), + QObject::tr("WRN_STUDY_LOCKED") ); return; } @@ -855,9 +855,9 @@ QWidget* SalomeApp_Application::createWindow( const int flag ) // temporary commented /* - ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual ); - ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual ); - ob->resize( desktop()->width()/3, ob->height() ); + ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual ); + ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual ); + ob->resize( desktop()->width()/3, ob->height() ); */ } } @@ -912,11 +912,11 @@ void SalomeApp_Application::updateDesktopTitle() { if ( study ) { _PTR(Study) stdDS = study->studyDS(); if(stdDS) { - if ( stdDS->GetProperties()->IsLocked() ) { - aTitle += QString( " - [%1 (%2)]").arg( sName ).arg( tr( "STUDY_LOCKED" ) ); - } else { - aTitle += QString( " - [%1]" ).arg( sName ); - } + if ( stdDS->GetProperties()->IsLocked() ) { + aTitle += QString( " - [%1 (%2)]").arg( sName ).arg( tr( "STUDY_LOCKED" ) ); + } else { + aTitle += QString( " - [%1]" ).arg( sName ); + } } } } @@ -929,7 +929,7 @@ int SalomeApp_Application::closeChoice( const QString& docName ) { int answer = SUIT_MessageBox::question( desktop(), tr( "APPCLOSE_CAPTION" ), tr( "APPCLOSE_DESCRIPTION" ).arg( docName ), tr ("APPCLOSE_SAVE"), tr ("APPCLOSE_CLOSE"), - tr ("APPCLOSE_UNLOAD"), tr ("APPCLOSE_CANCEL"), 0 ); + tr ("APPCLOSE_UNLOAD"), tr ("APPCLOSE_CANCEL"), 0 ); int res = CloseCancel; if ( answer == 0 ) @@ -985,11 +985,11 @@ int SalomeApp_Application::openChoice( const QString& aName ) if ( exist ) { int answer = SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYEXIST" ).arg( aName ), - SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ); + SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ); if ( answer == SUIT_MessageBox::Yes ) - choice = OpenRefresh; + choice = OpenRefresh; else - choice = OpenCancel; + choice = OpenCancel; } } @@ -1007,8 +1007,8 @@ bool SalomeApp_Application::openAction( const int aChoice, const QString& aName _PTR(Study) aStudy = studyMgr()->GetStudyByName( aName.toStdString() ); if ( aStudy ) { - studyMgr()->Close( aStudy ); - choice = OpenNew; + studyMgr()->Close( aStudy ); + choice = OpenNew; } } default: @@ -1161,10 +1161,10 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePop { _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject; while( aRefObj && aRefObj->ReferencedObject( anObj ) ) - aRefObj = anObj; + aRefObj = anObj; if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() ) - isInvalidRefs = true; + isInvalidRefs = true; } // Add "Delete reference" item to popup @@ -1210,17 +1210,17 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) { for ( _PTR(SComponentIterator) it ( stdDS->NewComponentIterator() ); it->More(); it->Next() ) { - _PTR(SComponent) aComponent ( it->Value() ); + _PTR(SComponent) aComponent ( it->Value() ); - if ( aComponent->ComponentDataType() == "Interface Applicative" ) - continue; // skip the magic "Interface Applicative" component + if ( aComponent->ComponentDataType() == "Interface Applicative" ) + continue; // skip the magic "Interface Applicative" component - if ( !objectBrowser() ) - getWindow( WT_ObjectBrowser ); - const bool isAutoUpdate = objectBrowser()->autoUpdate(); - objectBrowser()->setAutoUpdate( false ); - SalomeApp_DataModel::synchronize( aComponent, study ); - objectBrowser()->setAutoUpdate( isAutoUpdate ); + if ( !objectBrowser() ) + getWindow( WT_ObjectBrowser ); + const bool isAutoUpdate = objectBrowser()->autoUpdate(); + objectBrowser()->setAutoUpdate( false ); + SalomeApp_DataModel::synchronize( aComponent, study ); + objectBrowser()->setAutoUpdate( isAutoUpdate ); } } } @@ -1272,7 +1272,7 @@ void SalomeApp_Application::onDblClick( SUIT_DataObject* theObj ) QModelIndexList aSelectedIndexes = ob->selectedIndexes(); if ( !aSelectedIndexes.isEmpty() ) - ob->treeView()->scrollTo( aSelectedIndexes.first() ); + ob->treeView()->scrollTo( aSelectedIndexes.first() ); } } } diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index 1548ff23b..85bc1e160 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -102,8 +102,8 @@ bool SalomeApp_DataModelSync::isCorrect( const kerPtr& so ) const \param prepend - SUIT object must be added to start of children list */ suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so, - const suitPtr& parent, - const suitPtr& after ) const + const suitPtr& parent, + const suitPtr& after ) const { if( !isCorrect( so ) ) return 0; @@ -150,7 +150,7 @@ bool SalomeApp_DataModelSync::isEqual( const kerPtr& p, const suitPtr& q ) const _PTR( SComponent ) aComp( p ); bool res = ( !p && !q ) || ( lobj && !sobj && aComp ) || - ( sobj && isCorrect( p ) && p->GetID().c_str()==sobj->entry() ); + ( sobj && isCorrect( p ) && p->GetID().c_str()==sobj->entry() ); return res; } @@ -306,8 +306,8 @@ void SalomeApp_DataModel::update( LightApp_DataObject*, LightApp_Study* study ) studyRoot = dynamic_cast( aSStudy->root() ); QString anId = getRootEntry( aSStudy ); if ( !anId.isEmpty() ){ // if nothing is published in the study for this module -> do nothing - _PTR(Study) aStudy ( aSStudy->studyDS() ); - sobj = aStudy->FindComponentID( std::string( anId.toLatin1() ) ); + _PTR(Study) aStudy ( aSStudy->studyDS() ); + sobj = aStudy->FindComponentID( std::string( anId.toLatin1() ) ); } } } diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index 6db6c32ca..dbc07fe66 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -60,7 +60,7 @@ SalomeApp_DataObject::SalomeApp_DataObject( SUIT_DataObject* parent ) \param parent parent data object */ SalomeApp_DataObject::SalomeApp_DataObject( const _PTR(SObject)& sobj, - SUIT_DataObject* parent ) + SUIT_DataObject* parent ) : CAM_DataObject( parent ), LightApp_DataObject( parent ) { @@ -136,7 +136,7 @@ QString SalomeApp_DataObject::text( const int id ) const #endif txt = value( object() ); if ( txt.isEmpty() ) - txt = value( referencedObject() ); + txt = value( referencedObject() ); break; case IORId: txt = ior( referencedObject() ); @@ -165,20 +165,20 @@ QPixmap SalomeApp_DataObject::icon( const int id ) const if ( myObject && myObject->FindAttribute( anAttr, "AttributePixMap" ) ){ _PTR(AttributePixMap) aPixAttr ( anAttr ); if ( aPixAttr->HasPixMap() ) { - QString componentType = componentDataType(); - QString pixmapID = aPixAttr->GetPixMap().c_str(); - // select a plugin within a component - QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts ); - if ( plugin_pixmap.size() == 2 ) { - componentType = plugin_pixmap.front(); - pixmapID = plugin_pixmap.back(); - } - QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() ); - LightApp_RootObject* aRoot = dynamic_cast( root() ); - if ( aRoot && aRoot->study() ) { - SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr(); - return mgr->loadPixmap( componentType, pixmapName, false ); - } + QString componentType = componentDataType(); + QString pixmapID = aPixAttr->GetPixMap().c_str(); + // select a plugin within a component + QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts ); + if ( plugin_pixmap.size() == 2 ) { + componentType = plugin_pixmap.front(); + pixmapID = plugin_pixmap.back(); + } + QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() ); + LightApp_RootObject* aRoot = dynamic_cast( root() ); + if ( aRoot && aRoot->study() ) { + SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr(); + return mgr->loadPixmap( componentType, pixmapName, false ); + } } } } @@ -203,16 +203,16 @@ QColor SalomeApp_DataObject::color( const ColorRole role, const int id ) const // text color (not selected item) if ( isReference() ) { if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) ) - c = QColor( 255, 0, 0 ); // valid reference (red) + c = QColor( 255, 0, 0 ); // valid reference (red) else - c = QColor( 200, 200, 200 ); // invalid reference (grayed) + c = QColor( 200, 200, 200 ); // invalid reference (grayed) } else if ( myObject ) { // get color atrtribute value _PTR(GenericAttribute) anAttr; if ( myObject->FindAttribute( anAttr, "AttributeTextColor" ) ) { - _PTR(AttributeTextColor) aColAttr = anAttr; - c = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B ); + _PTR(AttributeTextColor) aColAttr = anAttr; + c = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B ); } } break; @@ -220,18 +220,18 @@ QColor SalomeApp_DataObject::color( const ColorRole role, const int id ) const // background color for the highlighted item if ( isReference() ) { if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) ) - c = QColor( 255, 0, 0 ); // valid reference (red) + c = QColor( 255, 0, 0 ); // valid reference (red) else - c = QColor( 200, 200, 200 ); // invalid reference (grayed) + c = QColor( 200, 200, 200 ); // invalid reference (grayed) } else if ( myObject ) { // get color atrtribute value _PTR(GenericAttribute) anAttr; if( myObject->FindAttribute ( anAttr, "AttributeTextHighlightColor") ) { _PTR(AttributeTextHighlightColor) aHighColAttr = anAttr; - c = QColor( (int)(aHighColAttr->TextHighlightColor().R), - (int)(aHighColAttr->TextHighlightColor().G), - (int)(aHighColAttr->TextHighlightColor().B)); + c = QColor( (int)(aHighColAttr->TextHighlightColor().R), + (int)(aHighColAttr->TextHighlightColor().G), + (int)(aHighColAttr->TextHighlightColor().B)); } } break; @@ -273,9 +273,9 @@ QString SalomeApp_DataObject::toolTip( const int /*id*/ ) const app->lcc()->FindComponent(params, componentDataType().toLatin1().constData() ); if ( !CORBA::is_nil(aComponent) && aComponent->hasObjectInfo() ) { - LightApp_RootObject* aRoot = dynamic_cast( root() ); - if ( aRoot && aRoot->study() ) - return QString( (CORBA::String_var)aComponent->getObjectInfo( aRoot->study()->id(), entry().toLatin1().constData()) ); + LightApp_RootObject* aRoot = dynamic_cast( root() ); + if ( aRoot && aRoot->study() ) + return QString( (CORBA::String_var)aComponent->getObjectInfo( aRoot->study()->id(), entry().toLatin1().constData()) ); } } } @@ -440,8 +440,8 @@ QString SalomeApp_DataObject::ior( const _PTR(SObject)& obj ) const _PTR(AttributeIOR) iorAttr = attr; if ( iorAttr ) { - std::string str = iorAttr->Value(); - txt = QString( str.c_str() ); + std::string str = iorAttr->Value(); + txt = QString( str.c_str() ); } } } @@ -491,28 +491,28 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const { _PTR(Study) studyDS( aStudy->studyDS() ); - bool ok = false; - QStringList aSectionList = aStrings.split( "|" ); - if ( !aSectionList.isEmpty() ) - { - QString aLastSection = aSectionList.last(); - QStringList aStringList = aLastSection.split( ":" ); - if ( !aStringList.isEmpty() ) - { - ok = true; - for ( int i = 0, n = aStringList.size(); i < n; i++ ) - { - QString aStr = aStringList[i]; - if ( studyDS->IsVariable( aStr.toStdString() ) ) - val.append( aStr + ", " ); - } - - if ( !val.isEmpty() ) - val.remove( val.length() - 2, 2 ); - } - } - if( !ok ) - val = aStrings; + bool ok = false; + QStringList aSectionList = aStrings.split( "|" ); + if ( !aSectionList.isEmpty() ) + { + QString aLastSection = aSectionList.last(); + QStringList aStringList = aLastSection.split( ":" ); + if ( !aStringList.isEmpty() ) + { + ok = true; + for ( int i = 0, n = aStringList.size(); i < n; i++ ) + { + QString aStr = aStringList[i]; + if ( studyDS->IsVariable( aStr.toStdString() ) ) + val.append( aStr + ", " ); + } + + if ( !val.isEmpty() ) + val.remove( val.length() - 2, 2 ); + } + } + if( !ok ) + val = aStrings; } } } @@ -581,7 +581,7 @@ SalomeApp_ModuleObject::SalomeApp_ModuleObject( SUIT_DataObject* parent ) \param parent parent data object */ SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj, - SUIT_DataObject* parent ) + SUIT_DataObject* parent ) : CAM_DataObject( parent ), LightApp_DataObject( parent ), SalomeApp_DataObject( sobj, parent ), @@ -596,8 +596,8 @@ SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj, \param parent parent data object */ SalomeApp_ModuleObject::SalomeApp_ModuleObject( CAM_DataModel* dm, - const _PTR(SObject)& sobj, - SUIT_DataObject* parent ) + const _PTR(SObject)& sobj, + SUIT_DataObject* parent ) : CAM_DataObject( parent ), LightApp_DataObject( parent ), SalomeApp_DataObject( sobj, parent ), @@ -744,8 +744,8 @@ QString SalomeApp_RootObject::toolTip( const int id ) const \param study study */ SalomeApp_SavePointObject::SalomeApp_SavePointObject( SUIT_DataObject* parent, - const int id, - SalomeApp_Study* study ) + const int id, + SalomeApp_Study* study ) : LightApp_DataObject( parent ), CAM_DataObject( parent ), myId( id ), diff --git a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx index c784b6a26..f83897839 100644 --- a/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_DoubleSpinBox.cxx @@ -116,16 +116,16 @@ SalomeApp_DoubleSpinBox::~SalomeApp_DoubleSpinBox() void SalomeApp_DoubleSpinBox::connectSignalsAndSlots() { connect( this, SIGNAL( editingFinished() ), - this, SLOT( onEditingFinished() ) ); + this, SLOT( onEditingFinished() ) ); connect( this, SIGNAL( valueChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); connect( lineEdit(), SIGNAL( textChanged( const QString& )), - this, SIGNAL( textChanged( const QString& ) ) ); + this, SIGNAL( textChanged( const QString& ) ) ); } /*! @@ -204,11 +204,11 @@ bool SalomeApp_DoubleSpinBox::isValid( QString& msg, bool toCorrect ) if( toCorrect ) { if( aState == Incompatible ) - msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n"; + msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n"; else if( aState == NoVariable ) - msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n"; + msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n"; else if( aState == Invalid ) - msg += tr( "ERR_INVALID_VALUE" ) + "\n"; + msg += tr( "ERR_INVALID_VALUE" ) + "\n"; setText( myCorrectValue ); } @@ -325,29 +325,29 @@ SalomeApp_DoubleSpinBox::SearchState SalomeApp_DoubleSpinBox::findVariable( cons std::string aName = name.toStdString(); if( studyDS->IsVariable( aName ) ) { - if( studyDS->IsReal( aName ) || studyDS->IsInteger( aName ) || studyDS->IsString( aName ) ) - { - if( studyDS->IsString( aName ) ) - { - PyConsole_Console* pyConsole = app->pythonConsole(); - PyConsole_Interp* pyInterp = pyConsole->getInterp(); - PyLockWrapper aLock = pyInterp->GetLockWrapper(); - std::string command; - command = "import salome_notebook ; "; - command += "salome_notebook.notebook.setAsReal(\""; - command += aName; - command += "\")"; - bool aResult; - aResult = pyInterp->run(command.c_str()); - if(aResult) - { - return IncorrectType; - } - } - value = studyDS->GetReal( aName ); - return Found; - } - return IncorrectType; + if( studyDS->IsReal( aName ) || studyDS->IsInteger( aName ) || studyDS->IsString( aName ) ) + { + if( studyDS->IsString( aName ) ) + { + PyConsole_Console* pyConsole = app->pythonConsole(); + PyConsole_Interp* pyInterp = pyConsole->getInterp(); + PyLockWrapper aLock = pyInterp->GetLockWrapper(); + std::string command; + command = "import salome_notebook ; "; + command += "salome_notebook.notebook.setAsReal(\""; + command += aName; + command += "\")"; + bool aResult; + aResult = pyInterp->run(command.c_str()); + if(aResult) + { + return IncorrectType; + } + } + value = studyDS->GetReal( aName ); + return Found; + } + return IncorrectType; } } } diff --git a/src/SalomeApp/SalomeApp_IntSpinBox.cxx b/src/SalomeApp/SalomeApp_IntSpinBox.cxx index 27427d2e6..76625adc9 100644 --- a/src/SalomeApp/SalomeApp_IntSpinBox.cxx +++ b/src/SalomeApp/SalomeApp_IntSpinBox.cxx @@ -86,16 +86,16 @@ SalomeApp_IntSpinBox::~SalomeApp_IntSpinBox() void SalomeApp_IntSpinBox::connectSignalsAndSlots() { connect( this, SIGNAL( editingFinished() ), - this, SLOT( onEditingFinished() ) ); + this, SLOT( onEditingFinished() ) ); connect( this, SIGNAL( valueChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); connect( lineEdit(), SIGNAL( textChanged( const QString& ) ), - this, SLOT( onTextChanged( const QString& ) ) ); + this, SLOT( onTextChanged( const QString& ) ) ); connect( lineEdit(), SIGNAL( textChanged( const QString& )), - this, SIGNAL( textChanged( const QString& ) ) ); + this, SIGNAL( textChanged( const QString& ) ) ); } /*! @@ -174,11 +174,11 @@ bool SalomeApp_IntSpinBox::isValid( QString& msg, bool toCorrect ) if( toCorrect ) { if( aState == Incompatible ) - msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n"; + msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n"; else if( aState == NoVariable ) - msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n"; + msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n"; else if( aState == Invalid ) - msg += tr( "ERR_INVALID_VALUE" ) + "\n"; + msg += tr( "ERR_INVALID_VALUE" ) + "\n"; setText( myCorrectValue ); } @@ -233,7 +233,7 @@ SalomeApp_IntSpinBox::State SalomeApp_IntSpinBox::isValid( const QString& text, { text.toDouble( &ok ); if( ok ) - return Invalid; + return Invalid; return NoVariable; } } @@ -283,29 +283,29 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr std::string aName = name.toStdString(); if( studyDS->IsVariable( aName ) ) { - if( studyDS->IsInteger( aName ) || studyDS->IsString( aName ) ) - { - if( studyDS->IsString( aName ) ) - { - PyConsole_Console* pyConsole = app->pythonConsole(); - PyConsole_Interp* pyInterp = pyConsole->getInterp(); - PyLockWrapper aLock = pyInterp->GetLockWrapper(); - std::string command; - command = "import salome_notebook ; "; - command += "salome_notebook.notebook.setAsInteger(\""; - command += aName; - command += "\")"; - bool aResult; - aResult = pyInterp->run(command.c_str()); - if(aResult) - { - return IncorrectType; - } - } - value = studyDS->GetInteger( aName ); - return Found; - } - return IncorrectType; + if( studyDS->IsInteger( aName ) || studyDS->IsString( aName ) ) + { + if( studyDS->IsString( aName ) ) + { + PyConsole_Console* pyConsole = app->pythonConsole(); + PyConsole_Interp* pyInterp = pyConsole->getInterp(); + PyLockWrapper aLock = pyInterp->GetLockWrapper(); + std::string command; + command = "import salome_notebook ; "; + command += "salome_notebook.notebook.setAsInteger(\""; + command += aName; + command += "\")"; + bool aResult; + aResult = pyInterp->run(command.c_str()); + if(aResult) + { + return IncorrectType; + } + } + value = studyDS->GetInteger( aName ); + return Found; + } + return IncorrectType; } } } diff --git a/src/SalomeApp/SalomeApp_ListView.cxx b/src/SalomeApp/SalomeApp_ListView.cxx index b86831fa1..b6d2b5138 100644 --- a/src/SalomeApp/SalomeApp_ListView.cxx +++ b/src/SalomeApp/SalomeApp_ListView.cxx @@ -89,9 +89,9 @@ SalomeApp_ListView::SalomeApp_ListView( QWidget* parent ) viewport()->installEventFilter(this); connect(this, SIGNAL(itemSelectionChanged()), - this, SLOT(onSelectionChanged())); + this, SLOT(onSelectionChanged())); connect(header(), SIGNAL(sizeChange(int, int, int)), - this, SLOT(onHeaderSizeChange(int, int, int))); + this, SLOT(onHeaderSizeChange(int, int, int))); } /*! @@ -330,10 +330,10 @@ UpdateType SalomeApp_ListView::finishEditing(bool ok) if (ok) { aNeedsUpdate = myEditedItem->finishEditing(myEdit); if (aNeedsUpdate == utCancel) { - // something to do here on Cancel... + // something to do here on Cancel... } else { - // something to do here on OK... + // something to do here on OK... } // updating contents switch (aNeedsUpdate) { @@ -385,9 +385,9 @@ UpdateType SalomeApp_ListView::finishEditing(bool ok) \retval valid rect in success */ QRect SalomeApp_ListView::tip(QPoint aPos, - QString& aText, - QRect& dspRect, - QFont& dspFnt) const + QString& aText, + QRect& dspRect, + QFont& dspFnt) const { QRect result( -1, -1, -1, -1 ); SalomeApp_ListViewItem* aItem = (SalomeApp_ListViewItem*)itemAt( aPos ); @@ -396,15 +396,15 @@ QRect SalomeApp_ListView::tip(QPoint aPos, QRect aItemRect = aItem->itemRect(i); QRect aTextRect = aItem->textRect(i); if ( !aItem->text(i).isEmpty() && - ( aItemRect.width() > header()->sectionSize(i) || - aTextRect.left() < 0 || + ( aItemRect.width() > header()->sectionSize(i) || + aTextRect.left() < 0 || aTextRect.top() < 0 || aTextRect.right() > viewport()->width() || aTextRect.bottom() > viewport()->height() ) ) { // calculating tip data aText = aItem->tipText(); - dspRect = aItem->tipRect(); - dspFnt = font(); + dspRect = aItem->tipRect(); + dspFnt = font(); if (dspRect.isValid()) { result = QRect(QPoint(0, aItemRect.top()), QSize(viewport()->width(), aItemRect.height())); @@ -428,7 +428,7 @@ QTreeWidgetItem( parent ) Constructor */ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, - SalomeApp_ListViewItem* after) : + SalomeApp_ListViewItem* after) : QTreeWidgetItem( parent, after ) { init(); @@ -438,8 +438,8 @@ QTreeWidgetItem( parent, after ) Constructor */ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, - const QStringList& theStrings, - const bool theEditable) : + const QStringList& theStrings, + const bool theEditable) : QTreeWidgetItem(parent, theStrings) { init(); @@ -450,8 +450,8 @@ QTreeWidgetItem(parent, theStrings) Constructor */ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent, - const QStringList& theString, - const bool theEditable) : + const QStringList& theString, + const bool theEditable) : QTreeWidgetItem(parent, theString) { init(); @@ -462,9 +462,9 @@ QTreeWidgetItem(parent, theString) Constructor */ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent, - SalomeApp_ListViewItem* after, - const QString& theName, - const bool theEditable) : + SalomeApp_ListViewItem* after, + const QString& theName, + const bool theEditable) : QTreeWidgetItem(parent, after) { setData(0,Qt::DisplayRole,QVariant(theName)); @@ -476,9 +476,9 @@ QTreeWidgetItem(parent, after) Constructor */ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, - SalomeApp_ListViewItem* after, - const QString& theName, - const bool theEditable) : + SalomeApp_ListViewItem* after, + const QString& theName, + const bool theEditable) : QTreeWidgetItem(parent, after) { setData(0,Qt::DisplayRole,QVariant(theName)); @@ -490,10 +490,10 @@ QTreeWidgetItem(parent, after) Constructor */ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent, - SalomeApp_ListViewItem* after, - const QString& theName, - const QString& theValue, - const bool theEditable) : + SalomeApp_ListViewItem* after, + const QString& theName, + const QString& theValue, + const bool theEditable) : QTreeWidgetItem(parent, after) { setData(0,Qt::DisplayRole,QVariant(theName)); @@ -506,10 +506,10 @@ QTreeWidgetItem(parent, after) Constructor */ SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent, - SalomeApp_ListViewItem* after, - const QString& theName, - const QString& theValue, - const bool theEditable) : + SalomeApp_ListViewItem* after, + const QString& theName, + const QString& theValue, + const bool theEditable) : QTreeWidgetItem(parent, after) { setData(0,Qt::DisplayRole,QVariant(theName)); @@ -767,9 +767,9 @@ SalomeApp_EntityEdit* SalomeApp_ListViewItem::startEditing() return 0; aWidget = new SalomeApp_EntityEdit(aListView->viewport(), anEditType, - aValueType, - aButtons & SalomeApp_EntityEdit::btApply, - aButtons & SalomeApp_EntityEdit::btCancel); + aValueType, + aButtons & SalomeApp_EntityEdit::btApply, + aButtons & SalomeApp_EntityEdit::btCancel); computeEditGeometry(this, aWidget); fillWidgetWithValues(aWidget); @@ -966,7 +966,7 @@ int SalomeApp_ComboBox::findItem(const QString& theText) Adds item in combo box */ void SalomeApp_ComboBox::insertItem(const QString& theValue, - int theIndex) + int theIndex) { if (duplicatesEnabled() || findItem(theValue) < 0) QComboBox::insertItem(theIndex, theValue); @@ -1046,10 +1046,10 @@ void SalomeApp_ComboBox::insertList(const TColStd_ListOfReal& theList) Constructor */ SalomeApp_EntityEdit::SalomeApp_EntityEdit(QWidget* parent, - int controlType, - int valueType, - bool butApply, - bool butCancel) : + int controlType, + int valueType, + bool butApply, + bool butCancel) : QWidget(parent), myEdit(0), myCombo(0), @@ -1185,8 +1185,8 @@ void SalomeApp_EntityEdit::setText(const QString& theText) Adds item in combo box, sets it current if theSetCurrent is true */ void SalomeApp_EntityEdit::insertItem(const QString& theValue, - bool theSetCurrent, - int theOrder) + bool theSetCurrent, + int theOrder) { if (myCombo) { int aIndexAt = -1; @@ -1208,7 +1208,7 @@ void SalomeApp_EntityEdit::insertItem(const QString& theValue, Adds items in combo box, sets item theCurrent as current */ void SalomeApp_EntityEdit::insertList(const QStringList& theList, - const int theCurrent) + const int theCurrent) { if (myCombo) myCombo->insertList(theList); @@ -1220,7 +1220,7 @@ void SalomeApp_EntityEdit::insertList(const QStringList& theList, Adds item in combo box, sets it current if theSetCurrent is true */ void SalomeApp_EntityEdit::insertItem(const int theValue, - bool theSetCurrent) + bool theSetCurrent) { if (myCombo) { myCombo->insertItem(theValue); @@ -1233,7 +1233,7 @@ void SalomeApp_EntityEdit::insertItem(const int theValue, Adds items in combo box, sets item theCurrent as current */ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList, - const int theCurrent) + const int theCurrent) { if (myCombo) myCombo->insertList(theList); @@ -1251,7 +1251,7 @@ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList, Adds item in combo box, sets it current if theSetCurrent is true */ void SalomeApp_EntityEdit::insertItem(const double theValue, - bool theSetCurrent) + bool theSetCurrent) { if (myCombo) { myCombo->insertItem(theValue); @@ -1264,7 +1264,7 @@ void SalomeApp_EntityEdit::insertItem(const double theValue, Adds items in combo box, sets item theCurrent as current */ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfReal& theList, - const int theCurrent) + const int theCurrent) { if (myCombo) myCombo->insertList(theList); diff --git a/src/SalomeApp/SalomeApp_ListView.h b/src/SalomeApp/SalomeApp_ListView.h index 8e1521a6d..ea418cad6 100644 --- a/src/SalomeApp/SalomeApp_ListView.h +++ b/src/SalomeApp/SalomeApp_ListView.h @@ -186,10 +186,10 @@ public: public: SalomeApp_EntityEdit( QWidget* parent, - int controlType = etLineEdit, - int valueType = vtString, - bool butApply = false, - bool butCancel = false); + int controlType = etLineEdit, + int valueType = vtString, + bool butApply = false, + bool butCancel = false); ~SalomeApp_EntityEdit(); void finishEditing(); @@ -197,18 +197,18 @@ public: QString getText(); void setText(const QString& theText ); void insertItem( const QString& theValue, - bool theSetCurrent = false, - int theOrder = atBottom ); + bool theSetCurrent = false, + int theOrder = atBottom ); void insertList( const QStringList& theList, - const int theCurrent = -1 ); + const int theCurrent = -1 ); void insertItem( const int theValue, - bool theSetCurrent = false ); + bool theSetCurrent = false ); void insertList( const TColStd_ListOfInteger& theList, - const int theCurrent = -1 ); + const int theCurrent = -1 ); void insertItem( const double theValue, - bool theSetCurrent = false ); + bool theSetCurrent = false ); void insertList( const TColStd_ListOfReal& theList, - const int theCurrent = -1 ); + const int theCurrent = -1 ); QWidget* getControl(); void setFocus(); void setValidator(const QValidator*); @@ -241,31 +241,31 @@ class SalomeApp_ListViewItem : public QTreeWidgetItem public: SalomeApp_ListViewItem( SalomeApp_ListView* ); SalomeApp_ListViewItem( SalomeApp_ListView*, - SalomeApp_ListViewItem* ); + SalomeApp_ListViewItem* ); SalomeApp_ListViewItem( SalomeApp_ListView*, - const QStringList&, - const bool = false ); + const QStringList&, + const bool = false ); SalomeApp_ListViewItem( SalomeApp_ListViewItem*, - const QStringList&, - const bool = false ); + const QStringList&, + const bool = false ); SalomeApp_ListViewItem( SalomeApp_ListView*, - SalomeApp_ListViewItem*, - const QString&, - const bool = false ); + SalomeApp_ListViewItem*, + const QString&, + const bool = false ); SalomeApp_ListViewItem( SalomeApp_ListViewItem*, - SalomeApp_ListViewItem*, - const QString&, - const bool = false); + SalomeApp_ListViewItem*, + const QString&, + const bool = false); SalomeApp_ListViewItem( SalomeApp_ListView*, - SalomeApp_ListViewItem*, - const QString& theName, - const QString& theValue, - const bool = false); + SalomeApp_ListViewItem*, + const QString& theName, + const QString& theValue, + const bool = false); SalomeApp_ListViewItem( SalomeApp_ListViewItem*, - SalomeApp_ListViewItem*, - const QString&, - const QString&, - const bool = false); + SalomeApp_ListViewItem*, + const QString&, + const QString&, + const bool = false); ~SalomeApp_ListViewItem(); QString fullName(); diff --git a/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx b/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx index d338c6830..a94089ac8 100644 --- a/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx @@ -74,7 +74,7 @@ SalomeApp_LoadStudiesDlg::SalomeApp_LoadStudiesDlg( QWidget* parent, const QStri myList = new QListWidget( this ); myList->setMinimumSize( MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT ); myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, - QSizePolicy::Expanding ) ); + QSizePolicy::Expanding ) ); myList->setSelectionMode( QAbstractItemView::SingleSelection ); topLayout->addWidget( lab ); @@ -84,9 +84,9 @@ SalomeApp_LoadStudiesDlg::SalomeApp_LoadStudiesDlg( QWidget* parent, const QStri connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( myList, SIGNAL( itemDoubleClicked( QListWidgetItem* ) ), - this, SLOT( accept() ) ); + this, SLOT( accept() ) ); connect( myList, SIGNAL( itemSelectionChanged() ), - this, SLOT( updateState() ) ); + this, SLOT( updateState() ) ); myList->addItems( studies ); updateState(); diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index 5bfa0adfa..e7b54c83a 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -96,26 +96,26 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li _PTR(SObject) SO = study->studyDS()->FindObjectID( obj->getEntry() ); if( SO && QString( SO->GetID().c_str() ) == SO->GetFatherComponent()->GetID().c_str() ) { //component is selected - _PTR(SComponent) SC( SO->GetFatherComponent() ); - _PTR(ChildIterator) anIter ( study->studyDS()->NewChildIterator( SC ) ); - anIter->InitEx( true ); - while( anIter->More() ) - { - _PTR(SObject) valSO ( anIter->Value() ); - _PTR(SObject) refSO; - if( !valSO->ReferencedObject( refSO ) ) - { - QString id = valSO->GetID().c_str(), - comp = SC->ComponentDataType().c_str(), - val = valSO->GetName().c_str(); - - Handle( SALOME_InteractiveObject ) new_obj = - new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() ); - dest.Append( new_obj ); - } - anIter->Next(); - } - continue; + _PTR(SComponent) SC( SO->GetFatherComponent() ); + _PTR(ChildIterator) anIter ( study->studyDS()->NewChildIterator( SC ) ); + anIter->InitEx( true ); + while( anIter->More() ) + { + _PTR(SObject) valSO ( anIter->Value() ); + _PTR(SObject) refSO; + if( !valSO->ReferencedObject( refSO ) ) + { + QString id = valSO->GetID().c_str(), + comp = SC->ComponentDataType().c_str(), + val = valSO->GetName().c_str(); + + Handle( SALOME_InteractiveObject ) new_obj = + new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() ); + dest.Append( new_obj ); + } + anIter->Next(); + } + continue; } } dest.Append( obj ); diff --git a/src/SalomeApp/SalomeApp_NoteBookDlg.cxx b/src/SalomeApp/SalomeApp_NoteBookDlg.cxx index 347d6a771..e4e4934b9 100644 --- a/src/SalomeApp/SalomeApp_NoteBookDlg.cxx +++ b/src/SalomeApp/SalomeApp_NoteBookDlg.cxx @@ -368,8 +368,8 @@ void NoteBook_Table::Init(_PTR(Study) theStudy) NoteBook_TableRow* aRow = myRows[ i ]; if( aRow ) { - delete aRow; - aRow = 0; + delete aRow; + aRow = 0; } } myRows.clear(); @@ -384,7 +384,7 @@ void NoteBook_Table::Init(_PTR(Study) theStudy) vector aVariables = theStudy->GetVariableNames(); for(int iVar = 0; iVar < aVariables.size(); iVar++ ) { AddRow(QString(aVariables[iVar].c_str()), - Variable2String(aVariables[iVar],theStudy)); + Variable2String(aVariables[iVar],theStudy)); } //Add empty row @@ -535,51 +535,51 @@ void NoteBook_Table::onItemChanged(QTableWidgetItem* theItem) QString aMsg; if(aCurrentColumn == NAME_COLUMN) { - int anIndex = aRow->GetIndex(); - if( myVariableMap.contains( anIndex ) ) - { - const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ]; - if( !aVariable.Name.isEmpty() && myStudy->IsVariableUsed( string( aVariable.Name.toLatin1().constData() ) ) ) - { - if( QMessageBox::warning( parentWidget(), tr( "WARNING" ), - tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ), - QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) - { - bool isBlocked = blockSignals( true ); - aRow->SetName( aVariable.Name ); - blockSignals( isBlocked ); - return; - } - } - } + int anIndex = aRow->GetIndex(); + if( myVariableMap.contains( anIndex ) ) + { + const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ]; + if( !aVariable.Name.isEmpty() && myStudy->IsVariableUsed( string( aVariable.Name.toLatin1().constData() ) ) ) + { + if( QMessageBox::warning( parentWidget(), tr( "WARNING" ), + tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ), + QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) + { + bool isBlocked = blockSignals( true ); + aRow->SetName( aVariable.Name ); + blockSignals( isBlocked ); + return; + } + } + } } //Case then varible name changed. if(aCurrentColumn == NAME_COLUMN) { if(!aRow->CheckName()) { - IsCorrect = false; - aMsg = tr( "VARNAME_INCORRECT" ).arg(aRow->GetName()); - } + IsCorrect = false; + aMsg = tr( "VARNAME_INCORRECT" ).arg(aRow->GetName()); + } else if(!IsUniqueName(aRow)) { - IsCorrect = false; + IsCorrect = false; aMsg = tr( "VARNAME_EXISTS" ).arg(aRow->GetName()); - } - else - IsVariableComplited = aRow->CheckValue(); + } + else + IsVariableComplited = aRow->CheckValue(); } //Case then varible value changed. else if(aCurrentColumn == VALUE_COLUMN){ if(!aRow->CheckValue()) { - IsCorrect = false; - aMsg = tr( "VARVALUE_INCORRECT" ).arg(aRow->GetName()); - } - else - IsVariableComplited = aRow->CheckName() && IsUniqueName(aRow); + IsCorrect = false; + aMsg = tr( "VARVALUE_INCORRECT" ).arg(aRow->GetName()); + } + else + IsVariableComplited = aRow->CheckName() && IsUniqueName(aRow); } if(!IsCorrect && !aMsg.isEmpty()) - SUIT_MessageBox::warning( parentWidget(), tr( "WARNING" ), aMsg ); + SUIT_MessageBox::warning( parentWidget(), tr( "WARNING" ), aMsg ); bool isBlocked = blockSignals( true ); theItem->setForeground( QBrush( IsCorrect ? Qt::black : Qt::red ) ); @@ -588,19 +588,19 @@ void NoteBook_Table::onItemChanged(QTableWidgetItem* theItem) int anIndex = aRow->GetIndex(); if( myVariableMap.contains( anIndex ) ) { - NoteBoox_Variable& aVariable = myVariableMap[ anIndex ]; - if( aVariable.Name.compare( aRow->GetName() ) != 0 || - aVariable.Value.compare( aRow->GetValue() ) != 0 ) - { - aVariable.Name = aRow->GetName(); - aVariable.Value = aRow->GetValue(); - } - else - isModified = false; + NoteBoox_Variable& aVariable = myVariableMap[ anIndex ]; + if( aVariable.Name.compare( aRow->GetName() ) != 0 || + aVariable.Value.compare( aRow->GetValue() ) != 0 ) + { + aVariable.Name = aRow->GetName(); + aVariable.Value = aRow->GetValue(); + } + else + isModified = false; } if(IsCorrect && IsVariableComplited && IsLastRow(aRow)) - AddEmptyRow(); + AddEmptyRow(); } if( !myIsModified ) @@ -648,22 +648,22 @@ void NoteBook_Table::RemoveSelected() else { int nRow = row(aSelectedItems[i]); - if( myStudy->IsVariableUsed( string( aRow->GetName().toLatin1().constData() ) ) ) - { - if( QMessageBox::warning( parentWidget(), tr( "WARNING" ), - tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ), - QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) - { - isProcessItemChangedSignal = true; - return; - } - } - - int index = aRow->GetIndex(); + if( myStudy->IsVariableUsed( string( aRow->GetName().toLatin1().constData() ) ) ) + { + if( QMessageBox::warning( parentWidget(), tr( "WARNING" ), + tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ), + QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) + { + isProcessItemChangedSignal = true; + return; + } + } + + int index = aRow->GetIndex(); QString aVarName = aRow->GetName(); - myRemovedRows.append( index ); - if( myVariableMap.contains( index ) ) - myVariableMap.remove( index ); + myRemovedRows.append( index ); + if( myVariableMap.contains( index ) ) + myVariableMap.remove( index ); removeRow(nRow); myRows.removeAt(nRow); if(myStudy->IsVariable(aVarName.toLatin1().constData())) @@ -899,28 +899,28 @@ void SalomeApp_NoteBookDlg::onApply() { if( aVariableMapRef.contains( anIndex ) ) { - const NoteBoox_Variable& aVariableRef = aVariableMapRef[ anIndex ]; - QString aNameRef = aVariableRef.Name; - QString aValueRef = aVariableRef.Value; - - if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName ) - { - myStudy->RenameVariable( string( aNameRef.toLatin1().constData() ), - string( aName.toLatin1().constData() ) ); - } + const NoteBoox_Variable& aVariableRef = aVariableMapRef[ anIndex ]; + QString aNameRef = aVariableRef.Name; + QString aValueRef = aVariableRef.Value; + + if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName ) + { + myStudy->RenameVariable( string( aNameRef.toLatin1().constData() ), + string( aName.toLatin1().constData() ) ); + } } if( NoteBook_TableRow::IsIntegerValue(aValue,&anIVal) ) - myStudy->SetInteger(string(aName.toLatin1().constData()),anIVal); + myStudy->SetInteger(string(aName.toLatin1().constData()),anIVal); else if( NoteBook_TableRow::IsRealValue(aValue,&aDVal) ) - myStudy->SetReal(string(aName.toLatin1().constData()),aDVal); + myStudy->SetReal(string(aName.toLatin1().constData()),aDVal); else if( NoteBook_TableRow::IsBooleanValue(aValue,&aBVal) ) - myStudy->SetBoolean(string(aName.toLatin1().constData()),aBVal); + myStudy->SetBoolean(string(aName.toLatin1().constData()),aBVal); else if( NoteBook_TableRow::IsValidStringValue(aValue) ) - myStudy->SetString(string(aName.toLatin1().constData()),aValue.toStdString()); + myStudy->SetString(string(aName.toLatin1().constData()),aValue.toStdString()); } } myTable->ResetMaps(); @@ -941,13 +941,13 @@ void SalomeApp_NoteBookDlg::onCancel() if( myTable->IsModified() ) { int answer = QMessageBox::question( this, tr( "CLOSE_CAPTION" ), tr( "CLOSE_DESCRIPTION" ), - QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel ); + QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel ); switch( answer ) { case QMessageBox::Yes : onOK(); return; case QMessageBox::No : break; case QMessageBox::Cancel : return; - default : break; + default : break; } } reject(); @@ -1086,7 +1086,7 @@ void SalomeApp_NoteBookDlg::clearStudy() int aY = y(); // Disconnect dialog from application desktop in case if: - // 1) Application is not the first application in the session + // 1) Application is not the first application in the session // 2) Application is the first application in session but not the only. bool changeDesktop = ((anIndex > 0) || (anIndex == 0 && aList.count() > 1)); diff --git a/src/SalomeApp/SalomeApp_NoteBookDlg.h b/src/SalomeApp/SalomeApp_NoteBookDlg.h index 2f1e815cc..93709477c 100644 --- a/src/SalomeApp/SalomeApp_NoteBookDlg.h +++ b/src/SalomeApp/SalomeApp_NoteBookDlg.h @@ -94,7 +94,7 @@ class SALOMEAPP_EXPORT NoteBook_Table : public QTableWidget void Init(_PTR(Study) theStudy); static QString Variable2String(const std::string& theVarName, - _PTR(Study) theStudy); + _PTR(Study) theStudy); bool IsValid() const; diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 1c040af7d..4b18f8a6c 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -213,7 +213,7 @@ bool SalomeApp_Study::saveDocumentAs( const QString& theFileName ) listOfFiles.clear(); aModel->saveAs( theFileName, this, listOfFiles ); if ( !listOfFiles.isEmpty() ) - saveModuleData(aModel->module()->name(), listOfFiles); + saveModuleData(aModel->module()->name(), listOfFiles); } } @@ -255,7 +255,7 @@ bool SalomeApp_Study::saveDocument() listOfFiles.clear(); aModel->save(listOfFiles); if ( !listOfFiles.isEmpty() ) - saveModuleData(aModel->module()->name(), listOfFiles); + saveModuleData(aModel->module()->name(), listOfFiles); } } @@ -523,7 +523,7 @@ QString SalomeApp_Study::newStudyName() const curName = prefix.arg( i ); for ( j = 0 ; j < n; j++ ){ if ( !strcmp( studies[j].c_str(), curName.toLatin1() ) ) - break; + break; } if ( j == n ) newName = curName; diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index ee81e8ee1..9f8467c3b 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -54,19 +54,19 @@ class SalomeApp_PropItem : public SalomeApp_ListViewItem public: /*! constructor */ SalomeApp_PropItem(SalomeApp_ListView* parent, - const QString theName, - const bool theEditable, - const int theUserType) : + const QString theName, + const bool theEditable, + const int theUserType) : SalomeApp_ListViewItem( parent, QStringList(theName), theEditable ) { setUserType(theUserType); } /*! constructor */ SalomeApp_PropItem(SalomeApp_ListView* parent, - SalomeApp_ListViewItem* after, - const QString theName, - const bool theEditable, - const int theUserType) : + SalomeApp_ListViewItem* after, + const QString theName, + const bool theEditable, + const int theUserType) : SalomeApp_ListViewItem( parent, after, theName, theEditable ) { setUserType(theUserType); @@ -85,46 +85,46 @@ public: // } case SalomeApp_StudyPropertiesDlg::prpLockedId: { - list << SalomeApp_StudyPropertiesDlg::tr( "PRP_NO" ) << SalomeApp_StudyPropertiesDlg::tr( "PRP_YES" ); - theWidget->insertList(list, getValue() == SalomeApp_StudyPropertiesDlg::tr( "PRP_NO" ) ? 0 : 1 ); - break; + list << SalomeApp_StudyPropertiesDlg::tr( "PRP_NO" ) << SalomeApp_StudyPropertiesDlg::tr( "PRP_YES" ); + theWidget->insertList(list, getValue() == SalomeApp_StudyPropertiesDlg::tr( "PRP_NO" ) ? 0 : 1 ); + break; } case SalomeApp_StudyPropertiesDlg::prpModificationsId: { - SalomeApp_Study* study = + SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); - if (study) { - _PTR(Study) studyDoc = study->studyDS(); - _PTR(AttributeStudyProperties) propAttr; - if ( studyDoc ) { - propAttr = studyDoc->GetProperties(); - if ( propAttr ) { - std::vector aUsers; - std::vector aMins, aHours, aDays, aMonths, aYears; - propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false); - int aCnt = aUsers.size(); - for ( int i = 0; i < aCnt; i++ ) { - QString val; - val.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", - aDays [i], - aMonths[i], - aYears [i], - aHours [i], - aMins [i]); - val = val + " : " + QString( aUsers[i].c_str() ); - list.prepend(val); - } - theWidget->setDuplicatesEnabled(true); - theWidget->insertList(list); - } - } - } - break; + if (study) { + _PTR(Study) studyDoc = study->studyDS(); + _PTR(AttributeStudyProperties) propAttr; + if ( studyDoc ) { + propAttr = studyDoc->GetProperties(); + if ( propAttr ) { + std::vector aUsers; + std::vector aMins, aHours, aDays, aMonths, aYears; + propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false); + int aCnt = aUsers.size(); + for ( int i = 0; i < aCnt; i++ ) { + QString val; + val.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", + aDays [i], + aMonths[i], + aYears [i], + aHours [i], + aMins [i]); + val = val + " : " + QString( aUsers[i].c_str() ); + list.prepend(val); + } + theWidget->setDuplicatesEnabled(true); + theWidget->insertList(list); + } + } + } + break; } default: { - SalomeApp_ListViewItem::fillWidgetWithValues(theWidget); - break; + SalomeApp_ListViewItem::fillWidgetWithValues(theWidget); + break; } } } @@ -261,11 +261,11 @@ void SalomeApp_StudyPropertiesDlg::initData() if (aLast >= 0) { QString val; val.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", - aDays [aLast], - aMonths[aLast], - aYears [aLast], - aHours [aLast], - aMins [aLast]); + aDays [aLast], + aMonths[aLast], + aYears [aLast], + aHours [aLast], + aMins [aLast]); val = val + " : " + QString(aUsers[aUsers.size()-1].c_str()); item->setValue(val); } @@ -296,24 +296,24 @@ void SalomeApp_StudyPropertiesDlg::onOK() QTreeWidgetItemIterator it( myPropList ); // iterate through all items of the listview while (*it) { - SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it); - switch (item->getUserType()) { - case prpAuthorId: + SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it); + switch (item->getUserType()) { + case prpAuthorId: if (QString(propAttr->GetUserName().c_str()) != item->getValue().trimmed()) { if (!propAttr->IsLocked()) { propAttr->SetUserName(item->getValue().trimmed().toStdString()); myChanged = true; } else { SUIT_MessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_STUDY_LOCKED") ); + QObject::tr("WRN_WARNING"), + QObject::tr("WRN_STUDY_LOCKED") ); } } - break; + break; //case prpModeId: - // propAttr->SetCreationMode(item->getValue().trimmed().latin1()); - // break; - case prpLockedId: + // propAttr->SetCreationMode(item->getValue().trimmed().latin1()); + // break; + case prpLockedId: { bool bLocked = item->getValue().compare(tr("PRP_YES")) == 0; if (propAttr->IsLocked() != bLocked) { @@ -321,11 +321,11 @@ void SalomeApp_StudyPropertiesDlg::onOK() myChanged = true; } } - break; - default: - break; - } - ++it; + break; + default: + break; + } + ++it; } } accept(); @@ -346,25 +346,25 @@ bool SalomeApp_StudyPropertiesDlg::propChanged() SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it); switch (item->getUserType()) { case prpAuthorId: - if ( QString( propAttr->GetUserName().c_str() ) != item->getValue().trimmed() ) { - return true; - } - break; + if ( QString( propAttr->GetUserName().c_str() ) != item->getValue().trimmed() ) { + return true; + } + break; //case prpModeId: // if ( QString( propAttr->GetCreationMode().c_str() ) != item->getValue().trimmed() ) { // return true; // } // break; case prpLockedId: - { - bool bLocked = item->getValue().compare( tr( "PRP_YES" ) ) == 0; - if ( propAttr->IsLocked() != bLocked ) { - return true; - } - break; - } + { + bool bLocked = item->getValue().compare( tr( "PRP_YES" ) ) == 0; + if ( propAttr->IsLocked() != bLocked ) { + return true; + } + break; + } default: - break; + break; } ++it; } diff --git a/src/SalomeApp/SalomeApp_Tools.cxx b/src/SalomeApp/SalomeApp_Tools.cxx index eeb12e91f..80f6a9639 100644 --- a/src/SalomeApp/SalomeApp_Tools.cxx +++ b/src/SalomeApp/SalomeApp_Tools.cxx @@ -37,10 +37,10 @@ */ Quantity_Color SalomeApp_Tools::color( const QColor& c ) { - Quantity_Color aColor; - if ( c.isValid() ) - aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB ); - return aColor; + Quantity_Color aColor; + if ( c.isValid() ) + aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB ); + return aColor; } /*! @@ -48,7 +48,7 @@ Quantity_Color SalomeApp_Tools::color( const QColor& c ) */ QColor SalomeApp_Tools::color( const Quantity_Color& c ) { - return QColor( (int)( c.Red() * 255 ), (int)( c.Green() * 255 ), (int)( c.Blue() * 255 ) ); + return QColor( (int)( c.Red() * 255 ), (int)( c.Green() * 255 ), (int)( c.Blue() * 255 ) ); } /*! @@ -63,32 +63,32 @@ QString SalomeApp_Tools::ExceptionToString( const SALOME::SALOME_Exception& S_ex case SALOME::COMM: case SALOME::INTERNAL_ERROR: { - message = QString( S_ex.details.text ); - QString source( S_ex.details.sourceFile ); - QString line; - line.setNum( S_ex.details.lineNumber ); - message = message + " \n" + source + " : " + line; + message = QString( S_ex.details.text ); + QString source( S_ex.details.sourceFile ); + QString line; + line.setNum( S_ex.details.lineNumber ); + message = message + " \n" + source + " : " + line; break; } case SALOME::BAD_PARAM: { - message = QString( S_ex.details.text ); + message = QString( S_ex.details.text ); #ifdef _DEBUG_ - QString source( S_ex.details.sourceFile ); - QString line; - line.setNum( S_ex.details.lineNumber ); - message = message + " \n" + source + " : " + line; + QString source( S_ex.details.sourceFile ); + QString line; + line.setNum( S_ex.details.lineNumber ); + message = message + " \n" + source + " : " + line; #endif - break; + break; } default: { - message = QString( "SALOME CORBA Exception Type invalid" ); - QString source( S_ex.details.sourceFile ); - QString line; - line.setNum( S_ex.details.lineNumber ); - message = message + " \n" + source + " : " + line; - break; + message = QString( "SALOME CORBA Exception Type invalid" ); + QString source( S_ex.details.sourceFile ); + QString line; + line.setNum( S_ex.details.lineNumber ); + message = message + " \n" + source + " : " + line; + break; } } return message; @@ -112,7 +112,7 @@ void SalomeApp_Tools::QtCatchCorbaException( const SALOME::SALOME_Exception& S_e case SALOME::BAD_PARAM: error = false; title = QObject::tr( "Engine Warning" ); - break; + break; default: title = QObject::tr( "Internal SALOME Error" ); break; @@ -120,9 +120,9 @@ void SalomeApp_Tools::QtCatchCorbaException( const SALOME::SALOME_Exception& S_e if ( error ) SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), - title, message ); + title, message ); else SUIT_MessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(), - title, message ); + title, message ); } diff --git a/src/SalomeApp/SalomeApp_TypeFilter.cxx b/src/SalomeApp/SalomeApp_TypeFilter.cxx index 9e603dcad..f792c5432 100644 --- a/src/SalomeApp/SalomeApp_TypeFilter.cxx +++ b/src/SalomeApp/SalomeApp_TypeFilter.cxx @@ -55,11 +55,11 @@ bool SalomeApp_TypeFilter::isOk( const SUIT_DataOwner* sOwner ) const _PTR(SObject) aSObj( aStudy->FindObjectID( entry.toStdString() ) ); if (aSObj) - { - _PTR(SComponent) aComponent(aSObj->GetFatherComponent()); - if ( aComponent && (aComponent->ComponentDataType() == myKind.toStdString()) ) - return true; - } + { + _PTR(SComponent) aComponent(aSObj->GetFatherComponent()); + if ( aComponent && (aComponent->ComponentDataType() == myKind.toStdString()) ) + return true; + } } return false; diff --git a/src/SalomeApp/SalomeApp_VisualState.cxx b/src/SalomeApp/SalomeApp_VisualState.cxx index 4edce501e..6b27a16ae 100644 --- a/src/SalomeApp/SalomeApp_VisualState.cxx +++ b/src/SalomeApp/SalomeApp_VisualState.cxx @@ -240,11 +240,11 @@ void SalomeApp_VisualState::restoreState(int savePoint) { viewWin = views[i]; if ( !viewWin ) - continue; + continue; // wait untill the window is really shown. This step fixes MANY bugs.. // while ( !vm->isVisible() ) - // qApp->processEvents(); + // qApp->processEvents(); viewWin->setWindowTitle( ip->getValue( viewerEntry, j ).c_str() ); @@ -279,8 +279,8 @@ void SalomeApp_VisualState::restoreState(int savePoint) { if ( !viewersParameters.contains( views[i] ) ) { - viewersParameters[ views[i] ] = views[i]->getVisualParameters(); - // printf ( "store VP for viewWin \"%s\": %s\n", views[i]->name(), views[i]->getVisualParameters().toLatin1().constData() ); + viewersParameters[ views[i] ] = views[i]->getVisualParameters(); + // printf ( "store VP for viewWin \"%s\": %s\n", views[i]->name(), views[i]->getVisualParameters().toLatin1().constData() ); } } } @@ -331,7 +331,7 @@ void SalomeApp_VisualState::restoreState(int savePoint) // QPtrVector views = it.current()->getViews(); // for ( int i = 0; i < view_count; i++ ) { // if ( activeViewName == views[i]->name() ) - // views[i]->setFocus(); + // views[i]->setFocus(); // } // } } diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index a4f881c69..d56edde6e 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -180,7 +180,7 @@ public: if ( myExtAppVersion == "APP_VERSION" ) { if ( myExtAppName != "SalomeApp" ) myExtAppVersion = ""; - else myExtAppVersion = salomeVersion(); + else myExtAppVersion = salomeVersion(); } } } @@ -201,23 +201,23 @@ protected: QString fname = QFileInfo( _fname ).fileName(); if( exp.exactMatch( fname ) ) { - QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts ); - int major=0, minor=0; - major = vers[0].toInt(); - minor = vers[1].toInt(); - if( vers_exp.indexIn( vers[2] )==-1 ) - return -1; - int release = 0, dev1 = 0, dev2 = 0; - release = vers_exp.cap( 1 ).toInt(); - dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1(); - dev2 = vers_exp.cap( 3 ).toInt(); - - int dev = dev1*100+dev2, id = major; - id*=100; id+=minor; - id*=100; id+=release; - id*=10000; - if ( dev > 0 ) id+=dev-10000; - return id; + QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts ); + int major=0, minor=0; + major = vers[0].toInt(); + minor = vers[1].toInt(); + if( vers_exp.indexIn( vers[2] )==-1 ) + return -1; + int release = 0, dev1 = 0, dev2 = 0; + release = vers_exp.cap( 1 ).toInt(); + dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1(); + dev2 = vers_exp.cap( 3 ).toInt(); + + int dev = dev1*100+dev2, id = major; + id*=100; id+=minor; + id*=100; id+=release; + id*=10000; + if ( dev > 0 ) id+=dev-10000; + return id; } } @@ -473,22 +473,22 @@ int main( int argc, char **argv ) splash->setProgress( 0, sc.totalSteps() ); // start check loop while ( true ) { - int step = sc.currentStep(); - int total = sc.totalSteps(); - QString msg = sc.currentMessage(); - QString err = sc.error(); - if ( !err.isEmpty() ) { - QtxSplash::setError( err ); - QApplication::instance()->processEvents(); - result = -1; - break; - } - QtxSplash::setStatus( msg, step ); - QApplication::instance()->processEvents(); - if ( step >= total ) - break; - // ...block this thread until servers checking is finished - _SplashStarted.wait( &_SplashMutex ); + int step = sc.currentStep(); + int total = sc.totalSteps(); + QString msg = sc.currentMessage(); + QString err = sc.error(); + if ( !err.isEmpty() ) { + QtxSplash::setError( err ); + QApplication::instance()->processEvents(); + result = -1; + break; + } + QtxSplash::setStatus( msg, step ); + QApplication::instance()->processEvents(); + if ( step >= total ) + break; + // ...block this thread until servers checking is finished + _SplashStarted.wait( &_SplashMutex ); } // ...unlock mutex 'cause it is no more needed _SplashMutex.unlock(); @@ -506,7 +506,7 @@ int main( int argc, char **argv ) // Launch GUI activator if ( isGUI ) { if ( splash ) - splash->setStatus( QApplication::translate( "", "Activating desktop..." ) ); + splash->setStatus( QApplication::translate( "", "Activating desktop..." ) ); // ...retrieve Session interface reference CORBA::Object_var obj = _NS->Resolve( "/Kernel/Session" ); SALOME::Session_var session = SALOME::Session::_narrow( obj ) ; @@ -535,28 +535,28 @@ int main( int argc, char **argv ) SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 ); if ( aGUIApp ) { - Style_Salome::initialize( aGUIApp->resourceMgr() ); - if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) ) - Style_Salome::apply(); - - if ( !isFound( "noexcepthandler", argc, argv ) ) - _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application - // aGUISession contains SalomeApp_ExceptionHandler - // Run GUI loop - MESSAGE( "run(): starting the main event loop" ); - - if ( splash ) - splash->finish( aGUIApp->desktop() ); - - result = _qappl.exec(); - - splash = 0; - - if ( result == SUIT_Session::NORMAL ) { // desktop is closed by user from GUI - shutdown = aGUISession->exitFlags(); - _SessionMutex.lock(); - break; - } + Style_Salome::initialize( aGUIApp->resourceMgr() ); + if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) ) + Style_Salome::apply(); + + if ( !isFound( "noexcepthandler", argc, argv ) ) + _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application + // aGUISession contains SalomeApp_ExceptionHandler + // Run GUI loop + MESSAGE( "run(): starting the main event loop" ); + + if ( splash ) + splash->finish( aGUIApp->desktop() ); + + result = _qappl.exec(); + + splash = 0; + + if ( result == SUIT_Session::NORMAL ) { // desktop is closed by user from GUI + shutdown = aGUISession->exitFlags(); + _SessionMutex.lock(); + break; + } } delete aGUISession; diff --git a/src/Session/Session_ServerCheck.cxx b/src/Session/Session_ServerCheck.cxx index 4003b22ac..37218c190 100644 --- a/src/Session/Session_ServerCheck.cxx +++ b/src/Session/Session_ServerCheck.cxx @@ -265,8 +265,8 @@ void Session_ServerCheck::run() CORBA::Object_var obj = orb->resolve_initial_references( "NameService" ); CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow( obj ); if ( !CORBA::is_nil( _root_context ) ) { - setStep( ++current * myAttempts ); - break; + setStep( ++current * myAttempts ); + break; } } catch( CORBA::COMM_FAILURE& ) { @@ -296,11 +296,11 @@ void Session_ServerCheck::run() CORBA::Object_var obj = NS.Resolve( "/Registry" ); Registry::Components_var registry = Registry::Components::_narrow( obj ); if ( !CORBA::is_nil( registry ) ) { - MESSAGE( "/Registry is found" ); - registry->ping(); - MESSAGE( "Registry was activated" ); - setStep( ++current * myAttempts ); - break; + MESSAGE( "/Registry is found" ); + registry->ping(); + MESSAGE( "Registry was activated" ); + setStep( ++current * myAttempts ); + break; } } catch ( ServiceUnreachable& ) { @@ -344,11 +344,11 @@ void Session_ServerCheck::run() CORBA::Object_var obj = NS.Resolve( "/myStudyManager" ); SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow( obj ); if ( !CORBA::is_nil( studyManager ) ) { - MESSAGE( "/myStudyManager is found" ); - studyManager->ping(); - MESSAGE( "StudyManager was activated" ); - setStep( ++current * myAttempts ); - break; + MESSAGE( "/myStudyManager is found" ); + studyManager->ping(); + MESSAGE( "StudyManager was activated" ); + setStep( ++current * myAttempts ); + break; } } catch ( ServiceUnreachable& ) { @@ -392,11 +392,11 @@ void Session_ServerCheck::run() CORBA::Object_var obj = NS.Resolve( "/Kernel/ModulCatalog" ); SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow( obj ); if ( !CORBA::is_nil( catalog ) ){ - MESSAGE( "/Kernel/ModulCatalog is found" ); - catalog->ping(); - MESSAGE( "ModuleCatalog was activated" ); - setStep( ++current * myAttempts ); - break; + MESSAGE( "/Kernel/ModulCatalog is found" ); + catalog->ping(); + MESSAGE( "ModuleCatalog was activated" ); + setStep( ++current * myAttempts ); + break; } } catch ( ServiceUnreachable& ) { @@ -440,11 +440,11 @@ void Session_ServerCheck::run() CORBA::Object_var obj = NS.Resolve( "/Kernel/Session" ); SALOME::Session_var session = SALOME::Session::_narrow( obj ); if ( !CORBA::is_nil( session ) ) { - MESSAGE( "/Kernel/Session is found" ); - session->ping(); - MESSAGE( "SALOME_Session was activated" ); - setStep( ++current * myAttempts ); - break; + MESSAGE( "/Kernel/Session is found" ); + session->ping(); + MESSAGE( "SALOME_Session was activated" ); + setStep( ++current * myAttempts ); + break; } } catch ( ServiceUnreachable& ) { @@ -482,45 +482,45 @@ void Session_ServerCheck::run() setStep( current * myAttempts + i ); try { - CORBA::ORB_var orb = CORBA::ORB_init( argc, argv ); - SALOME_NamingService &NS = *SINGLETON_::Instance(); - ASSERT( SINGLETON_::IsAlreadyExisting() ); - NS.init_orb( orb ); - QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( Kernel_Utils::GetHostname().c_str() ); - CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() ); - Engines::Container_var FScontainer = Engines::Container::_narrow( obj ); - if ( !CORBA::is_nil( FScontainer ) ) { - MESSAGE( containerName.toLatin1().constData() << " is found" ); - FScontainer->ping(); - MESSAGE( "FactoryServer container was activated" ); - setStep( ++current * myAttempts ); - break; - } + CORBA::ORB_var orb = CORBA::ORB_init( argc, argv ); + SALOME_NamingService &NS = *SINGLETON_::Instance(); + ASSERT( SINGLETON_::IsAlreadyExisting() ); + NS.init_orb( orb ); + QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( Kernel_Utils::GetHostname().c_str() ); + CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() ); + Engines::Container_var FScontainer = Engines::Container::_narrow( obj ); + if ( !CORBA::is_nil( FScontainer ) ) { + MESSAGE( containerName.toLatin1().constData() << " is found" ); + FScontainer->ping(); + MESSAGE( "FactoryServer container was activated" ); + setStep( ++current * myAttempts ); + break; + } } catch ( ServiceUnreachable& ) { - MESSAGE( "Caught exception: Naming Service unreachable." ); - error = "Naming service unreachable"; + MESSAGE( "Caught exception: Naming Service unreachable." ); + error = "Naming service unreachable"; } catch ( CORBA::COMM_FAILURE& ) { - MESSAGE( "Caught CORBA::SystemException CommFailure." ); - error = "Caught CORBA::SystemException CommFailure."; + MESSAGE( "Caught CORBA::SystemException CommFailure." ); + error = "Caught CORBA::SystemException CommFailure."; } catch ( CORBA::SystemException& ) { - MESSAGE( "Caught CORBA::SystemException." ); - error = "Caught CORBA::SystemException."; + MESSAGE( "Caught CORBA::SystemException." ); + error = "Caught CORBA::SystemException."; } catch ( CORBA::Exception& ) { - MESSAGE( "Caught CORBA::Exception." ); - error = "Caught CORBA::Exception."; + MESSAGE( "Caught CORBA::Exception." ); + error = "Caught CORBA::Exception."; } catch (...) { - MESSAGE( "Caught unknown exception." ); - error = "Caught unknown exception."; + MESSAGE( "Caught unknown exception." ); + error = "Caught unknown exception."; } if ( i == myAttempts-1 ) { - setError( tr( "C++ container is not found.\n%1" ).arg ( error ) ); - return; + setError( tr( "C++ container is not found.\n%1" ).arg ( error ) ); + return; } } } @@ -533,45 +533,45 @@ void Session_ServerCheck::run() setStep( current * myAttempts + i ); try { - CORBA::ORB_var orb = CORBA::ORB_init( argc, argv ); - SALOME_NamingService &NS = *SINGLETON_::Instance(); - ASSERT( SINGLETON_::IsAlreadyExisting() ); - NS.init_orb( orb ); - QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( Kernel_Utils::GetHostname().c_str() ); - CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() ); - Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj ); - if ( !CORBA::is_nil( FSPcontainer ) ) { - MESSAGE( containerName.toLatin1().constData() << " is found" ); - FSPcontainer->ping(); - MESSAGE("FactoryServerPy container was activated"); - setStep( ++current * myAttempts ); - break; - } + CORBA::ORB_var orb = CORBA::ORB_init( argc, argv ); + SALOME_NamingService &NS = *SINGLETON_::Instance(); + ASSERT( SINGLETON_::IsAlreadyExisting() ); + NS.init_orb( orb ); + QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( Kernel_Utils::GetHostname().c_str() ); + CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() ); + Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj ); + if ( !CORBA::is_nil( FSPcontainer ) ) { + MESSAGE( containerName.toLatin1().constData() << " is found" ); + FSPcontainer->ping(); + MESSAGE("FactoryServerPy container was activated"); + setStep( ++current * myAttempts ); + break; + } } catch ( ServiceUnreachable& ) { - MESSAGE( "Caught exception: Naming Service unreachable." ); - error = "Naming service unreachable"; + MESSAGE( "Caught exception: Naming Service unreachable." ); + error = "Naming service unreachable"; } catch ( CORBA::COMM_FAILURE& ) { - MESSAGE( "Caught CORBA::SystemException CommFailure." ); - error = "Caught CORBA::SystemException CommFailure."; + MESSAGE( "Caught CORBA::SystemException CommFailure." ); + error = "Caught CORBA::SystemException CommFailure."; } catch ( CORBA::SystemException& ) { - MESSAGE( "Caught CORBA::SystemException." ); - error = "Caught CORBA::SystemException."; + MESSAGE( "Caught CORBA::SystemException." ); + error = "Caught CORBA::SystemException."; } catch ( CORBA::Exception& ) { - MESSAGE( "Caught CORBA::Exception." ); - error = "Caught CORBA::Exception."; + MESSAGE( "Caught CORBA::Exception." ); + error = "Caught CORBA::Exception."; } catch (...) { - MESSAGE( "Caught unknown exception." ); - error = "Caught unknown exception."; + MESSAGE( "Caught unknown exception." ); + error = "Caught unknown exception."; } if ( i == myAttempts-1 ) { - setError( tr( "Python container is not found.\n%1" ).arg ( error ) ); - return; + setError( tr( "Python container is not found.\n%1" ).arg ( error ) ); + return; } } } @@ -584,45 +584,45 @@ void Session_ServerCheck::run() setStep( current * myAttempts + i ); try { - CORBA::ORB_var orb = CORBA::ORB_init( argc, argv ); - SALOME_NamingService &NS = *SINGLETON_::Instance(); - ASSERT( SINGLETON_::IsAlreadyExisting() ); - NS.init_orb( orb ); - QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( Kernel_Utils::GetHostname().c_str() ); - CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() ); - Engines::Container_var SVcontainer = Engines::Container::_narrow( obj ); - if ( !CORBA::is_nil( SVcontainer ) ) { - MESSAGE( containerName.toLatin1().constData() << " is found" ); - SVcontainer->ping(); - MESSAGE("SuperVisionContainer container was activated"); - setStep( ++current * myAttempts ); - break; - } + CORBA::ORB_var orb = CORBA::ORB_init( argc, argv ); + SALOME_NamingService &NS = *SINGLETON_::Instance(); + ASSERT( SINGLETON_::IsAlreadyExisting() ); + NS.init_orb( orb ); + QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( Kernel_Utils::GetHostname().c_str() ); + CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() ); + Engines::Container_var SVcontainer = Engines::Container::_narrow( obj ); + if ( !CORBA::is_nil( SVcontainer ) ) { + MESSAGE( containerName.toLatin1().constData() << " is found" ); + SVcontainer->ping(); + MESSAGE("SuperVisionContainer container was activated"); + setStep( ++current * myAttempts ); + break; + } } catch ( ServiceUnreachable& ) { - MESSAGE( "Caught exception: Naming Service unreachable." ); - error = "Naming service unreachable"; + MESSAGE( "Caught exception: Naming Service unreachable." ); + error = "Naming service unreachable"; } catch ( CORBA::COMM_FAILURE& ) { - MESSAGE( "Caught CORBA::SystemException CommFailure." ); - error = "Caught CORBA::SystemException CommFailure."; + MESSAGE( "Caught CORBA::SystemException CommFailure." ); + error = "Caught CORBA::SystemException CommFailure."; } catch ( CORBA::SystemException& ) { - MESSAGE( "Caught CORBA::SystemException." ); - error = "Caught CORBA::SystemException."; + MESSAGE( "Caught CORBA::SystemException." ); + error = "Caught CORBA::SystemException."; } catch ( CORBA::Exception& ) { - MESSAGE( "Caught CORBA::Exception." ); - error = "Caught CORBA::Exception."; + MESSAGE( "Caught CORBA::Exception." ); + error = "Caught CORBA::Exception."; } catch (...) { - MESSAGE( "Caught unknown exception." ); - error = "Caught unknown exception."; + MESSAGE( "Caught unknown exception." ); + error = "Caught unknown exception."; } if ( i == myAttempts-1 ) { - setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) ); - return; + setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) ); + return; } } } diff --git a/src/Session/Session_ServerLauncher.cxx b/src/Session/Session_ServerLauncher.cxx index ab558f666..14f952927 100755 --- a/src/Session/Session_ServerLauncher.cxx +++ b/src/Session/Session_ServerLauncher.cxx @@ -47,13 +47,13 @@ Session_ServerLauncher::Session_ServerLauncher() constructor */ Session_ServerLauncher::Session_ServerLauncher(int argc, - char ** argv, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - QMutex *GUIMutex, - QWaitCondition *ServerLaunch, - QMutex *SessionMutex, - QWaitCondition *SessionStarted) + char ** argv, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + QMutex *GUIMutex, + QWaitCondition *ServerLaunch, + QMutex *SessionMutex, + QWaitCondition *SessionStarted) { _argc = argc; _argv = argv; @@ -117,60 +117,60 @@ void Session_ServerLauncher::CheckArgs() SCRUTE(_argv[iarg]); _argCopy.push_back(_argv[iarg]); switch (argState) - { - case 0: // looking for "--with" - { - if (strcmp(_argv[iarg],"--with")==0) - argState = 1; - break; - } - case 1: // looking for server type - { - for (int i=0; i1) { for (int i=0; icreate_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION); + _root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION); // default = NO_IMPLICIT_ACTIVATION PortableServer::ThreadPolicy_var threadPolicy = - _root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL); + _root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL); // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL // create policy list CORBA::PolicyList policyList; policyList.length(2); policyList[0] = PortableServer::ImplicitActivationPolicy:: - _duplicate(implicitActivation); + _duplicate(implicitActivation); policyList[1] = PortableServer::ThreadPolicy:: - _duplicate(threadPolicy); + _duplicate(threadPolicy); PortableServer::POAManager_var nil_mgr - = PortableServer::POAManager::_nil(); + = PortableServer::POAManager::_nil(); factory_poa = _root_poa->create_POA("factory_poa", - nil_mgr, - policyList); + nil_mgr, + policyList); //with nil_mgr instead of pman, //a new POA manager is created with the new POA @@ -414,7 +414,7 @@ void Session_ServerThread::ActivateEngine(int /*argc*/, char ** /*argv*/) } void Session_ServerThread::ActivateSession(int argc, - char ** argv) + char ** argv) { MESSAGE("Session_ServerThread::ActivateSession() not implemented!"); } @@ -423,11 +423,11 @@ void Session_ServerThread::ActivateSession(int argc, constructor */ Session_SessionThread::Session_SessionThread(int argc, - char** argv, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - QMutex* GUIMutex, - QWaitCondition* GUILauncher) + char** argv, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + QMutex* GUIMutex, + QWaitCondition* GUILauncher) : Session_ServerThread(argc, argv, orb, poa), _GUIMutex( GUIMutex ), _GUILauncher( GUILauncher ) @@ -442,7 +442,7 @@ Session_SessionThread::~Session_SessionThread() } void Session_SessionThread::ActivateSession(int argc, - char ** argv) + char ** argv) { try { MESSAGE("Session thread started"); diff --git a/src/Session/Session_ServerThread.hxx b/src/Session/Session_ServerThread.hxx index 549dd3021..f92c8fadf 100755 --- a/src/Session/Session_ServerThread.hxx +++ b/src/Session/Session_ServerThread.hxx @@ -47,9 +47,9 @@ public: Session_ServerThread(); Session_ServerThread(int argc, - char ** argv, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa); + char ** argv, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa); virtual ~Session_ServerThread(); void Init(); protected: @@ -77,10 +77,10 @@ class SESSION_EXPORT Session_SessionThread : public Session_ServerThread public: Session_SessionThread() {} Session_SessionThread(int argc, - char** argv, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - QMutex* GUIMutex, + char** argv, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + QMutex* GUIMutex, QWaitCondition* GUILauncher); virtual ~Session_SessionThread(); diff --git a/src/Session/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index 59ea32ac2..21c0d2e78 100755 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -54,11 +54,11 @@ using namespace std; constructor */ SALOME_Session_i::SALOME_Session_i(int argc, - char ** argv, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - QMutex* GUIMutex, - QWaitCondition* GUILauncher) + char ** argv, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + QMutex* GUIMutex, + QWaitCondition* GUILauncher) { _argc = argc ; _argv = argv ; @@ -78,8 +78,8 @@ SALOME_Session_i::SALOME_Session_i(int argc, Engines::Component_ptr SALOME_Session_i::GetComponent(const char* theLibraryName) { typedef Engines::Component_ptr TGetImpl(CORBA::ORB_ptr, - PortableServer::POA_ptr, - SALOME_NamingService*,QMutex*); + PortableServer::POA_ptr, + SALOME_NamingService*,QMutex*); OSD_SharedLibrary aSharedLibrary(const_cast(theLibraryName)); if(aSharedLibrary.DlOpen(OSD_RTLD_LAZY)) if(OSD_Function anOSDFun = aSharedLibrary.DlSymb("GetImpl")) @@ -223,7 +223,7 @@ bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint) virtual void Execute() { SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy(); if ( study ) { - study->restoreState(_savePoint); + study->restoreState(_savePoint); } } }; @@ -254,7 +254,7 @@ void SALOME_Session_i::emitMessage(const char* theMessage) if ( SUIT_Session::session() ) { if ( SUIT_Session::session()->activeApplication() ) { if ( SUIT_Session::session()->activeApplication()->desktop() ) { - ProcessVoidEvent( new TEvent(theMessage) ); + ProcessVoidEvent( new TEvent(theMessage) ); } } } diff --git a/src/Session/Session_Session_i.hxx b/src/Session/Session_Session_i.hxx index c691a2ba2..1fdc144d1 100755 --- a/src/Session/Session_Session_i.hxx +++ b/src/Session/Session_Session_i.hxx @@ -39,7 +39,7 @@ class QMutex; class QWaitCondition; class SESSION_EXPORT SALOME_Session_i: public virtual POA_SALOME::Session, - public virtual PortableServer::ServantBase + public virtual PortableServer::ServantBase { public: SALOME_Session_i(int argc, diff --git a/src/Style/Style_Model.cxx b/src/Style/Style_Model.cxx index 43bb896c0..e3f8fd6ca 100644 --- a/src/Style/Style_Model.cxx +++ b/src/Style/Style_Model.cxx @@ -41,9 +41,9 @@ static QColor mixColors( const QColor& c1, const QColor& c2 ) { return QColor( (c1.red() + c2.red() ) / 2, - (c1.green() + c2.green() ) / 2, - (c1.blue() + c2.blue() ) / 2, - (c1.alpha() + c2.alpha() ) / 2 ); + (c1.green() + c2.green() ) / 2, + (c1.blue() + c2.blue() ) / 2, + (c1.alpha() + c2.alpha() ) / 2 ); } /*! @@ -125,7 +125,7 @@ void Style_Model::fromApplication( bool reset ) for ( int i = (int)QPalette::Active; i <= (int)QPalette::Inactive; i++ ) { for ( int j = (int)Style_Model::WindowText; j < (int)Style_Model::NColorRoles; j++ ) { myColors[ (QPalette::ColorGroup)i ][ (Style_Model::ColorRole)j ] = - myAppData->myPalette.color( (QPalette::ColorGroup)i, (QPalette::ColorRole)j ); + myAppData->myPalette.color( (QPalette::ColorGroup)i, (QPalette::ColorRole)j ); } } @@ -281,7 +281,7 @@ void Style_Model::fromResources( QtxResourceMgr* resMgr, const QString& resSecti setWidgetEffect( (WidgetEffect)effect ); } else if ( resourceMgr()->hasValue( section, "is-highlight-widget" ) || - resourceMgr()->hasValue( section, "is-raising-widget" ) ) { + resourceMgr()->hasValue( section, "is-raising-widget" ) ) { bool highlight = resourceMgr()->booleanValue( section, "is-highlight-widget", false ); bool autoraise = resourceMgr()->booleanValue( section, "is-highlight-widget", false ); if ( highlight ) @@ -504,7 +504,7 @@ QColor Style_Model::color( ColorRole role, QPalette::ColorGroup cg ) const \sa color() */ void Style_Model::setColor( Style_Model::ColorRole role, const QColor& active, - const QColor& inactive, const QColor& disabled ) + const QColor& inactive, const QColor& disabled ) { QColor ac = active, ic = inactive, dc = disabled; @@ -854,7 +854,7 @@ void Style_Model::readColorValue( ColorRole role, const QString& prefix ) \sa readColorValue() */ void Style_Model::writeColorValue( ColorRole role, const QString& prefix, - QtxResourceMgr* resMgr, const QString& resSection ) const + QtxResourceMgr* resMgr, const QString& resSection ) const { QString active = QString( "%1-color" ).arg( prefix ); QString inactive = QString( "%1-color-inactive" ).arg( prefix ); diff --git a/src/Style/Style_PrefDlg.cxx b/src/Style/Style_PrefDlg.cxx index 10d1e397b..a5627e63f 100644 --- a/src/Style/Style_PrefDlg.cxx +++ b/src/Style/Style_PrefDlg.cxx @@ -211,7 +211,7 @@ void Style_PrefDlg::PaletteEditor::setColor( int id, QPalette::ColorGroup cg, co \internal */ void Style_PrefDlg::PaletteEditor::setColor( int id, const QColor& active, - const QColor& inactive, const QColor& disabled ) + const QColor& inactive, const QColor& disabled ) { setColor( id, QPalette::Active, active ); setColor( id, QPalette::Inactive, inactive.isValid() ? inactive : active ); @@ -267,61 +267,61 @@ void Style_PrefDlg::PaletteEditor::fromColor( const QColor& c ) const QPalette pal = QPalette( c ); for ( int i = 0; i < (int)Style_Model::NColorRoles; i++ ) { setColor( i, - pal.color( QPalette::Active, (QPalette::ColorRole)i ), - pal.color( QPalette::Inactive, (QPalette::ColorRole)i ), - pal.color( QPalette::Disabled, (QPalette::ColorRole)i ) ); + pal.color( QPalette::Active, (QPalette::ColorRole)i ), + pal.color( QPalette::Inactive, (QPalette::ColorRole)i ), + pal.color( QPalette::Disabled, (QPalette::ColorRole)i ) ); } // Header setColor( Style_Model::Header, - pal.color( QPalette::Active, QPalette::Button ), - pal.color( QPalette::Inactive, QPalette::Button ), - pal.color( QPalette::Disabled, QPalette::Button ) ); + pal.color( QPalette::Active, QPalette::Button ), + pal.color( QPalette::Inactive, QPalette::Button ), + pal.color( QPalette::Disabled, QPalette::Button ) ); // Checked setColor( Style_Model::Checked, - pal.color( QPalette::Active, QPalette::Base ), - pal.color( QPalette::Inactive, QPalette::Base ), - pal.color( QPalette::Disabled, QPalette::Base ) ); + pal.color( QPalette::Active, QPalette::Base ), + pal.color( QPalette::Inactive, QPalette::Base ), + pal.color( QPalette::Disabled, QPalette::Base ) ); // Lines setColor( Style_Model::Lines, - pal.color( QPalette::Active, QPalette::Mid ), - pal.color( QPalette::Inactive, QPalette::Mid ), - pal.color( QPalette::Disabled, QPalette::Mid ) ); + pal.color( QPalette::Active, QPalette::Mid ), + pal.color( QPalette::Inactive, QPalette::Mid ), + pal.color( QPalette::Disabled, QPalette::Mid ) ); // Slider setColor( Style_Model::Slider, - pal.color( QPalette::Active, QPalette::Button ), - pal.color( QPalette::Inactive, QPalette::Button ), - pal.color( QPalette::Disabled, QPalette::Button ) ); + pal.color( QPalette::Active, QPalette::Button ), + pal.color( QPalette::Inactive, QPalette::Button ), + pal.color( QPalette::Disabled, QPalette::Button ) ); // ProgressBar setColor( Style_Model::ProgressBar, - pal.color( QPalette::Active, QPalette::Highlight ), - pal.color( QPalette::Inactive, QPalette::Highlight ), - pal.color( QPalette::Disabled, QPalette::Highlight ) ); + pal.color( QPalette::Active, QPalette::Highlight ), + pal.color( QPalette::Inactive, QPalette::Highlight ), + pal.color( QPalette::Disabled, QPalette::Highlight ) ); // FieldLight setColor( Style_Model::FieldLight, - pal.color( QPalette::Active, QPalette::Light ), - pal.color( QPalette::Inactive, QPalette::Light ), - pal.color( QPalette::Disabled, QPalette::Light ) ); + pal.color( QPalette::Active, QPalette::Light ), + pal.color( QPalette::Inactive, QPalette::Light ), + pal.color( QPalette::Disabled, QPalette::Light ) ); // FieldDark setColor( Style_Model::FieldDark, - pal.color( QPalette::Active, QPalette::Mid ).light( 125 ), - pal.color( QPalette::Inactive, QPalette::Mid ).light( 125 ), - pal.color( QPalette::Disabled, QPalette::Mid ).light( 125 ) ); + pal.color( QPalette::Active, QPalette::Mid ).light( 125 ), + pal.color( QPalette::Inactive, QPalette::Mid ).light( 125 ), + pal.color( QPalette::Disabled, QPalette::Mid ).light( 125 ) ); // GridLine setColor( Style_Model::GridLine, - pal.color( QPalette::Active, QPalette::Mid ), - pal.color( QPalette::Inactive, QPalette::Mid ), - pal.color( QPalette::Disabled, QPalette::Mid ) ); + pal.color( QPalette::Active, QPalette::Mid ), + pal.color( QPalette::Inactive, QPalette::Mid ), + pal.color( QPalette::Disabled, QPalette::Mid ) ); // HighlightWidget setColor( Style_Model::HighlightWidget, - pal.color( QPalette::Active, QPalette::Button ), - pal.color( QPalette::Inactive, QPalette::Button ), - pal.color( QPalette::Disabled, QPalette::Button ) ); + pal.color( QPalette::Active, QPalette::Button ), + pal.color( QPalette::Inactive, QPalette::Button ), + pal.color( QPalette::Disabled, QPalette::Button ) ); // HighlightWidget setColor( Style_Model::HighlightBorder, - pal.color( QPalette::Active, QPalette::Button ).dark( 100 ), - pal.color( QPalette::Inactive, QPalette::Button ).dark( 100 ), - pal.color( QPalette::Disabled, QPalette::Button ).dark( 100 ) ); + pal.color( QPalette::Active, QPalette::Button ).dark( 100 ), + pal.color( QPalette::Inactive, QPalette::Button ).dark( 100 ), + pal.color( QPalette::Disabled, QPalette::Button ).dark( 100 ) ); // Pointer setColor( Style_Model::Pointer, Qt::black, Qt::black, Qt::black ); @@ -331,24 +331,24 @@ void Style_PrefDlg::PaletteEditor::fromColor( const QColor& c ) // BorderTop setColor( Style_Model::BorderTop, - aDarkActive.lighter(), - aDarkInactive.lighter(), - aDarkDisabled.lighter() ); + aDarkActive.lighter(), + aDarkInactive.lighter(), + aDarkDisabled.lighter() ); // BorderBottom setColor( Style_Model::BorderBottom, - aDarkActive.darker(), - aDarkInactive.darker(), - aDarkDisabled.darker() ); + aDarkActive.darker(), + aDarkInactive.darker(), + aDarkDisabled.darker() ); // TabBorderTop setColor( Style_Model::TabBorderTop, - aDarkActive.light().light().light(), - aDarkInactive.light().light().light(), - aDarkDisabled.light().light().light() ); + aDarkActive.light().light().light(), + aDarkInactive.light().light().light(), + aDarkDisabled.light().light().light() ); // TabBorderBottom setColor( Style_Model::TabBorderBottom, - aDarkActive.dark().dark().dark(), - aDarkInactive.dark().dark().dark(), - aDarkDisabled.dark().dark().dark() ); + aDarkActive.dark().dark().dark(), + aDarkInactive.dark().dark().dark(), + aDarkDisabled.dark().dark().dark() ); } /*! @@ -671,9 +671,9 @@ Style_PrefDlg::Style_PrefDlg( QWidget* parent ) connect( myStyleCheck, SIGNAL( toggled( bool ) ), fr, SLOT( setEnabled( bool ) ) ); connect( myStylesList, SIGNAL( itemSelectionChanged() ), this, SLOT( onStyleChanged() ) ); connect( myStylesList, SIGNAL( itemChanged( QListWidgetItem* ) ), - this, SLOT( onItemChanged( QListWidgetItem* ) ) ); + this, SLOT( onItemChanged( QListWidgetItem* ) ) ); connect( myStylesList, SIGNAL( itemDoubleClicked( QListWidgetItem* ) ), - this, SLOT( onApply() ) ); + this, SLOT( onApply() ) ); connect( myLinesCombo, SIGNAL( activated( int ) ), this, SLOT( onLinesType() ) ); connect( myPaletteEditor, SIGNAL( changed() ), this, SIGNAL( styleChanged() ) ); connect( myFontEdit, SIGNAL( changed( QFont ) ), this, SIGNAL( styleChanged() ) ); @@ -688,7 +688,7 @@ Style_PrefDlg::Style_PrefDlg( QWidget* parent ) connect( mySplitterLength, SIGNAL( valueChanged( int ) ), this, SIGNAL( styleChanged() ) ); connect( mySliderSize, SIGNAL( valueChanged( int ) ), this, SIGNAL( styleChanged() ) ); connect( aGroup, SIGNAL( buttonClicked( QAbstractButton* ) ), - this, SLOT( onEffectChanged( QAbstractButton* ) ) ); + this, SLOT( onEffectChanged( QAbstractButton* ) ) ); connect( this, SIGNAL( styleChanged() ), this, SLOT( onChanged() ) ); connect( this, SIGNAL( dlgApply() ), this, SLOT( onApply() ) ); @@ -726,13 +726,13 @@ void Style_PrefDlg::keyPressEvent( QKeyEvent* e ) QListWidgetItem* item = myStylesList->currentItem(); if ( item && item->data( TypeRole ).toInt() == User ) { if ( QMessageBox::question( this, - tr( "Delete user theme" ), - tr( "Remove theme %1?" ).arg( item->text() ), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::Yes ) == QMessageBox::Yes ) { - resourceMgr()->remove( item->data( NameRole ).toString() ); - resourceMgr()->save(); - delete item; + tr( "Delete user theme" ), + tr( "Remove theme %1?" ).arg( item->text() ), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::Yes ) == QMessageBox::Yes ) { + resourceMgr()->remove( item->data( NameRole ).toString() ); + resourceMgr()->save(); + delete item; } } } @@ -806,24 +806,24 @@ void Style_PrefDlg::toModel( Style_Model* model ) const // ... first set Button color 'cause it is used to calculate other ones if ( myPaletteEditor->isAuto() ) model->setColor( Style_Model::Button, - myPaletteEditor->color( Style_Model::Button, QPalette::Active ) ); + myPaletteEditor->color( Style_Model::Button, QPalette::Active ) ); else model->setColor( Style_Model::Button, - myPaletteEditor->color( Style_Model::Button, QPalette::Active ), - myPaletteEditor->color( Style_Model::Button, QPalette::Inactive ), - myPaletteEditor->color( Style_Model::Button, QPalette::Disabled )); + myPaletteEditor->color( Style_Model::Button, QPalette::Active ), + myPaletteEditor->color( Style_Model::Button, QPalette::Inactive ), + myPaletteEditor->color( Style_Model::Button, QPalette::Disabled )); // ... then set all other colors for ( int i = (int)Style_Model::WindowText; i < (int)Style_Model::LastColor; i++ ) { if ( i == Style_Model::NoRole ) continue; // not supported if ( i == Style_Model::Button ) continue; // already set if ( myPaletteEditor->isAuto() ) model->setColor( (Style_Model::ColorRole)i, - myPaletteEditor->color( i, QPalette::Active ) ); + myPaletteEditor->color( i, QPalette::Active ) ); else model->setColor( (Style_Model::ColorRole)i, - myPaletteEditor->color( i, QPalette::Active ), - myPaletteEditor->color( i, QPalette::Inactive ), - myPaletteEditor->color( i, QPalette::Disabled )); + myPaletteEditor->color( i, QPalette::Active ), + myPaletteEditor->color( i, QPalette::Inactive ), + myPaletteEditor->color( i, QPalette::Disabled )); } model->setAutoPalette( myPaletteEditor->isAuto() ); // internal // font @@ -1019,7 +1019,7 @@ void Style_PrefDlg::onItemChanged( QListWidgetItem* item ) myStylesList->blockSignals( false ); } onChanged(); -} +} /*! \brief Called when widget effect is changed diff --git a/src/Style/Style_ResourceMgr.cxx b/src/Style/Style_ResourceMgr.cxx index 597e99d21..22cef09fc 100644 --- a/src/Style/Style_ResourceMgr.cxx +++ b/src/Style/Style_ResourceMgr.cxx @@ -81,8 +81,8 @@ QStringList Style_ResourceMgr::styles( StyleType type, bool sort ) setWorkingMode( IgnoreUserValues ); QMutableListIterator it( sl ); while ( it.hasNext() ) { - QString s = it.next(); - if ( hasSection( s ) ) it.remove(); + QString s = it.next(); + if ( hasSection( s ) ) it.remove(); } } break; diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index eeb12969f..82d58ff71 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -398,7 +398,7 @@ void Style_Salome::unpolish( QWidget* w ) \param w widget */ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComplex* opt, - QPainter* p, const QWidget* w ) const + QPainter* p, const QWidget* w ) const { if ( checkDebugLevel(4) ) { QWindowsStyle::drawComplexControl( cc, opt, p, w ); @@ -415,14 +415,14 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp double aRad = model()->widgetRounding( Style_Model::EditRadius ); bool antialized = model()->antialiasing(); QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr if ( hover ) drawHoverRect(p, optr, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Left, true); else Style_Tools::shadowRect( p, optr, aRad, LINE_GR_MARGIN, SHADOW, Style_Tools::Left, model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr, model()->color( Style_Model::FieldDark ), // Style_Model::fld_dark_clr, - aBrdTopCol, aBrdBotCol, antialized, false ); + aBrdTopCol, aBrdBotCol, antialized, false ); QRect aBtnRect = QRect( QPoint( arUp.x(), optr.y() ), QPoint( arUp.right(), optr.bottom() ) ); QColor aBtnCol = opt->palette.color( QPalette::Button ); bool aStateOn = opt->state & ( State_Sunken | State_On ); @@ -482,7 +482,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp copy.rect = aBtnRect; drawPrimitive(pe, ©, p, w); } - break; + break; } case CC_ComboBox: { if (const QStyleOptionComboBox *cmb = qstyleoption_cast(opt)) { @@ -495,14 +495,14 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp bool antialized = model()->antialiasing(); double aRad = model()->widgetRounding( Style_Model::EditRadius ); QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr if ( hover ) drawHoverRect(p, optr, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Left, true); else Style_Tools::shadowRect( p, optr, aRad, LINE_GR_MARGIN, SHADOW, Style_Tools::Left, model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr, model()->color( Style_Model::FieldDark ), // Style_Model::fld_dark_clr, - aBrdTopCol, aBrdBotCol, antialized, false ); + aBrdTopCol, aBrdBotCol, antialized, false ); if (cmb->subControls & SC_ComboBoxArrow) { State flags = State_None; QColor aBtnCol = opt->palette.color( QPalette::Button ); @@ -533,7 +533,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp p->setPen(cmb->palette.highlightedText().color()); } else - p->setPen(cmb->palette.text().color()); + p->setPen(cmb->palette.text().color()); } break; } @@ -545,7 +545,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp if( hasHover() && (slider->state & State_Enabled) && (slider->state & State_MouseOver) ) { - QRect moderated = w->rect(); + QRect moderated = w->rect(); drawHoverRect(p, moderated, opt->palette.color( QPalette::Window ), model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false); } @@ -572,8 +572,8 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp bool tickAbove = slider->tickPosition == QSlider::TicksAbove; bool tickBelow = slider->tickPosition == QSlider::TicksBelow; QColor aBtnCol = model()->color( Style_Model::Slider ); // Style_Model::slider_clr - QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr // rect was changed on +/-DELTA_SLIDER value for correct painting Antialised border of slider int aDelta = DELTA_SLIDER-1; QRect slRect = QRect(x+aDelta, y+aDelta, wi-aDelta, he-aDelta); @@ -622,8 +622,8 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp menuArea = subControlRect(cc, toolbutton, SC_ToolButtonMenu, w); if (w && ( qobject_cast(w->parentWidget() ) || - toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) ) - ) { + toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) ) + ) { QWindowsStyle::drawComplexControl( cc, opt, p, w ); return; } @@ -639,8 +639,8 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect; bool isHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect; bool hover = hasHover() && (opt->state & State_Enabled) && ( opt->state & State_MouseOver ); - QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr QRect aRect = button; int aType = isMenuBtn ? Style_Tools::Left : Style_Tools::All; if ( toolbutton->subControls & SC_ToolButton ) { @@ -652,7 +652,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp else Style_Tools::shadowRect( p, aRect, aMinDelta, -1, SHADOW, aType, top, bottom, aBrdTopCol, aBrdBotCol, antialized, true, aStateOn ); - } + } if (toolbutton->subControls & SC_ToolButtonMenu) { p->save(); if ( aMinDelta > menuArea.height()/2 ) @@ -694,7 +694,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp fr.rect.adjust(3, 3, -3, -3); if (toolbutton->features & QStyleOptionToolButton::Menu) fr.rect.adjust(0, 0, -pixelMetric(QStyle::PM_MenuButtonIndicator, toolbutton, w), 0); - Style_Tools::drawFocus( p, fr.rect, aMinDelta-1, isMenuBtn ? Style_Tools::Left : + Style_Tools::drawFocus( p, fr.rect, aMinDelta-1, isMenuBtn ? Style_Tools::Left : Style_Tools::All, aBrdBotCol ); } QStyleOptionToolButton label = *toolbutton; @@ -717,13 +717,13 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp QRect checkBoxRect = subControlRect( cc, opt, SC_GroupBoxCheckBox, w); if (groupBox->subControls & QStyle::SC_GroupBoxFrame) { QRect aRect = subControlRect( cc, opt, SC_GroupBoxFrame, w); - QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr - QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr + QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr Style_Tools::shadowRect( p, aRect, model()->widgetRounding( Style_Model::FrameRadius ), 0., SHADOW, Style_Tools::All, model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr model()->color( Style_Model::FieldDark ), // Style_Model::fld_dark_clr - aBrdTopCol, aBrdBotCol, false, false, false, false); + aBrdTopCol, aBrdBotCol, false, false, false, false); } // Draw title if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) { @@ -788,10 +788,10 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, drawControl(CE_PushButtonLabel, &subopt, p, w); if (btn->state & State_HasFocus) { QRect aRect = subElementRect( SE_PushButtonFocusRect, btn, w ); - Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ), + Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, model()->color( Style_Model::BorderBottom ) ); } - break; + break; } case CE_PushButtonBevel: if ( qstyleoption_cast(opt) ) { @@ -804,9 +804,9 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, QColor aBtnCol = opt->palette.color( QPalette::Button ); QColor top = aBtnCol.light( BUT_PERCENT_COL ), - bottom = aBtnCol.dark( BUT_PERCENT_COL ); + bottom = aBtnCol.dark( BUT_PERCENT_COL ); QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr QRect r = opt->rect; bool antialized = model()->antialiasing(); if ( isAutoRaising && hover && !aStateOn ) @@ -814,10 +814,10 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, aBrdTopCol, aBrdBotCol, antialized, true, aStateOn ); else if ( isHighWdg && hover && !aStateOn ) drawHoverRect( p, r, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true ); - else + else Style_Tools::shadowRect( p, r, aRad, -1, SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol, antialized, true, aStateOn ); - break; + break; } case CE_DockWidgetTitle: if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast(opt)) { @@ -894,8 +894,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, dwOpt->state & State_Enabled, aTitle, floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText); p->setFont(oldFont); - } - break; + } + break; } case CE_Splitter: { QWindowsStyle::drawControl( ce, opt, p, w ); @@ -919,10 +919,10 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, bool isSelected = opt->state & State_Selected; bool isLast = tab->position == QStyleOptionTab::End || tab->position == QStyleOptionTab::OnlyOneTab; - QColor aColor = opt->palette.color( QPalette::Window ), + QColor aColor = opt->palette.color( QPalette::Window ), aDarkColor = aColor.dark( BUT_PERCENT_ON ); - QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr - QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr + QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr bool isHover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver); @@ -935,13 +935,13 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, DELTA_H_TAB, aColor, aDarkColor, aBrdTopCol, aBrdBotCol, isSelected, isLast, isHover ); p->restore(); - } else + } else QCommonStyle::drawControl(ce, opt, p, w); break; } case CE_TabBarTabLabel: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { - if ( tab->position == QStyleOptionTab::End || + if ( tab->position == QStyleOptionTab::End || tab->position == QStyleOptionTab::OnlyOneTab ) { QRect oldRect = opt->rect; int aDelta = 0; @@ -949,14 +949,14 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2); oldRect = QRect( oldRect.topLeft(), QPoint( oldRect.right()-aDelta, oldRect.bottom() ) ); } - else { + else { aDelta = (int)(opt->rect.width()*DELTA_H_TAB/2); oldRect = QRect( oldRect.topLeft(), QPoint( oldRect.right(), oldRect.bottom()-aDelta ) ); - } + } QStyleOptionTab* copyTab = (QStyleOptionTab*)tab; copyTab->rect = oldRect; QWindowsStyle::drawControl( ce, copyTab, p, w ); - } + } else QWindowsStyle::drawControl( ce, opt, p, w ); break; @@ -978,8 +978,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, QColor aBtnCol = opt->palette.color( QPalette::Window ), top = aBtnCol.light( BUT_PERCENT_ON ), bottom = aBtnCol.dark( BUT_PERCENT_ON ); - QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr bool aHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect; if ( !aStateOn && aHighWdg && (opt->state & State_Enabled) && (opt->state & State_Selected) ) @@ -1004,7 +1004,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, break; case CE_ProgressBarGroove: { QColor aBgColor = opt->palette.color( QPalette::Window ), - top = aBgColor.light( BUT_PERCENT_ON ), + top = aBgColor.light( BUT_PERCENT_ON ), bottom = aBgColor.dark( BUT_PERCENT_ON ); QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr @@ -1150,9 +1150,9 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, int myHeight = pbBits.rect.height(); pbBits.state = State_None; QRect aRect; - QColor aColor = model()->color( Style_Model::ProgressBar ); // Style_Model::prbar_clr - QColor top = aColor.light( BUT_PERCENT_COL ); - QColor bottom = aColor.dark( BUT_PERCENT_COL ); + QColor aColor = model()->color( Style_Model::ProgressBar ); // Style_Model::prbar_clr + QColor top = aColor.light( BUT_PERCENT_COL ); + QColor bottom = aColor.dark( BUT_PERCENT_COL ); int aType; for (int i = 0; i <= nu; ++i) { aType = Style_Tools::None; @@ -1194,7 +1194,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, if ( unit_width > 1 ) { aTopClr = aColor.light(); aBotClr = aColor.dark(); - } + } Style_Tools::shadowRect( p, aRect, model()->widgetRounding( Style_Model::EditRadius ), -1, 0, aType, top, bottom, aTopClr, aBotClr, false, true ); x += reverse ? -unit_width : unit_width; @@ -1224,7 +1224,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, double aMargin = LINE_GR_MARGIN; QLinearGradient gr(x,y,menuitem->rect.right(),y); gr.setColorAt( 0.0, aBgColor ); - gr.setColorAt( aMargin/width, model()->color( Style_Model::FieldLight ) ); // Style_Model::fld_light_clr + gr.setColorAt( aMargin/width, model()->color( Style_Model::FieldLight ) ); // Style_Model::fld_light_clr gr.setColorAt( 1.0, model()->color( Style_Model::FieldLight ) ); QBrush fill; if ( act ) @@ -1234,8 +1234,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, p->fillRect(menuitem->rect, fill); if (menuitem->menuItemType == QStyleOptionMenuItem::Separator){ int yoff = y-1 + h / 2; - QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr - QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr + QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr p->setPen( aBrdBotCol ); p->drawLine(x + 2, yoff, x + width - 4, yoff); p->setPen( aBrdTopCol ); @@ -1388,7 +1388,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, Qt::AlignLeft | Qt::AlignVCenter, iconRect.size(), alignRect); - // Here's absent filling of pixmap on basic color for editable comboBox + // Here's absent filling of pixmap on basic color for editable comboBox drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap); if (cb->direction == Qt::RightToLeft) @@ -1410,7 +1410,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, QColor top = aBtnCol.light( BUT_PERCENT_COL ), bottom = aBtnCol.dark( BUT_PERCENT_COL ); QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol, false, true, aStateOn, true ); PrimitiveElement arrow; @@ -1438,13 +1438,13 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, if ( hasHover() && enabled && (opt->state & State_MouseOver) ) drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, false); else { - QColor aColor = model()->color( Style_Model::Slider ); // Style_Model::slider_clr + QColor aColor = model()->color( Style_Model::Slider ); // Style_Model::slider_clr if ( !enabled ) aColor = opt->palette.button().color(); - QColor top = aColor.light( BUT_PERCENT_ON ), + QColor top = aColor.light( BUT_PERCENT_ON ), bottom = aColor.dark( BUT_PERCENT_ON ); - QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr QRect r = opt->rect; QPainterPath path = Style_Tools::roundRect( r, aRad, Style_Tools::All ); @@ -1501,7 +1501,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, \param w widget (optional) */ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, - QPainter* p, const QWidget* w ) const + QPainter* p, const QWidget* w ) const { if ( checkDebugLevel(6) ) { QWindowsStyle::drawPrimitive( pe, opt, p, w ); @@ -1516,8 +1516,8 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QColor aBtnCol = opt->palette.color( QPalette::Window ), top = aBtnCol.light( BUT_PERCENT_ON ), bottom = aBtnCol.dark( BUT_PERCENT_ON ); - QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr Style_Tools::shadowRect( p, opt->rect, 0, 0., SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol, false, false, false, false ); break; @@ -1525,7 +1525,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, case PE_PanelButtonTool : { if ( w && ( opt->state & State_Enabled ) && ( ( qobject_cast( w->parentWidget() ) ) || - ( w->inherits("QDockWidgetTitleButton") ) || + ( w->inherits("QDockWidgetTitleButton") ) || ( w->inherits("QtxWorkstackAreaTitleButton") ) ) ) { bool aStateOn = opt->state & (State_Sunken | State_On); bool aHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect; @@ -1534,14 +1534,14 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), 0, Style_Tools::All, true); else { QColor aBtnCol = opt->palette.color( QPalette::Window ); - QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr - QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr + QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr QColor top = aBtnCol.light( BUT_PERCENT_COL ), bottom = aBtnCol.dark( BUT_PERCENT_COL ); Style_Tools::shadowRect( p, opt->rect, 0.0, 0, SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol, model()->antialiasing(), true, aStateOn ); - } - break; + } + break; } else QWindowsStyle::drawPrimitive( pe, opt, p, w ); @@ -1550,8 +1550,8 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, case PE_FrameFocusRect: { if (w && qobject_cast((QWidget*)w)) { QTabBar* tabBar = qobject_cast((QWidget*)w); - QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr - QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr + QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr + QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr bool isHover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver); Style_Tools::tabRect( p, opt->rect, (int)tabBar->shape(), model()->widgetRounding( Style_Model::FrameRadius ), DELTA_H_TAB, @@ -1560,7 +1560,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, aBrdTopCol, aBrdBotCol, false, false, isHover, true ); } else { - QWindowsStyle::drawPrimitive( pe, opt, p, w ); + QWindowsStyle::drawPrimitive( pe, opt, p, w ); } break; } @@ -1575,24 +1575,24 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QRect rect = opt->rect; QColor pen, brush; if ( opt->state & State_Enabled ) { - pen = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr - brush = opt->palette.color( QPalette::Button ); + pen = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr + brush = opt->palette.color( QPalette::Button ); if ( ( opt->state & State_Sunken ) && (opt->state & State_Enabled ) ) rect.moveTo( rect.x()+1, rect.y()+1 ); } else { pen = opt->palette.mid().color(); - brush = pen; + brush = pen; } if ( pe == PE_IndicatorSpinPlus || pe == PE_IndicatorSpinMinus ) - Style_Tools::drawSign( pe, p, rect, pen, brush ); + Style_Tools::drawSign( pe, p, rect, pen, brush ); else - Style_Tools::drawArrow( pe, p, rect, pen, brush ); + Style_Tools::drawArrow( pe, p, rect, pen, brush ); break; } case PE_IndicatorCheckBox: { if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) ) drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ), - model()->widgetRounding( Style_Model::EditRadius ), + model()->widgetRounding( Style_Model::EditRadius ), Style_Tools::All, false); QBrush fill; if (opt->state & State_NoChange) @@ -1642,10 +1642,10 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, } const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast(opt); p->setPen(itemViewOpt && itemViewOpt->showDecorationSelected - && opt->state & State_Selected ? opt->palette.highlightedText().color() - : opt->palette.text().color()); + && opt->state & State_Selected ? opt->palette.highlightedText().color() + : opt->palette.text().color()); if (opt->state & State_NoChange) - p->setBrush( opt->palette.color( QPalette::Button ) ); + p->setBrush( opt->palette.color( QPalette::Button ) ); p->drawRect(opt->rect.x() + 1, opt->rect.y() + 1, 11, 11); if (!(opt->state & State_Off)) { QLineF lines[11]; @@ -1666,7 +1666,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QColor aColor = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr if ( !(opt->state & State_Enabled ) ) aColor = opt->palette.mid().color(); - if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected ) + if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected ) aColor = opt->palette.highlightedText().color(); p->setPen( QPen( aColor ) ); @@ -1680,7 +1680,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, case PE_IndicatorRadioButton: { if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) ) drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ), - model()->widgetRounding( Style_Model::ButtonRadius ), + model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false); #define PTSARRLEN(x) sizeof(x)/(sizeof(QPoint)) static const QPoint pts_border[] = { // border line @@ -1713,7 +1713,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, else { QColor fillColor = opt->palette.color( QPalette::Base ); if ( enabled && on ) - fillColor = model()->color( Style_Model::Checked ); // Style_Model::checked_clr + fillColor = model()->color( Style_Model::Checked ); // Style_Model::checked_clr QLinearGradient gr( 3, 3, 8, 8 ); gr.setColorAt( 0.0, fillColor.dark( BUT_PERCENT_ON ) ); gr.setColorAt( 1.0, fillColor ); @@ -1762,14 +1762,14 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, } if ( pe == PE_FrameLineEdit ) { QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver); double aRad = model()->widgetRounding( Style_Model::EditRadius ); if ( hover ) drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true); else { Style_Tools::shadowRect( p, opt->rect, aRad, LINE_GR_MARGIN, SHADOW, - Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ), + Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ), model()->color( Style_Model::FieldDark ), aBrdTopCol, aBrdBotCol, model()->antialiasing(), false ); } @@ -1778,14 +1778,14 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, if (const QStyleOptionFrame *panel = qstyleoption_cast(opt)) { QRect rect = panel->rect.adjusted( panel->lineWidth, panel->lineWidth, -panel->lineWidth, -panel->lineWidth); - if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) { + if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) { drawPrimitive( PE_FrameLineEdit, panel, p, w ); - } + } else { - QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255); + QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255); p->fillRect( rect, c ); // panel->palette.brush(QPalette::Base) - } - } + } + } } break; } @@ -1801,7 +1801,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, if ( aTabPos != QTabWidget::East ) aRoundType = aRoundType | Style_Tools::TopRight; QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr - QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr + QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr Style_Tools::shadowRect( p, opt->rect, model()->widgetRounding( Style_Model::FrameRadius ), 0., SHADOW, aRoundType, model()->color( Style_Model::FieldLight ), @@ -1838,7 +1838,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, if (const QStyleOptionTabBarBase *tbb = qstyleoption_cast(opt)) { if (tbb->shape != QTabBar::RoundedNorth && tbb->shape != QTabBar::RoundedEast && - tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) { + tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) { QWindowsStyle::drawPrimitive( pe, opt, p, w ); break; } @@ -1851,18 +1851,18 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, isLast = tabBar->currentIndex() == tabBar->count() -1; QColor aColor = opt->palette.color( QPalette::Window ); QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr - QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr + QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr bool isHover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver); QPainterPath aSelPath = Style_Tools::tabRect( p, aSelRect, (int)tbb->shape, - model()->widgetRounding( Style_Model::FrameRadius ), - DELTA_H_TAB, aColor, aColor, + model()->widgetRounding( Style_Model::FrameRadius ), + DELTA_H_TAB, aColor, aColor, aColor, aColor, isSelected, isLast, isHover, false, false ); if ( !aSelPath.isEmpty() ) aSelRect = aSelPath.controlPointRect().toRect(); QStyleOptionTabBarBase* copyOpt = (QStyleOptionTabBarBase*)tbb; copyOpt->selectedTabRect = aSelRect; - QCommonStyle::drawPrimitive( pe, copyOpt, p, w ); + QCommonStyle::drawPrimitive( pe, copyOpt, p, w ); break; } case PE_IndicatorBranch: { @@ -1932,9 +1932,9 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QPalette aPal = aWdg->palette(); double aMarg = LINE_GR_MARGIN; QColor base = model()->color( Style_Model::Base ), // Style_Model::pal_base_clr - light = base, - light_alt = base.dark(110),//AlternateBase color - dark = model()->color( Style_Model::FieldDark ); // Style_Model::fld_dark_clr + light = base, + light_alt = base.dark(110),//AlternateBase color + dark = model()->color( Style_Model::FieldDark ); // Style_Model::fld_dark_clr //light.setAlpha( 0 ); // VSR commented: IPAL19262 QLinearGradient gr_h(r.x(), r.y(), r.right(), r.y()); gr_h.setColorAt( 0.0, dark ); @@ -1947,7 +1947,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, // draw frame p->fillRect( r, base ); p->fillRect( r, gr_h ); - p->fillRect( r, gr_v ); + p->fillRect( r, gr_v ); aPal.setBrush( QPalette::Base, QBrush( light ) ); QLinearGradient gr_alt(r.x(), r.y(), r.right(), r.y()); @@ -1973,7 +1973,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, \return metric value */ int Style_Salome::pixelMetric( PixelMetric metric, const QStyleOption* opt, - const QWidget* w ) const + const QWidget* w ) const { if ( checkDebugLevel(7) ) { return QWindowsStyle::pixelMetric( metric, opt, w ); @@ -2028,11 +2028,11 @@ QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt, if ( tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedSouth ) { int aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2); sz.setWidth( sz.width() + aDelta ); - } + } if ( tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedWest ) { int aDelta = (int)(opt->rect.width()*DELTA_H_TAB/2); sz.setHeight( sz.height() + aDelta ); - } + } } break; } @@ -2055,7 +2055,7 @@ QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt, aDelta += aHalfRect; // for right of line edit internal sz.setWidth( res.width() + aDelta + aHalfRect ); } - break; + break; default: break; } @@ -2100,8 +2100,8 @@ QPixmap Style_Salome::standardPixmap(StandardPixmap stPixmap, const QStyleOption \return standard icon */ QIcon Style_Salome::standardIconImplementation( StandardPixmap standardIcon, - const QStyleOption* opt, - const QWidget* w ) const + const QStyleOption* opt, + const QWidget* w ) const { if ( checkDebugLevel(10) ) { return QWindowsStyle::standardIconImplementation( standardIcon, opt, w ); @@ -2165,7 +2165,7 @@ int Style_Salome::styleHint( StyleHint hint, const QStyleOption* opt, const QWid \return subcontrol rectangle */ QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex* opt, - SubControl sc, const QWidget* wid ) const + SubControl sc, const QWidget* wid ) const { if ( checkDebugLevel(12) ) { return QWindowsStyle::subControlRect( cc, opt, sc, wid ); @@ -2227,8 +2227,8 @@ QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex else res.setTop( res.top() - aRect - 1); break; - default: - break; + default: + break; } break; } @@ -2310,7 +2310,7 @@ void Style_Salome::updatePaletteColors() for ( int j = (int)Style_Model::WindowText; j < (int)Style_Model::NColorRoles; j++ ) { if ( j == QPalette::NoRole ) continue; pal.setColor( (QPalette::ColorGroup)i, (QPalette::ColorRole)j, - model()->color( (Style_Model::ColorRole)j, (QPalette::ColorGroup)i ) ); + model()->color( (Style_Model::ColorRole)j, (QPalette::ColorGroup)i ) ); } } QPixmapCache::clear(); @@ -2331,7 +2331,7 @@ void Style_Salome::updateAllWidgets( QApplication* app ) for (QWidgetList::ConstIterator it2 = all.constBegin(); it2 != all.constEnd(); ++it2) { w = *it2; if (w->windowType() != Qt::Desktop && w->testAttribute(Qt::WA_WState_Polished) - && !w->testAttribute(Qt::WA_SetStyle)) { + && !w->testAttribute(Qt::WA_SetStyle)) { QEvent e(QEvent::StyleChange); QApplication::sendEvent(w, &e); polish( w ); @@ -2467,7 +2467,7 @@ void Style_Salome::drawBackground( QPainter* p, const QRect& r, const QColor& bg { const int d = 3; for ( int i = 0; i <= h; i += d ) - lines.append( QLine( x, y+i, w, r.y()+i ) ); + lines.append( QLine( x, y+i, w, r.y()+i ) ); } break; case Style_Model::Inclined: @@ -2476,9 +2476,9 @@ void Style_Salome::drawBackground( QPainter* p, const QRect& r, const QColor& bg w = w/d*d; h = h/d*d; for ( int i = 0; i <= w; i += d ) - lines.append( QLine( x+i, y, x, y+i ) ); + lines.append( QLine( x+i, y, x, y+i ) ); for ( int i = 0; i < h; i += d ) - lines.append( QLine( left+w-i, top+h, left+w, top+h-i ) ); + lines.append( QLine( left+w-i, top+h, left+w, top+h-i ) ); } break; default: diff --git a/src/Style/Style_Salome.h b/src/Style/Style_Salome.h index 75659e9ac..8502acd92 100644 --- a/src/Style/Style_Salome.h +++ b/src/Style/Style_Salome.h @@ -60,35 +60,35 @@ public: virtual void polish( QWidget* ); virtual void unpolish( QWidget* ); virtual void drawComplexControl( ComplexControl, const QStyleOptionComplex*, - QPainter*, const QWidget* = 0 ) const; + QPainter*, const QWidget* = 0 ) const; virtual void drawControl( ControlElement, const QStyleOption*, QPainter*, const QWidget* ) const; virtual void drawPrimitive( PrimitiveElement, const QStyleOption*, - QPainter*, const QWidget* = 0 ) const; + QPainter*, const QWidget* = 0 ) const; virtual int pixelMetric( PixelMetric, const QStyleOption* = 0, - const QWidget* = 0 ) const; + const QWidget* = 0 ) const; virtual QSize sizeFromContents ( ContentsType, const QStyleOption*, - const QSize&, const QWidget* = 0 ) const; + const QSize&, const QWidget* = 0 ) const; virtual QPixmap standardPixmap( StandardPixmap, const QStyleOption*, - const QWidget* = 0) const; + const QWidget* = 0) const; virtual int styleHint( StyleHint, const QStyleOption* = 0, - const QWidget* = 0, QStyleHintReturn* = 0 ) const; + const QWidget* = 0, QStyleHintReturn* = 0 ) const; virtual QRect subControlRect( ComplexControl, const QStyleOptionComplex*, - SubControl, const QWidget* = 0 ) const; + SubControl, const QWidget* = 0 ) const; virtual QRect subElementRect( SubElement, const QStyleOption*, const QWidget* = 0 ) const; protected slots: QIcon standardIconImplementation( StandardPixmap, const QStyleOption* = 0, - const QWidget* = 0 ) const; + const QWidget* = 0 ) const; private: void updatePaletteColors(); void updateAllWidgets( QApplication* ); bool hasHover() const; void drawHoverRect( QPainter*, const QRect&, const QColor&, const double, - const int, const bool ) const; + const int, const bool ) const; void drawHandle( QPainter*, const QRect&, bool, bool = true ) const; void drawBackground( QPainter*, const QRect&, const QColor&, const bool, - const bool = false, const bool = true ) const; + const bool = false, const bool = true ) const; void drawBorder( QPainter*, const QRect&, bool ) const; QString titleText( const QString&, const int, const int, QFont& ) const; diff --git a/src/Style/Style_Tools.cxx b/src/Style/Style_Tools.cxx index 8ba7c60c6..83f1ba0ea 100644 --- a/src/Style/Style_Tools.cxx +++ b/src/Style/Style_Tools.cxx @@ -436,7 +436,7 @@ void Style_Tools::drawArrow( QStyle::PrimitiveElement type, QPainter* p, const Q \param brush background painter brush */ void Style_Tools::drawSign( QStyle::PrimitiveElement type, QPainter* p, const QRect& r, - const QColor& pen, const QColor& brush ) + const QColor& pen, const QColor& brush ) { p->save(); QPainterPath sign; @@ -458,31 +458,31 @@ void Style_Tools::drawSign( QStyle::PrimitiveElement type, QPainter* p, const QR deltaY = -deltaY; } if ( correct ) - sign.moveTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) ); + sign.moveTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) ); else { - sign.moveTo( aDelta/3, -aDelta/2 ); - sign.lineTo( aDelta/3, -aDelta/2-(deltaY/2-aDelta/3) ); - sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) ); + sign.moveTo( aDelta/3, -aDelta/2 ); + sign.lineTo( aDelta/3, -aDelta/2-(deltaY/2-aDelta/3) ); + sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) ); } sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 ); if ( !correct ) { - sign.lineTo( aDelta/3, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 ); - sign.lineTo( aDelta/3, -aDelta/2-deltaY ); - sign.lineTo( -aDelta/3, -aDelta/2-deltaY ); - sign.lineTo( -aDelta/3, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 ); + sign.lineTo( aDelta/3, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 ); + sign.lineTo( aDelta/3, -aDelta/2-deltaY ); + sign.lineTo( -aDelta/3, -aDelta/2-deltaY ); + sign.lineTo( -aDelta/3, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 ); } sign.lineTo( -deltaY/2, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 ); sign.lineTo( -deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) ); if ( correct ) - sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) ); + sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) ); else { - sign.lineTo( -aDelta/3, -aDelta/2-(deltaY/2-aDelta/3) ); - sign.lineTo( -aDelta/3, -aDelta/2 ); - sign.lineTo( aDelta/3, -aDelta/2); + sign.lineTo( -aDelta/3, -aDelta/2-(deltaY/2-aDelta/3) ); + sign.lineTo( -aDelta/3, -aDelta/2 ); + sign.lineTo( aDelta/3, -aDelta/2); } if ( correct ) diff --git a/src/Style/Style_Tools.h b/src/Style/Style_Tools.h index a21893e2e..9f94ec750 100644 --- a/src/Style/Style_Tools.h +++ b/src/Style/Style_Tools.h @@ -90,7 +90,7 @@ public: static void drawArrow( QStyle::PrimitiveElement, QPainter*, const QRect&, const QColor&, const QColor& ); static void drawSign( QStyle::PrimitiveElement, QPainter*, const QRect&, - const QColor&, const QColor& ); + const QColor&, const QColor& ); static QPainterPath tabRect( QPainter*, const QRect&, const int, const double, const double, const QColor&, const QColor&, const QColor&, const QColor&, diff --git a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx index 0ae32da23..0326eecd4 100755 --- a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx +++ b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx @@ -324,8 +324,8 @@ QString ToolsGUI_CatalogGeneratorDlg::getIdlPath() QCString dir; if (dir = getenv( modulename + "_ROOT_DIR")) { IDLpath = IDLpath + "-I" + SUIT_Tools::addSlash( SUIT_Tools::addSlash(dir) + - SUIT_Tools::addSlash("idl") + - SUIT_Tools::addSlash("salome")) + " "; + SUIT_Tools::addSlash("idl") + + SUIT_Tools::addSlash("salome")) + " "; } } @@ -371,7 +371,7 @@ void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked() void ToolsGUI_CatalogGeneratorDlg::updateButtonState() { myApplyBtn->setEnabled( !myIdlEdit->text().trimmed().isEmpty() && - !myXmlEdit->text().trimmed().isEmpty() ); + !myXmlEdit->text().trimmed().isEmpty() ); } /*! @@ -395,25 +395,25 @@ void ToolsGUI_CatalogGeneratorDlg::onApply() if ( !XmlFile.isEmpty() && !IdlFile.isEmpty() ) { if ( !QFile::exists( IdlFile ) ) { SUIT_MessageBox::critical( this, - tr("TOOLS_ERR_ERROR"), - tr("TOOLS_ERR_FILE_NOT_EXIST").arg(IdlFile) ); + tr("TOOLS_ERR_ERROR"), + tr("TOOLS_ERR_FILE_NOT_EXIST").arg(IdlFile) ); } else { QString command = ""; if ( getenv("KERNEL_ROOT_DIR") ) - command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser -K " + IDLpath + " -Wbcatalog=" + XmlFile; + command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser -K " + IDLpath + " -Wbcatalog=" + XmlFile; else { - SUIT_MessageBox::critical( this, - tr("TOOLS_ERR_ERROR"), - tr("KERNEL_ROOT_DIR variable is not defined") ); + SUIT_MessageBox::critical( this, + tr("TOOLS_ERR_ERROR"), + tr("KERNEL_ROOT_DIR variable is not defined") ); } if (!Author.isEmpty()) command += ",author=" + Author; if (!Version.isEmpty()) command += ",version=" + Version; if (!PngFile.isEmpty()) { - OSD_Path aPath((Standard_CString)PngFile.toLatin1().constData()); - TCollection_AsciiString aFile = aPath.Name() + aPath.Extension(); - command += QString(",icon=") + QString(aFile.ToCString()); + OSD_Path aPath((Standard_CString)PngFile.toLatin1().constData()); + TCollection_AsciiString aFile = aPath.Name() + aPath.Extension(); + command += QString(",icon=") + QString(aFile.ToCString()); } if (!CompName.isEmpty()) command += ",name=" + CompName; if (!CompUserName.isEmpty()) command += ",username=" + CompUserName; @@ -424,9 +424,9 @@ void ToolsGUI_CatalogGeneratorDlg::onApply() int res; res = system( ( char* )( command.toLatin1().constData() ) ); if ( res == -1 ) { - MESSAGE( "work failed (system command result = " << res ); + MESSAGE( "work failed (system command result = " << res ); } else if (res == 217) { - MESSAGE( "shell exec failed (system command result = " << res ); + MESSAGE( "shell exec failed (system command result = " << res ); } } } diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx index 8c7fca354..038eaafbf 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -462,7 +462,7 @@ ToolsGUI_RegWidget* ToolsGUI_RegWidget::myRegWidgetPtr = 0; \param parent parent widget */ ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_var& orb, - QWidget* parent ) + QWidget* parent ) { if ( !myRegWidgetPtr ) myRegWidgetPtr = new ToolsGUI_RegWidget( orb, parent ); @@ -594,13 +594,13 @@ bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event ) else if ( object == _clients && event->type() == QEvent::KeyPress ) { QKeyEvent* ke = (QKeyEvent*)event; if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) { - slotClientChanged( _clients->currentItem(), 0 ); + slotClientChanged( _clients->currentItem(), 0 ); } } else if ( object == _history && event->type() == QEvent::KeyPress ) { QKeyEvent* ke = (QKeyEvent*)event; if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) { - slotHistoryChanged( _history->currentItem(), 0 ); + slotHistoryChanged( _history->currentItem(), 0 ); } } } @@ -616,9 +616,9 @@ bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event ) \return item index or -1 if it is not found. */ int ToolsGUI_RegWidget::numitem( const QString& name, - const QString& pid, - const QString& machine, - const Registry::AllInfos* listclient ) + const QString& pid, + const QString& machine, + const Registry::AllInfos* listclient ) { for (CORBA::ULong i=0; ilength(); i++) { const Registry::Infos & c_info=(*listclient)[i]; @@ -626,8 +626,8 @@ int ToolsGUI_RegWidget::numitem( const QString& name, QString b; b.setNum(int(c_info.pid)); if ( (name.compare(QString(c_info.name)) == 0) && - (machine.compare(QString(c_info.machine)) == 0) && - (pid.compare(b) == 0) ) { + (machine.compare(QString(c_info.machine)) == 0) && + (pid.compare(b) == 0) ) { return i; } } diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.h b/src/TOOLSGUI/ToolsGUI_RegWidget.h index 1c9b3d549..b1df2375c 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.h +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.h @@ -62,7 +62,7 @@ public: bool eventFilter( QObject* object, QEvent* event ); static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var& orb, - QWidget* parent = 0 ); + QWidget* parent = 0 ); virtual QMenu* createPopupMenu(); @@ -77,9 +77,9 @@ public slots: protected: static QString setlongText( const Registry::Infos& c_info ); int numitem( const QString& name, - const QString& pid, - const QString& machine, - const Registry::AllInfos* clistclient ); + const QString& pid, + const QString& machine, + const Registry::AllInfos* clistclient ); void closeEvent( QCloseEvent* e ); protected : diff --git a/src/VTKViewer/VTKViewer_ConvexTool.h b/src/VTKViewer/VTKViewer_ConvexTool.h index 0f4429c2b..57ee30ee8 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.h +++ b/src/VTKViewer/VTKViewer_ConvexTool.h @@ -52,16 +52,16 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator bool Execute(vtkUnstructuredGrid *theInput, - vtkCellData* thInputCD, - vtkIdType theCellId, - int theShowInside, - int theAllVisible, - const char* theCellsVisibility, - vtkPolyData *theOutput, - vtkCellData* theOutputCD, - int theStoreMapping, - std::vector& theVTK2ObjIds, - bool theIsCheckConvex); + vtkCellData* thInputCD, + vtkIdType theCellId, + int theShowInside, + int theAllVisible, + const char* theCellsVisibility, + vtkPolyData *theOutput, + vtkCellData* theOutputCD, + int theStoreMapping, + std::vector& theVTK2ObjIds, + bool theIsCheckConvex); private: vtkIdList* myCellIds; @@ -74,7 +74,7 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator virtual vtkPoints* InitPoints(vtkUnstructuredGrid *theInput, - vtkIdType theCellId); + vtkIdType theCellId); virtual vtkIdType @@ -95,9 +95,9 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator void GetCellNeighbors(vtkUnstructuredGrid *theInput, - vtkIdType theCellId, - vtkCell* theFace, - vtkIdList* theCellIds); + vtkIdType theCellId, + vtkCell* theFace, + vtkIdList* theCellIds); vtkIdType GetConnectivity(vtkIdType thePntId); @@ -121,7 +121,7 @@ class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangul virtual vtkPoints* InitPoints(vtkUnstructuredGrid *theInput, - vtkIdType theCellId); + vtkIdType theCellId); virtual vtkIdType @@ -151,7 +151,7 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu virtual vtkPoints* InitPoints(vtkUnstructuredGrid *theInput, - vtkIdType theCellId); + vtkIdType theCellId); virtual vtkIdType