#ifdef _DEBUG
#define new DEBUG_NEW
#endif
-wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent)
+wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent, vtkBaseData* vtkbasedata)
:wxVtkBaseView( parent )
{
+ SetVtkBaseData( vtkbasedata );
_configure = false;
_aRenderer = NULL;
_renWin = NULL;
wxVtk3DBaseView::~wxVtk3DBaseView()
{
- if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;}
+ if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;}
if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;}
- if (_renWin!=NULL) {
- if(_renWin->GetReferenceCount()==0){
- _renWin -> Delete(); _renWin=NULL;
+ if (_renWin!=NULL)
+ {
+ if(_renWin->GetReferenceCount()==0)
+ {
+ _renWin->Delete();
+ _renWin=NULL;
}
}
}
//wxVtkBaseView::Configure();
_aRenderer = vtkRenderer::New();
_renWin = vtkRenderWindow::New();
+
+ int supportopengl=_renWin->SupportsOpenGL();
+ printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow SupportsOpenGL %d\n", supportopengl );
+ printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow IsDirect %d\n", _renWin->IsDirect() );
+ if (supportopengl==0)
+ {
+#if defined(_WIN32)
+ printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n Copy from <ProgramsFiles>\\CreaTools\\crea_TPdlls-4.0.0\\bin\\opengl-mesa\n the file: opengl32.dll\n to <ProgramsFiles>\\CreaTools\\CreaTools-3.0.0\\bin \n");
+#else
+ printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n");
+#endif
+ exit(0);
+ }
+
_renWin->AddRenderer(_aRenderer);
_aRenderer->GradientBackgroundOn();
_aRenderer->SetBackground( 0.33 , 0.33 , 0.33 );
_aRenderer->SetBackground2( 0.66 , 0.66 , 0.66 );
+
+
+
+// _aRenderer->GradientBackgroundOff();
+// _aRenderer->SetBackground(0,0,0 );
+
SetStereo(0);
GetCamera()->Roll(180);
GetCamera()->Yaw(180+30);
GetCamera()->Pitch(-22);
-
-
+
}
}
+
//-------------------------------------------------------------------
//EED 27 sep 2006
void wxVtk3DBaseView::GetSpacing(double spc[3])