[vtkusers] Exception at centralWidget (Qt Project with VTK)

Cory Quammen cory.quammen at kitware.com
Fri Feb 3 11:46:31 EST 2017


I'm not sure this is a VTK-related problem, but the nature of the exception
should make it not too hard to track down.

Your ONS_Tools_Mesh object is NULL. Are you saying it is not NULL when you
do not define any additional member variables?

Where is the ONS_Tools_Mesh object being allocated?

- Cory

On Fri, Feb 3, 2017 at 11:21 AM, Luis Costa <luis.costa at vektore.com> wrote:

> Hello everyone,
>
>
>
> I have a problem with a Qt project on VS 2013. I am using Qt with VTK and
> if I declare an extra variable, of any kind, (for example, if I declare the
> double* orientation) in my header file, it throws me this exception. I
> started a new project but the error persists. Any help you can get me to
> solve this problem?
>
>
>
> This is my header file:
>
>
>
> //#pragma once
>
>
>
> #ifndef _ONS_TOOLS_MESH_H_
>
> #define _ONS_TOOLS_MESH_H_
>
>
>
> #include <QtWidgets/QMainWindow>
>
> #include "ui_ONS_Tools_Mesh.h"
>
>
>
> #include "vtkPlaneSource.h"
>
> #include "vtkActor.h"
>
> #include "vtkAxes.h"
>
> #include "vtkAxesActor.h"
>
> #include "vtkTransform.h"
>
> #include "vtkSmartPointer.h"    // Required for smart pointer internal
> ivars.
>
>
>
> //#define VTK_CREATE(type, name) \
>
>   //vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
>
>
>
> class ONS_Tools_Mesh : public QMainWindow
>
> {
>
>        Q_OBJECT
>
>
>
> public:
>
>
>
>        ONS_Tools_Mesh(QWidget *parent = Q_NULLPTR);
>
>
>
> private:
>
>
>
>        Ui::ONS_Tools_MeshClass *ui;
>
>
>
>        double* origin;
>
>        //double* orientation;
>
>
>
>        vtkSmartPointer<vtkPlaneSource> planeSourceOne;
>
>        vtkSmartPointer<vtkPlaneSource> planeSourceTwo;
>
>        vtkSmartPointer<vtkActor> planeActorOne;
>
>        vtkSmartPointer<vtkActor> planeActorTwo;
>
>        //vtkSmartPointer<vtkAxesActor> axesActor;
>
>
>
> private slots:
>
>
>
>        virtual void slotScale(double value);
>
>        virtual void slotIntervals(int value);
>
>        virtual void slotPositionX(double value);
>
>        virtual void slotPositionY(double value);
>
>        virtual void slotPositionZ(double value);
>
>        virtual void slotInc(double value);
>
>        virtual void slotOrientationXY();
>
>        virtual void slotOrientationYZ();
>
>        virtual void slotOrientationZX();
>
>        virtual void slotResetOrientation();
>
>        virtual void slotRender(int state);
>
>        virtual void slotResetOrigin();
>
> };
>
>
>
> #endif
>
>
>
> *Luis Costa*,
>
> Consultant, Programmer
>
> Vektore Exploration Consulting Corporation
>
> http://lnked.in/luisantoniocosta
>
> luis.costa at vektore.com
>
> www.vektore.com
>
>
>
>
> ------------------------------
> [image: Avast logo]
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>
> This email has been checked for viruses by Avast antivirus software.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170203/9ce18bdc/attachment.html>


More information about the vtkusers mailing list