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

Luis Costa luis.costa at vektore.com
Fri Feb 3 13:32:00 EST 2017


You are right Cory, I have a strong guess that the problem is in the header file, but everything seems to work and cleaning and rebuilding do not seem to make any difference…

 

De: Cory Quammen [mailto:cory.quammen at kitware.com] 
Enviada em: Friday, February 3, 2017 4:25 PM
Para: Luis Costa <luis.costa at vektore.com>
Cc: vtkusers at vtk.org
Assunto: Re: [vtkusers] Exception at centralWidget (Qt Project with VTK)

 

It sounds like maybe compilation units dependent on your header file are not being recompiled, or something like that.

 

Cory

 

On Fri, Feb 3, 2017 at 12:02 PM, Luis Costa <luis.costa at vektore.com <mailto:luis.costa at vektore.com> > wrote:

The ONS_Tools_Mesh object is being allocated in a constructor in a cpp file. The problem is so bizarre that I can declare any extra functions on the private slots, but I cannot declare any public or private variables that this exception is throw. Right now what I am doing is declaring them as globals before the constructor on the cpp file, but that is not the most elegant way…

 

De: Cory Quammen [mailto:cory.quammen at kitware.com <mailto:cory.quammen at kitware.com> ] 
Enviada em: Friday, February 3, 2017 2:47 PM
Para: Luis Costa <luis.costa at vektore.com <mailto:luis.costa at vektore.com> >
Cc: vtkusers at vtk.org <mailto:vtkusers at vtk.org> 
Assunto: Re: [vtkusers] Exception at centralWidget (Qt Project with VTK)

 

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 <mailto: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> http://lnked.in/luisantoniocosta

 <mailto:luis.costa at vektore.com> luis.costa at vektore.com

 <http://www.vektore.com/> www.vektore.com

 

 

  _____  


 <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 <http://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.

 

  _____  


 <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>  

 





 

-- 

Cory Quammen
Staff R&D Engineer
Kitware, Inc.



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170203/4126a6fa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ~WRD000.jpg
Type: image/jpeg
Size: 823 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170203/4126a6fa/attachment.jpg>


More information about the vtkusers mailing list