<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hello everybody, <br>
I have solved this problem by adding <br>
std::string dataset = [[[NSBundle mainBundle]
pathForResource:@"tissue" ofType:@"stl"] UTF8String]; <br>
to find the file path.<br>
Thank you very much.<br>
Best regards,<br>
NIE JUNXIAO<br>
<br>
On 2015/04/29 18:44, NIE JUNXIAO wrote:<br>
</div>
<blockquote cite="mid:5540A818.2010809@gmail.com" type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
Hello everybody,<br>
My name is Nie. And I am very sorry for such a newbie.<br>
I am now working with a project on iOS. I choose VTK as the
rendering engine. But I have came up eith a problem on reading
stl( or other 3D type file is OK, like vtp).<br>
I first followed th tutorial on <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadSTL">http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadSTL</a><br>
But I get a file not found error (the .stl file is in the app
bundle).<br>
Then I changed the stl to vtp using 3Dslicer and tried to read vtp
referring to readvtp tutorial. This time I get a error opening
file code. <br>
Could anyone give me some hints to solve this?<br>
Thank you.<br>
I am now using VTK6.20 and the version of Xcode is 6.3.1.<br>
Best regards,<br>
NIE JUNXIAO<br>
<br>
<br>
read stl code //vtkSTLreader is changed to vtkXMLPolyDataReader
when reading vtp<br>
----------------------------------------------<br>
(void) loadSTL(string name){<br>
vtkNew<vtkSTLReader> reader;<br>
reader->SetFileName("tissue.stl"/*name.c_str()*/);//actually it
is called in another function<br>
reader->Update();<br>
vtkNew<vtkPolyDataMapper> mapper;<br>
mapper->SetInputConnection(reader->GetOutputPort());<br>
mapper->Update();<br>
vtkNew<vtkActor> actor;<br>
actor->SetMapper(mapper.Get());<br>
_myVTKRenderer->AddActor(actor.Get());//_myVTKrenderer is
defined before this <br>
}<br>
---------------------------------<br>
error message while reading stl<br>
ERROR: In
/Users/atreapple/iOS_App/VTK-6.2.0/IO/Geometry/vtkSTLReader.cxx,
line 106<br>
vtkSTLReader (0x16d9ccd0): <font color="#ff0000">File tissue.stl
not found</font><br>
ERROR: In
/Users/atreapple/iOS_App/VTK-6.2.0/Common/ExecutionModel/vtkExecutive.cxx,
line 784<br>
vtkCompositeDataPipeline (0x16d9d0e0): Algorithm
vtkSTLReader(0x16d9ccd0) returned failure for request:
vtkInformation (0x16da2fc0)<br>
Debug: Off<br>
Modified Time: 347<br>
Reference Count: 1<br>
Registered Events: (none)<br>
Request: REQUEST_DATA<br>
FORWARD_DIRECTION: 0<br>
FROM_OUTPUT_PORT: 0<br>
ALGORITHM_AFTER_FORWARD: 1<br>
------------------------read vtp error code<br>
ERROR: In
/Users/atreapple/iOS_App/VTK-6.2.0/IO/XML/vtkXMLReader.cxx, line
233<br>
vtkXMLPolyDataReader (0x17532490): <font color="#cc0000">Error
opening file tissue.vtp<br>
</font><br>
ERROR: In
/Users/atreapple/iOS_App/VTK-6.2.0/Common/ExecutionModel/vtkExecutive.cxx,
line 784<br>
vtkCompositeDataPipeline (0x17532120): Algorithm
vtkXMLPolyDataReader(0x17532490) returned failure for request:
vtkInformation (0x17531230)<br>
Debug: Off<br>
Modified Time: 314<br>
Reference Count: 1<br>
Registered Events: (none)<br>
Request: REQUEST_INFORMATION<br>
ALGORITHM_AFTER_FORWARD: 1<br>
FORWARD_DIRECTION: 0<br>
</blockquote>
<br>
</body>
</html>