Berk,<br><br>This seems like it will have a major impact on customers. If you had to change dozens of Imaging classes, just imagine how many of our customers will have to do the same. And you know what do do. How will they know how to change their classes? Also is there a way that an existing application can support these changes and vtk5.8? What will it take to have one code base?<br>
<br>I think these drastic changes need to be passed by the VTK ARB.<br><br>Bill<br><br><div class="gmail_quote">On Mon, May 9, 2011 at 2:22 PM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi folks,<br>
<br>
I wanted to give you an update on where I am in removing the VTK 4<br>
compatibility layer and the issues I have encountered. For reference,<br>
see:<br>
<br>
<a href="http://www.vtk.org/Wiki/VTK/Remove_VTK_4_Compatibility" target="_blank">http://www.vtk.org/Wiki/VTK/Remove_VTK_4_Compatibility</a><br>
<br>
Specifically:<br>
<br>
"Removal of data object's dependency on algorithm and executive"<br>
<br>
As innocent as this sounds, it is a beast. Below is a list of some of<br>
the functions I removed from vtkDataObject.<br>
<br>
int ShouldIReleaseData();<br>
vtkGetMacro(DataReleased,int);<br>
void SetReleaseDataFlag(int);<br>
virtual void Update();<br>
virtual void UpdateInformation();<br>
virtual unsigned long GetEstimatedMemorySize();<br>
virtual void SetUpdateExtent(int piece,int numPieces, int ghostLevel);<br>
virtual int* GetUpdateExtent();<br>
unsigned long GetPipelineMTime();<br>
void SetUpdatePiece(int piece);<br>
void SetUpdateNumberOfPieces(int num);<br>
virtual int GetUpdatePiece();<br>
virtual int GetUpdateNumberOfPieces();<br>
virtual int* GetWholeExtent();<br>
void SetExtentTranslator(vtkExtentTranslator* translator);<br>
vtkExtentTranslator* GetExtentTranslator();<br>
<br>
Every single one of the functions above access the pipeline<br>
information and hence depend on the algorithm and executive. So what<br>
does this mean? It means that if you have a filter that does this:<br>
<br>
input->GetWholeExtent();<br>
<br>
it now has to do:<br>
<br>
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());<br>
<br>
If you do:<br>
<br>
outputData->Update();<br>
<br>
you now have to do:<br>
<br>
algorithm->Update();<br>
<br>
These are all small changes but there seems to be lots of places in<br>
VTK that need to be changed. Specially in the Imaging kit. I changed a<br>
couple of dozens of classes already. When the entire VTK compiles, I<br>
will commit these changes to my Gitorious repo.<br>
<br>
Also, there are some behavior changes that may require a close look at<br>
existing code. For example, vtkImageData::SetScalarType() and<br>
vtkImageData::SetNumberOfScalarComponents() currently set meta-data in<br>
the pipeline information - vtkImageData does not have a "ScalarType"<br>
or "NumberOfScalarComponents" member. I will change these to set the<br>
type of the actual scalars, i.e. something like:<br>
<br>
void SetScalarType(int type)<br>
{<br>
  vtkDataArray* scalars = vtkDataArray::CreateDataArray(type);<br>
  this->GetPointData()->SetScalars(scalars);<br>
  ...<br>
}<br>
<br>
With the proper checks, of course. This means that these functions<br>
should never NEVER be used in RequestInformation(). As long as they<br>
are used in RequestData(), everything should work as before. So this<br>
will work as before:<br>
<br>
image->SetScalarType(VTK_FLOAT);<br>
image->SetNumberOfScalarComponents(3);<br>
image->SetExtent(...);<br>
image->AllocateScalars();<br>
<br>
-berk<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>