[vtk-developers] change VTK Namespace?

Martin Waitzbauer mazzok at gmx.at
Sat Apr 16 09:54:18 EDT 2011


HI Jean

Thank you for your reply!
My intention is to build VTK from source with this new namespace because i need to link the libraries with a software that already uses a static version of VTK on Mac Since i would get symbol entries doubled if im using the same namespoace, i need my verison of VTK to be in another namespace

at least i thought this would help, ive seen it with ITK and there it worked

So, in your opiinion
adding a namespace mynamespace{...} before eah VTK class and asasuring that all classes being called within Vtk classes are also assigned to that NS would result in a VTK version that resides in the mynamespace ns?
and instantiating would go like
mynamespace::vtkImageData * data = mynamewspace::vtkImageData::New()
for example??

Thank you!
-------- Original-Nachricht --------
> Datum: Fri, 15 Apr 2011 11:37:47 -0400
> Von: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
> An: Martin Waitzbauer <mazzok at gmx.at>
> CC: vtk-developers at vtk.org
> Betreff: Re: [vtk-developers] change VTK Namespace?

> 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

-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
Jetzt informieren: http://www.gmx.net/de/go/freephone



More information about the vtk-developers mailing list