0

vtkInteractorStyleImage をサブクラス化して、クリック時のマウスの動作を変更したいと考えています。Qt Creator を使用しており、vtkinteractorStyleImage などを試してみました。

ここに私のコード。

vtkinteractorstylevisor.h:

#define VTK_EXCLUDE_STRSTREAM_HEADERS

#ifndef VTKINTERACTORSTYLEVISOR_H
#define VTKINTERACTORSTYLEVISOR_H
#include <vtkInteractorStyleImage.h>

class VTK_RENDERING_EXPORT vtkInteractorStyleVisor : public vtkInteractorStyleImage
{
public:
    static vtkInteractorStyleVisor* New();
    vtkTypeMacro(vtkInteractorStyleVisor, vtkInteractorStyleImage)

    virtual void OnLeftButtonDown();

protected:
vtkInteractorStyleVisor();
~vtkInteractorStyleVisor();

};

#endif // VTKINTERACTORSTYLEVISOR_H

vtkinteractorstyle.cpp

#include <vtkinteractorstylevisor.h>
#include <vtkObjectFactory.h>

vtkStandardNewMacro(vtkInteractorStyleVisor)

左クリック動作の実装を開始したいのですが、これをコンパイルすると次のエラーが発生します。

vtkinteractorstylevisor.cpp:-1: エラー: `vtkInteractorStyleVisor::vtkInteractorStyleVisor()' への未定義の参照:-1: エラー: collect2: エラー: ld が 1 つの終了ステータスを返しました

助言がありますか?ありがとう。

4

1 に答える 1

0

はい、分かりました。

コンストラクタとデストラクタの実装を.cppファイルに含めるのを忘れました。

これを読んでくれてありがとう。

于 2012-12-01T21:59:09.857 に答える