Commit b3711f66 authored by Guillaume Pasero's avatar Guillaume Pasero

STYLE: remove commented code

Conflicts:
	Modules/Visualization/MonteverdiGui/src/mvdImageViewRenderer.cxx
parent 90b391db
......@@ -28,10 +28,6 @@ VertexArrayObjectPolicy
::Generate( Id_t & id )
{
glGenVertexArrays( 1, &id );
#if OTB_DEBUG
std::cout << "glGenVertexArrays() -> " << id << std::endl;
#endif
}
......@@ -47,10 +43,6 @@ void
VertexArrayObjectPolicy
::Release( Id_t & id )
{
#if OTB_DEBUG
std::cout << "glDeleteArrays( " << id << " )" << std::endl;
#endif
glDeleteVertexArrays( 1, &id );
}
......
......@@ -245,13 +245,6 @@ GlView
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// std::cout
// << "glOrtho( "
// << ulx << ", " << lrx << ", "
// << lry << ", " << uly
// << ", -1, 1 )"
// << std::endl;
glOrtho(ulx, lrx, lry, uly, -1, 1);
glMatrixMode(GL_MODELVIEW);
......@@ -559,11 +552,11 @@ GlView
if( glGetError()!=GL_NO_ERROR )
throw std::runtime_error(
std::string(
reinterpret_cast< const char * >(
gluErrorString(
glGetError()
)
)
reinterpret_cast< const char * >(
gluErrorString(
glGetError()
)
)
)
);
......@@ -591,11 +584,11 @@ GlView
if( glGetError()!=GL_NO_ERROR )
throw std::runtime_error(
std::string(
reinterpret_cast< const char * >(
gluErrorString(
glGetError()
)
)
reinterpret_cast< const char * >(
gluErrorString(
glGetError()
)
)
)
);
......@@ -654,10 +647,4 @@ GlView
// itkBuffer = NULL;
}
//~ m_Settings->m_VertexShader = vShader;
//~ m_Settings->m_TextureCoordIdx = glGetAttribLocation(m_VertexProgram , "in_coord");
}
......@@ -66,18 +66,7 @@ void Shader::UnloadShader()
void Shader::SetupShader()
{
// // Default always report corners
// GLint shader_ul = glGetUniformLocation(otb::ShaderRegistry::Instance()->GetShaderProgram("StandardShader"), "shader_ul");
// glUniform2f(shader_ul,m_UL[0],m_UL[1]);
// GLint shader_ur = glGetUniformLocation(otb::ShaderRegistry::Instance()->GetShaderProgram("StandardShader"), "shader_ur");
// glUniform2f(shader_ur,m_UR[0],m_UR[1]);
// GLint shader_ll = glGetUniformLocation(otb::ShaderRegistry::Instance()->GetShaderProgram("StandardShader"), "shader_ll");
// glUniform2f(shader_ll,m_LL[0],m_LL[1]);
// GLint shader_lr = glGetUniformLocation(otb::ShaderRegistry::Instance()->GetShaderProgram("StandardShader"), "shader_lr");
// glUniform2f(shader_lr,m_LR[0],m_LR[1]);
// Default does nothing
}
const std::vector<int> &
......
......@@ -415,7 +415,6 @@ private:
/**
*/
// bool m_isGLSLAvailable : 1;
bool m_ForceNoGLSL : 1;
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
......
......@@ -233,9 +233,6 @@ int main(int argc, char* argv[])
//
// 6. Let's go: run the application and return exit code.
#if OTB_DEBUG
std::cout << "QCoreApplication::instance()->exec();" << std::endl;
#endif
int result = QCoreApplication::instance()->exec();
// Coverity-14835
......
......@@ -225,10 +225,6 @@ bool MainWindow::CheckGLCapabilities(bool forceNoGLSL)
/*****************************************************************************/
void MainWindow::SetGLSLEnabled(bool enabled)
{
#if OTB_DEBUG
std::cout << "MainWindow::SetGLSLEnabled( " << enabled << " )" << std::endl;
#endif
//
// Image view
assert( m_ImageView );
......@@ -1204,7 +1200,7 @@ void MainWindow::on_action_GLSL_triggered(bool checked)
{
// qDebug() << this << "::on_action_GLSL_triggered(" << checked << ")";
SetGLSLEnabled( /* m_isGLSLAvailable && !m_ForceNoGLSL && */ checked );
SetGLSLEnabled(checked);
}
/*****************************************************************************/
......
......@@ -188,7 +188,13 @@ ImageViewRenderer
//
// Construct message.
QString message(
tr( "Current OpenGL version is '%1' supporting OpenGL Shading-Language (GLSL) version '%2'.\nTo run at best performances, this application needs, at least, OpenGL version '%3' with GLSL version '%4'.\nThe application will automatically switch to a rendering mode which does not make use of OpenGL shaders and GLSL.\nIf you are running this application under some remote-desktop service, runtime OpenGL and GLSL versions may differ from those running directly on remote platform." )
tr( "Current OpenGL version is '%1' supporting OpenGL Shading-Language "
"(GLSL) version '%2'.\nTo run at best performances, this application "
"needs, at least, OpenGL version '%3' with GLSL version '%4'.\nThe "
"application will automatically switch to a rendering mode which does "
"not make use of OpenGL shaders and GLSL.\nIf you are running this "
"application under some remote-desktop service, runtime OpenGL and GLSL "
"versions may differ from those running directly on remote platform." )
.arg( glVersion )
.arg( glslVersion )
.arg( otb::GlVersionChecker::REQUIRED_GL_VERSION )
......@@ -870,12 +876,12 @@ void ImageViewRenderer::virtual_UpdateScene()
// << "\tQString:" << vectorImageModel->GetFilename()
// << "\tstd::string" << QFile::encodeName( vectorImageModel->GetFilename() );
if( IsGLSLEnabled() )
{
// qDebug() << "Created shader for" << FromStdString( it->first );
glImageActor->CreateShader();
}
if(IsGLSLEnabled())
{
// qDebug() << "Created shader for" << FromStdString( it->first );
glImageActor->CreateShader();
}
glImageActor->Initialize(
QFile::encodeName(
......@@ -892,9 +898,9 @@ void ImageViewRenderer::virtual_UpdateScene()
// .arg( vectorImageModel->GetFilename() );
}
else
{
assert( false && "Unhandled AbstractLayerModel derived type." );
}
{
assert(false && "Unhandled AbstractLayerModel derived type.");
}
}
#endif // USE_REMOTE_DESKTOP_DISABLED_RENDERING
......@@ -1101,42 +1107,41 @@ void ImageViewRenderer::UpdatePixelInfo(const QPoint& screen, const PointType& /
// Get shader.
otb::Shader::Pointer ishader( glImageActor->GetShader() );
if( !ishader.IsNull() )
{
otb::StandardShader::Pointer shader(
otb::DynamicCast< otb::StandardShader >(
ishader
)
);
assert( !shader.IsNull() );
//
// Update cursor position of shader.
PointType p_screen;
assert( m_GlView->GetSettings()!=NULL );
p_screen[ 0 ] = screen.x();
p_screen[ 1 ] =
m_GlView->GetSettings()->GetViewportSize()[ 1 ] - screen.y();
// qDebug()
// << "otb::StandardShader::SetCenter("
// << p_screen[ 0 ] << "," << p_screen[ 1 ]
// << ")";
shader->SetCenter( p_screen );
if( shader->GetShaderType()==otb::SHADER_ALPHA_SLIDER )
shader->SetSliderPosition(
p_screen[
shader->GetVerticalSlider()
? 1
: 0
]
);
}
if(!ishader.IsNull())
{
otb::StandardShader::Pointer shader(
otb::DynamicCast< otb::StandardShader >(
ishader
)
);
assert( !shader.IsNull() );
//
// Update cursor position of shader.
PointType p_screen;
assert( m_GlView->GetSettings()!=NULL );
p_screen[ 0 ] = screen.x();
p_screen[ 1 ] =
m_GlView->GetSettings()->GetViewportSize()[ 1 ] - screen.y();
// qDebug()
// << "otb::StandardShader::SetCenter("
// << p_screen[ 0 ] << "," << p_screen[ 1 ]
// << ")";
shader->SetCenter( p_screen );
if( shader->GetShaderType()==otb::SHADER_ALPHA_SLIDER )
shader->SetSliderPosition(
p_screen[
shader->GetVerticalSlider()
? 1
: 0
]
);
}
}
}
......
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