<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018 at 1:00 PM Matthew Troke <<a href="mailto:matthew.troke@avalonholographics.com">matthew.troke@avalonholographics.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I am adding a new module to VTK that extends vtkOpenGLRenderer (let's call it vtkMyOpenGLRenderer). I would like to be able to use this in an application such that when I instantiate a vtkRenderer (such as with vtkRenderer::New()), it creates a vtkMyOpenGLRenderer. I'm not clear on the correct way to set this up via CMake. Do I need to create a new backend, or just enable the object factory?</div></div></blockquote><div><br></div><div>This is really just a runtime thing, and you would achieve it by manipulating the object factory. All the CMake code does is ensure the appropriate calls are made before any of the classes are instantiated, as part of your application start up logic you would want to remove the standard vtkOpenGLRenderer override, and add your own. You don't even need this to be in a module, it just needs to derive from the vtkRenderer class so that it is possible to return a vtkRenderer pointer from the static ::New() method.</div><div><br></div><div>Hope that makes sense, the entire object factory thing is runtime. We just added convenience functions in the form of defines passed into the build system, or calls you can add to your code that is compiled into your application somewhere.</div></div></div>