Discussion:
[vtkusers] Disable warning about "does not support stereo"
Mengda Wu
2013-09-02 19:51:06 UTC
Permalink
Hi All,

Is there away to disable this warning message?

Warning: In ..\..\Rendering\vtkRenderWindow.cxx, line 236
vtkWin32OpenGLRenderWindow (0000000010C070D0): Adjusting stereo mode on a
window that does not support stereo type CrystalEyes is not possible.

I always get this message when pressing key '3' in the vtk window. I know
my screen does not support stereo. I also know that I can globally disable
all warnings using the static function
vtkObject::GlobalWarningDisplayOff(). But I would like to keep warned of
other errors.

Thanks,
Mengda
Alex Malyushytskyy
2013-09-04 02:17:43 UTC
Permalink
Sorry I do not know of the way how to disable specific warning,
but this warning comes from void vtkRenderWindow::SetStereoRender(int
stereo)

it would be called from
vtkInteractorStyle::OnChar()


You may subclass vtkInteractorStyle you use -
(for example vtkInteractorStyleTrackballCamera ), override
virtual void OnChar();

Something like below will work:

//--------------------------------------------------------------------------
void vtkInteractorStyleRubberBand::OnChar()
{
switch (this->Interactor->GetKeyCode())
{
case '3':
vtkObject::GlobalWarningDisplayOff();
this->Superclass::OnChar();
vtkObject::GlobalWarningDisplayOn();
return;
}
this->Superclass::OnChar();
}


Basically you are not guaranteed that other warnings which may happen are
enabled, but you limit time warnings are disabled.



Alex
Post by Mengda Wu
Hi All,
Is there away to disable this warning message?
Warning: In ..\..\Rendering\vtkRenderWindow.cxx, line 236
vtkWin32OpenGLRenderWindow (0000000010C070D0): Adjusting stereo mode on a
window that does not support stereo type CrystalEyes is not possible.
I always get this message when pressing key '3' in the vtk window. I
know my screen does not support stereo. I also know that I can globally
disable all warnings using the static function
vtkObject::GlobalWarningDisplayOff(). But I would like to keep warned of
other errors.
Thanks,
Mengda
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.vtk.org/Wiki/VTK_FAQ
http://www.vtk.org/mailman/listinfo/vtkusers
David Cole
2013-09-04 10:49:13 UTC
Permalink
Post by Alex Malyushytskyy
it would be called from
vtkInteractorStyle::OnChar()
You may subclass vtkInteractorStyle you use -
(for example vtkInteractorStyleTrackballCamera ), override
  virtual void OnChar();
If you are overriding OnChar, simply do not call the parent class when
the '3' key is pressed. The '3' key means "turn on (or off) 3D stereo
viewing" in the default interactor style. And attempting to do that is
what triggers the warning...

Search for "Keypress 3" here:

http://www.vtk.org/doc/nightly/html/classvtkInteractorStyle.html


HTH,
David
Alex Malyushytskyy
2013-09-04 20:38:37 UTC
Permalink
Post by Alex Malyushytskyy
Post by David Cole
If you are overriding OnChar, simply do not call the parent class when
the '3' key is pressed. The '3' key means "turn on (or off) 3D stereo
viewing" in the default interactor style. And attempting to do that is what
triggers the warning...

You are missing that if you do this, you will disable not only warning, but
3D functionality on the systems which are able to support it.

Alex
Post by Alex Malyushytskyy
it would be called from
Post by David Cole
vtkInteractorStyle::OnChar()
You may subclass vtkInteractorStyle you use -
(for example vtkInteractorStyleTrackballCam**era ), override
virtual void OnChar();
If you are overriding OnChar, simply do not call the parent class when the
'3' key is pressed. The '3' key means "turn on (or off) 3D stereo viewing"
in the default interactor style. And attempting to do that is what triggers
the warning...
http://www.vtk.org/doc/**nightly/html/**classvtkInteractorStyle.html<http://www.vtk.org/doc/nightly/html/classvtkInteractorStyle.html>
HTH,
David
Max
2013-09-04 21:57:20 UTC
Permalink
Another solution is to redirect the warnings to a file.
This way you know the warnings but they don't bother the user.

Max



--
View this message in context: http://vtk.1045678.n5.nabble.com/Disable-warning-about-does-not-support-stereo-tp5723212p5723286.html
Sent from the VTK - Users mailing list archive at Nabble.com.
Bill Lorensen
2013-09-05 01:15:15 UTC
Permalink
This example sows how to catch a warning or error:
http://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ObserveError
Post by Max
Another solution is to redirect the warnings to a file.
This way you know the warnings but they don't bother the user.
Max
--
View this message in context: http://vtk.1045678.n5.nabble.com/Disable-warning-about-does-not-support-stereo-tp5723212p5723286.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
http://www.vtk.org/mailman/listinfo/vtkusers
--
Unpaid intern in BillsBasement at noware dot com
Loading...