]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merging GUI_SRC module with the BR_HDF_dev_merged branch, which has been merged with...
authornds <nds@opencascade.com>
Tue, 7 Oct 2008 08:26:33 +0000 (08:26 +0000)
committernds <nds@opencascade.com>
Tue, 7 Oct 2008 08:26:33 +0000 (08:26 +0000)
59 files changed:
src/STD/STD_TabDesktop.cxx
src/STD/STD_TabDesktop.h
src/STD/resources/cascade.png [new file with mode: 0644]
src/STD/resources/close.png
src/STD/resources/copy.png
src/STD/resources/cut.png
src/STD/resources/delete.png [new file with mode: 0644]
src/STD/resources/help.png
src/STD/resources/htile.png [new file with mode: 0644]
src/STD/resources/new.png
src/STD/resources/open.png
src/STD/resources/paste.png
src/STD/resources/print.png
src/STD/resources/redo.png
src/STD/resources/reset.png
src/STD/resources/save.png
src/STD/resources/undo.png
src/STD/resources/vtile.png [new file with mode: 0644]
src/SUITApp/SUITApp.cxx
src/SUITApp/SUITApp.pro
src/SUITApp/SUITApp_Application.cxx
src/SUITApp/SUITApp_Application.h
src/SVTK/SALOME_Actor.cxx
src/SVTK/SALOME_Actor.h
src/SVTK/SVTK_CubeAxesDlg.cxx
src/SVTK/SVTK_CubeAxesDlg.h
src/SVTK/SVTK_GenericRenderWindowInteractor.cxx
src/SVTK/SVTK_GenericRenderWindowInteractor.h
src/SVTK/SVTK_InteractorStyle.h
src/SVTK/resources/vtk_view_graduated_axes.png [new file with mode: 0755]
src/SVTK/resources/vtk_view_rotation_point.png [new file with mode: 0755]
src/SVTK/resources/vtk_view_scaling.png [new file with mode: 0644]
src/SVTK/resources/vtk_view_update_rate.png [new file with mode: 0755]
src/Style/images/critical.png [new file with mode: 0644]
src/Style/images/information.png [new file with mode: 0644]
src/Style/images/question.png [new file with mode: 0644]
src/Style/images/warning.png [new file with mode: 0644]
src/VTKViewer/VTKViewer_ConvexTool.cxx
src/VTKViewer/VTKViewer_ConvexTool.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_Trihedron.cxx
src/VTKViewer/VTKViewer_ViewManager.cxx
src/VTKViewer/VTKViewer_ViewManager.h
src/VTKViewer/VTKViewer_ViewWindow.cxx
src/VTKViewer/resources/vtk_view_back.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_bottom.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_camera_dump.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_fitall.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_fitarea.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_front.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_glpan.png [new file with mode: 0644]
src/VTKViewer/resources/vtk_view_left.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_pan.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_reset.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_right.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_rotate.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_top.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_triedre.png [new file with mode: 0755]
src/VTKViewer/resources/vtk_view_zoom.png [new file with mode: 0755]

index 8b6c41b0836c0846e60d74e38deab8564033d8b4..ab9d92e4058145a3db4440f0a4a47fbb51cac5df 100644 (file)
 #include <SUIT_ViewWindow.h>
 #include <SUIT_ResourceMgr.h>
 
-#include <QtxAction.h>
 #include <QtxWorkstack.h>
 #include <QtxActionMenuMgr.h>
-//#include <QtxWorkstackAction.h>
+#include <QtxWorkstackAction.h>
 
-#include <QtGui/qframe.h>
-#include <QtGui/qlayout.h>
+#include <QFrame>
+#include <QVBoxLayout>
 
 #include <stdarg.h>
 
 /*!Constructor.Create new instances of QVBox and QtxWorkstack.*/
 STD_TabDesktop::STD_TabDesktop()
 : SUIT_Desktop(),
-myWorkstack( 0 )//,
-//myWorkstackAction( 0 )
+myWorkstack( 0 ),
+myWorkstackAction( 0 )
 {
   QFrame* base = new QFrame( this );
   base->setFrameStyle( QFrame::Panel | QFrame::Sunken );
@@ -57,18 +56,32 @@ myWorkstack( 0 )//,
   myWorkstack->setAccel( QtxWorkstack::SplitHorizontal, Qt::SHIFT + Qt::Key_H );
   myWorkstack->setAccel( QtxWorkstack::Close,           Qt::SHIFT + Qt::Key_C );
 
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  if ( resMgr ) {
+    myWorkstack->setIcon( QtxWorkstack::SplitVertical,   
+                         resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
+    myWorkstack->setIcon( QtxWorkstack::SplitHorizontal,
+                         resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
+    myWorkstack->setIcon( QtxWorkstack::Close,
+                         resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ));
+  }
+
   connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ),
            this, SLOT( onWindowActivated( QWidget* ) ) );
 
   createActions();
 }
 
-/*!Destructor.*/
+/*!
+  Destructor.
+*/
 STD_TabDesktop::~STD_TabDesktop()
 {
 }
 
-/*!\retval SUIT_ViewWindow - return const active window.*/
+/*!
+  \retval SUIT_ViewWindow - return const active window.
+*/
 SUIT_ViewWindow* STD_TabDesktop::activeWindow() const
 {
   SUIT_ViewWindow* wnd = 0;
@@ -80,7 +93,9 @@ SUIT_ViewWindow* STD_TabDesktop::activeWindow() const
   return wnd;
 }
 
-/*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
+/*!
+  \retval QPtrList<SUIT_ViewWindow> - return const active window list.
+*/
 QList<SUIT_ViewWindow*> STD_TabDesktop::windows() const
 {
   QList<SUIT_ViewWindow*> winList;
@@ -95,7 +110,9 @@ QList<SUIT_ViewWindow*> STD_TabDesktop::windows() const
   return winList;
 }
 
-/*! insert new widget into desktop.*/
+/*!
+  Insert new widget into desktop.
+*/
 void STD_TabDesktop::addWindow( QWidget* w )
 {
   if ( !w || !workstack() )
@@ -104,13 +121,17 @@ void STD_TabDesktop::addWindow( QWidget* w )
   workstack()->addWindow( w );
 }
 
-/*!Call method perform for operation \a type.*/
+/*!
+  Call method perform for operation \a type.
+*/
 void STD_TabDesktop::windowOperation( const int type )
 {
-//  myWorkstackAction->perform( operationFlag( type ) );
+  myWorkstackAction->perform( operationFlag( type ) );
 }
 
-/*!Sets window operations by \a first ... parameters.*/
+/*!
+  Sets window operations by \a first ... parameters.
+*/
 void STD_TabDesktop::setWindowOperations( const int first, ... )
 {
   va_list ints;
@@ -128,7 +149,9 @@ void STD_TabDesktop::setWindowOperations( const int first, ... )
        setWindowOperations( typeList );
 }
 
-/*!Sets window operations by variable \a opList - operation list.*/
+/*!
+  Sets window operations by variable \a opList - operation list.
+*/
 void STD_TabDesktop::setWindowOperations( const QList<int>& opList )
 {
   int flags = 0;
@@ -139,23 +162,28 @@ void STD_TabDesktop::setWindowOperations( const QList<int>& opList )
 //  myWorkstackAction->setItems( flags );
 }
 
-/*!\retval QtxWorkstack pointer - QT work stack.*/
+/*!
+  \retval QtxWorkstack pointer - Qt work stack.
+*/
 QtxWorkstack* STD_TabDesktop::workstack() const
 {
   return myWorkstack;
 }
 
-/*!Emit window activated.*/
+/*!
+  Emit window activated.
+*/
 void STD_TabDesktop::onWindowActivated( QWidget* w )
 {
   if ( w && w->inherits( "SUIT_ViewWindow" ) )
     emit windowActivated( (SUIT_ViewWindow*)w );
 }
 
-/*!Create actions for window.*/
+/*!
+  Create actions for window.
+*/
 void STD_TabDesktop::createActions()
 {
-/*
   if ( myWorkstackAction )
     return;
 
@@ -165,44 +193,46 @@ void STD_TabDesktop::createActions()
 
   myWorkstackAction = new QtxWorkstackAction( workstack(), this );
 
-  myWorkstackAction->setItems( QtxWorkstackAction::Split | QtxWorkstackAction::Windows );
+  myWorkstackAction->setMenuActions( QtxWorkstackAction::Split | QtxWorkstackAction::Windows );
 
   // Split Horizontal
-  myWorkstackAction->setIconSet( QtxWorkstackAction::HSplit,
-                                 resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
-  myWorkstackAction->setMenuText( QtxWorkstackAction::HSplit, tr( "MEN_DESK_WINDOW_HSPLIT" ) );
-  myWorkstackAction->setStatusTip( QtxWorkstackAction::HSplit, tr( "PRP_DESK_WINDOW_HSPLIT" ) );
+  myWorkstackAction->setIcon( QtxWorkstackAction::SplitHorizontal,
+                              resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
+  myWorkstackAction->setText( QtxWorkstackAction::SplitHorizontal, tr( "MEN_DESK_WINDOW_HSPLIT" ) );
+  myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitHorizontal, tr( "PRP_DESK_WINDOW_HSPLIT" ) );
+  myWorkstackAction->setAccel( QtxWorkstackAction::SplitHorizontal, Qt::SHIFT + Qt::Key_H );
 
   // Split Vertical
-  myWorkstackAction->setIconSet( QtxWorkstackAction::VSplit,
-                                 resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
-  myWorkstackAction->setMenuText( QtxWorkstackAction::VSplit, tr( "MEN_DESK_WINDOW_VSPLIT" ) );
-  myWorkstackAction->setStatusTip( QtxWorkstackAction::VSplit, tr( "PRP_DESK_WINDOW_VSPLIT" ) );
+  myWorkstackAction->setIcon( QtxWorkstackAction::SplitVertical,
+                              resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
+  myWorkstackAction->setText( QtxWorkstackAction::SplitVertical, tr( "MEN_DESK_WINDOW_VSPLIT" ) );
+  myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitVertical, tr( "PRP_DESK_WINDOW_VSPLIT" ) );
+  myWorkstackAction->setAccel( QtxWorkstackAction::SplitVertical,   Qt::SHIFT + Qt::Key_V );
 
   QtxActionMenuMgr* mMgr = menuMgr();
   if ( !mMgr )
     return;
 
-  int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100, MenuWindowId );
+  int winMenuId = mMgr->insert( tr( "MEN_DESK_WINDOW" ), -1, 100 );
   mMgr->insert( myWorkstackAction, winMenuId, -1 );
   mMgr->insert( QtxActionMenuMgr::separator(), winMenuId, -1 );
-*/
 }
 
-/*!Convert STD_TabDesktop enumerations to QtxWorkstackAction*/
+/*!
+  Convert STD_TabDesktop enumerations to QtxWorkstackAction
+*/
 int STD_TabDesktop::operationFlag( const int type ) const
 {
   int res = 0;
-/*
   switch ( type )
   {
-  case VSplit:
-    res = QtxWorkstackAction::VSplit;
+  case SplitVertical:
+    res = QtxWorkstackAction::SplitVertical;
     break;
-  case HSplit:
-    res = QtxWorkstackAction::HSplit;
+  case SplitHorizontal:
+    res = QtxWorkstackAction::SplitHorizontal;
     break;
   }
-*/
+
   return res;
 }
index 1d5c2ecb8a6e280d9b72840e004f45a3ef02e2c0..35d09cd29470cdfff129588dbf7fc26bf6beee21 100644 (file)
 
 #include <SUIT_Desktop.h>
 
-class QtxAction;
-class QPopupMenu;
-class QWorkspace;
 class QtxWorkstack;
-//class QtxWorkstackAction;
+class QtxWorkstackAction;
 
 #if defined WIN32
 #pragma warning( disable: 4251 )
@@ -38,8 +35,7 @@ class STD_EXPORT STD_TabDesktop: public SUIT_Desktop
   Q_OBJECT
 
 public:
-  enum { MenuWindowId = 6 };
-  enum { VSplit, HSplit };
+  enum { SplitVertical, SplitHorizontal };
 
 public:
   STD_TabDesktop();
@@ -67,7 +63,7 @@ private:
 
 private:
   QtxWorkstack*            myWorkstack;
-//  QtxWorkstackAction*      myWorkstackAction;
+  QtxWorkstackAction*      myWorkstackAction;
 };
 
 #if defined WIN32
diff --git a/src/STD/resources/cascade.png b/src/STD/resources/cascade.png
new file mode 100644 (file)
index 0000000..3111e55
Binary files /dev/null and b/src/STD/resources/cascade.png differ
index b7126e002d7aa7ab3a7c9a9265a9f283f1ecfa20..4364ce7fe7d8ef363f0560fb0b4042fee232e748 100755 (executable)
Binary files a/src/STD/resources/close.png and b/src/STD/resources/close.png differ
index 1e43a09c2f80427d80e154e552661e4cf9596317..a26b641984355b66dcf8a638b34e4e3dcd8205d0 100755 (executable)
Binary files a/src/STD/resources/copy.png and b/src/STD/resources/copy.png differ
index b35200830ca593d5f55a151525f9f9125caa44f3..055c27ea6a73f494b87fbe64868df09e01024597 100755 (executable)
Binary files a/src/STD/resources/cut.png and b/src/STD/resources/cut.png differ
diff --git a/src/STD/resources/delete.png b/src/STD/resources/delete.png
new file mode 100644 (file)
index 0000000..93d1663
Binary files /dev/null and b/src/STD/resources/delete.png differ
index 452b45f62a547640e2a9de3ad3870bbdcf8c0a44..c8dd11c140d8a19e79d8f1e7d0e6a9f84e234262 100755 (executable)
Binary files a/src/STD/resources/help.png and b/src/STD/resources/help.png differ
diff --git a/src/STD/resources/htile.png b/src/STD/resources/htile.png
new file mode 100644 (file)
index 0000000..42af00c
Binary files /dev/null and b/src/STD/resources/htile.png differ
index 953757a62f594c7591c7cdcfe8e51cdde41bfa45..68555d2211d1f80a63dab34e873a943b4f128bc5 100755 (executable)
Binary files a/src/STD/resources/new.png and b/src/STD/resources/new.png differ
index d9953b6a7d36d4983f2cd609ef10976ac221215f..8ed143ebddf46107de32a68f5b95d4c0c90f26d6 100755 (executable)
Binary files a/src/STD/resources/open.png and b/src/STD/resources/open.png differ
index c7446259534a83a6e06232c80c732b459919cd15..b2b5c95ac6a45af84b1f6de1b259e5e4ca890134 100755 (executable)
Binary files a/src/STD/resources/paste.png and b/src/STD/resources/paste.png differ
index 37ca7c24d941032c079bb45cfd377d1d07c85882..69bae957d19a7c332608629612ddfcb786d364d0 100755 (executable)
Binary files a/src/STD/resources/print.png and b/src/STD/resources/print.png differ
index ac72e5c27cb02fdb6aebd6fdf3a8f08b4a4bb2fb..3753bb923cd9e03192cfe0d8cb013ae6813ddd51 100755 (executable)
Binary files a/src/STD/resources/redo.png and b/src/STD/resources/redo.png differ
index ccda81cb117fd14d8ba2279f5de2aa03b55e1b90..761af7368d1abbee4f38dfbcbedca5bbe3efabb1 100755 (executable)
Binary files a/src/STD/resources/reset.png and b/src/STD/resources/reset.png differ
index 330493fa2ae0c510e9ccd70d2f923b1220b9dde5..be10e0cf8817b7532548560cd558d72c0f0f8560 100755 (executable)
Binary files a/src/STD/resources/save.png and b/src/STD/resources/save.png differ
index 61b19777e4f9527d8961358b7dde84d4af2d16e6..9b60fbd5d01059c8cc35f2dfa10f27626a498577 100755 (executable)
Binary files a/src/STD/resources/undo.png and b/src/STD/resources/undo.png differ
diff --git a/src/STD/resources/vtile.png b/src/STD/resources/vtile.png
new file mode 100644 (file)
index 0000000..9ad8814
Binary files /dev/null and b/src/STD/resources/vtile.png differ
index 81bab394b1a4f9cc674f0256050dba06686e8076..bbac91a30c9a8aa515939f9946e9f2339687969c 100644 (file)
@@ -32,6 +32,7 @@
 #include <Style_Model.h>
 #include <QtxSplash.h>
 
+#include <SUIT_LicenseDlg.h>
 #ifdef SUIT_ENABLE_PYTHON
 #include <Python.h>
 #endif
 
 #include <stdlib.h>
 
+#ifdef WIN32
+#include <UserEnv.h>
+#endif
+
 static QString salomeVersion()
 {
   QString path( ::getenv( "GUI_ROOT_DIR" ) );
@@ -161,12 +166,13 @@ int main( int args, char* argv[] )
   PySys_SetArgv( args, argv );
 #endif
 
-  qInstallMsgHandler( MessageOutput );
+  //qInstallMsgHandler( MessageOutput );
 
   QStringList argList;
   bool noExceptHandling = false;
   bool iniFormat        = false;
   bool noSplash         = false;
+  bool useLicense       = false;
   for ( int i = 1; i < args /*&& !noExceptHandling*/; i++ )
   {
     if ( !strcmp( argv[i], "--noexcepthandling" ) )
@@ -175,23 +181,51 @@ int main( int args, char* argv[] )
       iniFormat = true;
     else if ( !strcmp( argv[i], "--nosplash") )
       noSplash = true;
-    else
+       else if ( !strcmp( argv[i], "--uselicense" ) )
+      useLicense = true;
+       else
       argList.append( QString( argv[i] ) );
   }
 
   SUITApp_Application app( args, argv );
 
   int result = -1;
+
+  if ( useLicense ) {
+    QString env;
+
+#ifdef WIN32
+    DWORD aLen=1024;
+    char aStr[1024];
+    HANDLE aToken=0;
+    HANDLE hProcess = GetCurrentProcess();
+    OpenProcessToken(hProcess,TOKEN_QUERY,&aToken);
+    if( GetUserProfileDirectory( aToken, aStr, &aLen ) )
+      env = aStr;
+
+#else
+    if ( ::getenv( "HOME" ) )
+      env = ::getenv( "HOME" );
+#endif
+    QFile file( env + "/ReadLicense.log" ); // Read the text from a file    
+    if( !file.exists() ) {
+      SUIT_LicenseDlg aLicense;
+      if ( aLicense.exec() != QDialog::Accepted ) 
+        return result;
+    }
+  }
+
   if ( !argList.isEmpty() )
   {
     SUITApp_Session* aSession = new SUITApp_Session( iniFormat );
     QtxSplash* splash = 0;
+    SUIT_ResourceMgr* resMgr = aSession->createResourceMgr( argList.first() );
     if ( !noSplash ) 
     {
-      SUIT_ResourceMgr* resMgr = aSession->createResourceMgr( argList.first() );
       if ( resMgr )
       {
-       resMgr->loadLanguage();
+       resMgr->loadLanguage( false );
 
        splash = QtxSplash::splash( QPixmap() );
        splash->readSettings( resMgr );
@@ -222,9 +256,12 @@ int main( int args, char* argv[] )
     SUIT_Application* theApp = aSession->startApplication( argList.first() );
     if ( theApp )
     {
-      Style_Salome* aStyle = new Style_Salome();
-      aStyle->getModel()->initFromResource( theApp->resourceMgr() );
-      app.setStyle( aStyle );
+      if ( resMgr && resMgr->booleanValue( "Style", "use_salome_style", true ) )
+      {
+       Style_Salome* aStyle = new Style_Salome();
+       aStyle->getModel()->initFromResource( theApp->resourceMgr() );
+       app.setStyle( aStyle );
+      }
        
       if ( !noExceptHandling )
         app.setHandler( aSession->handler() );
index e5edddab52ff1e310f6f5ba8958b2f640775394a..def2d40118f9245b8676ccca3d2f428f64da0086 100644 (file)
@@ -18,6 +18,7 @@ CONFIG -= debug release debug_and_release
 CONFIG += qt thread debug dll shared
 
 win32:DEFINES += WNT WIN32
+DEFINES += DISABLE_TESTRECORDER
 
 HEADERS = *.h
 
index 7027184df33f2feced785b812c1a2ea1001f5692..df551d580c06c658da7df8561c2c1a5cebe6f47d 100644 (file)
   Constructor
 */
 SUITApp_Application::SUITApp_Application( int& argc, char** argv, SUIT_ExceptionHandler* hand )
-: QApplication( argc, argv ),
+#ifndef DISABLE_TESTRECORDER
+  : TestApplication( argc, argv ),
+#else
+  : QApplication( argc, argv ),
+#endif
 myExceptHandler( hand )
 {
   QString path = SUIT_Tools::dir( argv[0] ) + QDir::separator() + "../../resources";
@@ -52,7 +56,11 @@ myExceptHandler( hand )
   Constructor
 */
 SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand )
-: QApplication( argc, argv, type ),
+#ifndef DISABLE_TESTRECORDER
+  : TestApplication( argc, argv ),
+#else
+  : QApplication( argc, argv, type ),
+#endif
 myExceptHandler( hand )
 {
     QTranslator* strTbl = new QTranslator( 0 );
@@ -69,7 +77,11 @@ myExceptHandler( hand )
 bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
 {
   return myExceptHandler ? myExceptHandler->handle( receiver, e ) :
+#ifndef DISABLE_TESTRECORDER
+                           TestApplication::notify( receiver, e );
+#else
                            QApplication::notify( receiver, e );
+#endif
 }
 
 /*!
index 808e464cc11f3223f123b27d5153f5fd9cdeb009..bb27322b53841d02b8ef99720aab51da0fdaed8d 100644 (file)
 #ifndef SUITAPP_APPLICATION_H
 #define SUITAPP_APPLICATION_H
 
-#include <QApplication>
+#ifndef DISABLE_TESTRECORDER
+  #include <TestApplication.h>
+#else
+  #include <QApplication>
+#endif
 
 class SUIT_ExceptionHandler;
 
-class SUITApp_Application : public QApplication
+#ifndef DISABLE_TESTRECORDER
+  class SUITApp_Application : public TestApplication
+#else
+  class SUITApp_Application : public QApplication
+#endif
 {
   Q_OBJECT
 
index 7f17c270832f1972b9e3632beac61b578c927768..678d9de95b4b15b2fd59ad88e34a42b4fa2f50f8 100644 (file)
@@ -509,7 +509,7 @@ SALOME_Actor
          if(myIsPreselected){
            const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
            int anExtent = aMapIndex.Extent();
-           anIsChanged |= (anExtent == 0);
+           anIsChanged |= (anExtent == 0 || anExtent == 1);
            anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2)));
            if(anIsChanged){
              TColStd_IndexedMapOfInteger aMapIndex;
index db4e2e56e440aa897fbc31799729bf0bb7f7e1e1..ffa0bdca7f4895d280aedf0add55a180342c28f8 100644 (file)
@@ -54,8 +54,12 @@ class SVTK_Actor;
 class SVTK_RectPicker;
 class SVTK_InteractorStyle;
 
-extern int SALOME_POINT_SIZE;
-extern int SALOME_LINE_WIDTH;
+SVTK_EXPORT extern int SALOME_POINT_SIZE;
+SVTK_EXPORT extern int SALOME_LINE_WIDTH;
+
+#ifdef WIN32
+#pragma warning ( disable:4251 )
+#endif
 
 #ifdef WIN32
 #pragma warning ( disable:4251 )
index 1258e98ed2b5f8e37a9b07f082d5d8a81117953e..92c3f28476b6e707ba701f9f1a428b18801c4f2f 100644 (file)
 #include <vtkTextProperty.h>
 
 /*!
- * Class       : AxisWg
- * Description : Tab of dialog
- */
+  \class SVTK_CubeAxesDlg::AxisWidget
+  \brief Axis tab widget of the "Graduated axis" dialog box
+  \internal
+*/
+
+class SVTK_CubeAxesDlg::AxisWidget : public QFrame
+{
+public:
+  AxisWidget( QWidget* );
+  ~AxisWidget();
+
+  void             UseName( const bool );
+  void             SetName( const QString& );
+  void             SetNameFont( const QColor&, const int, const bool, const bool, const bool );
+  bool             ReadData( vtkAxisActor2D* );
+  bool             Apply( vtkAxisActor2D* );
+
+private:
+  // name
+  QGroupBox*       myNameGrp;
+  QLineEdit*       myAxisName;
+  SVTK_FontWidget* myNameFont;
+
+  // labels
+  QGroupBox*       myLabelsGrp;
+  QtxIntSpinBox*   myLabelNumber;
+  QtxIntSpinBox*   myLabelOffset;
+  SVTK_FontWidget* myLabelsFont;
+
+  // tick marks
+  QGroupBox*       myTicksGrp;
+  QtxIntSpinBox*   myTickLength;
+
+  friend class SVTK_CubeAxesDlg;
+};
 
 /*!
   Constructor
 */
-SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
+SVTK_CubeAxesDlg::AxisWidget::AxisWidget (QWidget* theParent)
 :  QFrame(theParent)
 {
   QList< QLabel* > aLabels;
 
   // "Name" grp
 
-  myNameGrp = new QGroupBox(tr("AXIS_NAME"), this);
+  myNameGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("AXIS_NAME"), this);
+  myNameGrp->setCheckable( true );
+
   QVBoxLayout* aVBox = new QVBoxLayout;
   
-  myIsNameVisible = new QCheckBox(tr("IS_VISIBLE"), myNameGrp);
-  aVBox->addWidget(myIsNameVisible);
-
   QHBoxLayout* aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  QLabel* aLabel = new QLabel(tr("NAME"));
+  QLabel* aLabel = new QLabel(SVTK_CubeAxesDlg::tr("NAME"));
   aHBox->addWidget(aLabel);
   myAxisName = new QLineEdit;
   aHBox->addWidget(myAxisName);
@@ -79,7 +110,7 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
 
   aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("FONT"));
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("FONT"));
   aHBox->addWidget(aLabel);
   myNameFont = new SVTK_FontWidget(myNameGrp);
   aHBox->addWidget(myNameFont);
@@ -90,35 +121,32 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
 
   // "Labels" grp
 
-  myLabelsGrp = new QGroupBox(tr("LABELS"), this);
-  aVBox = new QVBoxLayout;
+  myLabelsGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("LABELS"), this);
+  myLabelsGrp->setCheckable( true );
 
-  myIsLabelsVisible = new QCheckBox(tr("IS_VISIBLE"), myLabelsGrp);
-  aVBox->addWidget(myIsLabelsVisible);
+  aVBox = new QVBoxLayout;
 
   aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("NUMBER"));
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("NUMBER"));
   aHBox->addWidget(aLabel);
   myLabelNumber = new QtxIntSpinBox(0,25,1,myLabelsGrp);
-  myLabelNumber->setObjectName("SpinBoxLabelNumber");
   aHBox->addWidget(myLabelNumber);
   aLabels.append(aLabel);
   aVBox->addLayout(aHBox);
 
   aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("OFFSET"));
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("OFFSET"));
   aHBox->addWidget(aLabel);
   myLabelOffset = new QtxIntSpinBox(0,100,1,myLabelsGrp);
-  myLabelOffset->setObjectName("SpinBoxLabellOffset");
   aHBox->addWidget(myLabelOffset);
   aLabels.append(aLabel);
   aVBox->addLayout(aHBox);
 
   aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("FONT"));
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("FONT"));
   aHBox->addWidget(aLabel);
   myLabelsFont = new SVTK_FontWidget(myLabelsGrp);
   aHBox->addWidget(myLabelsFont);
@@ -129,18 +157,16 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
 
   // "Tick marks" grp
 
-  myTicksGrp = new QGroupBox(tr("TICK_MARKS"), this);
-  aVBox = new QVBoxLayout;
+  myTicksGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("TICK_MARKS"), this);
+  myTicksGrp->setCheckable( true );
 
-  myIsTicksVisible = new QCheckBox(tr("IS_VISIBLE"), myTicksGrp);
-  aVBox->addWidget(myIsTicksVisible);
+  aVBox = new QVBoxLayout;
 
   aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
-  aLabel = new QLabel(tr("LENGTH"));
+  aLabel = new QLabel(SVTK_CubeAxesDlg::tr("LENGTH"));
   aHBox->addWidget(aLabel);
   myTickLength = new QtxIntSpinBox(0,100,1,myTicksGrp);
-  myTickLength->setObjectName("SpinBoxTickLength");
   aHBox->addWidget(myTickLength);
   aLabels.append(aLabel);
   aVBox->addLayout(aHBox);
@@ -150,17 +176,16 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
   // Layout
 
   QVBoxLayout* aLay = new QVBoxLayout(this);
-  aLay->setMargin(0);
+  aLay->setMargin(5);
   aLay->setSpacing(5);
   aLay->addWidget(myNameGrp);
   aLay->addWidget(myLabelsGrp);
   aLay->addWidget(myTicksGrp);
 
   // init
-  myIsNameVisible->setChecked(true);
-  myIsLabelsVisible->setChecked(true);
-  myIsTicksVisible->setChecked(true);
-  updateControlState();
+  myNameGrp->setChecked( true );
+  myLabelsGrp->setChecked( true );
+  myTicksGrp->setChecked( true );
 
   // Adjust label widths
   QList< QLabel* >::iterator anIter;
@@ -169,74 +194,35 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
     aMaxWidth = qMax(aMaxWidth, (*anIter)->sizeHint().width());
   for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
     (*anIter)->setFixedWidth(aMaxWidth);
-
-  // connect signals and slots
-  connect(myIsNameVisible, SIGNAL(stateChanged(int)), SLOT(onNameChecked()));
-  connect(myIsLabelsVisible, SIGNAL(stateChanged(int)), SLOT(onLabelsChecked()));
-  connect(myIsTicksVisible, SIGNAL(stateChanged(int)), SLOT(onTicksChecked()));
 }
 
 /*!
   Destructor
 */
-SVTK_AxisWidget::~SVTK_AxisWidget()
-{
-}
-
-void SVTK_AxisWidget::updateControlState()
+SVTK_CubeAxesDlg::AxisWidget::~AxisWidget()
 {
-  onNameChecked();
-  onLabelsChecked();
-  onTicksChecked();
 }
 
-void SVTK_AxisWidget::setEnabled(QGroupBox* theGrp, const bool theState)
+void SVTK_CubeAxesDlg::AxisWidget::UseName(const bool toUse)
 {
-  QObjectList aChildren(theGrp->children());
-  QObject* anObj;
-  for(int i = 0; i < aChildren.size(); i++)
-  {
-    anObj = aChildren.at(i);
-    if (anObj !=0 && anObj->inherits("QHBoxLayout"))
-      ((QHBoxLayout*)anObj)->setEnabled(theState);
-  }
-}
-
-void SVTK_AxisWidget::onLabelsChecked()
-{
-  setEnabled(myLabelsGrp, myIsLabelsVisible->isChecked());
-}
-
-void SVTK_AxisWidget::onTicksChecked()
-{
-  setEnabled(myTicksGrp, myIsTicksVisible->isChecked());
+  myNameGrp->setChecked(toUse);
 }
 
-void SVTK_AxisWidget::onNameChecked()
-{
-  setEnabled(myNameGrp, myIsNameVisible->isChecked());
-}
-
-void SVTK_AxisWidget::UseName(const bool toUse)
-{
-  myIsNameVisible->setChecked(toUse);
-}
-
-void SVTK_AxisWidget::SetName(const QString& theName)
+void SVTK_CubeAxesDlg::AxisWidget::SetName(const QString& theName)
 {
   myAxisName->setText(theName);
 }
 
-void SVTK_AxisWidget::SetNameFont(const QColor& theColor,
-                                  const int theFont,
-                                  const bool theIsBold,
-                                  const bool theIsItalic,
-                                  const bool theIsShadow)
+void SVTK_CubeAxesDlg::AxisWidget::SetNameFont(const QColor& theColor,
+                                              const int theFont,
+                                              const bool theIsBold,
+                                              const bool theIsItalic,
+                                              const bool theIsShadow)
 {
   myNameFont->SetData(theColor, theFont, theIsBold, theIsItalic, theIsShadow);
 }
 
-bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
+bool SVTK_CubeAxesDlg::AxisWidget::ReadData(vtkAxisActor2D* theActor)
 {
   if (theActor == 0)
     return false;
@@ -264,7 +250,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
     isTitleShadow = aTitleProp->GetShadow() ? true : false;
   }
 
-  myIsNameVisible->setChecked(useName);
+  myNameGrp->setChecked(useName);
   myAxisName->setText(aTitle);
   myNameFont->SetData(aTitleColor, aTitleFontFamily, isTitleBold, isTitleItalic, isTitleShadow);
 
@@ -292,7 +278,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
     isLabelsShadow = aLabelsProp->GetShadow() ? true : false;
   }
 
-  myIsLabelsVisible->setChecked(useLabels);
+  myLabelsGrp->setChecked(useLabels);
   myLabelNumber->setValue(nbLabels);
   myLabelOffset->setValue(anOffset);
   myLabelsFont->SetData(aLabelsColor, aLabelsFontFamily, isLabelsBold, isLabelsItalic, isLabelsShadow);
@@ -301,20 +287,20 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
   bool useTickMarks = theActor->GetTickVisibility();
   int aTickLength = theActor->GetTickLength();
 
-  myIsTicksVisible->setChecked(useTickMarks);
+  myTicksGrp->setChecked(useTickMarks);
   myTickLength->setValue(aTickLength);
 
   return true;
 }
 
-bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
+bool SVTK_CubeAxesDlg::AxisWidget::Apply(vtkAxisActor2D* theActor)
 {
    if (theActor == 0)
     return false;
 
   // Name
 
-  theActor->SetTitleVisibility(myIsNameVisible->isChecked() ? 1 : 0);
+  theActor->SetTitleVisibility(myNameGrp->isChecked() ? 1 : 0);
   theActor->SetTitle(myAxisName->text().toLatin1());
 
   QColor aTitleColor(255, 255, 255);
@@ -341,7 +327,7 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
 
   // Labels
 
-  theActor->SetLabelVisibility(myIsLabelsVisible->isChecked() ? 1 : 0);
+  theActor->SetLabelVisibility(myLabelsGrp->isChecked() ? 1 : 0);
 
   int nbLabels = myLabelNumber->value();
   theActor->SetNumberOfLabels(nbLabels);
@@ -374,7 +360,7 @@ bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
 
 
   // Tick marks
-  theActor->SetTickVisibility(myIsTicksVisible->isChecked());
+  theActor->SetTickVisibility(myTicksGrp->isChecked());
   int aTickLength = myTickLength->value();
   theActor->SetTickLength(aTickLength);
 
@@ -418,16 +404,14 @@ QWidget* SVTK_CubeAxesDlg::createMainFrame(QWidget* theParent)
 
   myTabWg = new QTabWidget(aFrame);
 
-  myAxes[ 0 ] = new SVTK_AxisWidget(myTabWg);
-  myAxes[ 1 ] = new SVTK_AxisWidget(myTabWg);
-  myAxes[ 2 ] = new SVTK_AxisWidget(myTabWg);
+  myAxes[ 0 ] = new AxisWidget(myTabWg);
+  myAxes[ 1 ] = new AxisWidget(myTabWg);
+  myAxes[ 2 ] = new AxisWidget(myTabWg);
 
   myTabWg->addTab(myAxes[ 0 ], tr("X_AXIS"));
   myTabWg->addTab(myAxes[ 1 ], tr("Y_AXIS"));
   myTabWg->addTab(myAxes[ 2 ], tr("Z_AXIS"));
 
-  myTabWg->setContentsMargins(5,5,5,5);
-
   myIsVisible = new QCheckBox(tr("IS_VISIBLE"), aFrame);
 
   QVBoxLayout* aLay = new QVBoxLayout(aFrame);
index f573f94b1fbb897e1829ef40d1c131f5247fe92c..d4f90568af2dc46488efb22ac2d5d9e064f2f338 100644 (file)
 #ifndef SVTK_CubeAxesDlg_H
 #define SVTK_CubeAxesDlg_H
 
-#include "SVTK.h"
 #include "SVTK_DialogBase.h"
 
-#include <QFrame>
-
 class QWidget;
 class QPushButton;
 class QTabWidget;
 class QCheckBox;
-class QLineEdit;
-class QGroupBox;
 
 class QtxAction;
-class QtxIntSpinBox;
-
-class vtkAxisActor2D;
 class SVTK_CubeAxesActor2D;
-
-class SVTK_FontWidget;
-class SVTK_AxisWidget;
 class SVTK_MainWindow;
 
 /*!
  * Class       : SVTK_CubeAxesDlg
  * Description : Dialog for specifynig cube axes properties
  */
-class SVTK_EXPORT SVTK_CubeAxesDlg : public SVTK_DialogBase
+class SVTK_CubeAxesDlg : public SVTK_DialogBase
 {
   Q_OBJECT
 
+  class AxisWidget;
+
 public:
                   SVTK_CubeAxesDlg(QtxAction* theAction,
                                   SVTK_MainWindow* theParent,
@@ -85,56 +76,7 @@ private:
   QPushButton*    myOkBtn;
   QPushButton*    myApplyBtn;
   QPushButton*    myCloseBtn;
-  SVTK_AxisWidget* myAxes[ 3 ];
-};
-
-/*!
- * Class       : SVTK_AxisWidget
- * Description : Tab of dialog
- */
-class SVTK_EXPORT SVTK_AxisWidget : public QFrame
-{
-  Q_OBJECT
-
-public:
-                  SVTK_AxisWidget( QWidget* );
-                  ~SVTK_AxisWidget();
-
-  void            UseName( const bool );
-  void            SetName( const QString& );
-  void            SetNameFont( const QColor&, const int, const bool, const bool, const bool );
-  bool            ReadData( vtkAxisActor2D* );
-  bool            Apply( vtkAxisActor2D* );
-
-private slots:
-  void            onNameChecked();
-  void            onLabelsChecked();
-  void            onTicksChecked();
-
-private:
-  void            updateControlState();
-  void            setEnabled( QGroupBox*, const bool );
-
-private:
-  // name
-  QGroupBox*      myNameGrp;
-  QCheckBox*      myIsNameVisible;
-  QLineEdit*      myAxisName;
-  SVTK_FontWidget* myNameFont;
-
-  // labels
-  QGroupBox*      myLabelsGrp;
-  QCheckBox*      myIsLabelsVisible;
-  QtxIntSpinBox*  myLabelNumber;
-  QtxIntSpinBox*  myLabelOffset;
-  SVTK_FontWidget* myLabelsFont;
-
-  // tick marks
-  QGroupBox*      myTicksGrp;
-  QCheckBox*      myIsTicksVisible;
-  QtxIntSpinBox*  myTickLength;
-
-  friend class SVTK_CubeAxesDlg;
+  AxisWidget*     myAxes[ 3 ];
 };
 
 #endif
index 3dffbae506e6b816f652ec86a826b5c5ef5b915a..fa49432028ae86aef5f16de062b80624cac9dd7b 100644 (file)
@@ -134,7 +134,7 @@ SVTK_Selector*
 SVTK_GenericRenderWindowInteractor
 ::GetSelector()
 {
-  return mySelector.GetPointer();
+  return mySelector;
 }
 
 /*!
index 9bb7cbfcddc8aa9077e532c507ef32125d10cfce..06c0241e8efae8ec2708ab083dbde0cb32e5e19e 100644 (file)
@@ -122,7 +122,7 @@ class SVTK_EXPORT SVTK_GenericRenderWindowInteractor: public QVTK_GenericRenderW
   SVTK_GenericRenderWindowInteractor();
   ~SVTK_GenericRenderWindowInteractor();
 
-  vtkSmartPointer<SVTK_Selector> mySelector; //!< Keeps a pointer to SVTK_Selector
+  SVTK_Selector* mySelector; //!< Keeps a pointer to SVTK_Selector
   QWidget* myRenderWidget; //!< Keeps a pointer to QWidget, where vtkRenderWindow maps to.
 };
 
index 60dbf4fe6ca0e86802b47e377765428c70c75007..b02941bfb72d25a64e02092d26dc6248d925338b 100644 (file)
@@ -102,7 +102,6 @@ class SVTK_EXPORT SVTK_ControllerOnKeyDown : public vtkObject{
   void operator=(const SVTK_ControllerOnKeyDown&);          //Not implemented
 };
 
-class vtkPicker;
 class vtkPointPicker;
 
 class SALOME_Actor;
@@ -334,8 +333,6 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
 
   PSelectionEvent mySelectionEvent;
 
-  vtkSmartPointer<vtkPicker> myPicker;
-
   unsigned long                   myCurrRotationPointType;
   unsigned long                   myPrevRotationPointType;
 
diff --git a/src/SVTK/resources/vtk_view_graduated_axes.png b/src/SVTK/resources/vtk_view_graduated_axes.png
new file mode 100755 (executable)
index 0000000..2b44c06
Binary files /dev/null and b/src/SVTK/resources/vtk_view_graduated_axes.png differ
diff --git a/src/SVTK/resources/vtk_view_rotation_point.png b/src/SVTK/resources/vtk_view_rotation_point.png
new file mode 100755 (executable)
index 0000000..fc303e3
Binary files /dev/null and b/src/SVTK/resources/vtk_view_rotation_point.png differ
diff --git a/src/SVTK/resources/vtk_view_scaling.png b/src/SVTK/resources/vtk_view_scaling.png
new file mode 100644 (file)
index 0000000..fa8cbbc
Binary files /dev/null and b/src/SVTK/resources/vtk_view_scaling.png differ
diff --git a/src/SVTK/resources/vtk_view_update_rate.png b/src/SVTK/resources/vtk_view_update_rate.png
new file mode 100755 (executable)
index 0000000..3d01ad1
Binary files /dev/null and b/src/SVTK/resources/vtk_view_update_rate.png differ
diff --git a/src/Style/images/critical.png b/src/Style/images/critical.png
new file mode 100644 (file)
index 0000000..3cf8e5b
Binary files /dev/null and b/src/Style/images/critical.png differ
diff --git a/src/Style/images/information.png b/src/Style/images/information.png
new file mode 100644 (file)
index 0000000..3cd9764
Binary files /dev/null and b/src/Style/images/information.png differ
diff --git a/src/Style/images/question.png b/src/Style/images/question.png
new file mode 100644 (file)
index 0000000..b42fc1c
Binary files /dev/null and b/src/Style/images/question.png differ
diff --git a/src/Style/images/warning.png b/src/Style/images/warning.png
new file mode 100644 (file)
index 0000000..471ec58
Binary files /dev/null and b/src/Style/images/warning.png differ
index 9dfa3b47f3a8db449fd5fd0a437e420508948730..0689ab67aef41c6bebcae46b0758a824725c86e8 100644 (file)
@@ -47,6 +47,9 @@
 #include <vtkCell.h>
 #include <vtkPlane.h>
 #include <vtkMath.h>
+#include <vtkCellArray.h>
+#include <vtkTriangle.h>
+#include <vtkOrderedTriangulator.h>
 
 #ifdef _DEBUG_
 static int DEBUG_TRIA_EXECUTE = 0;
@@ -81,31 +84,117 @@ namespace
   typedef std::vector<TPolygon> TPolygons;
 }
 
-/*!
-  Constructor
-*/
+
+//----------------------------------------------------------------------------
 VTKViewer_Triangulator
 ::VTKViewer_Triangulator():
-  myInput(NULL),
-  myCellId(-1),
-  myShowInside(-1),
-  myAllVisible(-1),
-  myCellsVisibility(NULL),
-  myCellIds(vtkIdList::New())
+  myCellIds(vtkIdList::New()),
+  myFaceIds(vtkIdList::New()),
+  myPoints(vtkPoints::New()),
+  myPointIds(NULL)
 {}
 
 
-/*!
-  Destructor
-*/
+//----------------------------------------------------------------------------
 VTKViewer_Triangulator
 ::~VTKViewer_Triangulator()
 {
   myCellIds->Delete();
+  myFaceIds->Delete();
+  myPoints->Delete();
+}
+
+
+//----------------------------------------------------------------------------
+vtkPoints*
+VTKViewer_Triangulator
+::InitPoints(vtkUnstructuredGrid *theInput,
+            vtkIdType theCellId)
+{
+  myPoints->Reset();
+  myPoints->Modified(); // the VTK bug
+
+  vtkIdType aNumPts;
+  theInput->GetCellPoints(theCellId, aNumPts, myPointIds); 
+  if ( aNumPts > 0 ) {
+    vtkFloatingPointType anAbsoluteCoord[3];
+    myPoints->SetNumberOfPoints(aNumPts);
+    vtkPoints *anInputPoints = theInput->GetPoints();
+    for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
+      anInputPoints->GetPoint(myPointIds[aPntId], anAbsoluteCoord);
+      myPoints->SetPoint(aPntId, anAbsoluteCoord);
+    }
+  }
+
+  return myPoints;
+}
+
+
+//----------------------------------------------------------------------------
+vtkIdType 
+VTKViewer_Triangulator
+::GetNbOfPoints()
+{
+  return myPoints->GetNumberOfPoints();
 }
 
 
+//----------------------------------------------------------------------------
+vtkIdType 
+VTKViewer_Triangulator
+::GetPointId(vtkIdType thePointId)
+{
+  return thePointId;
+}
 
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType 
+VTKViewer_Triangulator
+::GetCellLength()
+{
+  vtkFloatingPointType aBounds[6];
+  myPoints->GetBounds(aBounds);
+
+  vtkFloatingPointType aCoordDiff[3];
+  aCoordDiff[0] = (aBounds[1] - aBounds[0]);
+  aCoordDiff[1] = (aBounds[3] - aBounds[2]);
+  aCoordDiff[2] = (aBounds[5] - aBounds[4]);
+
+  return sqrt(aCoordDiff[0]*aCoordDiff[0] + 
+             aCoordDiff[1]*aCoordDiff[1] + 
+             aCoordDiff[2]*aCoordDiff[2]);
+}
+
+
+//----------------------------------------------------------------------------
+void 
+VTKViewer_Triangulator
+::GetCellNeighbors(vtkUnstructuredGrid *theInput,
+                  vtkIdType theCellId,
+                  vtkCell* theFace,
+                  vtkIdList* theCellIds)
+{
+  myFaceIds->Reset();
+  vtkIdList *anIdList = theFace->PointIds;  
+  myFaceIds->InsertNextId(myPointIds[anIdList->GetId(0)]);
+  myFaceIds->InsertNextId(myPointIds[anIdList->GetId(1)]);
+  myFaceIds->InsertNextId(myPointIds[anIdList->GetId(2)]);
+
+  theInput->GetCellNeighbors(theCellId, myFaceIds, theCellIds);
+}
+
+
+//----------------------------------------------------------------------------
+vtkIdType 
+VTKViewer_Triangulator
+::GetConnectivity(vtkIdType thePntId)
+{
+  return myPointIds[thePntId];
+}
+
+
+//----------------------------------------------------------------------------
 bool 
 VTKViewer_Triangulator
 ::Execute(vtkUnstructuredGrid *theInput,
@@ -120,13 +209,7 @@ VTKViewer_Triangulator
          std::vector<vtkIdType>& theVTK2ObjIds,
          bool theIsCheckConvex)
 {
-  myInput = theInput;
-  myCellId = theCellId;
-  myShowInside = theShowInside;
-  myAllVisible = theAllVisible;
-  myCellsVisibility = theCellsVisibility;
-
-  vtkPoints *aPoints = InitPoints();
+  vtkPoints *aPoints = InitPoints(theInput, theCellId);
   vtkIdType aNumPts = GetNbOfPoints();
   if(DEBUG_TRIA_EXECUTE) cout<<"Triangulator - aNumPts = "<<aNumPts<<"\n";
 
@@ -154,7 +237,7 @@ VTKViewer_Triangulator
 
   static vtkFloatingPointType EPS = 1.0E-2;
   vtkFloatingPointType aDistEps = aCellLength/3.0 * EPS;
-  if(DEBUG_TRIA_EXECUTE) cout<<"\taCellLength = "<<aCellLength<<"; aDistEps = "<<aDistEps<<"\n";
+  if(DEBUG_TRIA_EXECUTE) cout<<"\taNumFaces = "<<aNumFaces<<"; aCellLength = "<<aCellLength<<"; aDistEps = "<<aDistEps<<"\n";
 
   // To initialize set of points that belong to the cell
   typedef std::set<vtkIdType> TPointIds;
@@ -172,9 +255,9 @@ VTKViewer_Triangulator
   for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
     vtkCell* aFace = GetFace(aFaceId);
     
-    GetCellNeighbors(theCellId, aFace, myCellIds);
-    if((!myAllVisible && !myCellsVisibility[myCellIds->GetId(0)]) || 
-       myCellIds->GetNumberOfIds() <= 0 || myShowInside)
+    GetCellNeighbors(theInput, theCellId, aFace, myCellIds);
+    if((!theAllVisible && !theCellsVisibility[myCellIds->GetId(0)]) || 
+       myCellIds->GetNumberOfIds() <= 0 || theShowInside)
     {
       TPointIds aPointIds;
       vtkIdList *anIdList = aFace->PointIds;  
@@ -320,9 +403,9 @@ VTKViewer_Triangulator
            aCenter[0] += aPntCoord[0];
            aCenter[1] += aPntCoord[1];
            aCenter[2] += aPntCoord[2];
-           if(DEBUG_TRIA_EXECUTE) cout  << "Added = TRUE" << endl;
+           if(DEBUG_TRIA_EXECUTE) cout  << "Added = TRUE" << endl;
          } else {
-           if(DEBUG_TRIA_EXECUTE) cout  << "Added = FALSE" << endl;
+           if(DEBUG_TRIA_EXECUTE) cout  << "Added = FALSE" << endl;
          }
        }
        int aNbPoints = aPointIds.size();
@@ -512,171 +595,144 @@ VTKViewer_Triangulator
   return true;
 }
 
-/*!
-  Constructor
-*/
+
+//----------------------------------------------------------------------------
 VTKViewer_OrderedTriangulator
 ::VTKViewer_OrderedTriangulator():
-  myCell(vtkGenericCell::New())
-{}
+  myTriangulator(vtkOrderedTriangulator::New()),
+  myBoundaryTris(vtkCellArray::New()),
+  myTriangle(vtkTriangle::New())
+{
+  myBoundaryTris->Allocate(VTK_CELL_SIZE);
+  myTriangulator->PreSortedOff();
+}
 
-/*!
-  Destructor
-*/
+
+//----------------------------------------------------------------------------
 VTKViewer_OrderedTriangulator
 ::~VTKViewer_OrderedTriangulator()
 {
-  myCell->Delete();
+  myTriangle->Delete();
+  myBoundaryTris->Delete();
+  myTriangulator->Delete();
 }
 
+
+//----------------------------------------------------------------------------
 vtkPoints*
 VTKViewer_OrderedTriangulator
-::InitPoints()
+::InitPoints(vtkUnstructuredGrid *theInput,
+            vtkIdType theCellId)
 {
-  myInput->GetCell(myCellId,myCell);
-  return myInput->GetPoints();
-}
+  myBoundaryTris->Reset();
 
-vtkIdType 
-VTKViewer_OrderedTriangulator
-::GetNbOfPoints()
-{
-  return myCell->GetNumberOfPoints();
-}
+  vtkPoints* aPoints = VTKViewer_Triangulator::InitPoints(theInput, theCellId);
+  vtkIdType aNumPts = myPoints->GetNumberOfPoints();
+  if ( aNumPts > 0 ) {
+    myTriangulator->InitTriangulation(0.0, 1.0, 0.0, 1.0, 0.0, 1.0, aNumPts);
 
-vtkIdType 
-VTKViewer_OrderedTriangulator
-::GetPointId(vtkIdType thePointId)
-{
-  return myCell->GetPointId(thePointId);
-}
+    vtkFloatingPointType aBounds[6];
+    myPoints->GetBounds(aBounds);
 
-vtkFloatingPointType 
-VTKViewer_OrderedTriangulator
-::GetCellLength()
-{
-  return sqrt(myCell->GetLength2());
+    vtkFloatingPointType anAbsoluteCoord[3];
+    vtkFloatingPointType aParamentrucCoord[3];
+    for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
+      myPoints->GetPoint(aPntId, anAbsoluteCoord);
+      aParamentrucCoord[0] = (anAbsoluteCoord[0] - aBounds[0]) / (aBounds[1] - aBounds[0]);
+      aParamentrucCoord[1] = (anAbsoluteCoord[1] - aBounds[2]) / (aBounds[3] - aBounds[2]);
+      aParamentrucCoord[2] = (anAbsoluteCoord[2] - aBounds[4]) / (aBounds[5] - aBounds[4]);
+      myTriangulator->InsertPoint(aPntId, anAbsoluteCoord, aParamentrucCoord, 0);
+    }
+
+    myTriangulator->Triangulate();
+    myTriangulator->AddTriangles(myBoundaryTris);
+  }
+
+  return aPoints;
 }
 
+
+//----------------------------------------------------------------------------
 vtkIdType 
 VTKViewer_OrderedTriangulator
 ::GetNumFaces()
 {
-  return myCell->GetNumberOfFaces();
+  return myBoundaryTris->GetNumberOfCells();
 }
 
+
+//----------------------------------------------------------------------------
 vtkCell*
 VTKViewer_OrderedTriangulator
 ::GetFace(vtkIdType theFaceId)
 {
-  return myCell->GetFace(theFaceId);
-}
+  vtkIdType aNumCells = myBoundaryTris->GetNumberOfCells();
+  if ( theFaceId < 0 || theFaceId >= aNumCells ) 
+    return NULL;
 
-void 
-VTKViewer_OrderedTriangulator
-::GetCellNeighbors(vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds)
-{
-  vtkIdList *anIdList = theFace->PointIds;  
-  myInput->GetCellNeighbors(theCellId, anIdList, theCellIds);
-}
+  vtkIdType *aCells = myBoundaryTris->GetPointer();
 
-vtkIdType 
-VTKViewer_OrderedTriangulator
-::GetConnectivity(vtkIdType thePntId)
-{
-  return thePntId;
+  // Each triangle has three points plus number of points
+  vtkIdType *aCellPtr = aCells + 4*theFaceId;
+  
+  myTriangle->PointIds->SetId(0, aCellPtr[1]);
+  myTriangle->Points->SetPoint(0, myPoints->GetPoint(aCellPtr[1]));
+
+  myTriangle->PointIds->SetId(1, aCellPtr[2]);
+  myTriangle->Points->SetPoint(1, myPoints->GetPoint(aCellPtr[2]));
+
+  myTriangle->PointIds->SetId(2, aCellPtr[3]);
+  myTriangle->Points->SetPoint(2, myPoints->GetPoint(aCellPtr[3]));
+
+  return myTriangle;
 }
 
-/*!
-  Constructor
-*/
+
+//----------------------------------------------------------------------------
 VTKViewer_DelaunayTriangulator
 ::VTKViewer_DelaunayTriangulator():
   myUnstructuredGrid(vtkUnstructuredGrid::New()),
   myGeometryFilter(vtkGeometryFilter::New()),
   myDelaunay3D(vtkDelaunay3D::New()),
-  myFaceIds(vtkIdList::New()),
-  myPoints(vtkPoints::New()),
-  myPolyData(NULL),
-  myPointIds(NULL)
+  myPolyData(NULL)
 {
+  myUnstructuredGrid->Initialize();
+  myUnstructuredGrid->Allocate();
+  myUnstructuredGrid->SetPoints(myPoints);
+
   myDelaunay3D->SetInput(myUnstructuredGrid);
   myGeometryFilter->SetInput(myDelaunay3D->GetOutput());
+  myPolyData = myGeometryFilter->GetOutput();
 }
 
 
-
-/*!
-  Destructor
-*/
+//----------------------------------------------------------------------------
 VTKViewer_DelaunayTriangulator
 ::~VTKViewer_DelaunayTriangulator()
 {
   myUnstructuredGrid->Delete();
   myGeometryFilter->Delete();
   myDelaunay3D->Delete();
-  myFaceIds->Delete();
-  myPoints->Delete();
 }
 
 
+//----------------------------------------------------------------------------
 vtkPoints* 
 VTKViewer_DelaunayTriangulator
-::InitPoints()
+::InitPoints(vtkUnstructuredGrid *theInput,
+            vtkIdType theCellId)
 {
-  myPoints->Reset();
-  myUnstructuredGrid->Initialize();
-  myUnstructuredGrid->Allocate();
-  myUnstructuredGrid->SetPoints(myPoints);
-
-  vtkIdType aNumPts;
-  myInput->GetCellPoints(myCellId,aNumPts,myPointIds); 
-  
-  if ( aNumPts < myPoints->GetNumberOfPoints() )
-    myPoints->Reset();
-  
-  {
-    vtkFloatingPointType aPntCoord[3];
-    myPoints->SetNumberOfPoints(aNumPts);
-    vtkPoints *anInputPoints = myInput->GetPoints();
-    for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
-      anInputPoints->GetPoint(myPointIds[aPntId],aPntCoord);
-      myPoints->SetPoint(aPntId,aPntCoord);
-    }
-  }
+  vtkPoints* aPoints = VTKViewer_Triangulator::InitPoints(theInput, theCellId);
 
   myPoints->Modified();
   myUnstructuredGrid->Modified();
-
   myGeometryFilter->Update();
-  myPolyData = myGeometryFilter->GetOutput();
   
-  return myPoints;
-}
-
-vtkIdType 
-VTKViewer_DelaunayTriangulator
-::GetNbOfPoints()
-{
-  return myPoints->GetNumberOfPoints();
+  return aPoints;
 }
 
-vtkIdType 
-VTKViewer_DelaunayTriangulator
-::GetPointId(vtkIdType thePointId)
-{
-  return thePointId;
-}
-
-vtkFloatingPointType 
-VTKViewer_DelaunayTriangulator
-::GetCellLength()
-{
-  return myPolyData->GetLength();
-}
 
+//----------------------------------------------------------------------------
 vtkIdType 
 VTKViewer_DelaunayTriangulator
 ::GetNumFaces()
@@ -684,32 +740,11 @@ VTKViewer_DelaunayTriangulator
   return myPolyData->GetNumberOfCells();
 }
 
+
+//----------------------------------------------------------------------------
 vtkCell*
 VTKViewer_DelaunayTriangulator
 ::GetFace(vtkIdType theFaceId)
 {
   return myPolyData->GetCell(theFaceId);
 }
-
-void 
-VTKViewer_DelaunayTriangulator
-::GetCellNeighbors(vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds)
-{
-  myFaceIds->Reset();
-  vtkIdList *anIdList = theFace->PointIds;  
-  myFaceIds->InsertNextId(myPointIds[anIdList->GetId(0)]);
-  myFaceIds->InsertNextId(myPointIds[anIdList->GetId(1)]);
-  myFaceIds->InsertNextId(myPointIds[anIdList->GetId(2)]);
-
-  myInput->GetCellNeighbors(theCellId, myFaceIds, theCellIds);
-}
-
-
-vtkIdType 
-VTKViewer_DelaunayTriangulator
-::GetConnectivity(vtkIdType thePntId)
-{
-  return myPointIds[thePntId];
-}
index 2bf024d5e0fc1d1a7bd86b948ab215259e59e2dd..5e391d976af4cc0667d687c10e8f5a82ac4cc132 100644 (file)
@@ -36,7 +36,12 @@ class vtkCellData;
 class vtkPoints;
 class vtkIdList;
 class vtkCell;
+class vtkCellArray;
+class vtkTriangle;
+class vtkOrderedTriangulator;
 
+
+//----------------------------------------------------------------------------
 class VTKVIEWER_EXPORT VTKViewer_Triangulator
 {
  public:
@@ -57,51 +62,48 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator
          std::vector<vtkIdType>& theVTK2ObjIds,
          bool theIsCheckConvex);
 
- protected:
+ private:
   vtkIdList* myCellIds;
 
-  vtkUnstructuredGrid *myInput;
-  vtkIdType myCellId;
-  int myShowInside;
-  int myAllVisible;
-  const char* myCellsVisibility;
+ protected:
+  vtkIdType *myPointIds;
+  vtkIdList* myFaceIds;
+  vtkPoints* myPoints;
 
   virtual
   vtkPoints* 
-  InitPoints() = 0;
+  InitPoints(vtkUnstructuredGrid *theInput,
+            vtkIdType theCellId);
 
   virtual
   vtkIdType 
-  GetNbOfPoints() = 0;
+  GetNumFaces() = 0;
 
   virtual
-  vtkIdType 
-  GetPointId(vtkIdType thePointId) = 0;
+  vtkCell* 
+  GetFace(vtkIdType theFaceId) = 0;
 
-  virtual
-  vtkFloatingPointType 
-  GetCellLength() = 0;
+  vtkIdType 
+  GetNbOfPoints();
 
-  virtual
   vtkIdType 
-  GetNumFaces() = 0;
+  GetPointId(vtkIdType thePointId);
 
-  virtual
-  vtkCell* 
-  GetFace(vtkIdType theFaceId) = 0;
+  vtkFloatingPointType 
+  GetCellLength();
 
-  virtual
   void 
-  GetCellNeighbors(vtkIdType theCellId,
+  GetCellNeighbors(vtkUnstructuredGrid *theInput,
+                  vtkIdType theCellId,
                   vtkCell* theFace,
-                  vtkIdList* theCellIds) = 0;
+                  vtkIdList* theCellIds);
 
-  virtual
   vtkIdType 
-  GetConnectivity(vtkIdType thePntId) = 0;
+  GetConnectivity(vtkIdType thePntId);
 };
 
 
+//----------------------------------------------------------------------------
 class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangulator
 {
  public:
@@ -111,22 +113,14 @@ class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangul
   ~VTKViewer_OrderedTriangulator();
 
  protected:
-  vtkGenericCell *myCell;
+  vtkOrderedTriangulator *myTriangulator;
+  vtkCellArray *myBoundaryTris;
+  vtkTriangle  *myTriangle;
 
   virtual
   vtkPoints* 
-  InitPoints();
-
-  virtual
-  vtkIdType 
-  GetNbOfPoints();
-
-  vtkIdType 
-  GetPointId(vtkIdType thePointId);
-
-  virtual
-  vtkFloatingPointType 
-  GetCellLength();
+  InitPoints(vtkUnstructuredGrid *theInput,
+            vtkIdType theCellId);
 
   virtual
   vtkIdType 
@@ -135,19 +129,10 @@ class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangul
   virtual
   vtkCell* 
   GetFace(vtkIdType theFaceId);
-
-  virtual
-  void 
-  GetCellNeighbors(vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds);
-
-  virtual
-  vtkIdType 
-  GetConnectivity(vtkIdType thePntId);
 };
 
 
+//----------------------------------------------------------------------------
 class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangulator
 {
  public:
@@ -161,24 +146,11 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu
   vtkGeometryFilter* myGeometryFilter;
   vtkDelaunay3D* myDelaunay3D;
   vtkPolyData* myPolyData;
-  vtkIdType *myPointIds;
-  vtkIdList* myFaceIds;
-  vtkPoints* myPoints;
 
   virtual
   vtkPoints* 
-  InitPoints();
-
-  virtual
-  vtkIdType 
-  GetNbOfPoints();
-
-  vtkIdType 
-  GetPointId(vtkIdType thePointId);
-
-  virtual
-  vtkFloatingPointType 
-  GetCellLength();
+  InitPoints(vtkUnstructuredGrid *theInput,
+            vtkIdType theCellId);
 
   virtual
   vtkIdType 
@@ -187,16 +159,6 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu
   virtual
   vtkCell* 
   GetFace(vtkIdType theFaceId);
-
-  virtual
-  void 
-  GetCellNeighbors(vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds);
-
-  virtual
-  vtkIdType 
-  GetConnectivity(vtkIdType thePntId);
 };
 
 
index 50cade3f124768c3c37afaf018742f4c93401cc2..3d6182e96292a3728780c2d937093f38bd210fa9 100755 (executable)
@@ -474,6 +474,7 @@ VTKViewer_GeometryFilter
         case VTK_QUADRATIC_QUAD:
         case VTK_QUADRATIC_TETRA:
         case VTK_QUADRATIC_HEXAHEDRON:
+        case VTK_QUADRATIC_WEDGE:
          if(!myIsWireframeMode){
            input->GetCell(cellId,cell);
            vtkIdList *pts = vtkIdList::New();  
@@ -650,6 +651,82 @@ VTKViewer_GeometryFilter
 
              break;
            }
+            case VTK_QUADRATIC_WEDGE: {
+              aCellType = VTK_POLYGON;
+             numFacePts = 6;
+              //---------------------------------------------------------------
+              //Face 1
+             aNewPts[0] = pts[0];
+             aNewPts[1] = pts[6];
+             aNewPts[2] = pts[1];
+             aNewPts[3] = pts[7];
+             aNewPts[4] = pts[2];
+             aNewPts[5] = pts[8];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              //Face 2
+              aNewPts[0] = pts[3];
+             aNewPts[1] = pts[9];
+             aNewPts[2] = pts[4];
+             aNewPts[3] = pts[10];
+             aNewPts[4] = pts[5];
+             aNewPts[5] = pts[11];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              //Face 3
+              numFacePts = 8;
+              aNewPts[0] = pts[0];
+             aNewPts[1] = pts[8];
+             aNewPts[2] = pts[2];
+             aNewPts[3] = pts[14];
+             aNewPts[4] = pts[5];
+             aNewPts[5] = pts[11];
+             aNewPts[6] = pts[3];
+             aNewPts[7] = pts[12];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              //Face 4
+              aNewPts[0] = pts[1];
+             aNewPts[1] = pts[13];
+             aNewPts[2] = pts[4];
+             aNewPts[3] = pts[10];
+             aNewPts[4] = pts[5];
+             aNewPts[5] = pts[14];
+             aNewPts[6] = pts[2];
+             aNewPts[7] = pts[7];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              //Face 5
+              aNewPts[0] = pts[0];
+             aNewPts[1] = pts[12];
+             aNewPts[2] = pts[3];
+             aNewPts[3] = pts[9];
+             aNewPts[4] = pts[4];
+             aNewPts[5] = pts[13];
+              aNewPts[6] = pts[1];
+              aNewPts[7] = pts[6];
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+             if(myStoreMapping)
+               myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+              break;
+            }
            case VTK_QUADRATIC_HEXAHEDRON: {
              aCellType = VTK_POLYGON;
              numFacePts = 8;
@@ -771,6 +848,8 @@ VTKViewer_GeometryFilter
     {
     delete [] cellVis;
     }
+
+  return 1;
 }
 
 
index f50d67b30b862bc967e3ef2efcb92107dde0b9a8..7781f1b579707eb3b3e34350e8c34652968ece92 100755 (executable)
@@ -80,8 +80,12 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
     vtkFloatingPointType aLength = aDataSet->GetLength();
     vtkFloatingPointType aPrecision = 1.0E-3;
     vtkFloatingPointType anOldScale = GetScale()[0];
-    vtkFloatingPointType aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
-    if(fabs(aScale - anOldScale)/aScale > aPrecision){
+    vtkFloatingPointType aScale;
+    if (aSize[1] > aSize[0])
+      aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
+    else
+      aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[1])/vtkFloatingPointType(aSize[0]));
+    if(aScale != 0.0&& fabs(aScale - anOldScale)/aScale > aPrecision){
       SetScale(aScale);
     }
   }
index 0e3f32bb7b26d1173f9b8cd20701b534b97d4794..a206be6ee9e95495d382ba2d3bf70ac42fd41b13 100755 (executable)
@@ -19,9 +19,6 @@
 #include "VTKViewer_ViewManager.h"
 #include "VTKViewer_ViewModel.h"
 
-#include <SUIT_PreferenceMgr.h>
-#include <SUIT_ResourceMgr.h>
-
 /*!Constructor.Initialize SIUT_ViewManager by \a study and \a theDesktop.
  * Create new instance of VTKViewer_Viewer and set view model by it.
  */
@@ -36,37 +33,3 @@ VTKViewer_ViewManager::~VTKViewer_ViewManager()
 {
   /*!Do nothing.*/
 }
-
-/*!
-  Fills preference manager for viewer
-*/
-int VTKViewer_ViewManager::fillPreferences( SUIT_PreferenceMgr* thePrefMgr, const int theId )
-{
-  int aGrpId = thePrefMgr->addItem( tr( "PREF_GROUP_VTKVIEWER" ), theId,
-                                    SUIT_PreferenceMgr::GroupBox );
-
-  int vtkTS = thePrefMgr->addItem( tr( "PREF_TRIHEDRON_SIZE" ), aGrpId,
-                                   SUIT_PreferenceMgr::DblSpin, "VTKViewer", "trihedron_size" );
-  thePrefMgr->addItem( tr( "PREF_RELATIVE_SIZE" ), aGrpId, SUIT_PreferenceMgr::Bool,
-                       "VTKViewer", "relative_size" );
-  thePrefMgr->addItem( tr( "PREF_VIEWER_BACKGROUND" ), aGrpId,
-                       SUIT_PreferenceMgr::Color, "VTKViewer", "background" );
-
-  thePrefMgr->setItemProperty( "min", 1.0E-06, vtkTS );
-  thePrefMgr->setItemProperty( "max", 150, vtkTS );
-
-  return aGrpId;
-}
-
-/**
- * Fills values from resources
- */
-void VTKViewer_ViewManager::fillFrom( SUIT_ResourceMgr* theMgr )
-{
-  VTKViewer_Viewer* aModel = dynamic_cast<VTKViewer_Viewer*>( getViewModel() );
-  if ( !aModel )
-    return;
-
-  aModel->setBackgroundColor( theMgr->colorValue( "VTKViewer", "background",
-                                                  aModel->backgroundColor() ) );
-}
index c8e20081726a81c84bcf9050e1c78e3875ed5c94..debd7987e5c331ade27606c11db352b4bb380a38 100755 (executable)
@@ -35,9 +35,6 @@ class VTKVIEWER_EXPORT VTKViewer_ViewManager : public SUIT_ViewManager
 public:
   VTKViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* );
   virtual ~VTKViewer_ViewManager();
-
-  static int  fillPreferences( SUIT_PreferenceMgr*, const int );
-  void        fillFrom( SUIT_ResourceMgr* );
 };
 
 #endif
index ead79fd574a3e31e095211b8eb8b298d28314559..6f462e3e24fad54b5a6f7e8ac713ecc93836c458 100755 (executable)
@@ -456,8 +456,8 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){
                      (bnd[5]-bnd[4])*(bnd[5]-bnd[4]));
     }else{
       aLength = bnd[1]-bnd[0];
-      aLength = max((bnd[3]-bnd[2]),aLength);
-      aLength = max((bnd[5]-bnd[4]),aLength);
+      aLength = qMax((bnd[3]-bnd[2]),aLength);
+      aLength = qMax((bnd[5]-bnd[4]),aLength);
     }
    
     static vtkFloatingPointType aSizeInPercents = 105;
diff --git a/src/VTKViewer/resources/vtk_view_back.png b/src/VTKViewer/resources/vtk_view_back.png
new file mode 100755 (executable)
index 0000000..51beb0c
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_back.png differ
diff --git a/src/VTKViewer/resources/vtk_view_bottom.png b/src/VTKViewer/resources/vtk_view_bottom.png
new file mode 100755 (executable)
index 0000000..fa558e2
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_bottom.png differ
diff --git a/src/VTKViewer/resources/vtk_view_camera_dump.png b/src/VTKViewer/resources/vtk_view_camera_dump.png
new file mode 100755 (executable)
index 0000000..b02616f
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_camera_dump.png differ
diff --git a/src/VTKViewer/resources/vtk_view_fitall.png b/src/VTKViewer/resources/vtk_view_fitall.png
new file mode 100755 (executable)
index 0000000..87e001d
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_fitall.png differ
diff --git a/src/VTKViewer/resources/vtk_view_fitarea.png b/src/VTKViewer/resources/vtk_view_fitarea.png
new file mode 100755 (executable)
index 0000000..450dc56
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_fitarea.png differ
diff --git a/src/VTKViewer/resources/vtk_view_front.png b/src/VTKViewer/resources/vtk_view_front.png
new file mode 100755 (executable)
index 0000000..d917960
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_front.png differ
diff --git a/src/VTKViewer/resources/vtk_view_glpan.png b/src/VTKViewer/resources/vtk_view_glpan.png
new file mode 100644 (file)
index 0000000..28ab547
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_glpan.png differ
diff --git a/src/VTKViewer/resources/vtk_view_left.png b/src/VTKViewer/resources/vtk_view_left.png
new file mode 100755 (executable)
index 0000000..1b787b0
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_left.png differ
diff --git a/src/VTKViewer/resources/vtk_view_pan.png b/src/VTKViewer/resources/vtk_view_pan.png
new file mode 100755 (executable)
index 0000000..ec56cac
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_pan.png differ
diff --git a/src/VTKViewer/resources/vtk_view_reset.png b/src/VTKViewer/resources/vtk_view_reset.png
new file mode 100755 (executable)
index 0000000..66f81e6
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_reset.png differ
diff --git a/src/VTKViewer/resources/vtk_view_right.png b/src/VTKViewer/resources/vtk_view_right.png
new file mode 100755 (executable)
index 0000000..5c6e161
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_right.png differ
diff --git a/src/VTKViewer/resources/vtk_view_rotate.png b/src/VTKViewer/resources/vtk_view_rotate.png
new file mode 100755 (executable)
index 0000000..28ec89f
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_rotate.png differ
diff --git a/src/VTKViewer/resources/vtk_view_top.png b/src/VTKViewer/resources/vtk_view_top.png
new file mode 100755 (executable)
index 0000000..cef9504
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_top.png differ
diff --git a/src/VTKViewer/resources/vtk_view_triedre.png b/src/VTKViewer/resources/vtk_view_triedre.png
new file mode 100755 (executable)
index 0000000..bc5894d
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_triedre.png differ
diff --git a/src/VTKViewer/resources/vtk_view_zoom.png b/src/VTKViewer/resources/vtk_view_zoom.png
new file mode 100755 (executable)
index 0000000..386c966
Binary files /dev/null and b/src/VTKViewer/resources/vtk_view_zoom.png differ