Commit a7a2b881 authored by Jean-Loup Haberbusch's avatar Jean-Loup Haberbusch

Merge branch 'hotfix-4.0.1'

parents 3249431f 334e6fd5
......@@ -16,7 +16,7 @@ set(CAMITK_PROJECT_NAME "CamiTK")
set(CAMITK_VERSION_MAJOR "4")
set(CAMITK_VERSION_MINOR "0")
set(CAMITK_VER_NICKNAME "red") # Red Amaranth American rose Auburn Burgundy Cardinal Carmine Carnelian Cerise Coquelicot
set(CAMITK_VERSION_PATCH "0") # patch version for packaging, change when appropriate
set(CAMITK_VERSION_PATCH "1") # patch version for packaging, change when appropriate
string(TOLOWER "${CAMITK_PROJECT_NAME}-${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}" CAMITK_SHORT_VERSION_STRING)
# Specific to SDK: this is the SDK build
......
......@@ -23,13 +23,13 @@
* $CAMITK_LICENCE_END$
****************************************************************************/
// CamiTK stuff
#include <Action.h>
#include <InteractiveViewer.h>
#include <Log.h>
#include <Geometry.h>
#include <Property.h>
#include <Application.h>
#include <InteractiveViewer.h>
#include <AbortException.h>
#include <Action.h>
#include "PMLComponent.h"
// Qt stuff
......
......@@ -86,7 +86,7 @@ Action::ApplyStatus AboutAction::apply() {
+ QString(Core::version) + "<br/>"
+ "VTK: " + QString(vtkVersion::GetVTKVersion()) + " - Qt: " + QString(qVersion()) + "<br/><br/>"
+ tr("Please visit <a href='http://camitk.imag.fr'>camitk.imag.fr</a> for more information.<br/>")
+ tr("(c) UGA-Grenoble 1, CNRS, TIMC-IMAG UMR 5525"));
+ tr("(c) Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525"));
// get the proper text height
text->adjustSize();
......
......@@ -17,6 +17,6 @@ set(SHIBOKEN_CAMITK_SDK_PATH ${SHIBOKEN_CAMITK_SDK_PATH}:${CMAKE_CURRENT_SOURCE_
# a fail to a pass
# This is needed until there is a way to automatically add input ROI without a widget
# and launch the action with this input from the test environment
if(NOT PACKAGING_NSIS)
if(NOT PACKAGING_NSIS AND BUILD_TESTING)
set_tests_properties("action-cropvolume-LEVEL1-15" PROPERTIES WILL_FAIL true)
endif()
......@@ -11,6 +11,6 @@ camitk_extension( ACTION_EXTENSION
# As the Reorient image action, when applied, needs its dialog box initialized, it cannot
# pass this test.
# Remove when action reorient image has been updated consequently
if(NOT PACKAGING_NSIS)
if(NOT PACKAGING_NSIS AND BUILD_TESTING)
set_tests_properties("action-reorientimage-LEVEL1-15" PROPERTIES WILL_FAIL true)
endif()
\ No newline at end of file
......@@ -199,7 +199,7 @@ Action::ApplyStatus RigidTransform::apply() {
comp->setModified();
} else {
CAMITK_INFO("RigidTransform", "applyTransform", "Error: filter output is of type: " << filterList[i]->GetOutputDataObject(0)->GetClassName());
return ERROR;
return ABORTED;
}
// next filter
i++;
......
......@@ -18,7 +18,7 @@ set(SHIBOKEN_CAMITK_SDK_PATH ${SHIBOKEN_CAMITK_SDK_PATH}:${CMAKE_CURRENT_SOURCE_
# a fail to a pass
# This is needed until there is a way to tell testaction that this action
# needs two mesh in input
if(NOT PACKAGING_NSIS)
if(NOT PACKAGING_NSIS AND BUILD_TESTING)
set_tests_properties("action-meshprocessing-LEVEL1-19" PROPERTIES WILL_FAIL true)
set_tests_properties("action-meshprocessing-LEVEL1-21" PROPERTIES WILL_FAIL true)
endif()
\ No newline at end of file
......@@ -37,7 +37,6 @@
// -- CamiTK Core stuff
#include <MainWindow.h>
#include <InteractiveViewer.h>
#include <Application.h>
#include <MedicalImageViewer.h>
#include <Core.h>
......
......@@ -30,6 +30,7 @@
#include <Application.h>
#include <ExtensionManager.h>
#include <MedicalImageViewer.h>
#include <ActionViewer.h>
#include <SettingsDialog.h>
#include <Component.h>
#include <Action.h>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -524,7 +524,7 @@ macro(camitk_extension)
# 5th DEPENDENCY ON TESTING APPLICATION
# Those projects are used to run unitarian test on ACTION / COMPONENT extensions.
set(APPLICATIONS_DEPENDENCY_LIST "")
if(${EXTENSION_NAME_CMAKE}_TEST_APPLICATION AND NOT PACKAGING_NSIS)
if(${EXTENSION_NAME_CMAKE}_TEST_APPLICATION AND NOT PACKAGING_NSIS AND BUILD_TESTING)
# Add this dependencies for automatically constructing application-testactions components dependencies
add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} application-test${TYPE_EXTENSION}s)
set(APPLICATIONS_DEPENDENCY_LIST "application-test${TYPE_EXTENSION}s")
......@@ -534,14 +534,14 @@ macro(camitk_extension)
if((CEP_NAME STREQUAL "SDK") OR (CEP_NAME STREQUAL "modeling") OR (CEP_NAME STREQUAL "imaging"))
# 6th TEST-COMPONENT APPLICATION DEPENDENCY ON THIS COMPONENT
if(${EXTENSION_NAME_CMAKE}_COMPONENT_EXTENSION AND ${EXTENSION_NAME_CMAKE}_TEST_APPLICATION AND NOT PACKAGING_NSIS)
if(${EXTENSION_NAME_CMAKE}_COMPONENT_EXTENSION AND ${EXTENSION_NAME_CMAKE}_TEST_APPLICATION AND NOT PACKAGING_NSIS AND BUILD_TESTING)
add_dependencies(application-testactions ${COMPONENT_TARGET_NAME})
# add this component automoc target to the dependency of the test application
set_property(TARGET application-testactions APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${COMPONENT_TARGET_NAME})
endif()
# 7th TEST-ACTION APPLICATION DEPENDENCY ON ACTION-APPLICATION
if(${TYPE_EXTENSION_CMAKE}_TARGET_NAME STREQUAL "action-application")
if(${TYPE_EXTENSION_CMAKE}_TARGET_NAME STREQUAL "action-application" AND BUILD_TESTING)
add_dependencies(application-testcomponents action-application)
# add this component automoc target to the dependency of the test application
set_property(TARGET application-testcomponents APPEND PROPERTY AUTOGEN_TARGET_DEPENDS action-application)
......@@ -847,7 +847,7 @@ macro(camitk_extension)
# CTEST - COMPONENT TESTS DESCRIPTION #
# #
#########################################################################
if( ${EXTENSION_NAME_CMAKE}_COMPONENT_EXTENSION AND ${EXTENSION_NAME_CMAKE}_TEST_APPLICATION AND NOT PACKAGING_NSIS)
if( ${EXTENSION_NAME_CMAKE}_COMPONENT_EXTENSION AND ${EXTENSION_NAME_CMAKE}_TEST_APPLICATION AND NOT PACKAGING_NSIS AND BUILD_TESTING)
camitk_init_test( ${${EXTENSION_NAME_CMAKE}_TEST_APPLICATION} )
camitk_parse_test_add_separator(EXTENSION_TYPE ${TYPE_EXTENSION} EXTENSION_NAME ${EXTENSION_NAME})
......
......@@ -35,7 +35,6 @@
#include <QWidget>
#include <QString>
#include <QAction>
#include <signal.h>
namespace camitk {
......
......@@ -24,12 +24,12 @@
****************************************************************************/
// -- Core stuff
#include "Action.h"
#include "RendererWidget.h"
#include "InteractiveViewer.h"
#include "SliderSpinBoxWidget.h"
#include "Application.h"
#include "Log.h"
#include "Action.h"
#include "MeshComponent.h"
#include "PropertyObject.h"
......
......@@ -24,10 +24,10 @@
****************************************************************************/
// -- Core stuff
#include "Action.h"
#include "MedicalImageViewer.h"
#include "InteractiveViewer.h"
#include "Application.h"
#include "Action.h"
//-- Qt stuff
#include <QColorDialog>
......
......@@ -26,6 +26,7 @@
// -- Core stuff
#include "Application.h"
#include "PropertyExplorer.h"
#include "Component.h"
// -- QT stuff
#include <QVBoxLayout>
......
......@@ -28,7 +28,6 @@
// -- Core stuff
#include "Viewer.h"
#include "ObjectController.h"
#include "ActionViewer.h"
#include "PropertyObject.h"
// -- QT stuff
......
......@@ -33,6 +33,8 @@
#include <QKeyEvent>
#include <QFileInfo>
#include <QCursor>
#include <QProcessEnvironment>
#include <QOpenGLContext>
// -- VTK stuff
#include <vtkObjectFactory.h>
......@@ -362,7 +364,7 @@ void vtkInteractorStylePick::PrintSelf ( ostream& os, vtkIndent indent ) {
QMap <RendererWidget::ScreenshotFormat , RendererWidget::ScreenshotFormatInfo*> screenshotMap;
//---------------------- Constructor ------------------------
RendererWidget::RendererWidget(QWidget* parent, ControlMode mode) : QVTKWidget(parent) {
RendererWidget::RendererWidget(QWidget* parent, ControlMode mode) : QVTKWidget2(parent) {
setObjectName( "RendererWidget" );
//-- initialize screenshotMap only at the first invocation of constructor
......@@ -379,7 +381,65 @@ RendererWidget::RendererWidget(QWidget* parent, ControlMode mode) : QVTKWidget(p
policy.setHeightForWidth(false);
setSizePolicy(policy);
//-- display options (this is not a state manage by the renderer, but a property of the actors
//-- OpenGL context on integrated card
// For more information about this problem
// see https://bugzilla-timc.imag.fr/show_bug.cgi?id=181
// Description of the bugfix:
// In order to make it work on integrated cards as well as on GPU (using primusrun
// see below for optirun), RendererWidget is now inheriting from QVTKWidget2 (which
// in turns inherits from QGLWidget, which is deprecated...)
//
// Unfortunately this trigger another bug where, although everything is alright
// when running on the GPU (using primusrun), it does not work on the integrated card.
//
// To make it work on both, the OpenGL format has to be reinitialized.
//
// This might lead to performance issue (not investigated). If this is the case,
// set the environment variable CAMITK_NO_OPENGL_RESET to 1.
// For instance:
// CAMITK_NO_OPENGL_RESET=1 primusrun bin/camitk-imp
// or
// CAMITK_NO_OPENGL_RESET=1 bin/camitk-imp
//
// If the CAMITK_NO_OPENGL_RESET environment variable is set to 1, then the OpenGL context will not be
// reset.
// Note for bumblebee users on Linux:
// There is a bug in bumblebee/optirun, see https://bugreports.qt.io/browse/QTBUG-33258
// you need to use primusrun (which is also the bumblebee developer team recommendation)
/*
qDebug() << "------------------------ OpenGL information -------------------------" ;
qDebug() << "OpenGL Versions Supported: " << QGLFormat::openGLVersionFlags() ;
qDebug() << "Current format:" << format();
qDebug() << "Context valid: " << context()->isValid() ;
qDebug() << "Direct rendering: " << context()->format().directRendering();
qDebug() << "Context OpenGL Version: " << context()->format().majorVersion() << "." << context()->format().minorVersion() ;
qDebug() << "Vendor: " << (const char*)glGetString(GL_VENDOR);
qDebug() << "Renderer: " << (const char*)glGetString(GL_RENDERER);
qDebug() << "Version: " << (const char*)glGetString(GL_VERSION) ;
qDebug() << "GLSL version: " << (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION) ;
qDebug() << "---------------------------------------------------------------------\n";
*/
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
bool resetOpenGL = true;
if (env.contains("CAMITK_NO_OPENGL_RESET") && env.value("CAMITK_NO_OPENGL_RESET") == "1") {
CAMITK_INFO("RendererWidget", "constructor", "CAMITK_NO_OPENGL_RESET on: QGLFormat is not reset\n");
resetOpenGL = false;
}
if (resetOpenGL) {
// recreate a format, using some default from the current context
QGLFormat newFormat;
newFormat.setProfile(context()->format().profile());
newFormat.setDepthBufferSize(context()->format().depthBufferSize());
newFormat.setStencilBufferSize(context()->format().stencilBufferSize());
context()->setFormat(newFormat);
}
//-- display options (this is not a state managed by the renderer, but a property of the actors)
backfaceCulling = false;
displayCopyright = true;
rendering3DRedBlue = false;
......@@ -1263,13 +1323,13 @@ void RendererWidget::mousePressEvent ( QMouseEvent* event ) {
if ( event->button() == Qt::RightButton ) {
emit rightButtonPressed();
}
QVTKWidget::mousePressEvent ( event );
QVTKWidget2::mousePressEvent ( event );
}
}
//--------------------- mouseReleaseEvent ----------------------------------
void RendererWidget::mouseReleaseEvent(QMouseEvent* event) {
QVTKWidget::mouseReleaseEvent ( event );
QVTKWidget2::mouseReleaseEvent ( event );
endPicking();
}
......@@ -1309,7 +1369,7 @@ void RendererWidget::mouseMoveEvent(QMouseEvent* event) {
// just keep the button pressed
//pick();
}
QVTKWidget::mouseMoveEvent(event);
QVTKWidget2::mouseMoveEvent(event);
}
......
......@@ -30,10 +30,14 @@
#include "CamiTKAPI.h"
// -- VTK stuff
#include <QVTKWidget.h>
#include <QVTKWidget2.h>
#include <vtkSmartPointer.h>
#include <vtkInteractorStyle.h>
// additional needed headers for QVTKWidget2
#include <vtkGenericOpenGLRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <QVTKInteractor.h>
// -- VTK stuff classes
class vtkRenderer;
class vtkInteractorStyle;
......@@ -112,14 +116,14 @@ namespace camitk{
*
* The Core companion class is InteractiveViewer (which delegates all vtk stuff to RendererWidget.
*
* It is directly based on QVTKWidget, the GUI support class available in Vtk version >= 5.0
* It is directly based on QVTKWidget2, the GUI support class available in Vtk version >= 5.0
* This is a pure Qt/vtk wrapper class (no Core stuff).
*
* For developers: please check the coding policy in InteractiveViewer API documentation first.
*
*
**/
class CAMITK_API RendererWidget : public QVTKWidget {
class CAMITK_API RendererWidget : public QVTKWidget2 {
Q_OBJECT
Q_ENUMS(ControlMode CameraOrientation); // so that it can be used in property editor
......
......@@ -26,10 +26,10 @@
// -- Core stuff
#include <Application.h>
#include <MainWindow.h>
#include <Action.h>
#include <InteractiveViewer.h>
#include <Core.h>
#include <ExtensionManager.h>
#include <Action.h>
using namespace camitk;
......
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