From: Thomas W. <tho...@us...> - 2007-01-12 08:12:44
|
Update of /cvsroot/octaviz/octaviz/Common In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1418/Common Modified Files: vtkInitializeInteractor.cc vtkRaiseWindow.cc vtk_get_pointer.cc vtk_print_ref_table.cc Log Message: Use Unix-type line ends (no code changes) Index: vtk_get_pointer.cc =================================================================== RCS file: /cvsroot/octaviz/octaviz/Common/vtk_get_pointer.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vtk_get_pointer.cc 24 Oct 2004 02:09:13 -0000 1.1 +++ vtk_get_pointer.cc 12 Jan 2007 08:12:41 -0000 1.2 @@ -1,46 +1,46 @@ -/* - -## Copyright (C) 2004 Dragan Tubic -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -// The following must be defined for recent versions of Octave. -#define TYPEID_HAS_CLASS -#include <octave/oct.h> -#include "octaviz.h" - -DEFUN_DLD (vtk_get_pointer, args, , -"") -{ - octave_value retval; - if ( args(0).type_id() != vtk_object::static_type_id() ) - { - error("The parameter has to be vtk_object"); - return retval; - } - - retval = args(0).uint_value(); - - return retval; -} - - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/ - +/* + +## Copyright (C) 2004 Dragan Tubic +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this file. If not, write to the Free Software Foundation, +## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +// The following must be defined for recent versions of Octave. +#define TYPEID_HAS_CLASS +#include <octave/oct.h> +#include "octaviz.h" + +DEFUN_DLD (vtk_get_pointer, args, , +"") +{ + octave_value retval; + if ( args(0).type_id() != vtk_object::static_type_id() ) + { + error("The parameter has to be vtk_object"); + return retval; + } + + retval = args(0).uint_value(); + + return retval; +} + + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; End: *** +*/ + Index: vtkInitializeInteractor.cc =================================================================== RCS file: /cvsroot/octaviz/octaviz/Common/vtkInitializeInteractor.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- vtkInitializeInteractor.cc 7 Mar 2005 02:06:53 -0000 1.4 +++ vtkInitializeInteractor.cc 12 Jan 2007 08:12:41 -0000 1.5 @@ -1,90 +1,90 @@ -/* - -## Copyright (C) 2004 Dragan Tubic -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -#include <vtkXRenderWindowInteractor.h> -#include <vtkXOpenGLRenderWindow.h> -#include <vtkCommand.h> -#include <vtkCallbackCommand.h> -#undef Complex -#include <octave/oct.h> - -vtkCallbackCommand* InteractorExitCallbackCommand = NULL; - -// The following must be defined for recent versions of Octave. -#define TYPEID_HAS_CLASS -#include <octave/oct.h> -#include "octaviz.h" - - -// Function called when WM_DELETE_WINDOW protocol is passed -void CloseAppCallback(Widget w, XtPointer client_data, XtPointer call_data) -{ - cout << "WM_DELETE_WINDOW hello!" << endl << std::flush; -} - -void ExitCallback(vtkObject*, unsigned long eid, void* clientdata, void *calldata) -{ - -} - -DEFUN_DLD (vtkInitializeInteractor, args, , - "Returns app context.") -{ - octave_value retval; - - if ( args(0).type_id() != vtk_object::static_type_id() ) - { - error("The parameter has to be vtkRenderWindowInteractor"); - return retval; - } - - vtkObjectBase* vtk_pointer = reinterpret_cast<vtkObjectBase*>( args(0).uint_value() ); - - if ( !vtk_pointer->IsA("vtkXRenderWindowInteractor") ) - { - error("The parameter has to be vtkXRenderWindowInteractor"); - return retval; - } - - vtkXRenderWindowInteractor* CurrentInteractor = reinterpret_cast<vtkXRenderWindowInteractor*>(vtk_pointer); - - if ( InteractorExitCallbackCommand == NULL ) - { - InteractorExitCallbackCommand = vtkCallbackCommand::New(); - InteractorExitCallbackCommand->SetCallback( ExitCallback ); - } - CurrentInteractor->Initialize(vtk_app_context); - CurrentInteractor->AddObserver(vtkCommand::ExitEvent, InteractorExitCallbackCommand, 0.0f ); - - vtkXOpenGLRenderWindow* RenderWindow = reinterpret_cast<vtkXOpenGLRenderWindow*>(CurrentInteractor->GetRenderWindow()); - Widget widg = CurrentInteractor->GetWidget(); - Atom wm_delete_window = XInternAtom(XtDisplay(widg), "WM_DELETE_WINDOW", False); - vtk_delete_window_atoms[wm_delete_window] = reinterpret_cast<uintptr_t>(RenderWindow); - // turn off default delete response - XSetWMProtocols(XtDisplay(widg), XtWindow(widg), &wm_delete_window, 1); - return retval; -} - - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/ - +/* + +## Copyright (C) 2004 Dragan Tubic +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this file. If not, write to the Free Software Foundation, +## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +#include <vtkXRenderWindowInteractor.h> +#include <vtkXOpenGLRenderWindow.h> +#include <vtkCommand.h> +#include <vtkCallbackCommand.h> +#undef Complex +#include <octave/oct.h> + +vtkCallbackCommand* InteractorExitCallbackCommand = NULL; + +// The following must be defined for recent versions of Octave. +#define TYPEID_HAS_CLASS +#include <octave/oct.h> +#include "octaviz.h" + + +// Function called when WM_DELETE_WINDOW protocol is passed +void CloseAppCallback(Widget w, XtPointer client_data, XtPointer call_data) +{ + cout << "WM_DELETE_WINDOW hello!" << endl << std::flush; +} + +void ExitCallback(vtkObject*, unsigned long eid, void* clientdata, void *calldata) +{ + +} + +DEFUN_DLD (vtkInitializeInteractor, args, , + "Returns app context.") +{ + octave_value retval; + + if ( args(0).type_id() != vtk_object::static_type_id() ) + { + error("The parameter has to be vtkRenderWindowInteractor"); + return retval; + } + + vtkObjectBase* vtk_pointer = reinterpret_cast<vtkObjectBase*>( args(0).uint_value() ); + + if ( !vtk_pointer->IsA("vtkXRenderWindowInteractor") ) + { + error("The parameter has to be vtkXRenderWindowInteractor"); + return retval; + } + + vtkXRenderWindowInteractor* CurrentInteractor = reinterpret_cast<vtkXRenderWindowInteractor*>(vtk_pointer); + + if ( InteractorExitCallbackCommand == NULL ) + { + InteractorExitCallbackCommand = vtkCallbackCommand::New(); + InteractorExitCallbackCommand->SetCallback( ExitCallback ); + } + CurrentInteractor->Initialize(vtk_app_context); + CurrentInteractor->AddObserver(vtkCommand::ExitEvent, InteractorExitCallbackCommand, 0.0f ); + + vtkXOpenGLRenderWindow* RenderWindow = reinterpret_cast<vtkXOpenGLRenderWindow*>(CurrentInteractor->GetRenderWindow()); + Widget widg = CurrentInteractor->GetWidget(); + Atom wm_delete_window = XInternAtom(XtDisplay(widg), "WM_DELETE_WINDOW", False); + vtk_delete_window_atoms[wm_delete_window] = reinterpret_cast<uintptr_t>(RenderWindow); + // turn off default delete response + XSetWMProtocols(XtDisplay(widg), XtWindow(widg), &wm_delete_window, 1); + return retval; +} + + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; End: *** +*/ + Index: vtk_print_ref_table.cc =================================================================== RCS file: /cvsroot/octaviz/octaviz/Common/vtk_print_ref_table.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vtk_print_ref_table.cc 25 Dec 2006 20:12:50 -0000 1.2 +++ vtk_print_ref_table.cc 12 Jan 2007 08:12:41 -0000 1.3 @@ -1,39 +1,39 @@ -/* - -## Copyright (C) 2004 Dragan Tubic -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -// The following must be defined for recent versions of Octave. -#define TYPEID_HAS_CLASS -#include <octave/oct.h> -#include "octaviz.h" -// -DEFUN_DLD (vtk_print_ref_table, args, , -"") -{ - octave_value retval; - vtk_object::print_ref_table(); - return retval; -} - - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/ - +/* + +## Copyright (C) 2004 Dragan Tubic +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this file. If not, write to the Free Software Foundation, +## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +// The following must be defined for recent versions of Octave. +#define TYPEID_HAS_CLASS +#include <octave/oct.h> +#include "octaviz.h" +// +DEFUN_DLD (vtk_print_ref_table, args, , +"") +{ + octave_value retval; + vtk_object::print_ref_table(); + return retval; +} + + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; End: *** +*/ + Index: vtkRaiseWindow.cc =================================================================== RCS file: /cvsroot/octaviz/octaviz/Common/vtkRaiseWindow.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vtkRaiseWindow.cc 4 Oct 2004 02:01:20 -0000 1.2 +++ vtkRaiseWindow.cc 12 Jan 2007 08:12:41 -0000 1.3 @@ -1,70 +1,70 @@ -/* - -## Copyright (C) 2004 Dragan Tubic -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -#include <vtkXOpenGLRenderWindow.h> -#undef Complex -#include <octave/oct.h> - -// The following must be defined for recent versions of Octave. -#define TYPEID_HAS_CLASS -#include <octave/oct.h> -#include "octaviz.h" - -DEFUN_DLD (vtkRaiseWindow, args, , -"-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} vtkRaiseWindow(@var{window})\n\ -Raises the window specified. Typically this window can be obtained by:\n\ -\n\ -f = vtk_figure(0);\n\ -\n\ -@var{window} = f.window;\n\ -\n\ -Some windows managers (e.g. KDE) will intercept this call. You must\n\ -turn off so-called ``Focus stealing prevention'' options in your windows manager for this\n\ -function to work.\n\ -@end deftypefn") -{ - octave_value retval; - if ( args(0).type_id() != vtk_object::static_type_id() ) - { - error("The parameter has to be vtkXOpenGLRenderWindow"); - return retval; - } - - vtkObjectBase* vtk_pointer = reinterpret_cast<vtkObjectBase*>( args(0).uint_value() ); - - if ( !vtk_pointer->IsA("vtkXOpenGLRenderWindow") ) - { - error("The parameter has to be vtkXOpenGLRenderWindow"); - return retval; - } - - vtkXOpenGLRenderWindow* window = reinterpret_cast<vtkXOpenGLRenderWindow*>(vtk_pointer); - XRaiseWindow(window->GetDisplayId(), window->GetWindowId() ); - - return retval; -} - - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/ - +/* + +## Copyright (C) 2004 Dragan Tubic +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2, or (at your option) +## any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this file. If not, write to the Free Software Foundation, +## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +#include <vtkXOpenGLRenderWindow.h> +#undef Complex +#include <octave/oct.h> + +// The following must be defined for recent versions of Octave. +#define TYPEID_HAS_CLASS +#include <octave/oct.h> +#include "octaviz.h" + +DEFUN_DLD (vtkRaiseWindow, args, , +"-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {} vtkRaiseWindow(@var{window})\n\ +Raises the window specified. Typically this window can be obtained by:\n\ +\n\ +f = vtk_figure(0);\n\ +\n\ +@var{window} = f.window;\n\ +\n\ +Some windows managers (e.g. KDE) will intercept this call. You must\n\ +turn off so-called ``Focus stealing prevention'' options in your windows manager for this\n\ +function to work.\n\ +@end deftypefn") +{ + octave_value retval; + if ( args(0).type_id() != vtk_object::static_type_id() ) + { + error("The parameter has to be vtkXOpenGLRenderWindow"); + return retval; + } + + vtkObjectBase* vtk_pointer = reinterpret_cast<vtkObjectBase*>( args(0).uint_value() ); + + if ( !vtk_pointer->IsA("vtkXOpenGLRenderWindow") ) + { + error("The parameter has to be vtkXOpenGLRenderWindow"); + return retval; + } + + vtkXOpenGLRenderWindow* window = reinterpret_cast<vtkXOpenGLRenderWindow*>(vtk_pointer); + XRaiseWindow(window->GetDisplayId(), window->GetWindowId() ); + + return retval; +} + + +/* +;;; Local Variables: *** +;;; mode: C++ *** +;;; End: *** +*/ + |