[Paraview-developers] Re: [vtk-developers] Removed windows.h from VTK headers.

Brad King brad.king at kitware.com
Tue Jan 4 16:04:45 EST 2005

Brad King wrote:
>> The correct solution for this problem is to rename all of the methods 
>> in question to names that do not conflict with Windows.h.   
> This sounds like a good idea.  Then we can deprecate the old method 
> names using the standard VTK deprecation mechanism.  Now we need to 
> choose new names.  How about these:
> GetClassName -> GetNameOfClass
> GetProp -> GetViewProp
> SetProp -> SetViewProp
> RemoveProp -> RemoveViewProp

I have just committed changes that rename all the mangled methods except 
GetClassName.  I will make a separate sweep for 
GetClassName->GetNameOfClass because it is used so often.

Those who have already updated their virtual functions for previous 
renames like RemoveProp to RemovePropInternal will have to do it again 
because the method now has a new public name (RemoveViewProp in this 
case).  I apologize for requiring you to rename your methods again, but 
this is the price of using the CVS version of VTK.  This solution really 
is better because we can remove the anti-mangling code altogether after 
the VTK 5.0 release and all windows.h issues will will go away.

All the old (mangled) names are still provided but deprecated using the 
new VTK_LEGACY syntax.  The methods should be reported by Doxygen as 
deprecated.  Existing user code that tries to replace virtual functions 
that have been renamed will now get errors at compile time instead of 
subtle runtime bugs due to the missing override of the new name. 
Compile time warnings for calls to the deprecated methods are available 
on some compilers.  Runtime warnings are available everywhere.

There are two new CMake options to help with the transition.  Use the 
VTK_LEGACY_REMOVE option in CMakeSetup to remove the legacy names 
completely if you want to make sure your code is not using anything 
deprecated.  Use the VTK_LEGACY_SILENT option to remove all warnings 
(compile time and runtime) about deprecated code to quickly fix existing 
applications until you have time to update them.


More information about the vtk-developers mailing list