[vtk-developers] My vtk class override not being used when an override already exists.

Kathleen S. Biagas biagas2 at llnl.gov
Tue Feb 12 20:54:22 EST 2013


Trying to come up to speed with current VTK master, and ran across
issues trying to override vtk classes.  

One thing I noticed was that I could not override the classes I was
interested in without first building VTK with VTK_ALL_NEW_OBJECT_FACTORY
enabled.  So my first question is:  are more classes going to be opened
up for overriding within the new scheme of things without having to set
this flag?  Or will this flag be enabled by default in the future?  We
eventually want our code to compile with a user's preinstalled VTK, and
there wouldn't be a guarantee this flag would have been used.

The other thing I noticed was a change in behavior.  To illustrate, I
copied the TestObjectFactory.cxx from Common/Core/Testing/cxx, and
modified it to override vtkCamera instead of vtkPoints.

When built against an older version of VTK, say 5.8, the results show
that when vtkCamera is instantiated, the correct version (either
vtkTestCamera or vtkTestCamera2) is succesfully created. Running through
the vtkOverrideInformationCollection printing OverrideWithName, only two
are shown: vtkTestCamera and vtkTestCamera2.

When built against latest version of master, the results show that when
vtkCamera is instantiated, a vtkOpenGLCamera is created instead of
either of the registered overrides in the test (vtkTestCamera or
vtkTestCamera2). Running through the vtkOverrideInformationCollection,
and printing the OverrideWithName, three are shown: vtkOpenGLCamera,
vtkTestCamera and vtkTestCamera2.


In the new scheme of things, how would I go about ensuring my override
takes precedence over any default ones? eg vtkTestCamera over
vtkOpenGLCamera?

Thanks!

Kathleen












More information about the vtk-developers mailing list