[vtkusers] Writing a file

Bill Lorensen bill.lorensen at gmail.com
Wed Mar 28 14:44:59 EDT 2012


In VTK6, SetInput is gone! You did the right thing by changing it to
SetInputConnection. (BTW, SetInputConnection works in VTK5 also).

Try removing your VTK build tree and rebuilding vtk. Something strange
is going on, perhaps elsewhere in your code. I assume that the input
file is a vtk polydata file?

On Wed, Mar 28, 2012 at 11:39 AM, Darshan Pai <darshanpai at gmail.com> wrote:
> This version of vtk was the nightly build from yesterday . The following
> code was working before without problems .
>
> char *buffer;
> buffer = _getcwd(NULL,0);
> QString path(buffer);
> QString filename = QFileDialog::getOpenFileName(this,"LoadVTk Files",path,
> "Txt (*.vtk)");
>     vtkPolyDataReader *slcreader = vtkPolyDataReader::New();
>        slcreader->SetFileName(filename.toStdString().c_str());
>
>   std::string wq = "image.stl";
>  // wq.replace(wq.size()-3,3,"stl");
>  // cout << wq << endl;
>
>   vtkSTLWriter *stlwriter = vtkSTLWriter::New();
>   stlwriter->SetFileName(wq.c_str());
>   stlwriter->SetInputConnection(slcreader->GetOutputPort());
>   stlwriter->Update();
>
> That is all i have in the app . I changed the stlwriter->SetInput to
> stlwriter->SetInputConnection() because the former function does not link .
>
>
>
> On Wed, Mar 28, 2012 at 2:21 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
>>
>> What version of vtk? Also can you post a small, compilable example
>> that illustrates the error? Looks like a programming bug on your part.
>>
>> On Wed, Mar 28, 2012 at 11:18 AM, Darshan Pai <darshanpai at gmail.com>
>> wrote:
>> > I am reading a VTK file and saving it as an STL file .
>> > My issue is that I am getting this strange error :
>> > ERROR: In
>> > O:\qt-everywhere-opensource-src-4.8.0\VTK\Filtering\vtkExecutive.cxx,
>> > line
>> > 377
>> > vtkStreamingDemandDrivenPipeline (00AC0C00): Attempt to get input
>> > information vector from input port index 11252952 for algorithm
>> > vtkSTLWriter(00ACCB50), which has 1 input ports.
>> >
>> >
>> > This was working fine before . The only change I did from before was I
>> > compiled VTK with Shared_libs option On.
>> > Since making dlls. the vtkSTLWriter does not recognize SetInput() either
>> > .
>> >
>> > Regards
>> > Darshan
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>
>



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the vtkusers mailing list