Commit f5cd8f5e authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[STYLE] Removed leading space for brackets after if|else if|for|while|switch...

[STYLE] Removed leading space for brackets after if|else if|for|while|switch but not for preprocessor if stmts
parent 7f6674e3
......@@ -96,7 +96,7 @@ namespace PROPERTY_TYPE_HELPER
boost::lexical_cast< double >( innerTokens[ 4 ].c_str() ), // blue
1. ) ); // blue
}
else if ( innerTokens[ 0 ] == "a" )
else if( innerTokens[ 0 ] == "a" )
{
tf.addAlpha( boost::lexical_cast< double >( innerTokens[ 1 ].c_str() ),
boost::lexical_cast< double >( innerTokens[ 2 ].c_str() ) );
......
......@@ -133,7 +133,7 @@ void WTransferFunction::sample1DTransferFunction( unsigned char*array, int width
color = colors.begin()->color;
color[ 3 ] = alphas.begin()->alpha;
}
else if ( iso >= isomax )
else if( iso >= isomax )
{
color = colors.back().color;
color[ 3 ] = alphas.back().alpha;
......
......@@ -268,7 +268,7 @@ WGEAnimationManipulator::RefPtr WGEViewer::animationMode( bool on )
m_View->setCameraManipulator( m_animationModeManipulatorBackup );
return NULL;
}
else if ( !m_inAnimationMode && on ) // turn on
else if( !m_inAnimationMode && on ) // turn on
{
m_inAnimationMode = true;
......@@ -280,7 +280,7 @@ WGEAnimationManipulator::RefPtr WGEViewer::animationMode( bool on )
m_View->setCameraManipulator( anim );
return anim;
}
else if ( m_inAnimationMode ) // already on
else if( m_inAnimationMode ) // already on
{
return dynamic_cast< WGEAnimationManipulator* >( getCameraManipulator().get() );
}
......
......@@ -356,11 +356,11 @@ void WReaderVTK::readPointData()
{
readScalars( nbPoints, name );
}
else if ( tokens.size() == 3 && string_utils::toUpper( tokens.at( 0 ) ) == "VECTORS" )
else if( tokens.size() == 3 && string_utils::toUpper( tokens.at( 0 ) ) == "VECTORS" )
{
readVectors( nbPoints, name );
}
else if ( tokens.size() == 3 && string_utils::toUpper( tokens.at( 0 ) ) == "TENSORS" )
else if( tokens.size() == 3 && string_utils::toUpper( tokens.at( 0 ) ) == "TENSORS" )
{
readTensors( nbPoints, name );
}
......
......@@ -150,43 +150,43 @@ boost::shared_ptr< WDataSetScalar > WMReadRawData::readData( std::string fileNam
{
newValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet< uint8_t >( 0, 1, readDataTyped< uint8_t >( fileName ), W_DT_UINT8 ) );
}
else if ( dataTypeName == "UINT16")
else if( dataTypeName == "UINT16")
{
newValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet< uint16_t >( 0, 1, readDataTyped< uint16_t >( fileName ), W_DT_UINT16 ) );
}
// else if ( dataTypeName == "UINT32")
// else if( dataTypeName == "UINT32")
// {
// newValueSet = readDataTyped< uint32_t >( fileName );
// }
// else if ( dataTypeName == "UINT64")
// else if( dataTypeName == "UINT64")
// {
// newValueSet = readDataTyped< uint64_t >( fileName );
// }
// else if ( dataTypeName == "INT8" )
// else if( dataTypeName == "INT8" )
// {
// newValueSet = readDataTyped< int8_t >( fileName );
// }
// else if ( dataTypeName == "INT16")
// else if( dataTypeName == "INT16")
// {
// newValueSet = readDataTyped< int16_t >( fileName );
// }
// else if ( dataTypeName == "INT32")
// else if( dataTypeName == "INT32")
// {
// newValueSet = readDataTyped< int32_t >( fileName );
// }
// else if ( dataTypeName == "INT64")
// else if( dataTypeName == "INT64")
// {
// newValueSet = readDataTyped< int64_t >( fileName );
// }
// else if ( dataTypeName == "FLOAT" )
// else if( dataTypeName == "FLOAT" )
// {
// newValueSet = readDataTyped< float >( fileName );
// }
else if ( dataTypeName == "DOUBLE" )
else if( dataTypeName == "DOUBLE" )
{
newValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet< double >( 0, 1, readDataTyped< double >( fileName ), W_DT_DOUBLE ) );
}
else if ( dataTypeName == "FLOAT128" )
else if( dataTypeName == "FLOAT128" )
{
newValueSet =
boost::shared_ptr< WValueSetBase >( new WValueSet< long double >( 0, 1, readDataTyped< long double >( fileName ), W_DT_FLOAT128 ) );
......
......@@ -97,7 +97,7 @@ void WTransferFunctionColorPoint::paint( QPainter *painter, const QStyleOptionGr
gradient.setColorAt( 1, Qt::red );
painter->setPen( QPen( Qt::black, 2 ) );
}
else if ( option->state & QStyle::State_Sunken )
else if( option->state & QStyle::State_Sunken )
{
gradient.setColorAt( 0, color ); //QColor( Qt::yellow ).light( 120 ) );
gradient.setColorAt( 1, color ); //QColor( Qt::darkYellow ).light( 120 ) );
......
......@@ -329,7 +329,7 @@ void WTransferFunctionWidget::keyPressEvent( QKeyEvent *event )
WTransferFunctionPoint *next = 0;
if( current->getLeft() && current->getLeft()->getLeft( ) )
next = current->getLeft();
else if ( current->getRight() && current->getRight()->getRight() )
else if( current->getRight() && current->getRight()->getRight() )
next = current->getRight();
current->getLeft()->setRight( current->getRight() );
......@@ -346,7 +346,7 @@ void WTransferFunctionWidget::keyPressEvent( QKeyEvent *event )
WTransferFunctionColorPoint *next = 0;
if( ccurrent->getLeft() && ccurrent->getLeft()->getLeft( ) )
next = ccurrent->getLeft();
else if ( ccurrent->getRight() && ccurrent->getRight()->getRight() )
else if( ccurrent->getRight() && ccurrent->getRight()->getRight() )
next = ccurrent->getRight();
ccurrent->getLeft()->setRight( ccurrent->getRight() );
......
......@@ -1881,7 +1881,7 @@ def CheckSpacing(filename, clean_lines, linenum, error):
# A pet peeve of mine: no spaces after an if, while, switch, or for
# math: Modified for exact opposite behaviour, we don't want spaces before the braces
match = Search(r'(if|for|while|switch) \(', line)
match = Search(r'^\s*(else if|if|for|while|switch) \(', line)
if match:
error(filename, linenum, 'whitespace/parens', 5,
'Extra space before ( in %s' % match.group(1))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment