Build vtk classes - HELP !!!

Yi-Yu Chou chouyiyu at hotmail.com
Tue Jan 13 22:10:06 CET 2004


Hi all python users,

I am trying t build my own vtk classes and use them in python but I 
encounter some problems.
I tried to change the example a little bit in 
VTK/Example/Build/vtkMy/Common/

// vtkBar.h
#ifndef __vtkBar_h
#define __vtkBar_h
#include "vtkObject.h"
#include "vtkmyCommonWin32Header.h"

class VTK_MY_COMMON_EXPORT vtkBar : public vtkObject
{
public:
  static vtkBar *New();
  vtkTypeRevisionMacro(vtkBar,vtkObject);
  int inData;
  int outData;
protected:
  vtkBar() ;
  ~vtkBar() ;
private:
  vtkBar(const vtkBar&);  // Not implemented.
  void operator=(const vtkBar&);  // Not implemented.
};
#endif 

// vtkBar.cxx
#include "vtkBar.h"
#include "vtkObjectFactory.h"

vtkCxxRevisionMacro(vtkBar, "$Revision: 1.3 $");
vtkStandardNewMacro(vtkBar);
vtkBar::vtkBar()
{
  this->inData = 0;
  this->outData = 0;
}

vtkBar::~vtkBar()
{
}
...............................................................................................................................


Under /VTK/Example/Build/vtkMy
I ran : ccmake . 
Press "c" twice, then press "g"
Enter : make
Go to /vtkMy/bin
Ran : python
>>> from vtk import *
>>> from libvtkmyCommonPython import *
>>> A = vtkBar()
>>> A.inData
Then I got the following error message :
AttributeError: inData 
What's wrong with my procedure.....??????
Please help me !!!
Thanks a lot !!

Best,
YY

_________________________________________________________________
想戀愛?交朋友?MSN 線上交友:由 Match.com 提供,全世界最受歡迎的線上交友服
務 http://match.msn.com.tw 





More information about the Python-list mailing list