[vtk-developers] vtkOpenGLTextActor/vtkTextActor exception error

Allie Vacanti allison.vacanti at kitware.com
Mon Dec 18 12:21:12 EST 2017


Hi Kevin,

I'm cc'ing the list with my reply in case anyone else is having this issue.

It looks like the object factory is not being set up properly, since
vtkRenderingOpenGL2 is linked (otherwise you wouldn't enter
vtkOpenGLTextActor in the stack), but vtkTexture::New() is returning NULL
instead of a new vtkOpenGLTexture pointer (which is triggering the crash
inside vtkOpenGLTextActor::New().

Is this project using CMake? If so, the object factory stuff should be take
care of by default.

If not using CMake, you'll need to add a bit of code to your application to
set things up. See the bottom of
https://www.vtk.org/Wiki/VTK/Build_System_Migration, I suspect that adding:

 #include <vtkAutoInit.h>
 VTK_MODULE_INIT(vtkRenderingOpenGL2);
 VTK_MODULE_INIT(vtkRenderingFreeType);

somewhere in your application will fix it. You'll need to add one of these
VTK_MODULE_INIT calls for every linked VTK library.

HTH,
Allie

On Mon, Dec 18, 2017 at 11:22 AM, Kevin Lee <kevin.lee at emiservices.com>
wrote:

> I am linking vktRenderingFreeType-8.0.dll
>
>
>
> The exception dialog window that VS2015 display when the exception occurs
> state: Exception thrown: read access violation.  This was nullptr.
>
>
>
> The call stack shows the following trace:
>
>
>
> vtkCommonExecutionModel-8.0.dll!vtkAlgorithm::SetInputDataInternal(int
> port, vtkDataObject * input) Line 949
>
> vtkCommonExecutionModel-8.0.dll!vtkImageAlgorithm::SetInputData(int
> index, vtkDataObject * input) Line 406
>
> vtkCommonExecutionModel-8.0.dll!vtkImageAlgorithm::SetInputData(vtkDataObject
> * input) Line 400
>
> vtkRenderingCore-8.0.dll!vtkTextActor::vtkTextActor() Line 75
>
> vtkRenderingOpenGL2-8.0.dll!vtkOpenGLTextActor::vtkOpenGLTextActor() Line
> 56
>
> vtkRenderingOpenGL2-8.0.dll!vtkOpenGLTextActor::New() Line 56
>
> MultiPlotDisplay.exe!vtkSmartPointer<vtkOpenGLTextActor>::New() Line 137
>
> MultiPlotDisplay.exe!CTextActor::CTextActor() Line 17
>
>
>
>
>
> This is line 17 of my code that is failing.  It’s the first line in my
> class constructor:
>
>
>
> m_pTextActor = vtkSmartPointer<vtkOpenGLTextActor>::New();
>
>
>
>
>
> This is how I declare the smart pointer in my class definition:
>
>
>
> vtkSmartPointer<vtkOpenGLTextActor> m_pTextActor;
>
>
>
>
>
> I appreciate the help.
>
>
>
>
>
> *From:* Allie Vacanti [mailto:allison.vacanti at kitware.com]
> *Sent:* Monday, December 18, 2017 7:36 AM
> *To:* Kevin Lee <kevin.lee at emiservices.com>
> *Cc:* VTK Developers <vtk-developers at vtk.org>
> *Subject:* Re: [vtk-developers] vtkOpenGLTextActor/vtkTextActor exception
> error
>
>
>
> The only bit of extra setup that vtkTextActor requires is that the
> vtkRenderingFreeType module needs to be linked, but it should print out
> something like "Failed getting the TextRenderer instance!" if that's not
> done, and vtkAlgorithm::SetInputDataInternal shouldn't be a part of the
> stack.
>
> What does the exception say? Can you provide a more detailed backtrace?
>
>
>
> On Fri, Dec 15, 2017 at 5:10 PM, Kevin Lee <kevin.lee at emiservices.com>
> wrote:
>
> I am using VTK 8.0.  When I call the New member function of either
> vtkOpenGLTextActor or vtkTextActor, my program throws an exception.  The
> exception occurs in:
>
> vtkCommonExecutionModel-8.0.dll!vtkAlgorithm::SetInputDataInternal(int
> port, vtkDataObject *input) Line 949
>
>
>
> I have no problems instantiating a vtkOpenGLActor object.  Are there
> special setup requirements that must be in place before creating a text
> actor?
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtk-developers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://vtk.org/pipermail/vtk-developers/attachments/20171218/99f4218a/attachment.html>


More information about the vtk-developers mailing list