[vtkusers] to inherit a class

Diego Parada icebishop at gmail.com
Wed Sep 14 12:00:40 EDT 2005


Hi,

I have been treating to derivate a clas from vtkWindowRenderInteractor but 
the compilation showws this:

C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(30) : error C2065: 
'CvtkWin32OpenGLRenderWindow' : undeclared identifier
C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(30) : error C2065: 
'tmp' : undeclared identifier
C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(30) : warning C4552: 
'*' : operator has no effect; expected operator with side-effect
C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(35) : error C2065: 
'vtkWin32OpenGLRenderWindow' : undeclared identifier
C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(35) : error C2065: 
'ren' : undeclared identifier
C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(35) : warning C4552: 
'*' : operator has no effect; expected operator with side-effect
C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(36) : error C2061: 
syntax error : identifier 'vtkWin32OpenGLRenderWindow'
C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(37) : error C2059: 
syntax error : ')'
C:\test\ISVtest\MyvtkWin32RenderWindowInteractor.cpp(50) : error C2065: 
'vtkSetWindowLong' : undeclared identifier

the code is:

file .h

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "vtkWin32RenderWindowInteractor.h"

class CvtkWin32RenderWindowInteractor : public 
vtkWin32RenderWindowInteractor
{

public:
static CvtkWin32RenderWindowInteractor *New();

virtual void OnMouseMove (HWND wnd, UINT nFlags, int X, int Y);
virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y);
virtual void OnRButtonUp (HWND wnd, UINT nFlags, int X, int Y);
virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y);
virtual void OnMButtonUp (HWND wnd, UINT nFlags, int X, int Y);
virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y);
virtual void OnLButtonUp (HWND wnd, UINT nFlags, int X, int Y);
virtual void OnSize (HWND wnd, UINT nType, int X, int Y);
virtual void OnTimer (HWND wnd, UINT nIDEvent);
virtual void OnKeyDown (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
virtual void OnKeyUp (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
virtual void OnChar (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);

protected:

CvtkWin32RenderWindowInteractor();
virtual ~CvtkWin32RenderWindowInteractor();

};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
file .cpp
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CvtkWin32RenderWindowInteractor::CvtkWin32RenderWindowInteractor()
{
static int timerId = 1;
this->WindowId = 0;
this->TimerId = timerId++;
this->InstallMessageProc = 1;
this->MouseInWindow = 0;
}

CvtkWin32RenderWindowInteractor::~CvtkWin32RenderWindowInteractor()
{

CvtkWin32OpenGLRenderWindow *tmp;

// we need to release any hold we have on a windows event loop
if (this->WindowId && this->Enabled && this->InstallMessageProc) 
{
vtkWin32OpenGLRenderWindow *ren;
ren = static_cast<vtkWin32OpenGLRenderWindow *>(this->RenderWindow);
tmp = (vtkWin32OpenGLRenderWindow *)(vtkGetWindowLong(this->WindowId,4));
// watch for odd conditions
if ((tmp != ren) && (ren != NULL)) 
{
// OK someone else has a hold on our event handler
// so lets have them handle this stuff
// well send a USER message to the other
// event handler so that it can properly
// call this event handler if required
CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(LONG)this->OldProc);
}
else 
{
vtkSetWindowLong(this->WindowId,GWL_WNDPROC,(LONG)this->OldProc);
}
this->Enabled = 0;
}
}

void CvtkWin32RenderWindowInteractor::OnMouseMove (HWND wnd, UINT nFlags, 
int X, int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnNCMouseMove(HWND wnd, UINT nFlags, 
int X, int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnRButtonDown(HWND wnd, UINT nFlags, 
int X, int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnRButtonUp (HWND wnd, UINT nFlags, 
int X, int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnMButtonDown(HWND wnd, UINT nFlags, 
int X, int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnMButtonUp (HWND wnd, UINT nFlags, 
int X, int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnLButtonDown(HWND wnd, UINT nFlags, 
int X, int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnLButtonUp (HWND wnd, UINT nFlags, 
int X, int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnSize (HWND wnd, UINT nType, int X, 
int Y)
{
}
void CvtkWin32RenderWindowInteractor::OnTimer (HWND wnd, UINT nIDEvent)
{
}
void CvtkWin32RenderWindowInteractor::OnKeyDown (HWND wnd, UINT nChar, UINT 
nRepCnt, UINT nFlags)
{
}
void CvtkWin32RenderWindowInteractor::OnKeyUp (HWND wnd, UINT nChar, UINT 
nRepCnt, UINT nFlags)
{
}
void CvtkWin32RenderWindowInteractor::OnChar (HWND wnd, UINT nChar, UINT 
nRepCnt, UINT nFlags)
{
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
of course with vtkWin32RenderWindowInteractor.h include

Somebody can help me? 

Thanks
-- 
Diego Armando Parada Cuervo
Estudiante de Ingeniería de Sistemas y Computación
Universidad Pedagógica y Tecnológica de Colombia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050914/dd19b281/attachment.htm>


More information about the vtkusers mailing list