[vtkusers] Volume Rendering in VTK 5.0

Runar Lyngset runarylv at stud.ntnu.no
Tue May 16 09:14:50 EDT 2006


Thanks for your quick response

In what CMakeList.txt file is the TARGET_LINK_LIBRARIES supposed to 
contain vtkVolumeRendering?
I find this in VTK\VolumeRendering\Test\Cxx\CMakeList.txt:   
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkVolumeRendering).  CMakeList.txt 
in VolumeRendering does not have a TARGET_LINK_LIBRARIES tag.

Here are the code snippet and linking error message:
_______________________________________________________________
    vtkStructuredPointsReader *reader = vtkStructuredPointsReader::New();
    reader->SetFileName(QFileDialog::getOpenFileName("", "*.slc"));

    vtkPiecewiseFunction *opacityTransferFunction = 
vtkPiecewiseFunction::New();
    opacityTransferFunction->AddPoint(20,0.0);
    opacityTransferFunction->AddPoint(255, 0.2);

    vtkColorTransferFunction *colorTransferFunction = 
vtkColorTransferFunction::New();
    colorTransferFunction->AddRGBPoint(0.0,0.0,0.0,0.0);
    colorTransferFunction->AddRGBPoint(64.0,1.0,0.0,0.0);
    colorTransferFunction->AddRGBPoint(128.0,0.0,0.0,1.0);
    colorTransferFunction->AddRGBPoint(192.0,0.0,1.0,0.0);
    colorTransferFunction->AddRGBPoint(255.0,0.0,0.2,0.0);

    vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();
    volumeProperty->SetColor(colorTransferFunction);
    volumeProperty->SetScalarOpacity(opacityTransferFunction);

    vtkVolumeRayCastCompositeFunction *compositeFunction = 
vtkVolumeRayCastCompositeFunction::New();
    vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();
    volumeMapper->SetVolumeRayCastFunction(compositeFunction);
    
volumeMapper->SetInput(reinterpret_cast<vtkImageData*>(reader->GetOutput()));

    vtkVolume *volume = vtkVolume::New();
    volume->SetMapper(volumeMapper);
    volume->SetProperty(volumeProperty);
    
    ren->AddVolume(volume);
_________________________________________

Linking...
vmainview.obj : error LNK2019: unresolved external symbol "public: 
static class vtkVolumeRayCastMapper * __cdecl 
vtkVolumeRayCastMapper::New(void)" 
(?New at vtkVolumeRayCastMapper@@SAPAV1 at XZ) referenced in function "public: 
virtual void __thiscall VMainView::fileOpen(void)" 
(?fileOpen at VMainView@@UAEXXZ)
vmainview.obj : error LNK2019: unresolved external symbol "public: 
static class vtkVolumeRayCastCompositeFunction * __cdecl 
vtkVolumeRayCastCompositeFunction::New(void)" 
(?New at vtkVolumeRayCastCompositeFunction@@SAPAV1 at XZ) referenced in 
function "public: virtual void __thiscall VMainView::fileOpen(void)" 
(?fileOpen at VMainView@@UAEXXZ)
Debug\visualizationapp.exe : fatal error LNK1120: 2 unresolved externals
__________________________________________





More information about the vtkusers mailing list