[vtkusers] vtkInteractorStyleImage and QT Widget

Ale notinmyhead at gmail.com
Tue Sep 4 08:57:37 EDT 2012


sorry I miss the attachment...
#ifndef CUSTOMWIDGET_H
#define CUSTOMWIDGET_H

#include <QWidget>

/* include custom Interactor */
#include "custominteractorstyle.h"

namespace Ui {
    class CustomWidget;
}

class CustomWidget : public QWidget
{
    Q_OBJECT
    
public:
    explicit CustomWidget(QWidget *parent = 0, vtkImageData * image = NULL, QString wtitle = QString::null);

    ~CustomWidget();

  ...

public slots:
  ...

protected:
   ...
    
private:
    Ui::CustomWidget *ui;

  ....

};

#endif //CUSTOMWIDGET_H


#ifndef CUSTOMINTERACTORSTYLE_H
#define CUSTOMINTERACTORSTYLE_H

#include <QWidget>

#include "customwidget.h"

class CustomInteractorStyle : public vtkInteractorStyleImage
{
public:
    CustomInteractorStyle ();

    static CustomInteractorStyle * New();
    vtkTypeMacro(CustomInteractorStyle, vtkInteractorStyleImage)

protected:

    std::vector < CustomWidget * > widgets;

public:
    ...

private:
   ...

protected:
    virtual void OnKeyDown();
    virtual void OnMouseWheelBackward();
    virtual void OnMouseWheelForward();
    virtual void OnRightButtonDown();
};

vtkStandardNewMacro(CustomInteractorStyle)

#endif // CUSTOMINTERACTORSTYLE_H

Il giorno 04/set/2012, alle ore 14.31, Ale ha scritto:

> Hello,
> 
> I'd like to include a custom vtkInteractorStyleImage in a QT project. I need to store a set of custom qwidgets (I attached the template) in the custom vtkInteractorStyleImage but since a create a sort of loop of classes (including my custom widget header into the custom vtkInteractorStyleImage header and viceversa), it does not compile properly. I got this error when I try to refer to the custom widget class:
> 
> custominteractorstyle.h:30: error: 'CustomWidget' was not declared in this scope
> 
> What is happening?
> 
> Thanks,
> Ale




More information about the vtkusers mailing list