<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">The other day I was trying to write a custom filter in VTK, just to see how to do it, and I had a few questions that the documentation and the examples just didn't answer. I'd like to fix the documentation/examples, but I need to know the answers first. Here are the questions I had:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">vtkPolyDataAlgorithm::RequestData(...)</div><div style="font-family:arial,sans-serif;font-size:13px">
the documentation is just "<span style="line-height:19px;font-size:14px;font-family:Roboto,sans-serif">This is called by the superclass. This is the method you should override.</span>"</div><div style="font-family:arial,sans-serif;font-size:13px">
-this returns an int, but all the examples just return 1. Why? What does this return code mean, if anything?</div><div style="font-family:arial,sans-serif;font-size:13px">-the online examples show how to use the input and output vectors, but what is the other parameter for? In every example I have looked at it is unused.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Then I was looking at the question of what to do if my filter failed (divide by 0 was a possibility). I found this example:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><a href="http://www.vtk.org/Wiki/VTK/Examples/Developers/FailedFilter" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Developers/FailedFilter</a></div><div style="font-family:arial,sans-serif;font-size:13px">
it uses vtkAlgorithm::SetErrorCode(), which according to the documentation:</div><div style="font-family:arial,sans-serif;font-size:13px">"<span style="line-height:19px;font-size:14px;font-family:Roboto,sans-serif">The error code contains a possible error that occurred while reading or writing the file."</span></div>
<div style="font-family:arial,sans-serif;font-size:13px">my questions:</div><div style="font-family:arial,sans-serif;font-size:13px">-Should I be using this since my filter doesn't do file I/O?</div><div style="font-family:arial,sans-serif;font-size:13px">
-Do different codes mean anything? Is there a list somewhere or do I just use the standard posix error codes?</div><div style="font-family:arial,sans-serif;font-size:13px">-What do you set as your output if the filter fails? The example just soft copies the input, is that the standard/right thing to do?</div>
<div style="font-family:arial,sans-serif;font-size:13px">-The failed filter example uses a vtkDebugMacro() to print error messages, but I would think that for an error, there would be something a little more urgent than a debug message. Why doesn't it use vtkErrorMacro() or vtkWarningMacro() as shown in the other examples? How should you decide which one to use? None of the examples explain this.</div>
<div><br></div><div style>Thank you,</div><div style><br></div><div style>Shawn Waldon</div>-- <br><div dir="ltr">Shawn Waldon<div>Graduate Student</div><div style>Department of Computer Science</div><div>University of North Carolina at Chapel Hill</div>
<div><a href="mailto:swaldon@cs.unc.edu" target="_blank">swaldon@cs.unc.edu</a></div></div>
</div>