[vtkusers] vtkOutlineFilte Problem

Amy Henderson amy.henderson at kitware.com
Tue Mar 2 09:49:24 EST 2004


At 11:42 PM 3/1/2004, Everette W. Sperling wrote:
>I am trying to visualize some vector data using Visual C++ with 
>vtkOutlineFilter.  Here is the code:
>
>   vtkDataSetReader *vectorData = vtkDataSetReader::New();
>     vectorData->SetFileName("data/office.vtk");
>     vectorData->Update();
>
>vtkOutlineFilter *vectorOutline = vtkOutlineFilter::New();
>             vectorOutline->SetInput(vectorData);
>             vectorOutline->Update();
>
>When I do that, I receive the following error:
>
>error C2664: 'SetInput' : cannot convert parameter 1 from 'class 
>vtkDataSetReader *' to 'class vtkDataSet *' Types pointed to are 
>unrelated; conversion requires reinterpret_cast, C-style cast or 
>function-style cast

You want to pass the output of the vtkDataSetReader to the 
vtkOutlineFilter, not the reader itself. Change the SetInput line to the 
following:
vectorOutline->SetInput(vectorData->GetOutput());

- Amy


>
>I thought that it would be logical to use 
>vtkDataObjectToDataSetFilter.  (mistakenly perhaps)
>
>vtkDataSetReader *vectorData = vtkDataSetReader::New();
>     vectorData->SetFileName("data/office.vtk");
>     vectorData->Update();
>
>vtkDataObjectToDataSetFilter() *vectorSet = 
>vtkDataObjectToDataSetFilter::New();
>             vectorSet->SetInput(vectorData->GetOutput());
>             vectorSet->Update();
>
>vtkOutlineFilter *vectorOutline = vtkOutlineFilter::New();
>             vectorOutline->SetInput(vectorSet->GetOutput());
>             vectorOutline->Update();
>
>When I do that, I receive the following error:
>
>error C2248: 'vtkDataObjectToDataSetFilter::vtkDataObjectToDataSetFilter' 
>: cannot access protected member declared in class 
>'vtkDataObjectToDataSetFilter'
>
>Errors seem to be unrelated to data (I have tried at least 8 different 
>sets).  Any ANY ANY Help would be greatly appreciated,
>
>
>
>Everette W. Sperling
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040302/e8dd29ef/attachment.htm>


More information about the vtkusers mailing list