#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR)
INCLUDE(CMakeDependentOption)
PROJECT(SalomeGUI C CXX)
if ( !formats.IsEmpty() )
app->stdApp()->NewDocument( formats.First(), myStdDoc );
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
res = false;
}
}
OCC_CATCH_SIGNALS;
status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == PCDM_RS_OK;
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
status = false;
}
status = app->SaveAs( stdDoc(), path ) == PCDM_SS_OK;
}
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
status = false;
}
myStdDoc->OpenCommand();
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
res = false;
}
myStdDoc->AbortCommand();
update();
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
res = false;
}
return res;
d->SetName( CAF_Tools::toExtString( name ) );
}
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
res = false;
}
return res;
myStdDoc->Undo();
undoModified(); /* decrement modification counter */
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
SUIT_MessageBox::critical(application()->desktop(), tr( "ERR_ERROR" ),
tr( "ERR_DOC_UNDO" ));
return false;
myStdDoc->Redo();
doModified(); /* increment modification counter */
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
SUIT_MessageBox::critical( application()->desktop(), tr( "ERR_ERROR" ),
tr( "ERR_DOC_REDO" ) );
return false;
This method is called from CAM_Application::startOperation().
\param actionId is a numerical unique operation id.
*/
-bool CAM_Module::activateOperation( int actionId )
+bool CAM_Module::activateOperation( int /*actionId*/ )
{
- //GUI_UNUSED(actionId);
return false;
}
This method is called from CAM_Application::startOperation().
\param actionId is a string unique operation id.
*/
-bool CAM_Module::activateOperation( const QString& actionId )
+bool CAM_Module::activateOperation( const QString& /*actionId*/ )
{
- //GUI_UNUSED(actionId);
return false;
}
\param actionId is a string unique operation id.
\param pluginName is a name of a plugin where the operation is implemented.
*/
-bool CAM_Module::activateOperation( const QString& actionId, const QString& pluginName )
+bool CAM_Module::activateOperation( const QString& /*actionId*/, const QString& /*pluginName*/ )
{
- //GUI_UNUSED(actionId);
return false;
}
}
-#ifdef SA_SIGINFO
//================================================================================
/*! Private -
* \brief handler for SIGSEGV signal
*/
//================================================================================
+#ifdef SA_SIGINFO
static void SegvHandler(const int, siginfo_t*, const Standard_Address)
+#else
+static void SegvHandler(const int)
+#endif
{
sigset_t set;
sigemptyset(&set);
CASCatch_Failure::Raise("SIGSEGV detected");
}
-#endif
//================================================================================
for(; i<=MAX_HANDLER_NUMBER; i++)
mySigStates[i] = new struct sigaction(); //Initialize structures
- int stat;
+ /*int stat;*/
act.sa_handler = (SIG_PFV) &Handler ;
sigemptyset(&act.sa_mask) ;
- stat = sigaction(SIGHUP,&act,(struct sigaction*)mySigStates[0]); // ...... hangup
- stat = sigaction(SIGFPE,&act,(struct sigaction*) mySigStates[1]); // ...... floating point exception
- stat = sigaction(SIGINT,&act,(struct sigaction*)mySigStates[2]); // ...... interrupt
- stat = sigaction(SIGQUIT,&act,(struct sigaction*)mySigStates[3]); // ...... quit
- stat = sigaction(SIGBUS,&act,(struct sigaction*)mySigStates[4]); // ...... bus error
- stat = sigaction(SIGILL,&act,(struct sigaction*)mySigStates[5]); // ...... illegal instruction
+ /*stat = */sigaction(SIGHUP,&act,(struct sigaction*)mySigStates[0]); // ...... hangup
+ /*stat = */sigaction(SIGFPE,&act,(struct sigaction*) mySigStates[1]); // ...... floating point exception
+ /*stat = */sigaction(SIGINT,&act,(struct sigaction*)mySigStates[2]); // ...... interrupt
+ /*stat = */sigaction(SIGQUIT,&act,(struct sigaction*)mySigStates[3]); // ...... quit
+ /*stat = */sigaction(SIGBUS,&act,(struct sigaction*)mySigStates[4]); // ...... bus error
+ /*stat = */sigaction(SIGILL,&act,(struct sigaction*)mySigStates[5]); // ...... illegal instruction
#ifdef SA_RESTART
act.sa_flags = SA_RESTART ;
#else
act.sa_flags = 0 ;
#endif
+#ifdef SA_SIGINFO
+ act.sa_sigaction = (void(*)(int, siginfo_t *, void*)) &SegvHandler ;
+#else
act.sa_handler = (SIG_PFV) &SegvHandler ;
-
+# endif
#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 ;
-# endif
#endif
- stat = sigaction( SIGSEGV , &act , (struct sigaction*)mySigStates[6]); // ...... segmentation violation
+ /*stat = */sigaction( SIGSEGV , &act , (struct sigaction*)mySigStates[6]); // ...... segmentation violation
myIsActivated = Standard_True;
}
if(!myIsActivated) return;
struct sigaction oact;
- int stat;
-
- stat = sigaction(SIGHUP,(struct sigaction*)mySigStates[0],&oact); // ...... hangup
- stat = sigaction(SIGFPE,(struct sigaction*)mySigStates[1],&oact); // ...... floating point exception
- stat = sigaction(SIGINT,(struct sigaction*)mySigStates[2],&oact); // ...... interrupt
- stat = sigaction(SIGQUIT,(struct sigaction*)mySigStates[3],&oact); // ...... quit
- stat = sigaction(SIGBUS,(struct sigaction*)mySigStates[4],&oact); // ...... bus error
- stat = sigaction(SIGILL,(struct sigaction*)mySigStates[5],&oact); // ...... illegal instruction
- stat = sigaction(SIGSEGV,(struct sigaction*)mySigStates[6],&oact); // ...... segmentation violation
+ /*int stat;*/
+
+ /*stat = */sigaction(SIGHUP,(struct sigaction*)mySigStates[0],&oact); // ...... hangup
+ /*stat = */sigaction(SIGFPE,(struct sigaction*)mySigStates[1],&oact); // ...... floating point exception
+ /*stat = */sigaction(SIGINT,(struct sigaction*)mySigStates[2],&oact); // ...... interrupt
+ /*stat = */sigaction(SIGQUIT,(struct sigaction*)mySigStates[3],&oact); // ...... quit
+ /*stat = */sigaction(SIGBUS,(struct sigaction*)mySigStates[4],&oact); // ...... bus error
+ /*stat = */sigaction(SIGILL,(struct sigaction*)mySigStates[5],&oact); // ...... illegal instruction
+ /*stat = */sigaction(SIGSEGV,(struct sigaction*)mySigStates[6],&oact); // ...... segmentation violation
Standard_Integer i = 0;
\brief Copy constructor (put in private section to prevent object copying).
*/
DDS_DicGroup::DDS_DicGroup( const DDS_DicGroup& )
+: Standard_Transient()
{
}
\brief Copy constructor (put in private section to prevent object copying).
*/
DDS_DicItem::DDS_DicItem( const DDS_DicItem& )
+: Standard_Transient()
{
}
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();
}
\brief Copy constructor (put in private section to prevent object copying).
*/
DDS_Dictionary::DDS_Dictionary( const DDS_Dictionary& )
+: Standard_Transient()
{
}
OCC_CATCH_SIGNALS;
aRetValue = UnitsAPI::AnyToSI( theValue, theUnits );
}
- catch( Standard_Failure ) {
+ catch( Standard_Failure& ) {
}
}
else if ( theUnits && *theUnits )
OCC_CATCH_SIGNALS;
aRetValue = UnitsAPI::AnyFromSI( theValue, theUnits );
}
- catch( Standard_Failure ) {
+ catch( Standard_Failure& ) {
}
}
else if ( theUnits && *theUnits )
GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect /*rect*/, GLboolean /*isFull*/,
GLboolean isCircle, GLboolean isShift )
{
- //GUI_UNUSED(isFull);
- //GUI_UNUSED(rect);
if( !myIsVisible )
return false;
// cout << "GLViewer_MarkerSet::select " << x << " " << y << endl;
*/
GLViewer_Polyline::GLViewer_Polyline( int number, float /*size*/, const QString& toolTip ):
GLViewer_Object(),
- myNumber( 0 ),
myXCoord( 0 ),
- myYCoord( 0 )
+ myYCoord( 0 ),
+ myNumber( 0 )
{
- //GUI_UNUSED(size);
myHighFlag = GL_TRUE;
myHNumbers.clear();
*/
GLboolean GLViewer_Polyline::highlight( GLfloat x, GLfloat y, GLfloat /*tol*/, GLboolean /*isCircle*/ )
{
- //GUI_UNUSED(isCircle);
- //GUI_UNUSED(tol);
if( !myIsVisible )
return false;
GLfloat xa, xb, ya, yb, l;
Default constructor
*/
GLViewer_TexFont::GLViewer_TexFont()
-: myMaxRowWidth( 0 ), myFontHeight( 0 )
+: myFontHeight( 0 ), myMaxRowWidth( 0 )
{
myQFont = QApplication::font();//QFont::defaultFont();
mySeparator = 2;
\param theMinMagFilter - min/mag filter, affects text sharpness
*/
GLViewer_TexFont::GLViewer_TexFont( QFont* theFont, int theSeparator, bool theIsResizeable, GLuint theMinMagFilter )
-: myMaxRowWidth( 0 ), myFontHeight( 0 )
+: myFontHeight( 0 ), myMaxRowWidth( 0 )
{
myQFont = *theFont;
mySeparator = theSeparator;
aFindFont.myIsItal = myQFont.italic();
aFindFont.myIsUndl = myQFont.underline();
aFindFont.myPointSize = myQFont.pointSize();
- aFindFont.myViewPortId = long(QGLContext::currentContext()); //!<TODO: conversion from "size_t" to "long"
+ aFindFont.myViewPortId = (long)QGLContext::currentContext(); //!<TODO: conversion from "size_t" to "long"
if( TexFontBase.contains( aFindFont ) )
{
return aList;
}
- aFindFont.myViewPortId = size_t(aCont);
+ aFindFont.myViewPortId = (long)aCont;
if ( GLViewer_TexFont::BitmapFontCache.contains( aFindFont ) )
aList = GLViewer_TexFont::BitmapFontCache[aFindFont];
QMap<GLViewer_TexFindId, GLuint>::iterator it = GLViewer_TexFont::BitmapFontCache.begin();
for ( ; it != GLViewer_TexFont::BitmapFontCache.end(); ++it )
{
- if ( it.key().myViewPortId == size_t(aCont) && it.value() > listBase )
+ if ( it.key().myViewPortId == (long)aCont && it.value() > listBase )
listBase = it.value();
}
listBase += 256;
*/
int GLViewer_Group::count()
{
- return (size_t)myList.size(); //!< TODO: conversion from size_t to int
+ return (int)myList.size(); //!< TODO: conversion from size_t to int
}
/*!
aCurPos += aGLText.size();
aPointer = (char*)&myOwner;
- for( i = 0; i < sizeof( SUIT_DataOwner* ); i++, aPointer++ )
+ for( i = 0; i < (int)sizeof( SUIT_DataOwner* ); i++, aPointer++ )
aResult[ aCurPos + i ] = *aPointer;
return aResult;
Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel'
Should be called by after non-interactive selection.
*/
-void GLViewer_Selector2d::checkSelection( int selBefore, bool append, int aStatus )
+void GLViewer_Selector2d::checkSelection( int selBefore, bool /*append*/, int aStatus )
{
- //GUI_UNUSED(append);
int selAfter = numSelected();
if ( selBefore > 0 && selAfter < 1 )
emit selSelectionCancel();
{
int aResult = 0;
QFontMetrics aFM( myQFont );
- for( uint i = 0; i < (uint)myText.length(); i++ )
+ for( int i = 0; i < myText.length(); i++ )
aResult += aFM.width( myText.at(i) ) + mySeparator;
return aResult;
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : OPEN CASCADE
-// File: GLViewer_ToolTip.xx
-// Created: March, 2005
-//#include "GLViewerAfx.h"
-//
#include "GLViewer_Context.h"
#include "GLViewer_ToolTip.h"
#include "GLViewer_Viewer2d.h"
*/
GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent )
:QObject(),
- myText(),
myPoint( -1, -1 )
{
mypViewPort = theParent;
- //mypLabel = NULL;
mypLabel = new QLabel( "Test", NULL,
Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint );
mypLabel->setObjectName("ObjectTipText");
mypLabel->setMargin( 1 );
- //mypLabel->setAutoMask( false );
mypLabel->setFrameStyle( QFrame::Plain | QFrame::Box );
mypLabel->setLineWidth( 1 );
mypLabel->setAlignment( Qt::AlignAbsolute | Qt::AlignTop );
mypLabel->setIndent( 0 );
mypLabel->ensurePolished();
- //mypLabel->setPalette( QToolTip::palette() );
-
mypTimer = new QTimer( this );
connect( mypTimer, SIGNAL( timeout() ), this, SLOT( showTip() ) );
*/
GLViewer_ObjectTip::~GLViewer_ObjectTip()
{
-// delete mypRect;
if( mypLabel )
delete mypLabel;
-
- //if( mypPoint )
- // delete mypPoint;
-
- //if( mypTimer )
- // delete mypTimer;
}
It is called when there is a possibility that a tool tip should be shown
\param p - position of tooltip
*/
-bool GLViewer_ObjectTip::maybeTip( const QPoint &p )
+bool GLViewer_ObjectTip::maybeTip( const QPoint& /*p*/ )
{
- //GUI_UNUSED(p);
-
GLViewer_Context* aContext = ((GLViewer_Viewer2d*)mypViewPort->getViewFrame()->getViewer())->getGLContext();
-
- /*if( !aContext->currentObjectIsChanged() )
- return false;
- else
- return true;
- if( myPoint.x() == -1 && myPoint.y() == -1 || aContext->currentObjectIsChanged())
- {
- myPoint = p;
- }
- else/if( abs(myPoint.y() - p.y()) < 16 )
- {
- return;
- }
- else // > 16
- {
- myPoint = p;
- }
-*/
GLViewer_Object* anObj = aContext->getCurrentObject();
if( anObj )
{
}
return false;
- /*if( anObj )
- {
- //GLViewer_Rect* aRect = anObj->getRect();
- //QRect aWinRect = mypViewPort->GLV2win( *aRect );
- tip( QRect( p.x(), p.y(), 1, 1 ), anObj->getName() );
- //QFontMetrics aFM( font() );
- //showTip( aWinRect, anObj->getName(), QRect( 0, 0, aFM.width( anObj->getName() + " " ), aFM.height()*1.5 ) );
- //tip( aWinRect, anObj->getName(), aWinRect( aFM.width( anObj->getName() + " " ), aFM.height()*1.5 ) );
- }
-// else
-// clear();
-
- //tip( QRect( 0, 0, mypViewPort->getGLWidget()->width(),mypViewPort->getGLWidget()->height() ) , "test Tool tip" );
- */
}
/*!
hideTipAndSleep();
switch( e->type() )
{
- /*case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease:
- case QEvent::MouseButtonDblClick:
- case QEvent::KeyPress:
- case QEvent::KeyRelease:
- // input - turn off tool tip mode
- hideTipAndSleep();
- break;*/
case QEvent::MouseMove:
+ {
+ QWidget* aWidget = (QWidget*) theObj;
+ if( aWidget == mypViewPort->getGLWidget() )
{
- //hideTipAndSleep();
- /*if( mypTimer->isActive() )
- {
- mypTimer->Stop();
- wakeUp();
- }*/
- QWidget* aWidget = (QWidget*) theObj;
- if( aWidget == mypViewPort->getGLWidget() )
- {
- wakeup();
- QMouseEvent* m = (QMouseEvent *)e;
- //if( !mypPoint )
- // mypPoint = new QPoint();
-
- myPoint.setX( m->x() );
- myPoint.setY( m->y() );
- }
+ wakeup();
+ QMouseEvent* m = (QMouseEvent *)e;
+
+ myPoint.setX( m->x() );
+ myPoint.setY( m->y() );
}
+ }
+ default:
+ break;
}
return false;
}
*/
void GLViewer_ObjectTip::hideTipAndSleep()
{
- //if( mypPoint )
- // delete mypPoint;
myPoint.setX(-1);
myPoint.setY(-1);
if( mypLabel )
{
mypLabel->hide();
- //delete mypLabel;
}
mypTimer->stop();
}
QPoint pos = mypViewPort->getGLWidget()->mapToGlobal( myPoint );
- //mypLabel->show();
int cur_height = 24;
QCursor* aCursor = QApplication::overrideCursor();
if( aCursor )
/*!
Adds line
*/
-void GLViewer_LineField::addLine( FieldDim theDim, GLViewer_LineList* )
+void GLViewer_LineField::addLine( FieldDim, GLViewer_LineList* )
{
- //GUI_UNUSED(theDim);
//not implemented
}
*/
GLViewer_ViewPort2d::GLViewer_ViewPort2d( QWidget* parent, GLViewer_ViewFrame* theViewFrame )
: GLViewer_ViewPort( parent ),
- myMargin( MARGIN ), myWidth( WIDTH ), myHeight( HEIGHT ),
+ myMargin( MARGIN ), myHeight( HEIGHT ), myWidth( WIDTH ),
myXScale( 1.0 ), myYScale( 1.0 ), myXOldScale( 1.0 ), myYOldScale( 1.0 ),
myXPan( 0.0 ), myYPan( 0.0 ),
myIsMouseReleaseBlock( false ),
Transform view by view borders
\param keepScale - if it is true, zoom does not change
*/
-void GLViewer_ViewPort2d::fitAll( bool keepScale, bool withZ )
+void GLViewer_ViewPort2d::fitAll( bool keepScale, bool /*withZ*/ )
{
- //GUI_UNUSED(withZ);
//cout << "GLViewer_ViewPort2d::fitAll" << endl;
float xa, xb, ya, yb;
glEndList();
- if ( aTextList != -1 )
+ if ( (int)aTextList != -1 )
glCallList( aTextList );
}
/*!
Constructor
*/
-GLViewer_Viewer::GLViewer_Viewer( const QString& title )
+GLViewer_Viewer::GLViewer_Viewer( const QString& /*title*/ )
: SUIT_ViewModel(),
mySelector( 0 ),
+mySelMode( NoSelection ),
mySketcher( 0 ),
-myTransformer( 0 ),
-mySelMode( NoSelection )
+myTransformer( 0 )
{
- //GUI_UNUSED(title);
}
/*!
/*!
Called when smth is selected in this viewer. [ virtual protected slot ]
*/
-void GLViewer_Viewer::onSelectionDone( bool bAdded, SelectionChangeStatus status )
+void GLViewer_Viewer::onSelectionDone( bool /*bAdded*/, SelectionChangeStatus status )
{
- //GUI_UNUSED(bAdded);
emit selectionChanged( status );
}
if ( e->modifiers() & GLViewer_ViewTransformer::accelKey() )
{
Qt::MouseButton bs = e->button();
- if ( bs == GLViewer_ViewTransformer::zoomButton() )
+ if ( (int)bs == GLViewer_ViewTransformer::zoomButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint
activateTransform( Zoom );
- else if ( bs == GLViewer_ViewTransformer::panButton() )
+ else if ( (int)bs == GLViewer_ViewTransformer::panButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint
activateTransform( Pan );
}
else
}
/* Try to activate default sketching
*/
- else if ( e->button() == GLViewer_ViewSketcher::sketchButton() )
+ else if ( (int)e->button() == GLViewer_ViewSketcher::sketchButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint
{
activateSketching( Rect );
if ( mySketcher )
: QObject( 0 ),
myViewer( v ),
myType( type ),
-myMajorBtn( Qt::NoButton ),
myButtonState( 0 ),
+myMajorBtn( Qt::NoButton ),
myRectBand( 0 )
{
if ( myType == GLViewer_Viewer::Pan ||
GLViewer_ViewSketcher::GLViewer_ViewSketcher( GLViewer_Viewer* viewer, int type )
: QObject( 0 ),
myViewer( viewer ),
-myData( 0 ),
myType( type ),
+myData( 0 ),
myRectBand( 0 )
{
if( !myViewer )
/*!
Updates colors for all drawers (does not work)
*/
-void GLViewer_Viewer2d::updateColors( QColor colorH, QColor colorS )
+void GLViewer_Viewer2d::updateColors( QColor /*colorH*/, QColor /*colorS*/ )
{
- //GUI_UNUSED(colorH);
- //GUI_UNUSED(colorS);
-// cout << "GLViewer_Viewer2d::updateColors" << endl;
-
-/*
- for ( DrawerMap::Iterator it = myDrawers.begin(); it != myDrawers.end(); ++it )
- {
- it.key()->setHColor( colorH );
- it.key()->setSColor( colorS );
- }
-*/
- /*
- ObjList anObjects = myGLContext->getObjects();
- ObjList::Iterator beginIt = anObjects.begin();
- ObjList::Iterator endIt = anObjects.end();
- for ( ObjList::Iterator it = beginIt; it != endIt; ++it )
- {
- //GLViewer_Drawer* aDrawer = (*it)->getDrawer();
- //aDrawer->setHColor( colorH );
- //aDrawer->setSColor( colorS );
- }
- */
-
-
activateAllDrawers( true );
}
/*!
\param onlyUpdate is passed to method activateAllDrawers drawers
*/
-void GLViewer_Viewer2d::updateDrawers( GLboolean update, GLfloat scX, GLfloat scY )
+void GLViewer_Viewer2d::updateDrawers( GLboolean update, GLfloat /*scX*/, GLfloat /*scY*/ )
{
- //GUI_UNUSED(scX);
- //GUI_UNUSED(scY);
-// cout << "GLViewer_Viewer2d::updateDrawers" << endl;
-
- //myGLContext->updateScales( scX, scY );
- //myGLSketcher->drawContour();
activateAllDrawers( update );
}
*/
bool GLViewer_Viewer2d::testRotation( QMouseEvent* e )
{
- if ( ( e->button() == GLViewer_View2dTransformer::rotateButton() ) &&
+ if ( ( (int)e->button() == GLViewer_View2dTransformer::rotateButton() ) && // todo Qt::MouseButton is unsigned int: comparison of int with uint
( e->type() == QEvent::MouseButtonPress ) &&
( e->modifiers() & GLViewer_ViewTransformer::accelKey() ) )
{
A constructor
Parameters using for QOGLWidget as is
*/
-GLViewer_Widget::GLViewer_Widget( QWidget* parent, const char* name ):
+GLViewer_Widget::GLViewer_Widget( QWidget* parent, const char* /*name*/ ):
QGLWidget( parent, 0/*, WRepaintNoErase | WResizeNoErase*/ )
{
- //GUI_UNUSED(name);
myViewPort = ( GLViewer_ViewPort2d* )parent;
myXPan = 0.0;
memcpy( dest, source, aSize/8 );
else
{
- double r, g, b; WORD color;
+ double r=0, g=0, b=0; WORD color;
for( int i=0; i<width; i++ )
{
color = 0;
// Function : checkHighlight
// Purpose :
//================================================================
-bool GraphicsView_Object::checkHighlight( double theX, double theY, QCursor& theCursor ) const
+bool GraphicsView_Object::checkHighlight( double theX, double theY, QCursor& /*theCursor*/ ) const
{
- /*GUI_UNUSED(theCursor);*/
return !getRect().isNull() && getRect().contains( theX, theY );
}
bool GraphicsView_Object::highlight( double theX, double theY )
{
QCursor aCursor;
- if( myIsHighlighted = isVisible() )
+ if( (myIsHighlighted = isVisible()) )
myIsHighlighted = checkHighlight( theX, theY, aCursor );
return myIsHighlighted;
}
bool GraphicsView_Object::select( double theX, double theY, const QRectF& theRect )
{
QCursor aCursor;
- if( myIsSelected = isVisible() )
+ if( (myIsSelected = isVisible()) )
{
if( !theRect.isNull() )
myIsSelected = theRect.contains( getRect() );
//================================================================
void GraphicsView_Scene::onSceneRectChanged( const QRectF& theRect )
{
+ (void)theRect; // unused in debug mode
#ifdef VIEWER_DEBUG
mySceneRectItem->setRect( theRect );
#endif
//================================================================
bool GraphicsView_ViewPort::isItemAdded( QGraphicsItem* theItem )
{
- if( GraphicsView_Object* anObject = dynamic_cast<GraphicsView_Object*>( theItem ) )
+ if( dynamic_cast<GraphicsView_Object*>( theItem ) )
{
for( GraphicsView_ObjectList::iterator anIter = myObjects.begin(); anIter != myObjects.end(); anIter++ )
if( theItem == *anIter )
bool anIsHighlighted = false;
bool anIsOnObject = false;
- GraphicsView_Object* aPreviousHighlightedObject = myHighlightedObject;
GraphicsView_Object* aHighlightedObject = 0;
QCursor aCursor;
{
aStatus = GVSS_NoChanged;
- bool updateAll = false;
if( !theIsAppend )
{
if( !mySelectedObjects.isEmpty() )
else
anObjectsToMove.append( anObject );
}
- else if( ( hasInteractionFlag( DraggingByMiddleButton ) && ( e->buttons() & Qt::MidButton ) ||
- isDraggingSelectedByLeftButton() && ( e->buttons() & Qt::LeftButton ) ) &&
+ else if( ( ( hasInteractionFlag( DraggingByMiddleButton ) && ( e->buttons() & Qt::MidButton ) ) ||
+ ( isDraggingSelectedByLeftButton() && ( e->buttons() & Qt::LeftButton ) ) ) &&
nbSelected() )
{
for( initSelected(); moreSelected(); nextSelected() )
if( ( getHighlightedObject() &&
getHighlightedObject()->isMovable() &&
!( anAccel || e->button() != Qt::LeftButton ) ) ||
- ( ( hasInteractionFlag( DraggingByMiddleButton ) && e->button() == Qt::MidButton ||
- isDraggingSelectedByLeftButton() && e->button() == Qt::LeftButton ) &&
+ ( ( ( hasInteractionFlag( DraggingByMiddleButton ) && e->button() == Qt::MidButton ) ||
+ ( isDraggingSelectedByLeftButton() && e->button() == Qt::LeftButton ) ) &&
nbSelected() && !anAccel ) )
{
myIsDragging = true;
: QObject( 0 ),
myViewer( v ),
myType( type ),
- myMajorBtn( Qt::NoButton ),
myButtonState( 0 ),
+ myMajorBtn( Qt::NoButton ),
myRectBand( 0 )
{
if( myType == GraphicsView_Viewer::Pan ||
// Name : GraphicsView_Viewer
// Purpose : Constructor
//=======================================================================
-GraphicsView_Viewer::GraphicsView_Viewer( const QString& title, QWidget* widget )
+GraphicsView_Viewer::GraphicsView_Viewer( const QString& /*title*/, QWidget* widget )
: SUIT_ViewModel(),
mySelector( 0 ),
myTransformer( 0 ),
myWidget( widget ),
myIsInitialized( false )
{
- //GUI_UNUSED(title);
}
//=======================================================================
if ( e->modifiers() & GraphicsView_ViewTransformer::accelKey() )
{
Qt::MouseButton bs = e->button();
- if ( bs == GraphicsView_ViewTransformer::zoomButton() )
+ if ( (int)bs == GraphicsView_ViewTransformer::zoomButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint
activateTransform( Zoom );
- else if ( bs == GraphicsView_ViewTransformer::panButton() )
+ else if ( (int)bs == GraphicsView_ViewTransformer::panButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint
activateTransform( Pan );
}
else // checking for other operations before selection in release event
else if( e->button() == Qt::LeftButton &&
!( aViewPort->currentBlock() & GraphicsView_ViewPort::BS_Selection ) &&
!aViewPort->getHighlightedObject() &&
- ( !aViewPort->isDraggingSelectedByLeftButton() ||
- aViewPort->isDraggingSelectedByLeftButton() && aViewPort->nbSelected() == 0 ) )
+ ( ( !aViewPort->isDraggingSelectedByLeftButton() ) ||
+ ( aViewPort->isDraggingSelectedByLeftButton() && aViewPort->nbSelected() == 0 ) ) )
{
// Start rectangular selection if pulling was not started
QPoint p = aViewPort->mapFromScene( e->scenePos() );
// Function : onSketchingFinished
// Purpose :
//================================================================
-void GraphicsView_Viewer::onSketchingFinished( QPainterPath thePath )
+void GraphicsView_Viewer::onSketchingFinished( QPainterPath /*thePath*/ )
{
// testing ImageViewer
//onTestCropOperatorPerform( thePath );
}
// Creating the action
- QAction * action= this->createAction( effIdentifier, label, actionIcon,
- label, effToolTip, 0, getApp()->desktop(),
- false, slotobject, slotmember);
+ this->createAction( effIdentifier, label, actionIcon,
+ label, effToolTip, 0, getApp()->desktop(),
+ false, slotobject, slotmember);
return effIdentifier;
}
// Obsolete:
void initialize(bool dummy = true)
- { isRunning(); Q_UNUSED(dummy) }
+ { isRunning(); }
public Q_SLOTS:
bool sendMessage(const QString &message, int timeout = 5000);
int inputLen = input.length();
QDataStream anInputData( &input, QIODevice::ReadOnly );
while ( tmp < inputLen ) {
- tmp = input.indexOf( QToolBarMarker, tmp + 1 );
+ tmp = input.indexOf( (uchar)QToolBarMarker, tmp + 1 );
if ( tmp < 0 )
break;
anInputData.device()->seek( tmp );
}
/*!Protected SLOT. On study closed.*/
-void LightApp_Application::onStudyClosed( SUIT_Study* s )
+void LightApp_Application::onStudyClosed( SUIT_Study* /*s*/ )
{
/*
disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
\param name new name of the object
\brief Return \c true if rename operation finished successfully, \c false otherwise.
*/
-bool LightApp_Application::renameObject( const QString& entry, const QString& ) {
+bool LightApp_Application::renameObject( const QString& /*entry*/, const QString& /*name*/ ) {
return false;
}
return aRes;
QDataStream anInputData(&input, QIODevice::ReadOnly);
- int toolBarMarkerIndexDef;
+ int toolBarMarkerIndexDef = 0;
if(hasDefaultState) {
toolBarMarkerIndexDef = getToolbarMarkerIndex(defaultState, aNames);
if(toolBarMarkerIndexDef < 0)
/*!
Emit opened()
*/
-bool LightApp_DataModel::open( const QString&, CAM_Study* study, QStringList )
+bool LightApp_DataModel::open( const QString&, CAM_Study*, QStringList )
{
emit opened(); //TODO: is it really needed? to be removed maybe...
return true;
*/
LightApp_DataObject::LightApp_DataObject( SUIT_DataObject* parent )
: CAM_DataObject( parent ),
- myCompObject( 0 ),
- myCompDataType( "" )
+ myCompDataType( "" ),
+ myCompObject( 0 )
{
}
if (myMap.count(aName))
aListOfFiles = myMap[aName];
- return aListOfFiles;
+ return aListOfFiles;
}
/*!
theList.append( new LightApp_DataOwner( aViewport->selectedObject()->getName() ) );
}
-void LightApp_GVSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
+void LightApp_GVSelector::setSelection( const SUIT_DataOwnerPtrList& /*theList*/ )
{
}
/*!
virtual method called to manage the same operations
*/
-bool LightApp_Module::reusableOperation( const int id )
+bool LightApp_Module::reusableOperation( const int /*id*/ )
{
return true;
}
*/
void LightApp_OBSelector::onSelectionChanged()
{
+#ifdef _DEBUG_
QTime t1 = QTime::currentTime();
+#endif
mySelectedList.clear();
selectionChanged();
- QTime t2 = QTime::currentTime();
#ifdef _DEBUG_
+ QTime t2 = QTime::currentTime();
qDebug( QString( "selection time = %1 msecs" ).arg( t1.msecsTo( t2 ) ).toLatin1().constData() );
#endif
}
: SUIT_Selector( mgr, v ),
myViewer(v)
{
- if ( v )
+ if ( v ) {
connect( v, SIGNAL( legendSelected( const QString& ) ), this, SLOT( onSelectionChanged( const QString& ) ) );
connect( v, SIGNAL( clearSelected() ), this, SLOT( onClearSelected( ) ) );
+ }
}
/*!
/*!
Creates SComponent for module, necessary for SalomeApp study
*/
-void LightApp_Study::addComponent(const CAM_DataModel* dm)
+void LightApp_Study::addComponent(const CAM_DataModel* /*dm*/)
{
}
if ( !anOp->isActive() && anOp->isAutoResumed() &&
study() && !study()->blockingOperation( anOp ) )
study()->resume( anOp );
+ break;
}
- break;
-
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonPress:
case QEvent::MouseButtonDblClick:
{
if ( !anOp->isActive() )
return true;
+ break;
}
- break;
-
+ default:
+ break;
}
}
}
*/
class LIGHTAPP_EXPORT LightApp_VTKSelector : public QObject, public SUIT_Selector
{
- Q_OBJECT;
+ Q_OBJECT
public:
virtual ~LightApp_VTKSelector() {};
{
myHilightColor = color;
if ( !myAISContext.IsNull() ) {
- const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle();
+ const Handle(Prs3d_Drawer)& hStyle = myAISContext->HighlightStyle();
hStyle->SetColor( myHilightColor );
}
}
{
mySelectColor = color;
if ( !myAISContext.IsNull() ) {
- const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle();
+ const Handle(Prs3d_Drawer)& sStyle = myAISContext->SelectionStyle();
sStyle->SetColor( mySelectColor );
}
}
{
myAISContext = aisContext;
if ( ! myAISContext.IsNull() ) {
- const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle();
- const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle();
+ const Handle(Prs3d_Drawer)& hStyle = myAISContext->HighlightStyle();
+ const Handle(Prs3d_Drawer)& sStyle = myAISContext->SelectionStyle();
hStyle->SetColor( myHilightColor );
sStyle->SetColor( mySelectColor );
myAISContext->SetSubIntensityColor( Quantity_NOC_CYAN1 );
if ( myAISContext.IsNull() )
return false;
- myNumSelected = myAISContext->NbCurrents(); /* update after the last selection */
+ myNumSelected = myAISContext->NbCurrents(); /* update after the last selection */ // todo: NbCurrents is deprecated
if ( status == AIS_SOP_NothingSelected && !hadSelection ) {
emit selSelectionCancel( addTo );
result[1] = first[2]*second[0] - first[0]*second[2];
result[2] = first[0]*second[1] - first[1]*second[0];
}
-};
+}
OCCViewer_ClipPlane::OCCViewer_ClipPlane()
-: X( 0.0 ),
+: Mode( Absolute ),
+ IsOn( true ),
+ X( 0.0 ),
Y( 0.0 ),
- Z( 0.0 ),
- Mode( Absolute ),
- IsOn( true )
+ Z( 0.0 )
{
OrientationType = AbsoluteCustom;
AbsoluteOrientation.Dx = 0.0;
bool OCCViewer_ClipPlaneInteractor::isClickable( const Handle(AIS_Plane)& thePlane )
{
bool isFound = Standard_False;
- for ( int aPlaneIt = 0; aPlaneIt < myPlanes.size(); ++aPlaneIt )
+ for ( int aPlaneIt = 0; aPlaneIt < (int)myPlanes.size(); ++aPlaneIt )
{
if ( myPlanes[aPlaneIt] == thePlane )
{
Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
- if ( anAISContext->IsSelected( Handle(AIS_InteractiveObject)::DownCast(thePlane) ) )
+ if ( anAISContext->IsSelected( thePlane ) )
{
return false;
}
bool OCCViewer_ClipPlaneInteractor::isDraggable( const Handle(AIS_Plane)& thePlane )
{
bool isFound = Standard_False;
- for ( int aPlaneIt = 0; aPlaneIt < myPlanes.size(); ++aPlaneIt )
+ for ( int aPlaneIt = 0; aPlaneIt < (int)myPlanes.size(); ++aPlaneIt )
{
if ( myPlanes[aPlaneIt] == thePlane )
{
Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
- if ( !anAISContext->IsSelected( Handle(AIS_InteractiveObject)::DownCast(thePlane) ) )
+ if ( !anAISContext->IsSelected( thePlane ) )
{
return false;
}
myMouseDragPln = gp_Pln( aPickPoint, aMousePlnN );
+ /* todo: aDistance2Center, aCenterOnMousePln not used
Standard_Real aDistance2Center = myMouseDragPln.Distance( aPlaneCenter );
gp_Pnt aCenterOnMousePln = aMousePlnN * gp_Vec( aPickPoint, aPlaneCenter ) < 0.0
? aPlaneCenter.Translated( aMousePlnN * aDistance2Center )
: aPlaneCenter.Translated( aMousePlnN * -aDistance2Center );
+ */
myRotationAxis = gp_Ax1( myRotationCenter, aMousePlnN );
}
myMouseDragPln = gp_Pln( aPickPoint, aMousePlnN );
+ /* todo: aDistance2Center, aCenterOnMousePln not used
Standard_Real aDistance2Center = myMouseDragPln.Distance( aPlaneCenter );
gp_Pnt aCenterOnMousePln = aMousePlnN * gp_Vec( aPickPoint, aPlaneCenter ) < 0.0
? aPlaneCenter.Translated( aMousePlnN * aDistance2Center )
: aPlaneCenter.Translated( aMousePlnN * -aDistance2Center );
+ */
myRotationAxis = gp_Ax1( myRotationCenter, aMousePlnN );
}
return true;
}
+ default:
+ {
+ break;
+ }
}
return false;
myViewer->getAISContext()->Update( thePlane , Standard_True );
}
break;
+ default:
+ break;
}
}
// process mouse click on the object
if ( myIsClickable )
{
- myViewer->getAISContext()->SetSelected( Handle(AIS_InteractiveObject)::DownCast(aPlane) , Standard_True );
+ myViewer->getAISContext()->SetSelected( aPlane, Standard_True );
emit planeClicked( aPlane );
}
\param theEvent [in] the user event.
\param theViewPort [in] the viewport.
*/
-bool OCCViewer_ClipPlaneInteractor::mouseRelease( QMouseEvent* theEvent,
- OCCViewer_ViewPort3d* theViewPort )
+bool OCCViewer_ClipPlaneInteractor::mouseRelease( QMouseEvent* /*theEvent*/,
+ OCCViewer_ViewPort3d* /*theViewPort*/ )
{
if ( !isPerforming() )
{
\param theEvent [in] the user event.
\param theViewPort [in] the viewport.
*/
-bool OCCViewer_ClipPlaneInteractor::mouseDoubleClick( QMouseEvent* theEvent,
- OCCViewer_ViewPort3d* theViewPort )
+bool OCCViewer_ClipPlaneInteractor::mouseDoubleClick( QMouseEvent* /*theEvent*/,
+ OCCViewer_ViewPort3d* /*theViewPort*/ )
{
return isPerforming();
}
gp_Pnt aBasePnt;
gp_Dir aNormal;
clipPlaneParams(aClipPlane, ic, aSize, aBasePnt, aNormal, myModel->trihedronSize());
- if(myPreviewPlaneVector.size() < (size_t)clipPlanesCount()) { //TODO: mismatch signed/unsigned
+ if((int)myPreviewPlaneVector.size() < clipPlanesCount()) { //TODO: mismatch signed/unsigned
myPreviewPlaneVector.resize(clipPlanesCount());
}
myPreviewPlane = myPreviewPlaneVector[aCurPlaneIndex];
ic->SetColor( myPreviewPlane, Quantity_Color( 255. / 255., 70. / 255., 0. / 255., Quantity_TOC_RGB ), false );
ic->Update( myPreviewPlane, Standard_False );
} else {
- if(myPreviewPlaneVector.size() > aCurPlaneIndex ) {
+ if((int)myPreviewPlaneVector.size() > aCurPlaneIndex ) {
myPreviewPlane = myPreviewPlaneVector[aCurPlaneIndex];
if(ic->IsDisplayed(myPreviewPlane)) {
ic->Erase( myPreviewPlane, false );
Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
- if(aPlaneIndex+1 <= myPreviewPlaneVector.size()) {
+ if(aPlaneIndex+1 <= (int)myPreviewPlaneVector.size()) {
Handle(AIS_Plane) myPreviewPlane = myPreviewPlaneVector[aPlaneIndex];
if ( !myPreviewPlane.IsNull() && ic->IsDisplayed( myPreviewPlane ) ) {
ic->Erase( myPreviewPlane, false );
return;
}
- OCCViewer_ClipPlane& aClipPlane = getClipPlane( theIndex );
+ //OCCViewer_ClipPlane& aClipPlane = getClipPlane( theIndex ); // unused
myIsSelectPlane = true;
updateControls();
*/
void OCCViewer_ClippingDlg::onPlaneClicked( const Handle_AIS_Plane& thePlane )
{
- for ( int aPlaneIt = 0; aPlaneIt < myPreviewPlaneVector.size(); aPlaneIt++ )
+ for ( int aPlaneIt = 0; aPlaneIt < (int)myPreviewPlaneVector.size(); aPlaneIt++ )
{
Handle(AIS_Plane)& aPlane = myPreviewPlaneVector.at( aPlaneIt );
if ( aPlane != thePlane )
*/
void OCCViewer_ClippingDlg::onPlaneDragged( const Handle_AIS_Plane& thePlane )
{
- for ( int aPlaneIt = 0; aPlaneIt < myPreviewPlaneVector.size(); aPlaneIt++ )
+ for ( int aPlaneIt = 0; aPlaneIt < (int)myPreviewPlaneVector.size(); aPlaneIt++ )
{
Handle(AIS_Plane)& aPlane = myPreviewPlaneVector.at( aPlaneIt );
if ( aPlane != thePlane )
{
if( curItem && ( curItem->flags() & Qt::ItemIsEditable ) )
{
- int lowLevel = -1;
- int highLevel = -1;
int index = curItem->listWidget()->row( curItem );
Handle(V3d_View) aView3d = myCurViewPort->getView();
myCurrentItem = myParametersMap[ index ];
}
else {
myEnvTextureName->setText("");
- Graphic3d_NameOfTextureEnv aStandardTexture; //!<TODO: unused variable
QList<Graphic3d_NameOfTextureEnv> aTextures;
aTextures << Graphic3d_NOT_ENV_CLOUDS << Graphic3d_NOT_ENV_CV << Graphic3d_NOT_ENV_MEDIT
<< Graphic3d_NOT_ENV_PEARL << Graphic3d_NOT_ENV_SKY1 << Graphic3d_NOT_ENV_SKY2
const double min = -RealLast();
const double max = RealLast();
- const int precision = 3;
/********************** Directional light **********************/
/* Controls for directional light:
myModel->getViewer3d()->NextDefinedLights();
}
- double aX, aY, aZ;
+ double aX=0., aY=0., aZ=0.;
Quantity_Color aColor = aLight->Color();
if( myDirType->isChecked() ) {
myDirColor->setColor( OCCViewer::color( aColor ) );
\param modal - is this dialog modal
\param fl - flags
*/
-OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, const char* name, bool modal, Qt::WindowFlags fl )
+OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, const char* /*name*/, bool modal, Qt::WindowFlags /*fl*/ )
: QDialog( view, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myView( view )
{
\param txtRect - returned tooltip text rectangle
\param rect - returned tooltip rectangle
*/
-void OCCViewer_ToolTip::onToolTip( QPoint p, QString& str, QFont& f, QRect& txtRect, QRect& rect )
+void OCCViewer_ToolTip::onToolTip( QPoint p, QString& str, QFont& /*f*/, QRect& txtRect, QRect& rect )
{
OCCViewer_Viewer* v = dynamic_cast<OCCViewer_Viewer*>( myWnd->getViewManager()->getViewModel() );
Handle( AIS_InteractiveContext ) aCont = v->getAISContext();
case OCCViewer_ViewWindow::YZPlane:
aView3d->SetProj (V3d_Xpos);
break;
+ default:
+ break;
}
}
/*!
Creates viewer 3d [ static ]
*/
-Handle(V3d_Viewer) OCCViewer_VService::CreateViewer( const Standard_ExtString name,
- const Standard_CString displayName,
- const Standard_CString domain,
- const Standard_Real viewSize ,
- const V3d_TypeOfOrientation viewProjection,
- const Standard_Boolean computedMode,
- const Standard_Boolean defaultComputedMode )
+Handle(V3d_Viewer) OCCViewer_VService::CreateViewer()
{
static Handle(OpenGl_GraphicDriver) aGraphicDriver;
if (aGraphicDriver.IsNull())
- {
- Handle(Aspect_DisplayConnection) aDisplayConnection;
-#if !defined WIN32 && !defined __APPLE__
- aDisplayConnection = new Aspect_DisplayConnection( displayName );
-#else
- aDisplayConnection = new Aspect_DisplayConnection();
-#endif
- aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
- }
-
- return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection,
- Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD,
- computedMode, defaultComputedMode );
+ aGraphicDriver = new OpenGl_GraphicDriver(new Aspect_DisplayConnection());
+ return new V3d_Viewer(aGraphicDriver);
}
class Standard_EXPORT OCCViewer_VService
{
public:
-
static Handle(Aspect_Window) CreateWindow( const Handle(V3d_View)&, WId );
-
- static Handle(V3d_Viewer) CreateViewer( const Standard_ExtString,
- const Standard_CString = "",
- const Standard_CString = "",
- const Quantity_Length = 1000.0,
- const V3d_TypeOfOrientation = V3d_XposYnegZpos,
- const Standard_Boolean = Standard_True,
- const Standard_Boolean = Standard_True );
+ static Handle(V3d_Viewer) CreateViewer();
};
#endif
#include <QApplication>
OCCViewer_ViewFrame::OCCViewer_ViewFrame(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel)
- : OCCViewer_ViewWindow( theDesktop, theModel ), myPopupRequestedView(0), mySplitMode(-1)
+ : OCCViewer_ViewWindow( theDesktop, theModel ), mySplitMode(-1), myPopupRequestedView(0)
{
QFrame* centralFrame = new QFrame( this );
setCentralWidget( centralFrame );
if( mySplitMode == -1 )
return;
- int aNbViews;
+ int aNbViews = 1;
if ( mySplitMode >= 0 && mySplitMode < 2)
aNbViews = 2;
else if( mySplitMode >= 2 && mySplitMode < 8 )
aNbViews = 4;
if( aNbViews != myViewsMode.count() )
- return;
+ return;
int SubViews3Map[6][3][4] = {
{ {0,0,1,1}, {0,1,1,1}, {0,2,1,1} },
*/
OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
: SUIT_ViewModel(),
- myBackgrounds(4, Qtx::BackgroundData( Qt::black )),
myIsRelative(true),
- myTopLayerId( 0 ),
+ myTopLayerId(0),
myTrihedronSize(100),
- myClippingDlg (NULL),
+ myBackgrounds(4, Qtx::BackgroundData(Qt::black)),
+ myClippingDlg(0),
myFitter(0)
{
// init CasCade viewers
- myV3dViewer = OCCViewer_VService::CreateViewer( TCollection_ExtendedString("Viewer3d").ToExtString() );
+ myV3dViewer = OCCViewer_VService::CreateViewer();
//myV3dViewer->Init(); // to avoid creation of the useless perspective view (see OCCT issue 0024267)
setDefaultLights();
Handle(Prs3d_Drawer) drawer = myTrihedron->Attributes();
if (drawer->HasOwnDatumAspect()) {
Handle(Prs3d_DatumAspect) daspect = drawer->DatumAspect();
- daspect->FirstAxisAspect()->SetColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB));
- daspect->SecondAxisAspect()->SetColor(Quantity_Color(0.0, 1.0, 0.0, Quantity_TOC_RGB));
- daspect->ThirdAxisAspect()->SetColor(Quantity_Color(0.0, 0.0, 1.0, Quantity_TOC_RGB));
+ daspect->LineAspect(Prs3d_DP_XAxis)->SetColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB));
+ daspect->LineAspect(Prs3d_DP_YAxis)->SetColor(Quantity_Color(0.0, 1.0, 0.0, Quantity_TOC_RGB));
+ daspect->LineAspect(Prs3d_DP_ZAxis)->SetColor(Quantity_Color(0.0, 0.0, 1.0, Quantity_TOC_RGB));
}
}
/*!
SLOT: called on mouse button press, stores current mouse position as start point for transformations
*/
-void OCCViewer_Viewer::onMousePress(SUIT_ViewWindow* theWindow, QMouseEvent* theEvent)
+void OCCViewer_Viewer::onMousePress(SUIT_ViewWindow* /*theWindow*/, QMouseEvent* theEvent)
{
myStartPnt.setX(theEvent->x()); myStartPnt.setY(theEvent->y());
}
if (myStartPnt == myEndPnt)
{
if (!aHasShift) {
- myAISContext->ClearCurrents( false );
+ myAISContext->ClearCurrents( false ); // todo: ClearCurrents is deprecated
emit deselection();
}
if ( !isPreselectionEnabled() ) {
switch ( theEvent->key() ) {
case Qt::Key_S:
if (!aHasShift) {
- myAISContext->ClearCurrents( false );
+ myAISContext->ClearCurrents( false ); // todo: ClearCurrents is deprecated
emit deselection();
}
\param onlyInViewer - search object only in viewer (so object must be displayed)
*/
bool OCCViewer_Viewer::isInViewer( const Handle(AIS_InteractiveObject)& obj,
- bool onlyInViewer )
+ bool /*onlyInViewer*/ )
{
AIS_ListOfInteractive List;
myAISContext->DisplayedObjects(List);
0 /*wireframe*/,
-1 /* selection mode */,
Standard_True /* update viewer*/,
- Standard_False /* allow decomposition */,
AIS_DS_Displayed /* display status */);
myAISContext->Deactivate( myTrihedron );
}
float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("3DViewer","trihedron_size", 100.);
- static float EPS = 5.0E-3f;
+ static float EPS = 5.0E-3f;
theSize = getTrihedron()->Size();
theNewSize = aMaxSide*aSizeInPercents / 100.0;
Handle(AIS_InteractiveObject) anObj = anIter.Value();
Handle(ViewerData_AISShape) aShape = Handle(ViewerData_AISShape)::DownCast (anObj);
if (!aShape.IsNull() && aShape->IsClippable()) {
- aShape->SetClipPlanes(myInternalClipPlanes);
+ aShape->SetClipPlanes(new Graphic3d_SequenceOfHClipPlane(myInternalClipPlanes)); // todo: store clipping planes in a handle?
}
}
}
Handle(ViewerData_AISShape) aShape = Handle(ViewerData_AISShape)::DownCast (theObject);
if (!aShape.IsNull() && aShape->IsClippable())
{
- aShape->SetClipPlanes (myInternalClipPlanes);
+ aShape->SetClipPlanes (new Graphic3d_SequenceOfHClipPlane(myInternalClipPlanes)); // todo: store clipping planes in a handle?
}
}
*/
OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView type )
: OCCViewer_ViewPort( parent ),
- myScale( 1.0 ),
myBusy( true ),
+ myScale( 1.0 ),
myIsAdvancedZoomingEnabled( false )
{
// VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
Standard_True );
- Quantity_Ratio zRotationThreshold;
+ Standard_Real zRotationThreshold;
zRotation = Standard_False;
zRotationThreshold = 0.45;
if( zRotationThreshold > 0. ) {
/*!
Fits all objects in view. [ virtual protected ]
*/
-void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
+void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool /*withZ*/, bool upd )
{
if ( activeView().IsNull() )
return;
else
avp->setCursor( Qt::ForbiddenCursor );
- if ( e->type() == QEvent::MouseButtonRelease && e->button() == sketchButton() )
+ if ( e->type() == QEvent::MouseButtonRelease && (int)e->button() == sketchButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint
{
myResult = Accept;
QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
return true;
bool res = true;
- for ( uint i = 0; i < (uint)aPoints->count() - 1 && res; i++ )
+ for ( int i = 0; i < aPoints->count() - 1 && res; i++ )
{
const QPoint& aStart = aPoints->point( i );
const QPoint& anEnd = aPoints->point( i + 1 );
virtual bool isDefault() const;
virtual bool eventFilter( QObject*, QEvent* );
- virtual void setSketcherMode(int theMode) {}
+ virtual void setSketcherMode(int) {}
virtual int sketcherMode() const { return 0; }
private slots:
case YZPlane:
onFrontView();
break;
+ default:
+ break;
}
// Graduated axes dialog
if ( aStructure->IsEmpty() || !aStructure->IsVisible() || aStructure->CStructure()->IsForHighlight )
continue;
- Bnd_Box aBox1 = aStructure->MinMaxValues();
const Graphic3d_BndBox3d& aBox = aStructure->CStructure()->BoundingBox();
if (!aBox.IsValid())
continue;
- aXmin = /*aBox.IsVoid() ? RealFirst() :*/ aBox.CornerMin().x();
+ aXmin = /*aBox.IsVoid() ? RealFirst() : */aBox.CornerMin().x();
aYmin = /*aBox.IsVoid() ? RealFirst() : */aBox.CornerMin().y();
aZmin = /*aBox.IsVoid() ? RealFirst() : */aBox.CornerMin().z();
aXmax = /*aBox.IsVoid() ? RealLast() : */aBox.CornerMax().x();
int aButton = theEvent->buttons();
int anInteractionStyle = interactionStyle();
if ( ( anInteractionStyle == SUIT_ViewModel::STANDARD &&
- aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) ||
+ aButton == Qt::LeftButton && ( aState == Qt::NoModifier || aState == Qt::ShiftModifier ) ) ||
( anInteractionStyle == SUIT_ViewModel::KEY_FREE &&
aButton == Qt::LeftButton && ( aState == Qt::ControlModifier || aState == ( Qt::ControlModifier|Qt::ShiftModifier ) ) ) ) {
myDrawRect = myEnableDrawMode;
resetState();
}
break;
+ default:
+ break;
}
// NOTE: viewer 3D detects a rectangle of selection using this event
#endif // USE_OLD_IMPLEMENTATION
}
-bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img,
+bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& /*img*/,
const QString& fileName,
- const QString& format )
+ const QString& /*format*/ )
{
bool res = false;
QApplication::setOverrideCursor( Qt::WaitCursor );
data << QString( "size=%1" ) .arg( params.size, 0, 'f', 2 );
ClipPlanesList aPlanes = myModel->getClipPlanes();
- for ( int i=0; i < aPlanes.size(); i++ )
+ for ( int i=0; i < (int)aPlanes.size(); i++ )
{
OCCViewer_ClipPlane& aPlane = aPlanes[i];
QString ClippingPlane = QString( "ClippingPlane%1=").arg( i+1 );
Handle(V3d_DirectionalLight)::DownCast( aLight )->Direction( aX, aY, aZ );
else if ( aLight->Type() == V3d_POSITIONAL )
Handle(V3d_PositionalLight)::DownCast( aLight )->Position( aX, aY, aZ );
+ else
+ continue; // not supported type of light source
LightSource += QString( "lightX~%1;" ).arg( aX );
LightSource += QString( "lightY~%1;" ).arg( aY );
LightSource += QString( "lightZ~%1;" ).arg( aZ );
myModel->getViewer3d()->NextDefinedLights();
}
}
- double aX, aY, aZ;
- double cR, cG, cB;
- V3d_TypeOfLight aType;
- bool isHeadlight;
+ double aX = 0., aY = 0., aZ = 0.;
+ double cR = 0., cG = 0., cB = 0.;
+ V3d_TypeOfLight aType = (V3d_TypeOfLight)-1; // not specified
+ bool isHeadlight = false;
QStringList lsData = paramValue.split( ';' );
foreach( QString lsParam, lsData )
{
aDestView->SetImmediateUpdate( Standard_True );
aDestView->Redraw();
}
- catch (Standard_Failure) {
+ catch (Standard_Failure&) {
}
blockSignals( blocked );
if( USE_XY )
{
const double EPS = 1E-6;
- int xp = myViewPort->width()/2, yp = myViewPort->height()/2, xp1, yp1; //!< TODO: unused xp1, yp1
+ int xp = myViewPort->width()/2, yp = myViewPort->height()/2;
aView3d->Convert( xp, yp, X, Y, Z );
gp_Dir d = aView3d->Camera()->Direction();
{
public:
PVServer_ServiceLoader_Exception(const std::string & what):_what(what) {}
- ~PVServer_ServiceLoader_Exception() {}
+ ~PVServer_ServiceLoader_Exception() noexcept {}
virtual const char* what() const noexcept { return _what.c_str(); }
private:
std::string _what;
* This method should be updated at each new version of ParaView with what is found in
* Qt/ApplicationComponents/pqParaViewBehaviors.cxx
*/
-void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * desk)
+void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * /*desk*/)
{
- //GUI_UNUSED(desk);
if (BehaviorLoadingLevel < 1)
{
// Register ParaView interfaces.
\param fullSetup whether to instanciate all behaviors or just the minimal ones.
\return \c true if ParaView has been initialized successfully, otherwise false
*/
-bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop)
+bool PVViewer_Core::ParaviewInitApp(QMainWindow * /*aDesktop*/)
{
- //GUI_UNUSED(aDesktop);
if ( ! MyCoreApp) {
// Obtain command-line arguments
int argc = 0;
#include <vtkObjectFactory.h>
-vtkStandardNewMacro(PVViewer_OutputWindow);
+vtkStandardNewMacro(PVViewer_OutputWindow)
PVViewer_OutputWindow::PVViewer_OutputWindow()
{
{
}
-const unsigned int PVViewer_OutputWindow::getTextCount()
+unsigned int PVViewer_OutputWindow::getTextCount() const
{
return count(MESSAGE_TYPE_TEXT);
}
-const unsigned int PVViewer_OutputWindow::getErrorCount()
+unsigned int PVViewer_OutputWindow::getErrorCount() const
{
return count(MESSAGE_TYPE_ERROR);
}
-const unsigned int PVViewer_OutputWindow::getWarningCount()
+unsigned int PVViewer_OutputWindow::getWarningCount() const
{
return count(MESSAGE_TYPE_WARNING);
}
-const unsigned int PVViewer_OutputWindow::getGenericWarningCount()
+unsigned int PVViewer_OutputWindow::getGenericWarningCount() const
{
return count(MESSAGE_TYPE_GENERIC_WARNING);
}
-const unsigned int PVViewer_OutputWindow::getDebugCount()
+unsigned int PVViewer_OutputWindow::getDebugCount() const
{
return count(MESSAGE_TYPE_DEBUG);
}
}
}
-int PVViewer_OutputWindow::count(const MessageTypes& type)
+int PVViewer_OutputWindow::count(const MessageTypes& type) const
{
return myCounter.value(type, 0);
}
{
public:
static PVViewer_OutputWindow* New();
- vtkTypeMacro(PVViewer_OutputWindow, vtkOutputWindow);
+ vtkTypeMacro(PVViewer_OutputWindow, vtkOutputWindow)
//! Returns the number of text messages received
- const unsigned int getTextCount();
+ unsigned int getTextCount() const;
//! Returns the number of error messages received
- const unsigned int getErrorCount();
+ unsigned int getErrorCount() const;
//! Returns the number of warning messages received
- const unsigned int getWarningCount();
+ unsigned int getWarningCount() const;
//! Returns the number of generic warning messages received
- const unsigned int getGenericWarningCount();
+ unsigned int getGenericWarningCount() const;
//! Returns the number of debug messages received
- const unsigned int getDebugCount();
+ unsigned int getDebugCount() const;
private:
PVViewer_OutputWindow();
QMap<MessageTypes, int> myCounter;
void DisplayText(const char*);
- int count(const MessageTypes&);
+ int count(const MessageTypes&) const;
};
#endif // PVVIEWER_OUTPUTWINDOW_H
Constructor
*/
Plot2d_Point::Plot2d_Point( double theX, double theY, const QString& theText )
- : x( theX ), y( theY ), text( theText ), deviationPtr(0)
+ : x( theX ), y( theY ), deviationPtr(0), text( theText )
{
}
myMarkerSize( 0 ),
myLine( Plot2d::Solid ),
myLineWidth( 0 ),
+ myNbIntervals(100),
myRangeBegin(0.0),
myRangeEnd(100.0),
- myNbIntervals(100),
myExpression(""),
myAction(Plot2d_AnalyticalCurve::ActAddInView),
myState(Plot2d_AnalyticalCurve::StateNeedUpdate),
static PyMethodDef PyStdOut_methods[] = {
{"write", (PyCFunction)PyStdOut_write, METH_VARARGS,
PyDoc_STR("write(string) -> None")},
- {NULL, NULL} /* sentinel */
+ {0, 0, 0, 0} /* sentinel */
};
static PyMemberDef PyStdOut_memberlist[] = {
{(char*)"softspace", T_INT, offsetof(PyStdOut, softspace), 0,
(char*)"flag indicating that a space needs to be printed; used by print"},
- {NULL} /* Sentinel */
+ {0, 0, 0, 0, 0} /* sentinel */
};
static PyTypeObject PyStdOut_Type = {
double pMin, pMax, kKoef, bKoef, yMin, yMax;
switch( getNormalizationMode() ) {
- case NormalizeToMin:
+ case NormalizeToMin:
pMin = _pMin;
for (int i = 0; i < yMaxLst.size(); ++i) {
yMin = yMinLst.at(i);
aKkoefs<<kKoef;
}
break;
+ default:
+ break;
}
for (int i = 0; i < myInuptData.size(); ++i) {
myName( "" ),
myXAxis( QwtPlot::xBottom ),
myYAxis( QwtPlot::yLeft ),
- myIsSelected(false),
- myScale ( 1.0 )
+ myScale ( 1.0 ),
+ myIsSelected(false)
{
}
QRect iconRect = cr;
if ( !icon().isNull() )
{
- if ( itemMode() != QwtLegendData::ReadOnly )
+ if ( itemMode() != QwtLegendData::ReadOnly ) {
iconRect.setX( iconRect.x() + ButtonFrame );
iconRect.setSize( QSize( icon().size().width() + spacing() ,
icon().size().height() + spacing() ) );
iconRect.moveCenter( QPoint( iconRect.center().x(), cr.center().y() ) );
+ }
}
drawIdentifier( &painter, iconRect );
*/
Plot2d_QwtPlotCurve::Plot2d_QwtPlotCurve( const QString& title,
QwtPlot::Axis yAxis /*const int index*/ ) :
- Plot2d_SelectableItem(),
QwtPlotCurve( title ),
+ Plot2d_SelectableItem(),
myYAxis( yAxis ),
myYAxisIdentifierEnabled( false ),
myDeviationData(0)
*/
Plot2d_SelectableItem::Plot2d_SelectableItem():
myIsSelected(false),
- myLegendSymbol( new QwtSymbol() ),
- myLegendPen( QPen() )
+ myLegendPen( QPen() ),
+ myLegendSymbol( new QwtSymbol() )
{
}
/*!
Redefined method, which create a widget to be inserted into the legend.
*/
-QWidget *Plot2d_QwtLegend::createWidget( const QwtLegendData &data ) const
+QWidget *Plot2d_QwtLegend::createWidget( const QwtLegendData& /*data*/ ) const
{
- Q_UNUSED( data );
-
Plot2d_QwtLegendLabel *label = new Plot2d_QwtLegendLabel();
label->setItemMode( defaultItemMode() );
icur2 = icur1 + groupSize -1;
// For all curves in one group
- double XgroupMin, XgroupMax;
- double YgroupMin, YgroupMax;
+ double XgroupMin = 0., XgroupMax = 0.;
+ double YgroupMin = 0., YgroupMax = 0.;
// For one curve
- double XcurveMin, XcurveMax;
- double YcurveMin, YcurveMax;
+ double XcurveMin = 0., XcurveMax = 0.;
+ double YcurveMin = 0., YcurveMax = 0.;
double *Xval;
double *Yval;
int nbPoints;
int lineWidth,
QColor & lineColor,
QwtSymbol::Style markerKind,
- Plot2d_QwtPlotPicker* picker,
+ Plot2d_QwtPlotPicker* /*picker*/,
bool toDraw,
bool displayLegend)
{
Plot2d_AnalyticalCurve* Plot2d_ViewFrame::getAnalyticalCurve(QwtPlotItem * theItem) {
AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
for( ; it != myAnalyticalCurves.end(); it++) {
- if((*it)->plotItem() == theItem); //!< TODO: empty controlled statement found; is this the intent?
- return (*it);
+ if((*it)->plotItem() == theItem)
+ return (*it);
}
return 0;
}
QList<double> allTicks;
double devXmin, devXmax; // X interval of a system
- double gapXmin, gapXmax; // X interval between two systems
+ double gapXmin = 0., gapXmax = 0.; // X interval between two systems
double devLabPos; // Label's position of a system
double segmentPos; // Position of the vertical segment between current system and the next
aWriter.writeAttribute("Name",c->getName());
aWriter.writeAttribute("IsActive", QString("").sprintf("%d", c->isActive()));
aWriter.writeAttribute("Expression", c->getExpression());
- aWriter.writeAttribute("NbIntervals", QString("").sprintf("%d", c->getNbIntervals()));
+ aWriter.writeAttribute("NbIntervals", QString("").sprintf("%ld", c->getNbIntervals()));
aWriter.writeAttribute("isAuto", QString("").sprintf("%d",isAuto));
if(!isAuto) {
aWriter.writeAttribute("Marker", QString("").sprintf("%d",(int)c->getMarker()));
*/
bool Plot2d_ViewFrame::setXmlVisualParameters(const QString& parameters) {
QXmlStreamReader aReader(parameters);
- double xmin, xmax, ymin, ymax, y2min, y2max;
+ double xmin = 0., xmax = 0., ymin = 0., ymax = 0., y2min = 0., y2max = 0.;
bool leftMin,leftMax,rightMin,rightMax;
leftMin = leftMax = rightMin = rightMax = false;
while(!aReader.atEnd()) {
{
SUIT_ViewManager* aMgr = getViewManager();
QVector<SUIT_ViewWindow*> aViews = aMgr->getViews();
- unsigned int aSize = aViews.size();
- for (uint i = 0; i < aSize; i++) {
+ int aSize = aViews.size();
+ for (int i = 0; i < aSize; i++) {
Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i];
if (myPrs && aView)
aView->getViewFrame()->Display(myPrs);
QVector<SUIT_ViewWindow*> aViews;
if ( aMgr )
aViews = aMgr->getViews();
- unsigned int aSize = aViews.size();
- for (uint i = 0; i < aSize; i++) {
+ int aSize = aViews.size();
+ for (int i = 0; i < aSize; i++) {
Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i];
if (myPrs && aView)
aView->getViewFrame()->Erase(myPrs);
/*
SLOT: called when clicked item in the legend from Plot2d_ViewManager
*/
-void Plot2d_Viewer::onClicked(const QVariant& itemInfo, int index)
+void Plot2d_Viewer::onClicked(const QVariant& /*itemInfo*/, int /*index*/)
{
}
//! \retval Return false.
virtual bool isVisible( const Handle(SALOME_InteractiveObject)& ){ return false; }
virtual void Repaint() {} //!< Null body here.
- virtual void GetVisible( SALOME_ListIO& /*theList*/ ) {/*GUI_UNUSED(theList);*/}
+ virtual void GetVisible( SALOME_ListIO& /*theList*/ ) {}
};
/*!
bool changed = false;
QMap<int, int> aMap;
- for ( uint i = 0; i < (uint)ids.count(); i++ )
+ for ( int i = 0; i < ids.count(); i++ )
aMap.insert( ids.at( i ), 0 );
for ( IdStateMap::Iterator it = myState.begin(); it != myState.end(); ++it )
QDS_Datum::QDS_Datum( const QString& id, QWidget* parent, const int flags, const QString& comp )
: QObject( parent ),
myId( id ),
+ myFlags( flags ),
myLabel( 0 ),
myUnits( 0 ),
myControl( 0 ),
- myFlags( flags ),
myInitialised( false ),
myTr( false )
{
\param unitSystem new active units system
*/
-void QDS_Datum::unitSystemChanged( const QString& unitSystem )
+void QDS_Datum::unitSystemChanged( const QString& /*unitSystem*/ )
{
- //GUI_UNUSED(initSystem);
QString labText = label();
QString unitText = unitsToText( units() );
{
QString trg = src;
- for ( uint i = 0; i < (uint)trg.length(); )
+ for ( int i = 0; i < trg.length(); )
{
if ( trg.mid( i, 2 ) == QString( "&&" ) )
i += 2;
bool changed = false;
QMap<int, int> aMap;
- for ( uint i = 0; i < (uint)ids.count(); i++ )
+ for ( int i = 0; i < ids.count(); i++ )
aMap.insert( ids.at( i ), 0 );
for ( IdStateMap::Iterator it = myState.begin(); it != myState.end(); ++it )
\param p parent object
*/
QDS_StringValidator::QDS_StringValidator( const QString& f, QObject* p )
-: QValidator( p ),
- myFlags( f ),
- myLen( -1 )
+: QValidator( p ),
+ myLen( -1 ),
+ myFlags( f )
{
}
\param p parent object
*/
QDS_StringValidator::QDS_StringValidator( const QString& ft, const QString& fg, QObject* p )
-: QValidator( p ),
- myLen( -1 ),
- myFilter( ft ),
- myFlags( fg )
+: QValidator( p ),
+ myLen( -1 ),
+ myFlags( fg ),
+ myFilter( ft )
{
}
QStringList vars = { "QT5_ROOT_DIR", "QT_ROOT_DIR", "QTDIR" };
QString qtPath;
- for (uint i = 0; i < (uint)vars.length() && qtPath.isEmpty(); i++ ) { //!< TODO: mismatch signed/unsigned
+ for (int i = 0; i < vars.length() && qtPath.isEmpty(); i++ ) {
qtPath = getenv(vars[i]);
}
if ( !qtPath.isEmpty() && !context.isEmpty() )
//! Header view flags
typedef enum {
+ ShowNone = 0x000, //!< Show nothing
ShowText = 0x001, //!< Show only text in the header
ShowIcon = 0x010, //!< Show only icon in the header
ShowAll = ShowText | ShowIcon //!< Show icon and text in the header
QString aTitle = title();
- int titleWidth = 0;
+ //int titleWidth = 0; // unused
int titleHeight = 0;
if ( qGray( bg.rgb() ) < 128 )
{
srt->setTextWidth( W - 10 );
titleHeight = (int)srt->size().height() + spacer;
- titleWidth = (int)srt->size().width();
+ //titleWidth = (int)srt->size().width(); // unused
p->save();
p->translate( X + 5, Y );
srt->drawContents( p );
QtxDialog::QtxDialog( QWidget* parent, bool modal, bool allowResize, const int f, Qt::WindowFlags wf )
: QDialog( parent, (Qt::WindowFlags)( wf | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | Qt::Dialog |
#ifdef WIN32
- ( allowResize ? 0 : Qt::FramelessWindowHint ) |
+ ( allowResize ? (Qt::WindowType)0 : Qt::FramelessWindowHint ) |
#endif
( ( allowResize
#ifdef WIN32
// 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 : (Qt::WindowType)0 ) ) ),
myInited( false ),
mySender( 0 ),
myAlignment( 0 ),
{
QString pref = this->prefix();
QString suff = this->suffix();
- uint overhead = pref.length() + suff.length();
+ int overhead = pref.length() + suff.length();
QValidator::State state = QValidator::Invalid;
QDoubleValidator v (NULL);
state = v.validate( str, pos );
else
{
- if ( (uint)str.length() >= overhead && str.startsWith( pref ) && //!< TODO: mismatch signed/unsigned
+ if ( str.length() >= overhead && str.startsWith( pref ) &&
str.right( suff.length() ) == suff )
{
QString core = str.mid( pref.length(), str.length() - overhead );
\param v2 second argument (not valid for unary postfix operations)
\return error code (QtxEvalExpr::Error)
*/
-QtxEvalExpr::Error QtxEvalSetMath::calculate( const QString& op, QVariant& v1, QVariant& v2 ) const
+QtxEvalExpr::Error QtxEvalSetMath::calculate( const QString& op, QVariant& /*v1*/, QVariant& v2 ) const
{
QtxEvalExpr::Error err = QtxEvalExpr::OK;
double val = v2.toDouble();
{
bool res = true;
- switch( e->type() )
+ switch( (int)e->type() )
{
case QEvent::MouseMove:
{
: QMainWindow( parent, f ),
myMenuBar( 0 ),
myStatusBar( 0 ),
+ myFullScreenAllowed(true),
+ myMinimizeAllowed(true),
myOpaque( true ),
myResizer( 0 ),
- myMouseMove( 0 ),
- myFullScreenAllowed(true),
- myMinimizeAllowed(true)
+ myMouseMove( 0 )
{
//rnv: Enables tooltips for inactive windows.
//rnv: For details see http://bugtracker.opencascade.com/show_bug.cgi?id=20893
private:
int myId;
- QString myText;
QString myTitle;
+ QString myText;
QTimer* myTimer;
QtxNotify* myNotifyMgr;
-
bool myIsClosePressed;
};
*/
QtxPathListEdit::QtxPathListEdit( const Qtx::PathType type, QWidget* parent )
: QFrame( parent ),
- myCompleter( 0 ),
myType( type ),
+ myCompleter( 0 ),
myDuplicate( false )
{
initialize();
*/
QtxPathListEdit::QtxPathListEdit( QWidget* parent )
: QFrame( parent ),
- myCompleter( 0 ),
myType( Qtx::PT_OpenFile ),
+ myCompleter( 0 ),
myDuplicate( false )
{
initialize();
if ( !ok && msg )
QMessageBox::warning( this, tr( "Error" ), tr( "Location \"%1\" doesn't point to directory" ).arg( str ) );
break;
+ default:
+ break;
}
}
return myIsClosed;
}
-void QtxAbstractRubberBand::paintEvent( QPaintEvent* theEvent )
+void QtxAbstractRubberBand::paintEvent( QPaintEvent* /*theEvent*/ )
{
if ( !myPoints.empty() )
{
// ### workaround for borked XRENDER
tiledPixmap = QPixmap::fromImage(tiledPixmap.toImage());
-
-
QPainter aPainter( this );
aPainter.setRenderHint( QPainter::Antialiasing );
- QRect r = myPoints.boundingRect();
- //aPainter.setClipRegion( r.normalized().adjusted( -1, -1, 2, 2 ) );
aPainter.drawTiledPixmap( 0, 0, width(), height(), tiledPixmap);
-
aPainter.end();
-
- /*
-
-
-
-#ifdef WIN32
- QPixmap anImage( size() );
-#else
- QImage anImage( size(), QImage::Format_ARGB32_Premultiplied );
-#endif
-
- anImage.fill( Qt::transparent );
- QPainter aImgPainter( &anImage );
- aImgPainter.setRenderHint( QPainter::Antialiasing );
- aImgPainter.setCompositionMode(QPainter::CompositionMode_Source);
-
- QPen aPen( Qt::black );
- aPen.setWidth( 2 );
- aImgPainter.setPen( aPen );
-
- aImgPainter.drawPolyline( myPoints );
- if ( myIsClosed && myPoints.last() != myPoints.first() )
- aImgPainter.drawLine( myPoints.last(), myPoints.first() );
-
- //aImgPainter.setPen(Qt::NoPen);
- //aImgPainter.setBrush(QBrush( Qt::white, Qt::Dense4Pattern));
- //aImgPainter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
- //aImgPainter.drawRect(0, 0, width(), height());
- aImgPainter.end();
-
- QPainter aPainter( this );
- aPainter.drawPolyline( myPoints );
- if ( myIsClosed && myPoints.last() != myPoints.first() )
- aPainter.drawLine( myPoints.last(), myPoints.first() );
-
-#ifdef WIN32
- aPainter.drawPixmap( 0, 0, anImage );
-#else
- aPainter.drawImage( 0, 0, anImage );
- #endif
- aPainter.end();*/
-
}
}
return -1;
QPoint aDist = myPoints[1] - myPoints[0];
return (int)std::sqrt(std::pow(aDist.x(), 2) + std::pow(aDist.y(), 2));
-}
\ No newline at end of file
+}
myMargin( 5 ),
myOpacity( 1.0 ),
myError( 0 ),
- myShowPercent( true ),
myShowProgress( true ),
- myShowMessage( true )
+ myShowMessage( true ),
+ myShowPercent( true )
{
setAttribute( Qt::WA_DeleteOnClose, true );
setPixmap( pixmap );
*/
void QtxToolBar::Watcher::customEvent( QEvent* e )
{
- switch ( e->type() )
+ switch ( (int)e->type() )
{
case Install:
installFilters();
showMenu();
return;
}
+ // fall through!
case Qt::Key_PageDown:
move = ( e->modifiers() & Qt::ControlModifier ) ? MoveLast : MoveDown;
break;
does not allow to process messages with global context.
For the current moment global context should be specified in translation
- (*.ts/*.qm) files as "@default" string. For example:
+ (*.ts) files as "@default" string. For example:
\verbatim
<!DOCTYPE TS><TS>
<context>
{
WidgetEvent* we = (WidgetEvent*)e;
- switch ( we->type() )
+ switch ( (int)we->type() )
{
case ActivateWidget:
myBar->updateActiveState();
int new_this = szList[item_ind];
int new_next = 0;
- bool isToCheck = false;
-
if (need_pos < splitter_pos) {
// Set size of all previous workareas to zero <--
if (item_ind == nb - 1) {
new_this = splitter_size - new_item_rel_pos;
}
// jfa to do: in this case fixed size of next widgets could prevent right resizing
- isToCheck = true;
}
if (item_ind == nb - 1) {
new_this = splitter_size - new_item_rel_pos;
}
for( int i = 0; i < 4; i++ ) {
if( myComboBox[i] != aSender ) {
- ViewMode aNewMode;
+ ViewMode aNewMode = XYZ;
if( myMapComboBoxMode[myComboBox[i]] == (ViewMode)(theItem) ) {
for( int j = 0; j < 4; j++ )
if( !aModeEnabledMap[(ViewMode)j] )
/*!
Builds popup for QxScene viewer
*/
-void QxScene_Viewer::contextMenuPopup(QMenu* thePopup)
+void QxScene_Viewer::contextMenuPopup(QMenu* /*thePopup*/)
{
- //GUI_UNUSED(thePopup);
DEBTRACE("QxScene_Viewer::contextMenuPopup");
}
void onViewReset();
protected:
- void resizeEvent( QResizeEvent* /*theEvent*/ );
+ void resizeEvent( QResizeEvent* );
QGraphicsScene* _scene;
QGraphicsView* _sceneView;
}
};
-extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderer( PyObject* self, PyObject* args )
+extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderer( PyObject* /*self*/, PyObject* args )
{
PyObject* aResult = Py_None;
int toCreate = 0;
}
};
-extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindow( PyObject* self, PyObject* args )
+extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindow( PyObject* /*self*/, PyObject* args )
{
PyObject* aResult = Py_None;
int toCreate = 0;
}
};
-extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindowInteractor( PyObject* self, PyObject* args )
+extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindowInteractor( PyObject* /*self*/, PyObject* args )
{
PyObject* aResult = Py_None;
int toCreate = 0;
\return nothing (Py_None)
*/
-extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_showTrihedron( PyObject* self, PyObject* args )
+extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_showTrihedron( PyObject* /*self*/, PyObject* args )
{
class TEvent: public SALOME_Event
{
\return nothing (Py_None)
*/
-extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_fitAll( PyObject* self, PyObject* args )
+extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_fitAll( PyObject* /*self*/, PyObject* /*args*/ )
{
class TEvent: public SALOME_Event
{
\return nothing (Py_None)
*/
-extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_setView( PyObject* self, PyObject* args )
+extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_setView( PyObject* /*self*/, PyObject* args )
{
class TEvent: public SALOME_Event
{
\return nothing (Py_None)
*/
-extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_resetView( PyObject* self, PyObject* args )
+extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_resetView( PyObject* /*self*/, PyObject* /*args*/ )
{
class TEvent: public SALOME_Event
{
static PyMethodDef libSalomePy_methods[] =
{
- { "getRenderer", libSalomePy_getRenderer, METH_VARARGS },
- { "getRenderWindow", libSalomePy_getRenderWindow, METH_VARARGS },
- { "getRenderWindowInteractor", libSalomePy_getRenderWindowInteractor, METH_VARARGS },
- { "showTrihedron", libSalomePy_showTrihedron, METH_VARARGS },
- { "fitAll", libSalomePy_fitAll, METH_NOARGS },
- { "setView", libSalomePy_setView, METH_VARARGS },
- { "resetView", libSalomePy_resetView, METH_NOARGS },
- { NULL, NULL }
+ { "getRenderer", libSalomePy_getRenderer, METH_VARARGS, PyDoc_STR("Get renderer from current vtk view") },
+ { "getRenderWindow", libSalomePy_getRenderWindow, METH_VARARGS, PyDoc_STR("Get render window from current vtk view") },
+ { "getRenderWindowInteractor", libSalomePy_getRenderWindowInteractor, METH_VARARGS, PyDoc_STR("Get interactor from current vtk view") },
+ { "showTrihedron", libSalomePy_showTrihedron, METH_VARARGS, PyDoc_STR("Show/hide trihedron in current vtk view") },
+ { "fitAll", libSalomePy_fitAll, METH_NOARGS, PyDoc_STR("Fit current vtk view to show all contents") },
+ { "setView", libSalomePy_setView, METH_VARARGS, PyDoc_STR("Set side view for the current VTK viewer") },
+ { "resetView", libSalomePy_resetView, METH_NOARGS, PyDoc_STR("Reset camera for current vtk view") },
+ { 0, 0, 0, 0 }
};
struct module_state {
class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module
{
- Q_OBJECT;
+ Q_OBJECT
public:
SALOME_PYQT_Module();
// function : SALOME_PYQT_BorrowedDataObjectLight::toolTip()
// purpose : return toolTip of object
//=================================================================================
-QString SALOME_PYQT_BorrowedDataObjectLight::toolTip(const int index) const
+QString SALOME_PYQT_BorrowedDataObjectLight::toolTip(const int /*index*/) const
{
- //GUI_UNUSED(index);
return myToolTip;
}
// function : saveAs()
// purpose : SaveAs data model operation
//=================================================================================
-bool SALOME_PYQT_DataModelLight::saveAs ( const QString& theURL, CAM_Study* theStudy, QStringList& theListOfFiles)
+bool SALOME_PYQT_DataModelLight::saveAs ( const QString& theURL, CAM_Study* /*theStudy*/, QStringList& theListOfFiles)
{
- //GUI_UNUSED(theStudy);
myStudyURL = theURL;
return save(theListOfFiles);
}
-bool SALOME_PYQT_DataModelLight::create( CAM_Study* study )
+bool SALOME_PYQT_DataModelLight::create( CAM_Study* /*study*/ )
{
- //GUI_UNUSED(study);
return true;
}
}
-void SALOME_PYQT_DataModelLight::update ( LightApp_DataObject* theObj, LightApp_Study* theStudy )
+void SALOME_PYQT_DataModelLight::update ( LightApp_DataObject* /*theObj*/, LightApp_Study* /*theStudy*/ )
{
- //GUI_UNUSED(theObj);GUI_UNUSED(theStudy);
// Nothing to do here: we always keep the data tree in the up-to-date state
// The only goal of this method is to hide default behavior from LightApp_DataModel
return;
// function : SALOME_PYQT_DataObjectLight::toolTip()
// purpose : return toolTip of object
//=================================================================================
-QString SALOME_PYQT_DataObjectLight::toolTip(const int index) const
+QString SALOME_PYQT_DataObjectLight::toolTip(const int /*index*/) const
{
- //GUI_UNUSED(index);
return myToolTip;
}
\brief Used to notify a Python light module of a modification of selection in study (propagation of a remote selection)
\param list of study entries
*/
-void SALOME_PYQT_ModuleLight::setSelected( const QStringList& entries, const bool isUnused)
+void SALOME_PYQT_ModuleLight::setSelected( const QStringList& entries, const bool /*isUnused*/)
{
- //GUI_UNUSED(isUnused);
MESSAGE("setSelected");
return myHelper->selectionUpdated(entries);
}
class SALOME_PYQT_LIGHT_EXPORT SALOME_PYQT_ModuleLight: public LightApp_Module
{
- Q_OBJECT;
+ Q_OBJECT
public:
SALOME_PYQT_ModuleLight();
}
void message( const QString& msg )
{
+ (void)msg; // unused in debug mode
if ( theDEBUG )
MESSAGE( qPrintable( myName ) << " : " << qPrintable( msg ) );
}
*/
void PyModuleHelper::XmlHandler::createMenu( QDomNode& parentNode,
const int parentMenuId,
- QMenu* parentPopup )
+ QMenu* /*parentPopup*/ )
{
if ( !module() || parentNode.isNull() )
return;
\param study parent study
*/
-void PyModuleHelper::internalDeactivate( SUIT_Study* study )
+void PyModuleHelper::internalDeactivate( SUIT_Study* /*study*/ )
{
- //GUI_UNUSED(study);
FuncMsg fmsg( "--- PyModuleHelper::internalDeactivate()" );
// check that Python subinterpreter is initialized and Python module is imported
}
private:
PyModuleHelper* myHelper;
- int myColumn;
QString myEntry;
+ int myColumn;
};
// Posting the request only if dispatcher is not busy!
bool mySubst;
TResult myDefault;
TGetStrSettingEvent( const QString& section, const QString& name, const QString& def, const bool subst )
- : mySection( section ), myName( name ), myDefault( def ), mySubst( subst ) {}
+ : mySection( section ), myName( name ), mySubst( subst ), myDefault( def ) {}
virtual void Execute()
{
if ( SUIT_Session::session() ) {
CrTool( const QString& tBar, const QString& nBar )
: myCase( 0 ), myTbTitle( tBar ), myTbName( nBar) {}
CrTool( const int id, const int tBar, const int idx )
- : myCase( 1 ), myId( id ), myTbId( tBar ), myIndex( idx ) {}
+ : myCase( 1 ), myTbId( tBar ), myId( id ), myIndex( idx ) {}
CrTool( const int id, const QString& tBar, const int idx )
- : myCase( 2 ), myId( id ), myTbTitle( tBar ), myIndex( idx ) {}
+ : myCase( 2 ), myTbTitle( tBar ), myId( id ), myIndex( idx ) {}
CrTool( QAction* action, const int tbId, const int id, const int idx )
- : myCase( 3 ), myAction( action ), myTbId( tbId ), myId( id ), myIndex( idx ) {}
+ : myCase( 3 ), myTbId( tbId ), myAction( action ), myId( id ), myIndex( idx ) {}
CrTool( QAction* action, const QString& tBar, const int id, const int idx )
- : myCase( 4 ), myAction( action ), myTbTitle( tBar ), myId( id ), myIndex( idx ) {}
+ : myCase( 4 ), myTbTitle( tBar ), myAction( action ), myId( id ), myIndex( idx ) {}
int execute() const
{
return getActiveModule()->createTool( myTbTitle, myTbName );
else if ( getApplication() )
return getApplication()->createTool( myTbTitle, myTbName );
+ break;
case 1:
if ( getActiveModule() )
return getActiveModule()->createTool( myId, myTbId, myIndex );
else if ( getApplication() )
return getApplication()->createTool( myId, myTbId, myIndex );
+ break;
case 2:
if ( getActiveModule() )
return getActiveModule()->createTool( myId, myTbTitle, myIndex );
else if ( getApplication() )
return getApplication()->createTool( myId, myTbTitle, myIndex );
+ break;
case 3:
if ( getActiveModule() )
return getActiveModule()->createTool( myAction, myTbId, myId, myIndex );
else if ( getApplication() )
return getApplication()->createTool( myAction, myTbId, myId, myIndex );
+ break;
case 4:
if ( getActiveModule() )
return getActiveModule()->createTool( myAction, myTbTitle, myId, myIndex );
else if ( getApplication() )
return getApplication()->createTool( myAction, myTbTitle, myId, myIndex );
+ break;
+ default:
+ break;
}
return -1;
}
{
public:
CrMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx )
- : myCase( 0 ), mySubMenuName( subMenu ), myMenuId( menu ), myId( id ), myGroup( group ), myIndex( idx ) {}
+ : myCase( 0 ), myMenuId( menu ), mySubMenuName( subMenu ), myGroup( group ), myId( id ), myIndex( idx ) {}
CrMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx )
- : myCase( 1 ), mySubMenuName( subMenu ), myMenuName( menu ), myId( id ), myGroup( group ), myIndex( idx ) {}
+ : myCase( 1 ), myMenuName( menu ), mySubMenuName( subMenu ), myGroup( group ), myId( id ), myIndex( idx ) {}
CrMenu( const int id, const int menu, const int group, const int idx )
- : myCase( 2 ), myId( id ), myMenuId( menu ), myGroup( group ), myIndex( idx ) {}
+ : myCase( 2 ), myMenuId( menu ), myGroup( group ), myId( id ), myIndex( idx ) {}
CrMenu( const int id, const QString& menu, const int group, const int idx )
- : myCase( 3 ), myId( id ), myMenuName( menu ), myGroup( group ), myIndex( idx ) {}
+ : myCase( 3 ), myMenuName( menu ), myGroup( group ), myId( id ), myIndex( idx ) {}
CrMenu( QAction* action, const int menu, const int id, const int group, const int idx )
- : myCase( 4 ), myAction( action ), myMenuId( menu ), myId( id ), myGroup( group ), myIndex( idx ) {}
+ : myCase( 4 ), myMenuId( menu ), myGroup( group ), myAction( action ), myId( id ), myIndex( idx ) {}
CrMenu( QAction* action, const QString& menu, const int id, const int group, const int idx )
- : myCase( 5 ), myAction( action ), myMenuName( menu ), myId( id ), myGroup( group ), myIndex( idx ) {}
+ : myCase( 5 ), myMenuName( menu ), myGroup( group ), myAction( action ), myId( id ), myIndex( idx ) {}
int execute() const
{
return getActiveModule()->createMenu( mySubMenuName, myMenuId, myId, myGroup, myIndex );
else if ( getApplication() )
return getApplication()->createMenu( mySubMenuName, myMenuId, myId, myGroup, myIndex );
+ break;
case 1:
if ( getActiveModule() )
return getActiveModule()->createMenu( mySubMenuName, myMenuName, myId, myGroup, myIndex );
else if ( getApplication() )
return getApplication()->createMenu( mySubMenuName, myMenuName, myId, myGroup, myIndex );
+ break;
case 2:
if ( getActiveModule() )
return getActiveModule()->createMenu( myId, myMenuId, myGroup, myIndex );
else if ( getApplication() )
return getApplication()->createMenu( myId, myMenuId, myGroup, myIndex );
+ break;
case 3:
if ( getActiveModule() )
return getActiveModule()->createMenu( myId, myMenuName, myGroup, myIndex );
else if ( getApplication() )
return getApplication()->createMenu( myId, myMenuName, myGroup, myIndex );
+ break;
case 4:
if ( getActiveModule() )
return getActiveModule()->createMenu( myAction, myMenuId, myId, myGroup, myIndex );
else if ( getApplication() )
return getApplication()->createMenu( myAction, myMenuId, myId, myGroup, myIndex );
+ break;
case 5:
if ( getActiveModule() )
return getActiveModule()->createMenu( myAction, myMenuName, myId, myGroup, myIndex );
else if ( getApplication() )
return getApplication()->createMenu( myAction, myMenuName, myId, myGroup, myIndex );
+ break;
+ default:
+ break;
}
return -1;
}
const QString& icon,
const QString& tooltip,
const QString& parent )
- : myName( name ),
+ : myParent( parent ),
+ myName( name ),
myIcon( icon ),
- myToolTip( tooltip ),
- myParent( parent ) {}
+ myToolTip( tooltip ) {}
virtual void Execute()
{
SALOME_PYQT_ModuleLight* module = dynamic_cast<SALOME_PYQT_ModuleLight*>( getActiveModule() );
\param onlyInViewer - search object only in viewer (so object must be displayed)
*/
bool SOCC_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& obj,
- bool onlyInViewer )
+ bool /*onlyInViewer*/ )
{
- //GUI_UNUSED(on);
AIS_ListOfInteractive List;
getAISContext()->DisplayedObjects(List);
AIS_ListIteratorOfListOfInteractive ite(List);
\param prs - presentation
\param forced - removes object from context
*/
-void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced )
+void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool /*forced*/ )
{
- //GUI_UNUSED(forced);
// try do downcast object
const SOCC_Prs* anOCCPrs = dynamic_cast<const SOCC_Prs*>( prs );
if ( !anOCCPrs || anOCCPrs->IsNull() )
std::list<int>::const_iterator it;
if ( anAIS->IsKind( STANDARD_TYPE( AIS_Shape ) ) )
{
- ic->Load( anAIS, -1, false );
+ ic->Load( anAIS, -1 );
for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
ic->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)*it ) );
}
else if ( anAIS->DynamicType() != STANDARD_TYPE(AIS_Trihedron) )
{
- ic->Load( anAIS, -1, false );
+ ic->Load( anAIS, -1 );
for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
ic->Activate( anAIS, *it );
}
::action( const int theAction )
{
const int inc = 10;
- int cx, cy; //
+ int cx = 0, cy = 0;
if ( theAction == SUIT_Accel::ZoomIn || theAction == SUIT_Accel::ZoomOut ||
theAction == SUIT_Accel::RotateLeft || theAction == SUIT_Accel::RotateRight ||
theAction == SUIT_Accel::RotateUp || theAction == SUIT_Accel::RotateDown ) {
class SOCC_EXPORT SOCC_ViewWindow : public OCCViewer_ViewWindow
{
- Q_OBJECT;
+ Q_OBJECT
public:
SOCC_ViewWindow( SUIT_Desktop*, OCCViewer_Viewer* );
{
const QVector<SUIT_ViewWindow*>& wnds = vm->getViews();
- for ( uint i = 0; i < (uint)wnds.size(); i++ )
+ for ( int i = 0; i < wnds.size(); i++ )
{
Plot2d_ViewWindow* pwnd = dynamic_cast<Plot2d_ViewWindow*>( wnds.at( i ) );
rename( IObj, name, pwnd->getViewFrame() );
SLOT: called when action "Legend Clicked" is activated.
override "onLegendClicked" method from Plot2d_ViewModel.
*/
-void SPlot2d_Viewer::onClicked( const QVariant& itemInfo, int index )
+void SPlot2d_Viewer::onClicked( const QVariant& itemInfo, int /*index*/ )
{
Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
if(aViewFrame == NULL) return;
virtual QString getType() const { return Type(); }
/* interactive object management */
- void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool update = true ) {/*GUI_UNUSED(highlight);GUI_UNUSED(IObject);*/}
+ void highlight( const Handle(SALOME_InteractiveObject)& /*IObject*/, bool /*highlight*/, bool /*update*/ = true ) {}
void unHighlightAll() {}
void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 );
void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& );
class SPLOT2D_EXPORT SPlot2d_ViewWindow : public Plot2d_ViewWindow
{
- Q_OBJECT;
+ Q_OBJECT
public:
SPlot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* );
*/
void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool /*autoOpen*/ )
{
- //GUI_UNUSED(autoOpen);
SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
if ( m ) {
m->updateTree( obj );
*/
void SUIT_DataBrowser::onExpanded( const QModelIndex& /*index*/ )
{
- //GUI_UNUSED(index);
if (myResizeOnExpandItem) {
adjustFirstColumnWidth();
adjustColumnsWidth();
*/
Qtx::HeaderViewFlags SUIT_TreeModel::headerFlags( const QString& name ) const
{
- Qtx::HeaderViewFlags flags;
+ Qtx::HeaderViewFlags flags = Qtx::ShowNone;
for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
if ( myColumns[i].myName == name ) {
flags = myColumns[i].myHeaderFlags;
bool SUIT_TreeModel::dropMimeData( const QMimeData* data, Qt::DropAction action,
int row, int /*column*/, const QModelIndex& parent )
{
- //GUI_UNUSED(column);
if ( action == Qt::IgnoreAction )
// do nothing with data
return false;
*/
bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView)
{
- unsigned int aSize = myViews.size();
- unsigned int aNbItems = myViews.count() + 1;
+ int aSize = myViews.size();
+ int aNbItems = myViews.count() + 1;
if ( aNbItems > aSize )
{
myViews.resize( aNbItems );
connect(theView, SIGNAL(contextMenuRequested( QContextMenuEvent * )),
this, SLOT (onContextMenuRequested( QContextMenuEvent * )));
- for ( uint i = 0; i < aSize; i++ )
+ for ( int i = 0; i < aSize; i++ )
{
if ( myViews[i] == 0 )
{
void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view)
{
if (view) {
- unsigned int aSize = myViews.size();
- for (uint i = 0; i < aSize; i++) {
+ int aSize = myViews.size();
+ for (int i = 0; i < aSize; i++) {
if (myViews[i] && myViews[i] == view) {
myActiveView = view;
emit activated( this );
*/
int SUIT_ViewWindow::getId() const
{
- return *((int*)(this));
+ return int(reinterpret_cast<long long>(this)); // todo: unsafe - converting pointer to int can give non-unique result
}
/*!
*/
void SUIT_ViewWindow::onSynchronizeView( bool /*checked*/ )
{
- //GUI_UNUSED(checked);
QAction* a = qobject_cast<QAction*>( sender() );
if ( a ) {
synchronizeView( this, a->data().toInt() );
}
protected:
- QString userFileName( const QString& appName, const bool forLoad ) const
+ QString userFileName( const QString& /*appName*/, const bool forLoad ) const
{
if ( version().isEmpty() ) return "";
return SUIT_ResourceMgr::userFileName( myCustomAppName, forLoad );
script += "import sys\n";
script += "sys.excepthook = _custom_except_hook\n";
script += "del _custom_except_hook, sys\n";
- int res = PyRun_SimpleString(qUtf8Printable(script));
+ PyRun_SimpleString(qUtf8Printable(script));
// VSR (22/09/2016): end of workaround
PyEval_InitThreads(); // Create (and acquire) the interpreter lock - can be called many times
// Py_InitThreads acquires the GIL
}
-vtkStandardNewMacro(SALOME_Actor);
+vtkStandardNewMacro(SALOME_Actor)
/*!
Constructor
*/
SALOME_Actor
::SALOME_Actor():
- myRenderer(NULL),
myInteractor(NULL),
+ myRenderer(NULL),
mySelectionMode(ActorSelection),
myPreHighlightActor(SVTK_Actor::New()),
myHighlightActor(SVTK_Actor::New()),
- myOutline(vtkOutlineSource::New()),
myOutlineActor(VTKViewer_Actor::New()),
+ myOutline(vtkOutlineSource::New()),
myIsDisplayNameActor(false),
myNameActor(VTKViewer_FramedTextActor::New())
{
aRenderer->SetWorldPoint( aBounds[ i ], aBounds[ j ], aBounds[ k ], 1.0 );
aRenderer->WorldToDisplay();
aRenderer->GetDisplayPoint( aPnt );
- bool anIsPointInSelection;
+ bool anIsPointInSelection = false;
if( theSelectionEvent->myIsRectangle )
anIsPointInSelection = aPnt[0] > x1 && aPnt[0] < x2 && aPnt[1] > y1 && aPnt[1] < y2;
else if( theSelectionEvent->myIsPolygon )
public:
static SALOME_Actor* New();
- vtkTypeMacro(SALOME_Actor,VTKViewer_Actor);
+ vtkTypeMacro(SALOME_Actor,VTKViewer_Actor)
//----------------------------------------------------------------------------
//! To check, if the #SALOME_Actor has a reference to #SALOME_InteractiveObject
#include "utilities.h"
-vtkStandardNewMacro(SVTK_Actor);
+vtkStandardNewMacro(SVTK_Actor)
/*!
Constructor
public:
static SVTK_Actor* New();
- vtkTypeMacro(SVTK_Actor,SVTK_DeviceActor);
+ vtkTypeMacro(SVTK_Actor,SVTK_DeviceActor)
//! Initialiaze the instance completely
virtual void
}
//----------------------------------------------------------------------------
+ /* Unused
void CalculatePickPosition( vtkRenderer *theRenderer, double theSelectionX,
double theSelectionY, double theSelectionZ, double thePickPosition[3] )
{
}
}
}
+ */
}
vtkStandardNewMacro( SVTK_AreaPicker )
-;
SVTK_AreaPicker::SVTK_AreaPicker()
{
double aDX[3];
theRenderer->GetDisplayPoint( aDX );
- bool isInSelection;
+ bool isInSelection = false;
if ( theMode == RectangleMode ) isInSelection = aDX[0] >= mySelection[0]
&& aDX[0] <= mySelection[2] && aDX[1] >= mySelection[1]
&& aDX[1] <= mySelection[3];
double aDX[3];
theRenderer->GetDisplayPoint( aDX );
- bool isInSelection;
+ bool isInSelection = false;
if ( theMode == RectangleMode ) isInSelection = aDX[0] >= mySelection[0]
&& aDX[0] <= mySelection[2] && aDX[1] >= mySelection[1]
&& aDX[1] <= mySelection[3];
static
SVTK_AreaPicker *New();
- vtkTypeMacro(SVTK_AreaPicker,vtkAbstractPropPicker);
+ vtkTypeMacro(SVTK_AreaPicker,vtkAbstractPropPicker)
/*!
Specify tolerance for performing pick operation. Tolerance is specified
#include <vtkProperty.h>
#include <vtkProperty2D.h>
-vtkStandardNewMacro(SVTK_CubeAxesActor2D);
+vtkStandardNewMacro(SVTK_CubeAxesActor2D)
// Instantiate this object.
SVTK_CubeAxesActor2D::SVTK_CubeAxesActor2D()
#endif
{
public:
- vtkTypeMacro(SVTK_CubeAxesActor2D,vtkCubeAxesActor2D);
+ vtkTypeMacro(SVTK_CubeAxesActor2D,vtkCubeAxesActor2D)
// Description:
// Instantiate object with bold, italic, and shadow enabled; font family
#include <vtkPassThroughFilter.h>
-vtkStandardNewMacro(SVTK_DeviceActor);
+vtkStandardNewMacro(SVTK_DeviceActor)
/*!
Constructor
class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
{
public:
- vtkTypeMacro(SVTK_DeviceActor,vtkLODActor);
+ vtkTypeMacro(SVTK_DeviceActor,vtkLODActor)
static
SVTK_DeviceActor*
#include <QTimer>
-vtkStandardNewMacro(QVTK_GenericRenderWindowInteractor);
+vtkStandardNewMacro(QVTK_GenericRenderWindowInteractor)
/*!
Constructor
}
-vtkStandardNewMacro(SVTK_GenericRenderWindowInteractor);
+vtkStandardNewMacro(SVTK_GenericRenderWindowInteractor)
/*!
Constructor
public QObject,
public vtkGenericRenderWindowInteractor
{
- Q_OBJECT;
+ Q_OBJECT
public:
static QVTK_GenericRenderWindowInteractor* New();
- vtkTypeMacro(QVTK_GenericRenderWindowInteractor,vtkGenericRenderWindowInteractor);
+ vtkTypeMacro(QVTK_GenericRenderWindowInteractor,vtkGenericRenderWindowInteractor)
//! Starts the QTimer instance on defined microseconds
virtual
{
public:
static SVTK_GenericRenderWindowInteractor* New();
- vtkTypeMacro(SVTK_GenericRenderWindowInteractor,QVTK_GenericRenderWindowInteractor);
+ vtkTypeMacro(SVTK_GenericRenderWindowInteractor,QVTK_GenericRenderWindowInteractor)
//! To get access to SVTK_Selector
SVTK_Selector*
public:
static Standard_Integer HashCode(const std::vector<Standard_Integer> ids,
const Standard_Integer upper) {
- Standard_Integer seed = (int)ids.size(); //!< TODO: conversion from size_t to int
+ Standard_Integer seed = (Standard_Integer)ids.size(); //!< TODO: conversion from size_t to int
for( Standard_Integer i = 0; i < (Standard_Integer) ids.size(); i++ ) {
Standard_Integer v = ids[i];
seed ^= v + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
}
-vtkStandardNewMacro(SVTK_InteractorStyle);
+vtkStandardNewMacro(SVTK_InteractorStyle)
/*!
Constructor
*/
SVTK_InteractorStyle::SVTK_InteractorStyle():
- mySelectionEvent(new SVTK_SelectionEvent()),
- myPointPicker(vtkPointPicker::New()),
myLastHighlitedActor(NULL),
myLastPreHighlitedActor(NULL),
myControllerIncrement(SVTK_ControllerIncrement::New()),
myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()),
+ mySelectionEvent(new SVTK_SelectionEvent()),
myHighlightSelectionPointActor(SVTK_Actor::New()),
+ myPointPicker(vtkPointPicker::New()),
myRectBand(0),
myPolygonBand(0),
- myIsAdvancedZoomingEnabled(false),
- myPoligonState( Disable )
+ myPoligonState(Disable),
+ myIsAdvancedZoomingEnabled(false)
{
myPointPicker->Delete();
if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
{
Selection_Mode aSelectionMode = GetSelector()->SelectionMode();
- double* aCoords;
+ double* aCoords = NULL;
int aVtkId;
bool isTrueType = false;
{
if (!myCursorState)
setCursor(VTK_INTERACTOR_STYLE_CAMERA_SELECT);
- }
+ } // fall through!
case VTK_INTERACTOR_STYLE_CAMERA_FIT:
{
myOtherPoint = mousePos;
Called when user moves mouse inside viewer window and there is no active viewer operation
(!put necessary processing here!)
*/
-void SVTK_InteractorStyle::onCursorMove(QPoint mousePos)
+void SVTK_InteractorStyle::onCursorMove(QPoint /*mousePos*/)
{
if ( !GetSelector()->IsPreSelectionEnabled() )
return;
return true;
bool res = true;
- for ( uint i = 0; i < (uint)thePoints->count() - 1 && res; i++ )
+ for ( int i = 0; i < thePoints->count() - 1 && res; i++ )
{
const QPoint& aStart = thePoints->point( i );
const QPoint& anEnd = thePoints->point( i + 1 );
return myControllerIncrement.GetPointer();
}
-vtkStandardNewMacro(SVTK_ControllerIncrement);
+vtkStandardNewMacro(SVTK_ControllerIncrement)
SVTK_ControllerIncrement::SVTK_ControllerIncrement()
{
myIncrement=10;
return myIncrement;
}
-vtkStandardNewMacro(SVTK_GeomControllerIncrement);
+vtkStandardNewMacro(SVTK_GeomControllerIncrement)
SVTK_GeomControllerIncrement::SVTK_GeomControllerIncrement()
{
}
return myIncrement;
}
-vtkStandardNewMacro(SVTK_ControllerOnKeyDown);
+vtkStandardNewMacro(SVTK_ControllerOnKeyDown)
/*!
Constructor
{
}
-bool SVTK_ControllerOnKeyDown::OnKeyDown(vtkInteractorStyle* theIS)
+bool SVTK_ControllerOnKeyDown::OnKeyDown(vtkInteractorStyle* /*theIS*/)
{
return true;
}
*/
class SVTK_EXPORT SVTK_ControllerIncrement : public vtkObject{
public:
- vtkTypeMacro(SVTK_ControllerIncrement, vtkObject);
+ vtkTypeMacro(SVTK_ControllerIncrement, vtkObject)
static SVTK_ControllerIncrement* New();
//! Set start value of increment
*/
class SVTK_EXPORT SVTK_GeomControllerIncrement : public SVTK_ControllerIncrement{
public:
- vtkTypeMacro(SVTK_GeomControllerIncrement, SVTK_ControllerIncrement);
+ vtkTypeMacro(SVTK_GeomControllerIncrement, SVTK_ControllerIncrement)
static SVTK_GeomControllerIncrement* New();
//! Increace the increment value by add 1
*/
class SVTK_EXPORT SVTK_ControllerOnKeyDown : public vtkObject{
public:
- vtkTypeMacro(SVTK_ControllerOnKeyDown, vtkObject);
+ vtkTypeMacro(SVTK_ControllerOnKeyDown, vtkObject)
static SVTK_ControllerOnKeyDown* New();
//! Provides the action on event
{
public:
static SVTK_InteractorStyle *New();
- vtkTypeMacro(SVTK_InteractorStyle, vtkInteractorStyle);
+ vtkTypeMacro(SVTK_InteractorStyle, vtkInteractorStyle)
typedef boost::shared_ptr<SVTK_SelectionEvent> PSelectionEvent;
//----------------------------------------------------------------------------
-vtkStandardNewMacro(SVTK_KeyFreeInteractorStyle);
+vtkStandardNewMacro(SVTK_KeyFreeInteractorStyle)
//----------------------------------------------------------------------------
SVTK_KeyFreeInteractorStyle::SVTK_KeyFreeInteractorStyle():
{
public:
static SVTK_KeyFreeInteractorStyle *New();
- vtkTypeMacro(SVTK_KeyFreeInteractorStyle,SVTK_InteractorStyle);
+ vtkTypeMacro(SVTK_KeyFreeInteractorStyle,SVTK_InteractorStyle)
protected:
SVTK_KeyFreeInteractorStyle();
class SVTK_NonIsometricDlg : public ViewerTools_DialogBase
{
- Q_OBJECT;
+ Q_OBJECT
public:
SVTK_NonIsometricDlg(QtxAction* theAction,
}
//----------------------------------------------------------------------------
-vtkStandardNewMacro(SVTK_Recorder);
+vtkStandardNewMacro(SVTK_Recorder)
//----------------------------------------------------------------------------
SVTK_Recorder
::SVTK_Recorder():
- myRenderWindow(NULL),
myState(SVTK_Recorder_Stop),
+ myPaused(0),
+ myErrorStatus(0),
+ myPriority(0.0),
+ myTimeStart(0.0),
+ myFrameIndex(0),
+ myNbWrittenFrames(0),
myNbFPS(5.5),
myQuality(100),
myProgressiveMode(true),
myUseSkippedFrames(true),
- myErrorStatus(0),
+ myNameAVIMaker("jpeg2yuv"),
myCommand(vtkCallbackCommand::New()),
- myPriority(0.0),
- myTimeStart(0.0),
- myFrameIndex(0),
- myPaused(0),
+ myRenderWindow(NULL),
myFilter(vtkWindowToImageFilter::New()),
- myWriterMgr(new SVTK_ImageWriterMgr),
- myNbWrittenFrames(0),
- myNameAVIMaker("jpeg2yuv")
+ myWriterMgr(new SVTK_ImageWriterMgr)
{
myCommand->SetClientData(this);
myCommand->SetCallback(SVTK_Recorder::ProcessEvents);
aStream<<"COPY /Y "<<QString::fromStdString(anInitialName).replace("/","\\\\").toStdString()<<
" "<<QString::fromStdString(anCurrentName).replace("/","\\\\").toStdString()<<" > NUL";
#endif
- if(anIndex + 1 < aFinishIndex)
+ if(anIndex + 1 < aFinishIndex) {
#ifndef WIN32
aStream<<" \\";
aStream<<endl;
#else
aStream<<" & ";
#endif
+ }
}
std::string aString(aStream.str());
system(aString.c_str());
//" -f "<<int(myNbFPS)<<" "<<
" -f "<<myNbFPS<<" "<<
" -n "<<myNbWrittenFrames<<" "<<
- " -j \""<<myName<<"_\%06d.jpeg\" "<<
+ " -j \""<<myName<<"_%06d.jpeg\" "<<
"| yuv2lav"<<" -o \""<<myName<<"\"";
#ifdef WIN32
aStream<<" -f aA";
public:
static SVTK_Recorder *New();
- vtkTypeMacro(SVTK_Recorder,vtkObject);
+ vtkTypeMacro(SVTK_Recorder,vtkObject)
void
SetRenderWindow(vtkRenderWindow* theRenderWindow);
*/
void
QVTK_RenderWindowInteractor
-::paintEvent( QPaintEvent* theEvent )
+::paintEvent( QPaintEvent* /*theEvent*/ )
{
GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
}
*/
void
QVTK_RenderWindowInteractor
-::resizeEvent( QResizeEvent* theEvent )
+::resizeEvent( QResizeEvent* /*theEvent*/ )
{
int* aSize = getRenderWindow()->GetSize();
int aWidth = aSize[0];
*/
void
QVTK_RenderWindowInteractor
-::contextMenuEvent( QContextMenuEvent* event )
+::contextMenuEvent( QContextMenuEvent* /*event*/ )
{}
/*!
*/
void
QVTK_RenderWindowInteractor
-::mouseDoubleClickEvent( QMouseEvent* event )
+::mouseDoubleClickEvent( QMouseEvent* /*event*/ )
{}
*/
void
QVTK_RenderWindowInteractor
-::enterEvent( QEvent* event )
+::enterEvent( QEvent* /*event*/ )
{
if(FOCUS_UNDER_MOUSE){
activateWindow();
*/
class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget
{
- Q_OBJECT;
+ Q_OBJECT
public:
QVTK_RenderWindowInteractor(QWidget* theParent,
*/
class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteractor
{
- Q_OBJECT;
+ Q_OBJECT
public:
SVTK_RenderWindowInteractor(QWidget* theParent,
#undef max
-vtkStandardNewMacro(SVTK_Renderer);
+vtkStandardNewMacro(SVTK_Renderer)
/*!
Constructor
*/
SVTK_Renderer
::SVTK_Renderer():
- myDevice(VTKViewer_OpenGLRenderer::New()),
- myInteractor(NULL),
myPriority(0.0),
myEventCallbackCommand(vtkCallbackCommand::New()),
+ myDevice(VTKViewer_OpenGLRenderer::New()),
+ myInteractor(NULL),
+ myTransform(VTKViewer_Transform::New()),
myPointPicker(vtkPointPicker::New()),
myCellPicker(vtkCellPicker::New()),
myPointAreaPicker(SVTK_AreaPicker::New()),
myCellAreaPicker(SVTK_AreaPicker::New()),
myPreHighlightProperty(vtkProperty::New()),
myHighlightProperty(vtkProperty::New()),
- myTransform(VTKViewer_Transform::New()),
myCubeAxes(SVTK_CubeAxesActor2D::New()),
myTrihedron(SVTK_Trihedron::New()),
myTrihedronSize(105),
class SVTK_EXPORT SVTK_Renderer : public vtkObject
{
public:
- vtkTypeMacro(SVTK_Renderer,vtkObject);
+ vtkTypeMacro(SVTK_Renderer,vtkObject)
static SVTK_Renderer* New();
//----------------------------------------------------------------------------
public:
static SVTK_Selector* New();
- vtkTypeMacro(SVTK_Selector,vtkObject);
+ vtkTypeMacro(SVTK_Selector,vtkObject)
//! To change current Selection_Mode (as outside effect, it invokes selectionChange signal)
virtual
theParent,
theName),
myMainWindow(theParent),
+ myRWInteractor(theParent->GetInteractor()),
myPriority(0.0),
- myEventCallbackCommand(vtkCallbackCommand::New()),
- myRWInteractor(theParent->GetInteractor())
+ myEventCallbackCommand(vtkCallbackCommand::New())
{
setWindowTitle(tr("DLG_TITLE"));
setSizeGripEnabled(true);
class SVTK_EXPORT SVTK_SetRotationPointDlg : public ViewerTools_DialogBase
{
- Q_OBJECT;
+ Q_OBJECT
public:
SVTK_SetRotationPointDlg(QtxAction* theAction,
int SVTK_SpaceMouseXCB::setWindow( xcb_connection_t *connection, xcb_window_t window )
{
xcb_client_message_event_t xcbEvent;
- xcb_window_t root_window;
+ xcb_window_t root_window = 0; // todo: initial value (if screen is null, see below)
xcb_screen_t* screen;
xcb_generic_error_t* error;
xcb_void_cookie_t cookie;
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
-vtkStandardNewMacro(SVTK_Trihedron);
+vtkStandardNewMacro(SVTK_Trihedron)
/*!
Constructor
void operator = (const SVTK_Trihedron&); // Not implemented
public:
- vtkTypeMacro(SVTK_Trihedron,VTKViewer_Trihedron);
+ vtkTypeMacro(SVTK_Trihedron,VTKViewer_Trihedron)
static SVTK_Trihedron *New();
virtual int GetVisibleActorCount(vtkRenderer* theRenderer);
ViewerTools_DialogBase(theAction,
theParent,
theName),
- myPriority(0.0),
- myEventCallbackCommand(vtkCallbackCommand::New()),
myRWInteractor(theParent->GetInteractor()),
- myAction(theAction)
+ myAction(theAction),
+ myPriority(0.0),
+ myEventCallbackCommand(vtkCallbackCommand::New())
{
vtkRenderWindowInteractor* aRWI = myRWInteractor->GetDevice();
bool anIsEnabledUpdateRate = false;
class SVTK_UpdateRateDlg : public ViewerTools_DialogBase
{
- Q_OBJECT;
+ Q_OBJECT
public:
SVTK_UpdateRateDlg(QtxAction* theAction,
SVTK_View
::highlight( const Handle(SALOME_InteractiveObject)& theIO,
bool theIsHighlight,
- bool theIsUpdate )
+ bool /*theIsUpdate*/ )
{
using namespace SVTK;
VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
*/
class SVTK_EXPORT SVTK_SignalHandler : public QObject
{
- Q_OBJECT;
+ Q_OBJECT
public:
SVTK_SignalHandler(SVTK_ViewWindow* theMainWindow);
*/
class SVTK_EXPORT SVTK_View : public SVTK_SignalHandler
{
- Q_OBJECT;
+ Q_OBJECT
public:
SVTK_View(SVTK_ViewWindow* theMainWindow);
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetTrihedronSize( theSize, theRelative );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetStaticTrihedronVisible( theIsVisible );
myProjMode = theMode;
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetProjectionMode( theMode );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetStereoType( theType );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetAnaglyphFilter( theFilter );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetQuadBufferSupport( theEnable );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetInteractionStyle( theStyle );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetZoomingStyle( theStyle );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetPreSelectionMode( theMode );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetIncrementalSpeed( theValue, theMode );
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 );
/*!
SLOT: called on mouse button press, empty implementation
*/
-void SVTK_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
+void SVTK_Viewer::onMousePress(SUIT_ViewWindow* /*vw*/, QMouseEvent* /*event*/)
{}
/*!
SLOT: called on mouse move, empty implementation
*/
-void SVTK_Viewer::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
+void SVTK_Viewer::onMouseMove(SUIT_ViewWindow* /*vw*/, QMouseEvent* /*event*/)
{}
/*!
SLOT: called on mouse button release, empty implementation
*/
-void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
+void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* /*vw*/, QMouseEvent* /*event*/)
{}
/*!
if (SUIT_ViewManager* aViewManager = getViewManager()) {
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for ( uint i = 0; i < (uint)aViews.count(); i++ )
+ for ( int i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
aView->SetSelectionEnabled( isEnabled );
//! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View
class SVTK_EXPORT SVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View
{
- Q_OBJECT;
+ Q_OBJECT
public:
/*! supported gradient types */
//! To define minimal interface for #SVTK_ViewWindow initialization
class SVTK_EXPORT SVTK_ViewModelBase: public SUIT_ViewModel
{
- Q_OBJECT;
+ Q_OBJECT
public slots:
//! To invoke Qt #selectionChanged signal
const char* theName):
ViewerTools_DialogBase(theAction, theParent, theName),
myMainWindow(theParent),
+ myRWInteractor(theParent->GetInteractor()),
myPriority(0.0),
- myEventCallbackCommand(vtkCallbackCommand::New()),
- myRWInteractor(theParent->GetInteractor())
+ myEventCallbackCommand(vtkCallbackCommand::New())
{
setWindowTitle(tr("DLG_TITLE"));
setSizeGripEnabled(true);
}
-void SVTK_ViewParameterDlg::onProjectionModeChanged(int mode)
+void SVTK_ViewParameterDlg::onProjectionModeChanged(int /*mode*/)
{
int aBtn = myProjectionMode->checkedId();
}
}
-void SVTK_ViewParameterDlg::onPositionModeChanged(int mode)
+void SVTK_ViewParameterDlg::onPositionModeChanged(int /*mode*/)
{
setEnabled(myCameraCoords, myCameraPositionMode->checkedId() == 0);
}
class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase
{
- Q_OBJECT;
+ Q_OBJECT
public:
SVTK_ViewParameterDlg(QtxAction* theAction,
SVTK_ViewWindow::SVTK_ViewWindow(SUIT_Desktop* theDesktop):
SUIT_ViewWindow(theDesktop),
myView(NULL),
- myDumpImage(QImage()),
myKeyFreeInteractorStyle(SVTK_KeyFreeInteractorStyle::New()),
- myEventCallbackCommand(vtkCallbackCommand::New())
+ myEventCallbackCommand(vtkCallbackCommand::New()),
+ myDumpImage(QImage())
{
setWindowFlags( windowFlags() & ~Qt::Window );
// specific of vtkSmartPointer
/*! If parameter theIsForcedUpdate is true, recalculate parameters for
* trihedron and cube axes, even if trihedron and cube axes is invisible.
*/
-void SVTK_ViewWindow::AdjustTrihedrons(const bool theIsForcedUpdate)
+void SVTK_ViewWindow::AdjustTrihedrons(const bool /*theIsForcedUpdate*/)
{
GetRenderer()->AdjustActors();
Repaint();
void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters, bool baseParamsOnly )
{
- double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
+ double pos[3], focalPnt[3], viewUp[3], parScale = 1.0, scale[3];
QXmlStreamReader aReader(parameters);
SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
Processes events
*/
void SVTK_ViewWindow::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
+ unsigned long /*theEvent*/,
void* theClientData,
- void* theCallData)
+ void* /*theCallData*/)
{
SVTK_ViewWindow* self = reinterpret_cast<SVTK_ViewWindow*>(theClientData);
if(self)
//! Define a container for SALOME VTK view window
class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
{
- Q_OBJECT;
+ Q_OBJECT
public:
//! To construct #SVTK_ViewWindow instance
namespace salomevtk
{
-vtkStandardNewMacro(vtkPVAxesActor);
+vtkStandardNewMacro(vtkPVAxesActor)
-vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData );
-vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedShaft, vtkPolyData );
+vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData )
+vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedShaft, vtkPolyData )
//-----------------------------------------------------------------------------
vtkPVAxesActor::vtkPVAxesActor()
{
public:
static vtkPVAxesActor *New();
- vtkTypeMacro(vtkPVAxesActor,vtkProp3D);
+ vtkTypeMacro(vtkPVAxesActor,vtkProp3D)
void PrintSelf(ostream& os, vtkIndent indent);
namespace salomevtk
{
-vtkStandardNewMacro(vtkPVAxesWidget);
+vtkStandardNewMacro(vtkPVAxesWidget)
-vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor);
-vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer);
+vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor)
+vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer)
//----------------------------------------------------------------------------
class vtkPVAxesWidgetObserver : public vtkCommand
{
public:
static vtkPVAxesWidget* New();
- vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver);
+ vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver)
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
desktop()->setWindowTitle( aTitle );
}
-int SalomeApp_Application::closeChoice( const QString& docName )
+int SalomeApp_Application::closeChoice( const QString& /*docName*/ )
{
- //GUI_UNUSED(docName);
QStringList buttons;
QMap<int, int> choices;
int idx = 0;
onSaveDoc();
else if ( !onSaveAsDoc() )
res = false;
+ // fall through!
case CloseDisconnect:
closeActiveDoc( false );
closePermanently = false;
switch ( choice )
{
case OpenRefresh:
- {
- choice = OpenNew;
- }
+ choice = OpenNew;
+ // fall through!
default:
res = LightApp_Application::openAction( choice, aName );
break;
\param name new name of the object
\brief Return \c true if rename operation finished successfully, \c false otherwise.
*/
-bool SalomeApp_Application::renameObject( const QString& entry, const QString& name )
+bool SalomeApp_Application::renameObject( const QString& /*entry*/, const QString& name )
{
- //GUI_UNUSED(entry);
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
int savePoint = ::getSelectedSavePoint( selectionMgr() );
Updates SUIT object
\param p - SUIT object
*/
-void SalomeApp_DataModelSync::updateItem( const kerPtr& obj, const suitPtr& ) const
+void SalomeApp_DataModelSync::updateItem( const kerPtr&, const suitPtr& ) const
{
- //GUI_UNUSED(obj);
}
/*!
switch ( id )
{
case ValueId:
-#ifndef WIN32
- if ( componentObject() != this )
-#else
if ( componentObject() != (SUIT_DataObject*)this )
-#endif
txt = value( object() );
- if ( txt.isEmpty() )
- txt = value( referencedObject() );
+ if ( txt.isEmpty() )
+ txt = value( referencedObject() );
break;
case IORId:
txt = ior( referencedObject() );
}
SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
+ const char* /*theURL*/,
bool isMultiFile)
{
SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
/*!
* DumpPython implementation for light modules
*/
-Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Boolean isPublished,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean& isValidScript)
+Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Boolean /*isPublished*/,
+ CORBA::Boolean /*isMultiFile*/,
+ CORBA::Boolean& isValidScript)
{
- //GUI_UNUSED(isPublished);GUI_UNUSED(isMultiFile);
MESSAGE("SalomeApp_Engine_i::DumpPython(): myComponentName = "<<
qPrintable( myComponentName ) << ", this = " << this);
*/
void SalomeApp_ComboBox::insertList(const QStringList& theList)
{
- for (unsigned i = 0; i < (unsigned int)theList.count(); i++) //!< TODO: mismatch signed/unsigned
+ for (int i = 0; i < theList.count(); i++)
insertItem(theList[i]);
}
* This method is called just before the study document is saved, so the module has a possibility
* to store visual parameters in AttributeParameter attribut
*/
-void SalomeApp_Module::storeVisualParameters(int savePoint)
+void SalomeApp_Module::storeVisualParameters(int /*savePoint*/)
{
- //GUI_UNUSED(savePoint);
}
/*!
* This method is called after the study document is opened, so the module has a possibility to restore
* visual parameters
*/
-void SalomeApp_Module::restoreVisualParameters(int savePoint)
+void SalomeApp_Module::restoreVisualParameters(int /*savePoint*/)
{
- //GUI_UNUSED(savePoint);
}
//============================================================================
NoteBook_TableRow::NoteBook_TableRow(int index, NoteBook_Table* parentTable, QWidget* parent):
QWidget(parent),
- myParentTable(parentTable),
myIndex(index),
+ myParentTable(parentTable),
myRowHeader(new QTableWidgetItem()),
myVariableName(new QTableWidgetItem()),
myVariableValue(new QTableWidgetItem())
* The whole notebook is verified on apply
*/
//============================================================================
-bool NoteBook_TableRow::IsValidStringValue(const QString theValue)
+bool NoteBook_TableRow::IsValidStringValue(const QString /*theValue*/)
{
int aNumRows = myParentTable->myRows.count();
if( aNumRows == 0 )
//Add all variables into the table
std::vector<std::string> aVariables = SalomeApp_Application::getStudy()->GetVariableNames();
- for(int iVar = 0; iVar < aVariables.size(); iVar++ ) {
+ for(int iVar = 0; iVar < (int)aVariables.size(); iVar++ ) {
AddRow(QString(aVariables[iVar].c_str()),
Variable2String(aVariables[iVar]));
}
* Purpose : [slot]
*/
//============================================================================
-void SalomeApp_NoteBook::onVarUpdate(QString theVarName)
+void SalomeApp_NoteBook::onVarUpdate(QString /*theVarName*/)
{
myTable->Init();
}
bool IsUniqueName(const NoteBook_TableRow* theRow) const;
QList<NoteBook_TableRow*> GetRows() const;
- const bool IsModified() const { return myIsModified; }
+ bool IsModified() const { return myIsModified; }
const QList<int>& GetRemovedRows() const { return myRemovedRows; }
const VariableMap& GetVariableMap() const { return myVariableMap; }
const VariableMap& GetVariableMapRef() const { return myVariableMapRef; }
// parse the children
o = o->firstChild();
}
- else if ( o->nextBrother() > 0 ) {
+ else if ( o->nextBrother() ) {
o = o->nextBrother();
}
else {
bool isMultiFile,
bool toSaveGUI )
{
- int savePoint;
+ int savePoint = 0;
_PTR(AttributeParameter) ap;
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
Re-implemented from LightApp_Study, actually does not save anything but
simply cleans up light modules' data
*/
-bool SalomeApp_Study::saveStudyData( const QString& theFileName, int type )
+bool SalomeApp_Study::saveStudyData( const QString& /*theFileName*/, int type )
{
- //GUI_UNUSED(theFileName);
ModelList list; dataModels( list );
QListIterator<CAM_DataModel*> it( list );
while ( it.hasNext() ){
std::vector<std::string> aUsers;
std::vector<int> aMins, aHours, aDays, aMonths, aYears;
propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false);
- size_t aCnt = aUsers.size();
- for ( int i = 0; i < aCnt; i++ ) {
+ int aCnt = aUsers.size();
+ for ( int i = 0; i < (int)aCnt; i++ ) {
QString date;
date.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d",
aDays [i],
//Component versions
std::vector<std::string> aComponents = propAttr->GetStoredComponents();
- for ( int i = 0; i < aComponents.size(); i++ ) {
+ for ( int i = 0; i < (int)aComponents.size(); i++ ) {
std::vector<int> aMins, aHours, aDays, aMonths, aYears;
std::vector<std::string> aVersions = propAttr->GetComponentVersions(aComponents[i]);
QStringList aData;
// restore modules' visual parameters
std::vector<std::string> v = ip->getValues( "AP_MODULES_LIST" );
- for ( int i = 0; i < v.size(); i++ )
+ for ( int i = 0; i < (int)v.size(); i++ )
{
myApp->activateModule( v[i].c_str() );
if ( SalomeApp_Module* module = dynamic_cast<SalomeApp_Module*>( myApp->activeModule() ) )
{
public:
MsgHandler() {}
- void qtMessage( QtMsgType type, const QMessageLogContext& context, const QString& message )
+ void qtMessage( QtMsgType type, const QMessageLogContext& /*context*/, const QString& message )
{
+ (void)message; // unused in debug mode
switch ( type )
{
case QtDebugMsg:
}
protected:
- QString userFileName( const QString& appName, const bool forLoad ) const
+ QString userFileName( const QString& /*appName*/, const bool forLoad ) const
{
if ( version().isEmpty() ) return "";
return SUIT_ResourceMgr::userFileName( myCustomAppName, forLoad );
}
}
-void Session_ServerThread::ActivateSALOMEDS(int argc,
- char ** argv)
+void Session_ServerThread::ActivateSALOMEDS(int /*argc*/, char** /*argv*/)
{
try {
MESSAGE("SALOMEDS thread started");
}
}
-void Session_ServerThread::ActivateContainerManager(int argc,
- char ** argv)
+void Session_ServerThread::ActivateContainerManager(int /*argc*/, char** /*argv*/)
{
try {
PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
}
}
-void Session_ServerThread::ActivateContainer(int argc,
- char ** argv)
+void Session_ServerThread::ActivateContainer(int argc, char** argv)
{
try {
MESSAGE("Container thread started");
containerName = argv[1];
}
- _container = new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
+ _container = new Engines_Container_i(_orb, _root_poa, containerName, argc, argv, true, false);
}
catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.");
}
}
-void Session_ServerThread::ActivateSession(int argc,
- char ** argv)
+void Session_ServerThread::ActivateSession(int /*argc*/, char** /*argv*/)
{
MESSAGE("Session_ServerThread::ActivateSession() not implemented!");
}
// destroy of all containers and modules
_NS->Change_Directory("/Containers");
std::vector<std::string> machines = _NS->list_subdirs();
- for(int i=0;i<machines.size();i++){
+ for(int i=0;i<(int)machines.size();i++){
_NS->Change_Directory(machines[i].c_str());
std::vector<std::string> toto = _NS->list_directory();
- for(int j=0;j<toto.size();j++)
+ for(int j=0;j<(int)toto.size();j++)
_NS->Destroy_Name(toto[j].c_str());
std::vector<std::string> containers = _NS->list_subdirs();
- for(int j=0;j<containers.size();j++){
+ for(int j=0;j<(int)containers.size();j++){
_NS->Change_Directory(containers[j].c_str());
std::vector<std::string> modules = _NS->list_directory();
- for(int k=0;k<modules.size();k++)
+ for(int k=0;k<(int)modules.size();k++)
_NS->Destroy_Name(modules[k].c_str());
_NS->Change_Directory("/Containers");
_NS->Change_Directory(machines[i].c_str());
#define DELTA_SLIDER 3
static const char* const hole_xpm[] = {
-"3 3 3 1",
-". c None",
-"a c #999999",
-"b c #FFFFFF",
-"aa.",
-"aab",
-".bb"
+ "3 3 3 1",
+ ". c None",
+ "a c #999999",
+ "b c #FFFFFF",
+ "aa.",
+ "aab",
+ ".bb"
};
static const char* const cross_xpm[] = {
-"12 12 4 1",
-". c None",
-"a c #000000",
-"b c #FFFFFF",
-"c c #666666",
-"............",
-"............",
-"............",
-".aaaa..aaaa.",
-"..abbaabba..",
-"...abbbba...",
-"....abba....",
-"...abbbba...",
-"..abbaabba..",
-".aaaa..aaaa.",
-"............",
-"............"
+ "12 12 4 1",
+ ". c None",
+ "a c #000000",
+ "b c #FFFFFF",
+ "c c #666666",
+ "............",
+ "............",
+ "............",
+ ".aaaa..aaaa.",
+ "..abbaabba..",
+ "...abbbba...",
+ "....abba....",
+ "...abbbba...",
+ "..abbaabba..",
+ ".aaaa..aaaa.",
+ "............",
+ "............"
};
static const char* const maximize_xpm[] = {
-"12 12 4 1",
-". c None",
-"a c #000000",
-"b c #FFFFFF",
-"c c #666666",
-"............",
-".aaaaaaaaaa.",
-".acccccccca.",
-".acccccccca.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".abbbbbbbba.",
-".aaaaaaaaaa.",
-"............"
+ "12 12 4 1",
+ ". c None",
+ "a c #000000",
+ "b c #FFFFFF",
+ "c c #666666",
+ "............",
+ ".aaaaaaaaaa.",
+ ".acccccccca.",
+ ".acccccccca.",
+ ".abbbbbbbba.",
+ ".abbbbbbbba.",
+ ".abbbbbbbba.",
+ ".abbbbbbbba.",
+ ".abbbbbbbba.",
+ ".abbbbbbbba.",
+ ".aaaaaaaaaa.",
+ "............"
};
static const char* const normal_xpm[] = {
-"12 12 4 1",
-". c None",
-"a c #000000",
-"b c #FFFFFF",
-"c c #666666",
-"............",
-"...aaaaaaaa.",
-"...acccccca.",
-"...abbbbbba.",
-"...aaaaaaba.",
-".aaaaaaaaba.",
-".accccccaba.",
-".abbbbbbaaa.",
-".abbbbbba...",
-".abbbbbba...",
-".aaaaaaaa...",
-"............"
+ "12 12 4 1",
+ ". c None",
+ "a c #000000",
+ "b c #FFFFFF",
+ "c c #666666",
+ "............",
+ "...aaaaaaaa.",
+ "...acccccca.",
+ "...abbbbbba.",
+ "...aaaaaaba.",
+ ".aaaaaaaaba.",
+ ".accccccaba.",
+ ".abbbbbbaaa.",
+ ".abbbbbba...",
+ ".abbbbbba...",
+ ".aaaaaaaa...",
+ "............"
};
static const char* const minimize_xpm[] = {
-"12 12 4 1",
-". c None",
-"a c #000000",
-"b c #FFFFFF",
-"c c #666666",
-"............",
-"............",
-"............",
-"............",
-"............",
-"............",
-"............",
-"............",
-"aaaaaaaaaaaa",
-"abbbbbbbbbba",
-"aaaaaaaaaaaa",
-"............"
+ "12 12 4 1",
+ ". c None",
+ "a c #000000",
+ "b c #FFFFFF",
+ "c c #666666",
+ "............",
+ "............",
+ "............",
+ "............",
+ "............",
+ "............",
+ "............",
+ "............",
+ "aaaaaaaaaaaa",
+ "abbbbbbbbbba",
+ "aaaaaaaaaaaa",
+ "............"
};
///////////////////////////////////////////////////////////
void Style_Salome::polish ( QApplication* app )
{
BaseStyle::polish( app );
-
+
if ( checkDebugLevel(1) ) {
return;
}
qobject_cast<QMenuBar*>(w) || qobject_cast<QDockWidget*>(w) )
w->setAttribute( Qt::WA_Hover );
}
- BaseStyle::polish( w );
+ BaseStyle::polish( w );
}
/*!
const QPalette& pal = w->palette();
switch( cc ) {
- case CC_SpinBox:
+ case CC_SpinBox: {
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
QRect optr = opt->rect, arUp = subControlRect( cc, spin, SC_SpinBoxUp, w );
copy.rect = aBtnRect;
drawPrimitive(pe, ©, p, w);
}
- break;
- }
- case CC_ComboBox: {
+ }
+ break;
+ }
+ case CC_ComboBox: {
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
QRect optr = opt->rect,
else
p->setPen(cmb->palette.text().color());
}
- break;
}
+ break;
}
case CC_Slider: {
- if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
- QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, w);
- QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, w);
-
- if( hasHover() && (slider->state & State_Enabled) &&
- (slider->state & State_MouseOver) ) {
- QRect moderated = w->rect();
- drawHoverRect(p, moderated, opt->palette.color( QPalette::Window ),
- model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false);
- }
-
- if ((slider->subControls & SC_SliderGroove) && groove.isValid()) {
- QStyleOptionSlider tmpSlider = *slider;
- tmpSlider.subControls = SC_SliderGroove;
- BaseStyle::drawComplexControl(cc, &tmpSlider, p, w);
- }
- if (slider->subControls & SC_SliderTickmarks) {
- QStyleOptionSlider tmpSlider = *slider;
- tmpSlider.subControls = SC_SliderTickmarks;
- QCommonStyle::drawComplexControl(cc, &tmpSlider, p, w);
+ if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
+ QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, w);
+ QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, w);
+
+ if( hasHover() && (slider->state & State_Enabled) &&
+ (slider->state & State_MouseOver) ) {
+ QRect moderated = w->rect();
+ drawHoverRect(p, moderated, opt->palette.color( QPalette::Window ),
+ model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false);
+ }
+
+ if ((slider->subControls & SC_SliderGroove) && groove.isValid()) {
+ QStyleOptionSlider tmpSlider = *slider;
+ tmpSlider.subControls = SC_SliderGroove;
+ BaseStyle::drawComplexControl(cc, &tmpSlider, p, w);
+ }
+ if (slider->subControls & SC_SliderTickmarks) {
+ QStyleOptionSlider tmpSlider = *slider;
+ tmpSlider.subControls = SC_SliderTickmarks;
+ QCommonStyle::drawComplexControl(cc, &tmpSlider, p, w);
+ }
+ if (slider->subControls & SC_SliderHandle) {
+ if (slider->state & State_HasFocus) {
+ QStyleOptionFocusRect fropt;
+ fropt.QStyleOption::operator=(*slider);
+ fropt.rect = subElementRect(SE_SliderFocusRect, slider, w);
+ drawPrimitive(PE_FrameFocusRect, &fropt, p, w);
+ }
+ int x = handle.x(), y = handle.y(), wi = handle.width(), he = handle.height();
+ bool horiz = slider->orientation == Qt::Horizontal;
+ 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
+ // 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);
+ int aXAdd = (int)(slRect.width()/6), aYAdd = (int)(slRect.height()/6);
+ Style_Tools::SliderType type = Style_Tools::SlNone;
+ if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow))
+ type = Style_Tools::SlNone;
+ else {
+ if (horiz) {
+ if (tickAbove) {
+ type = Style_Tools::SlUp;
+ slRect.setTop( slRect.top()-aYAdd );
+ }
+ else {
+ type = Style_Tools::SlDown;
+ slRect.setBottom( slRect.bottom()+aYAdd );
+ }
}
- if (slider->subControls & SC_SliderHandle) {
- if (slider->state & State_HasFocus) {
- QStyleOptionFocusRect fropt;
- fropt.QStyleOption::operator=(*slider);
- fropt.rect = subElementRect(SE_SliderFocusRect, slider, w);
- drawPrimitive(PE_FrameFocusRect, &fropt, p, w);
+ else {
+ if (tickAbove) {
+ type = Style_Tools::SlLeft;
+ slRect.setLeft( slRect.left()-aXAdd );
}
- int x = handle.x(), y = handle.y(), wi = handle.width(), he = handle.height();
- bool horiz = slider->orientation == Qt::Horizontal;
- 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
- // 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);
- int aXAdd = (int)(slRect.width()/6), aYAdd = (int)(slRect.height()/6);
- Style_Tools::SliderType type = Style_Tools::SlNone;
- if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow))
- type = Style_Tools::SlNone;
else {
- if (horiz)
- if (tickAbove) {
- type = Style_Tools::SlUp;
- slRect.setTop( slRect.top()-aYAdd );
- }
- else {
- type = Style_Tools::SlDown;
- slRect.setBottom( slRect.bottom()+aYAdd );
- }
- else
- if (tickAbove) {
- type = Style_Tools::SlLeft;
- slRect.setLeft( slRect.left()-aXAdd );
- }
- else {
- type = Style_Tools::SlRight;
- slRect.setRight( slRect.right()+aXAdd );
- }
+ type = Style_Tools::SlRight;
+ slRect.setRight( slRect.right()+aXAdd );
}
- Style_Tools::drawSlider( p, slRect, model()->widgetRounding( Style_Model::SliderRadius ), type,
- aBtnCol.light( BUT_PERCENT_COL ),
- aBtnCol.dark( BUT_PERCENT_COL ), aBrdTopCol, aBrdBotCol );
- QRect aHRect = handle;
- int aXRect = (int)(aHRect.width()/5),
- aYRect = (int)(aHRect.height()/5);
- aHRect = QRect( aHRect.x()+aXRect, aHRect.y()+aYRect,
- aHRect.width()-2*aXRect, aHRect.height()-2*aYRect );
- drawHandle( p, aHRect, horiz );
}
- break;
+ }
+ Style_Tools::drawSlider( p, slRect, model()->widgetRounding( Style_Model::SliderRadius ), type,
+ aBtnCol.light( BUT_PERCENT_COL ),
+ aBtnCol.dark( BUT_PERCENT_COL ), aBrdTopCol, aBrdBotCol );
+ QRect aHRect = handle;
+ int aXRect = (int)(aHRect.width()/5),
+ aYRect = (int)(aHRect.height()/5);
+ aHRect = QRect( aHRect.x()+aXRect, aHRect.y()+aYRect,
+ aHRect.width()-2*aXRect, aHRect.height()-2*aYRect );
+ drawHandle( p, aHRect, horiz );
}
+ }
+ break;
}
case CC_ToolButton: {
if (const QStyleOptionToolButton *toolbutton
int fw = pixelMetric( PM_DefaultFrameWidth, opt, w );
label.rect = button.adjusted( fw, fw, -fw, -fw );
drawControl( CE_ToolButtonLabel, &label, p, w );
-
- break;
}
+ break;
}
case CC_TitleBar: {
BaseStyle::drawComplexControl( cc, opt, p, w );
break;
}
- case CC_GroupBox:
+ case CC_GroupBox: {
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const
QStyleOptionGroupBox *>(opt)) {
// Draw frame
box.rect = checkBoxRect;
drawPrimitive(PE_IndicatorCheckBox, &box, p, w);
}
- break;
}
+ break;
+ }
case CC_Dial: {
BaseStyle::drawComplexControl( cc, opt, p, w );
break;
}
- default:
+ default: {
BaseStyle::drawComplexControl( cc, opt, p, w );
+ break;
+ }
}
}
}
switch ( ce ) {
- case CE_PushButton:
+ case CE_PushButton: {
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
drawControl(CE_PushButtonBevel, btn, p, w);
QStyleOptionButton subopt = *btn;
Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ),
Style_Tools::All, model()->color( Style_Model::BorderBottom ) );
}
- break;
}
- case CE_PushButtonBevel:
+ break;
+ }
+ case CE_PushButtonBevel: {
if ( const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) ) {
double aRad = model()->widgetRounding( Style_Model::ButtonRadius );
bool aStateOn = opt->state & ( State_Sunken | State_On );
else
Style_Tools::shadowRect( p, r, aRad, -1, SHADOW, Style_Tools::All, top, bottom,
aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
- if (btn->features & QStyleOptionButton::HasMenu) {
- int mbi = pixelMetric(PM_MenuButtonIndicator, btn, w);
- QStyleOptionButton newBtn = *btn;
- newBtn.rect = QRect(r.right() - mbi-2, r.height()/2 - mbi/2, mbi, mbi);
- drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w);
- }
- break;
+ if (btn->features & QStyleOptionButton::HasMenu) {
+ int mbi = pixelMetric(PM_MenuButtonIndicator, btn, w);
+ QStyleOptionButton newBtn = *btn;
+ newBtn.rect = QRect(r.right() - mbi-2, r.height()/2 - mbi/2, mbi, mbi);
+ drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w);
+ }
}
- case CE_DockWidgetTitle:
- if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
- bool floating = false;
- int menuOffset = 0; //used to center text when floated
- QColor inactiveCaptionTextColor = opt->palette.color( QPalette::HighlightedText );
- const QDockWidget *dockWidget = qobject_cast<const QDockWidget *>(w);
- //Titlebar gradient
- if (dockWidget) {
- if ( dockWidget->isFloating() && dwOpt->movable) {
- floating = true;
- QColor top = opt->palette.color( QPalette::Highlight ).light();
- QColor bottom = opt->palette.color( QPalette::Highlight );
- menuOffset = 2;
- QBrush fillBrush(bottom);
- if (top != bottom) {
- QPoint p1(dwOpt->rect.x(), dwOpt->rect.y());
- QPoint p2(dwOpt->rect.x(), dwOpt->rect.bottom() );
- QLinearGradient lg(p1, p2);
- lg.setColorAt(0, top);
- lg.setColorAt(1, bottom);
- fillBrush = lg;
- }
- p->fillRect(dwOpt->rect.adjusted(0, 0, 0, -3), fillBrush);
- }
- else {
- QRect r = dwOpt->rect.adjusted(0, 0, -1, -1);
- QColor bottom = opt->palette.color( QPalette::Window ),
- top = bottom.dark( BUT_PERCENT_COL );
- QRect aRect = dwOpt->rect;
- QLinearGradient gr( aRect.x(), aRect.y(), aRect.x(), aRect.y()+aRect.height() );
- gr.setColorAt( 0.0, top );
- gr.setColorAt( 0.4, bottom );
- gr.setColorAt( 0.6, bottom );
- gr.setColorAt( 1.0, top );
- p->fillRect( r, gr );
-
- 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( aBrdTopCol );
- p->drawLine( r.x(), r.bottom(), r.x(), r.y() );
- p->drawLine( r.x(), r.y(), r.right(), r.y() );
- p->setPen( aBrdBotCol );
- p->drawLine( r.x(), r.bottom(), r.right(), r.bottom() );
- p->drawLine( r.right(), r.bottom(), r.right(), r.y() );
+ break;
+ }
+ case CE_DockWidgetTitle: {
+ if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
+ bool floating = false;
+ int menuOffset = 0; //used to center text when floated
+ QColor inactiveCaptionTextColor = opt->palette.color( QPalette::HighlightedText );
+ const QDockWidget *dockWidget = qobject_cast<const QDockWidget *>(w);
+ //Titlebar gradient
+ if (dockWidget) {
+ if ( dockWidget->isFloating() && dwOpt->movable) {
+ floating = true;
+ QColor top = opt->palette.color( QPalette::Highlight ).light();
+ QColor bottom = opt->palette.color( QPalette::Highlight );
+ menuOffset = 2;
+ QBrush fillBrush(bottom);
+ if (top != bottom) {
+ QPoint p1(dwOpt->rect.x(), dwOpt->rect.y());
+ QPoint p2(dwOpt->rect.x(), dwOpt->rect.bottom() );
+ QLinearGradient lg(p1, p2);
+ lg.setColorAt(0, top);
+ lg.setColorAt(1, bottom);
+ fillBrush = lg;
}
+ p->fillRect(dwOpt->rect.adjusted(0, 0, 0, -3), fillBrush);
}
- p->setPen(dwOpt->palette.color(QPalette::Light));
-
- QString aTitle = dwOpt->title;
- if (!aTitle.isEmpty()) {
- int aMargin = pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, w);
- const int indent = p->fontMetrics().descent();
- QRect r = dwOpt->rect.adjusted(indent + 1, - menuOffset, -indent - 1, -1);
- QPixmap aPxm = standardPixmap( SP_DockWidgetCloseButton, opt, w);
- int aWidth = r.width() - aPxm.width()-2/*button margins*/;
- aPxm = standardPixmap( SP_TitleBarNormalButton, opt, w);
- aWidth = aWidth - aPxm.width()-2/*button margins*/;
- r = QRect( r.x(), r.y(), aWidth-aMargin-2/*buttons separator*/-2/*margin from text*/, r.height() );
-
- QFont oldFont = p->font();
- QFont font = oldFont;
- if (floating) {
- font.setBold(true);
- p->setFont(font);
- }
- aTitle = titleText( aTitle, r.width(), r.height(), font );
-
- QPalette palette = dwOpt->palette;
- palette.setColor(QPalette::Window, inactiveCaptionTextColor);
- bool active = dwOpt->state & State_Active;
- //const int indent = p->fontMetrics().descent();
- drawItemText(p, r, Qt::AlignLeft | Qt::AlignVCenter, palette,
- dwOpt->state & State_Enabled, aTitle,
- floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText);
- p->setFont(oldFont);
+ else {
+ QRect r = dwOpt->rect.adjusted(0, 0, -1, -1);
+ QColor bottom = opt->palette.color( QPalette::Window ),
+ top = bottom.dark( BUT_PERCENT_COL );
+ QRect aRect = dwOpt->rect;
+ QLinearGradient gr( aRect.x(), aRect.y(), aRect.x(), aRect.y()+aRect.height() );
+ gr.setColorAt( 0.0, top );
+ gr.setColorAt( 0.4, bottom );
+ gr.setColorAt( 0.6, bottom );
+ gr.setColorAt( 1.0, top );
+ p->fillRect( r, gr );
+
+ 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( aBrdTopCol );
+ p->drawLine( r.x(), r.bottom(), r.x(), r.y() );
+ p->drawLine( r.x(), r.y(), r.right(), r.y() );
+ p->setPen( aBrdBotCol );
+ p->drawLine( r.x(), r.bottom(), r.right(), r.bottom() );
+ p->drawLine( r.right(), r.bottom(), r.right(), r.y() );
}
- break;
}
+ p->setPen(dwOpt->palette.color(QPalette::Light));
+
+ QString aTitle = dwOpt->title;
+ if (!aTitle.isEmpty()) {
+ int aMargin = pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, w);
+ const int indent = p->fontMetrics().descent();
+ QRect r = dwOpt->rect.adjusted(indent + 1, - menuOffset, -indent - 1, -1);
+ QPixmap aPxm = standardPixmap( SP_DockWidgetCloseButton, opt, w);
+ int aWidth = r.width() - aPxm.width()-2/*button margins*/;
+ aPxm = standardPixmap( SP_TitleBarNormalButton, opt, w);
+ aWidth = aWidth - aPxm.width()-2/*button margins*/;
+ r = QRect( r.x(), r.y(), aWidth-aMargin-2/*buttons separator*/-2/*margin from text*/, r.height() );
+
+ QFont oldFont = p->font();
+ QFont font = oldFont;
+ if (floating) {
+ font.setBold(true);
+ p->setFont(font);
+ }
+ aTitle = titleText( aTitle, r.width(), r.height(), font );
+
+ QPalette palette = dwOpt->palette;
+ palette.setColor(QPalette::Window, inactiveCaptionTextColor);
+ bool active = dwOpt->state & State_Active;
+ //const int indent = p->fontMetrics().descent();
+ drawItemText(p, r, Qt::AlignLeft | Qt::AlignVCenter, palette,
+ dwOpt->state & State_Enabled, aTitle,
+ floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText);
+ p->setFont(oldFont);
+ }
+ }
+ break;
+ }
case CE_Splitter: {
BaseStyle::drawControl( ce, opt, p, w );
QRect r = opt->rect;
drawHandle( p, r, horiz, true );
break;
}
- case CE_TabBarTabShape:
+ case CE_TabBarTabShape: {
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
if (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedEast ||
tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::RoundedWest) {
DELTA_H_TAB, aColor, aDarkColor,
aBrdTopCol, aBrdBotCol, isSelected, isLast, isHover );
p->restore();
- } else
- QCommonStyle::drawControl( ce, opt, p, w );
- break;
+ }
+ else {
+ QCommonStyle::drawControl( ce, opt, p, w );
+ }
}
- case CE_TabBarTabLabel:
+ break;
+ }
+ case CE_TabBarTabLabel: {
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
if ( tab->position == QStyleOptionTab::End ||
tab->position == QStyleOptionTab::OnlyOneTab ) {
copyTab->rect = oldRect;
BaseStyle::drawControl( ce, copyTab, p, w );
}
- else
+ else {
BaseStyle::drawControl( ce, opt, p, w );
- break;
+ }
}
- case CE_MenuBarItem:
+ break;
+ }
+ case CE_MenuBarItem: {
if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
if ( w )
drawBackground( p, w->rect(), opt->palette.color( QPalette::Window ), true, true, true );
}
}
QCommonStyle::drawControl(ce, &newMbi, p, w);
- break;
}
- case CE_MenuBarEmptyArea:
+ break;
+ }
+ case CE_MenuBarEmptyArea: {
drawBackground( p, opt->rect, opt->palette.color( QPalette::Window ), true, true, true );
break;
+ }
case CE_ProgressBarGroove: {
QColor aBgColor = opt->palette.color( QPalette::Window ),
top = aBgColor.light( BUT_PERCENT_ON ),
SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol,
model()->antialiasing(), true );
break;
- }
- case CE_ProgressBarLabel:
+ }
+ case CE_ProgressBarLabel: {
if (const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
// implementation from qplastiquestyle
// The busy indicator doesn't draw a label
bool inverted = false;
bool bottomToTop = false;
// Get extra style options if version 2
- if (const QStyleOptionProgressBarV2 *bar2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt)) {
+ if (const QStyleOptionProgressBar *bar2 = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
vertical = (bar2->orientation == Qt::Vertical);
inverted = bar2->invertedAppearance;
bottomToTop = bar2->bottomToTop;
p->restore();
}
break;
- case CE_ProgressBarContents:
+ }
+ case CE_ProgressBarContents: {
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
QRect rect = pb->rect;
bool vertical = false;
bool inverted = false;
// Get extra style options if version 2
- const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(opt);
+ const QStyleOptionProgressBar *pb2 = qstyleoption_cast<const QStyleOptionProgressBar *>(opt);
if (pb2) {
vertical = (pb2->orientation == Qt::Vertical);
inverted = pb2->invertedAppearance;
int x = 0;
int x0 = reverse ? rect.right() - ((unit_width > 1) ? unit_width : fw)
: rect.x() + fw;
- QStyleOptionProgressBarV2 pbBits = *pb;
+ QStyleOptionProgressBar pbBits = *pb;
pbBits.rect = rect;
pbBits.palette = pal2;
int myY = pbBits.rect.y();
}
}
break;
- case CE_MenuItem:
+ }
+ case CE_MenuItem: {
if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
const int windowsItemFrame = 2; // definitions from qwindowstyle.cpp file
const int windowsItemHMargin = 3;
QFont font = menuitem->font;
if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
font.setBold(true);
- p->setFont(font);
- if (dis && !act) {
- p->setPen(menuitem->palette.light().color());
- p->drawText(vTextRect.adjusted(1,1,1,1), text_flags, s.left(t));
- p->setPen(discol);
- }
- p->drawText(vTextRect, text_flags, s.left(t));
- p->restore();
- }
- if (menuitem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow
- int dim = (h - 2 * windowsItemFrame) / 2;
- PrimitiveElement arrow;
- arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft :
- PE_IndicatorArrowRight;
- xpos = x + width - windowsArrowHMargin - windowsItemFrame - dim;
- QRect vSubMenuRect = visualRect(opt->direction, menuitem->rect,
- QRect(xpos, y + h / 2 - dim / 2, dim, dim));
- QStyleOptionMenuItem newMI = *menuitem;
- newMI.rect = vSubMenuRect;
- newMI.state = dis ? State_None : State_Enabled;
- if (act)
- newMI.palette.setColor(QPalette::ButtonText,
- newMI.palette.highlightedText().color());
- drawPrimitive(arrow, &newMI, p, w);
+ p->setFont(font);
+ if (dis && !act) {
+ p->setPen(menuitem->palette.light().color());
+ p->drawText(vTextRect.adjusted(1,1,1,1), text_flags, s.left(t));
+ p->setPen(discol);
}
+ p->drawText(vTextRect, text_flags, s.left(t));
+ p->restore();
}
+ if (menuitem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow
+ int dim = (h - 2 * windowsItemFrame) / 2;
+ PrimitiveElement arrow;
+ arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft :
+ PE_IndicatorArrowRight;
+ xpos = x + width - windowsArrowHMargin - windowsItemFrame - dim;
+ QRect vSubMenuRect = visualRect(opt->direction, menuitem->rect,
+ QRect(xpos, y + h / 2 - dim / 2, dim, dim));
+ QStyleOptionMenuItem newMI = *menuitem;
+ newMI.rect = vSubMenuRect;
+ newMI.state = dis ? State_None : State_Enabled;
+ if (act)
+ newMI.palette.setColor(QPalette::ButtonText,
+ newMI.palette.highlightedText().color());
+ drawPrimitive(arrow, &newMI, p, w);
+ }
+ }
break;
- /*
- case CE_ToolBoxTab:
+ }
+ /*
+ case CE_ToolBoxTab: {
QCommonStyle::drawControl( ce, opt, p, w );
break;
- */
+ }
+ */
case CE_HeaderSection: {
bool aStateOn = opt->state & State_On;
QColor aColor = model()->color( Style_Model::Header ); // Style_Model::header_clr
aBrdBotCol, model()->antialiasing(), true, aStateOn );
break;
}
- case CE_ComboBoxLabel:
+ case CE_ComboBoxLabel: {
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, w);
p->save();
p->restore();
}
break;
+ }
case CE_ScrollBarSubLine:
case CE_ScrollBarAddLine: {
- bool aStateOn = opt->state & ( State_Sunken | State_On );
- QColor aBtnCol = opt->palette.color( QPalette::Button );
- 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
- Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol,
- aBrdBotCol, false, true, aStateOn, true );
+ bool aStateOn = opt->state & ( State_Sunken | State_On );
+ QColor aBtnCol = opt->palette.color( QPalette::Button );
+ 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
+ Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol,
+ aBrdBotCol, false, true, aStateOn, true );
PrimitiveElement arrow;
if (opt->state & State_Horizontal) {
if (ce == CE_ScrollBarAddLine)
drawPrimitive(arrow, opt, p, w);
break;
}
- case CE_ScrollBarSlider:
+ case CE_ScrollBarSlider: {
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
p->save();
p->setRenderHint( QPainter::Antialiasing, true );
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 ),
p->fillPath( path, gr );
p->strokePath( path, aBrdTopCol );
+ }
+ p->setRenderHint( QPainter::Antialiasing, false );
+ // draw handle
+ QRect aRect = opt->rect;
+ int aWidth = aRect.width(), aHeight = aRect.height();
+ if ( aWidth > aHeight + aRad )
+ aRect = QRect( aRect.x() + (int)((aWidth-aHeight)/2),
+ aRect.y(), aHeight, aHeight );
+ else if ( aHeight > aWidth + aRad )
+ aRect = QRect( aRect.x(), aRect.y() + (int)((aHeight-aWidth)/2),
+ aWidth, aWidth );
+ else {
+ int aRad2 = (int)(aRad/3);
+ aRect = QRect( aRect.x()+aRad2, aRect.y()+aRad2, aRect.width()-2*aRad2, aRect.height()-2*aRad2 );
+ }
+ drawHandle( p, aRect, horiz, true );
+
+ p->restore();
}
+ break;
+ }
+ case CE_ToolBar: {
+ QRect r = w->rect();
+ bool horiz = opt->state & State_Horizontal;
+ drawBackground( p, r, opt->palette.color( QPalette::Window ), true, true, horiz );
p->setRenderHint( QPainter::Antialiasing, false );
- // draw handle
- QRect aRect = opt->rect;
- int aWidth = aRect.width(), aHeight = aRect.height();
- if ( aWidth > aHeight + aRad )
- aRect = QRect( aRect.x() + (int)((aWidth-aHeight)/2),
- aRect.y(), aHeight, aHeight );
- else if ( aHeight > aWidth + aRad )
- aRect = QRect( aRect.x(), aRect.y() + (int)((aHeight-aWidth)/2),
- aWidth, aWidth );
- else {
- int aRad2 = (int)(aRad/3);
- aRect = QRect( aRect.x()+aRad2, aRect.y()+aRad2, aRect.width()-2*aRad2, aRect.height()-2*aRad2 );
- }
- drawHandle( p, aRect, horiz, true );
-
- p->restore();
+ drawBorder( p, r, horiz );
+ break;
+ }
+ default: {
+ BaseStyle::drawControl( ce, opt, p, w );
break;
}
- case CE_ToolBar: {
- QRect r = w->rect();
- bool horiz = opt->state & State_Horizontal;
- drawBackground( p, r, opt->palette.color( QPalette::Window ), true, true, horiz );
- p->setRenderHint( QPainter::Antialiasing, false );
- drawBorder( p, r, horiz );
- break;
- }
- default:
- BaseStyle::drawControl( ce, opt, p, w );
- break;
}
}
const QPalette& pal = opt->palette;
bool doRestore = false;
switch ( pe ) {
- case PE_FrameMenu:
+ case PE_FrameMenu: {
if (qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
QColor aBtnCol = opt->palette.color( QPalette::Window ),
top = aBtnCol.light( BUT_PERCENT_ON ),
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;
}
+ break;
+ }
case PE_PanelButtonTool : {
if ( w && ( opt->state & State_Enabled ) &&
( ( qobject_cast<QToolBar*>( w->parentWidget() ) ) ||
}
break;
}
- else
+ else {
BaseStyle::drawPrimitive( pe, opt, p, w );
+ }
+ break;
}
- break;
case PE_FrameFocusRect: {
if (w && qobject_cast<QTabBar*>((QWidget*)w)) {
QTabBar* tabBar = qobject_cast<QTabBar*>((QWidget*)w);
p->setPen(opt->palette.dark().color());
else
p->setPen(opt->palette.text().color());
- } // Fall through!
- case PE_IndicatorViewItemCheck:
- {
+ } // Fall through!
+ case PE_IndicatorViewItemCheck: {
if (!doRestore) {
p->save();
doRestore = true;
QPoint(10, 2), QPoint(10, 3), QPoint(11, 4), QPoint(11, 7), QPoint(10, 8), QPoint(10, 9),
QPoint(9, 10), QPoint(8, 10), QPoint(7, 11), QPoint(4, 11), QPoint(3, 10), QPoint(2, 10)
};
- // make sure the indicator is square
+ // make sure the indicator is square
QRect ir = opt->rect;
if (opt->rect.width() < opt->rect.height()) {
ir.setTop(opt->rect.top() + (opt->rect.height() - opt->rect.width()) / 2);
p->restore();
break;
}
- case PE_FrameDockWidget:
+ case PE_FrameDockWidget: {
if ( qstyleoption_cast<const QStyleOptionFrame *>(opt))
QCommonStyle::drawPrimitive( pe, opt, p, w );
break;
+ }
case PE_FrameLineEdit:
case PE_PanelLineEdit: {
if ( w ) {
model()->color( Style_Model::FieldLight ),
opt->palette.color( QPalette::Dark ),
aBrdTopCol, aBrdBotCol, false, false, false, false );
- break;
}
+ break;
}
case PE_IndicatorToolBarHandle: {
p->save();
drawBackground( p, w->rect(), opt->palette.color( QPalette::Window ), false );
break;
}
- case PE_FrameTabBarBase:
+ case PE_FrameTabBarBase: {
// for a tabbar that isn't part of a tab widget(dockWidgets for example).
if (const QStyleOptionTabBarBase *tbb
= qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
QStyleOptionTabBarBase* copyOpt = (QStyleOptionTabBarBase*)tbb;
copyOpt->selectedTabRect = aSelRect;
QCommonStyle::drawPrimitive( pe, copyOpt, p, w );
- break;
}
+ break;
+ }
case PE_IndicatorBranch: {
- // This is _way_ too similar to the common style.
- static const int decoration_size = 9;
- int mid_h = opt->rect.x() + opt->rect.width() / 2;
- int mid_v = opt->rect.y() + opt->rect.height() / 2;
- int bef_h = mid_h;
- int bef_v = mid_v;
- int aft_h = mid_h;
- int aft_v = mid_v;
- if (opt->state & State_Children) {
- int delta = decoration_size / 2;
- bef_h -= delta;
- bef_v -= delta;
- aft_h += delta;
- aft_v += delta;
- p->drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4);
- if (!(opt->state & State_Open))
- p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6);
- QPen oldPen = p->pen();
- p->setPen(opt->palette.dark().color());
- p->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1);
- p->setPen(oldPen);
- }
- QBrush brush(opt->palette.dark().color(), Qt::Dense4Pattern);
- if (opt->state & State_Item) {
- if (opt->direction == Qt::RightToLeft)
- p->fillRect(opt->rect.left(), mid_v, bef_h - opt->rect.left(), 1, brush);
- else
- p->fillRect(aft_h, mid_v, opt->rect.right() - aft_h + 1, 1, brush);
- }
- if (opt->state & State_Sibling)
- p->fillRect(mid_h, aft_v, 1, opt->rect.bottom() - aft_v + 1, brush);
- if (opt->state & (State_Open | State_Children | State_Item | State_Sibling))
- p->fillRect(mid_h, opt->rect.y(), 1, bef_v - opt->rect.y(), brush);
- break;
+ // This is _way_ too similar to the common style.
+ static const int decoration_size = 9;
+ int mid_h = opt->rect.x() + opt->rect.width() / 2;
+ int mid_v = opt->rect.y() + opt->rect.height() / 2;
+ int bef_h = mid_h;
+ int bef_v = mid_v;
+ int aft_h = mid_h;
+ int aft_v = mid_v;
+ if (opt->state & State_Children) {
+ int delta = decoration_size / 2;
+ bef_h -= delta;
+ bef_v -= delta;
+ aft_h += delta;
+ aft_v += delta;
+ p->drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4);
+ if (!(opt->state & State_Open))
+ p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6);
+ QPen oldPen = p->pen();
+ p->setPen(opt->palette.dark().color());
+ p->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1);
+ p->setPen(oldPen);
+ }
+ QBrush brush(opt->palette.dark().color(), Qt::Dense4Pattern);
+ if (opt->state & State_Item) {
+ if (opt->direction == Qt::RightToLeft)
+ p->fillRect(opt->rect.left(), mid_v, bef_h - opt->rect.left(), 1, brush);
+ else
+ p->fillRect(aft_h, mid_v, opt->rect.right() - aft_h + 1, 1, brush);
}
+ if (opt->state & State_Sibling)
+ p->fillRect(mid_h, aft_v, 1, opt->rect.bottom() - aft_v + 1, brush);
+ if (opt->state & (State_Open | State_Children | State_Item | State_Sibling))
+ p->fillRect(mid_h, opt->rect.y(), 1, bef_v - opt->rect.y(), brush);
+ break;
+ }
case PE_IndicatorDockWidgetResizeHandle: {
QRect r = opt->rect;
drawBorder( p, r, opt->state & State_Horizontal );
}
case PM_DockWidgetFrameWidth:
aRes = 1;
- break;
+ break;
case PM_DockWidgetSeparatorExtent:
aRes = 8;
- break;
+ break;
case PM_DockWidgetTitleMargin:
aRes = 2;
- break;
+ break;
case PM_SplitterWidth:
aRes = 6;
- break;
+ break;
default:
- break;
+ break;
}
return aRes;
}
}
QSize sz = BaseStyle::sizeFromContents( ct, opt, contentsSize, w );
switch (ct) {
- case CT_TabBarTab:
+ case CT_TabBarTab: {
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
if ( tab->position == QStyleOptionTab::End ||
tab->position == QStyleOptionTab::OnlyOneTab ) {
sz.setHeight( sz.height() + aDelta );
}
}
- break;
}
break;
- case CT_Slider: {
- int aValue = model()->sliderSize();
- sz.setWidth( sz.width() + aValue );
- sz.setHeight( sz.height() + aValue );
- break;
+ }
+ case CT_Slider: {
+ int aValue = model()->sliderSize();
+ sz.setWidth( sz.width() + aValue );
+ sz.setHeight( sz.height() + aValue );
+ break;
+ }
+ case CT_ComboBox: {
+ if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
+ QRect res = QRect( 0, 0, sz.width(), sz.height() );
+ int aHalfRect = (int)Style_Tools::getMaxRect( res,
+ (int)model()->widgetRounding( Style_Model::EditRadius )/2 ); // left value
+
+ QRect old_arrow = BaseStyle::subControlRect( CC_ComboBox, cmb,
+ SC_ComboBoxArrow, w );
+ int aDelta = res.height() - old_arrow.width(); // right value
+ if ( cmb->editable )
+ aDelta += aHalfRect; // for right of line edit internal
+ sz.setWidth( res.width() + aDelta + aHalfRect );
}
- case CT_ComboBox:
- if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
- QRect res = QRect( 0, 0, sz.width(), sz.height() );
- int aHalfRect = (int)Style_Tools::getMaxRect( res,
- (int)model()->widgetRounding( Style_Model::EditRadius )/2 ); // left value
-
- QRect old_arrow = BaseStyle::subControlRect( CC_ComboBox, cmb,
- SC_ComboBoxArrow, w );
- int aDelta = res.height() - old_arrow.width(); // right value
- if ( cmb->editable )
- aDelta += aHalfRect; // for right of line edit internal
- sz.setWidth( res.width() + aDelta + aHalfRect );
- }
- break;
- default:
break;
+ }
+ default: {
+ break;
+ }
}
return sz;
}
res.setWidth( h );
break;
}
+ default: {
+ break;
+ }
}
}
break;
}
- case CC_ScrollBar:
+ case CC_ScrollBar: {
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
QRect slider_r = BaseStyle::subControlRect( cc, opt, SC_ScrollBarSlider, wid );
int aRect = Style_Tools::getMaxRect( slider_r, (int)model()->widgetRounding( Style_Model::ButtonRadius ) );
default:
break;
}
- break;
}
+ break;
+ }
case CC_Slider: {
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
switch ( sc ) {
}
break;
}
+ default: {
+ break;
+ }
}
}
+ break;
+ }
+ default: {
+ break;
}
}
return res;
case SE_ProgressBarContents:
case SE_ProgressBarGroove:
return opt->rect;
+ default:
+ break;
}
if( qobject_cast<const QRadioButton*>(wid) ||
qobject_cast<const QCheckBox*>(wid) ) {
p->translate( xc, yc );
bool correct = false;
switch( type ) {
- case QStyle::PE_IndicatorArrowDown:
+ case QStyle::PE_IndicatorArrowDown: {
correct = true;
+ } // fall through!
case QStyle::PE_IndicatorArrowUp: {
int widthArr2 = (int)(deltaX/3.);
if ( correct )
x11 = -deltaX; y11 = -deltaY; x12 = deltaX; y12 = deltaY;
break;
}
- case QStyle::PE_IndicatorArrowLeft: // to change
+ case QStyle::PE_IndicatorArrowLeft: {
correct = true;
+ } // fall through!
case QStyle::PE_IndicatorArrowRight: {
int widthArr2 = (int)(deltaX/3.);
if ( correct )
x11 = deltaX; y11 = deltaY; x12 = -deltaX; y12 = -deltaY;
break;
}
- case QStyle::PE_IndicatorSpinDown:
+ case QStyle::PE_IndicatorSpinDown: {
correct = true;
+ } // fall through!
case QStyle::PE_IndicatorSpinUp: {
aDelta = (int)(deltaY/2);
if ( correct ) {
p->translate( xc, yc );
bool correct = false;
switch( type ) {
- case QStyle::PE_IndicatorSpinMinus:
+ case QStyle::PE_IndicatorSpinMinus: {
correct = true;
+ } // fall through!
case QStyle::PE_IndicatorSpinPlus: {
aDelta = (int)(deltaY/2);
if ( correct ) {
*/
void Style_Tools::drawSlider( QPainter* p, const QRect& r, const double rad,
SliderType type, const QColor& light, const QColor& dark,
- const QColor& border_top, const QColor& border_bot )
+ const QColor& /*border_top*/, const QColor& border_bot )
{
- //GUI_UNUSED(border_top)
p->save();
QPainterPath path, bottomPath;
if ( rad == 0 )
bool ToolsGUI::GetVisibility( _PTR(SObject) theObj,
void* theId )
{
+ // todo: this function seems to be not used
_PTR(GenericAttribute) anAttr;
if ( theObj && theObj->FindAttribute( anAttr, "AttributeGraphic" ) )
{
_PTR(AttributeGraphic) aGraphic (anAttr);
- return aGraphic->GetVisibility( *((int*)theId) ); //!< TODO: pointer truncation
+ return aGraphic->GetVisibility( int(reinterpret_cast<long long>(theId)) ); // todo: unsafe - converting pointer to int can give non-unique result
}
return false;
const bool theValue,
void* theId )
{
+ // todo: this function seems to be not used
_PTR(Study) aStudy = ClientFactory::Study(KERNEL::getStudyServant());
_PTR(SObject) anObj ( aStudy->FindObjectID( theEntry ) );
if ( anObj->FindAttribute( aGAttr, "AttributeGraphic" ) )
{
_PTR(AttributeGraphic) anAttr ( aGAttr );
- anAttr->SetVisibility( *((int*)theId), theValue ); //!< TODO: pointer truncation
+ anAttr->SetVisibility( int(reinterpret_cast<long long>(theId)), theValue ); // todo: unsafe - converting pointer to int can give non-unique result
}
else if ( theValue )
{
_PTR(StudyBuilder) aBuilder (aStudy->NewBuilder());
_PTR(AttributeGraphic) anAttr (aBuilder->FindOrCreateAttribute(anObj, "AttributeGraphic"));
- anAttr->SetVisibility( *((int*)theId), theValue ); //!< TODO: pointer truncation
+ anAttr->SetVisibility( int(reinterpret_cast<long long>(theId)), theValue ); // todo: unsafe - converting pointer to int can give non-unique result
}
return true;
}
ToolsGUI_RegWidget::~ToolsGUI_RegWidget()
{
myRegWidgetPtr = 0;
-};
+}
/*!
\brief Get description text, containing information about the service.
protected:
- virtual void preprocess(QStringList itemNameIdList) {
+ virtual void preprocess(QStringList /*itemNameIdList*/) {
// Implement something to be executed at the begining of the process function
};
- virtual void postprocess(QStringList itemNameIdList) {
+ virtual void postprocess(QStringList /*itemNameIdList*/) {
// Implement something to be executed at the end of the process function
};
// Implement what must be done with each DataObject during the process function
_dwDataPanel->setWidget(_tvDataView);
}
-void DockWidgets::setPropertiesView(QTreeView * propertiesView) {
- //GUI_UNUSED(propertiesView);
+void DockWidgets::setPropertiesView(QTreeView * /*propertiesView*/) {
// Not implemented yet
}
//
// =================================================================
//
-int main(int argc, char * argv[ ])
+int main()
{
TEST_DataObject();
//TEST_DataModel();
*/
void TreeGuiManager::processItemList(QStringList itemNameIdList,
- int actionId)
+ int /*actionId*/)
{
// WARN: THIS IS A DEFAULT IMPLEMENTATION GIVEN FOR DEMONSTRATION
// OF WHAT TO DO WITH THE PARAMETERS
_lastActionId = 0;
// Default actions for tests
- int displayActionId = addAction(QObject::tr("Afficher"));
- int editActionId = addAction(QObject::tr("Editer"));
+ /*int displayActionId = */addAction(QObject::tr("Afficher"));
+ /*int editActionId = */addAction(QObject::tr("Editer"));
}
TreeView::~TreeView() {
#endif
#endif
-vtkStandardNewMacro(VTKViewer_AppendFilter);
+vtkStandardNewMacro(VTKViewer_AppendFilter)
VTKViewer_AppendFilter
::VTKViewer_AppendFilter()
const Pnt& thePnt2,
const Pnt& thePnt3,
double theAngle):
- myStatus(Arc_Error),
- myAngle(theAngle)
+ myAngle(theAngle),
+ myStatus(Arc_Error)
{
Vec V1(thePnt2.GetXYZ().X()-thePnt1.GetXYZ().X(),
thePnt2.GetXYZ().Y()-thePnt1.GetXYZ().Y(),
}
VTKViewer_ArcBuilder::IncOrder VTKViewer_ArcBuilder::GetArcAngle( const double& P1, const double& P2, const double& P3,double* Ang){
- IncOrder aResult;
+ IncOrder aResult = MINUS;
if(P1 < P2 && P2 < P3){
*Ang = P3 - P1;
- aResult = VTKViewer_ArcBuilder::PLUS;
+ aResult = PLUS;
}
else if((P1 < P3 && P3 < P2) || (P2 < P1 && P1 < P3)){
*Ang = 2*vtkMath::Pi() - P3 + P1;
- aResult = VTKViewer_ArcBuilder::MINUS;
+ aResult = MINUS;
}
else if((P2 < P3 && P3 < P1) || (P3 < P1 && P1 < P2)){
*Ang = 2*vtkMath::Pi() - P1 + P3;
- aResult = VTKViewer_ArcBuilder::PLUS;
+ aResult = PLUS;
}
else if(P3 < P2 && P2 < P1){
*Ang = P1 - P3;
- aResult = VTKViewer_ArcBuilder::MINUS;
+ aResult = MINUS;
}
return aResult;
}
double myMaxArcAngle){
vtkIdType aResult = -1;
- vtkIdType *aNewPoints;
vtkDataArray* inputScalars = input->GetPointData()->GetScalars();
vtkDataArray* outputScalars = output->GetPointData()->GetScalars();
{
public:
static VTKViewer_DataSetMapper *New();
- vtkTypeMacro(VTKViewer_DataSetMapper,vtkDataSetMapper);
+ vtkTypeMacro(VTKViewer_DataSetMapper,vtkDataSetMapper)
//! Set point marker enabled
void SetMarkerEnabled( bool );
VTKViewer_GeometryFilter
::UnstructuredGridExecute(vtkDataSet *dataSetInput,
vtkPolyData *output,
- vtkInformation *outInfo)
+ vtkInformation */*outInfo*/)
{
vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput;
vtkCellArray *Connectivity = input->GetCells();
{
if (!myCursorState)
setCursor(VTK_INTERACTOR_STYLE_CAMERA_SELECT);
- }
+ } // fall through!
case VTK_INTERACTOR_STYLE_CAMERA_FIT:
{
myOtherPoint = mousePos;
protected:
VTKViewer_InteractorStyle();
~VTKViewer_InteractorStyle();
- VTKViewer_InteractorStyle(const VTKViewer_InteractorStyle&) {};
+ VTKViewer_InteractorStyle(const VTKViewer_InteractorStyle&): QObject(), vtkInteractorStyle() {};
void operator=(const VTKViewer_InteractorStyle&) {};
void RotateXY(int dx, int dy);
aHeight++;
}
- if( theMarkerTexture.size() != aWidth * aHeight )
+ if( (int)theMarkerTexture.size() != aWidth * aHeight )
return false;
theMarkerTexture.push_front( aWidth );
#include <Basics_Utils.hxx>
-vtkStandardNewMacro(VTKViewer_OpenGLRenderer);
+vtkStandardNewMacro(VTKViewer_OpenGLRenderer)
VTKViewer_OpenGLRenderer::VTKViewer_OpenGLRenderer()
{
public:
static VTKViewer_OpenGLRenderer *New();
- vtkTypeMacro(VTKViewer_OpenGLRenderer,vtkOpenGLRenderer);
+ vtkTypeMacro(VTKViewer_OpenGLRenderer,vtkOpenGLRenderer)
virtual void SetGradientType( const int );
#endif
#ifndef VTK_IMPLEMENT_MESA_CXX
-vtkStandardNewMacro(VTKViewer_PolyDataMapper);
+vtkStandardNewMacro(VTKViewer_PolyDataMapper)
#endif
// some definitions for what the polydata has in it
-void MessageCallback( GLenum source,
+void MessageCallback( GLenum /*source*/,
GLenum type,
- GLuint id,
+ GLuint /*id*/,
GLenum severity,
- GLsizei length,
+ GLsizei /*length*/,
const GLcharARB* message,
- const void* userParam )
+ const void* /*userParam*/ )
{
fprintf( stderr, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n",
( type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : "" ),
virtual
void
- get( TVertex& theVertex, vtkIdType thePointId, vtkIdType theCellId )
+ get( TVertex& theVertex, vtkIdType /*thePointId*/, vtkIdType /*theCellId*/ )
{
theVertex.r = myColor[0];
theVertex.g = myColor[1];
virtual
vtkIdType
- GetTupleId( vtkIdType thePointId, vtkIdType theCellId )
+ GetTupleId( vtkIdType thePointId, vtkIdType /*theCellId*/ )
{
return thePointId;
}
virtual
vtkIdType
- GetTupleId( vtkIdType thePointId, vtkIdType theCellId )
+ GetTupleId( vtkIdType /*thePointId*/, vtkIdType theCellId )
{
return theCellId;
}
#else
//-----------------------------------------------------------------------------
void VTKViewer_PolyDataMapper::RenderPieceDraw( vtkRenderer* ren, vtkActor* act ) {
- int noAbort = 1;
if( (!this->MarkerEnabled || this->MarkerType == VTK::MT_NONE || !this->ImageData.GetPointer()) && !this->BallEnabled) {
MAPPER_SUPERCLASS::RenderPieceDraw( ren, act );
return;
}
/*!Call Render method for render window field.*/
-void VTKViewer_RenderWindow::paintEvent(QPaintEvent* theEvent)
+void VTKViewer_RenderWindow::paintEvent(QPaintEvent* /*theEvent*/)
{
myRW->Render();
}
/*!Resize render window.*/
-void VTKViewer_RenderWindow::resizeEvent(QResizeEvent* theEvent)
+void VTKViewer_RenderWindow::resizeEvent(QResizeEvent* /*theEvent*/)
{
int aWidth = myRW->GetSize()[0], aHeight = myRW->GetSize()[1];
if(vtkRenderWindowInteractor* aRWI = myRW->GetInteractor())
/*!Reaction on button pressed.
*\warning Do nothing.
*/
-void VTKViewer_RenderWindowInteractor::ButtonPressed(const QMouseEvent *event) {
+void VTKViewer_RenderWindowInteractor::ButtonPressed(const QMouseEvent* /*event*/) {
return ;
}
/*!Reaction on button released..
*\warning Do nothing.
*/
-void VTKViewer_RenderWindowInteractor::ButtonReleased(const QMouseEvent *event) {
+void VTKViewer_RenderWindowInteractor::ButtonReleased(const QMouseEvent* /*event*/) {
return ;
}
}
/*!Do nothing*/
-void VTKViewer_RenderWindowInteractor::Erase( VTKViewer_Actor* SActor, bool update)
+void VTKViewer_RenderWindowInteractor::Erase( VTKViewer_Actor* /*SActor*/, bool /*update*/)
{
}
/*!
default key press event (empty implementation)
*/
-void VTKViewer_RenderWindowInteractor::KeyPressed(QKeyEvent *event)
+void VTKViewer_RenderWindowInteractor::KeyPressed(QKeyEvent* /*event*/)
{
/// NOT_IMPLEMENTED
}
public:
static VTKViewer_RenderWindowInteractor *New();
- vtkTypeMacro(VTKViewer_RenderWindowInteractor,vtkRenderWindowInteractor);
+ vtkTypeMacro(VTKViewer_RenderWindowInteractor,vtkRenderWindowInteractor)
void PrintSelf(ostream& os, vtkIndent indent);
#include <vtkInformation.h>
#include <vtkInformationVector.h>
-vtkStandardNewMacro(VTKViewer_ShrinkFilter);
+vtkStandardNewMacro(VTKViewer_ShrinkFilter)
/*!Constructor. Sets store mapping to zero.*/
VTKViewer_ShrinkFilter::VTKViewer_ShrinkFilter():
public:
/*!Create new instance of VTKViewer_ShrinkFilter.*/
static VTKViewer_ShrinkFilter *New();
- vtkTypeMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter);
+ vtkTypeMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter)
void SetStoreMapping(int theStoreMapping);
/*!Gets store mapping flag.*/
#include "vtkOpenGL.h"
#include <vtkObjectFactory.h>
-vtkStandardNewMacro(VTKViewer_Texture);
+vtkStandardNewMacro(VTKViewer_Texture)
// ----------------------------------------------------------------------------
public:
static VTKViewer_Texture *New();
- vtkTypeMacro(VTKViewer_Texture,vtkOpenGLTexture);
+ vtkTypeMacro(VTKViewer_Texture,vtkOpenGLTexture)
virtual void Load(vtkRenderer *ren);
static double EPS = 10e-4;
-vtkStandardNewMacro(VTKViewer_Transform);
+vtkStandardNewMacro(VTKViewer_Transform)
/*!Sets matrix scale.*/
void VTKViewer_Transform::SetMatrixScale(double theScaleX, double theScaleY, double theScaleZ){
/*!Constructor.*/
VTKViewer_Transform() {/*!Do nothing*/}
/*!Copy contructor.*/
- VTKViewer_Transform(const VTKViewer_Transform&) {/*!Do nothing*/}
+ VTKViewer_Transform(const VTKViewer_Transform&): vtkTransform() {/*!Do nothing*/}
/*!Destructor.*/
~VTKViewer_Transform() {/*!Do nothing*/}
#include <vtkInformation.h>
#include <vtkInformationVector.h>
-vtkStandardNewMacro(VTKViewer_TransformFilter);
+vtkStandardNewMacro(VTKViewer_TransformFilter)
/*!Execution method. Calculate output.*/
int VTKViewer_TransformFilter::RequestData(
/*!Destructor.*/
~VTKViewer_TransformFilter() {/*!Do nothing*/}
/*!Copy constructor.*/
- VTKViewer_TransformFilter(const VTKViewer_TransformFilter&) {/*!Do nothing*/}
+ VTKViewer_TransformFilter(const VTKViewer_TransformFilter&): vtkTransformFilter() {/*!Do nothing*/}
/*!Operator = */
void operator=(const VTKViewer_TransformFilter&) {/*!Do nothing*/}
// QT includes
#include <QtGlobal>
-vtkStandardNewMacro(VTKViewer_UnScaledActor);
+vtkStandardNewMacro(VTKViewer_UnScaledActor)
/*!Constructor*/
VTKViewer_UnScaledActor::VTKViewer_UnScaledActor()
vtkFollower::Render(theRenderer);
}
-vtkStandardNewMacro(VTKViewer_LineActor);
+vtkStandardNewMacro(VTKViewer_LineActor)
#ifdef IPAL21440
vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,vtkTextActor);
#else
-vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor);
+vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor)
#endif
-vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower);
+vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower)
/*!Adds Label and Arrow actors to \a theRenderer.*/
void VTKViewer_LineActor::Render(vtkRenderer *theRenderer)
VTKViewer_XAxis();
VTKViewer_XAxis(const VTKViewer_XAxis&);
public:
- vtkTypeMacro(VTKViewer_XAxis,VTKViewer_Axis);
+ vtkTypeMacro(VTKViewer_XAxis,VTKViewer_Axis)
static VTKViewer_XAxis *New();
};
-vtkStandardNewMacro(VTKViewer_XAxis);
+vtkStandardNewMacro(VTKViewer_XAxis)
/*!Initialize X Axis*/
VTKViewer_XAxis::VTKViewer_XAxis(){
VTKViewer_YAxis();
VTKViewer_YAxis(const VTKViewer_YAxis&);
public:
- vtkTypeMacro(VTKViewer_YAxis,VTKViewer_Axis);
+ vtkTypeMacro(VTKViewer_YAxis,VTKViewer_Axis)
static VTKViewer_YAxis *New();
};
-vtkStandardNewMacro(VTKViewer_YAxis);
+vtkStandardNewMacro(VTKViewer_YAxis)
/*!Initialize Y Axis*/
VTKViewer_YAxis::VTKViewer_YAxis()
VTKViewer_ZAxis();
VTKViewer_ZAxis(const VTKViewer_ZAxis&);
public:
- vtkTypeMacro(VTKViewer_ZAxis,VTKViewer_Axis);
+ vtkTypeMacro(VTKViewer_ZAxis,VTKViewer_Axis)
static VTKViewer_ZAxis *New();
};
-vtkStandardNewMacro(VTKViewer_ZAxis);
+vtkStandardNewMacro(VTKViewer_ZAxis)
/*!Initialize Z Axis*/
VTKViewer_ZAxis::VTKViewer_ZAxis()
SetColor(0.0,0.0,1.0);
}
-vtkStandardNewMacro(VTKViewer_Trihedron);
+vtkStandardNewMacro(VTKViewer_Trihedron)
/*!
Constructor
class VIEWERTOOLS_EXPORT ViewerTools_DialogBase : public QDialog
{
- Q_OBJECT;
+ Q_OBJECT
public:
ViewerTools_DialogBase(QtxAction* theAction,
const bool theItalic,
const bool theShadow )
{
- //GUI_UNUSED(theFamily);
SetColor( theColor );
myBold->setChecked( theBold );
bool& theItalic,
bool& theShadow ) const
{
- //GUI_UNUSED(theFamily);
theColor = GetColor();
theBold = myBold->isChecked();
// std::string s = xx.toStdString();
// std::cout << "test xx: " << s << std::endl;
std::cout << "setting X label " << CurvePlot::SetXLabel("tôtô") << std::endl;
- PlotID crv_id = CurvePlot::AddCurve(xx, yy, ps_id, "the cérve", "th x", "the y-s", false);
+ /*PlotID crv_id = */CurvePlot::AddCurve(xx, yy, ps_id, "the cérve", "th x", "the y-s", false);
std::cout << "setting X label " << CurvePlot::SetXLabel("tôtô") << std::endl;
}
class PYCONSOLE_EXPORT PyConsole_Editor : public QTextEdit
{
- Q_OBJECT;
+ Q_OBJECT
public:
PyConsole_Editor( QWidget* = 0 );
\brief Constructor.
\param parent Parent widget.
*/
-PyEditor_Widget::PyEditor_Widget( QWidget* parent )
+PyEditor_Widget::PyEditor_Widget( QWidget* parent ) : QWidget( parent )
{
// Create editor.
myEditor = new PyEditor_Editor( this );