<div dir="ltr">Could you provide some more information that might be helpful for debugging:<div><br></div><div>1). Are you using CMake to configure your project?</div><div><br></div><div>2). Could you provide a stack trace?</div><div><br></div><div>Thanks,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 5, 2015 at 11:55 AM, francesco.argese <span dir="ltr"><<a href="mailto:kekko84@gmail.com" target="_blank">kekko84@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I'm having problems trying to port an application from VTK 5.10 to VTK 6.1.<br>
<br>
The application is a simple LSDyna reader which loads the frames of the<br>
animation and stores them in a vector of actors; then it uses them for a<br>
conversion.<br>
<br>
The only modification needed to compile the code with VTK 6.1 is the<br>
following one:<br>
#ifdef __VTK_5__<br>
        <a href="http://mapper.at" rel="noreferrer" target="_blank">mapper.at</a>(k)->SetInput(myData.at(k).GetPointer());<br>
#else<br>
        <a href="http://mapper.at" rel="noreferrer" target="_blank">mapper.at</a>(k)->SetInputData(myData.at(k).GetPointer());<br>
#endif<br>
<br>
The error at runtime is generated when I call SetMapper function.<br>
<br>
The entire code with a note on the runtime error is below.<br>
<br>
What could be the problem?<br>
<br>
Francesco<br>
<br>
<br>
---------------------------- CODE  (BEGIN)<br>
-----------------------------------------<br>
int main(int argc, char **argv)<br>
{<br>
        // 0) Parse command line arguments. First argument is path of dir<br>
containing LS-DYNA files<br>
        if(argc != 2)<br>
        {<br>
                std::cout << "Usage: " << argv[0] << " directory path" << std::endl;<br>
                return EXIT_FAILURE;<br>
        }<br>
        std::string dir= argv[1]; // Save command-line argument to dir variable<br>
<br>
        // 1) Use lsDyna reader to read file from lsDyna output<br>
        vtkSmartPointer<vtkLSDynaReader> reader =<br>
vtkSmartPointer<vtkLSDynaReader>::New();<br>
        reader->SetFileName(dir.c_str());<br>
        reader->Update();<br>
<br>
        // Extract a vector of actors from lsDynaReader<br>
        std::vector<std::vector&lt;vtkSmartPointer&lt;vtkActor>>> vectorOfFrames;<br>
// every frame is a vector of actor<br>
        for(unsigned int i = 0; i < reader->GetNumberOfTimeSteps(); i++) // loop<br>
over frames<br>
        {<br>
                // Set frame number and update<br>
                reader->SetTimeStep(i);<br>
                reader->Update();<br>
<br>
                vtkMultiBlockDataSet* mbds =  reader->GetOutput();<br>
<br>
                std::vector<vtkSmartPointer&lt;vtkDataSetMapper>> mapper;<br>
                std::vector<vtkSmartPointer&lt;vtkDataSet>> myData;<br>
<br>
                std::vector<vtkSmartPointer&lt;vtkActor>> actorsForThisFrame;<br>
<br>
                for(unsigned int k=0; k<=mbds->GetNumberOfBlocks(); k++)<br>
                {<br>
                        // Define a new mapper (process object to be related to the new vtkActor)<br>
and add it to vector of mappers<br>
                        vtkSmartPointer<vtkDataSetMapper> newMapper =<br>
vtkSmartPointer<vtkDataSetMapper>::New();<br>
                        // newMapper->SetScalarRange(0, 10);<br>
                        mapper.push_back(newMapper);<br>
<br>
                        // Take vtkDataSet extracted from multiBlockDataset extracted from<br>
lsDynaReader<br>
                        myData.push_back((vtkDataSet *)mbds->GetBlock(k));<br>
<br>
                        // Set dataset inserted as last mapper input<br>
                        #ifdef __VTK_5__<br>
                                <a href="http://mapper.at" rel="noreferrer" target="_blank">mapper.at</a>(k)->SetInput(myData.at(k).GetPointer());<br>
                        #else<br>
                                <a href="http://mapper.at" rel="noreferrer" target="_blank">mapper.at</a>(k)->SetInputData(myData.at(k).GetPointer());<br>
                        #endif<br>
<br>
                        // add a new vtkactor to vector of vtkActors<br>
                        actorsForThisFrame.push_back(vtkSmartPointer<vtkActor>::New());<br>
<br>
                        // Set mapper created as mapper of the vtkActor<br>
                        actorsForThisFrame.at(k)->SetMapper(<a href="http://mapper.at" rel="noreferrer" target="_blank">mapper.at</a>(k).GetPointer()); // Here<br>
there is the run time error!!!<br>
                }<br>
<br>
                vectorOfFrames.push_back(actorsForThisFrame);<br>
        }<br>
---------------------------- CODE  (END)<br>
-----------------------------------------<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Error-porting-from-VTK-5-10-to-VTK-6-1-tp5734818.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/Error-porting-from-VTK-5-10-to-VTK-6-1-tp5734818.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>