[vtk-developers] change VTK Namespace?

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Fri Apr 15 11:37:47 EDT 2011


Hi Martin,

Within VTK all class names starts with the prefix "vtk", that's how all
potential clashes with other toolkit or library is ensured.

Changing all VTK classes from:

class vtkMyClass{
};

to

namespace vtk {
class MyClass{
};
}

would be possible.

Nevertheless, doing so will seriously break backward compatibility. Indeed,
all projects using VTK will have to undergo some serious update.

A an other possibility could be the following, where the namespace is
optional:

#ifdef VTK_USE_NAMESPACE
namespace vtk {
#endif
class vtkMyClass{
};
#ifdef VTK_USE_NAMESPACE
}
#endif

but I dont really see the advantages of doing so.

Thanks
Jc



On Fri, Apr 15, 2011 at 6:43 AM, Martin Waitzbauer <mazzok at gmx.at> wrote:

> Hello,
>
>
> I would like to know if it is possible to compile VTK with a specific
> Namespace like in ITK, where the namespace is itk::
>
> so would osmetihing like
>
> namespace mynamespace{
> class VTK_INFOVIS_EXPORT vtkAppendPoints : public vtkPolyDataAlgorithm
> {
>
> }
> } //end namespace mynamespace
>
>
> so would this work if i made a script that added all the vtk classes to
> this NS?
>
>
> Thanks alot!
> M
> --
> GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
> gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>


-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110415/636b23ff/attachment.html>


More information about the vtk-developers mailing list