<div dir="ltr">Hi Quentan,<div><br></div><div>Can you try to add <i>vtkRenderingContextOpenGL </i>in <i>VTK_LIBRARIES </i>within the if block <i>IF (${CTK_USE_CHARTS}) </i>?</div><div><a href="https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/CMakeLists.txt#L160">https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/CMakeLists.txt#L160</a><br></div><div><br></div><div>Thanks,</div><div>Julien.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 2, 2015 at 2:10 PM, Quentan Qi <span dir="ltr"><<a href="mailto:quentan@gmail.com" target="_blank">quentan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Dear Community Members,<div><br></div><div>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><br></div><div>The test application `ctkVTKVolumePropertyWidgetTest1` of `/CTKBuild/CTK-build/bin/CTKVisualizationVTKWidgetsCppTests`receives the same error.</div><div><br></div><div><a href="http://marc.info/?l=vtk-developers&m=140685424721837&w=2" target="_blank">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><br></div><div><br></div><div>### CTK build options, using the latest CTK fork 02-Apr-2015</div><div>```</div><div>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>```</div><div><br></div><div>> 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><br></div><div>### `CMakeLists.txt`</div><div>```</div><div>cmake_minimum_required(VERSION 3.1)<br><br>project(TEST_VTK_CTK)<br><br>set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")<br><br>find_package(CTK REQUIRED)<br>include(${CTK_USE_FILE})<br><br>#find_package(ITK REQUIRED)<br>#include(${ITK_USE_FILE})<br><br>find_package(VTK REQUIRED)<br>include(${VTK_USE_FILE})<br><br>find_package(Qt4 REQUIRED)<br>include(${QT_USE_FILE})<br><br>set(SOURCE_FILES_6 PlayGround.cxx)<br>add_executable(Test6 MACOSX_BUNDLE ${SOURCE_FILES_6})<br>target_link_libraries(Test6 ${CTK_LIBRARIES} ${VTK_LIBRARIES})</div><div>```</div><div><br></div><div>### Source file</div><div>```</div><div>// Qt includes<br>#include <QApplication><br><br>// CTK-VTK includes<br>#include "ctkVTKVolumePropertyWidget.h"<br><br>// VTK includes<br>#include <vtkColorTransferFunction.h><br>#include <vtkPiecewiseFunction.h><br>#include <vtkSmartPointer.h><br>#include <vtkVolumeProperty.h><br><br>// STD includes<br>#include <iostream><br><br>//-----------------------------------------------------------------------------<br>int main(int argc, char * argv [] ) {<br><br>    QApplication app(argc, argv);<br><br>    vtkSmartPointer<vtkColorTransferFunction> ctf =<br>            vtkSmartPointer<vtkColorTransferFunction>::New();<br>    ctf->AddRGBPoint(0.2, 0.6941,0.76,0., 0.5, 0.);<br>    ctf->AddRGBPoint(0.4, 0.,0.6941,0.96);<br>    ctf->AddRGBPoint(0.8, 0.9686,0.76,0.);<br><br>    vtkSmartPointer<vtkPiecewiseFunction> otf =<br>            vtkSmartPointer<vtkPiecewiseFunction>::New();<br>    otf->AddPoint(0.2, 0.6941);<br>    otf->AddPoint(0.4, 0.641);<br>    otf->AddPoint(0.8, 0.9686);<br><br>    vtkSmartPointer<vtkPiecewiseFunction> otf2 =<br>            vtkSmartPointer<vtkPiecewiseFunction>::New();<br>    otf2->AddPoint(0.0, 0.6941);<br>    otf2->AddPoint(0.1, 0.641);<br>    otf2->AddPoint(0.7, 0.9686);<br><br>    vtkSmartPointer<vtkVolumeProperty> volumeProperty =<br>            vtkSmartPointer<vtkVolumeProperty>::New();<br>    volumeProperty->SetColor(ctf);<br>    volumeProperty->SetScalarOpacity(otf);<br>    double range[2] = {0., 1.};<br>    volumeProperty->GetGradientOpacity()->AdjustRange(range);<br><br>    ctkVTKVolumePropertyWidget widget;<br>//    widget.setUseThresholdSlider(true);<br>    widget.setVolumeProperty(volumeProperty);<br><br>    volumeProperty->SetScalarOpacity(otf2);<br><br>    widget.moveAllPoints(0.1, -0.1);<br>    widget.moveAllPoints(-0.1, 0.1);<br><br>    widget.show();<br><br>    return app.exec();<br>}</div><div>```</div><div><br></div><div>This is an example from `<a href="https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKVolumePropertyWidgetTest1.cpp%60" target="_blank">https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKVolumePropertyWidgetTest1.cpp`</a>.</div><div><br></div><div>### Running error info (No compiling error)</div><div>```</div><div><div>Generic Warning: In /Develop/VTK/VTKSource-6.2.0/Rendering/Context2D/vtkContextDevice2D.cxx, line 27</div><div>Error: no override found for 'vtkContextDevice2D'.</div><div><br></div><div><br></div><div>Process finished with exit code 11</div></div><div>```</div><div><br></div><div>Cheers,</div><div>Quentan</div></div><br>_______________________________________________<br>
Ctk-developers mailing list<br>
<a href="mailto:Ctk-developers@public.kitware.com">Ctk-developers@public.kitware.com</a><br>
<a href="http://public.kitware.com/mailman/listinfo/ctk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/ctk-developers</a><br>
<br></blockquote></div><br></div>