Using an approach similar to what's done in Qt could work. not only the VTk classes would have to be contained in that namespace but also the third party library statically built.<br><br>In both header and cpp files, the following could be added. For example<br>

<br><br><font style="font-family: courier new,monospace;" size="1">#include <.vtkObject.h><br><br>VTK_BEGIN_NAMESPACE<br><br>class vtkFoo : ...<br>{<br>};<br><br>VTK_END_NAMESPACE</font><br><br><br>You could look at line 69 of qglobal.h <br>

<br>Creating a patch and associated test case to validate it would represent quite some work.<br><br>Hth<br>Jc<br><br><div class="gmail_quote">On Sat, Apr 16, 2011 at 9:54 AM, Martin Waitzbauer <span dir="ltr"><<a href="mailto:mazzok@gmx.at">mazzok@gmx.at</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 Jean<br>
<br>
Thank you for your reply!<br>
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<br>


<br>
at least i thought this would help, ive seen it with ITK and there it worked<br>
<br>
So, in your opiinion<br>
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?<br>
and instantiating would go like<br>
mynamespace::vtkImageData * data = mynamewspace::vtkImageData::New()<br>
for example??<br>
<br>
Thank you!<br>
-------- Original-Nachricht --------<br>
> Datum: Fri, 15 Apr 2011 11:37:47 -0400<br>
> Von: Jean-Christophe Fillion-Robin <<a href="mailto:jchris.fillionr@kitware.com">jchris.fillionr@kitware.com</a>><br>
> An: Martin Waitzbauer <<a href="mailto:mazzok@gmx.at">mazzok@gmx.at</a>><br>
> CC: <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>
> Betreff: Re: [vtk-developers] change VTK Namespace?<br>
<div><div></div><div class="h5"><br>
> Hi Martin,<br>
><br>
> Within VTK all class names starts with the prefix "vtk", that's how all<br>
> potential clashes with other toolkit or library is ensured.<br>
><br>
> Changing all VTK classes from:<br>
><br>
> class vtkMyClass{<br>
> };<br>
><br>
> to<br>
><br>
> namespace vtk {<br>
> class MyClass{<br>
> };<br>
> }<br>
><br>
> would be possible.<br>
><br>
> Nevertheless, doing so will seriously break backward compatibility.<br>
> Indeed,<br>
> all projects using VTK will have to undergo some serious update.<br>
><br>
> A an other possibility could be the following, where the namespace is<br>
> optional:<br>
><br>
> #ifdef VTK_USE_NAMESPACE<br>
> namespace vtk {<br>
> #endif<br>
> class vtkMyClass{<br>
> };<br>
> #ifdef VTK_USE_NAMESPACE<br>
> }<br>
> #endif<br>
><br>
> but I dont really see the advantages of doing so.<br>
><br>
> Thanks<br>
> Jc<br>
><br>
><br>
><br>
> On Fri, Apr 15, 2011 at 6:43 AM, Martin Waitzbauer <<a href="mailto:mazzok@gmx.at">mazzok@gmx.at</a>> wrote:<br>
><br>
> > Hello,<br>
> ><br>
> ><br>
> > I would like to know if it is possible to compile VTK with a specific<br>
> > Namespace like in ITK, where the namespace is itk::<br>
> ><br>
> > so would osmetihing like<br>
> ><br>
> > namespace mynamespace{<br>
> > class VTK_INFOVIS_EXPORT vtkAppendPoints : public vtkPolyDataAlgorithm<br>
> > {<br>
> ><br>
> > }<br>
> > } //end namespace mynamespace<br>
> ><br>
> ><br>
> > so would this work if i made a script that added all the vtk classes to<br>
> > this NS?<br>
> ><br>
> ><br>
> > Thanks alot!<br>
> > M<br>
> > --<br>
> > GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit<br>
> > gratis Handy-Flat! <a href="http://portal.gmx.net/de/go/dsl" target="_blank">http://portal.gmx.net/de/go/dsl</a><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<br>
> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> ><br>
> > Follow this link to subscribe/unsubscribe:<br>
> > <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
> ><br>
> ><br>
><br>
><br>
> --<br>
> <a href="tel:%2B1%20919%20869%208849" value="+19198698849">+1 919 869 8849</a><br>
<br>
</div></div><font color="#888888">--<br>
NEU: FreePhone - kostenlos mobil telefonieren und surfen!<br>
Jetzt informieren: <a href="http://www.gmx.net/de/go/freephone" target="_blank">http://www.gmx.net/de/go/freephone</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br><br>