]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merge branch 'V7_5_BR'
authorvsr <vsr@opencascade.com>
Mon, 19 Jan 2015 15:10:14 +0000 (18:10 +0300)
committervsr <vsr@opencascade.com>
Mon, 19 Jan 2015 15:10:14 +0000 (18:10 +0300)
61 files changed:
CMakeLists.txt
doc/salome/gui/input/introduction_to_gui.doc
doc/salome/gui/input/salome_desktop.doc
doc/salome/gui/input/study_management_chapter.doc
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/LightApp/LightApp_DataObject.cxx
src/LightApp/LightApp_PyInterp.h
src/LightApp/resources/LightApp_msg_fr.ts
src/LightApp/resources/LightApp_msg_ja.ts
src/OCCViewer/resources/OCCViewer_msg_ja.ts
src/PVViewer/CMakeLists.txt
src/PVViewer/PVViewer_GUIElements.cxx
src/PVViewer/PVViewer_GUIElements.h
src/PVViewer/PVViewer_ViewWindow.cxx
src/PVViewer/resources/PVViewer_msg_ja.ts [new file with mode: 0644]
src/Plot2d/resources/Plot2d_msg_ja.ts
src/PyConsole/PyConsole_Console.cxx
src/PyConsole/PyConsole_Console.h
src/PyConsole/PyConsole_Editor.cxx
src/PyConsole/PyConsole_Editor.h
src/PyConsole/PyConsole_EnhEditor.cxx
src/PyConsole/PyConsole_EnhEditor.h
src/PyConsole/PyConsole_EnhInterp.cxx
src/PyConsole/PyConsole_EnhInterp.h
src/PyConsole/PyConsole_Interp.cxx
src/PyConsole/PyConsole_Interp.h
src/PyConsole/PyConsole_Request.cxx
src/PyConsole/PyConsole_Request.h
src/PyConsole/resources/PyConsole_msg_fr.ts
src/PyConsole/resources/PyConsole_msg_ja.ts
src/Qtx/CMakeLists.txt
src/Qtx/resources/Qtx_msg_ja.ts [new file with mode: 0644]
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
src/STD/STD_Application.cxx
src/SVTK/CMakeLists.txt
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h
src/SVTK/resources/SVTK_msg_ja.ts
src/SVTK/salomevtkPVAxesActor.cxx [new file with mode: 0644]
src/SVTK/salomevtkPVAxesActor.h [new file with mode: 0644]
src/SVTK/salomevtkPVAxesWidget.cxx [new file with mode: 0644]
src/SVTK/salomevtkPVAxesWidget.h [new file with mode: 0644]
src/SVTK/vtkPVAxesActor.cxx [deleted file]
src/SVTK/vtkPVAxesActor.h [deleted file]
src/SVTK/vtkPVAxesWidget.cxx [deleted file]
src/SVTK/vtkPVAxesWidget.h [deleted file]
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_DataObject.cxx
src/SalomeApp/SalomeApp_DoubleSpinBox.cxx
src/SalomeApp/SalomeApp_IntSpinBox.cxx
src/SalomeApp/SalomeApp_NoteBook.cxx
src/SalomeApp/SalomeApp_PyInterp.h
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/resources/SalomeApp_msg_fr.ts
src/SalomeApp/resources/SalomeApp_msg_ja.ts
src/VTKViewer/VTKViewer_FramedTextActor.cxx
src/VTKViewer/VTKViewer_Utilities.cxx

index 274140c448887ad528b8a98283fb324cf6e13c5b..2b140890ddb9f6008c63727180b2a2b7f70015cc 100755 (executable)
@@ -30,11 +30,11 @@ CMAKE_POLICY(SET CMP0003 NEW)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 5)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
 
 # Find KERNEL
 # ===========
index 1814130db825bc5879c3f18490dfe2ba278825e8..75c02ae4140222345b989be71c3bcd2a29da3581 100644 (file)
@@ -22,7 +22,7 @@ basic GUI functionalities, common for all modules.
 
 <ul>
 <li>\b File menu corresponds to \subpage study_management_page "Study management" functionalities
-(creation, saving, loading, editing studies, connecting, disconnecting, etc.).</li>
+(creation, saving, loading, connecting, disconnecting, editing studies, etc.)</li>
 <li>\b Edit menu gives access to <b> Copy/Paste</b> allowing to paste the
 objects from one study into the other. The availability of this
 functionality depends on the module and the nature of an operation or
index d4a64281f81ad4fcbe8164ea07e3bbc92e77d83d..2eb5ffd460e61f61ad83f789c4c68f97c99c3889 100644 (file)
@@ -3,23 +3,23 @@
 \page salome_desktop_page SALOME desktop
 
 SALOME applies <b>Single Document Interface</b> (SDI) approach. Only one 
-\ref study_management_page "study (document)" can be opened at the moment.
+\ref study_management_page "study (document)" can be opened at any given moment.
 
-The front-end of the application is represented as a single Desktop top-level window
-that embeds all GUI operations. Desktop window provides access to standard GUI elements
-like viewers, main menu, toolbars, dock windows, dialog boxes, etc. 
+The front-end of the application is a single Desktop top-level window
+that embeds all GUI operations. The desktop window provides access to standard GUI elements,
+such as viewers, main menu, toolbars, dockable windows, dialog boxes, etc. 
 
 The main elements of the SALOME Desktop are represented on the picture below:
 
 \image html desktop.png
 
 The main parts of the SALOME Desktop are:
-- <b>Main menu</b> - This is a set of context-sensitive menus, which will
-be updated according to the functionality of the currently active component. In
+- <b>Main menu</b> - This is a set of context-sensitive menus
+updated according to the functionality of the currently active component. In
 general, these menus contain all functional options of SALOME platform.
 - <b>Standard toolbar</b> - contains standard actions
 that allow creating new or opening existing study, saving study, deleting
-objects etc.
+objects, etc.
 - <b>Components toolbar</b> - allows activating
 components in SALOME platform.
 - <b>Module toolbars</b> - contain actions specific to the
index 945971e3e13d80ccb699a9d8ff7a8dab4a10f7c2..68b3774ab5c3f05ba06b71e1ad5b4d9a3c150d5d 100644 (file)
@@ -2,7 +2,7 @@
 
 \page study_management_page Study management
 
-Study is a document within application, where you can carry out all
+Study is a document within the application, where you can carry out all
 operations provided by the SALOME functionality. 
 This is a certain abstraction layer between actual
 document data (probably, remote data available through CORBA) and data
@@ -14,21 +14,21 @@ All operations with study are available from the \b File menu.
 \note SALOME is a single-study application. It means that only one study
 can be opened at the moment.
 
-Immediately after application start-up there is (normally) no active study.
+Immediately after the application is launched there is (normally) no active study.
 However, you have access to the embedded Python console, that can be used to initialize
-the study by means of Python API (see documentation on SALOME KERNEL module for more details).
+a study by means of Python API (see documentation on SALOME KERNEL module for more details).
 
 The following operations are available from the \b File menu:
 
 \image html menu_file.png
 
-As soon as study is created, loaded from the file or from the data server,
-some additional operations become available from the \b File menu:
+As soon as a study is created or loaded from a file or a data server,
+additional operations become available from the \b File menu:
 
 \image html studymanagement.png
 
 \b New - creates a new study. The study will be created
-with default name \b Study1. If there is already opened study,
+with default name \b Study1. If there is an already opened study,
 you will be asked to close it before creating new one.
 
 \b Open - allows to open an existing study by browsing for it in a
@@ -70,7 +70,7 @@ by the following dialog box with several options:
 
 \b Disconnect - unloads the current study from the desktop. The study stays opened
 in the data server; it can be then reloaded in the same working session
-(\b Connect operation), but if you quit SALOME application, all changes in the
+(using \b Connect operation), but if you quit SALOME application, all changes in the
 unloaded study can be lost.
 
 \note If the study has not been previously saved, you will be prompted
index 2229aa3eaaf8d4629169146f3f7ddbf4f7f1c4b2..bb0e4a26f9d05579d6df7202a1d2efee93eea2e2 100644 (file)
@@ -221,7 +221,6 @@ static const char* imageEmptyIcon[] = {
 
 int LightApp_Application::lastStudyId = 0;
 
-
 // Markers used to parse array with dockable windows and toolbars state.
 // For more details please see the qdockarealayout.cpp && qtoolbararealayout.cpp
 // in the Qt source code.
@@ -498,6 +497,10 @@ bool LightApp_Application::activateModule( const QString& modName )
   updateWindows();
   updateViewManagers();
 
+  if ( activeStudy() && activeStudy()->root() && objectBrowser() && objectBrowser()->root() != activeStudy()->root() ) {
+    objectBrowser()->setRoot( activeStudy()->root() );
+    updateObjectBrowser( true );
+  }
   return true;
 }
 
@@ -1616,7 +1619,7 @@ void LightApp_Application::onStudyCreated( SUIT_Study* theStudy )
 
 #ifndef DISABLE_PYCONSOLE
   if( pythonConsole() )
-    pythonConsole()->getInterp()->initStudy();
+    getPyInterp()->initStudy();
 #endif
 }
 
@@ -1647,7 +1650,7 @@ void LightApp_Application::onStudyOpened( SUIT_Study* theStudy )
 
 #ifndef DISABLE_PYCONSOLE
   if( pythonConsole() )
-    pythonConsole()->getInterp()->initStudy();
+    getPyInterp()->initStudy();
 #endif
 
   emit studyOpened();
@@ -1916,7 +1919,7 @@ QWidget* LightApp_Application::createWindow( const int flag )
 #ifndef DISABLE_PYCONSOLE
   else  if ( flag == WT_PyConsole )
   {
-    PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(),new LightApp_PyInterp());
+    PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(), getPyInterp() );
     pyCons->setObjectName( "pythonConsole" );
     pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
     pyCons->setFont(resourceMgr()->fontValue( "PyConsole", "font" ));
@@ -4456,3 +4459,19 @@ bool LightApp_Application::checkExistingDoc()
   return result;
 }
 
+#ifndef DISABLE_PYCONSOLE
+
+PyConsole_Interp* LightApp_Application::getPyInterp()
+{
+  static PyConsole_Interp* myInterp = 0;
+  if ( !myInterp )
+    myInterp = createPyInterp();
+  return myInterp;
+}
+
+PyConsole_Interp* LightApp_Application::createPyInterp()
+{
+  return new LightApp_PyInterp();
+}
+
+#endif // DISABLE_PYCONSOLE
index 3ea6cb1ddfa5535887b921069f39c8459ab65feb..54be0df781f7e9e4622c2fd155a5b4a1300b2fa7 100644 (file)
@@ -42,6 +42,7 @@
 class LogWindow;
 #ifndef DISABLE_PYCONSOLE
 class PyConsole_Console;
+class PyConsole_Interp;
 #endif
 class LightApp_WidgetContainer;
 class LightApp_Preferences;
@@ -182,6 +183,10 @@ public:
 
   virtual bool                        checkExistingDoc();
 
+#ifndef DISABLE_PYCONSOLE
+  PyConsole_Interp*                   getPyInterp();
+#endif
+
 signals:
   void                                studyOpened();
   void                                studySaved();
@@ -231,6 +236,10 @@ protected:
   virtual QMap<int, QString>          activateModuleActions() const;
   virtual void                        moduleActionSelected( const int );
 
+#ifndef DISABLE_PYCONSOLE
+  virtual PyConsole_Interp*           createPyInterp();
+#endif
+
 protected slots:
   virtual void                        onDesktopActivated();
   virtual void                        onViewManagerRemoved( SUIT_ViewManager* );
index d747f898bf0b9d2ce2e632b6b7fc1b942e07350b..c7e0ac4a6a9603367f0026227961f09d86e44ec5 100644 (file)
@@ -393,7 +393,7 @@ QString LightApp_DataObject::componentDataType() const
 {
   if ( myCompDataType.isEmpty() ) {
     SUIT_DataObject* aCompObj = componentObject();
-    LightApp_ModuleObject* anObj = dynamic_cast<LightApp_ModuleObject*>( aCompObj );
+    CAM_ModuleObject* anObj = dynamic_cast<CAM_ModuleObject*>( aCompObj );
     if ( anObj ) {
       CAM_DataModel* aModel = anObj->dataModel();
       if ( aModel ) {
index de8c2663666c9b9559c980d5b5558e42850ba591..7f35fbb25d19fdf8201407e45dd643d9d838d455 100644 (file)
 
 class LightApp_PyInterp : public PyConsole_EnhInterp
 {
+  friend class LightApp_Application;
+
 public:
-  LightApp_PyInterp();
   virtual ~LightApp_PyInterp();
   
 protected:
+  LightApp_PyInterp();
   virtual void initPython();
 };
 
index 1dc76dc2a32d7e2226e86d682d4cca3f4543d3c1..5f0fb012587649b6e12e47295c46bd6a77034945 100755 (executable)
@@ -75,7 +75,12 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     <name>LightApp_Application</name>
     <message>
         <source>LANG_CHANGED</source>
-        <translation>La langue de l&apos;application a été modifié.
+        <translation>La langue de l&apos;application a été modifiée.
+Les modifications seront appliquées à la prochaine session.</translation>
+    </message>
+    <message>
+        <source>LOCALE_CHANGED</source>
+        <translation>La locale de l&apos;application a été modifiée.
 Les modifications seront appliquées à la prochaine session.</translation>
     </message>
     <message>
@@ -484,7 +489,11 @@ Les modifications seront appliquées à la prochaine session.</translation>
     </message>
     <message>
         <source>NEW_WINDOW_5</source>
-        <translation>Sène G&amp;raphiques</translation>
+        <translation>Scène G&amp;raphiques</translation>
+    </message>
+    <message>
+        <source>NEW_WINDOW_6</source>
+        <translation>Scène ParaVie&amp;w</translation>
     </message>
     <message>
         <source>CREATING_NEW_WINDOW</source>
@@ -574,6 +583,10 @@ Les modifications seront appliquées à la prochaine session.</translation>
         <source>PREF_CURRENT_LANGUAGE</source>
         <translation>Langue actuelle</translation>
     </message>
+    <message>
+        <source>PREF_CURRENT_LOCALE</source>
+        <translation>Utiliser la locale &quot;C&quot;</translation>
+    </message>
     <message>
         <source>PREF_GROUP_LOOK_AND_FEEL</source>
         <translation>Aspect</translation>
index d90b91b081bf8fb39f62f7c6028088069e5db58f..b415523b9f797a9c35837c527a9a39d949f092d5 100644 (file)
@@ -56,7 +56,7 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     </message>
     <message>
       <source>STUDYCLOSE_DESCRIPTION</source>
-        <translation type="unfinished">You already have an active study in your 
+      <translation type="unfinished">You already have an active study in your 
 session. It has to be closed before working with another study.</translation>
     </message>
     <message>
@@ -491,6 +491,10 @@ session. It has to be closed before working with another study.</translation>
       <source>NEW_WINDOW_5</source>
       <translation>グラフィックの表示 (&amp;r)</translation>
     </message>
+    <message>
+      <source>NEW_WINDOW_6</source>
+      <translation type="unfinished">ParaVie&amp;w view</translation>
+    </message>
     <message>
       <source>CREATING_NEW_WINDOW</source>
       <translation>新しい %1 を作成します。</translation>
index c9a97890a870a7471da9a6b5b174b9b50ae4927c..ac86a82a7706ea6c8fe235abdd4344d1847e4e02 100644 (file)
     </message>
     <message>
       <source>DSC_FITALL</source>
-      <translation>すべてのオブジェクトを表示するには、シーンを Redimentionner</translation>
+      <translation>すべてのオブジェクトを表示するには、シーンを</translation>
     </message>
     <message>
       <source>MNU_CLIPPING</source>
     <name>OCCViewer_AxialScaleDlg</name>
     <message>
       <source>DLG_SCALING</source>
-      <translation>ã\82¹ã\82±ã\83¼ã\83ªã\83³ã\82°</translation>
+      <translation>ã\82¹ã\82±ã\83¼ã\83«ã\81®å¤\89æ\9b´</translation>
     </message>
     <message>
       <source>LBL_X</source>
       <translation>パラメータ</translation>
     </message>
     <message>
-        <source>HELP</source>
-        <translation>ヘルプ(&amp;H)</translation>
+      <source>HELP</source>
+      <translation>ヘルプ(&amp;H)</translation>
     </message>
   </context>
 </TS>
index 076b1f61bf4d42277a16f7b47c420d86f0485615..c92cdf2c20339721272fef7ed161a23c57c54d04 100644 (file)
@@ -74,6 +74,7 @@ SET(PVViewer_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
 # resource files / to be processed by lrelease
 SET(_ts_RESOURCES
   resources/PVViewer_msg_en.ts
+  resources/PVViewer_msg_ja.ts
 )
 
 # --- sources ---
index c534b8a72aafedcd991954780103a74a338cbd38..1d5c3e6ad66542fbcbd04747af75fb2e2ed8091b 100644 (file)
 #include <pqPropertiesPanel.h>
 #include <pqPipelineBrowserWidget.h>
 #include <pqParaViewMenuBuilders.h>
+#include <pqMainControlsToolbar.h>
+#include <pqVCRToolbar.h>
+#include <pqAnimationTimeToolbar.h>
+#include <pqColorToolbar.h>
+#include <pqRepresentationToolbar.h>
+#include <pqCameraToolbar.h>
+#include <pqAxesToolbar.h>
+#include <pqSetName.h>
+
+#include <pqPythonManager.h>
+#include <pqApplicationCore.h>
 
 #include <QMenu>
 #include <QList>
 #include <QAction>
+#include <QToolBar>
+#include <QLayout>
+
+#include <QCoreApplication>
 
 PVViewer_GUIElements * PVViewer_GUIElements::theInstance = 0;
 
@@ -46,6 +61,8 @@ PVViewer_GUIElements::PVViewer_GUIElements(SUIT_Desktop* desk) :
   pqParaViewMenuBuilders::buildFiltersMenu(*filtersMenu, desk);
   macrosMenu = new QMenu(0);
   pqParaViewMenuBuilders::buildMacrosMenu(*macrosMenu);
+
+  myBuildToolbars(desk);
 }
 
 PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(SUIT_Desktop* desk)
@@ -55,46 +72,93 @@ PVViewer_GUIElements * PVViewer_GUIElements::GetInstance(SUIT_Desktop* desk)
   return theInstance;
 }
 
-//void PVViewer_GUIElements::updateSourcesMenu(QMenu *menu)
-//{
-//  if (menu)
-//    {
-//      menu->clear();
-//      QList<QAction *> act_list = sourcesMenu->actions();
-//      foreach(QAction * a, act_list)
-//      {
-//        menu->addAction(a);
-//      }
-//    }
-//}
-//
-//void PVViewer_GUIElements::updateFiltersMenu(QMenu *menu)
-//{
-//  if (menu)
-//    {
-//      filtersMenu->linkToMenu(menu);
-//      menu->clear();
-//      QList<QAction *> act_list = filtersMenu->actions();
-//      foreach(QAction * a, act_list)
-//      {
-//        menu->addAction(a);
-//      }
-//    }
-//}
-//
-//void PVViewer_GUIElements::updateMacrosMenu(QMenu *menu)
-//{
-//  if (menu)
-//    {
-//      menu->clear();
-//      QList<QAction *> act_list = macrosMenu->actions();
-//      foreach(QAction * a, act_list)
-//      {
-//        menu->addAction(a);
-//      }
-//    }
-//}
+/**
+ * See ParaView source code: pqParaViewMenuBuilders::buildToolbars()
+ * to keep this function up to date:
+ */
+void PVViewer_GUIElements::myBuildToolbars(SUIT_Desktop* mainWindow)
+{
+  mainToolBar = new pqMainControlsToolbar(mainWindow)
+    << pqSetName("MainControlsToolbar");
+  mainToolBar->layout()->setSpacing(0);
+
+  vcrToolbar = new pqVCRToolbar(mainWindow)
+    << pqSetName("VCRToolbar");
+  vcrToolbar->layout()->setSpacing(0);
+
+  timeToolbar = new pqAnimationTimeToolbar(mainWindow)
+    << pqSetName("currentTimeToolbar");
+  timeToolbar->layout()->setSpacing(0);
+
+  colorToolbar = new pqColorToolbar(mainWindow)
+    << pqSetName("variableToolbar");
+  colorToolbar->layout()->setSpacing(0);
+
+  reprToolbar = new pqRepresentationToolbar(mainWindow)
+    << pqSetName("representationToolbar");
+  reprToolbar->layout()->setSpacing(0);
+
+  cameraToolbar = new pqCameraToolbar(mainWindow)
+    << pqSetName("cameraToolbar");
+  cameraToolbar->layout()->setSpacing(0);
 
+  axesToolbar = new pqAxesToolbar(mainWindow)
+    << pqSetName("axesToolbar");
+  axesToolbar->layout()->setSpacing(0);
+
+  // Give the macros menu to the pqPythonMacroSupervisor
+  pqPythonManager* manager = qobject_cast<pqPythonManager*>(
+    pqApplicationCore::instance()->manager("PYTHON_MANAGER"));
+
+  macrosToolbar = new QToolBar("Macros Toolbars", mainWindow)
+      << pqSetName("MacrosToolbar");
+    manager->addWidgetForRunMacros(macrosToolbar);
+
+  addToolbars(mainWindow);
+}
+
+void PVViewer_GUIElements::setToolBarVisible(bool show)
+{
+  QCoreApplication::processEvents();
+  mainAction->setChecked(!show);
+  mainAction->trigger();
+  vcrAction->setChecked(!show);
+  vcrAction->trigger();
+  timeAction->setChecked(!show);
+  timeAction->trigger();
+  colorAction->setChecked(!show);
+  colorAction->trigger();
+  reprAction->setChecked(!show);
+  reprAction->trigger();
+  cameraAction->setChecked(!show);
+  cameraAction->trigger();
+  axesAction->setChecked(!show);
+  axesAction->trigger();
+  macrosAction->setChecked(!show);
+  macrosAction->trigger();
+}
+
+void PVViewer_GUIElements::addToolbars(SUIT_Desktop* desk)
+{
+  desk->addToolBar(Qt::TopToolBarArea, mainToolBar);
+  desk->addToolBar(Qt::TopToolBarArea, vcrToolbar);
+  desk->addToolBar(Qt::TopToolBarArea, timeToolbar);
+  desk->addToolBar(Qt::TopToolBarArea, colorToolbar);
+  desk->insertToolBarBreak(colorToolbar);
+  desk->addToolBar(Qt::TopToolBarArea, reprToolbar);
+  desk->addToolBar(Qt::TopToolBarArea, cameraToolbar);
+  desk->addToolBar(Qt::TopToolBarArea, axesToolbar);
+  desk->addToolBar(Qt::TopToolBarArea, macrosToolbar);
+
+  mainAction = mainToolBar->toggleViewAction();
+  vcrAction = vcrToolbar->toggleViewAction();
+  timeAction = timeToolbar->toggleViewAction();
+  colorAction = colorToolbar->toggleViewAction();
+  reprAction = reprToolbar->toggleViewAction();
+  cameraAction = cameraToolbar->toggleViewAction();
+  axesAction = axesToolbar->toggleViewAction();
+  macrosAction = macrosToolbar->toggleViewAction();
+}
 
 void PVViewer_GUIElements::onEmulateApply()
 {
index c9d2d3f2d07f4684ce7977355564a51cbc7803ed..4360de94a5ebced16b0668180abfa0b01093341c 100644 (file)
@@ -29,6 +29,10 @@ class pqPropertiesPanel;
 class pqPipelineBrowserWidget;
 class SUIT_Desktop;
 class QMenu;
+class QToolBar;
+class QAction;
+class pqAnimationTimeToolbar;
+class pqVCRToolbar;
 
 /*!
  * Some GUI elements of ParaView need to be instanciated in a proper order. This class
@@ -48,6 +52,12 @@ public:
   QMenu * getSourcesMenu() { return sourcesMenu; }
   QMenu * getMacrosMenu()  { return macrosMenu; }
 
+  pqVCRToolbar * getVCRToolbar() { return vcrToolbar; }
+  pqAnimationTimeToolbar * getTimeToolbar() { return timeToolbar; }
+
+  void myBuildToolbars(SUIT_Desktop* desk);
+  void addToolbars(SUIT_Desktop* desk);
+  void setToolBarVisible(bool show);
 
 public slots:
   void onEmulateApply();  // better use the slot from PVViewer_ViewManager if you want to trigger "Apply"
@@ -66,6 +76,26 @@ private:
   QMenu * sourcesMenu;
   QMenu * filtersMenu;
   QMenu * macrosMenu;
+
+  // Toolbars also need to be instanciated early:
+  QToolBar* mainToolBar;
+  pqVCRToolbar* vcrToolbar;
+  pqAnimationTimeToolbar * timeToolbar;
+  QToolBar* colorToolbar;
+  QToolBar* reprToolbar;
+  QToolBar* cameraToolbar;
+  QToolBar* axesToolbar;
+  QToolBar* macrosToolbar;
+
+public:
+  QAction * mainAction;
+  QAction *  vcrAction;
+  QAction *  timeAction;
+  QAction *  colorAction;
+  QAction *  reprAction;
+  QAction *  cameraAction;
+  QAction *  axesAction;
+  QAction *  macrosAction;
 };
 
 #endif /* PVVIEWERGUIELEMENTS_H_ */
index bdb1edfa08ad740e511704621ab6f1b53de0b148..07c192a2e5d37b6b33bf7bd7ccc1dbd771655906 100644 (file)
@@ -33,6 +33,7 @@
 #include <pqTabbedMultiViewWidget.h>
 #include <pqApplicationCore.h>
 
+
 /*!
   \class PVViewer_ViewWindow
   \brief PVGUI view window.
@@ -59,6 +60,10 @@ PVViewer_ViewWindow::PVViewer_ViewWindow( SUIT_Desktop* theDesktop, PVViewer_Vie
     PVViewer_ViewManager::ParaviewInitBehaviors(true, theDesktop);
     PVViewer_ViewManager::ConnectToExternalPVServer(theDesktop);
     PVViewer_ViewManager::ParaviewLoadConfigurations();
+
+    // Hide toolbars
+    PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(theDesktop);
+    pvge->setToolBarVisible(false);
   } else
     qDebug("No multiViewManager defined");
 }
diff --git a/src/PVViewer/resources/PVViewer_msg_ja.ts b/src/PVViewer/resources/PVViewer_msg_ja.ts
new file mode 100644 (file)
index 0000000..1720cd2
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+  <context>
+    <name>@default</name>
+    <message>
+      <translation type="unfinished"/>
+    </message>
+  </context>
+  <context>
+    <name>PVViewer_ViewManager</name>
+    <message>
+      <source>PARAVIEW_VIEW_TITLE</source>
+      <translation type="unfinished">ParaView scene:%M - viewer:%V</translation>
+    </message>
+  </context>
+</TS>
index 85907998583288f902895f332f618589179c21f8..ff47146d950513e962e9aa285351d615da734852 100644 (file)
@@ -5,7 +5,7 @@
     <name>@default</name>
     <message>
       <source>DASHDOT_LINE_LBL</source>
-      <translation>TiretPoint</translation>
+      <translation>DashDot</translation>
     </message>
     <message>
       <source>DASH_LINE_LBL</source>
@@ -21,7 +21,7 @@
     </message>
     <message>
       <source>DAHSDOTDOT_LINE_LBL</source>
-      <translation>TiretPointPoint</translation>
+      <translation>DashDotDot</translation>
     </message>
     <message>
       <source>NONE_LINE_LBL</source>
       <source>DIAMOND_MARKER_LBL</source>
       <translation>ダイヤモンド</translation>
     </message>
-    <message>
-      <source>NONE_MARKER_LBL</source>
-      <translation>[なし]</translation>
-    </message>
     <message>
       <source>CIRCLE_MARKER_LBL</source>
       <translation>円</translation>
     </message>
+    <message>
+      <source>NONE_MARKER_LBL</source>
+      <translation>[なし]</translation>
+    </message>
   </context>
   <context>
     <name>Plot2d_FitDataDlg</name>
     </message>
     <message>
       <source>PREF_BOTTOM</source>
-      <translation type="unfinished">Bottom</translation>
+      <translation>下</translation>
     </message>
     <message>
       <source>PREF_CURVE_TYPE</source>
       <source>PLOT2D_SELECTED_LEGEND_FONT_COLOR</source>
       <translation>ハイライト凡例フォントの色:</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>Plot2d_SetupCurveDlg</name>
     <message>
       <source>TLT_SETUP_CURVE</source>
     </message>
     <message>
       <source>CURVE_LINE_WIDTH_LAB</source>
-      <translation>線の太さ:</translation>
+      <translation>線:</translation>
     </message>
     <message>
       <source>CURVE_LINE_TYPE_LAB</source>
-      <translation>回線の種類:</translation>
+      <translation>線種:</translation>
     </message>
     <message>
       <source>CURVE_COLOR_LAB</source>
     </message>
     <message>
       <source>CURVE_PREVIEW_LAB</source>
-      <translation>プレビュー</translation>
+      <translation>プレビュー</translation>
     </message>
     <message>
       <source>CURVE_MARKER_TYPE_LAB</source>
       <translation>マーカーの種類:</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>Plot2d_ViewWindow</name>
     <message>
       <source>MNU_DUMP_VIEW</source>
-      <translation>ビューを保存.</translation>
+      <translation type="unfinished">Dump view...</translation>
     </message>
     <message>
       <source>MNU_PAN_VIEW</source>
-      <translation>パンニング</translation>
+      <translation>パン</translation>
     </message>
     <message>
       <source>MNU_CLONE_VIEW</source>
-      <translation>ビューの複製</translation>
+      <translation type="unfinished">Clone View</translation>
     </message>
     <message>
       <source>MNU_PRINT_VIEW</source>
-      <translation>印刷ビュー</translation>
+      <translation type="unfinished">Print View</translation>
     </message>
     <message>
       <source>POSTSCRIPT_FILES</source>
     </message>
     <message>
       <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
-      <translation>カプセル化された PostScript (*.eps) ファイル</translation>
+      <translation>カプセル化された PostScript ファイル (*.eps)</translation>
     </message>
     <message>
       <source>PDF_FILES</source>
     </message>
     <message>
       <source>DSC_GLOBALPAN_VIEW</source>
-      <translation>ビューの新しい中心地の選択</translation>
+      <translation type="unfinished">Selection of a new center of the view</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
-      <translation>線形スケールのモードには、垂直軸の表示を変更します。</translation>
+      <translation type="unfinished">Switches view to linear scaling mode along vertical axis</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
-      <translation>線形スケールのモードに、ビューの水平方向の軸を変更します。</translation>
+      <translation type="unfinished">Switches view to linear scaling mode along horizontal axis</translation>
     </message>
     <message>
       <source>CURVE_TYPE_POPUP</source>
-      <translation>曲線の種類</translation>
+      <translation type="unfinished">Curve type</translation>
     </message>
     <message>
       <source>NORMALIZATION_TYPE_POPUP</source>
-      <translation>標準化</translation>
+      <translation type="unfinished">Normalization</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
-      <translation>垂直軸: 線形</translation>
+      <translation type="unfinished">Vertical axis: linear</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
-      <translation>水平軸: 線形</translation>
+      <translation type="unfinished">Horizontal axis: linear</translation>
     </message>
     <message>
       <source>MNU_ZOOM_VIEW</source>
     </message>
     <message>
       <source>DSC_PAN_VIEW</source>
-      <translation>ã\83\93ã\83¥ã\83¼ã\82\92移å\8b\95ã\81\97ã\81¾ã\81\99ã\80\82</translation>
+      <translation>ã\83\91ã\83³</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_CURVES_SPLINES</source>
-      <translation>表示モードのスプラインを変更します。</translation>
+      <translation type="unfinished">Switches view to splines mode</translation>
     </message>
     <message>
       <source>DSC_FITALL</source>
-      <translation>すべてのオブジェクトを表示するには、シーンを調整します。</translation>
+      <translation>全表示</translation>
     </message>
     <message>
       <source>MNU_FITALL</source>
-      <translation>すべて表示</translation>
+      <translation>表示</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-      <translation>水平軸: 対数</translation>
+      <translation type="unfinished">Horizontal axis: logarithmic</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
-      <translation>垂直軸: 対数</translation>
+      <translation type="unfinished">Vertical axis: logarithmic</translation>
     </message>
     <message>
       <source>MNU_GLOBALPAN_VIEW</source>
-      <translation>グローバルパンニング</translation>
+      <translation type="unfinished">Global Panning</translation>
     </message>
     <message>
       <source>DSC_CLONE_VIEW</source>
-      <translation>現在のステージの新しいビューアー OCC を開く</translation>
+      <translation type="unfinished">Create new OCC viewer for the active scene</translation>
     </message>
     <message>
       <source>DSC_PRINT_VIEW</source>
-      <translation>現在のビューを印刷します。</translation>
+      <translation type="unfinished">Print active view</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_SETTINGS</source>
-      <translation>パラメーター</translation>
+      <translation type="unfinished">Settings</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
-      <translation>分析曲線</translation>
+      <translation type="unfinished">Analytical curves</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
-      <translation>左の Y 軸: グローバルの最大値を標準化します。</translation>
+      <translation type="unfinished">Left Y Axis: Normalize to global maximum</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
-      <translation>左の Y 軸: 世界最小の標準化</translation>
+      <translation type="unfinished">Left Y Axis: Normalize to global minimum</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
-      <translation>右の Y 軸: グローバルの最大値を標準化します。</translation>
+      <translation type="unfinished">Right Y Axis: Normalize to global maximum</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
-      <translation>右の Y 軸: 世界最小の標準化</translation>
+      <translation type="unfinished">Right Y Axis: Normalize to global minimum</translation>
     </message>
     <message>
       <source>MEN_PLOT2D_CURVES_SPLINES</source>
-      <translation>スプラインを描画します。</translation>
+      <translation>2Dスプラインカーブ</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-      <translation>横軸に対数スケール モードの表示方法を変更</translation>
+      <translation type="unfinished">Switches view to logarithmic scaling mode along horizontal axis</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
-      <translation>垂直軸を対数スケール モードの表示方法を変更</translation>
+      <translation type="unfinished">Switches view to logarithmic scaling mode along vertical axis</translation>
     </message>
     <message>
       <source>TOT_PLOT2D_CURVES_POINTS</source>
-      <translation>ポイントを描画します。</translation>
+      <translation type="unfinished">Draw points</translation>
     </message>
     <message>
       <source>DSC_FITRECT</source>
-      <translation>シーンのボックスで選択した領域を調整します。</translation>
+      <translation>領域でフィット</translation>
     </message>
     <message>
       <source>MNU_FITRECT</source>
-      <translation>表示エリア</translation>
+      <translation>領域でフィット</translation>
     </message>
     <message>
       <source>MEN_PLOT2D_CURVES_POINTS</source>
-      <translation>ポイントを描画します。</translation>
+      <translation type="unfinished">Draw Points</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_CURVES_POINTS</source>
-      <translation>表示モードのポイントを変更します。</translation>
+      <translation type="unfinished">Switches view to points mode</translation>
     </message>
     <message>
       <source>DSC_DUMP_VIEW</source>
-      <translation>現在のビューをイメージ ファイルに保存します。</translation>
+      <translation type="unfinished">Saves the active view in the image file</translation>
     </message>
     <message>
       <source>DSC_ZOOM_VIEW</source>
     </message>
     <message>
       <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
-      <translation>分析曲線のプロパティを設定します。</translation>
+      <translation type="unfinished">Setups analytical curves properties</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
-      <translation>左側の Y 軸の最大の標準化の方法に、ビューを切り替える</translation>
+      <translation type="unfinished">Switches view to maximum normalization mode by left Y axis</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
-      <translation>左側の Y 軸の最小の標準化の方法に、ビューを切り替える</translation>
+      <translation type="unfinished">Switches view to minimum normalization mode by left Y axis</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
-      <translation>右側の Y 軸の最大の標準化の方法に、ビューを切り替える</translation>
+      <translation type="unfinished">Switches view to maximum normalization mode by right Y axis</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
     </message>
     <message>
       <source>TOT_PLOT2D_CURVES_LINES</source>
-      <translation>線を描</translation>
+      <translation>線を描</translation>
     </message>
     <message>
       <source>PRP_PLOT2D_CURVES_LINES</source>
       <source>INF_COORDINATES</source>
       <translation>お問い合わせ: x: %1、y: %2</translation>
     </message>
-    <message>
-      <source>INF_COORDINATES_SOME_Y</source>
-      <translation>お問い合わせ: x: %1、y: %2 ( %3 )</translation>
-    </message>
     <message>
       <source>WRN_XLOG_NOT_ALLOWED</source>
       <translation>X 軸上非陽性値を持つポイントが検出されました。カテゴリの対数目盛は許可されていません。</translation>
       <source>WRN_YLOG_NOT_ALLOWED</source>
       <translation>Y 軸上非陽性値を持つポイントが検出されました。切片の対数目盛は許可されていません。</translation>
     </message>
+    <message>
+      <source>INF_COORDINATES_SOME_Y</source>
+      <translation>お問い合わせ: x: %1、y: %2 ( %3 )</translation>
+    </message>
   </context>
 </TS>
index a3991bf88a8885103e52a684776b8716e737f344..5ec6eb57e07d45cf0890d7f06580052c7516b1ae 100644 (file)
 PyConsole_Console::PyConsole_Console( QWidget* parent, PyConsole_Interp* interp )
 : QWidget( parent )
 {
-  // create python interpreter
-  myInterp = interp;
-  if ( !myInterp )
-    myInterp = new PyConsole_Interp();
+  PyConsole_Interp* anInterp = interp ? interp : new PyConsole_Interp();
   
   // initialize Python interpretator
-  myInterp->initialize();
+  anInterp->initialize();
   
   // create editor console
   QVBoxLayout* lay = new QVBoxLayout( this );
   lay->setMargin( 0 );
-  myEditor = new PyConsole_Editor( myInterp, this );
+  myEditor = new PyConsole_Editor( anInterp, this );
   char* synchronous = getenv("PYTHON_CONSOLE_SYNC");
   if (synchronous && atoi(synchronous))
   {
@@ -78,8 +75,8 @@ PyConsole_Console::PyConsole_Console( QWidget* parent, PyConsole_Interp* interp
 /**
  * Protected constructor.
  */
-PyConsole_Console::PyConsole_Console( QWidget* parent, PyConsole_Interp* i,  PyConsole_Editor* e)
-  : QWidget (parent), myEditor(e), myInterp(i)
+PyConsole_Console::PyConsole_Console( QWidget* parent, PyConsole_Interp* /*i*/,  PyConsole_Editor* e )
+  : QWidget (parent), myEditor(e)
 {}
 
 /*!
@@ -91,6 +88,11 @@ PyConsole_Console::~PyConsole_Console()
 {
 }
 
+PyConsole_Interp* PyConsole_Console::getInterp() const
+{
+  return myEditor ? myEditor->getInterp() : 0;
+} 
+
 /*!
   \brief Execute python command in the interpreter.
   \param command string with command and arguments
@@ -373,21 +375,18 @@ void PyConsole_Console::stopLog()
  * @param parent
  * @param interp
  */
-PyConsole_EnhConsole::PyConsole_EnhConsole( QWidget* parent, PyConsole_EnhInterp* interp)
-  : PyConsole_Console(parent, interp, 0)
+PyConsole_EnhConsole::PyConsole_EnhConsole( QWidget* parent, PyConsole_Interp* interp )
+  : PyConsole_Console( parent, interp, 0 )
 {
-  // create python interpreter
-  myInterp = interp;
-  if ( !myInterp )
-    myInterp = new PyConsole_EnhInterp();
+  PyConsole_Interp* anInterp = interp ? interp : new PyConsole_EnhInterp();
 
   // initialize Python interpretator
-  myInterp->initialize();
+  anInterp->initialize();
 
   // create editor console
   QVBoxLayout* lay = new QVBoxLayout( this );
   lay->setMargin( 0 );
-  myEditor = new PyConsole_EnhEditor( static_cast<PyConsole_EnhInterp*>(myInterp), this );
+  myEditor = new PyConsole_EnhEditor( anInterp, this );
   char* synchronous = getenv("PYTHON_CONSOLE_SYNC");
   if (synchronous && atoi(synchronous))
   {
index 54442c2cd9c162cf2ed847410406789064866075..b32b078e40f0eeb789ceda5da7cc3e975e20093b 100644 (file)
@@ -34,7 +34,6 @@
 
 class PyConsole_Interp;
 class PyConsole_Editor;
-class PyConsole_EnhInterp;
 
 class PYCONSOLE_EXPORT PyConsole_Console : public QWidget, public SUIT_PopupClient
 {
@@ -59,7 +58,7 @@ public:
   virtual ~PyConsole_Console();
 
   //! \brief Get python interperter
-  PyConsole_Interp*   getInterp() { return myInterp; } 
+  PyConsole_Interp*   getInterp() const;
   QFont               font() const;
   virtual void        setFont( const QFont& );
 
@@ -93,8 +92,6 @@ protected:
 
   PyConsole_Console( QWidget* parent, PyConsole_Interp*,  PyConsole_Editor*);
 
-
-  PyConsole_Interp*   myInterp;    //!< python interpreter
   PyConsole_Editor*   myEditor;    //!< python console editor widget
   QMap<int, QAction*> myActions;   //!< menu actions list
 };
@@ -109,7 +106,7 @@ class PYCONSOLE_EXPORT PyConsole_EnhConsole: public PyConsole_Console
   Q_OBJECT
 
 public:
-  PyConsole_EnhConsole( QWidget* parent, PyConsole_EnhInterp* interp = 0);
+  PyConsole_EnhConsole( QWidget* parent, PyConsole_Interp* interp = 0 );
   virtual ~PyConsole_EnhConsole() {}
 };
 
index 42ea63e4f6c5f6b07fe9c986f011fc07d6347c89..ecbb7ba78b2da9f52ceaebcced8712ecbd934b47 100644 (file)
 #include <QTextStream>
 #include <QChar>
 
+//VSR: uncomment below macro to support unicode text properly in SALOME
+//     current commented out due to regressions
+//#define PAL22528_UNICODE
+
+namespace
+{
+  QString fromUtf8( const char* txt )
+  {
+#ifdef PAL22528_UNICODE
+    return QString::fromUtf8( txt );
+#else
+    return QString( txt );
+#endif
+  }
+}
+
 static QString READY_PROMPT = ">>> ";
 static QString DOTS_PROMPT  = "... ";
 
@@ -140,8 +156,8 @@ void staticCallbackStdout( void* data, char* c )
 {
   if(!((PyConsole_Editor*)data)->isSuppressOutput()) {
     PyConsole_Editor* e = (PyConsole_Editor*)data;
-    e->putLog( QString::fromUtf8(c) );
-    QApplication::postEvent( e, new PrintEvent( QString::fromUtf8(c), false ) );
+    e->putLog( fromUtf8(c) );
+    QApplication::postEvent( e, new PrintEvent( fromUtf8(c), false ) );
   }
 }
 
@@ -149,8 +165,8 @@ void staticCallbackStderr( void* data, char* c )
 {
   if(!((PyConsole_Editor*)data)->isSuppressOutput()) {
     PyConsole_Editor* e = (PyConsole_Editor*)data;
-    e->putLog( QString::fromUtf8(c) );
-    QApplication::postEvent( e, new PrintEvent( QString::fromUtf8(c), true ) );
+    e->putLog( fromUtf8(c) );
+    QApplication::postEvent( e, new PrintEvent( fromUtf8(c), true ) );
   }
 }
 
@@ -191,16 +207,20 @@ PyConsole_Editor::PyConsole_Editor( PyConsole_Interp* theInterp,
 
 /*!
   \brief Destructor.
-
-  Does nothing for the moment.
 */
 PyConsole_Editor::~PyConsole_Editor()
 {
-  myInterp->destroy();
-  delete myInterp;
   myInterp = 0;
 }
 
+/*!
+  \brief Get Python interpreter
+*/
+PyConsole_Interp* PyConsole_Editor::getInterp() const
+{
+  return myInterp;
+}
+
 /*!
   \brief Get synchronous mode flag value.
   
index c939ef1b7da3e9fd78f947738427b11222426a42..5094f8687861c8451e83ff5594300961f884a6e3 100644 (file)
@@ -42,6 +42,8 @@ class PYCONSOLE_EXPORT PyConsole_Editor : public QTextEdit
 public:
   PyConsole_Editor( PyConsole_Interp* theInterp, QWidget *theParent = 0 );
   ~PyConsole_Editor();
+
+  PyConsole_Interp* getInterp() const;
   
   virtual void   addText( const QString& str, const bool newBlock = false, const bool isError = false );
   bool           isCommand( const QString& str ) const;
index 20a5ef1c5e7003f0d168e6dd5c0ad0d47daf69d6..aa73ac04b33bb752a9bad6dff386c93c6b729631 100644 (file)
@@ -43,7 +43,7 @@ const std::vector<QString> PyConsole_EnhEditor::SEPARATORS = \
  * @param interp the interpreter linked to the editor
  * @param parent parent widget
  */
-PyConsole_EnhEditor::PyConsole_EnhEditor(PyConsole_EnhInterp * interp, QWidget * parent) :
+PyConsole_EnhEditor::PyConsole_EnhEditor(PyConsole_Interp* interp, QWidget* parent) :
      PyConsole_Editor(interp, parent),
      _tab_mode(false),
      _cursor_pos(-1),
@@ -117,7 +117,8 @@ void PyConsole_EnhEditor::clearCompletion()
       setTextCursor(tc);
       textCursor().deletePreviousChar();
       // TODO: before wait for any TAB event to be completed
-      static_cast<PyConsole_EnhInterp *>(myInterp)->clearCompletion();
+      if ( myInterp ) 
+       myInterp->clearCompletion();
     }
   _tab_mode = false;
 }
@@ -222,8 +223,8 @@ PyInterp_Request* PyConsole_EnhEditor::createTabRequest( const QString& input )
       _compl_before_point = QString("");
     }
 
-  return new CompletionCommand( static_cast<PyConsole_EnhInterp *>(myInterp), _compl_before_point,
-                               _compl_after_point, this, isSync() );
+  return new CompletionCommand( myInterp, _compl_before_point,
+                               _compl_after_point, this, isSync() );
 }
 
 /**
@@ -231,7 +232,7 @@ PyInterp_Request* PyConsole_EnhEditor::createTabRequest( const QString& input )
  * @param matches list of possible completions
  * @param result return value
  */
-void PyConsole_EnhEditor::formatCompletion(const std::vector<QString> & matches, QString & result) const
+void PyConsole_EnhEditor::formatCompletion(const QStringList& matches, QString& result) const
 {
   int sz = matches.size();
 
@@ -255,90 +256,97 @@ void PyConsole_EnhEditor::formatCompletion(const std::vector<QString> & matches,
  */
 void PyConsole_EnhEditor::customEvent( QEvent* event )
 {
-  std::vector<QString> matches;
+  QStringList matches;
   QString first_match, comple_text, doc, base;
   QTextCursor cursor(textCursor());
   QTextBlockFormat bf;
   QTextCharFormat cf;
-  PyConsole_EnhInterp * interp = static_cast<PyConsole_EnhInterp *>(myInterp);
   int cursorPos;
 
   switch( event->type() )
   {
     case PyInterp_Event::ES_TAB_COMPLETE_OK:
+    {
       // Extract corresponding matches from the interpreter
-      matches = interp->getLastMatches();
+      matches = getInterp()->getLastMatches();
+      doc = getInterp()->getDocStr();
 
       if (matches.size() == 0)
-        {
-          // Completion successful but nothing returned.
-          _tab_mode = false;
-          _cursor_pos = -1;
-          return;
-        }
-
+      {
+       // Completion successful but nothing returned.
+       _tab_mode = false;
+       _cursor_pos = -1;
+       return;
+      }
+      
       // Only one match - complete directly and update doc string window
-      doc = interp->getDocStr();
       if (matches.size() == 1)
-        {
-          first_match = matches[0].mid(_compl_after_point.size());
-          cursor.insertText(first_match);
-          _tab_mode = false;
-          if (doc == QString(""))
-            emit updateDoc(formatDocHTML("(no documentation available)\n"));
-          else
-            emit updateDoc(formatDocHTML(doc));
-        }
+      {
+       first_match = matches[0].mid(_compl_after_point.size());
+       cursor.insertText(first_match);
+       _tab_mode = false;
+       if (doc.isEmpty())
+         emit updateDoc(formatDocHTML("(no documentation available)\n"));
+       else
+         emit updateDoc(formatDocHTML(doc));
+      }
       else
-        {
-          // Detect if there is a common base to all available completion
-          // In this case append this base to the text already
-          extractCommon(matches, base);
-          first_match = base.mid(_compl_after_point.size());
-          cursor.insertText(first_match);
-
-          // If this happens to match exaclty the first completion
-          // also provide doc
-          if (base == matches[0])
-            {
-              doc = formatDocHTML(doc);
-              emit updateDoc(doc);
-            }
-
-          // Print all matching completion in a "undo-able" block
-          cursorPos = cursor.position();
-          cursor.insertBlock();
-          cursor.beginEditBlock();
-
-          // Insert all matches
-          QTextCharFormat cf;
-          cf.setForeground(QBrush(Qt::darkGreen));
-          cursor.setCharFormat(cf);
-          formatCompletion(matches, comple_text);
-          cursor.insertText(comple_text);
-          cursor.endEditBlock();
-
-          // Position cursor where it was before inserting the completion list:
-          cursor.setPosition(cursorPos);
-          setTextCursor(cursor);
-        }
+      {
+       // Detect if there is a common base to all available completion
+       // In this case append this base to the text already
+       extractCommon(matches, base);
+       first_match = base.mid(_compl_after_point.size());
+       cursor.insertText(first_match);
+       
+       // If this happens to match exaclty the first completion
+       // also provide doc
+       if (base == matches[0])
+       {
+         doc = formatDocHTML(doc);
+         emit updateDoc(doc);
+       }
+       
+       // Print all matching completion in a "undo-able" block
+       cursorPos = cursor.position();
+       cursor.insertBlock();
+       cursor.beginEditBlock();
+       
+       // Insert all matches
+       QTextCharFormat cf;
+       cf.setForeground(QBrush(Qt::darkGreen));
+       cursor.setCharFormat(cf);
+       formatCompletion(matches, comple_text);
+       cursor.insertText(comple_text);
+       cursor.endEditBlock();
+       
+       // Position cursor where it was before inserting the completion list:
+       cursor.setPosition(cursorPos);
+       setTextCursor(cursor);
+      }
       break;
+    }
     case PyInterp_Event::ES_TAB_COMPLETE_ERR:
+    {
       // Tab completion was unsuccessful, switch off mode:
       _tab_mode = false;
       _cursor_pos = -1;
       break;
+    }
     case PyInterp_Event::ES_OK:
     case PyInterp_Event::ES_ERROR:
     case PyInterp_Event::ES_INCOMPLETE:
+    {
       // Before everything else, call super()
       PyConsole_Editor::customEvent(event);
       // If we are in multi_paste_mode, process the next item:
       multiLineProcessNextLine();
       break;
+    }
     default:
+    {
       PyConsole_Editor::customEvent( event );
       break;
+    }
   }
 }
 
@@ -347,7 +355,7 @@ void PyConsole_EnhEditor::customEvent( QEvent* event )
  * @param matches
  * @param result
  */
-void PyConsole_EnhEditor::extractCommon(const std::vector<QString> & matches, QString & result) const
+void PyConsole_EnhEditor::extractCommon(const QStringList& matches, QString& result) const
 {
   result = "";
   int charIdx = 0;
index c18738f29d2e59eb6bf7c1bdbdb6be4936541127..546ea98fc11099641b5ed83698fb07987653e56a 100644 (file)
 #define PYCONSOLE_ENHEDITOR_H_
 
 #include "PyConsole.h"
-
 #include "PyConsole_Editor.h"
+
 #include <QObject>
 #include <queue>
 
-class PyConsole_EnhInterp;
-
 /**
  * Enhanced Python editor handling tab completion.
  */
@@ -38,7 +36,7 @@ class PYCONSOLE_EXPORT PyConsole_EnhEditor: public PyConsole_Editor
   Q_OBJECT;
 
 public:
-  PyConsole_EnhEditor(PyConsole_EnhInterp * interp, QWidget * parent=0);
+  PyConsole_EnhEditor(PyConsole_Interp* interp, QWidget* parent = 0);
   virtual ~PyConsole_EnhEditor() {}
 
 signals:
@@ -83,14 +81,14 @@ protected:
   virtual void handleTab();
   virtual void handleBackTab();
   virtual void clearCompletion();
-  virtual void formatCompletion(const std::vector<QString> & matches, QString & result) const;
+  virtual void formatCompletion(const QStringList& matches, QString& result) const;
   virtual QString formatDocHTML(const QString & doc) const;
 
   virtual void multilinePaste(const QString & s);
   virtual void multiLineProcessNextLine();
 
 private:
-  void extractCommon(const std::vector<QString> & matches, QString & result) const;
+  void extractCommon(const QStringList& matches, QString& result) const;
 
 };
 
index 1f5defe0714bde0bcf29d7593ffcae097c4fcab9..eb5cb2705d1c18724ba74a5c590c10edc9556e5b 100644 (file)
@@ -37,6 +37,31 @@ static const char * tmp_k[] = {"and",  "as", "assert", "break",  "class",
 const std::vector<QString> PyConsole_EnhInterp::PYTHON_KEYWORDS = \
       std::vector<QString>(tmp_k, tmp_k+sizeof(tmp_k)/sizeof(tmp_k[0]));
 
+/*!
+  \brief Constructor
+*/
+PyConsole_EnhInterp::PyConsole_EnhInterp()
+  : PyConsole_Interp()
+{
+}
+
+/*!
+  \brief Destructor
+*/
+PyConsole_EnhInterp::~PyConsole_EnhInterp()
+{
+}
+
+QStringList PyConsole_EnhInterp::getLastMatches() const
+{
+  return _last_matches;
+}
+
+QString PyConsole_EnhInterp::getDocStr() const
+{
+  return _doc_str;
+}
+
 /*!
   \brief Run Python dir() command and saves the result internally in _lastPy
   \param dirArgument Python expression to pass to the dir command. The parsing of what the
@@ -45,7 +70,7 @@ const std::vector<QString> PyConsole_EnhInterp::PYTHON_KEYWORDS = \
   the user types "a_string_variable.rsp <TAB>", this is "rsp".
   \return command exit status - 0 = success
 */
-int PyConsole_EnhInterp::runDirCommand(const QString & dirArgument, const QString & startMatch)
+int PyConsole_EnhInterp::runDirCommand(const QString& dirArgument, const QString& startMatch)
 {
   int ret;
   std::vector<QString> v;
@@ -99,8 +124,9 @@ int PyConsole_EnhInterp::runDirCommand(const QString & dirArgument, const QStrin
  * @return -1 if the call to dir() or the parsing of the result failed, 0 otherwise.
  */
 int PyConsole_EnhInterp::runDirAndExtract(const QString& dirArgument,
-       const QString & startMatch, std::vector<QString> & result,
-       bool discardSwig) const
+                                         const QString& startMatch,
+                                         QStringList& result,
+                                         bool discardSwig) const
 {
   QRegExp re("^[A-Z].+_[A-Z]+[a-z]+.+$");  // discard SWIG static method, e.g. MEDCouplingUMesh_Blabla
   QString command("dir(" + dirArgument + ")");
@@ -146,9 +172,6 @@ int PyConsole_EnhInterp::runDirAndExtract(const QString& dirArgument,
  */
 void PyConsole_EnhInterp::clearCompletion()
 {
-  _last_matches.resize(0);
-  _doc_str = QString("");
+  _last_matches.clear();
+  _doc_str = "";
 }
-
-
-
index 4b16aa369c6330d8592c37e6bb08f70c4c040a4f..42c0ab35d9d4e576c1734c462ec5e0fd3537b0d9 100644 (file)
 class PYCONSOLE_EXPORT PyConsole_EnhInterp: public PyConsole_Interp
 {
 public:
-  PyConsole_EnhInterp()
-    : PyConsole_Interp(), _last_matches(0), _doc_str("")
-    {}
+  PyConsole_EnhInterp();
+  virtual ~PyConsole_EnhInterp();
 
-  virtual ~PyConsole_EnhInterp() {}
-
-  const std::vector<QString>& getLastMatches() const { return _last_matches; }
-  const QString & getDocStr() const                  { return _doc_str; }
+  virtual QStringList getLastMatches() const;
+  virtual QString getDocStr() const;
 
   virtual int runDirCommand(const QString& dirArgument, const QString& startMatch);
   virtual void clearCompletion();
@@ -55,13 +52,12 @@ protected:
   static const std::vector<QString> PYTHON_KEYWORDS;
 
   /** Last computed matches */
-  std::vector<QString> _last_matches;
+  QStringList _last_matches;
   /** Doc string of the first match - when only one match it will be displayed by the Editor*/
   QString _doc_str;
 
-  virtual int runDirAndExtract(const QString& dirArgument, const QString & startMatch,
-      std::vector<QString> & result, bool discardSwig=true) const;
-
+  virtual int runDirAndExtract(const QString& dirArgument, const QString& startMatch,
+                              QStringList& result, bool discardSwig=true) const;
 };
 
 #endif /* PYCONSOLE_ENHINTERP_H_ */
index 01c94fe20953b5c1012027d729682f9fb922fefd..e1365760a011ccc71636904297b458daf7a65ccd 100644 (file)
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : PyConsole_Interp.cxx
 //  Author : Nicolas REJNERI, Adrien BRUNETON
-//  Module : SALOME
-//
+
 #include "PyConsole_Interp.h"
 
 /*!
   Creates new python interpreter.
 */
 PyConsole_Interp::PyConsole_Interp(): PyInterp_Interp()
-{}
+{
+}
 
 /*!
   \brief Destructor.
 
   Does nothing for the moment.
 */
-PyConsole_Interp::~PyConsole_Interp() { }
+PyConsole_Interp::~PyConsole_Interp()
+{
+}
 
 /*! Sets the variable "__IN_SALOME_GUI_CONSOLE" to True.
 * This is not attached to a module (like salome_iapp.IN_SALOME_GUI_CONSOLE)
@@ -72,3 +72,22 @@ int PyConsole_Interp::afterRun()
 {
   return PyRun_SimpleString("__builtins__.__IN_SALOME_GUI_CONSOLE=False");
 }
+
+QStringList PyConsole_Interp::getLastMatches() const
+{
+  return QStringList();
+}
+
+QString PyConsole_Interp::getDocStr() const
+{
+  return QString();
+}
+
+int PyConsole_Interp::runDirCommand(const QString&, const QString& )
+{
+  return 0;
+}
+
+void PyConsole_Interp::clearCompletion()
+{
+}
index 5434e481347a9f00ef40b54d4e85c42362caf924..31e8f7e97a66c6167e5a203c9e66381e5f0d40a8 100644 (file)
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : PyConsole_Interp.h
 //  Author : Nicolas REJNERI, Adrien BRUNETON
-//  Module : SALOME
-//
+
 #ifndef PYCONSOLE_INTERP_H
 #define PYCONSOLE_INTERP_H
 
 #include "PyConsole.h"
+#include "PyInterp_Interp.h"   /// !!! WARNING !!! THIS INCLUDE MUST BE VERY FIRST !!!
 
-#include <PyInterp_Interp.h>   /// !!! WARNING !!! THIS INCLUDE MUST BE VERY FIRST !!!
+#include <QStringList>
 
 class PYCONSOLE_EXPORT PyConsole_Interp : public PyInterp_Interp
 {
@@ -40,6 +38,12 @@ public:
 
   virtual int afterRun();
   virtual int beforeRun();
+
+  virtual QStringList getLastMatches() const;
+  virtual QString getDocStr() const;
+
+  virtual int runDirCommand(const QString&, const QString&);
+  virtual void clearCompletion();
 };
 
 #endif // PYCONSOLE_INTERP_H
index 97bf7f2df41d5ade45bc41a4899d665e3ef5ee3a..12a5e612db80fed42db3991d891f3dfdcdcbfd18 100644 (file)
 // Created on: 3 avr. 2013
 
 #include "PyConsole_Request.h"
-
-#include "PyInterp_Event.h"
+#include "PyConsole_Interp.h"
 #include "PyConsole_Event.h"
-#include "PyConsole_EnhInterp.h"
-#include "PyConsole_EnhEditor.h"
+#include "PyInterp_Event.h"
 
 #include <QCoreApplication>
 
  * @param sync
  */
 ExecCommand::ExecCommand( PyInterp_Interp*        theInterp,
-               const QString&          theCommand,
-               PyConsole_Editor*       theListener,
-               bool                    sync )
-    : PyInterp_LockRequest( theInterp, theListener, sync ),
-      myCommand( theCommand ), myState( PyInterp_Event::ES_OK )
-  {}
+                         const QString&          theCommand,
+                         QObject*                theListener,
+                         bool                    theSync )
+  : PyInterp_LockRequest( theInterp, theListener, theSync ),
+    myCommand( theCommand ), myState( PyInterp_Event::ES_OK )
+{}
 
 /**
  * Execute the command by calling the run() method of the embedded interpreter.
@@ -50,13 +48,13 @@ ExecCommand::ExecCommand( PyInterp_Interp*        theInterp,
 void ExecCommand::execute()
 {
   if ( myCommand != "" )
-    {
-      int ret = getInterp()->run( myCommand.toUtf8().data() );
-      if ( ret < 0 )
-        myState = PyInterp_Event::ES_ERROR;
-      else if ( ret > 0 )
-        myState = PyInterp_Event::ES_INCOMPLETE;
-    }
+  {
+    int ret = getInterp()->run( myCommand.toUtf8().data() );
+    if ( ret < 0 )
+      myState = PyInterp_Event::ES_ERROR;
+    else if ( ret > 0 )
+      myState = PyInterp_Event::ES_INCOMPLETE;
+  }
 }
 
 /**
@@ -80,13 +78,13 @@ QEvent* ExecCommand::createEvent()
   \param theListener widget to get the notification messages
   \param sync        if True the request is processed synchronously
 */
-CompletionCommand::CompletionCommand( PyConsole_EnhInterp*  theInterp,
-               const QString&          input,
-               const QString&         startMatch,
-               PyConsole_EnhEditor*           theListener,
-               bool                    sync)
-     : PyInterp_LockRequest( theInterp, theListener, sync ),
-       _tabSuccess(false), _dirArg(input), _startMatch(startMatch)
+CompletionCommand::CompletionCommand( PyInterp_Interp*   theInterp,
+                                     const QString&     theInput,
+                                     const QString&     theStartMatch,
+                                     QObject*           theListener,
+                                     bool               theSync )
+  : PyInterp_LockRequest( theInterp, theListener, theSync ),
+    _tabSuccess(false), _dirArg(theInput), _startMatch(theStartMatch)
 {}
 
 /**
@@ -95,12 +93,8 @@ CompletionCommand::CompletionCommand( PyConsole_EnhInterp*  theInterp,
  */
 void CompletionCommand::execute()
 {
-  PyConsole_EnhInterp * interp = static_cast<PyConsole_EnhInterp *>(getInterp());
-    int ret = interp->runDirCommand( _dirArg,  _startMatch);
-    if (ret == 0)
-      _tabSuccess = true;
-    else
-      _tabSuccess = false;
+  int ret = static_cast<PyConsole_Interp*>(getInterp())->runDirCommand( _dirArg,  _startMatch );
+  _tabSuccess = ret == 0;
 }
 
 /**
@@ -110,9 +104,5 @@ void CompletionCommand::execute()
 QEvent* CompletionCommand::createEvent()
 {
   int typ = _tabSuccess ? PyInterp_Event::ES_TAB_COMPLETE_OK : PyInterp_Event::ES_TAB_COMPLETE_ERR;
-
   return new PyInterp_Event( typ, this);
 }
-
-
-
index c2f22ff432bad9f9efc245bb20e2e32f344fe141..5605cc7fa5fc45690eab7990c66a15d8f8d3c400 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef PYCONSOLE_REQUEST_H_
 #define PYCONSOLE_REQUEST_H_
 
-#include "PyConsole.h"
 #include "PyInterp_Request.h"
 
 #include <vector>
@@ -31,7 +30,6 @@
 #include <QEvent>
 
 class PyInterp_Interp;
-class PyConsole_Editor;
 
 /*!
   \class ExecCommand
@@ -52,8 +50,8 @@ public:
   */
   ExecCommand( PyInterp_Interp*        theInterp,
                const QString&          theCommand,
-               PyConsole_Editor*       theListener,
-               bool                    sync = false );
+               QObject*                theListener,
+               bool                    theSync = false );
 
 protected:
   /*!
@@ -73,17 +71,14 @@ private:
   int     myState;     //!< Python command execution status
 };
 
-class PyConsole_EnhInterp;
-class PyConsole_EnhEditor;
-
 class CompletionCommand : public PyInterp_LockRequest
 {
 public:
-  CompletionCommand( PyConsole_EnhInterp*      theInterp,
-               const QString&          input,
-               const QString&          startMatch,
-               PyConsole_EnhEditor*    theListener,
-               bool                    sync = false );
+  CompletionCommand( PyInterp_Interp*     theInterp,
+                    const QString&       theInput,
+                    const QString&       theStartMatch,
+                    QObject*             theListener,
+                    bool                 theSync = false );
 
 
 protected:
@@ -99,7 +94,6 @@ protected:
 
   virtual void execute();
   virtual QEvent* createEvent();
-
 };
 
 #endif /* PYCONSOLE_REQUEST_H_ */
index 4446aa9bdd2857109409b613bdc82733cd76cb74..5f8faa51a36f281ad38f6bbdcfaaff7429b44b6f 100755 (executable)
     </message>
     <message>
         <source>EDIT_STARTLOG_CMD</source>
-        <translation type="unfinished">Start &amp;Log</translation>
+        <translation>Démarrer une &amp;trace</translation>
     </message>
     <message>
         <source>EDIT_STOPLOG_CMD</source>
-        <translation type="unfinished">Stop &amp;Log</translation>
+        <translation>Arrêter la &amp;trace</translation>
     </message>
 </context>
 <context>
index c993c7cc5e3b735b80514c4e0f1eec75eb837cc6..d29ce3d7fc4fa61b62d5db9f40fa72bee084b4ab 100644 (file)
       <translation>スクリプト コマンドを生成します。(&amp;u)</translation>
     </message>
     <message>
-        <source>EDIT_STARTLOG_CMD</source>
-        <translation type="unfinished">Start &amp;Log</translation>
+      <source>EDIT_STARTLOG_CMD</source>
+      <translation type="unfinished">Start &amp;Log</translation>
     </message>
     <message>
-        <source>EDIT_STOPLOG_CMD</source>
-        <translation type="unfinished">Stop &amp;Log</translation>
+      <source>EDIT_STOPLOG_CMD</source>
+      <translation type="unfinished">Stop &amp;Log</translation>
     </message>
   </context>
   <context>
       <translation>スクリプト コマンドを生成します。</translation>
     </message>
     <message>
-        <source>TOT_SAVE_PYLOG</source>
-        <translation type="unfinished">Save log</translation>
+      <source>TOT_SAVE_PYLOG</source>
+      <translation type="unfinished">Save log</translation>
     </message>
     <message>
       <source>PYTHON_FILES_FILTER</source>
       <translation>ファイル (*.py) PYTHON</translation>
     </message>
     <message>
-        <source>LOG_FILES_FILTER</source>
-        <translation type="unfinished">Log files (*.log *.txt)</translation>
+      <source>LOG_FILES_FILTER</source>
+      <translation type="unfinished">Log files (*.log *.txt)</translation>
     </message>
     <message>
-        <source>ERR_FILE_NOT_WRITABLE</source>
-        <translation type="unfinished">File is not writable!</translation>
+      <source>ERR_FILE_NOT_WRITABLE</source>
+      <translation type="unfinished">File is not writable!</translation>
     </message>
   </context>
 </TS>
index b1a89f82bc0e1e52fcdbf4b52e86f0aa58a28f62..099033ef959f2d503eed1bcd22f5b7f48c7510db 100755 (executable)
@@ -105,7 +105,9 @@ SET(qtx_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
 SET(_rcc_RESOURCES Qtx.qrc)
 
 # resource files / to be processed by lrelease
-SET(_ts_RESOURCES resources/Qtx_msg_fr.ts)
+SET(_ts_RESOURCES resources/Qtx_msg_fr.ts
+  resources/Qtx_msg_ja.ts
+)
 
 # --- sources ---
 
diff --git a/src/Qtx/resources/Qtx_msg_ja.ts b/src/Qtx/resources/Qtx_msg_ja.ts
new file mode 100644 (file)
index 0000000..4911a84
--- /dev/null
@@ -0,0 +1,498 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ja" sourcelanguage="en">
+  <context>
+    <name>QtxTreeView</name>
+    <message>
+      <source>Enable sorting</source>
+      <translation>並べ替えの有効化</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxWorkspaceAction</name>
+    <message>
+      <source>Arranges the windows as overlapping tiles</source>
+      <translation>ウィンドウを重ねて表示</translation>
+    </message>
+    <message>
+      <source>Cascade</source>
+      <translation>重ねて表示</translation>
+    </message>
+    <message>
+      <source>Arranges the windows as nonoverlapping tiles</source>
+      <translation>ウィンドウのタイル表示</translation>
+    </message>
+    <message>
+      <source>Tile</source>
+      <translation>タイル</translation>
+    </message>
+    <message>
+      <source>Arranges the windows as nonoverlapping horizontal tiles</source>
+      <translation>ウィンドウを重ならない水平表示</translation>
+    </message>
+    <message>
+      <source>Tile horizontally</source>
+      <translation>上下に並べて表示</translation>
+    </message>
+    <message>
+      <source>Arranges the windows as nonoverlapping vertical tiles</source>
+      <translation>ウィンドウを重ならない垂直表示</translation>
+    </message>
+    <message>
+      <source>Tile vertically</source>
+      <translation>水平に並べて表示</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxMainWindow</name>
+    <message>
+      <source>Menu bar</source>
+      <translation>メニュー バー</translation>
+    </message>
+    <message>
+      <source>Status bar</source>
+      <translation>ステータスバー</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxPathDialog</name>
+    <message>
+      <source>Open file</source>
+      <translation>ファイルを開く</translation>
+    </message>
+    <message>
+      <source>Save file</source>
+      <translation>ファイルの保存</translation>
+    </message>
+    <message>
+      <source>File name</source>
+      <translation>ファイル名</translation>
+    </message>
+    <message>
+      <source>File name not specified</source>
+      <translation>ファイル名が指定されていません</translation>
+    </message>
+    <message>
+      <source>File \"%1\" does not exist</source>
+      <translation>ファイル \"%1\" がありません</translation>
+    </message>
+    <message>
+      <source>File \"%1\" already exist. Do you want to overwrite it?</source>
+      <translation>ファイル \"%1\" が既にあります。 上書きしますか。</translation>
+    </message>
+    <message>
+      <source>Directory \"%1\" does not exist</source>
+      <translation>ディレクトリ \"%1\" がありません</translation>
+    </message>
+    <message>
+      <source>Directory \"%1\" can't be created because file with the same name exist</source>
+      <translation>同名のファイルがあるので、ディレクトリ \"%1\" を作成できません。</translation>
+    </message>
+    <message>
+      <source>Directory \"%1\" not empty. Do you want to remove all files in this directory?</source>
+      <translation>ディレクトリ \"%1\" が空でないです。 すべてのファイルを削除しますか。</translation>
+    </message>
+    <message>
+      <source>File dialog</source>
+      <translation>ファイル ダイアログ</translation>
+    </message>
+    <message>
+      <source>All files (*.*)</source>
+      <translation>すべてのファイル (*.*)</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxFontEdit</name>
+    <message>
+      <source>B</source>
+      <translatorcomment>Bold</translatorcomment>
+      <translation>B</translation>
+    </message>
+    <message>
+      <source>I</source>
+      <translatorcomment>Italic</translatorcomment>
+      <translation>I</translation>
+    </message>
+    <message>
+      <source>U</source>
+      <translatorcomment>Underline</translatorcomment>
+      <translation>U</translation>
+    </message>
+    <message>
+      <source>S</source>
+      <translatorcomment>Strikethrough</translatorcomment>
+      <translation>S</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxPathListEdit</name>
+    <message>
+      <source>Warning</source>
+      <translation>警告</translation>
+    </message>
+    <message>
+      <source>Path \"%1\" doesn't exist. Add it to list anyway?</source>
+      <translation>パス \"%1\" がありません。 リストに追加しますか。</translation>
+    </message>
+    <message>
+      <source>Error</source>
+      <translation>エラー</translation>
+    </message>
+    <message>
+      <source>Location \"%1\" doesn't point to file</source>
+      <translation>場所 \"%1\" はファイルを指していません</translation>
+    </message>
+    <message>
+      <source>Location \"%1\" doesn't point to directory</source>
+      <translation>場所 \"%1\" はディレクトリを指していません</translation>
+    </message>
+    <message>
+      <source>Path \"%1\" already exist in the list</source>
+      <translation>パス \"%1\" は既にリストにあります</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxMRUAction</name>
+    <message>
+      <source>Most Recently Used</source>
+      <translation>最近使用した</translation>
+    </message>
+    <message>
+      <source>Clear</source>
+      <translation>消去</translation>
+    </message>
+    <message>
+      <source>&lt;Empty&gt;</source>
+      <translation>&lt;空&gt;</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxDialog</name>
+    <message>
+      <source>&amp;OK</source>
+      <translation>&amp;OK</translation>
+    </message>
+    <message>
+      <source>&amp;Cancel</source>
+      <translation>キャンセル(&amp;C)</translation>
+    </message>
+    <message>
+      <source>C&amp;lose</source>
+      <translation>閉じる(&amp;l)</translation>
+    </message>
+    <message>
+      <source>&amp;Help</source>
+      <translation>ヘルプ(&amp;H)</translation>
+    </message>
+    <message>
+      <source>&amp;Apply</source>
+      <translation>適用(&amp;A)</translation>
+    </message>
+    <message>
+      <source>&amp;Yes</source>
+      <translation>&amp;Yes</translation>
+    </message>
+    <message>
+      <source>&amp;No</source>
+      <translation>&amp;No</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxSearchTool</name>
+    <message>
+      <source>Case sensitive</source>
+      <translation>大文字小文字を区別</translation>
+    </message>
+    <message>
+      <source>Regular expression</source>
+      <translation>正規表現</translation>
+    </message>
+    <message>
+      <source>Wrap search</source>
+      <translation>検索を続けます</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxSplash</name>
+    <message>
+      <source>Error</source>
+      <translation>エラー</translation>
+    </message>
+    <message>
+      <source>&amp;OK</source>
+      <translation>&amp;OK</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxWorkstack</name>
+    <message>
+      <source>Split vertically</source>
+      <translation>垂直方向分割</translation>
+    </message>
+    <message>
+      <source>Split horizontally</source>
+      <translation>水平方向分割</translation>
+    </message>
+    <message>
+      <source>Close</source>
+      <translation>閉じる</translation>
+    </message>
+    <message>
+      <source>Rename</source>
+      <translation>名前変更</translation>
+    </message>
+    <message>
+      <source>Enter new name:</source>
+      <translation>新規名前の入力:</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxWorkstackAction</name>
+    <message>
+      <source>Split the active window on two vertical parts</source>
+      <translation>アクティブウィンドウの垂直2分割</translation>
+    </message>
+    <message>
+      <source>Split vertically</source>
+      <translation>垂直方向分割</translation>
+    </message>
+    <message>
+      <source>Split the active window on two horizontal parts</source>
+      <translation>アクティブウィンドウの水平2分割</translation>
+    </message>
+    <message>
+      <source>Split horizontally</source>
+      <translation>水平方向分割</translation>
+    </message>
+    <message>
+      <source>Arrange Views</source>
+      <translation>ビューの配置</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxColorButton</name>
+    <message>
+      <source>Auto</source>
+      <translation>自動</translation>
+    </message>
+    <message>
+      <source>Other colors...</source>
+      <translation>他の色...</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxColorScale</name>
+    <message>
+      <source>Color scale</source>
+      <translation>カラースケール</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxBackgroundTool</name>
+    <message>
+      <source>Browse...</source>
+      <translation>ブラウズ...</translation>
+    </message>
+    <message>
+      <source>Not implemented yet</source>
+      <translation>まだ実装されていません</translation>
+    </message>
+    <message>
+      <source>Center</source>
+      <translation>センター</translation>
+    </message>
+    <message>
+      <source>Tile</source>
+      <translation>タイル</translation>
+    </message>
+    <message>
+      <source>Stretch</source>
+      <translation>ストレッチ</translation>
+    </message>
+    <message>
+      <source>Images Files (*.bmp *.png *.jpg *.jpeg *.gif *.tiff)</source>
+      <translation>イメージ ファイル (*.bmp *.png *.jpg *.jpeg *.gif * .tiff)</translation>
+    </message>
+    <message>
+      <source>Image</source>
+      <translation>イメージ</translation>
+    </message>
+    <message>
+      <source>Single Color</source>
+      <translation>一色</translation>
+    </message>
+    <message>
+      <source>Custom</source>
+      <translation>カスタム</translation>
+    </message>
+    <message>
+      <source>Select Picture</source>
+      <translation>画像選択</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxBackgroundDialog</name>
+    <message>
+      <source>Change background</source>
+      <translation>背景の変更</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxSplitDlg</name>
+    <message>
+      <source>Arrange views</source>
+      <translation>ビューの配置</translation>
+    </message>
+    <message>
+      <source>Create sub-views</source>
+      <translation>サブビューの作成</translation>
+    </message>
+    <message>
+      <source>Views Layout</source>
+      <translation>ビューレイアウト</translation>
+    </message>
+    <message>
+      <source>Sub-views Layout</source>
+      <translation>サブ ビュー レイアウト</translation>
+    </message>
+    <message>
+      <source>Views List</source>
+      <translation>ビューのリスト</translation>
+    </message>
+    <message>
+      <source>Close remaining views</source>
+      <translation>残りのビューを閉じる</translation>
+    </message>
+    <message>
+      <source>Stack remaining views in the last area</source>
+      <translation>最後の領域の残りのビューをスタック</translation>
+    </message>
+    <message>
+      <source>Sub-views Properties</source>
+      <translation>サブ ビュー プロパティ</translation>
+    </message>
+    <message>
+      <source>Sub-view</source>
+      <translation>サブビュー</translation>
+    </message>
+    <message>
+      <source>&amp;Apply</source>
+      <translation>適用(&amp;A)</translation>
+    </message>
+    <message>
+      <source>&amp;Close</source>
+      <translation>閉じる(&amp;C)</translation>
+    </message>
+  </context>
+  <context>
+    <name>QtxWebBrowser</name>
+    <message>
+      <source>Open URL</source>
+      <translation>URL を開く</translation>
+    </message>
+    <message>
+      <source>Open in</source>
+      <translation type="unfinished">Open in</translation>
+    </message>
+    <message>
+      <source>Save file</source>
+      <translation>ファイルの保存</translation>
+    </message>
+    <message>
+      <source>&amp;Browse...</source>
+      <translation>ブラウズ...(&amp;B)</translation>
+    </message>
+    <message>
+      <source>Use this program for all files of this type</source>
+      <translation type="unfinished">Use this program for all files of this type</translation>
+    </message>
+    <message>
+      <source>&amp;OK</source>
+      <translation>OK(&amp;O)</translation>
+    </message>
+    <message>
+      <source>&amp;Cancel</source>
+      <translation>キャンセル(&amp;C)</translation>
+    </message>
+    <message>
+      <source>You are opening the file</source>
+      <translation type="unfinished">You are opening the file</translation>
+    </message>
+    <message>
+      <source>Please choose the action to be done</source>
+      <translation type="unfinished">Please choose the action to be done</translation>
+    </message>
+    <message>
+      <source>Choose program</source>
+      <translation type="unfinished">Choose program</translation>
+    </message>
+    <message>
+      <source>Go Back</source>
+      <translation>戻る</translation>
+    </message>
+    <message>
+      <source>Go Forward</source>
+      <translation>進む</translation>
+    </message>
+    <message>
+      <source>Navigation</source>
+      <translation type="unfinished">Navigation</translation>
+    </message>
+    <message>
+      <source>&amp;File</source>
+      <translation>ファイル (&amp;F)</translation>
+    </message>
+    <message>
+      <source>&amp;Open...</source>
+      <translation>開く(&amp;O)...</translation>
+    </message>
+    <message>
+      <source>&amp;Find in text...</source>
+      <translation type="unfinished">&amp;Find in text...</translation>
+    </message>
+    <message>
+      <source>&amp;Find next</source>
+      <translation type="unfinished">&amp;Find next</translation>
+    </message>
+    <message>
+      <source>&amp;Find previous</source>
+      <translation type="unfinished">&amp;Find previous</translation>
+    </message>
+    <message>
+      <source>&amp;Close</source>
+      <translation>閉じる(&amp;C)</translation>
+    </message>
+    <message>
+      <source>&amp;Help</source>
+      <translation>ヘルプ(&amp;H)</translation>
+    </message>
+    <message>
+      <source>&amp;About...</source>
+      <translation type="unfinished">&amp;About...</translation>
+    </message>
+    <message>
+      <source>About %1</source>
+      <translation type="unfinished">About %1</translation>
+    </message>
+    <message>
+      <source>Help Browser</source>
+      <translation type="unfinished">Help Browser</translation>
+    </message>
+    <message>
+      <source>Error</source>
+      <translation>エラー</translation>
+    </message>
+    <message>
+      <source>Can't save file:\n%1</source>
+      <translation>Can't save file:\n%1</translation>
+    </message>
+    <message>
+      <source>Open file</source>
+      <translation>ファイルを開く</translation>
+    </message>
+    <message>
+      <source>%1 has been developed using %2</source>
+      <translation type="unfinished">%1 has been developed using %2</translation>
+    </message>
+  </context>
+</TS>
index 4b73279a700c3c34c38c8323852d078342d20d0c..d19f2ab5eed9aa5e526c53912d029703951396c6 100644 (file)
@@ -246,6 +246,18 @@ void SALOME_PYQT_Module::preferencesChanged( const QString& section, const QStri
   myHelper->preferencesChanged( section, parameter );
 }
 
+/*!
+  \brief Called when study is closed
+  \param study study being closed
+  \sa PyModuleHelper::studyClosed()
+*/
+void SALOME_PYQT_Module::studyClosed( SUIT_Study* study )
+{
+  // call helper
+  myHelper->modelClosed( study );
+  SalomeApp_Module::studyClosed( study );
+}
+
 /*!
   \brief Test if object \a what can be dragged by the user.
   \param what data object being tested
index dbe410ca8704b0a5c0763b11bcde7bff1554fc91..3e483dfec592de75fcbd73c5c0ef1a11895f7721 100644 (file)
@@ -53,6 +53,7 @@ public:
   void            contextMenuPopup( const QString&, QMenu*, QString& );
   void            createPreferences();
   void            preferencesChanged( const QString&, const QString& );
+  void            studyClosed( SUIT_Study* );
 
   // drag-n-drop support
   bool            isDraggable( const SUIT_DataObject* ) const;
index e6edb9d988be2be0a08b015e062438d59d73dac0..595e1070176f1c85dfc25acda7bb1bf438fdce97 100644 (file)
@@ -2698,7 +2698,9 @@ public:
 };
 int SalomePyQt::createView( const QString& type, QWidget* w )
 {
-  return ProcessEvent( new TCreateViewWg( type, w ) );
+  int ret = ProcessEvent( new TCreateViewWg( type, w ) );
+  QCoreApplication::processEvents();
+  return ret;
 }
 
 /*!
index 51354196a3206ef9b134cf0a9dca08ab68e1e18e..47b4eaa2e5001c86a379194e3e02c016c007ce55 100755 (executable)
@@ -409,6 +409,8 @@ bool STD_Application::closeDoc( bool ask )
 bool STD_Application::closeActiveDoc( bool permanently )
 {
   SUIT_Study* study = activeStudy();
+  if ( !study ) // no active study
+    return true;
 
   beforeCloseDoc( study );
 
index 22a93e45d6ffd428f40a3dbd7fc9624726f4b5bc..955302b269b91a19cb49a94fb8f412712d0db5ba 100755 (executable)
@@ -105,8 +105,8 @@ SET(_other_HEADERS
 SET(_internal_HEADERS
   SVTK_SelectorDef.h
   SVTK_Trihedron.h
-  vtkPVAxesActor.h
-  vtkPVAxesWidget.h
+  salomevtkPVAxesActor.h
+  salomevtkPVAxesWidget.h
 )
 
 # header files / to install
@@ -181,8 +181,8 @@ SET(_other_SOURCES
   SVTK_ViewModel.cxx
   SVTK_ViewParameterDlg.cxx
   SVTK_ViewWindow.cxx
-  vtkPVAxesActor.cxx
-  vtkPVAxesWidget.cxx
+  salomevtkPVAxesActor.cxx
+  salomevtkPVAxesWidget.cxx
 )
 
 # sources / to compile
index 49b496192e1a58b1e1393383a0dae7826f3524c0..19f9249666c5011572cd0c56a5b17df30de265f4 100755 (executable)
@@ -93,8 +93,8 @@
 #include "SVTK_Recorder.h"
 #include "SVTK_RecorderDlg.h"
 
-#include "vtkPVAxesWidget.h"
-#include "vtkPVAxesActor.h"
+#include "salomevtkPVAxesWidget.h"
+#include "salomevtkPVAxesActor.h"
 
 #include "SALOME_ListIO.hxx"
 
@@ -213,14 +213,14 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   
   setCentralWidget(myInteractor);
   
-  myAxesWidget = vtkPVAxesWidget::New();
+  myAxesWidget = salomevtk::vtkPVAxesWidget::New();
   myAxesWidget->SetParentRenderer(aRenderer->GetDevice());
   myAxesWidget->SetViewport(0, 0, 0.25, 0.25);
   myAxesWidget->SetInteractor(myInteractor->GetDevice());
   myAxesWidget->SetEnabled(1);
   myAxesWidget->SetInteractive(0);
 
-  vtkPVAxesActor* anAxesActor = myAxesWidget->GetAxesActor();
+  salomevtk::vtkPVAxesActor* anAxesActor = myAxesWidget->GetAxesActor();
   anAxesActor->GetXAxisTipProperty()->SetColor(   1.0, 0.0, 0.0 );
   anAxesActor->GetXAxisShaftProperty()->SetColor( 1.0, 0.0, 0.0 );
   anAxesActor->GetXAxisLabelProperty()->SetColor( 1.0, 0.0, 0.0 );
index ef6eb8a55bb196ec57e382afe6af95cb6fe9bb11..ea6f672369d9060d1c926d6c81af21f520ab047b 100755 (executable)
@@ -66,7 +66,10 @@ class SVTK_KeyFreeInteractorStyle;
 class SVTK_ViewParameterDlg;
 class SVTK_Recorder;
 
-class vtkPVAxesWidget;
+namespace salomevtk
+{
+  class vtkPVAxesWidget;
+}
 
 class vtkObject;
 class QtxAction;
@@ -453,7 +456,7 @@ protected:
   int myToolBar;
   int myRecordingToolBar;
 
-  vtkPVAxesWidget* myAxesWidget;
+  salomevtk::vtkPVAxesWidget* myAxesWidget;
   Qtx::BackgroundData myBackground;
 
 private:
index 983fa07a1e456b57993fd160c246f07960ddd5e0..477f0987f0227bd3fa128660b5c129a2b28ff26c 100644 (file)
     </message>
     <message>
       <source>DSC_SVTK_SCALING</source>
-      <translation>座標のスケールの軸を変更します。</translation>
+      <translation>スケーリング</translation>
     </message>
     <message>
       <source>MNU_SVTK_SCALING</source>
diff --git a/src/SVTK/salomevtkPVAxesActor.cxx b/src/SVTK/salomevtkPVAxesActor.cxx
new file mode 100644 (file)
index 0000000..da12e35
--- /dev/null
@@ -0,0 +1,820 @@
+/*=========================================================================
+
+   Program: ParaView
+   Module:    $RCSfile$
+
+   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+   All rights reserved.
+
+   ParaView is a free software; you can redistribute it and/or modify it
+   under the terms of the ParaView license version 1.2. 
+
+   See License_v1.2.txt for the full ParaView license.
+   A copy of this license can be obtained by contacting
+   Kitware Inc.
+   28 Corporate Drive
+   Clifton Park, NY 12065
+   USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+//
+// VSR 03/12/2014: the original file vtkPVAxesActor.cxx has been renamed to salomevtkPVAxesActor.cxx
+// to avoid collisions with native VTK/ParaView classes
+
+#include "salomevtkPVAxesActor.h" // changed by SALOME
+#include "vtkObject.h"
+#include "vtkObjectFactory.h"
+
+#include "vtkActor.h"
+#include "vtkPropCollection.h"
+#include "vtkProperty.h"
+#include "vtkRenderWindow.h"
+#include "vtkTransform.h"
+#include "vtkCylinderSource.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkLineSource.h"
+#include "vtkPolyData.h"
+#include "vtkConeSource.h"
+#include "vtkSphereSource.h"
+#include "vtkVectorText.h"
+#include "vtkFollower.h"
+#include "vtkRenderer.h"
+
+#include <math.h>
+
+// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace
+// to avoid collisions with native VTK/ParaView classes
+namespace salomevtk
+{
+
+vtkStandardNewMacro(vtkPVAxesActor);
+
+vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData );
+vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedShaft, vtkPolyData );
+
+//-----------------------------------------------------------------------------
+vtkPVAxesActor::vtkPVAxesActor()
+{
+  this->XAxisLabelText = NULL;
+  this->YAxisLabelText = NULL;
+  this->ZAxisLabelText = NULL;
+    
+  this->SetXAxisLabelText("X");
+  this->SetYAxisLabelText("Y");
+  this->SetZAxisLabelText("Z");
+  
+  //colors chosen to match the output of vtkAxes.cxx's LUT.
+  this->XAxisShaft = vtkActor::New();
+  this->XAxisShaft->GetProperty()->SetColor(1, 0, 0);
+  this->YAxisShaft = vtkActor::New();
+  this->YAxisShaft->GetProperty()->SetColor(1, 1, 0);
+  this->ZAxisShaft = vtkActor::New();
+  this->ZAxisShaft->GetProperty()->SetColor(0, 1, 0);
+
+  this->XAxisTip = vtkActor::New();
+  this->XAxisTip->GetProperty()->SetColor(1, 0, 0);
+  this->YAxisTip = vtkActor::New();
+  this->YAxisTip->GetProperty()->SetColor(1, 1, 0);
+  this->ZAxisTip = vtkActor::New();
+  this->ZAxisTip->GetProperty()->SetColor(0, 1, 0);
+
+  this->CylinderSource = vtkCylinderSource::New();
+  this->CylinderSource->SetHeight(1.0);
+  
+  this->LineSource = vtkLineSource::New();
+  this->LineSource->SetPoint1( 0.0, 0.0, 0.0 );
+  this->LineSource->SetPoint2( 0.0, 1.0, 0.0 );
+
+  this->ConeSource = vtkConeSource::New();
+  this->ConeSource->SetDirection( 0, 1, 0 );
+  this->ConeSource->SetHeight( 1.0 );
+   
+  this->SphereSource = vtkSphereSource::New();
+  
+  vtkPolyDataMapper *shaftMapper = vtkPolyDataMapper::New();
+  
+  this->XAxisShaft->SetMapper( shaftMapper );
+  this->YAxisShaft->SetMapper( shaftMapper );
+  this->ZAxisShaft->SetMapper( shaftMapper );
+  
+  shaftMapper->Delete();
+
+  vtkPolyDataMapper *tipMapper = vtkPolyDataMapper::New();
+  
+  this->XAxisTip->SetMapper( tipMapper );
+  this->YAxisTip->SetMapper( tipMapper );
+  this->ZAxisTip->SetMapper( tipMapper );
+  
+  tipMapper->Delete();
+
+  this->TotalLength[0] = 1.0;
+  this->TotalLength[1] = 1.0;
+  this->TotalLength[2] = 1.0;
+  this->NormalizedShaftLength[0] = 0.8;
+  this->NormalizedShaftLength[1] = 0.8;
+  this->NormalizedShaftLength[2] = 0.8;
+
+  this->NormalizedTipLength[0] = 0.2;
+  this->NormalizedTipLength[1] = 0.2;
+  this->NormalizedTipLength[2] = 0.2;
+
+  this->ConeResolution = 16;
+  this->SphereResolution = 16;
+  this->CylinderResolution = 16;
+  
+  this->ConeRadius = 0.4;
+  this->SphereRadius = 0.5;
+  this->CylinderRadius = 0.05;
+  
+  this->XAxisLabelPosition = 1;
+  this->YAxisLabelPosition = 1;
+  this->ZAxisLabelPosition = 1;
+  
+  this->ShaftType = vtkPVAxesActor::LINE_SHAFT;
+  this->TipType   = vtkPVAxesActor::CONE_TIP;
+
+  this->UserDefinedTip = NULL;
+  this->UserDefinedShaft = NULL;
+
+  this->XAxisVectorText = vtkVectorText::New();
+  this->YAxisVectorText = vtkVectorText::New();
+  this->ZAxisVectorText = vtkVectorText::New();
+  
+  this->XAxisLabel = vtkFollower::New();
+  this->YAxisLabel = vtkFollower::New();
+  this->ZAxisLabel = vtkFollower::New();
+  
+  vtkPolyDataMapper *xmapper = vtkPolyDataMapper::New();
+  vtkPolyDataMapper *ymapper = vtkPolyDataMapper::New();
+  vtkPolyDataMapper *zmapper = vtkPolyDataMapper::New();
+  
+  xmapper->SetInputConnection( this->XAxisVectorText->GetOutputPort() );
+  ymapper->SetInputConnection( this->YAxisVectorText->GetOutputPort() );
+  zmapper->SetInputConnection( this->ZAxisVectorText->GetOutputPort() );
+  
+  this->XAxisLabel->SetMapper( xmapper );
+  this->YAxisLabel->SetMapper( ymapper );
+  this->ZAxisLabel->SetMapper( zmapper );
+  
+  xmapper->Delete();
+  ymapper->Delete();
+  zmapper->Delete();
+  
+  this->UpdateProps();
+}
+
+//-----------------------------------------------------------------------------
+vtkPVAxesActor::~vtkPVAxesActor()
+{
+  this->CylinderSource->Delete();
+  this->LineSource->Delete();
+  this->ConeSource->Delete();
+  this->SphereSource->Delete();  
+  
+  this->XAxisShaft->Delete();
+  this->YAxisShaft->Delete();
+  this->ZAxisShaft->Delete();  
+
+  this->XAxisTip->Delete();
+  this->YAxisTip->Delete();
+  this->ZAxisTip->Delete();  
+  
+  this->SetUserDefinedTip( NULL );
+  this->SetUserDefinedShaft( NULL );
+  
+  this->SetXAxisLabelText( NULL );
+  this->SetYAxisLabelText( NULL );
+  this->SetZAxisLabelText( NULL );
+  
+  this->XAxisVectorText->Delete();
+  this->YAxisVectorText->Delete();
+  this->ZAxisVectorText->Delete();
+
+  this->XAxisLabel->Delete();
+  this->YAxisLabel->Delete();
+  this->ZAxisLabel->Delete();
+}
+
+//-----------------------------------------------------------------------------
+// Shallow copy of an actor.
+void vtkPVAxesActor::ShallowCopy(vtkProp *prop)
+{
+  vtkPVAxesActor *a = vtkPVAxesActor::SafeDownCast(prop);
+  if ( a != NULL )
+    {
+    }
+
+  // Now do superclass
+  this->vtkProp3D::ShallowCopy(prop);
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::GetActors(vtkPropCollection *ac)
+{
+  ac->AddItem(this->XAxisShaft);
+  ac->AddItem(this->YAxisShaft);
+  ac->AddItem(this->ZAxisShaft);
+  ac->AddItem(this->XAxisTip);
+  ac->AddItem(this->YAxisTip);
+  ac->AddItem(this->ZAxisTip);
+  ac->AddItem(this->XAxisLabel);
+  ac->AddItem(this->YAxisLabel);
+  ac->AddItem(this->ZAxisLabel);
+
+}
+
+//-----------------------------------------------------------------------------
+int vtkPVAxesActor::RenderOpaqueGeometry(vtkViewport *vp)
+{
+  int          renderedSomething = 0; 
+
+  vtkRenderer *ren = vtkRenderer::SafeDownCast( vp );
+
+  this->UpdateProps();
+  
+  this->XAxisLabel->SetCamera( ren->GetActiveCamera() );
+  this->YAxisLabel->SetCamera( ren->GetActiveCamera() );
+  this->ZAxisLabel->SetCamera( ren->GetActiveCamera() );
+  
+  this->XAxisShaft->RenderOpaqueGeometry(vp);
+  this->YAxisShaft->RenderOpaqueGeometry(vp);
+  this->ZAxisShaft->RenderOpaqueGeometry(vp);
+
+  this->XAxisTip->RenderOpaqueGeometry(vp);
+  this->YAxisTip->RenderOpaqueGeometry(vp);
+  this->ZAxisTip->RenderOpaqueGeometry(vp);
+
+  this->XAxisLabel->RenderOpaqueGeometry(vp);
+  this->YAxisLabel->RenderOpaqueGeometry(vp);
+  this->ZAxisLabel->RenderOpaqueGeometry(vp);
+  
+  return renderedSomething;
+}
+
+//-----------------------------------------------------------------------------
+#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2)
+// porting to VTK 5.0.x
+int vtkPVAxesActor::RenderTranslucentPolygonalGeometry(vtkViewport *vp)
+{
+  int renderedSomething=0; 
+
+  this->UpdateProps();
+  
+  renderedSomething += this->XAxisShaft->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->YAxisShaft->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->ZAxisShaft->RenderTranslucentPolygonalGeometry(vp);
+
+  renderedSomething += this->XAxisTip->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->YAxisTip->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->ZAxisTip->RenderTranslucentPolygonalGeometry(vp);
+  
+  renderedSomething += this->XAxisLabel->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->YAxisLabel->RenderTranslucentPolygonalGeometry(vp);
+  renderedSomething += this->ZAxisLabel->RenderTranslucentPolygonalGeometry(vp);
+  
+  return renderedSomething;
+}
+
+//-----------------------------------------------------------------------------
+// porting to VTK 5.0.x
+int vtkPVAxesActor::HasTranslucentPolygonalGeometry()
+{
+  int result = 0; 
+
+  this->UpdateProps();
+  
+  result |= this->XAxisShaft->HasTranslucentPolygonalGeometry();
+  result |= this->YAxisShaft->HasTranslucentPolygonalGeometry();
+  result |= this->ZAxisShaft->HasTranslucentPolygonalGeometry();
+
+  result |= this->XAxisTip->HasTranslucentPolygonalGeometry();
+  result |= this->YAxisTip->HasTranslucentPolygonalGeometry();
+  result |= this->ZAxisTip->HasTranslucentPolygonalGeometry();
+  
+  result |= this->XAxisLabel->HasTranslucentPolygonalGeometry();
+  result |= this->YAxisLabel->HasTranslucentPolygonalGeometry();
+  result |= this->ZAxisLabel->HasTranslucentPolygonalGeometry();
+  
+  return result;
+}
+
+#else
+//-----------------------------------------------------------------------------
+// porting to VTK 5.0.x
+int vtkPVAxesActor::RenderTranslucentGeometry(vtkViewport *vp)
+{
+  int renderedSomething=0; 
+
+  this->UpdateProps();
+  
+  renderedSomething += this->XAxisShaft->RenderTranslucentGeometry(vp);
+  renderedSomething += this->YAxisShaft->RenderTranslucentGeometry(vp);
+  renderedSomething += this->ZAxisShaft->RenderTranslucentGeometry(vp);
+
+  renderedSomething += this->XAxisTip->RenderTranslucentGeometry(vp);
+  renderedSomething += this->YAxisTip->RenderTranslucentGeometry(vp);
+  renderedSomething += this->ZAxisTip->RenderTranslucentGeometry(vp);
+  
+  renderedSomething += this->XAxisLabel->RenderTranslucentGeometry(vp);
+  renderedSomething += this->YAxisLabel->RenderTranslucentGeometry(vp);
+  renderedSomething += this->ZAxisLabel->RenderTranslucentGeometry(vp);
+  
+  return renderedSomething;
+}
+#endif
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::ReleaseGraphicsResources(vtkWindow *win)
+{
+  this->XAxisShaft->ReleaseGraphicsResources( win );
+  this->YAxisShaft->ReleaseGraphicsResources( win );
+  this->ZAxisShaft->ReleaseGraphicsResources( win );
+
+  this->XAxisTip->ReleaseGraphicsResources( win );
+  this->YAxisTip->ReleaseGraphicsResources( win );
+  this->ZAxisTip->ReleaseGraphicsResources( win );
+    
+  this->XAxisLabel->ReleaseGraphicsResources( win );
+  this->YAxisLabel->ReleaseGraphicsResources( win );
+  this->ZAxisLabel->ReleaseGraphicsResources( win );
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::GetBounds(double bounds[6])
+{
+  double *bds = this->GetBounds();
+  bounds[0] = bds[0];
+  bounds[1] = bds[1];
+  bounds[2] = bds[2];
+  bounds[3] = bds[3];
+  bounds[4] = bds[4];
+  bounds[5] = bds[5];
+}
+
+//-----------------------------------------------------------------------------
+// Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
+double *vtkPVAxesActor::GetBounds()
+{
+  double bounds[6];
+  int i;
+  
+  this->XAxisShaft->GetBounds(this->Bounds);
+
+  this->YAxisShaft->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  this->ZAxisShaft->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  this->XAxisTip->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  this->YAxisTip->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  this->ZAxisTip->GetBounds(bounds);
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  double dbounds[6];
+  (vtkPolyDataMapper::SafeDownCast(this->YAxisShaft->GetMapper()))->
+    GetInput()->GetBounds( dbounds );
+  
+  for (i=0; i<3; i++)
+    {
+    this->Bounds[2*i+1] = 
+      (dbounds[2*i+1]>this->Bounds[2*i+1])?(dbounds[2*i+1]):(this->Bounds[2*i+1]);    
+    }
+
+  // We want this actor to rotate / re-center about the origin, so give it
+  // the bounds it would have if the axes were symmetrical.
+  for (i = 0; i < 3; i++)
+    {
+    this->Bounds[2*i] = -this->Bounds[2*i+1];
+    }
+
+  return this->Bounds;
+}
+
+//-----------------------------------------------------------------------------
+unsigned long int vtkPVAxesActor::GetMTime()
+{
+  unsigned long mTime=this->Superclass::GetMTime();
+
+
+  return mTime;
+}
+
+//-----------------------------------------------------------------------------
+unsigned long int vtkPVAxesActor::GetRedrawMTime()
+{
+  unsigned long mTime=this->GetMTime();
+
+  return mTime;
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetXAxisTipProperty()
+{
+  return this->XAxisTip->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetYAxisTipProperty()
+{
+  return this->YAxisTip->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetZAxisTipProperty()
+{
+  return this->ZAxisTip->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetXAxisShaftProperty()
+{
+  return this->XAxisShaft->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetYAxisShaftProperty()
+{
+  return this->YAxisShaft->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetZAxisShaftProperty()
+{
+  return this->ZAxisShaft->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetXAxisLabelProperty()
+{
+  return this->XAxisLabel->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetYAxisLabelProperty()
+{
+  return this->YAxisLabel->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+vtkProperty *vtkPVAxesActor::GetZAxisLabelProperty()
+{
+  return this->ZAxisLabel->GetProperty();
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetTotalLength( float x, float y, float z )
+{
+  if ( this->TotalLength[0] != x ||
+       this->TotalLength[1] != y ||
+       this->TotalLength[2] != z )
+    {
+    this->TotalLength[0] = x;
+    this->TotalLength[1] = y;
+    this->TotalLength[2] = z;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetNormalizedShaftLength( float x, float y, float z )
+{
+  if ( this->NormalizedShaftLength[0] != x ||
+       this->NormalizedShaftLength[1] != y ||
+       this->NormalizedShaftLength[2] != z )
+    {
+    this->NormalizedShaftLength[0] = x;
+    this->NormalizedShaftLength[1] = y;
+    this->NormalizedShaftLength[2] = z;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetNormalizedTipLength( float x, float y, float z )
+{
+  if ( this->NormalizedTipLength[0] != x ||
+       this->NormalizedTipLength[1] != y ||
+       this->NormalizedTipLength[2] != z )
+    {
+    this->NormalizedTipLength[0] = x;
+    this->NormalizedTipLength[1] = y;
+    this->NormalizedTipLength[2] = z;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetShaftType( int type )
+{
+  if ( this->ShaftType != type )
+    {
+    this->ShaftType = type;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::SetTipType( int type )
+{
+  if ( this->TipType != type )
+    {
+    this->TipType = type;
+  
+    this->Modified();
+    
+    this->UpdateProps();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::UpdateProps()
+{
+  this->CylinderSource->SetRadius(this->CylinderRadius);
+  this->CylinderSource->SetResolution(this->CylinderResolution);
+  
+  
+  this->ConeSource->SetResolution(this->ConeResolution);
+  this->ConeSource->SetRadius(this->ConeRadius);
+  this->SphereSource->SetThetaResolution( this->SphereResolution );
+  this->SphereSource->SetPhiResolution( this->SphereResolution );
+  this->SphereSource->SetRadius(this->SphereRadius);
+  
+  switch ( this->ShaftType )
+    {
+    case vtkPVAxesActor::CYLINDER_SHAFT:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+        SetInputConnection( this->CylinderSource->GetOutputPort() );
+      break;
+    case vtkPVAxesActor::LINE_SHAFT:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+        SetInputConnection( this->LineSource->GetOutputPort() );
+      break;
+    case vtkPVAxesActor::USER_DEFINED_SHAFT:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+        SetInputData( this->UserDefinedShaft );
+    }
+  
+  switch ( this->TipType )
+    {
+    case vtkPVAxesActor::CONE_TIP:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+        SetInputConnection( this->ConeSource->GetOutputPort() );
+      break;      
+    case vtkPVAxesActor::SPHERE_TIP:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+        SetInputConnection( this->SphereSource->GetOutputPort() );
+      break;      
+    case vtkPVAxesActor::USER_DEFINED_TIP:
+      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+        SetInputData( this->UserDefinedTip );
+    }
+  
+  (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->Update();
+  (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->Update();
+      
+  
+  
+  float scale[3];
+  double bounds[6];
+
+  (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
+    GetInput()->GetBounds( bounds );
+  
+  int i;
+  for ( i = 0; i < 3; i++ )
+    {
+    scale[i] = 
+      this->NormalizedShaftLength[i]*this->TotalLength[i] / 
+      (bounds[3] - bounds[2]);
+    }
+  
+  vtkTransform *xTransform = vtkTransform::New();
+  vtkTransform *yTransform = vtkTransform::New();
+  vtkTransform *zTransform = vtkTransform::New();
+  
+  xTransform->RotateZ( -90 );
+  zTransform->RotateX( 90 );
+  
+  xTransform->Scale( scale[0], scale[0], scale[0] );
+  yTransform->Scale( scale[1], scale[1], scale[1] );
+  zTransform->Scale( scale[2], scale[2], scale[2] );
+
+  xTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  yTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  zTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  
+  
+
+  this->XAxisShaft->SetUserTransform( xTransform );
+  this->YAxisShaft->SetUserTransform( yTransform );
+  this->ZAxisShaft->SetUserTransform( zTransform );
+
+  xTransform->Delete();
+  yTransform->Delete();
+  zTransform->Delete();
+  
+  (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
+    GetInput()->GetBounds( bounds );
+  
+  xTransform = vtkTransform::New();
+  yTransform = vtkTransform::New();
+  zTransform = vtkTransform::New();
+  
+  xTransform->RotateZ( -90 );
+  zTransform->RotateX( 90 );
+  
+  xTransform->Scale( this->TotalLength[0], this->TotalLength[0], this->TotalLength[0] );
+  yTransform->Scale( this->TotalLength[1], this->TotalLength[1], this->TotalLength[1] );
+  zTransform->Scale( this->TotalLength[2], this->TotalLength[2], this->TotalLength[2] );
+  
+  xTransform->Translate( 0, (1.0 - this->NormalizedTipLength[0]), 0 );
+  yTransform->Translate( 0, (1.0 - this->NormalizedTipLength[1]), 0 );
+  zTransform->Translate( 0, (1.0 - this->NormalizedTipLength[2]), 0 );
+  
+  xTransform->Scale( this->NormalizedTipLength[0], 
+                     this->NormalizedTipLength[0], 
+                     this->NormalizedTipLength[0] );
+
+  yTransform->Scale( this->NormalizedTipLength[1], 
+                     this->NormalizedTipLength[1], 
+                     this->NormalizedTipLength[1] );
+  
+  zTransform->Scale( this->NormalizedTipLength[2], 
+                     this->NormalizedTipLength[2], 
+                     this->NormalizedTipLength[2] );
+  
+  xTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  yTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+  zTransform->Translate( -(bounds[0]+bounds[1])/2,
+                         -bounds[2],
+                         -(bounds[4]+bounds[5])/2 );
+
+  
+  this->XAxisTip->SetUserTransform( xTransform );
+  this->YAxisTip->SetUserTransform( yTransform );
+  this->ZAxisTip->SetUserTransform( zTransform );
+
+  xTransform->Delete();
+  yTransform->Delete();
+  zTransform->Delete();
+
+  this->XAxisVectorText->SetText( this->XAxisLabelText );
+  this->YAxisVectorText->SetText( this->YAxisLabelText );
+  this->ZAxisVectorText->SetText( this->ZAxisLabelText );
+  
+  
+  float avgScale = 
+    (this->TotalLength[0] + this->TotalLength[1] + this->TotalLength[2])/15;
+  
+  this->XAxisShaft->GetBounds(bounds);
+  this->XAxisLabel->SetScale( avgScale, avgScale, avgScale );
+  this->XAxisLabel->SetPosition( bounds[0] + this->XAxisLabelPosition *
+                                 (bounds[1]-bounds[0]),
+                                 bounds[2] - (bounds[3]-bounds[2])*2.0,
+                                 bounds[5] + (bounds[5]-bounds[4])/2.0 );
+
+  this->YAxisShaft->GetBounds(bounds);
+  this->YAxisLabel->SetScale( avgScale, avgScale, avgScale );
+  this->YAxisLabel->SetPosition( (bounds[0]+bounds[1])/2, 
+                                 bounds[2] + this->YAxisLabelPosition *
+                                 (bounds[3]-bounds[2]),
+                                 bounds[5] + (bounds[5]-bounds[4])/2.0 );
+
+  this->ZAxisShaft->GetBounds(bounds);
+  this->ZAxisLabel->SetScale( avgScale, avgScale, avgScale );
+  this->ZAxisLabel->SetPosition( bounds[0], 
+                                 bounds[2] - (bounds[3]-bounds[2])*2.0,
+                                 bounds[4] + this->ZAxisLabelPosition *
+                                 (bounds[5]-bounds[4]) );
+}
+
+//-----------------------------------------------------------------------------
+void vtkPVAxesActor::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+  
+  os << indent << "UserDefinedShaft: ";
+  if (this->UserDefinedShaft)
+    {
+    os << this->UserDefinedShaft << endl;
+    }
+  else
+    {
+    os << "(none)" << endl;
+    }
+  
+  os << indent << "UserDefinedTip: ";
+  if (this->UserDefinedTip)
+    {
+    os << this->UserDefinedTip << endl;
+    }
+  else
+    {
+    os << "(none)" << endl;
+    }
+  
+  os << indent << "XAxisLabelText: " << (this->XAxisLabelText ?
+                                         this->XAxisLabelText : "(none)")
+     << endl;
+  os << indent << "YAxisLabelText: " << (this->YAxisLabelText ?
+                                         this->YAxisLabelText : "(none)")
+     << endl;
+  os << indent << "ZAxisLabelText: " << (this->ZAxisLabelText ?
+                                         this->ZAxisLabelText : "(none)")
+     << endl;
+  os << indent << "XAxisLabelPosition: " << this->XAxisLabelPosition << endl;
+  os << indent << "YAxisLabelPosition: " << this->YAxisLabelPosition << endl;
+  os << indent << "ZAxisLabelPosition: " << this->ZAxisLabelPosition << endl;
+  
+  os << indent << "SphereRadius: " << this->SphereRadius << endl;
+  os << indent << "SphereResolution: " << this->SphereResolution << endl;
+  os << indent << "CylinderRadius: " << this->CylinderRadius << endl;
+  os << indent << "CylinderResolution: " << this->CylinderResolution << endl;
+  os << indent << "ConeRadius: " << this->ConeRadius << endl;
+  os << indent << "ConeResolution: " << this->ConeResolution << endl;
+  
+  os << indent << "NormalizedShaftLength: " 
+     << this->NormalizedShaftLength[0] << ","
+     << this->NormalizedShaftLength[1] << ","
+     << this->NormalizedShaftLength[2] << endl;
+  os << indent << "NormalizedTipLength: " 
+     << this->NormalizedTipLength[0] << ","
+     << this->NormalizedTipLength[1] << ","
+     << this->NormalizedTipLength[2] << endl;
+  os << indent << "TotalLength: " 
+     << this->TotalLength[0] << ","
+     << this->TotalLength[1] << ","
+     << this->TotalLength[2] << endl;
+}
+
+//-----------------------------------------------------------------------------
+// porting to VTK 5.0.x
+void vtkPVAxesActor::AddToRender( vtkRenderer* theRenderer )
+{
+  theRenderer->AddActor(this->XAxisLabel);
+  theRenderer->AddActor(this->YAxisLabel);
+  theRenderer->AddActor(this->ZAxisLabel);
+}
+
+} // end of salomevtk namespace
diff --git a/src/SVTK/salomevtkPVAxesActor.h b/src/SVTK/salomevtkPVAxesActor.h
new file mode 100644 (file)
index 0000000..6ab2edb
--- /dev/null
@@ -0,0 +1,304 @@
+/*=========================================================================
+
+   Program: ParaView
+   Module:    $RCSfile$
+
+   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+   All rights reserved.
+
+   ParaView is a free software; you can redistribute it and/or modify it
+   under the terms of the ParaView license version 1.2. 
+
+   See License_v1.2.txt for the full ParaView license.
+   A copy of this license can be obtained by contacting
+   Kitware Inc.
+   28 Corporate Drive
+   Clifton Park, NY 12065
+   USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+// .NAME vtkPVAxesActor - a 3D axes representation
+// .SECTION Description
+// 
+// vtkPVAxesActor is used to represent 3D axes in the scene. The user can
+// define the geometry to use for the shaft and the tip, and the user can
+// set the text for the three axes. The text will follow the camera.
+//
+// VSR 03/12/2014: the original file vtkPVAxesActor.h has been renamed to salomevtkPVAxesActor.h
+// to avoid collisions with native VTK/ParaView classes
+
+#ifndef __salomevtkPVAxesActor_h
+#define __salomevtkPVAxesActor_h
+
+#include "SVTK.h"               // added by SALOME
+#include "vtkProp3D.h"
+
+#include <vtkVersion.h>
+
+class vtkRenderer;
+class vtkPropCollection;
+class vtkMapper;
+class vtkProperty;
+class vtkActor;
+class vtkFollower;
+class vtkCylinderSource;
+class vtkLineSource;
+class vtkConeSource;
+class vtkSphereSource;
+class vtkPolyData;
+class vtkVectorText;
+
+// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace
+// to avoid collisions with native VTK/ParaView classes
+namespace salomevtk
+{
+
+class SVTK_EXPORT vtkPVAxesActor : public vtkProp3D
+{
+public:
+  static vtkPVAxesActor *New();
+  vtkTypeMacro(vtkPVAxesActor,vtkProp3D);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+
+  // Description: 
+  // For some exporters and other other operations we must be
+  // able to collect all the actors or volumes. These methods
+  // are used in that process.
+  virtual void GetActors(vtkPropCollection *);
+
+  // Description:
+  // Support the standard render methods.
+  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
+#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2)
+  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); // porting to VTK 5.0.x
+  virtual int HasTranslucentPolygonalGeometry();                         // porting to VTK 5.0.x
+#else
+  virtual int RenderTranslucentGeometry(vtkViewport *viewport);            // porting to VTK 5.0.x
+#endif
+
+  // Description:
+  // Shallow copy of an axes actor. Overloads the virtual vtkProp method.
+  void ShallowCopy(vtkProp *prop);
+
+  // Description:
+  // Release any graphics resources that are being consumed by this actor.
+  // The parameter window could be used to determine which graphic
+  // resources to release.
+  void ReleaseGraphicsResources(vtkWindow *);
+
+  // Description:
+  // Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax). (The
+  // method GetBounds(double bounds[6]) is available from the superclass.)
+  void GetBounds(double bounds[6]);
+  double *GetBounds();
+
+  // Description:
+  // Get the actors mtime plus consider its properties and texture if set.
+  unsigned long int GetMTime();
+  
+  // Description:
+  // Return the mtime of anything that would cause the rendered image to 
+  // appear differently. Usually this involves checking the mtime of the 
+  // prop plus anything else it depends on such as properties, textures
+  // etc.
+  virtual unsigned long GetRedrawMTime();
+
+  // Description:
+  // Set the total length of the axes in 3 dimensions.
+  void SetTotalLength( float v[3] ) 
+    { this->SetTotalLength( v[0], v[1], v[2] ); }
+  void SetTotalLength( float x, float y, float z );
+  vtkGetVectorMacro( TotalLength, float, 3 );
+  
+  // Description:
+  // Set the normalized (0-1) length of the shaft.
+  void SetNormalizedShaftLength( float v[3] ) 
+    { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
+  void SetNormalizedShaftLength( float x, float y, float z );
+  vtkGetVectorMacro( NormalizedShaftLength, float, 3 );
+  
+  // Description:
+  // Set the normalized (0-1) length of the tip.
+  void SetNormalizedTipLength( float v[3] ) 
+    { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
+  void SetNormalizedTipLength( float x, float y, float z );
+  vtkGetVectorMacro( NormalizedTipLength, float, 3 );
+
+  // Description:
+  // Set/get the resolution of the pieces of the axes actor
+  vtkSetClampMacro(ConeResolution, int, 3, 128);
+  vtkGetMacro(ConeResolution, int);
+  vtkSetClampMacro(SphereResolution, int, 3, 128);
+  vtkGetMacro(SphereResolution, int);
+  vtkSetClampMacro(CylinderResolution, int, 3, 128);
+  vtkGetMacro(CylinderResolution, int);
+  
+  // Description:
+  // Set/get the radius of the pieces of the axes actor
+  vtkSetClampMacro(ConeRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkGetMacro(ConeRadius, float);
+  vtkSetClampMacro(SphereRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkGetMacro(SphereRadius, float);
+  vtkSetClampMacro(CylinderRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkGetMacro(CylinderRadius, float);
+  
+  // Description:
+  // Set/get the positions of the axis labels
+  vtkSetClampMacro(XAxisLabelPosition, float, 0, 1);
+  vtkGetMacro(XAxisLabelPosition, float);
+  vtkSetClampMacro(YAxisLabelPosition, float, 0, 1);
+  vtkGetMacro(YAxisLabelPosition, float);
+  vtkSetClampMacro(ZAxisLabelPosition, float, 0, 1);
+  vtkGetMacro(ZAxisLabelPosition, float);
+  
+  // Description:
+  // Set the type of the shaft to a cylinder, line, or user defined geometry.
+  void SetShaftType( int type );
+  void SetShaftTypeToCylinder()
+    { this->SetShaftType( vtkPVAxesActor::CYLINDER_SHAFT ); }
+  void SetShaftTypeToLine()
+    { this->SetShaftType( vtkPVAxesActor::LINE_SHAFT ); }
+  void SetShaftTypeToUserDefined()
+    { this->SetShaftType( vtkPVAxesActor::USER_DEFINED_SHAFT ); }
+
+  // Description:
+  // Set the type of the tip to a cone, sphere, or user defined geometry.
+  void SetTipType( int type );
+  void SetTipTypeToCone()
+    { this->SetTipType( vtkPVAxesActor::CONE_TIP ); }
+  void SetTipTypeToSphere()
+    { this->SetTipType( vtkPVAxesActor::SPHERE_TIP ); }
+  void SetTipTypeToUserDefined()
+    { this->SetTipType( vtkPVAxesActor::USER_DEFINED_TIP ); }
+
+  //BTX
+  // Description:
+  // Set the user defined tip polydata.
+  void SetUserDefinedTip( vtkPolyData * );
+  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
+  
+  // Description:
+  // Set the user defined shaft polydata.
+  void SetUserDefinedShaft( vtkPolyData * );
+  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
+
+  // Description:
+  // Get the tip properties.
+  vtkProperty *GetXAxisTipProperty();
+  vtkProperty *GetYAxisTipProperty();
+  vtkProperty *GetZAxisTipProperty();
+  
+  // Description:
+  // Get the shaft properties.
+  vtkProperty *GetXAxisShaftProperty();
+  vtkProperty *GetYAxisShaftProperty();
+  vtkProperty *GetZAxisShaftProperty();
+
+  // Description:
+  // Get the label properties.
+  vtkProperty *GetXAxisLabelProperty();
+  vtkProperty *GetYAxisLabelProperty();
+  vtkProperty *GetZAxisLabelProperty();
+  //ETX
+  //
+  // Description:
+  // Set the label text.
+  vtkSetStringMacro( XAxisLabelText );
+  vtkSetStringMacro( YAxisLabelText );
+  vtkSetStringMacro( ZAxisLabelText );
+  
+//BTX
+  enum
+  {
+    CYLINDER_SHAFT,
+    LINE_SHAFT,
+    USER_DEFINED_SHAFT
+  };
+  
+  
+  enum
+  {
+    CONE_TIP,
+    SPHERE_TIP,
+    USER_DEFINED_TIP
+  };
+  
+//ETX
+
+  void AddToRender( vtkRenderer* theRenderer ); // porting to VTK 5.0.x
+  
+protected:
+  vtkPVAxesActor();
+  ~vtkPVAxesActor();
+
+  vtkCylinderSource *CylinderSource;
+  vtkLineSource     *LineSource;
+  vtkConeSource     *ConeSource;
+  vtkSphereSource   *SphereSource;
+  
+  vtkActor          *XAxisShaft;
+  vtkActor          *YAxisShaft;
+  vtkActor          *ZAxisShaft;
+
+  vtkActor          *XAxisTip;
+  vtkActor          *YAxisTip;
+  vtkActor          *ZAxisTip;
+
+  void              UpdateProps();
+
+  float             TotalLength[3];
+  float             NormalizedShaftLength[3];
+  float             NormalizedTipLength[3];
+  
+  int               ShaftType;
+  int               TipType;
+  
+  vtkPolyData      *UserDefinedTip;
+  vtkPolyData      *UserDefinedShaft;
+  
+  char             *XAxisLabelText;
+  char             *YAxisLabelText;
+  char             *ZAxisLabelText;
+  
+  vtkVectorText    *XAxisVectorText;
+  vtkVectorText    *YAxisVectorText;
+  vtkVectorText    *ZAxisVectorText;
+  
+  vtkFollower      *XAxisLabel;
+  vtkFollower      *YAxisLabel;
+  vtkFollower      *ZAxisLabel;
+  
+  int              ConeResolution;
+  int              SphereResolution;
+  int              CylinderResolution;
+  
+  float            ConeRadius;
+  float            SphereRadius;
+  float            CylinderRadius;
+
+  float            XAxisLabelPosition;
+  float            YAxisLabelPosition;
+  float            ZAxisLabelPosition;
+  
+private:
+  vtkPVAxesActor(const vtkPVAxesActor&);  // Not implemented.
+  void operator=(const vtkPVAxesActor&);  // Not implemented.
+};
+
+} // end of salomevtk namespace
+
+#endif
+
diff --git a/src/SVTK/salomevtkPVAxesWidget.cxx b/src/SVTK/salomevtkPVAxesWidget.cxx
new file mode 100644 (file)
index 0000000..c73d473
--- /dev/null
@@ -0,0 +1,878 @@
+/*=========================================================================
+
+   Program: ParaView
+   Module:    $RCSfile$
+
+   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+   All rights reserved.
+
+   ParaView is a free software; you can redistribute it and/or modify it
+   under the terms of the ParaView license version 1.2. 
+
+   See License_v1.2.txt for the full ParaView license.
+   A copy of this license can be obtained by contacting
+   Kitware Inc.
+   28 Corporate Drive
+   Clifton Park, NY 12065
+   USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+// VSR 03/12/2014: the original file vtkPVAxesWidget.cxx has been renamed to salomevtkPVAxesWidget.cxx
+// to avoid collisions with native VTK/ParaView classes
+
+#include "salomevtkPVAxesWidget.h"   // changed by SALOME
+#include "salomevtkPVAxesActor.h"    // changed by SALOME
+
+#include "vtkActor2D.h"
+#include "vtkCallbackCommand.h"
+#include "vtkCamera.h"
+#include "vtkCoordinate.h"
+#include "vtkObjectFactory.h"
+#include "vtkPoints.h"
+#include "vtkPolyData.h"
+#include "vtkPolyDataMapper2D.h"
+#include "vtkProperty.h"
+#include "vtkProperty2D.h"
+#include "vtkRenderer.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+
+// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace
+// to avoid collisions with native VTK/ParaView classes
+namespace salomevtk
+{
+
+vtkStandardNewMacro(vtkPVAxesWidget);
+
+vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor);
+vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer);
+
+//----------------------------------------------------------------------------
+class vtkPVAxesWidgetObserver : public vtkCommand
+{
+public:
+  static vtkPVAxesWidgetObserver *New()
+    {return new vtkPVAxesWidgetObserver;};
+  
+  vtkPVAxesWidgetObserver()
+    {
+      this->AxesWidget = 0;
+    }
+  
+  virtual void Execute(vtkObject* wdg, unsigned long event, void *calldata)
+    {
+      if (this->AxesWidget)
+        {
+        this->AxesWidget->ExecuteEvent(wdg, event, calldata);
+        }
+    }
+  
+  vtkPVAxesWidget *AxesWidget;
+};
+
+//----------------------------------------------------------------------------
+vtkPVAxesWidget::vtkPVAxesWidget()
+{
+  this->StartEventObserverId = 0;
+
+  this->EventCallbackCommand->SetCallback(vtkPVAxesWidget::ProcessEvents);
+  
+  this->Observer = vtkPVAxesWidgetObserver::New();
+  this->Observer->AxesWidget = this;
+  this->Renderer = vtkRenderer::New();
+  this->Renderer->SetViewport(0.0, 0.0, 0.2, 0.2);
+  this->Renderer->SetLayer(1);
+  this->Renderer->InteractiveOff();
+  this->Priority = 0.55;
+  this->AxesActor = vtkPVAxesActor::New();
+  this->Renderer->AddActor(this->AxesActor);
+  this->AxesActor->AddToRender(this->Renderer); // tmp
+  
+  this->ParentRenderer = NULL;
+  
+  this->Moving = 0;
+  this->MouseCursorState = vtkPVAxesWidget::Outside;
+
+  this->StartTag = 0;
+  
+  this->Interactive = 1;
+  
+  this->Outline = vtkPolyData::New();
+  this->Outline->Allocate();
+  vtkPoints *points = vtkPoints::New();
+  vtkIdType ptIds[5];
+  ptIds[4] = ptIds[0] = points->InsertNextPoint(1, 1, 0);
+  ptIds[1] = points->InsertNextPoint(2, 1, 0);
+  ptIds[2] = points->InsertNextPoint(2, 2, 0);
+  ptIds[3] = points->InsertNextPoint(1, 2, 0);
+  this->Outline->SetPoints(points);
+  this->Outline->InsertNextCell(VTK_POLY_LINE, 5, ptIds);
+  vtkCoordinate *tcoord = vtkCoordinate::New();
+  tcoord->SetCoordinateSystemToDisplay();
+  vtkPolyDataMapper2D *mapper = vtkPolyDataMapper2D::New();
+  mapper->SetInputData(this->Outline);
+  mapper->SetTransformCoordinate(tcoord);
+  this->OutlineActor = vtkActor2D::New();
+  this->OutlineActor->SetMapper(mapper);
+  this->OutlineActor->SetPosition(0, 0);
+  this->OutlineActor->SetPosition2(1, 1);
+  
+  points->Delete();
+  mapper->Delete();
+  tcoord->Delete();
+}
+
+//----------------------------------------------------------------------------
+vtkPVAxesWidget::~vtkPVAxesWidget()
+{
+  this->Observer->Delete();
+  this->AxesActor->Delete();
+  this->OutlineActor->Delete();
+  this->Outline->Delete();
+  this->SetParentRenderer(NULL);
+  this->Renderer->Delete();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetEnabled(int enabling)
+{
+  if (!this->Interactor)
+    {
+    vtkErrorMacro("The interactor must be set prior to enabling/disabling widget");
+    }
+  
+  if (enabling)
+    {
+    if (this->Enabled)
+      {
+      return;
+      }
+    if (!this->ParentRenderer)
+      {
+      vtkErrorMacro("The parent renderer must be set prior to enabling this widget");
+      return;
+      }
+
+    this->Enabled = 1;
+    
+    if ( this->EventCallbackCommand )
+      {
+      vtkRenderWindowInteractor *i = this->Interactor;
+      i->AddObserver(vtkCommand::MouseMoveEvent,
+        this->EventCallbackCommand, this->Priority);
+      i->AddObserver(vtkCommand::LeftButtonPressEvent,
+        this->EventCallbackCommand, this->Priority);
+      i->AddObserver(vtkCommand::LeftButtonReleaseEvent,
+        this->EventCallbackCommand, this->Priority);
+      }
+    
+    this->ParentRenderer->GetRenderWindow()->AddRenderer(this->Renderer);
+    if (this->ParentRenderer->GetRenderWindow()->GetNumberOfLayers() < 2)
+      {
+      this->ParentRenderer->GetRenderWindow()->SetNumberOfLayers(2);
+      }
+    this->AxesActor->SetVisibility(1);
+    // We need to copy the camera before the compositing observer is called.
+    // Compositing temporarily changes the camera to display an image.
+    this->StartEventObserverId = 
+      this->ParentRenderer->AddObserver(vtkCommand::StartEvent,this->Observer,1);
+    this->InvokeEvent(vtkCommand::EnableEvent, NULL);
+    }
+  else
+    {
+    if (!this->Enabled)
+      {
+      return;
+      }
+    
+    this->Enabled = 0;
+    this->Interactor->RemoveObserver(this->EventCallbackCommand);
+    
+    this->AxesActor->SetVisibility(0);
+    if (this->ParentRenderer)
+      {
+      if (this->ParentRenderer->GetRenderWindow())
+        {
+        this->ParentRenderer->GetRenderWindow()->RemoveRenderer(this->Renderer);
+        this->AxesActor->ReleaseGraphicsResources(this->ParentRenderer->GetRenderWindow());
+        }
+      if (this->StartEventObserverId != 0)
+        {
+        this->ParentRenderer->RemoveObserver(this->StartEventObserverId);
+        }
+      }
+    
+    this->InvokeEvent(vtkCommand::DisableEvent, NULL);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ExecuteEvent(vtkObject *vtkNotUsed(o),
+                                   unsigned long vtkNotUsed(event),
+                                   void *vtkNotUsed(calldata))
+{
+  if (!this->ParentRenderer)
+    {
+    return;
+    }
+  
+  vtkCamera *cam = this->ParentRenderer->GetActiveCamera();
+  double pos[3], fp[3], viewup[3];
+  cam->GetPosition(pos);
+  cam->GetFocalPoint(fp);
+  cam->GetViewUp(viewup);
+  
+  cam = this->Renderer->GetActiveCamera();
+  cam->SetPosition(pos);
+  cam->SetFocalPoint(fp);
+  cam->SetViewUp(viewup);
+  this->Renderer->ResetCamera();
+  
+  this->SquareRenderer();
+}
+
+void vtkPVAxesWidget::UpdateCursorIcon()
+{
+  if (!this->Enabled)
+    {
+    this->SetMouseCursor(vtkPVAxesWidget::Outside);
+    return;
+    }
+  
+  if (this->Moving)
+    {
+    return;
+    }
+  
+  int *parentSize = this->ParentRenderer->GetSize();
+  
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  double xNorm = x / (double)parentSize[0];
+  double yNorm = y / (double)parentSize[1];
+  
+  double pos[4];
+  this->Renderer->GetViewport(pos);
+  
+  int pState = this->MouseCursorState;
+  
+  if (xNorm > pos[0] && xNorm < pos[2] && yNorm > pos[1] && yNorm < pos[3])
+    {
+    this->MouseCursorState = vtkPVAxesWidget::Inside;
+    }
+  else if (fabs(xNorm-pos[0]) < .02 && fabs(yNorm-pos[3]) < .02)
+    {
+    this->MouseCursorState = vtkPVAxesWidget::TopLeft;
+    }
+  else if (fabs(xNorm-pos[2]) < .02 && fabs(yNorm-pos[3]) < .02)
+    {
+    this->MouseCursorState = vtkPVAxesWidget::TopRight;
+    }
+  else if (fabs(xNorm-pos[0]) < .02 && fabs(yNorm-pos[1]) < .02)
+    {
+    this->MouseCursorState = vtkPVAxesWidget::BottomLeft;
+    }
+  else if (fabs(xNorm-pos[2]) < .02 && fabs(yNorm-pos[1]) < .02)
+    {
+    this->MouseCursorState = vtkPVAxesWidget::BottomRight;
+    }
+  else
+    {
+    this->MouseCursorState = vtkPVAxesWidget::Outside;
+    }
+
+  if (pState == this->MouseCursorState)
+    {
+    return;
+    }
+  
+  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
+    {
+    this->Renderer->RemoveActor(this->OutlineActor);
+    }
+  else
+    {
+    this->Renderer->AddActor(this->OutlineActor);
+    }
+  this->Interactor->Render();
+  
+  this->SetMouseCursor(this->MouseCursorState);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetMouseCursor(int cursorState)
+{
+  switch (cursorState)
+    {
+    case vtkPVAxesWidget::Outside:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_DEFAULT);
+      break;
+    case vtkPVAxesWidget::Inside:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZEALL);
+      break;
+    case vtkPVAxesWidget::TopLeft:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZENW);
+      break;
+    case vtkPVAxesWidget::TopRight:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZENE);
+      break;
+    case vtkPVAxesWidget::BottomLeft:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZESW);
+      break;
+    case vtkPVAxesWidget::BottomRight:
+      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZESE);
+      break;
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ProcessEvents(vtkObject* vtkNotUsed(object),
+                                    unsigned long event,
+                                    void *clientdata,
+                                    void* vtkNotUsed(calldata))
+{
+  vtkPVAxesWidget *self =
+    reinterpret_cast<vtkPVAxesWidget*>(clientdata);
+
+  if (!self->GetInteractive())
+    {
+    return;
+    }
+  
+  switch (event)
+    {
+    case vtkCommand::LeftButtonPressEvent:
+      self->OnButtonPress();
+      break;
+    case vtkCommand::MouseMoveEvent:
+      self->OnMouseMove();
+      break;
+    case vtkCommand::LeftButtonReleaseEvent:
+      self->OnButtonRelease();
+      break;
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::OnButtonPress()
+{
+  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
+    {
+    return;
+    }
+  
+  this->SetMouseCursor(this->MouseCursorState);
+
+  this->StartPosition[0] = this->Interactor->GetEventPosition()[0];
+  this->StartPosition[1] = this->Interactor->GetEventPosition()[1];
+  
+  this->Moving = 1;
+  this->EventCallbackCommand->SetAbortFlag(1);
+  this->StartInteraction();
+  this->InvokeEvent(vtkCommand::StartInteractionEvent, NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::OnButtonRelease()
+{
+  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
+    {
+    return;
+    }
+  
+  this->Moving = 0;
+  this->EndInteraction();
+  this->InvokeEvent(vtkCommand::EndInteractionEvent, NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::OnMouseMove()
+{
+  if (this->Moving)
+    {
+    switch (this->MouseCursorState)
+      {
+      case vtkPVAxesWidget::Inside:
+        this->MoveWidget();
+        break;
+      case vtkPVAxesWidget::TopLeft:
+        this->ResizeTopLeft();
+        break;
+      case vtkPVAxesWidget::TopRight:
+        this->ResizeTopRight();
+        break;
+      case vtkPVAxesWidget::BottomLeft:
+        this->ResizeBottomLeft();
+        break;
+      case vtkPVAxesWidget::BottomRight:
+        this->ResizeBottomRight();
+        break;
+      }
+    
+    this->UpdateCursorIcon();
+    this->EventCallbackCommand->SetAbortFlag(1);
+    this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
+    }
+  else
+    {
+    this->UpdateCursorIcon();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::MoveWidget()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+  
+  double *vp = this->Renderer->GetViewport();
+  
+  double newPos[4];
+  newPos[0] = vp[0] + dxNorm;
+  newPos[1] = vp[1] + dyNorm;
+  newPos[2] = vp[2] + dxNorm;
+  newPos[3] = vp[3] + dyNorm;
+
+  if (newPos[0] < 0)
+    {
+    this->StartPosition[0] = 0;
+    newPos[0] = 0;
+    newPos[2] = vp[2] - vp[0];
+    }
+  if (newPos[1] < 0)
+    {
+    this->StartPosition[1] = 0;
+    newPos[1] = 0;
+    newPos[3] = vp[3] - vp[1];
+    }
+  if (newPos[2] > 1)
+    {
+    this->StartPosition[0] = (int)(size[0] - size[0] * (vp[2]-vp[0]));
+    newPos[0] = 1 - (vp[2]-vp[0]);
+    newPos[2] = 1;
+    }
+  if (newPos[3] > 1)
+    {
+    this->StartPosition[1] = (int)(size[1] - size[1]*(vp[3]-vp[1]));
+    newPos[1] = 1 - (vp[3]-vp[1]);
+    newPos[3] = 1;
+    }
+
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ResizeTopLeft()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+  
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+  
+  int useX;
+  double change;
+  double absDx = fabs(dxNorm);
+  double absDy = fabs(dyNorm);
+  
+  if (absDx > absDy)
+    {
+    change = dxNorm;
+    useX = 1;
+    }
+  else
+    {
+    change = dyNorm;
+    useX = 0;
+    }
+  
+  double *vp = this->Renderer->GetViewport();
+  
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+  
+  double newPos[4];
+  newPos[0] = useX ? vp[0] + change : vp[0] - change;
+  newPos[1] = vp[1];
+  newPos[2] = vp[2];
+  newPos[3] = useX ? vp[3] - change : vp[3] + change;
+  
+  if (newPos[0] < 0)
+    {
+    this->StartPosition[0] = 0;
+    newPos[0] = 0;
+    }
+  if (newPos[0] >= newPos[2]-0.01)
+    {
+    newPos[0] = newPos[2] - 0.01;
+    }
+  if (newPos[3] > 1)
+    {
+    this->StartPosition[1] = size[1];
+    newPos[3] = 1;
+    }
+  if (newPos[3] <= newPos[1]+0.01)
+    {
+    newPos[3] = newPos[1] + 0.01;
+    }
+  
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ResizeTopRight()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+  
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+
+  double change;
+  double absDx = fabs(dxNorm);
+  double absDy = fabs(dyNorm);
+  
+  if (absDx > absDy)
+    {
+    change = dxNorm;
+    }
+  else
+    {
+    change = dyNorm;
+    }
+  
+  double *vp = this->Renderer->GetViewport();
+  
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+  
+  double newPos[4];
+  newPos[0] = vp[0];
+  newPos[1] = vp[1];
+  newPos[2] = vp[2] + change;
+  newPos[3] = vp[3] + change;
+  
+  if (newPos[2] > 1)
+    {
+    this->StartPosition[0] = size[0];
+    newPos[2] = 1;
+    }
+  if (newPos[2] <= newPos[0]+0.01)
+    {
+    newPos[2] = newPos[0] + 0.01;
+    }
+  if (newPos[3] > 1)
+    {
+    this->StartPosition[1] = size[1];
+    newPos[3] = 1;
+    }
+  if (newPos[3] <= newPos[1]+0.01)
+    {
+    newPos[3] = newPos[1] + 0.01;
+    }
+  
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ResizeBottomLeft()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+  
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+  double *vp = this->Renderer->GetViewport();
+  
+  double change;
+  double absDx = fabs(dxNorm);
+  double absDy = fabs(dyNorm);
+  
+  if (absDx > absDy)
+    {
+    change = dxNorm;
+    }
+  else
+    {
+    change = dyNorm;
+    }
+  
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+  
+  double newPos[4];
+  newPos[0] = vp[0] + change;
+  newPos[1] = vp[1] + change;
+  newPos[2] = vp[2];
+  newPos[3] = vp[3];
+  
+  if (newPos[0] < 0)
+    {
+    this->StartPosition[0] = 0;
+    newPos[0] = 0;
+    }
+  if (newPos[0] >= newPos[2]-0.01)
+    {
+    newPos[0] = newPos[2] - 0.01;
+    }
+  if (newPos[1] < 0)
+    {
+    this->StartPosition[1] = 0;
+    newPos[1] = 0;
+    }
+  if (newPos[1] >= newPos[3]-0.01)
+    {
+    newPos[1] = newPos[3] - 0.01;
+    }
+  
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::ResizeBottomRight()
+{
+  int x = this->Interactor->GetEventPosition()[0];
+  int y = this->Interactor->GetEventPosition()[1];
+  
+  int dx = x - this->StartPosition[0];
+  int dy = y - this->StartPosition[1];
+  
+  int *size = this->ParentRenderer->GetSize();
+  double dxNorm = dx / (double)size[0];
+  double dyNorm = dy / (double)size[1];
+  
+  double *vp = this->Renderer->GetViewport();
+  
+  int useX;
+  double change;
+  double absDx = fabs(dxNorm);
+  double absDy = fabs(dyNorm);
+  
+  if (absDx > absDy)
+    {
+    change = dxNorm;
+    useX = 1;
+    }
+  else
+    {
+    change = dyNorm;
+    useX = 0;
+    }
+  
+  this->StartPosition[0] = x;
+  this->StartPosition[1] = y;
+  
+  double newPos[4];
+  newPos[0] = vp[0];
+  newPos[1] = useX ? vp[1] - change : vp[1] + change;
+  newPos[2] = useX ? vp[2] + change : vp[2] - change;
+  newPos[3] = vp[3];
+  
+  if (newPos[2] > 1)
+    {
+    this->StartPosition[0] = size[0];
+    newPos[2] = 1;
+    }
+  if (newPos[2] <= newPos[0]+0.01)
+    {
+    newPos[2] = newPos[0] + 0.01;
+    }
+  if (newPos[1] < 0)
+    {
+    this->StartPosition[1] = 0;
+    newPos[1] = 0;
+    }
+  if (newPos[1] >= newPos[3]-0.01)
+    {
+    newPos[1] = newPos[3]-0.01;
+    }
+  
+  this->Renderer->SetViewport(newPos);
+  this->Interactor->Render();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SquareRenderer()
+{
+  int *size = this->Renderer->GetSize();
+  if (size[0] == 0 || size[1] == 0)
+    {
+    return;
+    }
+  
+  double vp[4];
+  this->Renderer->GetViewport(vp);
+  
+  double deltaX = vp[2] - vp[0];
+  double newDeltaX = size[1] * deltaX / (double)size[0];
+  double deltaY = vp[3] - vp[1];
+  double newDeltaY = size[0] * deltaY / (double)size[1];
+
+  if (newDeltaX > 1)
+    {
+    if (newDeltaY > 1)
+      {
+      if (size[0] > size[1])
+        {
+        newDeltaX = size[1] / (double)size[0];
+        newDeltaY = 1;
+        }
+      else
+        {
+        newDeltaX = 1;
+        newDeltaY = size[0] / (double)size[1];
+        }
+      vp[0] = vp[1] = 0;
+      vp[2] = newDeltaX;
+      vp[3] = newDeltaY;
+      }
+    else
+      {
+      vp[3] = vp[1] + newDeltaY;
+      if (vp[3] > 1)
+        {
+        vp[3] = 1;
+        vp[1] = vp[3] - newDeltaY;
+        }
+      }
+    }
+  else
+    {
+    vp[2] = vp[0] + newDeltaX;
+    if (vp[2] > 1)
+      {
+      vp[2] = 1;
+      vp[0] = vp[2] - newDeltaX;
+      }
+    }
+  
+  this->Renderer->SetViewport(vp);
+  
+  this->Renderer->NormalizedDisplayToDisplay(vp[0], vp[1]);
+  this->Renderer->NormalizedDisplayToDisplay(vp[2], vp[3]);
+  
+  vtkPoints *points = this->Outline->GetPoints();
+  points->SetPoint(0, vp[0]+1, vp[1]+1, 0);
+  points->SetPoint(1, vp[2]-1, vp[1]+1, 0);
+  points->SetPoint(2, vp[2]-1, vp[3]-1, 0);
+  points->SetPoint(3, vp[0]+1, vp[3]-1, 0);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetInteractive(int state)
+{
+  if (this->Interactive != state)
+    {
+    this->Interactive = state;
+    }
+  
+  if (!state)
+    {
+    this->OnButtonRelease();
+    this->MouseCursorState = vtkPVAxesWidget::Outside;
+    this->Renderer->RemoveActor(this->OutlineActor);
+    if (this->Interactor)
+      {
+      this->SetMouseCursor(this->MouseCursorState);
+      // this->Interactor->Render();
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetOutlineColor(double r, double g, double b)
+{
+  this->OutlineActor->GetProperty()->SetColor(r, g, b);
+  if (this->Interactor)
+    {
+//    this->Interactor->Render();
+    }
+}
+
+//----------------------------------------------------------------------------
+double* vtkPVAxesWidget::GetOutlineColor()
+{
+  return this->OutlineActor->GetProperty()->GetColor();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetAxisLabelColor(double r, double g, double b)
+{
+  this->AxesActor->GetXAxisLabelProperty()->SetColor(r, g, b);
+  this->AxesActor->GetYAxisLabelProperty()->SetColor(r, g, b);
+  this->AxesActor->GetZAxisLabelProperty()->SetColor(r, g, b);
+}
+
+//----------------------------------------------------------------------------
+double* vtkPVAxesWidget::GetAxisLabelColor()
+{
+  return this->AxesActor->GetXAxisLabelProperty()->GetColor();
+}
+
+//----------------------------------------------------------------------------
+vtkRenderer* vtkPVAxesWidget::GetParentRenderer()
+{
+  return this->ParentRenderer;
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::SetViewport(double minX, double minY,
+                                  double maxX, double maxY)
+{
+  this->Renderer->SetViewport(minX, minY, maxX, maxY);
+}
+
+//----------------------------------------------------------------------------
+double* vtkPVAxesWidget::GetViewport()
+{
+  return this->Renderer->GetViewport();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVAxesWidget::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os, indent);
+  
+  os << indent << "AxesActor: " << this->AxesActor << endl;
+  os << indent << "Interactive: " << this->Interactive << endl;
+}
+
+} // end of salomevtk namespace
diff --git a/src/SVTK/salomevtkPVAxesWidget.h b/src/SVTK/salomevtkPVAxesWidget.h
new file mode 100644 (file)
index 0000000..bb68fa5
--- /dev/null
@@ -0,0 +1,169 @@
+/*=========================================================================
+
+   Program: ParaView
+   Module:    $RCSfile$
+
+   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+   All rights reserved.
+
+   ParaView is a free software; you can redistribute it and/or modify it
+   under the terms of the ParaView license version 1.2. 
+
+   See License_v1.2.txt for the full ParaView license.
+   A copy of this license can be obtained by contacting
+   Kitware Inc.
+   28 Corporate Drive
+   Clifton Park, NY 12065
+   USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+// .NAME vtkPVAxesWidget - A widget to manipulate an axe
+//
+// .SECTION Description
+// This widget creates and manages its own vtkPVAxesActor.
+// VSR 03/12/2014: the original file vtkPVAxesWidget.h has been renamed to salomevtkPVAxesWidget.h
+// to avoid collisions with native VTK/ParaView classes
+
+
+#ifndef __salomevtkPVAxesWidget_h
+#define __salomevtkPVAxesWidget_h
+
+#include "SVTK.h"                            // added by SALOME
+#include "vtkInteractorObserver.h"
+
+class vtkActor2D;
+class vtkKWApplication;
+class vtkPolyData;
+class vtkRenderer;
+
+// VSR 03/12/2014: we put classes copied from VTK/ParaView to the specific namespace
+// to avoid collisions with native VTK/ParaView classes
+namespace salomevtk
+{
+
+class vtkPVAxesWidgetObserver;
+class vtkPVAxesActor;
+
+class SVTK_EXPORT vtkPVAxesWidget : public vtkInteractorObserver
+{
+public:
+  static vtkPVAxesWidget* New();
+  vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  // Description:
+  // Set/get the axes actor to be displayed in this 3D widget.
+  void SetAxesActor(vtkPVAxesActor *actor);
+  vtkGetObjectMacro(AxesActor, vtkPVAxesActor);
+
+  // Description:
+  // Enable the 3D widget.
+  virtual void SetEnabled(int);
+
+  //BTX
+  // Description:
+  // Set the renderer this 3D widget will be contained in.
+  void SetParentRenderer(vtkRenderer *ren);
+  vtkRenderer* GetParentRenderer();
+  //ETX
+  
+  // Description:
+  // Callback to keep the camera for the axes actor up to date with the
+  // camera in the parent renderer
+  void ExecuteEvent(vtkObject *o, unsigned long event, void *calldata);
+
+  // Description:
+  // Set/get whether to allow this 3D widget to be interactively moved/scaled.
+  void SetInteractive(int state);
+  vtkGetMacro(Interactive, int);
+  vtkBooleanMacro(Interactive, int);
+  
+  // Description:
+  // Set/get the color of the outline of this widget.  The outline is visible
+  // when (in interactive mode) the cursor is over this 3D widget.
+  void SetOutlineColor(double r, double g, double b);
+  double *GetOutlineColor();
+  
+  // Description:
+  // Set/get the color of the axis labels of this widget.
+  void SetAxisLabelColor(double r, double g, double b);
+  double *GetAxisLabelColor();
+  
+  // Description:
+  // Set/get the viewport to position/size this 3D widget.
+  void SetViewport(double minX, double minY, double maxX, double maxY);
+  double* GetViewport();
+  
+protected:
+  vtkPVAxesWidget();
+  ~vtkPVAxesWidget();
+  
+  vtkRenderer *Renderer;
+  vtkRenderer *ParentRenderer;
+  
+  vtkPVAxesActor *AxesActor;
+  vtkPolyData *Outline;
+  vtkActor2D *OutlineActor;
+  
+  static void ProcessEvents(vtkObject *object, unsigned long event,
+                            void *clientdata, void *calldata);
+
+  vtkPVAxesWidgetObserver *Observer;
+  int StartTag;
+  
+  int MouseCursorState;
+  int Moving;
+  int StartPosition[2];
+
+  int Interactive;
+  
+  void UpdateCursorIcon();
+  void SetMouseCursor(int cursorState);
+  
+//BTX
+  int State;
+  
+  enum AxesWidgetState
+  {
+    Outside = 0,
+    Inside,
+    TopLeft,
+    TopRight,
+    BottomLeft,
+    BottomRight
+  };
+//ETX
+  
+  void OnButtonPress();
+  void OnMouseMove();
+  void OnButtonRelease();
+
+  void MoveWidget();
+  void ResizeTopLeft();
+  void ResizeTopRight();
+  void ResizeBottomLeft();
+  void ResizeBottomRight();
+  
+  void SquareRenderer();
+
+  unsigned long StartEventObserverId;  
+private:
+  vtkPVAxesWidget(const vtkPVAxesWidget&);  // Not implemented
+  void operator=(const vtkPVAxesWidget&);  // Not implemented
+};
+
+} // end of salomevtk namespace
+
+#endif
diff --git a/src/SVTK/vtkPVAxesActor.cxx b/src/SVTK/vtkPVAxesActor.cxx
deleted file mode 100644 (file)
index 4431e3e..0000000
+++ /dev/null
@@ -1,809 +0,0 @@
-/*=========================================================================
-
-   Program: ParaView
-   Module:    $RCSfile$
-
-   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
-   All rights reserved.
-
-   ParaView is a free software; you can redistribute it and/or modify it
-   under the terms of the ParaView license version 1.2. 
-
-   See License_v1.2.txt for the full ParaView license.
-   A copy of this license can be obtained by contacting
-   Kitware Inc.
-   28 Corporate Drive
-   Clifton Park, NY 12065
-   USA
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=========================================================================*/
-#include "vtkPVAxesActor.h"
-#include "vtkObject.h"
-#include "vtkObjectFactory.h"
-
-#include "vtkActor.h"
-#include "vtkPropCollection.h"
-#include "vtkProperty.h"
-#include "vtkRenderWindow.h"
-#include "vtkTransform.h"
-#include "vtkCylinderSource.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkLineSource.h"
-#include "vtkPolyData.h"
-#include "vtkConeSource.h"
-#include "vtkSphereSource.h"
-#include "vtkVectorText.h"
-#include "vtkFollower.h"
-#include "vtkRenderer.h"
-
-#include <math.h>
-
-vtkStandardNewMacro(vtkPVAxesActor);
-
-vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData );
-vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedShaft, vtkPolyData );
-
-//-----------------------------------------------------------------------------
-vtkPVAxesActor::vtkPVAxesActor()
-{
-  this->XAxisLabelText = NULL;
-  this->YAxisLabelText = NULL;
-  this->ZAxisLabelText = NULL;
-    
-  this->SetXAxisLabelText("X");
-  this->SetYAxisLabelText("Y");
-  this->SetZAxisLabelText("Z");
-  
-  //colors chosen to match the output of vtkAxes.cxx's LUT.
-  this->XAxisShaft = vtkActor::New();
-  this->XAxisShaft->GetProperty()->SetColor(1, 0, 0);
-  this->YAxisShaft = vtkActor::New();
-  this->YAxisShaft->GetProperty()->SetColor(1, 1, 0);
-  this->ZAxisShaft = vtkActor::New();
-  this->ZAxisShaft->GetProperty()->SetColor(0, 1, 0);
-
-  this->XAxisTip = vtkActor::New();
-  this->XAxisTip->GetProperty()->SetColor(1, 0, 0);
-  this->YAxisTip = vtkActor::New();
-  this->YAxisTip->GetProperty()->SetColor(1, 1, 0);
-  this->ZAxisTip = vtkActor::New();
-  this->ZAxisTip->GetProperty()->SetColor(0, 1, 0);
-
-  this->CylinderSource = vtkCylinderSource::New();
-  this->CylinderSource->SetHeight(1.0);
-  
-  this->LineSource = vtkLineSource::New();
-  this->LineSource->SetPoint1( 0.0, 0.0, 0.0 );
-  this->LineSource->SetPoint2( 0.0, 1.0, 0.0 );
-
-  this->ConeSource = vtkConeSource::New();
-  this->ConeSource->SetDirection( 0, 1, 0 );
-  this->ConeSource->SetHeight( 1.0 );
-   
-  this->SphereSource = vtkSphereSource::New();
-  
-  vtkPolyDataMapper *shaftMapper = vtkPolyDataMapper::New();
-  
-  this->XAxisShaft->SetMapper( shaftMapper );
-  this->YAxisShaft->SetMapper( shaftMapper );
-  this->ZAxisShaft->SetMapper( shaftMapper );
-  
-  shaftMapper->Delete();
-
-  vtkPolyDataMapper *tipMapper = vtkPolyDataMapper::New();
-  
-  this->XAxisTip->SetMapper( tipMapper );
-  this->YAxisTip->SetMapper( tipMapper );
-  this->ZAxisTip->SetMapper( tipMapper );
-  
-  tipMapper->Delete();
-
-  this->TotalLength[0] = 1.0;
-  this->TotalLength[1] = 1.0;
-  this->TotalLength[2] = 1.0;
-  this->NormalizedShaftLength[0] = 0.8;
-  this->NormalizedShaftLength[1] = 0.8;
-  this->NormalizedShaftLength[2] = 0.8;
-
-  this->NormalizedTipLength[0] = 0.2;
-  this->NormalizedTipLength[1] = 0.2;
-  this->NormalizedTipLength[2] = 0.2;
-
-  this->ConeResolution = 16;
-  this->SphereResolution = 16;
-  this->CylinderResolution = 16;
-  
-  this->ConeRadius = 0.4;
-  this->SphereRadius = 0.5;
-  this->CylinderRadius = 0.05;
-  
-  this->XAxisLabelPosition = 1;
-  this->YAxisLabelPosition = 1;
-  this->ZAxisLabelPosition = 1;
-  
-  this->ShaftType = vtkPVAxesActor::LINE_SHAFT;
-  this->TipType   = vtkPVAxesActor::CONE_TIP;
-
-  this->UserDefinedTip = NULL;
-  this->UserDefinedShaft = NULL;
-
-  this->XAxisVectorText = vtkVectorText::New();
-  this->YAxisVectorText = vtkVectorText::New();
-  this->ZAxisVectorText = vtkVectorText::New();
-  
-  this->XAxisLabel = vtkFollower::New();
-  this->YAxisLabel = vtkFollower::New();
-  this->ZAxisLabel = vtkFollower::New();
-  
-  vtkPolyDataMapper *xmapper = vtkPolyDataMapper::New();
-  vtkPolyDataMapper *ymapper = vtkPolyDataMapper::New();
-  vtkPolyDataMapper *zmapper = vtkPolyDataMapper::New();
-  
-  xmapper->SetInputConnection( this->XAxisVectorText->GetOutputPort() );
-  ymapper->SetInputConnection( this->YAxisVectorText->GetOutputPort() );
-  zmapper->SetInputConnection( this->ZAxisVectorText->GetOutputPort() );
-  
-  this->XAxisLabel->SetMapper( xmapper );
-  this->YAxisLabel->SetMapper( ymapper );
-  this->ZAxisLabel->SetMapper( zmapper );
-  
-  xmapper->Delete();
-  ymapper->Delete();
-  zmapper->Delete();
-  
-  this->UpdateProps();
-}
-
-//-----------------------------------------------------------------------------
-vtkPVAxesActor::~vtkPVAxesActor()
-{
-  this->CylinderSource->Delete();
-  this->LineSource->Delete();
-  this->ConeSource->Delete();
-  this->SphereSource->Delete();  
-  
-  this->XAxisShaft->Delete();
-  this->YAxisShaft->Delete();
-  this->ZAxisShaft->Delete();  
-
-  this->XAxisTip->Delete();
-  this->YAxisTip->Delete();
-  this->ZAxisTip->Delete();  
-  
-  this->SetUserDefinedTip( NULL );
-  this->SetUserDefinedShaft( NULL );
-  
-  this->SetXAxisLabelText( NULL );
-  this->SetYAxisLabelText( NULL );
-  this->SetZAxisLabelText( NULL );
-  
-  this->XAxisVectorText->Delete();
-  this->YAxisVectorText->Delete();
-  this->ZAxisVectorText->Delete();
-
-  this->XAxisLabel->Delete();
-  this->YAxisLabel->Delete();
-  this->ZAxisLabel->Delete();
-}
-
-//-----------------------------------------------------------------------------
-// Shallow copy of an actor.
-void vtkPVAxesActor::ShallowCopy(vtkProp *prop)
-{
-  vtkPVAxesActor *a = vtkPVAxesActor::SafeDownCast(prop);
-  if ( a != NULL )
-    {
-    }
-
-  // Now do superclass
-  this->vtkProp3D::ShallowCopy(prop);
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::GetActors(vtkPropCollection *ac)
-{
-  ac->AddItem(this->XAxisShaft);
-  ac->AddItem(this->YAxisShaft);
-  ac->AddItem(this->ZAxisShaft);
-  ac->AddItem(this->XAxisTip);
-  ac->AddItem(this->YAxisTip);
-  ac->AddItem(this->ZAxisTip);
-  ac->AddItem(this->XAxisLabel);
-  ac->AddItem(this->YAxisLabel);
-  ac->AddItem(this->ZAxisLabel);
-
-}
-
-//-----------------------------------------------------------------------------
-int vtkPVAxesActor::RenderOpaqueGeometry(vtkViewport *vp)
-{
-  int          renderedSomething = 0; 
-
-  vtkRenderer *ren = vtkRenderer::SafeDownCast( vp );
-
-  this->UpdateProps();
-  
-  this->XAxisLabel->SetCamera( ren->GetActiveCamera() );
-  this->YAxisLabel->SetCamera( ren->GetActiveCamera() );
-  this->ZAxisLabel->SetCamera( ren->GetActiveCamera() );
-  
-  this->XAxisShaft->RenderOpaqueGeometry(vp);
-  this->YAxisShaft->RenderOpaqueGeometry(vp);
-  this->ZAxisShaft->RenderOpaqueGeometry(vp);
-
-  this->XAxisTip->RenderOpaqueGeometry(vp);
-  this->YAxisTip->RenderOpaqueGeometry(vp);
-  this->ZAxisTip->RenderOpaqueGeometry(vp);
-
-  this->XAxisLabel->RenderOpaqueGeometry(vp);
-  this->YAxisLabel->RenderOpaqueGeometry(vp);
-  this->ZAxisLabel->RenderOpaqueGeometry(vp);
-  
-  return renderedSomething;
-}
-
-//-----------------------------------------------------------------------------
-#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2)
-// porting to VTK 5.0.x
-int vtkPVAxesActor::RenderTranslucentPolygonalGeometry(vtkViewport *vp)
-{
-  int renderedSomething=0; 
-
-  this->UpdateProps();
-  
-  renderedSomething += this->XAxisShaft->RenderTranslucentPolygonalGeometry(vp);
-  renderedSomething += this->YAxisShaft->RenderTranslucentPolygonalGeometry(vp);
-  renderedSomething += this->ZAxisShaft->RenderTranslucentPolygonalGeometry(vp);
-
-  renderedSomething += this->XAxisTip->RenderTranslucentPolygonalGeometry(vp);
-  renderedSomething += this->YAxisTip->RenderTranslucentPolygonalGeometry(vp);
-  renderedSomething += this->ZAxisTip->RenderTranslucentPolygonalGeometry(vp);
-  
-  renderedSomething += this->XAxisLabel->RenderTranslucentPolygonalGeometry(vp);
-  renderedSomething += this->YAxisLabel->RenderTranslucentPolygonalGeometry(vp);
-  renderedSomething += this->ZAxisLabel->RenderTranslucentPolygonalGeometry(vp);
-  
-  return renderedSomething;
-}
-
-//-----------------------------------------------------------------------------
-// porting to VTK 5.0.x
-int vtkPVAxesActor::HasTranslucentPolygonalGeometry()
-{
-  int result = 0; 
-
-  this->UpdateProps();
-  
-  result |= this->XAxisShaft->HasTranslucentPolygonalGeometry();
-  result |= this->YAxisShaft->HasTranslucentPolygonalGeometry();
-  result |= this->ZAxisShaft->HasTranslucentPolygonalGeometry();
-
-  result |= this->XAxisTip->HasTranslucentPolygonalGeometry();
-  result |= this->YAxisTip->HasTranslucentPolygonalGeometry();
-  result |= this->ZAxisTip->HasTranslucentPolygonalGeometry();
-  
-  result |= this->XAxisLabel->HasTranslucentPolygonalGeometry();
-  result |= this->YAxisLabel->HasTranslucentPolygonalGeometry();
-  result |= this->ZAxisLabel->HasTranslucentPolygonalGeometry();
-  
-  return result;
-}
-
-#else
-//-----------------------------------------------------------------------------
-// porting to VTK 5.0.x
-int vtkPVAxesActor::RenderTranslucentGeometry(vtkViewport *vp)
-{
-  int renderedSomething=0; 
-
-  this->UpdateProps();
-  
-  renderedSomething += this->XAxisShaft->RenderTranslucentGeometry(vp);
-  renderedSomething += this->YAxisShaft->RenderTranslucentGeometry(vp);
-  renderedSomething += this->ZAxisShaft->RenderTranslucentGeometry(vp);
-
-  renderedSomething += this->XAxisTip->RenderTranslucentGeometry(vp);
-  renderedSomething += this->YAxisTip->RenderTranslucentGeometry(vp);
-  renderedSomething += this->ZAxisTip->RenderTranslucentGeometry(vp);
-  
-  renderedSomething += this->XAxisLabel->RenderTranslucentGeometry(vp);
-  renderedSomething += this->YAxisLabel->RenderTranslucentGeometry(vp);
-  renderedSomething += this->ZAxisLabel->RenderTranslucentGeometry(vp);
-  
-  return renderedSomething;
-}
-#endif
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::ReleaseGraphicsResources(vtkWindow *win)
-{
-  this->XAxisShaft->ReleaseGraphicsResources( win );
-  this->YAxisShaft->ReleaseGraphicsResources( win );
-  this->ZAxisShaft->ReleaseGraphicsResources( win );
-
-  this->XAxisTip->ReleaseGraphicsResources( win );
-  this->YAxisTip->ReleaseGraphicsResources( win );
-  this->ZAxisTip->ReleaseGraphicsResources( win );
-    
-  this->XAxisLabel->ReleaseGraphicsResources( win );
-  this->YAxisLabel->ReleaseGraphicsResources( win );
-  this->ZAxisLabel->ReleaseGraphicsResources( win );
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::GetBounds(double bounds[6])
-{
-  double *bds = this->GetBounds();
-  bounds[0] = bds[0];
-  bounds[1] = bds[1];
-  bounds[2] = bds[2];
-  bounds[3] = bds[3];
-  bounds[4] = bds[4];
-  bounds[5] = bds[5];
-}
-
-//-----------------------------------------------------------------------------
-// Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
-double *vtkPVAxesActor::GetBounds()
-{
-  double bounds[6];
-  int i;
-  
-  this->XAxisShaft->GetBounds(this->Bounds);
-
-  this->YAxisShaft->GetBounds(bounds);
-  for (i=0; i<3; i++)
-    {
-    this->Bounds[2*i+1] = 
-      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
-    }
-
-  this->ZAxisShaft->GetBounds(bounds);
-  for (i=0; i<3; i++)
-    {
-    this->Bounds[2*i+1] = 
-      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
-    }
-
-  this->XAxisTip->GetBounds(bounds);
-  for (i=0; i<3; i++)
-    {
-    this->Bounds[2*i+1] = 
-      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
-    }
-
-  this->YAxisTip->GetBounds(bounds);
-  for (i=0; i<3; i++)
-    {
-    this->Bounds[2*i+1] = 
-      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
-    }
-
-  this->ZAxisTip->GetBounds(bounds);
-  for (i=0; i<3; i++)
-    {
-    this->Bounds[2*i+1] = 
-      (bounds[2*i+1]>this->Bounds[2*i+1])?(bounds[2*i+1]):(this->Bounds[2*i+1]);    
-    }
-
-  double dbounds[6];
-  (vtkPolyDataMapper::SafeDownCast(this->YAxisShaft->GetMapper()))->
-    GetInput()->GetBounds( dbounds );
-  
-  for (i=0; i<3; i++)
-    {
-    this->Bounds[2*i+1] = 
-      (dbounds[2*i+1]>this->Bounds[2*i+1])?(dbounds[2*i+1]):(this->Bounds[2*i+1]);    
-    }
-
-  // We want this actor to rotate / re-center about the origin, so give it
-  // the bounds it would have if the axes were symmetrical.
-  for (i = 0; i < 3; i++)
-    {
-    this->Bounds[2*i] = -this->Bounds[2*i+1];
-    }
-
-  return this->Bounds;
-}
-
-//-----------------------------------------------------------------------------
-unsigned long int vtkPVAxesActor::GetMTime()
-{
-  unsigned long mTime=this->Superclass::GetMTime();
-
-
-  return mTime;
-}
-
-//-----------------------------------------------------------------------------
-unsigned long int vtkPVAxesActor::GetRedrawMTime()
-{
-  unsigned long mTime=this->GetMTime();
-
-  return mTime;
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetXAxisTipProperty()
-{
-  return this->XAxisTip->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetYAxisTipProperty()
-{
-  return this->YAxisTip->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetZAxisTipProperty()
-{
-  return this->ZAxisTip->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetXAxisShaftProperty()
-{
-  return this->XAxisShaft->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetYAxisShaftProperty()
-{
-  return this->YAxisShaft->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetZAxisShaftProperty()
-{
-  return this->ZAxisShaft->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetXAxisLabelProperty()
-{
-  return this->XAxisLabel->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetYAxisLabelProperty()
-{
-  return this->YAxisLabel->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-vtkProperty *vtkPVAxesActor::GetZAxisLabelProperty()
-{
-  return this->ZAxisLabel->GetProperty();
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::SetTotalLength( float x, float y, float z )
-{
-  if ( this->TotalLength[0] != x ||
-       this->TotalLength[1] != y ||
-       this->TotalLength[2] != z )
-    {
-    this->TotalLength[0] = x;
-    this->TotalLength[1] = y;
-    this->TotalLength[2] = z;
-  
-    this->Modified();
-    
-    this->UpdateProps();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::SetNormalizedShaftLength( float x, float y, float z )
-{
-  if ( this->NormalizedShaftLength[0] != x ||
-       this->NormalizedShaftLength[1] != y ||
-       this->NormalizedShaftLength[2] != z )
-    {
-    this->NormalizedShaftLength[0] = x;
-    this->NormalizedShaftLength[1] = y;
-    this->NormalizedShaftLength[2] = z;
-  
-    this->Modified();
-    
-    this->UpdateProps();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::SetNormalizedTipLength( float x, float y, float z )
-{
-  if ( this->NormalizedTipLength[0] != x ||
-       this->NormalizedTipLength[1] != y ||
-       this->NormalizedTipLength[2] != z )
-    {
-    this->NormalizedTipLength[0] = x;
-    this->NormalizedTipLength[1] = y;
-    this->NormalizedTipLength[2] = z;
-  
-    this->Modified();
-    
-    this->UpdateProps();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::SetShaftType( int type )
-{
-  if ( this->ShaftType != type )
-    {
-    this->ShaftType = type;
-  
-    this->Modified();
-    
-    this->UpdateProps();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::SetTipType( int type )
-{
-  if ( this->TipType != type )
-    {
-    this->TipType = type;
-  
-    this->Modified();
-    
-    this->UpdateProps();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::UpdateProps()
-{
-  this->CylinderSource->SetRadius(this->CylinderRadius);
-  this->CylinderSource->SetResolution(this->CylinderResolution);
-  
-  
-  this->ConeSource->SetResolution(this->ConeResolution);
-  this->ConeSource->SetRadius(this->ConeRadius);
-  this->SphereSource->SetThetaResolution( this->SphereResolution );
-  this->SphereSource->SetPhiResolution( this->SphereResolution );
-  this->SphereSource->SetRadius(this->SphereRadius);
-  
-  switch ( this->ShaftType )
-    {
-    case vtkPVAxesActor::CYLINDER_SHAFT:
-      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
-        SetInputConnection( this->CylinderSource->GetOutputPort() );
-      break;
-    case vtkPVAxesActor::LINE_SHAFT:
-      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
-        SetInputConnection( this->LineSource->GetOutputPort() );
-      break;
-    case vtkPVAxesActor::USER_DEFINED_SHAFT:
-      (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
-        SetInputData( this->UserDefinedShaft );
-    }
-  
-  switch ( this->TipType )
-    {
-    case vtkPVAxesActor::CONE_TIP:
-      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
-        SetInputConnection( this->ConeSource->GetOutputPort() );
-      break;      
-    case vtkPVAxesActor::SPHERE_TIP:
-      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
-        SetInputConnection( this->SphereSource->GetOutputPort() );
-      break;      
-    case vtkPVAxesActor::USER_DEFINED_TIP:
-      (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
-        SetInputData( this->UserDefinedTip );
-    }
-  
-  (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->Update();
-  (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->Update();
-      
-  
-  
-  float scale[3];
-  double bounds[6];
-
-  (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
-    GetInput()->GetBounds( bounds );
-  
-  int i;
-  for ( i = 0; i < 3; i++ )
-    {
-    scale[i] = 
-      this->NormalizedShaftLength[i]*this->TotalLength[i] / 
-      (bounds[3] - bounds[2]);
-    }
-  
-  vtkTransform *xTransform = vtkTransform::New();
-  vtkTransform *yTransform = vtkTransform::New();
-  vtkTransform *zTransform = vtkTransform::New();
-  
-  xTransform->RotateZ( -90 );
-  zTransform->RotateX( 90 );
-  
-  xTransform->Scale( scale[0], scale[0], scale[0] );
-  yTransform->Scale( scale[1], scale[1], scale[1] );
-  zTransform->Scale( scale[2], scale[2], scale[2] );
-
-  xTransform->Translate( -(bounds[0]+bounds[1])/2,
-                         -bounds[2],
-                         -(bounds[4]+bounds[5])/2 );
-  yTransform->Translate( -(bounds[0]+bounds[1])/2,
-                         -bounds[2],
-                         -(bounds[4]+bounds[5])/2 );
-  zTransform->Translate( -(bounds[0]+bounds[1])/2,
-                         -bounds[2],
-                         -(bounds[4]+bounds[5])/2 );
-  
-  
-
-  this->XAxisShaft->SetUserTransform( xTransform );
-  this->YAxisShaft->SetUserTransform( yTransform );
-  this->ZAxisShaft->SetUserTransform( zTransform );
-
-  xTransform->Delete();
-  yTransform->Delete();
-  zTransform->Delete();
-  
-  (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
-    GetInput()->GetBounds( bounds );
-  
-  xTransform = vtkTransform::New();
-  yTransform = vtkTransform::New();
-  zTransform = vtkTransform::New();
-  
-  xTransform->RotateZ( -90 );
-  zTransform->RotateX( 90 );
-  
-  xTransform->Scale( this->TotalLength[0], this->TotalLength[0], this->TotalLength[0] );
-  yTransform->Scale( this->TotalLength[1], this->TotalLength[1], this->TotalLength[1] );
-  zTransform->Scale( this->TotalLength[2], this->TotalLength[2], this->TotalLength[2] );
-  
-  xTransform->Translate( 0, (1.0 - this->NormalizedTipLength[0]), 0 );
-  yTransform->Translate( 0, (1.0 - this->NormalizedTipLength[1]), 0 );
-  zTransform->Translate( 0, (1.0 - this->NormalizedTipLength[2]), 0 );
-  
-  xTransform->Scale( this->NormalizedTipLength[0], 
-                     this->NormalizedTipLength[0], 
-                     this->NormalizedTipLength[0] );
-
-  yTransform->Scale( this->NormalizedTipLength[1], 
-                     this->NormalizedTipLength[1], 
-                     this->NormalizedTipLength[1] );
-  
-  zTransform->Scale( this->NormalizedTipLength[2], 
-                     this->NormalizedTipLength[2], 
-                     this->NormalizedTipLength[2] );
-  
-  xTransform->Translate( -(bounds[0]+bounds[1])/2,
-                         -bounds[2],
-                         -(bounds[4]+bounds[5])/2 );
-  yTransform->Translate( -(bounds[0]+bounds[1])/2,
-                         -bounds[2],
-                         -(bounds[4]+bounds[5])/2 );
-  zTransform->Translate( -(bounds[0]+bounds[1])/2,
-                         -bounds[2],
-                         -(bounds[4]+bounds[5])/2 );
-
-  
-  this->XAxisTip->SetUserTransform( xTransform );
-  this->YAxisTip->SetUserTransform( yTransform );
-  this->ZAxisTip->SetUserTransform( zTransform );
-
-  xTransform->Delete();
-  yTransform->Delete();
-  zTransform->Delete();
-
-  this->XAxisVectorText->SetText( this->XAxisLabelText );
-  this->YAxisVectorText->SetText( this->YAxisLabelText );
-  this->ZAxisVectorText->SetText( this->ZAxisLabelText );
-  
-  
-  float avgScale = 
-    (this->TotalLength[0] + this->TotalLength[1] + this->TotalLength[2])/15;
-  
-  this->XAxisShaft->GetBounds(bounds);
-  this->XAxisLabel->SetScale( avgScale, avgScale, avgScale );
-  this->XAxisLabel->SetPosition( bounds[0] + this->XAxisLabelPosition *
-                                 (bounds[1]-bounds[0]),
-                                 bounds[2] - (bounds[3]-bounds[2])*2.0,
-                                 bounds[5] + (bounds[5]-bounds[4])/2.0 );
-
-  this->YAxisShaft->GetBounds(bounds);
-  this->YAxisLabel->SetScale( avgScale, avgScale, avgScale );
-  this->YAxisLabel->SetPosition( (bounds[0]+bounds[1])/2, 
-                                 bounds[2] + this->YAxisLabelPosition *
-                                 (bounds[3]-bounds[2]),
-                                 bounds[5] + (bounds[5]-bounds[4])/2.0 );
-
-  this->ZAxisShaft->GetBounds(bounds);
-  this->ZAxisLabel->SetScale( avgScale, avgScale, avgScale );
-  this->ZAxisLabel->SetPosition( bounds[0], 
-                                 bounds[2] - (bounds[3]-bounds[2])*2.0,
-                                 bounds[4] + this->ZAxisLabelPosition *
-                                 (bounds[5]-bounds[4]) );
-}
-
-//-----------------------------------------------------------------------------
-void vtkPVAxesActor::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-  
-  os << indent << "UserDefinedShaft: ";
-  if (this->UserDefinedShaft)
-    {
-    os << this->UserDefinedShaft << endl;
-    }
-  else
-    {
-    os << "(none)" << endl;
-    }
-  
-  os << indent << "UserDefinedTip: ";
-  if (this->UserDefinedTip)
-    {
-    os << this->UserDefinedTip << endl;
-    }
-  else
-    {
-    os << "(none)" << endl;
-    }
-  
-  os << indent << "XAxisLabelText: " << (this->XAxisLabelText ?
-                                         this->XAxisLabelText : "(none)")
-     << endl;
-  os << indent << "YAxisLabelText: " << (this->YAxisLabelText ?
-                                         this->YAxisLabelText : "(none)")
-     << endl;
-  os << indent << "ZAxisLabelText: " << (this->ZAxisLabelText ?
-                                         this->ZAxisLabelText : "(none)")
-     << endl;
-  os << indent << "XAxisLabelPosition: " << this->XAxisLabelPosition << endl;
-  os << indent << "YAxisLabelPosition: " << this->YAxisLabelPosition << endl;
-  os << indent << "ZAxisLabelPosition: " << this->ZAxisLabelPosition << endl;
-  
-  os << indent << "SphereRadius: " << this->SphereRadius << endl;
-  os << indent << "SphereResolution: " << this->SphereResolution << endl;
-  os << indent << "CylinderRadius: " << this->CylinderRadius << endl;
-  os << indent << "CylinderResolution: " << this->CylinderResolution << endl;
-  os << indent << "ConeRadius: " << this->ConeRadius << endl;
-  os << indent << "ConeResolution: " << this->ConeResolution << endl;
-  
-  os << indent << "NormalizedShaftLength: " 
-     << this->NormalizedShaftLength[0] << ","
-     << this->NormalizedShaftLength[1] << ","
-     << this->NormalizedShaftLength[2] << endl;
-  os << indent << "NormalizedTipLength: " 
-     << this->NormalizedTipLength[0] << ","
-     << this->NormalizedTipLength[1] << ","
-     << this->NormalizedTipLength[2] << endl;
-  os << indent << "TotalLength: " 
-     << this->TotalLength[0] << ","
-     << this->TotalLength[1] << ","
-     << this->TotalLength[2] << endl;
-}
-
-//-----------------------------------------------------------------------------
-// porting to VTK 5.0.x
-void vtkPVAxesActor::AddToRender( vtkRenderer* theRenderer )
-{
-  theRenderer->AddActor(this->XAxisLabel);
-  theRenderer->AddActor(this->YAxisLabel);
-  theRenderer->AddActor(this->ZAxisLabel);
-}
diff --git a/src/SVTK/vtkPVAxesActor.h b/src/SVTK/vtkPVAxesActor.h
deleted file mode 100644 (file)
index b76f59f..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-/*=========================================================================
-
-   Program: ParaView
-   Module:    $RCSfile$
-
-   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
-   All rights reserved.
-
-   ParaView is a free software; you can redistribute it and/or modify it
-   under the terms of the ParaView license version 1.2. 
-
-   See License_v1.2.txt for the full ParaView license.
-   A copy of this license can be obtained by contacting
-   Kitware Inc.
-   28 Corporate Drive
-   Clifton Park, NY 12065
-   USA
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=========================================================================*/
-// .NAME vtkPVAxesActor - a 3D axes representation
-// .SECTION Description
-// 
-// vtkPVAxesActor is used to represent 3D axes in the scene. The user can
-// define the geometry to use for the shaft and the tip, and the user can
-// set the text for the three axes. The text will follow the camera.
-
-
-#ifndef __vtkPVAxesActor_h
-#define __vtkPVAxesActor_h
-
-#include "SVTK.h"
-#include "vtkProp3D.h"
-
-#include <vtkVersion.h>
-
-class vtkRenderer;
-class vtkPropCollection;
-class vtkMapper;
-class vtkProperty;
-class vtkActor;
-class vtkFollower;
-class vtkCylinderSource;
-class vtkLineSource;
-class vtkConeSource;
-class vtkSphereSource;
-class vtkPolyData;
-class vtkVectorText;
-
-class SVTK_EXPORT vtkPVAxesActor : public vtkProp3D
-{
-public:
-  static vtkPVAxesActor *New();
-  vtkTypeMacro(vtkPVAxesActor,vtkProp3D);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-
-  // Description: 
-  // For some exporters and other other operations we must be
-  // able to collect all the actors or volumes. These methods
-  // are used in that process.
-  virtual void GetActors(vtkPropCollection *);
-
-  // Description:
-  // Support the standard render methods.
-  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
-#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2)
-  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); // porting to VTK 5.0.x
-  virtual int HasTranslucentPolygonalGeometry();                         // porting to VTK 5.0.x
-#else
-  virtual int RenderTranslucentGeometry(vtkViewport *viewport);            // porting to VTK 5.0.x
-#endif
-
-  // Description:
-  // Shallow copy of an axes actor. Overloads the virtual vtkProp method.
-  void ShallowCopy(vtkProp *prop);
-
-  // Description:
-  // Release any graphics resources that are being consumed by this actor.
-  // The parameter window could be used to determine which graphic
-  // resources to release.
-  void ReleaseGraphicsResources(vtkWindow *);
-
-  // Description:
-  // Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax). (The
-  // method GetBounds(double bounds[6]) is available from the superclass.)
-  void GetBounds(double bounds[6]);
-  double *GetBounds();
-
-  // Description:
-  // Get the actors mtime plus consider its properties and texture if set.
-  unsigned long int GetMTime();
-  
-  // Description:
-  // Return the mtime of anything that would cause the rendered image to 
-  // appear differently. Usually this involves checking the mtime of the 
-  // prop plus anything else it depends on such as properties, textures
-  // etc.
-  virtual unsigned long GetRedrawMTime();
-
-  // Description:
-  // Set the total length of the axes in 3 dimensions.
-  void SetTotalLength( float v[3] ) 
-    { this->SetTotalLength( v[0], v[1], v[2] ); }
-  void SetTotalLength( float x, float y, float z );
-  vtkGetVectorMacro( TotalLength, float, 3 );
-  
-  // Description:
-  // Set the normalized (0-1) length of the shaft.
-  void SetNormalizedShaftLength( float v[3] ) 
-    { this->SetNormalizedShaftLength( v[0], v[1], v[2] ); }
-  void SetNormalizedShaftLength( float x, float y, float z );
-  vtkGetVectorMacro( NormalizedShaftLength, float, 3 );
-  
-  // Description:
-  // Set the normalized (0-1) length of the tip.
-  void SetNormalizedTipLength( float v[3] ) 
-    { this->SetNormalizedTipLength( v[0], v[1], v[2] ); }
-  void SetNormalizedTipLength( float x, float y, float z );
-  vtkGetVectorMacro( NormalizedTipLength, float, 3 );
-
-  // Description:
-  // Set/get the resolution of the pieces of the axes actor
-  vtkSetClampMacro(ConeResolution, int, 3, 128);
-  vtkGetMacro(ConeResolution, int);
-  vtkSetClampMacro(SphereResolution, int, 3, 128);
-  vtkGetMacro(SphereResolution, int);
-  vtkSetClampMacro(CylinderResolution, int, 3, 128);
-  vtkGetMacro(CylinderResolution, int);
-  
-  // Description:
-  // Set/get the radius of the pieces of the axes actor
-  vtkSetClampMacro(ConeRadius, float, 0, VTK_LARGE_FLOAT);
-  vtkGetMacro(ConeRadius, float);
-  vtkSetClampMacro(SphereRadius, float, 0, VTK_LARGE_FLOAT);
-  vtkGetMacro(SphereRadius, float);
-  vtkSetClampMacro(CylinderRadius, float, 0, VTK_LARGE_FLOAT);
-  vtkGetMacro(CylinderRadius, float);
-  
-  // Description:
-  // Set/get the positions of the axis labels
-  vtkSetClampMacro(XAxisLabelPosition, float, 0, 1);
-  vtkGetMacro(XAxisLabelPosition, float);
-  vtkSetClampMacro(YAxisLabelPosition, float, 0, 1);
-  vtkGetMacro(YAxisLabelPosition, float);
-  vtkSetClampMacro(ZAxisLabelPosition, float, 0, 1);
-  vtkGetMacro(ZAxisLabelPosition, float);
-  
-  // Description:
-  // Set the type of the shaft to a cylinder, line, or user defined geometry.
-  void SetShaftType( int type );
-  void SetShaftTypeToCylinder()
-    { this->SetShaftType( vtkPVAxesActor::CYLINDER_SHAFT ); }
-  void SetShaftTypeToLine()
-    { this->SetShaftType( vtkPVAxesActor::LINE_SHAFT ); }
-  void SetShaftTypeToUserDefined()
-    { this->SetShaftType( vtkPVAxesActor::USER_DEFINED_SHAFT ); }
-
-  // Description:
-  // Set the type of the tip to a cone, sphere, or user defined geometry.
-  void SetTipType( int type );
-  void SetTipTypeToCone()
-    { this->SetTipType( vtkPVAxesActor::CONE_TIP ); }
-  void SetTipTypeToSphere()
-    { this->SetTipType( vtkPVAxesActor::SPHERE_TIP ); }
-  void SetTipTypeToUserDefined()
-    { this->SetTipType( vtkPVAxesActor::USER_DEFINED_TIP ); }
-
-  //BTX
-  // Description:
-  // Set the user defined tip polydata.
-  void SetUserDefinedTip( vtkPolyData * );
-  vtkGetObjectMacro( UserDefinedTip, vtkPolyData );
-  
-  // Description:
-  // Set the user defined shaft polydata.
-  void SetUserDefinedShaft( vtkPolyData * );
-  vtkGetObjectMacro( UserDefinedShaft, vtkPolyData );
-
-  // Description:
-  // Get the tip properties.
-  vtkProperty *GetXAxisTipProperty();
-  vtkProperty *GetYAxisTipProperty();
-  vtkProperty *GetZAxisTipProperty();
-  
-  // Description:
-  // Get the shaft properties.
-  vtkProperty *GetXAxisShaftProperty();
-  vtkProperty *GetYAxisShaftProperty();
-  vtkProperty *GetZAxisShaftProperty();
-
-  // Description:
-  // Get the label properties.
-  vtkProperty *GetXAxisLabelProperty();
-  vtkProperty *GetYAxisLabelProperty();
-  vtkProperty *GetZAxisLabelProperty();
-  //ETX
-  //
-  // Description:
-  // Set the label text.
-  vtkSetStringMacro( XAxisLabelText );
-  vtkSetStringMacro( YAxisLabelText );
-  vtkSetStringMacro( ZAxisLabelText );
-  
-//BTX
-  enum
-  {
-    CYLINDER_SHAFT,
-    LINE_SHAFT,
-    USER_DEFINED_SHAFT
-  };
-  
-  
-  enum
-  {
-    CONE_TIP,
-    SPHERE_TIP,
-    USER_DEFINED_TIP
-  };
-  
-//ETX
-
-  void AddToRender( vtkRenderer* theRenderer ); // porting to VTK 5.0.x
-  
-protected:
-  vtkPVAxesActor();
-  ~vtkPVAxesActor();
-
-  vtkCylinderSource *CylinderSource;
-  vtkLineSource     *LineSource;
-  vtkConeSource     *ConeSource;
-  vtkSphereSource   *SphereSource;
-  
-  vtkActor          *XAxisShaft;
-  vtkActor          *YAxisShaft;
-  vtkActor          *ZAxisShaft;
-
-  vtkActor          *XAxisTip;
-  vtkActor          *YAxisTip;
-  vtkActor          *ZAxisTip;
-
-  void              UpdateProps();
-
-  float             TotalLength[3];
-  float             NormalizedShaftLength[3];
-  float             NormalizedTipLength[3];
-  
-  int               ShaftType;
-  int               TipType;
-  
-  vtkPolyData      *UserDefinedTip;
-  vtkPolyData      *UserDefinedShaft;
-  
-  char             *XAxisLabelText;
-  char             *YAxisLabelText;
-  char             *ZAxisLabelText;
-  
-  vtkVectorText    *XAxisVectorText;
-  vtkVectorText    *YAxisVectorText;
-  vtkVectorText    *ZAxisVectorText;
-  
-  vtkFollower      *XAxisLabel;
-  vtkFollower      *YAxisLabel;
-  vtkFollower      *ZAxisLabel;
-  
-  int              ConeResolution;
-  int              SphereResolution;
-  int              CylinderResolution;
-  
-  float            ConeRadius;
-  float            SphereRadius;
-  float            CylinderRadius;
-
-  float            XAxisLabelPosition;
-  float            YAxisLabelPosition;
-  float            ZAxisLabelPosition;
-  
-private:
-  vtkPVAxesActor(const vtkPVAxesActor&);  // Not implemented.
-  void operator=(const vtkPVAxesActor&);  // Not implemented.
-};
-
-#endif
-
diff --git a/src/SVTK/vtkPVAxesWidget.cxx b/src/SVTK/vtkPVAxesWidget.cxx
deleted file mode 100644 (file)
index b83b1de..0000000
+++ /dev/null
@@ -1,868 +0,0 @@
-/*=========================================================================
-
-   Program: ParaView
-   Module:    $RCSfile$
-
-   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
-   All rights reserved.
-
-   ParaView is a free software; you can redistribute it and/or modify it
-   under the terms of the ParaView license version 1.2. 
-
-   See License_v1.2.txt for the full ParaView license.
-   A copy of this license can be obtained by contacting
-   Kitware Inc.
-   28 Corporate Drive
-   Clifton Park, NY 12065
-   USA
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=========================================================================*/
-#include "vtkPVAxesWidget.h"
-
-#include "vtkActor2D.h"
-#include "vtkCallbackCommand.h"
-#include "vtkCamera.h"
-#include "vtkCoordinate.h"
-#include "vtkObjectFactory.h"
-#include "vtkPoints.h"
-#include "vtkPolyData.h"
-#include "vtkPolyDataMapper2D.h"
-#include "vtkProperty.h"
-#include "vtkProperty2D.h"
-#include "vtkPVAxesActor.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-
-vtkStandardNewMacro(vtkPVAxesWidget);
-
-vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor);
-vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer);
-
-//----------------------------------------------------------------------------
-class vtkPVAxesWidgetObserver : public vtkCommand
-{
-public:
-  static vtkPVAxesWidgetObserver *New()
-    {return new vtkPVAxesWidgetObserver;};
-  
-  vtkPVAxesWidgetObserver()
-    {
-      this->AxesWidget = 0;
-    }
-  
-  virtual void Execute(vtkObject* wdg, unsigned long event, void *calldata)
-    {
-      if (this->AxesWidget)
-        {
-        this->AxesWidget->ExecuteEvent(wdg, event, calldata);
-        }
-    }
-  
-  vtkPVAxesWidget *AxesWidget;
-};
-
-//----------------------------------------------------------------------------
-vtkPVAxesWidget::vtkPVAxesWidget()
-{
-  this->StartEventObserverId = 0;
-
-  this->EventCallbackCommand->SetCallback(vtkPVAxesWidget::ProcessEvents);
-  
-  this->Observer = vtkPVAxesWidgetObserver::New();
-  this->Observer->AxesWidget = this;
-  this->Renderer = vtkRenderer::New();
-  this->Renderer->SetViewport(0.0, 0.0, 0.2, 0.2);
-  this->Renderer->SetLayer(1);
-  this->Renderer->InteractiveOff();
-  this->Priority = 0.55;
-  this->AxesActor = vtkPVAxesActor::New();
-  this->Renderer->AddActor(this->AxesActor);
-  this->AxesActor->AddToRender(this->Renderer); // tmp
-  
-  this->ParentRenderer = NULL;
-  
-  this->Moving = 0;
-  this->MouseCursorState = vtkPVAxesWidget::Outside;
-
-  this->StartTag = 0;
-  
-  this->Interactive = 1;
-  
-  this->Outline = vtkPolyData::New();
-  this->Outline->Allocate();
-  vtkPoints *points = vtkPoints::New();
-  vtkIdType ptIds[5];
-  ptIds[4] = ptIds[0] = points->InsertNextPoint(1, 1, 0);
-  ptIds[1] = points->InsertNextPoint(2, 1, 0);
-  ptIds[2] = points->InsertNextPoint(2, 2, 0);
-  ptIds[3] = points->InsertNextPoint(1, 2, 0);
-  this->Outline->SetPoints(points);
-  this->Outline->InsertNextCell(VTK_POLY_LINE, 5, ptIds);
-  vtkCoordinate *tcoord = vtkCoordinate::New();
-  tcoord->SetCoordinateSystemToDisplay();
-  vtkPolyDataMapper2D *mapper = vtkPolyDataMapper2D::New();
-  mapper->SetInputData(this->Outline);
-  mapper->SetTransformCoordinate(tcoord);
-  this->OutlineActor = vtkActor2D::New();
-  this->OutlineActor->SetMapper(mapper);
-  this->OutlineActor->SetPosition(0, 0);
-  this->OutlineActor->SetPosition2(1, 1);
-  
-  points->Delete();
-  mapper->Delete();
-  tcoord->Delete();
-}
-
-//----------------------------------------------------------------------------
-vtkPVAxesWidget::~vtkPVAxesWidget()
-{
-  this->Observer->Delete();
-  this->AxesActor->Delete();
-  this->OutlineActor->Delete();
-  this->Outline->Delete();
-  this->SetParentRenderer(NULL);
-  this->Renderer->Delete();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::SetEnabled(int enabling)
-{
-  if (!this->Interactor)
-    {
-    vtkErrorMacro("The interactor must be set prior to enabling/disabling widget");
-    }
-  
-  if (enabling)
-    {
-    if (this->Enabled)
-      {
-      return;
-      }
-    if (!this->ParentRenderer)
-      {
-      vtkErrorMacro("The parent renderer must be set prior to enabling this widget");
-      return;
-      }
-
-    this->Enabled = 1;
-    
-    if ( this->EventCallbackCommand )
-      {
-      vtkRenderWindowInteractor *i = this->Interactor;
-      i->AddObserver(vtkCommand::MouseMoveEvent,
-        this->EventCallbackCommand, this->Priority);
-      i->AddObserver(vtkCommand::LeftButtonPressEvent,
-        this->EventCallbackCommand, this->Priority);
-      i->AddObserver(vtkCommand::LeftButtonReleaseEvent,
-        this->EventCallbackCommand, this->Priority);
-      }
-    
-    this->ParentRenderer->GetRenderWindow()->AddRenderer(this->Renderer);
-    if (this->ParentRenderer->GetRenderWindow()->GetNumberOfLayers() < 2)
-      {
-      this->ParentRenderer->GetRenderWindow()->SetNumberOfLayers(2);
-      }
-    this->AxesActor->SetVisibility(1);
-    // We need to copy the camera before the compositing observer is called.
-    // Compositing temporarily changes the camera to display an image.
-    this->StartEventObserverId = 
-      this->ParentRenderer->AddObserver(vtkCommand::StartEvent,this->Observer,1);
-    this->InvokeEvent(vtkCommand::EnableEvent, NULL);
-    }
-  else
-    {
-    if (!this->Enabled)
-      {
-      return;
-      }
-    
-    this->Enabled = 0;
-    this->Interactor->RemoveObserver(this->EventCallbackCommand);
-    
-    this->AxesActor->SetVisibility(0);
-    if (this->ParentRenderer)
-      {
-      if (this->ParentRenderer->GetRenderWindow())
-        {
-        this->ParentRenderer->GetRenderWindow()->RemoveRenderer(this->Renderer);
-        this->AxesActor->ReleaseGraphicsResources(this->ParentRenderer->GetRenderWindow());
-        }
-      if (this->StartEventObserverId != 0)
-        {
-        this->ParentRenderer->RemoveObserver(this->StartEventObserverId);
-        }
-      }
-    
-    this->InvokeEvent(vtkCommand::DisableEvent, NULL);
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::ExecuteEvent(vtkObject *vtkNotUsed(o),
-                                   unsigned long vtkNotUsed(event),
-                                   void *vtkNotUsed(calldata))
-{
-  if (!this->ParentRenderer)
-    {
-    return;
-    }
-  
-  vtkCamera *cam = this->ParentRenderer->GetActiveCamera();
-  double pos[3], fp[3], viewup[3];
-  cam->GetPosition(pos);
-  cam->GetFocalPoint(fp);
-  cam->GetViewUp(viewup);
-  
-  cam = this->Renderer->GetActiveCamera();
-  cam->SetPosition(pos);
-  cam->SetFocalPoint(fp);
-  cam->SetViewUp(viewup);
-  this->Renderer->ResetCamera();
-  
-  this->SquareRenderer();
-}
-
-void vtkPVAxesWidget::UpdateCursorIcon()
-{
-  if (!this->Enabled)
-    {
-    this->SetMouseCursor(vtkPVAxesWidget::Outside);
-    return;
-    }
-  
-  if (this->Moving)
-    {
-    return;
-    }
-  
-  int *parentSize = this->ParentRenderer->GetSize();
-  
-  int x = this->Interactor->GetEventPosition()[0];
-  int y = this->Interactor->GetEventPosition()[1];
-  double xNorm = x / (double)parentSize[0];
-  double yNorm = y / (double)parentSize[1];
-  
-  double pos[4];
-  this->Renderer->GetViewport(pos);
-  
-  int pState = this->MouseCursorState;
-  
-  if (xNorm > pos[0] && xNorm < pos[2] && yNorm > pos[1] && yNorm < pos[3])
-    {
-    this->MouseCursorState = vtkPVAxesWidget::Inside;
-    }
-  else if (fabs(xNorm-pos[0]) < .02 && fabs(yNorm-pos[3]) < .02)
-    {
-    this->MouseCursorState = vtkPVAxesWidget::TopLeft;
-    }
-  else if (fabs(xNorm-pos[2]) < .02 && fabs(yNorm-pos[3]) < .02)
-    {
-    this->MouseCursorState = vtkPVAxesWidget::TopRight;
-    }
-  else if (fabs(xNorm-pos[0]) < .02 && fabs(yNorm-pos[1]) < .02)
-    {
-    this->MouseCursorState = vtkPVAxesWidget::BottomLeft;
-    }
-  else if (fabs(xNorm-pos[2]) < .02 && fabs(yNorm-pos[1]) < .02)
-    {
-    this->MouseCursorState = vtkPVAxesWidget::BottomRight;
-    }
-  else
-    {
-    this->MouseCursorState = vtkPVAxesWidget::Outside;
-    }
-
-  if (pState == this->MouseCursorState)
-    {
-    return;
-    }
-  
-  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
-    {
-    this->Renderer->RemoveActor(this->OutlineActor);
-    }
-  else
-    {
-    this->Renderer->AddActor(this->OutlineActor);
-    }
-  this->Interactor->Render();
-  
-  this->SetMouseCursor(this->MouseCursorState);
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::SetMouseCursor(int cursorState)
-{
-  switch (cursorState)
-    {
-    case vtkPVAxesWidget::Outside:
-      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_DEFAULT);
-      break;
-    case vtkPVAxesWidget::Inside:
-      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZEALL);
-      break;
-    case vtkPVAxesWidget::TopLeft:
-      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZENW);
-      break;
-    case vtkPVAxesWidget::TopRight:
-      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZENE);
-      break;
-    case vtkPVAxesWidget::BottomLeft:
-      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZESW);
-      break;
-    case vtkPVAxesWidget::BottomRight:
-      this->Interactor->GetRenderWindow()->SetCurrentCursor(VTK_CURSOR_SIZESE);
-      break;
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::ProcessEvents(vtkObject* vtkNotUsed(object),
-                                    unsigned long event,
-                                    void *clientdata,
-                                    void* vtkNotUsed(calldata))
-{
-  vtkPVAxesWidget *self =
-    reinterpret_cast<vtkPVAxesWidget*>(clientdata);
-
-  if (!self->GetInteractive())
-    {
-    return;
-    }
-  
-  switch (event)
-    {
-    case vtkCommand::LeftButtonPressEvent:
-      self->OnButtonPress();
-      break;
-    case vtkCommand::MouseMoveEvent:
-      self->OnMouseMove();
-      break;
-    case vtkCommand::LeftButtonReleaseEvent:
-      self->OnButtonRelease();
-      break;
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::OnButtonPress()
-{
-  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
-    {
-    return;
-    }
-  
-  this->SetMouseCursor(this->MouseCursorState);
-
-  this->StartPosition[0] = this->Interactor->GetEventPosition()[0];
-  this->StartPosition[1] = this->Interactor->GetEventPosition()[1];
-  
-  this->Moving = 1;
-  this->EventCallbackCommand->SetAbortFlag(1);
-  this->StartInteraction();
-  this->InvokeEvent(vtkCommand::StartInteractionEvent, NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::OnButtonRelease()
-{
-  if (this->MouseCursorState == vtkPVAxesWidget::Outside)
-    {
-    return;
-    }
-  
-  this->Moving = 0;
-  this->EndInteraction();
-  this->InvokeEvent(vtkCommand::EndInteractionEvent, NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::OnMouseMove()
-{
-  if (this->Moving)
-    {
-    switch (this->MouseCursorState)
-      {
-      case vtkPVAxesWidget::Inside:
-        this->MoveWidget();
-        break;
-      case vtkPVAxesWidget::TopLeft:
-        this->ResizeTopLeft();
-        break;
-      case vtkPVAxesWidget::TopRight:
-        this->ResizeTopRight();
-        break;
-      case vtkPVAxesWidget::BottomLeft:
-        this->ResizeBottomLeft();
-        break;
-      case vtkPVAxesWidget::BottomRight:
-        this->ResizeBottomRight();
-        break;
-      }
-    
-    this->UpdateCursorIcon();
-    this->EventCallbackCommand->SetAbortFlag(1);
-    this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
-    }
-  else
-    {
-    this->UpdateCursorIcon();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::MoveWidget()
-{
-  int x = this->Interactor->GetEventPosition()[0];
-  int y = this->Interactor->GetEventPosition()[1];
-  
-  int dx = x - this->StartPosition[0];
-  int dy = y - this->StartPosition[1];
-
-  this->StartPosition[0] = x;
-  this->StartPosition[1] = y;
-
-  int *size = this->ParentRenderer->GetSize();
-  double dxNorm = dx / (double)size[0];
-  double dyNorm = dy / (double)size[1];
-  
-  double *vp = this->Renderer->GetViewport();
-  
-  double newPos[4];
-  newPos[0] = vp[0] + dxNorm;
-  newPos[1] = vp[1] + dyNorm;
-  newPos[2] = vp[2] + dxNorm;
-  newPos[3] = vp[3] + dyNorm;
-
-  if (newPos[0] < 0)
-    {
-    this->StartPosition[0] = 0;
-    newPos[0] = 0;
-    newPos[2] = vp[2] - vp[0];
-    }
-  if (newPos[1] < 0)
-    {
-    this->StartPosition[1] = 0;
-    newPos[1] = 0;
-    newPos[3] = vp[3] - vp[1];
-    }
-  if (newPos[2] > 1)
-    {
-    this->StartPosition[0] = (int)(size[0] - size[0] * (vp[2]-vp[0]));
-    newPos[0] = 1 - (vp[2]-vp[0]);
-    newPos[2] = 1;
-    }
-  if (newPos[3] > 1)
-    {
-    this->StartPosition[1] = (int)(size[1] - size[1]*(vp[3]-vp[1]));
-    newPos[1] = 1 - (vp[3]-vp[1]);
-    newPos[3] = 1;
-    }
-
-  this->Renderer->SetViewport(newPos);
-  this->Interactor->Render();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::ResizeTopLeft()
-{
-  int x = this->Interactor->GetEventPosition()[0];
-  int y = this->Interactor->GetEventPosition()[1];
-  
-  int dx = x - this->StartPosition[0];
-  int dy = y - this->StartPosition[1];
-  
-  int *size = this->ParentRenderer->GetSize();
-  double dxNorm = dx / (double)size[0];
-  double dyNorm = dy / (double)size[1];
-  
-  int useX;
-  double change;
-  double absDx = fabs(dxNorm);
-  double absDy = fabs(dyNorm);
-  
-  if (absDx > absDy)
-    {
-    change = dxNorm;
-    useX = 1;
-    }
-  else
-    {
-    change = dyNorm;
-    useX = 0;
-    }
-  
-  double *vp = this->Renderer->GetViewport();
-  
-  this->StartPosition[0] = x;
-  this->StartPosition[1] = y;
-  
-  double newPos[4];
-  newPos[0] = useX ? vp[0] + change : vp[0] - change;
-  newPos[1] = vp[1];
-  newPos[2] = vp[2];
-  newPos[3] = useX ? vp[3] - change : vp[3] + change;
-  
-  if (newPos[0] < 0)
-    {
-    this->StartPosition[0] = 0;
-    newPos[0] = 0;
-    }
-  if (newPos[0] >= newPos[2]-0.01)
-    {
-    newPos[0] = newPos[2] - 0.01;
-    }
-  if (newPos[3] > 1)
-    {
-    this->StartPosition[1] = size[1];
-    newPos[3] = 1;
-    }
-  if (newPos[3] <= newPos[1]+0.01)
-    {
-    newPos[3] = newPos[1] + 0.01;
-    }
-  
-  this->Renderer->SetViewport(newPos);
-  this->Interactor->Render();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::ResizeTopRight()
-{
-  int x = this->Interactor->GetEventPosition()[0];
-  int y = this->Interactor->GetEventPosition()[1];
-  
-  int dx = x - this->StartPosition[0];
-  int dy = y - this->StartPosition[1];
-  
-  int *size = this->ParentRenderer->GetSize();
-  double dxNorm = dx / (double)size[0];
-  double dyNorm = dy / (double)size[1];
-
-  double change;
-  double absDx = fabs(dxNorm);
-  double absDy = fabs(dyNorm);
-  
-  if (absDx > absDy)
-    {
-    change = dxNorm;
-    }
-  else
-    {
-    change = dyNorm;
-    }
-  
-  double *vp = this->Renderer->GetViewport();
-  
-  this->StartPosition[0] = x;
-  this->StartPosition[1] = y;
-  
-  double newPos[4];
-  newPos[0] = vp[0];
-  newPos[1] = vp[1];
-  newPos[2] = vp[2] + change;
-  newPos[3] = vp[3] + change;
-  
-  if (newPos[2] > 1)
-    {
-    this->StartPosition[0] = size[0];
-    newPos[2] = 1;
-    }
-  if (newPos[2] <= newPos[0]+0.01)
-    {
-    newPos[2] = newPos[0] + 0.01;
-    }
-  if (newPos[3] > 1)
-    {
-    this->StartPosition[1] = size[1];
-    newPos[3] = 1;
-    }
-  if (newPos[3] <= newPos[1]+0.01)
-    {
-    newPos[3] = newPos[1] + 0.01;
-    }
-  
-  this->Renderer->SetViewport(newPos);
-  this->Interactor->Render();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::ResizeBottomLeft()
-{
-  int x = this->Interactor->GetEventPosition()[0];
-  int y = this->Interactor->GetEventPosition()[1];
-  
-  int dx = x - this->StartPosition[0];
-  int dy = y - this->StartPosition[1];
-  
-  int *size = this->ParentRenderer->GetSize();
-  double dxNorm = dx / (double)size[0];
-  double dyNorm = dy / (double)size[1];
-  double *vp = this->Renderer->GetViewport();
-  
-  double change;
-  double absDx = fabs(dxNorm);
-  double absDy = fabs(dyNorm);
-  
-  if (absDx > absDy)
-    {
-    change = dxNorm;
-    }
-  else
-    {
-    change = dyNorm;
-    }
-  
-  this->StartPosition[0] = x;
-  this->StartPosition[1] = y;
-  
-  double newPos[4];
-  newPos[0] = vp[0] + change;
-  newPos[1] = vp[1] + change;
-  newPos[2] = vp[2];
-  newPos[3] = vp[3];
-  
-  if (newPos[0] < 0)
-    {
-    this->StartPosition[0] = 0;
-    newPos[0] = 0;
-    }
-  if (newPos[0] >= newPos[2]-0.01)
-    {
-    newPos[0] = newPos[2] - 0.01;
-    }
-  if (newPos[1] < 0)
-    {
-    this->StartPosition[1] = 0;
-    newPos[1] = 0;
-    }
-  if (newPos[1] >= newPos[3]-0.01)
-    {
-    newPos[1] = newPos[3] - 0.01;
-    }
-  
-  this->Renderer->SetViewport(newPos);
-  this->Interactor->Render();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::ResizeBottomRight()
-{
-  int x = this->Interactor->GetEventPosition()[0];
-  int y = this->Interactor->GetEventPosition()[1];
-  
-  int dx = x - this->StartPosition[0];
-  int dy = y - this->StartPosition[1];
-  
-  int *size = this->ParentRenderer->GetSize();
-  double dxNorm = dx / (double)size[0];
-  double dyNorm = dy / (double)size[1];
-  
-  double *vp = this->Renderer->GetViewport();
-  
-  int useX;
-  double change;
-  double absDx = fabs(dxNorm);
-  double absDy = fabs(dyNorm);
-  
-  if (absDx > absDy)
-    {
-    change = dxNorm;
-    useX = 1;
-    }
-  else
-    {
-    change = dyNorm;
-    useX = 0;
-    }
-  
-  this->StartPosition[0] = x;
-  this->StartPosition[1] = y;
-  
-  double newPos[4];
-  newPos[0] = vp[0];
-  newPos[1] = useX ? vp[1] - change : vp[1] + change;
-  newPos[2] = useX ? vp[2] + change : vp[2] - change;
-  newPos[3] = vp[3];
-  
-  if (newPos[2] > 1)
-    {
-    this->StartPosition[0] = size[0];
-    newPos[2] = 1;
-    }
-  if (newPos[2] <= newPos[0]+0.01)
-    {
-    newPos[2] = newPos[0] + 0.01;
-    }
-  if (newPos[1] < 0)
-    {
-    this->StartPosition[1] = 0;
-    newPos[1] = 0;
-    }
-  if (newPos[1] >= newPos[3]-0.01)
-    {
-    newPos[1] = newPos[3]-0.01;
-    }
-  
-  this->Renderer->SetViewport(newPos);
-  this->Interactor->Render();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::SquareRenderer()
-{
-  int *size = this->Renderer->GetSize();
-  if (size[0] == 0 || size[1] == 0)
-    {
-    return;
-    }
-  
-  double vp[4];
-  this->Renderer->GetViewport(vp);
-  
-  double deltaX = vp[2] - vp[0];
-  double newDeltaX = size[1] * deltaX / (double)size[0];
-  double deltaY = vp[3] - vp[1];
-  double newDeltaY = size[0] * deltaY / (double)size[1];
-
-  if (newDeltaX > 1)
-    {
-    if (newDeltaY > 1)
-      {
-      if (size[0] > size[1])
-        {
-        newDeltaX = size[1] / (double)size[0];
-        newDeltaY = 1;
-        }
-      else
-        {
-        newDeltaX = 1;
-        newDeltaY = size[0] / (double)size[1];
-        }
-      vp[0] = vp[1] = 0;
-      vp[2] = newDeltaX;
-      vp[3] = newDeltaY;
-      }
-    else
-      {
-      vp[3] = vp[1] + newDeltaY;
-      if (vp[3] > 1)
-        {
-        vp[3] = 1;
-        vp[1] = vp[3] - newDeltaY;
-        }
-      }
-    }
-  else
-    {
-    vp[2] = vp[0] + newDeltaX;
-    if (vp[2] > 1)
-      {
-      vp[2] = 1;
-      vp[0] = vp[2] - newDeltaX;
-      }
-    }
-  
-  this->Renderer->SetViewport(vp);
-  
-  this->Renderer->NormalizedDisplayToDisplay(vp[0], vp[1]);
-  this->Renderer->NormalizedDisplayToDisplay(vp[2], vp[3]);
-  
-  vtkPoints *points = this->Outline->GetPoints();
-  points->SetPoint(0, vp[0]+1, vp[1]+1, 0);
-  points->SetPoint(1, vp[2]-1, vp[1]+1, 0);
-  points->SetPoint(2, vp[2]-1, vp[3]-1, 0);
-  points->SetPoint(3, vp[0]+1, vp[3]-1, 0);
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::SetInteractive(int state)
-{
-  if (this->Interactive != state)
-    {
-    this->Interactive = state;
-    }
-  
-  if (!state)
-    {
-    this->OnButtonRelease();
-    this->MouseCursorState = vtkPVAxesWidget::Outside;
-    this->Renderer->RemoveActor(this->OutlineActor);
-    if (this->Interactor)
-      {
-      this->SetMouseCursor(this->MouseCursorState);
-      // this->Interactor->Render();
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::SetOutlineColor(double r, double g, double b)
-{
-  this->OutlineActor->GetProperty()->SetColor(r, g, b);
-  if (this->Interactor)
-    {
-//    this->Interactor->Render();
-    }
-}
-
-//----------------------------------------------------------------------------
-double* vtkPVAxesWidget::GetOutlineColor()
-{
-  return this->OutlineActor->GetProperty()->GetColor();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::SetAxisLabelColor(double r, double g, double b)
-{
-  this->AxesActor->GetXAxisLabelProperty()->SetColor(r, g, b);
-  this->AxesActor->GetYAxisLabelProperty()->SetColor(r, g, b);
-  this->AxesActor->GetZAxisLabelProperty()->SetColor(r, g, b);
-}
-
-//----------------------------------------------------------------------------
-double* vtkPVAxesWidget::GetAxisLabelColor()
-{
-  return this->AxesActor->GetXAxisLabelProperty()->GetColor();
-}
-
-//----------------------------------------------------------------------------
-vtkRenderer* vtkPVAxesWidget::GetParentRenderer()
-{
-  return this->ParentRenderer;
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::SetViewport(double minX, double minY,
-                                  double maxX, double maxY)
-{
-  this->Renderer->SetViewport(minX, minY, maxX, maxY);
-}
-
-//----------------------------------------------------------------------------
-double* vtkPVAxesWidget::GetViewport()
-{
-  return this->Renderer->GetViewport();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVAxesWidget::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-  
-  os << indent << "AxesActor: " << this->AxesActor << endl;
-  os << indent << "Interactive: " << this->Interactive << endl;
-}
diff --git a/src/SVTK/vtkPVAxesWidget.h b/src/SVTK/vtkPVAxesWidget.h
deleted file mode 100644 (file)
index cc2bba8..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*=========================================================================
-
-   Program: ParaView
-   Module:    $RCSfile$
-
-   Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
-   All rights reserved.
-
-   ParaView is a free software; you can redistribute it and/or modify it
-   under the terms of the ParaView license version 1.2. 
-
-   See License_v1.2.txt for the full ParaView license.
-   A copy of this license can be obtained by contacting
-   Kitware Inc.
-   28 Corporate Drive
-   Clifton Park, NY 12065
-   USA
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=========================================================================*/
-// .NAME vtkPVAxesWidget - A widget to manipulate an axe
-//
-// .SECTION Description
-// This widget creates and manages its own vtkPVAxesActor.
-
-
-#ifndef __vtkPVAxesWidget_h
-#define __vtkPVAxesWidget_h
-
-#include "SVTK.h"
-#include "vtkInteractorObserver.h"
-
-class vtkActor2D;
-class vtkKWApplication;
-class vtkPolyData;
-class vtkPVAxesActor;
-class vtkPVAxesWidgetObserver;
-class vtkRenderer;
-
-class SVTK_EXPORT vtkPVAxesWidget : public vtkInteractorObserver
-{
-public:
-  static vtkPVAxesWidget* New();
-  vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Set/get the axes actor to be displayed in this 3D widget.
-  void SetAxesActor(vtkPVAxesActor *actor);
-  vtkGetObjectMacro(AxesActor, vtkPVAxesActor);
-
-  // Description:
-  // Enable the 3D widget.
-  virtual void SetEnabled(int);
-
-  //BTX
-  // Description:
-  // Set the renderer this 3D widget will be contained in.
-  void SetParentRenderer(vtkRenderer *ren);
-  vtkRenderer* GetParentRenderer();
-  //ETX
-  
-  // Description:
-  // Callback to keep the camera for the axes actor up to date with the
-  // camera in the parent renderer
-  void ExecuteEvent(vtkObject *o, unsigned long event, void *calldata);
-
-  // Description:
-  // Set/get whether to allow this 3D widget to be interactively moved/scaled.
-  void SetInteractive(int state);
-  vtkGetMacro(Interactive, int);
-  vtkBooleanMacro(Interactive, int);
-  
-  // Description:
-  // Set/get the color of the outline of this widget.  The outline is visible
-  // when (in interactive mode) the cursor is over this 3D widget.
-  void SetOutlineColor(double r, double g, double b);
-  double *GetOutlineColor();
-  
-  // Description:
-  // Set/get the color of the axis labels of this widget.
-  void SetAxisLabelColor(double r, double g, double b);
-  double *GetAxisLabelColor();
-  
-  // Description:
-  // Set/get the viewport to position/size this 3D widget.
-  void SetViewport(double minX, double minY, double maxX, double maxY);
-  double* GetViewport();
-  
-protected:
-  vtkPVAxesWidget();
-  ~vtkPVAxesWidget();
-  
-  vtkRenderer *Renderer;
-  vtkRenderer *ParentRenderer;
-  
-  vtkPVAxesActor *AxesActor;
-  vtkPolyData *Outline;
-  vtkActor2D *OutlineActor;
-  
-  static void ProcessEvents(vtkObject *object, unsigned long event,
-                            void *clientdata, void *calldata);
-
-  vtkPVAxesWidgetObserver *Observer;
-  int StartTag;
-  
-  int MouseCursorState;
-  int Moving;
-  int StartPosition[2];
-
-  int Interactive;
-  
-  void UpdateCursorIcon();
-  void SetMouseCursor(int cursorState);
-  
-//BTX
-  int State;
-  
-  enum AxesWidgetState
-  {
-    Outside = 0,
-    Inside,
-    TopLeft,
-    TopRight,
-    BottomLeft,
-    BottomRight
-  };
-//ETX
-  
-  void OnButtonPress();
-  void OnMouseMove();
-  void OnButtonRelease();
-
-  void MoveWidget();
-  void ResizeTopLeft();
-  void ResizeTopRight();
-  void ResizeBottomLeft();
-  void ResizeBottomRight();
-  
-  void SquareRenderer();
-
-  unsigned long StartEventObserverId;  
-private:
-  vtkPVAxesWidget(const vtkPVAxesWidget&);  // Not implemented
-  void operator=(const vtkPVAxesWidget&);  // Not implemented
-};
-
-#endif
index c9e8d72e1cedf94cf07ab3505ed4fc463b1c8138..8c68a1e710939c573a60a161c9ffd9d790f11c6b 100644 (file)
@@ -404,7 +404,7 @@ void SalomeApp_Application::onExit()
   if ( result ) {
     if ( !killServers ) myIsCloseFromExit = true;
     SUIT_Session::session()->closeSession( SUIT_Session::ASK, killServers );
-    myIsCloseFromExit = false;
+    if ( SUIT_Session::session()->applications().count() > 0 ) myIsCloseFromExit = false;
   }
 }
 
@@ -691,8 +691,15 @@ void SalomeApp_Application::onSelectionChanged()
    bool canCopy  = false;
    bool canPaste = false;
 
+   LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+
+   if ( m ) {
+     canCopy  = m->canCopy();
+     canPaste = m->canPaste();
+   }
+
    SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
-   if (study != NULL) {
+   if (study) {
      _PTR(Study) stdDS = study->studyDS();
 
      if (stdDS) {
@@ -702,8 +709,8 @@ void SalomeApp_Application::onSelectionChanged()
          _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
 
          if ( so ) {
-             canCopy = studyMgr()->CanCopy(so);
-             canPaste = studyMgr()->CanPaste(so);
+           canCopy  = canCopy  || studyMgr()->CanCopy(so);
+           canPaste = canPaste || studyMgr()->CanPaste(so);
          }
        }
      }
@@ -1112,7 +1119,7 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
 #ifndef DISABLE_PYCONSOLE
   else if ( flag == WT_PyConsole )
   {
-    PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(), new SalomeApp_PyInterp() );
+    PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(), getPyInterp() );
     pyCons->setObjectName( "pythonConsole" );
     pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
     pyCons->setFont(resourceMgr()->fontValue( "PyConsole", "font" ));
@@ -2124,3 +2131,13 @@ bool SalomeApp_Application::checkExistingDoc()
   }
   return result;
 }
+
+
+#ifndef DISABLE_PYCONSOLE
+
+PyConsole_Interp* SalomeApp_Application::createPyInterp()
+{
+  return new SalomeApp_PyInterp();
+}
+
+#endif // DISABLE_PYCONSOLE
index b9833a1dcdb797d96bd2f549adbfcf19db157cb6..aeee6dcb2be248afca72485c37eba98dc00aefad 100644 (file)
@@ -168,6 +168,7 @@ protected:
 
 #ifndef DISABLE_PYCONSOLE
   bool                                updateStudy();
+  virtual PyConsole_Interp*           createPyInterp();
 #endif
 
   virtual void                        afterCloseDoc();
index 468473a47773e2c0cff1b4e33b5103088cdd0424..0125dbc216bc815a2fe135c50054724bb8452282 100644 (file)
 #include <QObject>
 #include <QVariant>
 
+//VSR: uncomment below macro to support unicode text properly in SALOME
+//     current commented out due to regressions
+//#define PAL22528_UNICODE
+
+namespace
+{
+  QString fromUtf8( const char* txt )
+  {
+#ifdef PAL22528_UNICODE
+    return QString::fromUtf8( txt );
+#else
+    return QString( txt );
+#endif
+  }
+
+  QString fromUtf8( const std::string& txt )
+  {
+    return fromUtf8( txt.c_str() );
+  }
+}
+
 /*!
   \class SalomeApp_DataObject
   \brief Implementation of the data object for use in CORBA-based
@@ -82,12 +103,12 @@ QString SalomeApp_DataObject::name() const
 {
   QString str;
   if ( myObject )
-    str = QString::fromUtf8( myObject->GetName().c_str() );
+    str = fromUtf8( myObject->GetName() );
   
   if ( str.isEmpty() ) {
     _PTR(SObject) refObj = referencedObject();
     if ( refObj )
-      str = QString::fromUtf8( refObj->GetName().c_str() );
+      str = fromUtf8( refObj->GetName() );
   }
   
   if ( isReference() ) {
@@ -164,7 +185,7 @@ QPixmap SalomeApp_DataObject::icon( const int id ) const
       _PTR(AttributePixMap) aPixAttr ( anAttr );
       if ( aPixAttr->HasPixMap() ) {
         QString componentType = componentDataType();
-        QString pixmapID      = QString::fromUtf8(aPixAttr->GetPixMap().c_str());
+        QString pixmapID      = fromUtf8( aPixAttr->GetPixMap() );
         // select a plugin within a component
         QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts );
         if ( plugin_pixmap.size() == 2 ) {
@@ -517,7 +538,7 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const
   {
     _PTR(AttributeString) strAttr = attr;
     std::string str = strAttr->Value();
-    QString aStrings = QString::fromUtf8( str.c_str() );
+    QString aStrings = fromUtf8( str );
     
     //Special case to show NoteBook variables in the "Value" column of the OB 
     if ( LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() ) )
index 5274494994295f72def591034ff1e459f65d9fd3..9611f2ff4be00e1214ca8f0623d40a91fb83539c 100644 (file)
@@ -23,7 +23,6 @@
 
 #ifndef DISABLE_PYCONSOLE
   #include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
-  #include <PyConsole_Console.h>
 #endif
 
 #include "SalomeApp_DoubleSpinBox.h"
@@ -438,8 +437,7 @@ SalomeApp_DoubleSpinBox::SearchState SalomeApp_DoubleSpinBox::findVariable( cons
           if( studyDS->IsString( aName ) )
             {
 #ifndef DISABLE_PYCONSOLE
-              PyConsole_Console* pyConsole = app->pythonConsole();
-              PyConsole_Interp* pyInterp = pyConsole->getInterp();
+              PyConsole_Interp* pyInterp = app->getPyInterp();
               PyLockWrapper aLock; // Acquire GIL
               std::string command;
               command  = "import salome_notebook ; ";
index 2e8bcc78d90f607da37a2668af3fec4d428a157f..b5cc01765d6e117a9197071ce65a46f1c5d7a525 100644 (file)
@@ -23,7 +23,6 @@
 
 #ifndef DISABLE_PYCONSOLE
   #include <PyConsole_Interp.h> //this include must be first (see PyInterp_base.h)!
-  #include <PyConsole_Console.h>
 #endif
 
 #include "SalomeApp_IntSpinBox.h"
@@ -386,8 +385,7 @@ SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable( const QStr
           if( studyDS->IsString( aName ) )
             {
 #ifndef DISABLE_PYCONSOLE
-              PyConsole_Console* pyConsole = app->pythonConsole();
-              PyConsole_Interp* pyInterp = pyConsole->getInterp();
+              PyConsole_Interp* pyInterp = app->getPyInterp();
               PyLockWrapper aLock; // Acquire GIL
               std::string command;
               command  = "import salome_notebook ; ";
index b5ecb767ad43ae4563cf3331481cb11da9def5fb..242aae2ca3d2b39c1df8b3fd09868ea00e93b873 100644 (file)
@@ -285,7 +285,7 @@ bool NoteBook_TableRow::IsValidStringValue(const QString theValue)
 
   SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
   PyConsole_Console* pyConsole = app->pythonConsole();
-  PyConsole_Interp* pyInterp = pyConsole->getInterp();
+  PyConsole_Interp* pyInterp = app->getPyInterp();
   PyLockWrapper aLock; // Acquire GIL
   std::string command = "import salome_notebook ; ";
   command += "salome_notebook.checkThisNoteBook(";
@@ -459,7 +459,7 @@ bool NoteBook_Table::IsValid() const
 
   SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
   PyConsole_Console* pyConsole = app->pythonConsole();
-  PyConsole_Interp* pyInterp = pyConsole->getInterp();
+  PyConsole_Interp* pyInterp = app->getPyInterp();
   PyLockWrapper aLock; // Acquire GIL
   std::string command = "import salome_notebook ; ";
   command += "salome_notebook.checkThisNoteBook(";
index bf7bd8d500083006dbfdc8dc30d882969143f511..a0b6a3ec2b8dce607e4ad71390e159dfcbdf9f77 100755 (executable)
@@ -31,8 +31,9 @@
 
 class SalomeApp_PyInterp : public PyConsole_EnhInterp
 {
+  friend class SalomeApp_Application;
+
 public:
-  SalomeApp_PyInterp();
   virtual ~SalomeApp_PyInterp();
 
   virtual void initPython();
@@ -40,6 +41,7 @@ public:
   virtual void closeContext();
 
 protected:
+  SalomeApp_PyInterp();
   virtual int  beforeRun();
 
 private:
index cf1d7d624fc3c5388587653741a6813be3ba2a65..f081af349a2ae8fb8a2d3d5fddbdc2f64ab19734 100644 (file)
@@ -49,7 +49,6 @@
 
 #ifndef DISABLE_PYCONSOLE
   #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
-  #include <PyConsole_Console.h>
 #endif
 
 #include "utilities.h"
@@ -738,8 +737,7 @@ void SalomeApp_Study::closeDocument(bool permanently)
       desk->blockSignals( isBlocked );
 #ifndef DISABLE_PYCONSOLE
       SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( application() );
-      if( app->pythonConsole() )
-        app->pythonConsole()->getInterp()->destroy();
+      app->getPyInterp()->destroy();
 #endif
     }
     SALOMEDSClient_Study* aStudy = 0;
index 7aa34a06be1f24d515ce6e7f7027c49f540fcf55..135e0bd99f1afc5e459c4b1ebabe8f576c00386e 100755 (executable)
@@ -14,12 +14,16 @@ Un fichier Python ne doit être composé que de lettres, chiffres et tirets bas
     </message>
     <message>
         <source>ERR_ACTIVEDOC_LOAD</source>
-        <translation type="unfinished">A study is already active in your session, but you are not connected to it. Use the Connect button to load it in the interface.</translation>
+        <translation>Une étude est déjà chargée dans votre session mais vous n&apos;y êtes pas connectée. Utilisez le bouton &quot;Connecter&quot; pour charger l&apos;étude dans l&apos;interface.</translation>
     </message>
     <message>
         <source>WRN_STUDY_LOCKED</source>
         <translation>L&apos;étude est verrouillée</translation>
     </message>
+    <message>
+        <source>WRN_NO_STUDY_ON SERV</source>
+        <translation>Pas d&apos;étude active dans cette session.</translation>
+    </message>
     <message>
         <source>CLOSE_LOCKED_STUDY</source>
         <translation>Fermer l&apos;étude verrouillée ?</translation>
@@ -98,29 +102,37 @@ Lancez une nouvelle session ou fermez l&apos;étude en cours.</translation>
         <translation>Impossible d&apos;ouvrir l&apos;étude car il y en a déjà une d&apos;active.
 Lancez une nouvelle session ou fermez l&apos;étude en cours.</translation>
     </message>
+    <message>
+        <source>OPEN_DOCUMENT_PROBLEM</source>
+        <translation>Problème inconnu à l&apos;ouverture du document</translation>
+    </message>
+    <message>
+        <source>CREATE_DOCUMENT_PROBLEM</source>
+        <translation>Problème inconnu à la création du document</translation>
+    </message>
     <message>
         <source>TOT_DESK_CONNECT_STUDY</source>
-        <translation type="unfinished">Connect study</translation>
+        <translation>Connecter l&apos;étude</translation>
     </message>
     <message>
         <source>TOT_DESK_DISCONNECT_STUDY</source>
-        <translation type="unfinished">Disconnect study</translation>
+        <translation>Déconnecter l&apos;étude</translation>
     </message>
     <message>
         <source>PRP_DESK_CONNECT</source>
-        <translation type="unfinished">Connect active study</translation>
+        <translation>Connecter l&apos;étude en cours</translation>
     </message>
     <message>
         <source>PRP_DESK_DISCONNECT</source>
-        <translation type="unfinished">Disconnect the current study</translation>
+        <translation>Déconnecter l&apos;étude en cours</translation>
     </message>
     <message>
         <source>MEN_DESK_CONNECT</source>
-        <translation type="unfinished">Conn&amp;ect</translation>
+        <translation>Conn&amp;ecter</translation>
     </message>
     <message>
         <source>MEN_DESK_DISCONNECT</source>
-        <translation type="unfinished">D&amp;isconnect</translation>
+        <translation>D&amp;éconnecter</translation>
     </message>
 </context>
 <context>
@@ -368,7 +380,7 @@ Voulez-vous le recharger ?</translation>
     </message>
     <message>
         <source>ACTIVATE_MODULE_OP_LOAD</source>
-        <translation type="unfinished">&amp;Connect</translation>
+        <translation>&amp;Connecter</translation>
     </message>
     <message>
         <source>ACTIVATE_MODULE_OP_SCRIPT</source>
@@ -400,19 +412,19 @@ Voulez-vous le recharger ?</translation>
     </message>
     <message>
         <source>DISCONNECT_CAPTION</source>
-        <translation type="unfinished">Disconnect active study</translation>
+        <translation>Déconnecter l&apos;étude en cours</translation>
     </message>
     <message>
         <source>DISCONNECT_DESCRIPTION</source>
-        <translation type="unfinished">Do you want to save study before disconnect?</translation>
+        <translation>Voulez-vous sauver l&apos;étude avant la déconnexion ?</translation>
     </message>
     <message>
         <source>DISCONNECT_SAVE</source>
-        <translation type="unfinished">&amp;Save &amp;&amp; Disconnect</translation>
+        <translation>&amp;Sauver &amp;&amp; Déconnecter</translation>
     </message>
     <message>
         <source>DISCONNECT_WO_SAVE</source>
-        <translation type="unfinished">&amp;Disconnect w/o saving</translation>
+        <translation>&amp;Déconnecter sans sauver</translation>
     </message>
 </context>
 <context>
index 3c4804f36b1383a7aa3b8f108d2478473560e038..ace68131e9f1ba8d7ebe684c625896e2cd9c634f 100644 (file)
       <translation>すべてのファイル (*. *)</translation>
     </message>
     <message>
-        <source>APPCLOSE_UNLOAD</source>
-        <translation type="unfinished">&amp;Disconnect w/o saving</translation>
+      <source>APPCLOSE_UNLOAD</source>
+      <translation>アンロード(&amp;U)</translation>
     </message>
     <message>
-        <source>APPCLOSE_UNLOAD_SAVE</source>
-        <translation type="unfinished">S&amp;ave &amp;&amp; Disconnect</translation>
+      <source>APPCLOSE_UNLOAD_SAVE</source>
+      <translation type="unfinished">S&amp;ave &amp;&amp; Disconnect</translation>
     </message>
     <message>
       <source>MEN_WINDOWS_NEW</source>
     </message>
     <message>
       <source>ACTIVATE_MODULE_OP_LOAD</source>
-      <translation type="unfinished">&amp;Connect</translation>
+      <translation>読込み(&amp;L)</translation>
     </message>
     <message>
       <source>ACTIVATE_MODULE_OP_SCRIPT</source>
index 3de2711f132fc6dafbcc4a588d52f31457de9589..9dfe19d9b808c7f45323cd37eb4eb1fae7ec463b 100644 (file)
 #define TEXT_MARGIN    4
 #define OFFSET_SPACING 2
 
+//VSR: uncomment below macro to support unicode text properly in SALOME
+//     current commented out due to regressions
+//#define PAL22528_UNICODE
+
+namespace
+{
+  QString fromUtf8( const char* txt )
+  {
+#ifdef PAL22528_UNICODE
+    return QString::fromUtf8( txt );
+#else
+    return QString( txt );
+#endif
+  }
+  const char* toUtf8( const QString& txt )
+  {
+#ifdef PAL22528_UNICODE
+    return txt.toUtf8().constData();
+#else
+    return txt.toLatin1().constData();
+#endif
+  }
+}
+
 //==================================================================
 vtkStandardNewMacro(VTKViewer_FramedTextActor);
 
@@ -268,7 +292,7 @@ void VTKViewer_FramedTextActor::SetText(const char* theText)
 {
   // remove whitespaces from from the start and the end
   // additionally, consider a case of multi-string text
-  QString aString(QString::fromUtf8(theText));
+  QString aString(fromUtf8(theText));
 
   QStringList aTrimmedStringList;
   QStringList aStringList = aString.split("\n");
@@ -276,7 +300,7 @@ void VTKViewer_FramedTextActor::SetText(const char* theText)
   while(anIter.hasNext())
     aTrimmedStringList.append(anIter.next().trimmed());
 
-  myTextActor->SetInput(aTrimmedStringList.join("\n").toUtf8().constData());
+  myTextActor->SetInput(toUtf8(aTrimmedStringList.join("\n")));
   Modified();
 }
 
index 19c3892c1ab23405a4a7e6ba86e4df6ec4fdd356..67916a8d54ef1d81cd0e0cba261d2c5896b267fc 100755 (executable)
@@ -128,17 +128,17 @@ ComputeVisiblePropBounds(vtkRenderer* theRenderer,
       static double MIN_DISTANCE = 1./VTK_LARGE_FLOAT;
       static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
 
-      if(abs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) {
+      if(fabs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) {
         aBounds[0]-=0.001;
         aBounds[1]+=0.001;
       }
 
-      if(abs(aBounds[3] - aBounds[2]) < MIN_DISTANCE) {
+      if(fabs(aBounds[3] - aBounds[2]) < MIN_DISTANCE) {
         aBounds[2]-=0.001;
         aBounds[3]+=0.001;
       }
 
-      if(abs(aBounds[5] - aBounds[4]) < MIN_DISTANCE) {
+      if(fabs(aBounds[5] - aBounds[4]) < MIN_DISTANCE) {
         aBounds[4]-=0.001;
         aBounds[5]+=0.001;
       }