<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear Community Members,<div class=""><br class=""></div><div class="">I’m now using CTK for VTK UI design, and want to use its `ctkVTKVolumePropertyWidget` widget, but received `no override found for 'vtkContextDevice2D’.` error. </div><div class=""><br class=""></div><div class="">The test application `ctkVTKVolumePropertyWidgetTest1` of `/CTKBuild/CTK-build/bin/CTKVisualizationVTKWidgetsCppTests`receives the same error.</div><div class=""><br class=""></div><div class=""><a href="http://marc.info/?l=vtk-developers&m=140685424721837&w=2" class="">A mail list</a> explains this error of the OpenGL override moving from `vtkContextDevice2D` to `Rendering/ContextOpenGL`, but I have no idea how to split it. Is there any detailed solution?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">### CTK build options, using the latest CTK fork 02-Apr-2015</div><div class="">```</div><div class="">cmake -DCMAKE_MACOSX_RPATH:BOOL=OFF -DCMAKE_INSTALL_PREFIX:STRING=/usr/local/ctk -DCMAKE_BUILD_TYPE:STRING=Release -DCTK_ENABLE_Widgets:BOOL=ON -DCTK_LIB_Visualization/VTK/Widgets:BOOL=ON -DVTK_DIR:PATH=/usr/local/vtk/lib/cmake/vtk-6.2 -DCTK_BUILD_EXAMPLES:BOOL=ON -DCTK_LIB_ImageProcessing/ITK/Core:BOOL=ON -DITK_DIR:PATH=/usr/local/itk/lib/cmake/ITK-4.7 -DCTK_LIB_Visualization/VTK/Widgets_USE_TRANSFER_FUNCTION_CHARTS:BOOL=ON ../CTKSource</div><div class="">```</div><div class=""><br class=""></div><div class="">> Note: I used `-DCTK_LIB_Visualization/VTK/Widgets_USE_TRANSFER_FUNCTION_CHARTS:BOOL=ON` flag for volume transfer function widget. It is right?</div><div class=""><br class=""></div><div class="">### `CMakeLists.txt`</div><div class="">```</div><div class="">cmake_minimum_required(VERSION 3.1)<br class=""><br class="">project(TEST_VTK_CTK)<br class=""><br class="">set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")<br class=""><br class="">find_package(CTK REQUIRED)<br class="">include(${CTK_USE_FILE})<br class=""><br class="">#find_package(ITK REQUIRED)<br class="">#include(${ITK_USE_FILE})<br class=""><br class="">find_package(VTK REQUIRED)<br class="">include(${VTK_USE_FILE})<br class=""><br class="">find_package(Qt4 REQUIRED)<br class="">include(${QT_USE_FILE})<br class=""><br class="">set(SOURCE_FILES_6 PlayGround.cxx)<br class="">add_executable(Test6 MACOSX_BUNDLE ${SOURCE_FILES_6})<br class="">target_link_libraries(Test6 ${CTK_LIBRARIES} ${VTK_LIBRARIES})</div><div class="">```</div><div class=""><br class=""></div><div class="">### Source file</div><div class="">```</div><div class="">// Qt includes<br class="">#include <QApplication><br class=""><br class="">// CTK-VTK includes<br class="">#include "ctkVTKVolumePropertyWidget.h"<br class=""><br class="">// VTK includes<br class="">#include <vtkColorTransferFunction.h><br class="">#include <vtkPiecewiseFunction.h><br class="">#include <vtkSmartPointer.h><br class="">#include <vtkVolumeProperty.h><br class=""><br class="">// STD includes<br class="">#include <iostream><br class=""><br class="">//-----------------------------------------------------------------------------<br class="">int main(int argc, char * argv [] ) {<br class=""><br class="">    QApplication app(argc, argv);<br class=""><br class="">    vtkSmartPointer<vtkColorTransferFunction> ctf =<br class="">            vtkSmartPointer<vtkColorTransferFunction>::New();<br class="">    ctf->AddRGBPoint(0.2, 0.6941,0.76,0., 0.5, 0.);<br class="">    ctf->AddRGBPoint(0.4, 0.,0.6941,0.96);<br class="">    ctf->AddRGBPoint(0.8, 0.9686,0.76,0.);<br class=""><br class="">    vtkSmartPointer<vtkPiecewiseFunction> otf =<br class="">            vtkSmartPointer<vtkPiecewiseFunction>::New();<br class="">    otf->AddPoint(0.2, 0.6941);<br class="">    otf->AddPoint(0.4, 0.641);<br class="">    otf->AddPoint(0.8, 0.9686);<br class=""><br class="">    vtkSmartPointer<vtkPiecewiseFunction> otf2 =<br class="">            vtkSmartPointer<vtkPiecewiseFunction>::New();<br class="">    otf2->AddPoint(0.0, 0.6941);<br class="">    otf2->AddPoint(0.1, 0.641);<br class="">    otf2->AddPoint(0.7, 0.9686);<br class=""><br class="">    vtkSmartPointer<vtkVolumeProperty> volumeProperty =<br class="">            vtkSmartPointer<vtkVolumeProperty>::New();<br class="">    volumeProperty->SetColor(ctf);<br class="">    volumeProperty->SetScalarOpacity(otf);<br class="">    double range[2] = {0., 1.};<br class="">    volumeProperty->GetGradientOpacity()->AdjustRange(range);<br class=""><br class="">    ctkVTKVolumePropertyWidget widget;<br class="">//    widget.setUseThresholdSlider(true);<br class="">    widget.setVolumeProperty(volumeProperty);<br class=""><br class="">    volumeProperty->SetScalarOpacity(otf2);<br class=""><br class="">    widget.moveAllPoints(0.1, -0.1);<br class="">    widget.moveAllPoints(-0.1, 0.1);<br class=""><br class="">    widget.show();<br class=""><br class="">    return app.exec();<br class="">}</div><div class="">```</div><div class=""><br class=""></div><div class="">This is an example from `<a href="https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKVolumePropertyWidgetTest1.cpp%60" class="">https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKVolumePropertyWidgetTest1.cpp`</a>.</div><div class=""><br class=""></div><div class="">### Running error info (No compiling error)</div><div class="">```</div><div class=""><div class="">Generic Warning: In /Develop/VTK/VTKSource-6.2.0/Rendering/Context2D/vtkContextDevice2D.cxx, line 27</div><div class="">Error: no override found for 'vtkContextDevice2D'.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Process finished with exit code 11</div></div><div class="">```</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Quentan</div></body></html>