]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merge from V5_1_3_BR 07/12/2009
authorvsr <vsr@opencascade.com>
Tue, 8 Dec 2009 06:45:30 +0000 (06:45 +0000)
committervsr <vsr@opencascade.com>
Tue, 8 Dec 2009 06:45:30 +0000 (06:45 +0000)
55 files changed:
adm_local/unix/config_files/check_qt.m4
src/CAM/CAM_Application.cxx
src/GLViewer/GLViewer_ViewFrame.cxx
src/OCCViewer/OCCViewer_VService.cxx
src/OCCViewer/OCCViewer_VService.h
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/Plot2d/Plot2d_ViewWindow.cxx
src/PyInterp/PyInterp_Interp.cxx
src/Qtx/Qtx.cxx
src/Qtx/QtxActionToolMgr.cxx
src/Qtx/QtxActionToolMgr.h
src/Qtx/QtxDockWidget.cxx
src/Qtx/QtxPagePrefMgr.cxx
src/Qtx/QtxPagePrefMgr.h
src/Qtx/QtxSplash.cxx
src/QxScene/QxScene_ViewWindow.cxx
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h
src/SALOME_SWIG/examplevtk1.py
src/SPlot2d/Makefile.am
src/SUIT/SUIT_DataObject.cxx
src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx
src/SVTK/Makefile.am
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_ViewWindow.cxx
src/SalomeApp/SalomeApp_VisualState.cxx
src/Session/Makefile.am
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h
src/VTKViewer/VTKViewer_AppendFilter.cxx
src/VTKViewer/VTKViewer_AppendFilter.h
src/VTKViewer/VTKViewer_ArcBuilder.cxx
src/VTKViewer/VTKViewer_ArcBuilder.h
src/VTKViewer/VTKViewer_ConvexTool.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx
src/VTKViewer/VTKViewer_FramedTextActor.cxx
src/VTKViewer/VTKViewer_FramedTextActor.h
src/VTKViewer/VTKViewer_Functor.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_InteractorStyle.cxx
src/VTKViewer/VTKViewer_InteractorStyle.h
src/VTKViewer/VTKViewer_RenderWindow.cxx
src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx
src/VTKViewer/VTKViewer_RenderWindowInteractor.h
src/VTKViewer/VTKViewer_ShrinkFilter.cxx
src/VTKViewer/VTKViewer_Transform.cxx
src/VTKViewer/VTKViewer_Trihedron.cxx
src/VTKViewer/VTKViewer_Trihedron.h
src/VTKViewer/VTKViewer_Utilities.cxx
src/VTKViewer/VTKViewer_Utilities.h
src/VTKViewer/VTKViewer_ViewWindow.cxx
src/VTKViewer/VTKViewer_ViewWindow.h

index d98fff260536b1ecdb23b1cfd7e455b0731ff292..0f28aef7d9255db367155e1b234aecd3db2e682c 100644 (file)
@@ -51,6 +51,8 @@ fi
 
 qt_ok=yes
 
+QTDIR=$(echo $QTDIR | sed 's%[/]\+$%%')
+
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
 
index dab5b81430a78c10db3e5722e2ed35046a6e9526..0e7585504040a4d6391297265ed365b2cce7f922 100755 (executable)
@@ -39,6 +39,8 @@
 #include <dlfcn.h>
 #endif
 
+#include <cstdio>
+
 /*!
   \brief Create new instance of CAM_Application.
   \return new instance of CAM_Application class
@@ -88,6 +90,9 @@ CAM_Application::CAM_Application( const bool autoLoad )
 */
 CAM_Application::~CAM_Application()
 {
+  for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); it != myModules.end(); ++it )
+    delete *it;
+  myModules.clear();
 }
 
 /*! 
@@ -437,9 +442,6 @@ void CAM_Application::beforeCloseDoc( SUIT_Study* theDoc )
 
 void CAM_Application::afterCloseDoc()
 {
-  for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); it != myModules.end(); ++it )
-    delete *it;
-  myModules.clear();
 }
 
 /*!
index b52bdb69f1a7bf5acf51acd3b1c5c14965c5bdea..4fa9bc87640dfd54ae0bd31ce10aa18af93e9f96 100644 (file)
@@ -153,7 +153,7 @@ void GLViewer_ViewFrame::createActions()
 */
 void GLViewer_ViewFrame::createToolBar()
 {
-  int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL") );
+  int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false );
   toolMgr()->append( DumpId, tid );
 
   QtxMultiAction* aScaleAction = new QtxMultiAction( this );
index e7ba5ea8fffc3417f39a95e16e0db77b9920e1ab..02f104d7ed1551523e12b93bc67c9eb5ae8d9f18 100755 (executable)
@@ -32,7 +32,6 @@
 #include <WNT_Window.hxx>
 #include <Graphic3d_WNTGraphicDevice.hxx>
 #include <WNT_GraphicDevice.hxx>
-#include <WNT_GraphicDevice.hxx>
 #include <WNT_WDriver.hxx>
 #include <InterfaceGraphic_WNT.hxx>
 #else
@@ -82,23 +81,32 @@ return XServiceImageDevice;
 #endif // WNT
 
 /*!
-    Maps CasCade view to the window [ static ]
+    Create native view window for CasCade view [ static ]
 */
-void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view,
-                                 const Standard_Integer hiwin,
-                                 const Standard_Integer lowin,
-                                 const Xw_WindowQuality quality )
+Handle(Aspect_Window) OCCViewer_VService::CreateWindow( const Handle(V3d_View)& view,
+                                                       const Standard_Integer hiwin,
+                                                       const Standard_Integer lowin,
+                                                       const Xw_WindowQuality quality )
 {
 #ifdef WNT
-  Handle(WNT_Window) w =
-      new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
-  // Prevent flicker
-  w->SetFlags( WDF_NOERASEBKGRND );
+  Handle(WNT_Window) viewWindow = new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
+  // Prevent flickering
+  viewWindow->SetFlags( WDF_NOERASEBKGRND );
 #else
-  Handle(Xw_Window) w =
-      new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, quality );
+  Handle(Xw_Window) viewWindow = new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, quality );
 #endif
-  view->SetWindow( w );
+  return viewWindow;
+}
+
+/*!
+    Maps CasCade view to the window [ static ]
+*/
+void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view,
+                                   const Standard_Integer hiwin,
+                                   const Standard_Integer lowin,
+                                   const Xw_WindowQuality quality )
+{
+  view->SetWindow( OCCViewer_VService::CreateWindow( view, hiwin, lowin, quality ) );
 }
 
 /*!
index 43298b1f366850d2d18b94c34b497abd4717f043..2e7b392f639895b8054b20176687a23a8508dc0d 100755 (executable)
@@ -58,6 +58,9 @@
 #ifndef _Handle_Aspect_WindowDriver_HeaderFile
 #include <Handle_Aspect_WindowDriver.hxx>
 #endif
+#ifndef _Handle_Aspect_Window_HeaderFile
+#include <Handle_Aspect_Window.hxx>
+#endif
 
 class V3d_View;
 class V2d_View;
@@ -90,6 +93,12 @@ public:
     }
 
     // STATIC METHODS
+    static Handle(Aspect_Window) 
+                    CreateWindow( const Handle(V3d_View)& view,
+                                 const Standard_Integer hiwin,
+                                 const Standard_Integer lowin,
+                                 const Xw_WindowQuality quality );
+
     static void     SetWindow( const Handle(  V3d_View )& view,
                                const Standard_Integer hiwin,
                                const Standard_Integer lowin,
index 7fc204ddd3a1e489df889386d10da86c93c4ac02..523018d335f8978151cf08d7c3594a76b771c8f9 100755 (executable)
@@ -51,14 +51,14 @@ static int sy = 0;
 static Standard_Boolean zRotation = Standard_False;
 
 /*!
-    Constructor
+  Constructor
 */
 OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView  type )
-: OCCViewer_ViewPort( parent ),
-myScale( 1.0 ),
-myDegenerated( true ),
-myAnimate( false ),
-myBusy( true )
+  : OCCViewer_ViewPort( parent ),
+    myScale( 1.0 ),
+    myDegenerated( true ),
+    myAnimate( false ),
+    myBusy( true )
 {
   selectVisualId();
 
@@ -75,7 +75,7 @@ myBusy( true )
 }
 
 /*!
-    Destructor
+  Destructor
 */
 OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
 {
@@ -85,41 +85,40 @@ OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
 }
 
 /*!
-    Activates the desired 'type' of view in the viewer
-    ( view of 'type' is created if it doesn't exist ). [ public ]
+  Activates the desired 'type' of view in the viewer
+  ( view of 'type' is created if it doesn't exist ). [ public ]
 */
 /*void OCCViewer_ViewPort3d::setActive( V3d_TypeOfView type )
 {
-    if ( activeView().IsNull() )
-        return;
-
-    if ( activeView()->Type() != type )
-    {
-        if ( type == V3d_ORTHOGRAPHIC )
-            setView( myOrthoView );
-        if ( type == V3d_PERSPECTIVE )
-            setView( myPerspView );
-    }
+  if ( activeView().IsNull() )
+  return;
+
+  if ( activeView()->Type() != type )
+  {
+  if ( type == V3d_ORTHOGRAPHIC )
+  setView( myOrthoView );
+  if ( type == V3d_PERSPECTIVE )
+  setView( myPerspView );
+  }
 }*/
 
 /*!
-    Maps CasCade 'view' to this viewport. [ private ]
+  Maps CasCade 'view' to this viewport. [ private ]
 */
 bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
 {
   if ( !setWindow( view ) )
     return false;
 
-  if ( !mapped( view ) )
-       {
-               view->SetWindow( myWindow );
-               if ( view != activeView() )
-           view->View()->Deactivate();
-       }
+  if ( !mapped( view ) ) {
+    view->SetWindow( myWindow );
+    if ( view != activeView() )
+      view->View()->Deactivate();
+  }
 
   /* create static trihedron (16551: EDF PAL 501) */
   OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget() );
-  if ( aVW ){
+  if ( aVW ) {
     OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
     if ( aViewModel && aViewModel->isStaticTrihedronDisplayed() ){
       view->ZBufferTriedronSetup();
@@ -130,7 +129,7 @@ bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
 }
 
 /*!
-    Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
+  Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
 */
 Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view )
 {
@@ -138,13 +137,14 @@ Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view
   if ( view == activeView() || !mapView( view ) )
     return activeView();
 
-    /* activate the new view*/
+  /* activate the new view*/
   Handle( V3d_View ) oldView = activeView();
-       if ( !oldView.IsNull() )
-  {
-               oldView->View()->Deactivate();
-               view->SetBackgroundColor( oldView->BackgroundColor() );
-       }
+  if ( !oldView.IsNull() ) {
+    if (oldView->View()->IsDefined())
+      oldView->View()->Deactivate();
+    view->SetBackgroundColor( oldView->BackgroundColor() );
+  }
+  
   if ( myDegenerated )
     view->SetDegenerateModeOn();
   else
@@ -152,32 +152,32 @@ Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view
 
   view->View()->Activate();
   activeView() = view;
-       return oldView;
+  return oldView;
 }
 
 /*!
-    Returns CasCade 3D view. [ public ]
+  Returns CasCade 3D view. [ public ]
 */
 Handle(V3d_View) OCCViewer_ViewPort3d::getView() const
 {
-       return activeView();
+  return activeView();
 }
 
 /*!
-    Returns CasCade 3D viewer [ public ]
+  Returns CasCade 3D viewer [ public ]
 */
 Handle(V3d_Viewer) OCCViewer_ViewPort3d::getViewer() const
 {
-       Handle(V3d_Viewer) viewer;
-       if ( !activeView().IsNull() )
+  Handle(V3d_Viewer) viewer;
+  if ( !activeView().IsNull() )
     viewer = activeView()->Viewer();
-       return viewer;
+  return viewer;
 }
 
 /*!
-    Syncronizes visual state of this viewport with 'ref'
-    ( scale, projection, eye etc ) Returns 'true' if copied OK,
-    'false' otherwise. [ virtual public ]
+  Syncronizes visual state of this viewport with 'ref'
+  ( scale, projection, eye etc ) Returns 'true' if copied OK,
+  'false' otherwise. [ virtual public ]
 */
 bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
 {
@@ -186,11 +186,11 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
   Handle(V3d_View) tgtView = getView();
 
   /* Syncronize view types */
-/*    if ( tgtView->Type() != refView->Type() )
-  {
-      setActive( refView->Type() );
-      tgtView = getView();
-  }*/
+  /*    if ( tgtView->Type() != refView->Type() )
+       {
+       setActive( refView->Type() );
+       tgtView = getView();
+       }*/
 
   /*  The following params are copied:
       - view type( ortho/persp )
@@ -208,7 +208,7 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
 
   /* perspective */
   if ( refView->Type() == V3d_PERSPECTIVE )
-      tgtView->SetFocale( refView->Focale() );
+    tgtView->SetFocale( refView->Focale() );
 
   /* copy params */
   Standard_Real x, y, z;
@@ -227,7 +227,7 @@ bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
 }
 
 /*!
-    Returns Z-size of this view. [ public ]
+  Returns Z-size of this view. [ public ]
 */
 double OCCViewer_ViewPort3d::getZSize() const
 {
@@ -237,46 +237,44 @@ double OCCViewer_ViewPort3d::getZSize() const
 }
 
 /*!
-    Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
+  Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
 */
 void OCCViewer_ViewPort3d::setZSize( double zsize )
 {
   myActiveView->SetZSize( zsize );
-/*    if ( !myOrthoView.IsNull() )
+  /*    if ( !myOrthoView.IsNull() )
         myOrthoView->SetZSize( zsize );
-    if ( !myPerspView.IsNull() )
+       if ( !myPerspView.IsNull() )
         myPerspView->SetZSize( zsize );*/
 }
 
 /*!
-    Returns the background color [ virtual public ]
+  Returns the background color [ virtual public ]
 */
 QColor OCCViewer_ViewPort3d::backgroundColor() const
 {
-       if ( !activeView().IsNull() )
-       {
-               Standard_Real aRed, aGreen, aBlue;
-               activeView()->BackgroundColor( Quantity_TOC_RGB, aRed, aGreen, aBlue );
-               int red = (int) (aRed * 255);
-               int green = (int) (aGreen * 255);
-               int blue = (int) (aBlue * 255);
-               return QColor( red, green, blue );
-       }
-       return OCCViewer_ViewPort::backgroundColor();
+  if ( !activeView().IsNull() ) {
+    Standard_Real aRed, aGreen, aBlue;
+    activeView()->BackgroundColor( Quantity_TOC_RGB, aRed, aGreen, aBlue );
+    int red = (int) (aRed * 255);
+    int green = (int) (aGreen * 255);
+    int blue = (int) (aBlue * 255);
+    return QColor( red, green, blue );
+  }
+  return OCCViewer_ViewPort::backgroundColor();
 }
 
 /*!
-    Sets the background color [ virtual public ]
+  Sets the background color [ virtual public ]
 */
 void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
 {
-       if ( !activeView().IsNull() )
-       {
-         activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255.,
-                                           color.green()/255., color.blue()/255.);
-         activeView()->Update();
-         emit vpChangeBGColor( color );
-       }
+  if ( !activeView().IsNull() ) {
+    activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255.,
+                                     color.green()/255., color.blue()/255.);
+    activeView()->Update();
+    emit vpChangeBGColor( color );
+  }
 }
 
 /*!
@@ -285,15 +283,14 @@ void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
 */
 void OCCViewer_ViewPort3d::setAnimationMode(bool theDegenerated)
 {
-       if ( !activeView().IsNull() )
-       {
+  if ( !activeView().IsNull() ) {
     myAnimate = theDegenerated;
     activeView()->SetAnimationMode(true, theDegenerated);
   }
 }
 
 /*!
-    Updates the active viewport. [ virtual public ]
+  Updates the active viewport. [ virtual public ]
 */
 void OCCViewer_ViewPort3d::onUpdate()
 {
@@ -302,16 +299,16 @@ void OCCViewer_ViewPort3d::onUpdate()
 }
 
 /*!
-    Called at 'window fit' transformation. [ virtual protected ]
+  Called at 'window fit' transformation. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
 {
-       if ( !activeView().IsNull() )
-         activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
+  if ( !activeView().IsNull() )
+    activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
 }
 
 /*!
-    Called at 'zoom' transformation. [ virtual protected ]
+  Called at 'zoom' transformation. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
 {
@@ -324,74 +321,73 @@ void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
 }
 
 /*!
-    Centers the viewport. [ virtual protected ]
+  Centers the viewport. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::setCenter( int x, int y )
 {
-       if ( !activeView().IsNull() )
-           activeView()->Place( x, y, myScale );
+  if ( !activeView().IsNull() )
+    activeView()->Place( x, y, myScale );
 }
 
 /*!
-    Called at 'pan' transformation. [ virtual protected ]
+  Called at 'pan' transformation. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::pan( int dx, int dy )
 {
-       if ( !activeView().IsNull() )
-        activeView()->Pan( dx, dy, 1.0 );
+  if ( !activeView().IsNull() )
+    activeView()->Pan( dx, dy, 1.0 );
 }
 
 /*!
-    Inits 'rotation' transformation. [ protected ]
+  Inits 'rotation' transformation. [ protected ]
 */
 void OCCViewer_ViewPort3d::startRotation( int x, int y, 
                                          int theRotationPointType,
                                          const gp_Pnt& theSelectedPoint )
 {
-  if ( !activeView().IsNull() )
-    {
-      myDegenerated = activeView()->DegenerateModeIsOn();
-      activeView()->SetDegenerateModeOn();
-      if (myAnimate) activeView()->SetAnimationModeOn();
-
-      //double gx, gy, gz;
-      //double gx = activeView()->gx;
-      //activeView()->Gravity(gx,gy,gz);
-
-      switch ( theRotationPointType ) {
-      case OCCViewer_ViewWindow::GRAVITY:
-       activeView()->StartRotation( x, y, 0.45 );
-       break;
-      case OCCViewer_ViewWindow::SELECTED:
-       sx = x; sy = y;
-       
-       double X,Y;
-       activeView()->Size(X,Y);
-       rx = Standard_Real(activeView()->Convert(X)); 
-       ry = Standard_Real(activeView()->Convert(Y)); 
-       
-       activeView()->Rotate( 0., 0., 0., 
-                             theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(), 
-                             Standard_True );
-       
-       Quantity_Ratio zRotationThreshold;
-       zRotation = Standard_False;
-       zRotationThreshold = 0.45;
-       if( zRotationThreshold > 0. ) {
-         Standard_Real dx = Abs(sx - rx/2.);
-         Standard_Real dy = Abs(sy - ry/2.);
-         Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
-         if( dx > dd || dy > dd ) zRotation = Standard_True;
-       }
-       break;
-      default:
-       break;
+  if ( !activeView().IsNull() ) {
+    myDegenerated = activeView()->DegenerateModeIsOn();
+    activeView()->SetDegenerateModeOn();
+    if (myAnimate) activeView()->SetAnimationModeOn();
+    
+    //double gx, gy, gz;
+    //double gx = activeView()->gx;
+    //activeView()->Gravity(gx,gy,gz);
+    
+    switch ( theRotationPointType ) {
+    case OCCViewer_ViewWindow::GRAVITY:
+      activeView()->StartRotation( x, y, 0.45 );
+      break;
+    case OCCViewer_ViewWindow::SELECTED:
+      sx = x; sy = y;
+      
+      double X,Y;
+      activeView()->Size(X,Y);
+      rx = Standard_Real(activeView()->Convert(X)); 
+      ry = Standard_Real(activeView()->Convert(Y)); 
+      
+      activeView()->Rotate( 0., 0., 0., 
+                           theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(), 
+                           Standard_True );
+      
+      Quantity_Ratio zRotationThreshold;
+      zRotation = Standard_False;
+      zRotationThreshold = 0.45;
+      if( zRotationThreshold > 0. ) {
+       Standard_Real dx = Abs(sx - rx/2.);
+       Standard_Real dy = Abs(sy - ry/2.);
+       Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
+       if( dx > dd || dy > dd ) zRotation = Standard_True;
       }
+      break;
+    default:
+      break;
     }
+  }
 }
 
 /*!
-    Rotates the viewport. [ protected ]
+  Rotates the viewport. [ protected ]
 */
 void OCCViewer_ViewPort3d::rotate( int x, int y, 
                                   int theRotationPointType,
@@ -427,66 +423,63 @@ void OCCViewer_ViewPort3d::rotate( int x, int y,
 }
 
 /*!
-    Resets the viewport after 'rotation'. [ protected ]
+  Resets the viewport after 'rotation'. [ protected ]
 */
 void OCCViewer_ViewPort3d::endRotation()
 {
-  if ( !activeView().IsNull() )
-    {
-      if (myAnimate) activeView()->SetAnimationModeOff();
-      if ( !myDegenerated )
-       activeView()->SetDegenerateModeOff();
-      activeView()->ZFitAll(1.);
-      activeView()->SetZSize(0.);
-      activeView()->Update();
-    }
+  if ( !activeView().IsNull() ) {
+    if (myAnimate) activeView()->SetAnimationModeOff();
+    if ( !myDegenerated )
+      activeView()->SetDegenerateModeOff();
+    activeView()->ZFitAll(1.);
+    activeView()->SetZSize(0.);
+    activeView()->Update();
+  }
 }
 
 /*!
-    Repaints the viewport. [ virtual protected ]
+  Repaints the viewport. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
 {
 #ifndef WNT
-       /* X11 : map before show doesn't work */
-       if ( !mapped( activeView() ) )
-       mapView( activeView() );
+  /* X11 : map before show doesn't work */
+  if ( !mapped( activeView() ) )
+    mapView( activeView() );
 #endif
-       if ( !myWindow.IsNull() )
-       {
-               QApplication::syncX();
-               QRect rc = e->rect();
-               if ( !myPaintersRedrawing )
-                   activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
-       }
-       OCCViewer_ViewPort::paintEvent( e );
-       myBusy = false;
+  if ( !myWindow.IsNull() ) {
+    QApplication::syncX();
+    QRect rc = e->rect();
+    if ( !myPaintersRedrawing )
+      activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
+  }
+  OCCViewer_ViewPort::paintEvent( e );
+  myBusy = false;
 }
 
 /*!
-    Resizes the viewport. [ virtual protected ]
+  Resizes the viewport. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
 {
 #ifdef WNT
-       /* Win32 : map before first show to avoid flicker */
-       if ( !mapped( activeView() ) )
-           mapView( activeView() );
+  /* Win32 : map before first show to avoid flicker */
+  if ( !mapped( activeView() ) )
+    mapView( activeView() );
 #endif
-       QApplication::syncX();
-    if ( !activeView().IsNull() )
-        activeView()->MustBeResized();
+  QApplication::syncX();
+  if ( !activeView().IsNull() )
+    activeView()->MustBeResized();
 }
 
 /*!
-    Fits all objects in view. [ virtual protected ]
+  Fits all objects in view. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
 {
   if ( activeView().IsNull() )
     return;
 
-
   if ( keepScale )
     myScale = activeView()->Scale();
 
@@ -496,59 +489,68 @@ void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
 }
 
 /*!
-    Resets the view. [ virtual protected ]
+  Resets the view. [ virtual protected ]
 */
 void OCCViewer_ViewPort3d::reset()
 {
-//  double zsize = getZSize();
-       if ( !activeView().IsNull() )
-        activeView()->Reset();
-//    setZSize( zsize );
+  //  double zsize = getZSize();
+  if ( !activeView().IsNull() )
+    activeView()->Reset();
+  //    setZSize( zsize );
 }
 
 /*!
-    Passed the handle of native window of the component to CASCADE view. [ private ]
+  Passed the handle of native window of the component to CASCADE view. [ private ]
 */
 bool OCCViewer_ViewPort3d::setWindow( const Handle(V3d_View)& view )
 {
-       if ( !myWindow.IsNull() )
-               return true;
-
-       if ( view.IsNull() )
-               return false;
-
-       int hwnd = (int)winId();
-       if ( !hwnd )
-        return false;
-
-       /* set this widget as the drawing window */
-       short lo = (short)hwnd;
-       short hi = (short)( hwnd >> 16 );
-       OCCViewer_VService::SetWindow( view, (int)hi, (int)lo, Xw_WQ_SAMEQUALITY );
-       myWindow = view->Window();
-       return !myWindow.IsNull();
+  if ( !myWindow.IsNull() )
+    return true;
+
+  if ( view.IsNull() )
+    return false;
+
+  int hwnd = (int)winId();
+  if ( !hwnd )
+    return false;
+
+  /* set this widget as the drawing window */
+  short lo = (short)hwnd;
+  short hi = (short)( hwnd >> 16 );
+
+  attachWindow( view, OCCViewer_VService::CreateWindow( view, (int)hi, (int)lo, Xw_WQ_SAMEQUALITY ) );
+
+  myWindow = view->Window();
+  return !myWindow.IsNull();
+}
+
+void OCCViewer_ViewPort3d::attachWindow( const Handle(V3d_View)& view, 
+                                         const Handle(Aspect_Window)& window)
+{
+  if (!view.IsNull())
+    view->SetWindow( window );
 }
 
 /*!
-       Returns the current active view. [ private ]
+  Returns the current active view. [ private ]
 */
 Handle(V3d_View) OCCViewer_ViewPort3d::activeView() const
 {
-       return myActiveView;
+  return myActiveView;
 }
 
 /*!
-       Returns the current inactive view [ private ]
+  Returns the current inactive view [ private ]
 */
 /*Handle(V3d_View) OCCViewer_ViewPort3d::inactiveView() const
-{
-       return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
-}*/
+  {
+  return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
+  }*/
 
 /*!
-       Returns 'true' if the given view is mapped to window. [ private ]
+  Returns 'true' if the given view is mapped to window. [ private ]
 */
 bool OCCViewer_ViewPort3d::mapped( const Handle(V3d_View)& view ) const
 {
-       return ( !view.IsNull() && view->View()->IsDefined() );
+  return ( !view.IsNull() && view->View()->IsDefined() );
 }
index efa011d4b5e408dcfd24ddf2ec86fbf17719213c..41d2c67440d80daeb94d4c3039634d0cd7349726 100755 (executable)
@@ -81,6 +81,9 @@ protected:
   virtual void         paintEvent( QPaintEvent* );
   virtual void          resizeEvent( QResizeEvent* );
 
+  // initialization
+  virtual void          attachWindow( const Handle(V3d_View)&, const Handle(Aspect_Window)& );
+
 private:
   Handle(V3d_View) activeView() const;
   Handle(V3d_View) inactiveView() const;
index f7e311ff2e437f7cb2b26d17718a85218439a83e..ea102e914998b28dce6bdb002b38d65d1eff1e5d 100755 (executable)
@@ -75,6 +75,8 @@ static QEvent* l_mbPressEvent = 0;
 # include <QWindowsStyle>
 #endif
 
+#include <GL/gl.h>
+
 const char* imageZoomCursor[] = {
 "32 32 3 1",
 ". c None",
@@ -1102,7 +1104,7 @@ void OCCViewer_ViewWindow::createActions()
 */
 void OCCViewer_ViewWindow::createToolBar()
 {
-  int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
 
   toolMgr()->append( DumpId, tid );
   if( myModel->trihedronActivated() ) 
@@ -1164,6 +1166,7 @@ void OCCViewer_ViewWindow::onFrontView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xpos);
   onViewFitAll();
+  emit vpTransformationFinished ( FRONTVIEW );
 }
 
 /*!
@@ -1175,6 +1178,7 @@ void OCCViewer_ViewWindow::onBackView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xneg);
   onViewFitAll();
+  emit vpTransformationFinished ( BACKVIEW );
 }
 
 /*!
@@ -1186,6 +1190,7 @@ void OCCViewer_ViewWindow::onTopView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zpos);
   onViewFitAll();
+  emit vpTransformationFinished ( TOPVIEW );
 }
 
 /*!
@@ -1197,6 +1202,7 @@ void OCCViewer_ViewWindow::onBottomView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zneg);
   onViewFitAll();
+  emit vpTransformationFinished ( BOTTOMVIEW );
 }
 
 /*!
@@ -1208,6 +1214,7 @@ void OCCViewer_ViewWindow::onLeftView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Yneg);
   onViewFitAll();
+  emit vpTransformationFinished ( LEFTVIEW );
 }
 
 /*!
@@ -1219,6 +1226,7 @@ void OCCViewer_ViewWindow::onRightView()
   Handle(V3d_View) aView3d = myViewPort->getView();
   if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Ypos);
   onViewFitAll();
+  emit vpTransformationFinished ( RIGHTVIEW );
 }
 
 /*!
@@ -1234,6 +1242,7 @@ void OCCViewer_ViewWindow::onResetView()
   myViewPort->fitAll( false, true, false );
   myViewPort->getView()->SetImmediateUpdate( upd );
   myViewPort->getView()->Update();
+  emit vpTransformationFinished( RESETVIEW );
 }
 
 /*!
@@ -1243,6 +1252,7 @@ void OCCViewer_ViewWindow::onFitAll()
 {
   emit vpTransformationStarted( FITALLVIEW );
   myViewPort->fitAll();
+  emit vpTransformationFinished( FITALLVIEW );
 }
 
 /*!
@@ -1419,8 +1429,25 @@ void OCCViewer_ViewWindow::onTrihedronShow()
 */
 QImage OCCViewer_ViewWindow::dumpView()
 {
-  QPixmap px = QPixmap::grabWindow( myViewPort->winId() );
-  return px.toImage();
+  Handle(V3d_View) view = myViewPort->getView();
+  if ( view.IsNull() )
+    return QImage();
+  QApplication::syncX();
+  view->Update();
+  view->Redraw();
+
+  unsigned char* data = new unsigned char[ (myViewPort->width()*myViewPort->height())*4 ];
+
+  QPoint p = myViewPort->mapFromParent(myViewPort->geometry().topLeft());
+
+  glReadPixels( p.x(), p.y(), myViewPort->width(), myViewPort->height(), GL_RGBA, GL_UNSIGNED_BYTE,
+                data);
+
+  QImage anImage( data, myViewPort->width(), myViewPort->height(), QImage::Format_ARGB32 );
+  anImage = anImage.mirrored();
+  anImage = anImage.rgbSwapped();
+  return anImage;
+
 }
 
 bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img, 
@@ -1433,9 +1460,9 @@ bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img,
   Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
 
   if (format == "PS")
-    a3dView->Export(qPrintable(fileName), Graphic3d_EF_PostScript);
+    a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript);
   else if (format == "EPS")
-    a3dView->Export(qPrintable(fileName), Graphic3d_EF_EnhPostScript);
+    a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript);
 
   return true;
 }
index 6fcdd26427612c1fb6fae3e3dce38fa7536eba1e..4f3dda2ca8365800bb0b6df37e41c112a02b5562 100755 (executable)
@@ -386,7 +386,7 @@ void Plot2d_ViewWindow::createActions()
 void Plot2d_ViewWindow::createToolBar()
 {
   QtxActionToolMgr* mgr = toolMgr();
-  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
   mgr->append( DumpId, myToolBar );
   mgr->append( ScaleOpId, myToolBar );
   mgr->append( MoveOpId, myToolBar );
index 0dfe60dc32ad44dfe7b994e1be6e4bc7696e0b84..fecaeb387245d6e9608ff9f778bb1856e136e9dc 100644 (file)
@@ -142,9 +142,16 @@ PyStdOut_write(PyStdOut *self, PyObject *args)
   return Py_None;
 }
 
+static PyObject*
+PyStdOut_flush(PyStdOut *self)
+{
+  Py_INCREF(Py_None);
+  return Py_None;
+}
+
 static PyMethodDef PyStdOut_methods[] = {
-  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
-    PyDoc_STR("write(string) -> None")},
+  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS, PyDoc_STR("write(string) -> None")},
+  {"flush",  (PyCFunction)PyStdOut_flush,  METH_NOARGS,  PyDoc_STR("flush() -> None")},
   {NULL,    NULL}   /* sentinel */
 };
 
index 774538fe0bf49ec861adb1d26836136d7d03c37e..f0b532fa2e1a79308c0134e72aa96884287791ec 100755 (executable)
@@ -814,7 +814,7 @@ void Qtx::scaleColors( const int num, QColorList& lst )
 /*!
   \brief Scale the pixmap to the required size.
 
-  If \h is 0 (default) the value of \a w is used instead (to create
+  If \h is 0 (default) the value of \a w is used instead (to create
   square pixmap).
 
   \param icon pixmap to be resized
@@ -1058,7 +1058,7 @@ QString Qtx::colorToString( const QColor& color )
   - "RR,GG,BB[,AA]" or "RR GG BB[ AA]" (\c RR, \c GG, \c BB
   and optional \c AA values represent red, green, blue and alpha
   components of the color in decimal form)
-  - #RRGGBB" - (\c RR, \c GG and \c BB values represent red, green and blue
+  - "#RRGGBB" - (\c RR, \c GG and \c BB values represent red, green and blue
   components of the color in hexadecimal form)
   - an integer value representing packed color components (see rgbSet())
   - a name from the list of colors defined in the list of SVG color keyword names
index 8f3b8804eb4af2b221e72503c9dee68fbb8e7a42..45a28aa048cc2d1f8b37ea8e2283efea40705916 100644 (file)
@@ -99,6 +99,12 @@ QMainWindow* QtxActionToolMgr::mainWindow() const
   \return id of created/found toolbar
 */
 int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw )
+{
+  return createToolBar( title, true, Qt::AllToolBarAreas, tid, mw );
+}
+
+int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::ToolBarAreas dockAreas, 
+                                    int tid, QMainWindow* mw )
 {
   static int _toolBarId = -1;
 
@@ -124,6 +130,9 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW
   if ( !tb )
   {
     tb = new QtxToolBar( true, tbw );
+    tb->setFloatable( floatable );
+    tb->setAllowedAreas( dockAreas );
+    tb->setMovable( dockAreas & Qt::AllToolBarAreas );
     //mainWindow()->addToolBar( tb );
     tb->setWindowTitle( title );
     tb->setObjectName( title );
index dd6b19cf4ebc9c6cc63ff93155e3d1df6d442c94..5f81e6e21abc54aeb67cb13ed690c630c5bb2b47 100644 (file)
@@ -65,6 +65,8 @@ public:
   QMainWindow*    mainWindow() const;
 
   int             createToolBar( const QString&, int = -1, QMainWindow* = 0 );
+  int             createToolBar( const QString&, bool, Qt::ToolBarAreas = Qt::AllToolBarAreas, 
+                                int = -1, QMainWindow* = 0 );
   void            removeToolBar( const QString& );
   void            removeToolBar( const int );
 
index fcb52318d679a744fe383fc84c3c118d5c23b375..a14b2fd40fab4b3d0b375e2b109bf4c974395a3d 100644 (file)
@@ -377,7 +377,7 @@ QSize QtxDockWidget::sizeHint() const
 {
   QSize sz = QDockWidget::sizeHint();
 
-  printf( "----------------> QtxDockWidget::sizeHint()\n" );
+  // printf( "----------------> QtxDockWidget::sizeHint()\n" );
 
   return QSize( 500, 100 );
 
index 4d333f8845fb07f84a516213a8de93f6289fa47a..35c84807d80425a24cbb20f7e56af43e8b92a777 100644 (file)
@@ -45,6 +45,8 @@
 #include <QDateTimeEdit>
 #include <QStackedWidget>
 
+#include <stdio.h>
+
 /*!
   \class QtxPagePrefMgr
   \brief GUI implementation of the QtxPreferenceMgr class: preferences manager.
@@ -2296,7 +2298,7 @@ void QtxPagePrefSelectItem::setInputType( const int type )
 /*!
   \brief Get the list of the values from the selection widget.
   \return list of values
-  \sa numbers(), setStrings()
+  \sa numbers(), icons(), setStrings()
 */
 QStringList QtxPagePrefSelectItem::strings() const
 {
@@ -2309,7 +2311,7 @@ QStringList QtxPagePrefSelectItem::strings() const
 /*!
   \brief Get the list of the values identifiers from the selection widget.
   \return list of values IDs
-  \sa strings(), setNumbers()
+  \sa strings(), icons(), setNumbers()
 */
 QList<int> QtxPagePrefSelectItem::numbers() const
 {
@@ -2322,10 +2324,23 @@ QList<int> QtxPagePrefSelectItem::numbers() const
   return res;
 }
 
+/*!
+  \brief Get the list of the icons associated with the selection widget.items
+  \return list of icons
+  \sa strings(), numbers(), setIcons()
+*/
+QList<QIcon> QtxPagePrefSelectItem::icons() const
+{
+  QList<QIcon> res;
+  for ( uint i = 0; i < mySelector->count(); i++ )
+    res.append( mySelector->itemIcon( i ) );
+  return res;
+}
+
 /*!
   \brief Set the list of the values to the selection widget.
   \param lst new list of values
-  \sa strings(), setNumbers()
+  \sa strings(), setNumbers(), setIcons()
 */
 void QtxPagePrefSelectItem::setStrings( const QStringList& lst )
 {
@@ -2334,15 +2349,34 @@ void QtxPagePrefSelectItem::setStrings( const QStringList& lst )
 }
 
 /*!
-  \brief Set the list of the values identifiers to the selection widget.
+  \brief Set the list of the values identifiers to the selection widget
   \param ids new list of values IDs
-  \sa numbers(), setStrings()
+  \sa numbers(), setStrings(), setIcons()
 */
 void QtxPagePrefSelectItem::setNumbers( const QList<int>& ids )
 {
   uint i = 0;
-  for ( QList<int>::const_iterator it = ids.begin(); it != ids.end() && i < mySelector->count(); ++it, i++ )
+  for ( QList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it, i++ ) {
+    if ( i >= mySelector->count() )
+      mySelector->addItem(QString("") );
+    
     mySelector->setId( i, *it );
+  }
+}
+
+/*!
+  \brief Set the list of the icons to the selection widget items
+
+  Important: call this method after setStrings() or setNumbers()
+
+  \param icns new list of icons
+  \sa icons(), setStrings(), setNumbers()
+*/
+void QtxPagePrefSelectItem::setIcons( const QList<QIcon>& icns )
+{
+  uint i = 0;
+  for ( QList<QIcon>::const_iterator it = icns.begin(); it != icns.end() && i < mySelector->count(); ++it, i++ )
+    mySelector->setItemIcon( i, *it );
 }
 
 /*!
@@ -2422,6 +2456,14 @@ QVariant QtxPagePrefSelectItem::optionValue( const QString& name ) const
       lst.append( *it );
     return lst;
   }
+  else if ( name == "icons" || name == "pixmaps" )
+  {
+    QList<QVariant> lst;
+    QList<QIcon> ics = icons();
+    for ( QList<QIcon>::const_iterator it = ics.begin(); it != ics.end(); ++it )
+      lst.append( *it );
+    return lst;
+  }
   else
     return QtxPageNamedPrefItem::optionValue( name );
 }
@@ -2443,6 +2485,8 @@ void QtxPagePrefSelectItem::setOptionValue( const QString& name, const QVariant&
     setStrings( val );
   else if ( name == "numbers" || name == "ids" || name == "indexes" )
     setNumbers( val );
+  else if ( name == "icons" || name == "pixmaps" )
+    setIcons( val );
   else
     QtxPageNamedPrefItem::setOptionValue( name, val );
 }
@@ -2480,6 +2524,30 @@ void QtxPagePrefSelectItem::setNumbers( const QVariant& var )
   setNumbers( lst );
 }
 
+/*!
+  \brief Set the list of the icons from the resource manager.
+  \param var new icons list
+  \internal
+*/
+void QtxPagePrefSelectItem::setIcons( const QVariant& var )
+{
+  if ( var.type() != QVariant::List )
+    return;
+
+  QList<QIcon> lst;
+  QList<QVariant> varList = var.toList();
+  for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it )
+  {
+    if ( (*it).canConvert<QIcon>() )
+      lst.append( (*it).value<QIcon>() );
+    else if ( (*it).canConvert<QPixmap>() )
+      lst.append( (*it).value<QPixmap>() );
+    else
+      lst.append( QIcon() );
+  }
+  setIcons( lst );
+}
+
 /*!
   \brief Update selector widget.
 */
index 28fada6dcfce56f518b5659f5c2b6b287d0c0c9b..f853ba6acfe8c2dfbade6d8b1d72f0e578683ee7 100644 (file)
@@ -33,6 +33,7 @@
 #include <QFrame>
 #include <QLabel>
 #include <QPointer>
+#include <QIcon>
 
 class QtxGridBox;
 class QtxFontEdit;
@@ -434,9 +435,11 @@ public:
 
   QStringList      strings() const;
   QList<int>       numbers() const;
+  QList<QIcon>     icons() const;
 
   void             setStrings( const QStringList& );
   void             setNumbers( const QList<int>& );
+  void             setIcons( const QList<QIcon>& );
 
   virtual void     store();
   virtual void     retrieve();
@@ -449,6 +452,7 @@ private:
   void             updateSelector();
   void             setStrings( const QVariant& );
   void             setNumbers( const QVariant& );
+  void             setIcons( const QVariant& );
 
 private:
   int              myType;
index e32a29aae24d7fae4a6032102565bb78e251ddbb..f3610af520b02ef1b119ef2e8a91a58580174f53 100644 (file)
@@ -24,6 +24,7 @@
 //
 #include "QtxSplash.h"
 #include "QtxResourceMgr.h"
+#include <cstdio>
 
 #include <QApplication>
 #include <QPainter>
index 0e1435cd8cc36dbd50f10e9f8f5868549f9fbf10..28d7d71d458afa966832fab96baf434df8d45eb2 100644 (file)
@@ -161,7 +161,7 @@ void QxScene_ViewWindow::createToolBar()
 {
   DEBTRACE("QxScene_ViewWindow::createToolBar");
   QtxActionToolMgr* mgr = toolMgr();
-  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
   mgr->append( ScaleOpId, myToolBar );
   mgr->append( MoveOpId, myToolBar );
   mgr->append( ResetId, myToolBar );
index 42e24296b5af8ab2bf05f1724e31939b16d85bee..80da8eb31a42d682843e1dbcd33d5da37f84aa0c 100644 (file)
@@ -157,8 +157,8 @@ void SALOME_PYQT_Module::getEngineIOR()
   if ( !myInterp || !myModule )
     return;
 
-  if ( PyObject_HasAttrString( myModule->get() , "engineIOR" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"engineIOR", (char*)"" ) );
+  if ( PyObject_HasAttrString( myModule , "engineIOR" ) ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"engineIOR", (char*)"" ) );
     if ( !res ) {
       PyErr_Print();
     }
index 735f705f460f09eecb44ad4a5ed25d2777fd512a..8c278a4bc0580aeae07ac2d204463c79d60b76cb 100644 (file)
@@ -63,7 +63,6 @@
 #include <QMenu>
 #include <QAction>
 
-
 #include "sipAPISalomePyQtGUILight.h"
 
 #include <sip.h>
@@ -283,9 +282,9 @@ SALOME_PYQT_ModuleLight::~SALOME_PYQT_ModuleLight()
 {
   if ( myXmlHandler )
     delete myXmlHandler;
-  if ( myInterp ) {
+  if ( myInterp && myModule ) {
     PyLockWrapper aLock = myInterp->GetLockWrapper();
-    delete myModule;
+    Py_XDECREF(myModule);
   }
 }
 
@@ -866,8 +865,8 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app )
   PyLockWrapper aLock = myInterp->GetLockWrapper();
   // ... (the Python module is already imported)
   // ... finally call Python module's initialize() method
-  if ( PyObject_HasAttrString( myModule->get(), "initialize" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"initialize", (char*)"" ) );
+  if ( PyObject_HasAttrString( myModule, "initialize" ) ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"initialize", (char*)"" ) );
     if ( !res ) {
       PyErr_Print();
     }
@@ -880,8 +879,8 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app )
   myWindowsMap.insert( LightApp_Application::WT_PyConsole,     Qt::BottomDockWidgetArea );
   myWindowsMap.insert( LightApp_Application::WT_LogWindow,     Qt::BottomDockWidgetArea );
 
-  if ( PyObject_HasAttrString( myModule->get() , "windows" ) ) {
-    PyObjWrapper res1( PyObject_CallMethod( myModule->get(), (char*)"windows", (char*)"" ) );
+  if ( PyObject_HasAttrString( myModule , "windows" ) ) {
+    PyObjWrapper res1( PyObject_CallMethod( myModule, (char*)"windows", (char*)"" ) );
     if ( !res1 ) {
       PyErr_Print();
     }
@@ -907,8 +906,8 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app )
 
   // get compatible view windows types from the Python module 
   // by calling views() method
-  if ( PyObject_HasAttrString( myModule->get() , "views" ) ) {
-    PyObjWrapper res2( PyObject_CallMethod( myModule->get(), (char*)"views", (char*)"" ) );
+  if ( PyObject_HasAttrString( myModule , "views" ) ) {
+    PyObjWrapper res2( PyObject_CallMethod( myModule, (char*)"views", (char*)"" ) );
     if ( !res2 ) {
       PyErr_Print();
     }
@@ -954,20 +953,24 @@ void SALOME_PYQT_ModuleLight::activate( SUIT_Study* theStudy )
 
   // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
   initInterp( aStudyId );
-  if ( !myInterp )
+  if ( !myInterp ) {
+    myLastActivateStatus = false;
     return; // Error
+  }
 
   // import Python GUI module
   importModule();
-  if ( !myModule )
+  if ( !myModule ) {
+    myLastActivateStatus = false;
     return; // Error
+  }
 
   // get python lock
   PyLockWrapper aLock = myInterp->GetLockWrapper();
 
   // call Python module's activate() method (for the new modules)
-  if ( PyObject_HasAttrString( myModule->get() , "activate" ) ) {
-    PyObject* res1 = PyObject_CallMethod( myModule->get(), (char*)"activate", (char*)"" );
+  if ( PyObject_HasAttrString( myModule , "activate" ) ) {
+    PyObject* res1 = PyObject_CallMethod( myModule, (char*)"activate", (char*)"" );
     if ( !res1 || !PyBool_Check( res1 ) ) {
       PyErr_Print();
       // always true for old modules (no return value)
@@ -1039,8 +1042,8 @@ void SALOME_PYQT_ModuleLight::customize( SUIT_Study* theStudy )
 
   if ( IsCallOldMethods ) {
     // call Python module's setSettings() method (obsolete)
-    if ( PyObject_HasAttrString( myModule->get() , "setSettings" ) ) {
-      PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"setSettings", (char*)"" ) );
+    if ( PyObject_HasAttrString( myModule , "setSettings" ) ) {
+      PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"setSettings", (char*)"" ) );
       if( !res ) {
         PyErr_Print();
       }
@@ -1066,8 +1069,8 @@ void SALOME_PYQT_ModuleLight::deactivate( SUIT_Study* theStudy )
     return;
   }
   // then call Python module's deactivate() method
-  if ( PyObject_HasAttrString( myModule->get() , "deactivate" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"deactivate", (char*)"" ) );
+  if ( PyObject_HasAttrString( myModule , "deactivate" ) ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"deactivate", (char*)"" ) );
     if( !res ) {
       PyErr_Print();
     }
@@ -1120,8 +1123,8 @@ void SALOME_PYQT_ModuleLight::studyChanged( SUIT_Study* theStudy )
   PyLockWrapper aLock = myInterp->GetLockWrapper();
 
   // call Python module's activeStudyChanged() method
-  if ( PyObject_HasAttrString( myModule->get(), "activeStudyChanged" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"activeStudyChanged", (char*)"i", aStudyId ) );
+  if ( PyObject_HasAttrString( myModule, "activeStudyChanged" ) ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"activeStudyChanged", (char*)"i", aStudyId ) );
     if( !res ) {
       PyErr_Print();
     }
@@ -1154,10 +1157,10 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the
 
   QString aContext( "" ), aObject( "" ), aParent( theContext );
 
-  if ( IsCallOldMethods && PyObject_HasAttrString( myModule->get(), "definePopup" ) ) {
+  if ( IsCallOldMethods && PyObject_HasAttrString( myModule, "definePopup" ) ) {
     // call definePopup() Python module's function
     // this is obsolete function, used only for compatibility reasons
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(),
+    PyObjWrapper res( PyObject_CallMethod( myModule,
                                           (char*)"definePopup",
                                           (char*)"sss",
                                           theContext.toLatin1().constData(),
@@ -1182,11 +1185,15 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the
   if ( myXmlHandler )
     myXmlHandler->createPopup( thePopupMenu, aContext, aParent, aObject );
 
-  PyObjWrapper sipPopup( sipBuildResult( 0, "M", thePopupMenu, sipClass_QMenu ) );
+#if SIP_VERSION < 0x040800
+  PyObjWrapper sipPopup( sipBuildResult( 0, "M", thePopupMenu, sipClass_QMenu) );
+#else
+  PyObjWrapper sipPopup( sipBuildResult( 0, "D", thePopupMenu, sipType_QMenu, NULL) );
+#endif
 
   // then call Python module's createPopupMenu() method (for new modules)
-  if ( PyObject_HasAttrString( myModule->get(), "createPopupMenu" ) ) {
-    PyObjWrapper res1( PyObject_CallMethod( myModule->get(),
+  if ( PyObject_HasAttrString( myModule, "createPopupMenu" ) ) {
+    PyObjWrapper res1( PyObject_CallMethod( myModule,
                                            (char*)"createPopupMenu",
                                            (char*)"Os",
                                            sipPopup.get(),
@@ -1196,10 +1203,10 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the
     }
   }
 
-  if ( IsCallOldMethods && PyObject_HasAttrString( myModule->get(), "customPopup" ) ) {
+  if ( IsCallOldMethods && PyObject_HasAttrString( myModule, "customPopup" ) ) {
     // call customPopup() Python module's function
     // this is obsolete function, used only for compatibility reasons
-    PyObjWrapper res2( PyObject_CallMethod( myModule->get(),
+    PyObjWrapper res2( PyObject_CallMethod( myModule,
                                            (char*)"customPopup",
                                            (char*)"Osss",
                                            sipPopup.get(),
@@ -1229,8 +1236,8 @@ void SALOME_PYQT_ModuleLight::guiEvent( const int theId )
   if ( !myInterp || !myModule )
     return;
 
-  if ( PyObject_HasAttrString( myModule->get(), "OnGUIEvent" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"OnGUIEvent", (char*)"i", theId ) );
+  if ( PyObject_HasAttrString( myModule, "OnGUIEvent" ) ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"OnGUIEvent", (char*)"i", theId ) );
     if( !res ) {
       PyErr_Print();
     }
@@ -1256,8 +1263,8 @@ void SALOME_PYQT_ModuleLight::initPreferences()
   // might be called during the module intialization process
   myInitModule = this;
 
-  if ( PyObject_HasAttrString( myModule->get(), "createPreferences" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"createPreferences", (char*)"" ) );
+  if ( PyObject_HasAttrString( myModule, "createPreferences" ) ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"createPreferences", (char*)"" ) );
     if( !res ) {
       PyErr_Print();
     }
@@ -1339,7 +1346,11 @@ void SALOME_PYQT_ModuleLight::importModule()
   PyLockWrapper aLock = myInterp->GetLockWrapper();
   // ... then import a module
   QString aMod = name() + "GUI";
-  myModule = new PyObjWrapper( PyImport_ImportModule( aMod.toLatin1().data() ) );
+  try {
+    myModule = PyImport_ImportModule( aMod.toLatin1().data() );
+  }
+  catch (...) {
+  }
   if( !myModule ) {
     // Error!
     PyErr_Print();
@@ -1390,10 +1401,14 @@ void SALOME_PYQT_ModuleLight::setWorkSpace()
       if ( aDesktop )
         aWorkspace = aDesktop->workstack();
     }
-    PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget ) );
+#if SIP_VERSION < 0x040800
+    PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget) );
+#else
+    PyObjWrapper pyws( sipBuildResult( 0, "D", aWorkspace, sipType_QWidget , NULL) );
+#endif
     // ... and finally call Python module's setWorkspace() method (obsolete)
-    if ( PyObject_HasAttrString( myModule->get(), "setWorkSpace" ) ) {
-      PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"setWorkSpace", (char*)"O", pyws.get() ) );
+    if ( PyObject_HasAttrString( myModule, "setWorkSpace" ) ) {
+      PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"setWorkSpace", (char*)"O", pyws.get() ) );
       if( !res ) {
         PyErr_Print();
       }
@@ -1419,8 +1434,8 @@ void SALOME_PYQT_ModuleLight::prefChanged( const QString& section, const QString
   if ( !myInterp || !myModule )
     return;
 
-  if ( PyObject_HasAttrString( myModule->get(), "preferenceChanged" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(),
+  if ( PyObject_HasAttrString( myModule, "preferenceChanged" ) ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule,
                                           (char*)"preferenceChanged", 
                                           (char*)"ss", 
                                           section.toLatin1().constData(), 
@@ -1817,12 +1832,12 @@ void SALOME_PYQT_ModuleLight::activeViewChanged( const SUIT_ViewWindow* pview )
   
   connectView( pview );
 
-  if ( PyObject_HasAttrString( myModule->get(), "activeViewChanged" ) ) 
+  if ( PyObject_HasAttrString( myModule, "activeViewChanged" ) ) 
   {
     if ( !pview ) 
       return;   
 
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"activeViewChanged", (char*)"i" , pview->getId() ) );
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"activeViewChanged", (char*)"i" , pview->getId() ) );
     if( !res )
       PyErr_Print();
   }
@@ -1864,9 +1879,9 @@ void SALOME_PYQT_ModuleLight::viewCloned( const SUIT_ViewWindow* pview )
   if ( !myInterp || !myModule || !pview ) 
     return;  
 
-  if ( PyObject_HasAttrString( myModule->get(), "viewCloned" ) ) 
+  if ( PyObject_HasAttrString( myModule, "viewCloned" ) ) 
   {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"viewCloned", (char*)"i", pview->getId() ) );
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"viewCloned", (char*)"i", pview->getId() ) );
     if( !res )
       PyErr_Print();
   }
@@ -1908,9 +1923,9 @@ void SALOME_PYQT_ModuleLight::viewClosed( const SUIT_ViewWindow* pview )
   if ( !myInterp || !myModule ) 
     return;  
 
-  if ( PyObject_HasAttrString( myModule->get(), "viewClosed" ) ) 
+  if ( PyObject_HasAttrString( myModule, "viewClosed" ) ) 
   {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"viewClosed", (char*)"i", pview->getId() ) );
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"viewClosed", (char*)"i", pview->getId() ) );
     if ( !res )
     {
       PyErr_Print();
@@ -2376,8 +2391,8 @@ void SALOME_PYQT_ModuleLight::saveEvent(QStringList& theListOfFiles)
   if ( !myInterp || !myModule || (it == theListOfFiles.end()))
     return;
 
-  if ( PyObject_HasAttrString(myModule->get(), "saveFiles") ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"saveFiles",
+  if ( PyObject_HasAttrString(myModule, "saveFiles") ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"saveFiles",
                                           (char*)"s", (*it).toLatin1().constData()));
     if( !res ) {
       PyErr_Print();
@@ -2453,10 +2468,13 @@ void SALOME_PYQT_ModuleLight::openEvent(QStringList theListOfFiles, bool &opened
     return;
   QStringList* theList = new QStringList(theListOfFiles);
 
-  PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList ) );
-  
-  if ( PyObject_HasAttrString(myModule->get() , "openFiles") ) {
-    PyObjWrapper res( PyObject_CallMethod( myModule->get(), (char*)"openFiles",
+#if SIP_VERSION < 0x040800
+  PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList) );
+#else
+  PyObjWrapper sipList( sipBuildResult( 0, "D", theList,  sipType_QStringList , NULL) );
+#endif
+  if ( PyObject_HasAttrString(myModule , "openFiles") ) {
+    PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"openFiles",
                                           (char*)"O", sipList.get()));
     if( !res || !PyBool_Check( res )) {
       PyErr_Print();
index f9066c64075f2a158f42e0242bab4ffd3925a876..44c4a71e223e0c75e9afea7e0ac8ac1b38dab23e 100644 (file)
@@ -63,9 +63,9 @@ private:
   bool                       myLastActivateStatus; //!< latest module activation status
 
 protected:
-  PyObjWrapper*                   myModule;     //!< Python GUI module
-  PyInterp_Interp*                myInterp;     //!< current Python subinterpreter
-  static InterpMap                myInterpMap;  //!< study to Python subinterpreter map
+  PyObject*                  myModule;     //!< Python GUI module
+  PyInterp_Interp*           myInterp;     //!< current Python subinterpreter
+  static InterpMap           myInterpMap;  //!< study to Python subinterpreter map
 
 public:
   SALOME_PYQT_ModuleLight();
index 63fafd04695bd7c052e6744fb6101faa7f08746e..d340da560ab59131d8492d56faca36e3cbb86e44 100755 (executable)
 #  Module : SALOME
 #
 import libSalomePy
-ren=libSalomePy.renderer
-#iren=libSalomePy.interactor
+import vtk
 
-from libVTKCommonPython import *
-from libVTKGraphicsPython import *
-cone = vtkConeSource()
+# get the "vtkRenderer": an OpenGL rendering context
+ren=libSalomePy.getRenderer()
+
+# create an actor and give it cone geometry
+cone = vtk.vtkConeSource()
 cone.SetResolution(8)
-coneMapper = vtkPolyDataMapper()
+coneMapper = vtk.vtkPolyDataMapper()
 coneMapper.SetInput(cone.GetOutput())
-coneActor = vtkActor()
+coneActor = vtk.vtkActor()
 coneActor.SetMapper(coneMapper)
 
+# assign our actor to the renderer
 ren.AddActor(coneActor)
-iren = vtkRenderWindowInteractor()
 
+libSalomePy.fitAll()
+
+iren = libSalomePy.getRenderWindowInteractor()
index 1f4b4033a9660d2913a98c3a82360c4196fe796c..6b19753e21d4e12b26cc6ca50b775c01495fffe7 100644 (file)
@@ -44,7 +44,10 @@ nodist_libSPlot2d_la_SOURCES = $(MOC_FILES)
 libSPlot2d_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(QWT_INCLUDES) $(BOOST_CPPFLAGS)      \
                         -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Plot2d           \
                         -I$(srcdir)/../Prs -I$(srcdir)/../OBJECT
-libSPlot2d_la_LDFLAGS  = $(QT_MT_LIBS) $(CAS_KERNEL) $(QWT_LIBS) ../SUIT/libsuit.la ../Plot2d/libPlot2d.la ../Prs/libSalomePrs.la ../OBJECT/libSalomeObject.la
+libSPlot2d_la_LDFLAGS  = ../SUIT/libsuit.la ../Plot2d/libPlot2d.la ../Prs/libSalomePrs.la ../OBJECT/libSalomeObject.la
+
+### VSR: 24/11/2009: remove these libs to avoid double linking to the native libraries
+###$(QT_MT_LIBS) $(CAS_KERNEL) $(QWT_LIBS) 
 
 
 
index 7f4f1db88d9a37548efc39583db083c5e10f7ad2..1c4fe33f2dd7458a833a264f77c7816d7c149267 100755 (executable)
@@ -24,6 +24,7 @@
 //
 #include "SUIT_DataObject.h"
 #include "SUIT_DataObjectKey.h"
+#include <cstdio>
 
 SUIT_DataObject::Signal* SUIT_DataObject::mySignal = 0;
 
index 6cabb4e4efa0d7a9e06e78031ae25b267097d986..2a08d294b278a8dd4f403fef3fee83db94a48a9d 100755 (executable)
@@ -93,6 +93,7 @@ SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop )
   setBackgroundColor(QColor(R,G,B));*/
 
   myToolBar = new QToolBar(this);
+  myToolBar->setFloatable(false);
   //myToolBar->setCloseMode(QDockWindow::Undocked);
   myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
   createActions();
index f7e422f60c3fbb88136db99f178521390d20d5c6..27976ea9da0bcfb45d10c57256027a8609231f55 100755 (executable)
@@ -57,7 +57,6 @@ salomeinclude_HEADERS= \
        SVTK_SetRotationPointDlg.h \
        SVTK_ViewParameterDlg.h \
        SVTK_ComboAction.h \
-       SVTK_Extension.h \
        SVTK_Recorder.h \
        SVTK_RecorderDlg.h \
        SVTK_ImageWriter.h \
@@ -90,7 +89,6 @@ dist_libSVTK_la_SOURCES= \
        SVTK_SetRotationPointDlg.cxx \
        SVTK_ViewParameterDlg.cxx \
        SVTK_ComboAction.cxx \
-       SVTK_Extension.cxx \
        SVTK_Recorder.cxx \
        SVTK_RecorderDlg.cxx \
        SVTK_ImageWriter.cxx \
index 920402a610db7a1bcef71fcc5d7a1c3c04d43b78..07f52de151e73c61f0e725437420587718a4168e 100644 (file)
@@ -382,17 +382,8 @@ SALOME_Actor
 
   myPreHighlightActor->SetVisibility( theVisibility && myIsPreselected );
 
-  vtkProperty* aProp = vtkProperty::New();
-  aProp->SetColor( 255, 255, 255);
-  aProp->SetLineWidth ( 3 );
-  myPreHighlightActor->SetProperty(aProp);
-  aProp->Delete();
-
-  int vis = myPreHighlightActor->GetVisibility();
-  //printf ("\n Visibility = %d", vis);
-
   if(mySelector.GetPointer() && hasIO()){
-    if(mySelector->SelectionMode() != ActorSelection) {
+    if(mySelector->SelectionMode() != ActorSelection){
       int aHasIndex = mySelector->HasIndex( getIO() );
       myHighlightActor->SetVisibility( theVisibility && isHighlighted() && aHasIndex);
     }
index 83abf056c61c02cc17b686819bfcaaa848116340..2fdc252a62dac292d5f2f1cff7c644a7f70bc38f 100755 (executable)
@@ -143,8 +143,8 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   aRenderer->Delete();
   aSelector->Delete();
   
-  myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), -1, this );
-  myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), -1, this );
+  myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false, Qt::AllToolBarAreas, -1, this );
+  myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), false, Qt::AllToolBarAreas, -1, this );
   
   createActions( SUIT_Session::session()->activeApplication()->resourceMgr() );
   createToolBar();
@@ -846,6 +846,7 @@ QImage SVTK_ViewWindow::dumpView()
   if( myDumpImage.isNull() )
     return dumpViewContent();
   
+  RefreshDumpImage();
   return myDumpImage;
 }
 
index 8abfcaa27c54164084cbec414431fac3959ceea7..4edce501eb189ed4fce1aebaa1ebbf9a93aec194 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <vector>//?
 #include <string>//?
+#include <cstdio>
 
 /*!
   Constructor.
index 1871c3edaffe1ddd958ce20d2202773b5f64314f..6ee316dd5bfe1f2f3dc6319f033d9e1a89649e32 100755 (executable)
@@ -57,13 +57,13 @@ if ENABLE_TESTRECORDER
   libSalomeSession_la_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
 endif
 
-libSalomeSession_la_LDFLAGS = $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS       \
+libSalomeSession_la_LDFLAGS = $(KERNEL_LDFLAGS) -lSalomeNS                     \
        -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog      \
        -lSalomeDSClient $(CAS_KERNEL) -lwith_loggerTraceCollector              \
        -lSalomeIDLKernel -lSalomeContainer -lTOOLSDS -lSalomeLauncher          \
        -lRegistry -lSALOMEBasics                                               \
        ../SUIT/libsuit.la ../Event/libEvent.la ../../idl/libSalomeIDLGUI.la    \
-       ../Style/libSalomeStyle.la
+       ../Style/libSalomeStyle.la $(QT_MT_LIBS) 
 
 if ENABLE_TESTRECORDER
   libSalomeSession_la_LDFLAGS+= $(TESTRECORDER_LIBS)
@@ -76,12 +76,11 @@ dist_SALOME_Session_Server_SOURCES = SALOME_Session_Server.cxx
 
 SALOME_Session_Server_CPPFLAGS = $(libSalomeSession_la_CPPFLAGS)
 SALOME_Session_Server_LDADD    = $(libSalomeSession_la_LDFLAGS)                \
-       $(PYTHON_LIBS) $(OMNIORB_LIBS)                                          \
-       $(HDF5_LIBS) -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS       \
+       -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS                    \
        -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry         \
        -lSalomeNotification -lSALOMEBasics -lSalomeLauncher ../Qtx/libqtx.la   \
-       $(top_builddir)/idl/libSalomeIDLGUI.la                                  \
-       libSalomeSession.la
+       $(top_builddir)/idl/libSalomeIDLGUI.la libSalomeSession.la              \
+       $(HDF5_LIBS) $(PYTHON_LIBS) $(OMNIORB_LIBS)
 
 if ENABLE_TESTRECORDER
   SALOME_Session_Server_LDADD+= $(TESTRECORDER_LIBS)
index 920e3b08ceaa01ca98dcd825be969ef63cc58492..5118c43902a556cd93c2b127e84c06a26ef0c30e 100755 (executable)
@@ -79,7 +79,7 @@ VTKViewer_Actor
   myTransformFilter(VTKViewer_TransformFilter::New())
 {
   vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                myPolygonOffsetUnits);
+                                                                 myPolygonOffsetUnits);
 
   for(int i = 0; i < 6; i++)
     myPassFilter.push_back(vtkPassThroughFilter::New());
@@ -233,7 +233,7 @@ VTKViewer_Actor
     
     vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
     vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                  myPolygonOffsetUnits);
+                                                                   myPolygonOffsetUnits);
     Superclass::Render(ren,m);
     
     vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
@@ -261,7 +261,7 @@ VTKViewer_Actor
 void
 VTKViewer_Actor
 ::SetPolygonOffsetParameters(vtkFloatingPointType factor, 
-                            vtkFloatingPointType units)
+                             vtkFloatingPointType units)
 {
   myPolygonOffsetFactor = factor;
   myPolygonOffsetUnits = units;
@@ -274,7 +274,7 @@ VTKViewer_Actor
 void
 VTKViewer_Actor
 ::GetPolygonOffsetParameters(vtkFloatingPointType& factor, 
-                            vtkFloatingPointType& units)
+                             vtkFloatingPointType& units)
 {
   factor = myPolygonOffsetFactor;
   units = myPolygonOffsetUnits;
@@ -578,8 +578,8 @@ VTKViewer_Actor
 void
 VTKViewer_Actor
 ::SetColor(vtkFloatingPointType r,
-          vtkFloatingPointType g,
-          vtkFloatingPointType b)
+           vtkFloatingPointType g,
+           vtkFloatingPointType b)
 {
   GetProperty()->SetColor(r,g,b);
 }
@@ -600,8 +600,8 @@ VTKViewer_Actor
 void
 VTKViewer_Actor
 ::GetColor(vtkFloatingPointType& r,
-          vtkFloatingPointType& g,
-          vtkFloatingPointType& b)
+           vtkFloatingPointType& g,
+           vtkFloatingPointType& b)
 {
   vtkFloatingPointType aColor[3];
   GetProperty()->GetColor(aColor);
index 439e45dbf4dc21b9b56625c7cb7fb077048b85b7..d41760d9f26a5af8b762beeb6034a6344feba031 100755 (executable)
@@ -91,15 +91,15 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   virtual
   void
   SetColor(vtkFloatingPointType r,
-          vtkFloatingPointType g,
-          vtkFloatingPointType b);
+           vtkFloatingPointType g,
+           vtkFloatingPointType b);
 
   //! Get current color
   virtual
   void
   GetColor(vtkFloatingPointType& r,
-          vtkFloatingPointType& g,
-          vtkFloatingPointType& b);
+           vtkFloatingPointType& g,
+           vtkFloatingPointType& b);
 
   //! Change color
   virtual
@@ -223,12 +223,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   //! Set ResolveCoincidentTopology parameters
   void
   SetPolygonOffsetParameters(vtkFloatingPointType factor, 
-                            vtkFloatingPointType units);
+                             vtkFloatingPointType units);
 
   //! Get current ResolveCoincidentTopology parameters
   void
   GetPolygonOffsetParameters(vtkFloatingPointType& factor, 
-                            vtkFloatingPointType& units);
+                             vtkFloatingPointType& units);
 
   virtual
   void
index ccde1876d6d497e6e6edd29676e625e945fecd37..fe6550c8247fc557c1102d3f67ce4db828d6084e 100644 (file)
@@ -99,9 +99,9 @@ VTKViewer_AppendFilter
 int
 VTKViewer_AppendFilter
 ::RequestData(
-             vtkInformation *request,
-             vtkInformationVector **inputVector,
-             vtkInformationVector *outputVector)
+              vtkInformation *request,
+              vtkInformationVector **inputVector,
+              vtkInformationVector *outputVector)
 {
   int aRet = 0;
   if(GetSharedPointsDataSet())
@@ -146,8 +146,8 @@ namespace
   inline
   vtkIdType
   GetOutputID(vtkIdType theInputID,
-             vtkIdType theInputDataSetID,
-             const VTKViewer_AppendFilter::TVectorIds& theRanges)
+              vtkIdType theInputDataSetID,
+              const VTKViewer_AppendFilter::TVectorIds& theRanges)
   {
     theInputID = theInputDataSetID = -1;
 
@@ -163,7 +163,7 @@ namespace
 vtkIdType
 VTKViewer_AppendFilter
 ::GetPointOutputID(vtkIdType theInputID,
-                  vtkIdType theInputDataSetID)
+                   vtkIdType theInputDataSetID)
 {
   if(GetSharedPointsDataSet())
     return theInputID;
@@ -175,7 +175,7 @@ VTKViewer_AppendFilter
 vtkIdType 
 VTKViewer_AppendFilter
 ::GetCellOutputID(vtkIdType theInputID,
-                  vtkIdType theInputDataSetID)
+                   vtkIdType theInputDataSetID)
 {
   if(GetSharedPointsDataSet())
     return theInputID;
@@ -188,10 +188,10 @@ namespace
 {
   void
   GetInputID(vtkIdType theOutputID,
-            vtkIdType& theInputID,
-            vtkIdType& theStartID,
-            vtkIdType& theInputDataSetID,
-            const VTKViewer_AppendFilter::TVectorIds& theRanges)
+             vtkIdType& theInputID,
+             vtkIdType& theStartID,
+             vtkIdType& theInputDataSetID,
+             const VTKViewer_AppendFilter::TVectorIds& theRanges)
   {
     theInputID = theStartID = theInputDataSetID = -1;
 
@@ -207,10 +207,10 @@ namespace
     for(vtkIdType aDataSetId = 0; aDataSetId < aNbInputs; ++aDataSetId){
       vtkIdType aRange = theRanges[aDataSetId];
       if(aRange > theOutputID){
-       theInputID = theOutputID - aStartId;
-       theInputDataSetID = aDataSetId;
-       theStartID = aStartId;
-       break;
+        theInputID = theOutputID - aStartId;
+        theInputDataSetID = aDataSetId;
+        theStartID = aStartId;
+        break;
       }
       aStartId = aRange;
     }
@@ -220,9 +220,9 @@ namespace
 void 
 VTKViewer_AppendFilter
 ::GetPointInputID(vtkIdType theOutputID,
-                 vtkIdType& theInputID,
-                 vtkIdType& theStartID,
-                 vtkIdType& theInputDataSetID)
+                  vtkIdType& theInputID,
+                  vtkIdType& theStartID,
+                  vtkIdType& theInputDataSetID)
 {
   if(GetSharedPointsDataSet()) {
     theStartID = theInputDataSetID = 0;
@@ -231,25 +231,25 @@ VTKViewer_AppendFilter
   }
 
   ::GetInputID(theOutputID,
-              theInputID,
-              theStartID,
-              theInputDataSetID,
-              myNodeRanges);
+               theInputID,
+               theStartID,
+               theInputDataSetID,
+               myNodeRanges);
 }
 
 
 void
 VTKViewer_AppendFilter
 ::GetCellInputID(vtkIdType theOutputID,
-                vtkIdType& theInputID,
-                vtkIdType& theStartID,
-                vtkIdType& theInputDataSetID)
+                 vtkIdType& theInputID,
+                 vtkIdType& theStartID,
+                 vtkIdType& theInputDataSetID)
 {
   ::GetInputID(theOutputID,
-              theInputID,
-              theStartID,
-              theInputDataSetID,
-              myCellRanges);
+               theInputID,
+               theStartID,
+               theInputDataSetID,
+               myCellRanges);
 }
 
 
index 9f90c66581f6420fb6b0093469b200672c3f7ff5..5531d38d66ef5dcc033798fcba64c119a8bded24 100644 (file)
@@ -62,23 +62,23 @@ public:
 
   vtkIdType
   GetPointOutputID(vtkIdType theInputID,
-                  vtkIdType theInputDataSetID);
+                   vtkIdType theInputDataSetID);
 
   vtkIdType
   GetCellOutputID(vtkIdType theInputID,
-                 vtkIdType theInputDataSetID);
+                  vtkIdType theInputDataSetID);
 
   void 
   GetPointInputID(vtkIdType theOutputID,
-                vtkIdType& theInputID,
-                vtkIdType& theStartID,
-                vtkIdType& theInputDataSetID);
+                 vtkIdType& theInputID,
+                 vtkIdType& theStartID,
+                 vtkIdType& theInputDataSetID);
 
   void
   GetCellInputID(vtkIdType theOutputID,
-                vtkIdType& theInputID,
-                vtkIdType& theStartID,
-                vtkIdType& theInputDataSetID);
+                 vtkIdType& theInputID,
+                 vtkIdType& theStartID,
+                 vtkIdType& theInputDataSetID);
 
   typedef std::vector<vtkIdType> TVectorIds;
 
index e8cd9e4796f8b6349cc2e8d23ea2e13cb6ebcaca..392cbd18726331df4eeed462e8eb2a8fe5c91b13 100644 (file)
@@ -89,7 +89,7 @@ double XYZ::Modulus () const {
 Pnt::Pnt(double X, 
          double Y, 
          double Z,
-        double ScalarValue):
+         double ScalarValue):
   coord(X,Y,Z),
   scalarValue(ScalarValue)
 {
@@ -617,7 +617,7 @@ vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input,
     for(vtkIdType idx = 1; idx < aNbPts-1;idx++) {
       curID = output->GetPoints()->InsertNextPoint(aPoints->GetPoint(idx));
       if( outputScalars )
-       outputScalars->InsertNextTuple1(aScalarValues[idx]);
+        outputScalars->InsertNextTuple1(aScalarValues[idx]);
       aNewPoints[idx] = curID;
     }
     aNewPoints[aNbPts-1] = pts[1];
@@ -632,10 +632,10 @@ vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input,
  * Array theIds - it is array with ids of added points.
  */
 vtkIdType MergevtkPoints(const std::vector<vtkPoints*>& theCollection,
-                        const std::vector< std::vector<double> >& theScalarCollection,
-                        vtkPoints* thePoints,
-                        std::map<int, double>& thePntId2ScalarValue,
-                        vtkIdType* &theIds){
+                         const std::vector< std::vector<double> >& theScalarCollection,
+                         vtkPoints* thePoints,
+                         std::map<int, double>& thePntId2ScalarValue,
+                         vtkIdType* &theIds){
   vtkIdType aNbPoints = 0;
   vtkIdType anIdCounter = 0;
   vtkIdType aNewPntId = 0;
@@ -660,7 +660,7 @@ vtkIdType MergevtkPoints(const std::vector<vtkPoints*>& theCollection,
       for(vtkIdType idx = 0;idx < aPoints->GetNumberOfPoints()-1;idx++){
         aNewPntId = thePoints->InsertNextPoint(aPoints->GetPoint(idx));
         theIds[anIdCounter] = aNewPntId;
-       thePntId2ScalarValue[ aNewPntId ] = aScalarValues[idx];
+        thePntId2ScalarValue[ aNewPntId ] = aScalarValues[idx];
         anIdCounter++;
       }
     }
index 4ad39dc5f874008015ce6a0690a63d18f0cf4715..4362b6df0ebcacbd3c3a0514582291f448580315 100644 (file)
@@ -38,9 +38,9 @@ class Pnt;
 typedef std::list<Pnt> PntList;
 
 vtkIdType MergevtkPoints(const std::vector<vtkPoints*>& theCollection,
-                        const std::vector< std::vector<double> >& theScalarCollection,
+                         const std::vector< std::vector<double> >& theScalarCollection,
                          vtkPoints* thePoints,
-                        std::map<int, double>& thePntId2ScalarValue,
+                         std::map<int, double>& thePntId2ScalarValue,
                          vtkIdType* &theIds);
 
 vtkIdType Build1DArc(vtkIdType cellId, 
@@ -50,8 +50,8 @@ vtkIdType Build1DArc(vtkIdType cellId,
                      vtkFloatingPointType myMaxArcAngle);
 
 Pnt CreatePnt(vtkCell* cell,
-             vtkDataArray* scalars,
-             vtkIdType index);
+              vtkDataArray* scalars,
+              vtkIdType index);
 
 /*!
  * Class for represenation coordinates X,Y,Z
@@ -138,9 +138,9 @@ class Plane{
   void CalculatePlane(const Pnt& thePnt1, const Pnt& thePnt2, const Pnt& thePnt3);
   
  private:
-       double myA;
-       double myB;
-       double myC;
+        double myA;
+        double myB;
+        double myC;
 };
 
 
@@ -148,9 +148,9 @@ class VTKViewer_ArcBuilder{
  public:
   enum ArcStatus {Arc_Done=0, Arc_Error};
   VTKViewer_ArcBuilder(const Pnt& thePnt1,
-                      const Pnt& thePnt2,
-                      const Pnt& thePnt3,
-                      double theAngle);
+                       const Pnt& thePnt2,
+                       const Pnt& thePnt3,
+                       double theAngle);
   
   ~VTKViewer_ArcBuilder();  
 
@@ -161,7 +161,7 @@ class VTKViewer_ArcBuilder{
   void GetAngle(const double theAngle);
 
   static double GetPointAngleOnCircle(const double theXCenter, const double theYCenter,
-                                     const double theXPoint, const double theYPoint);
+                                      const double theXPoint, const double theYPoint);
 
   vtkPoints* GetPoints();
   const std::vector<double>& GetScalarValues();
index 96b6bec3384f233676cd7fb4313364525520acd9..229f28e1b7de5833019df3bbe707c50a0c77cd6a 100644 (file)
@@ -56,8 +56,8 @@ namespace
     vtkFloatingPointType myOrigin[3];
     vtkFloatingPointType myNormal[3];
     TPolygon(const TConnectivities& theConnectivities,
-            vtkFloatingPointType theOrigin[3],
-            vtkFloatingPointType theNormal[3]):
+             vtkFloatingPointType theOrigin[3],
+             vtkFloatingPointType theNormal[3]):
       myConnectivities(theConnectivities)
     {
       myOrigin[0] = theOrigin[0];
@@ -98,7 +98,7 @@ VTKViewer_Triangulator
 vtkPoints*
 VTKViewer_Triangulator
 ::InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId)
+             vtkIdType theCellId)
 {
   myPoints->Reset();
   myPoints->Modified(); // the VTK bug
@@ -151,8 +151,8 @@ VTKViewer_Triangulator
   aCoordDiff[2] = (aBounds[5] - aBounds[4]);
 
   return sqrt(aCoordDiff[0]*aCoordDiff[0] + 
-             aCoordDiff[1]*aCoordDiff[1] + 
-             aCoordDiff[2]*aCoordDiff[2]);
+              aCoordDiff[1]*aCoordDiff[1] + 
+              aCoordDiff[2]*aCoordDiff[2]);
 }
 
 
@@ -160,9 +160,9 @@ VTKViewer_Triangulator
 void 
 VTKViewer_Triangulator
 ::GetCellNeighbors(vtkUnstructuredGrid *theInput,
-                  vtkIdType theCellId,
-                  vtkCell* theFace,
-                  vtkIdList* theCellIds)
+                   vtkIdType theCellId,
+                   vtkCell* theFace,
+                   vtkIdList* theCellIds)
 {
   myFaceIds->Reset();
   vtkIdList *anIdList = theFace->PointIds;  
@@ -187,16 +187,16 @@ VTKViewer_Triangulator
 bool 
 VTKViewer_Triangulator
 ::Execute(vtkUnstructuredGrid *theInput,
-         vtkCellData* thInputCD,
-         vtkIdType theCellId,
-         int theShowInside,
-         int theAllVisible,
-         const char* theCellsVisibility,
-         vtkPolyData *theOutput,
-         vtkCellData* theOutputCD,
-         int theStoreMapping,
-         std::vector<vtkIdType>& theVTK2ObjIds,
-         bool theIsCheckConvex)
+          vtkCellData* thInputCD,
+          vtkIdType theCellId,
+          int theShowInside,
+          int theAllVisible,
+          const char* theCellsVisibility,
+          vtkPolyData *theOutput,
+          vtkCellData* theOutputCD,
+          int theStoreMapping,
+          std::vector<vtkIdType>& theVTK2ObjIds,
+          bool theIsCheckConvex)
 {
   vtkPoints *aPoints = InitPoints(theInput, theCellId);
   vtkIdType aNumPts = GetNbOfPoints();
@@ -270,7 +270,7 @@ VTKViewer_Triangulator
 
     vtkIdList *anIdList = aFace->PointIds;
     vtkIdType aNewPts[3] = {anIdList->GetId(0), anIdList->GetId(1), anIdList->GetId(2)};
-           
+            
     // To initialize set of points for the plane where the trinangle face belong to
     TPointIds aPointIds;
     aPointIds.insert(aNewPts[0]);
@@ -294,21 +294,21 @@ VTKViewer_Triangulator
       /* To calculate plane normal for face (aFace)
 
 
-       ^ aNormal
-       |     
-       |   ^ aVector01
-       | /
-       /_________> aVector02
+        ^ aNormal
+        |     
+        |   ^ aVector01
+        | /
+        /_________> aVector02
        
       
       */
       vtkFloatingPointType aVector01[3] = { aCoord[1][0] - aCoord[0][0],
-                                           aCoord[1][1] - aCoord[0][1],
-                                           aCoord[1][2] - aCoord[0][2] };
+                                            aCoord[1][1] - aCoord[0][1],
+                                            aCoord[1][2] - aCoord[0][2] };
       
       vtkFloatingPointType aVector02[3] = { aCoord[2][0] - aCoord[0][0],
-                                           aCoord[2][1] - aCoord[0][1],
-                                           aCoord[2][2] - aCoord[0][2] };
+                                            aCoord[2][1] - aCoord[0][1],
+                                            aCoord[2][2] - aCoord[0][2] };
       
       vtkMath::Normalize(aVector01);
       vtkMath::Normalize(aVector02);
@@ -323,211 +323,211 @@ VTKViewer_Triangulator
       // To calculate bounds of the point set
       vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0};
       {
-       TPointIds::const_iterator anIter = anInitialPointIds.begin();
-       TPointIds::const_iterator anEndIter = anInitialPointIds.end();
-       for(; anIter != anEndIter; anIter++){
-         vtkFloatingPointType aPntCoord[3];
-         vtkIdType aPntId = *anIter;
-         aPoints->GetPoint(aPntId,aPntCoord);
-         
-         vtkFloatingPointType aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0],
-                                                 aPntCoord[1] - aCoord[0][1],
-                                                 aPntCoord[2] - aCoord[0][2] };
-
-         
-         vtkMath::Normalize(aVector0Pnt);
-         
-         vtkFloatingPointType aNormalPnt[3];
-         // calculate aNormalPnt
-         {
-           vtkFloatingPointType aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01);
-           vtkFloatingPointType aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02);
-           if(aCosPnt01<-1)
-             aCosPnt01 = -1;
-           if(aCosPnt01>1)
-             aCosPnt01 = 1;
-           if(aCosPnt02<-1)
-             aCosPnt02 = -1;
-           if(aCosPnt02>1)
-             aCosPnt02 = 1;
-
-           vtkFloatingPointType aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle)
-           vtkFloatingPointType aAngPnt01 = fabs(acos(aCosPnt01));
-           vtkFloatingPointType aAngPnt02 = fabs(acos(aCosPnt02));
-
-           /*  check that triangle similar to equilateral triangle
-               AOC or COB ?
-               aVector0Pnt = (OC)
-               aVector01   = (OB)
-               aVector02   = (OA)
-           
-           B
-           ^ aVector01  C     
-           |           ^ aVector0Pnt  
-           |     _____/ 
-           | ___/
-           |/________> aVector02
-           O          A
-           */
-           aDist01 = fabs(aAngPnt01-(vtkMath::Pi())/3.0); 
-           aDist02 = fabs(aAngPnt02-(vtkMath::Pi())/3.0);
-           
-           // caculate a normal for best triangle
-           if(aDist01 <= aDist02)
-             vtkMath::Cross(aVector0Pnt,aVector01,aNormalPnt);
-           else
-             vtkMath::Cross(aVector0Pnt,aVector02,aNormalPnt);
-
-         }
-         
-         vtkMath::Normalize(aNormalPnt);
-         
-         if(DEBUG_TRIA_EXECUTE)
-           cout<<"\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"};";
-         
-         vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]);
-         if(DEBUG_TRIA_EXECUTE) cout<<": aDist = "<<aDist;
-         if(fabs(aDist) < aDistEps){
-           aPointIds.insert(aPntId);
-           aCenter[0] += aPntCoord[0];
-           aCenter[1] += aPntCoord[1];
-           aCenter[2] += aPntCoord[2];
-           if(DEBUG_TRIA_EXECUTE) cout  << "; Added = TRUE" << endl;
-         } else {
-           if(DEBUG_TRIA_EXECUTE) cout  << "; Added = FALSE" << endl;
-         }
-       }
-       int aNbPoints = aPointIds.size();
-       aCenter[0] /= aNbPoints;
-       aCenter[1] /= aNbPoints;
-       aCenter[2] /= aNbPoints;
+        TPointIds::const_iterator anIter = anInitialPointIds.begin();
+        TPointIds::const_iterator anEndIter = anInitialPointIds.end();
+        for(; anIter != anEndIter; anIter++){
+          vtkFloatingPointType aPntCoord[3];
+          vtkIdType aPntId = *anIter;
+          aPoints->GetPoint(aPntId,aPntCoord);
+          
+          vtkFloatingPointType aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0],
+                                                  aPntCoord[1] - aCoord[0][1],
+                                                  aPntCoord[2] - aCoord[0][2] };
+
+          
+          vtkMath::Normalize(aVector0Pnt);
+          
+          vtkFloatingPointType aNormalPnt[3];
+          // calculate aNormalPnt
+          {
+            vtkFloatingPointType aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01);
+            vtkFloatingPointType aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02);
+            if(aCosPnt01<-1)
+              aCosPnt01 = -1;
+            if(aCosPnt01>1)
+              aCosPnt01 = 1;
+            if(aCosPnt02<-1)
+              aCosPnt02 = -1;
+            if(aCosPnt02>1)
+              aCosPnt02 = 1;
+
+            vtkFloatingPointType aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle)
+            vtkFloatingPointType aAngPnt01 = fabs(acos(aCosPnt01));
+            vtkFloatingPointType aAngPnt02 = fabs(acos(aCosPnt02));
+
+            /*  check that triangle similar to equilateral triangle
+                AOC or COB ?
+                aVector0Pnt = (OC)
+                aVector01   = (OB)
+                aVector02   = (OA)
+            
+            B
+            ^ aVector01  C     
+            |           ^ aVector0Pnt  
+            |     _____/ 
+            | ___/
+            |/________> aVector02
+            O          A
+            */
+            aDist01 = fabs(aAngPnt01-(vtkMath::Pi())/3.0); 
+            aDist02 = fabs(aAngPnt02-(vtkMath::Pi())/3.0);
+            
+            // caculate a normal for best triangle
+            if(aDist01 <= aDist02)
+              vtkMath::Cross(aVector0Pnt,aVector01,aNormalPnt);
+            else
+              vtkMath::Cross(aVector0Pnt,aVector02,aNormalPnt);
+
+          }
+          
+          vtkMath::Normalize(aNormalPnt);
+          
+          if(DEBUG_TRIA_EXECUTE)
+            cout<<"\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"};";
+          
+          vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]);
+          if(DEBUG_TRIA_EXECUTE) cout<<": aDist = "<<aDist;
+          if(fabs(aDist) < aDistEps){
+            aPointIds.insert(aPntId);
+            aCenter[0] += aPntCoord[0];
+            aCenter[1] += aPntCoord[1];
+            aCenter[2] += aPntCoord[2];
+            if(DEBUG_TRIA_EXECUTE) cout  << "; Added = TRUE" << endl;
+          } else {
+            if(DEBUG_TRIA_EXECUTE) cout  << "; Added = FALSE" << endl;
+          }
+        }
+        int aNbPoints = aPointIds.size();
+        aCenter[0] /= aNbPoints;
+        aCenter[1] /= aNbPoints;
+        aCenter[2] /= aNbPoints;
       }
       
       //To sinchronize orientation of the cell and its face
       vtkFloatingPointType aVectorC[3] = { aCenter[0] - aCellCenter[0],
-                                          aCenter[1] - aCellCenter[1],
-                                          aCenter[2] - aCellCenter[2] };
+                                           aCenter[1] - aCellCenter[1],
+                                           aCenter[2] - aCellCenter[2] };
       vtkMath::Normalize(aVectorC);
       
       vtkFloatingPointType aDot = vtkMath::Dot(aNormal,aVectorC);
       if(DEBUG_TRIA_EXECUTE) {
-       cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
-       cout<<"; aVectorC = {"<<aVectorC[0]<<", "<<aVectorC[1]<<", "<<aVectorC[2]<<"}\n";
-       cout<<"\t\taDot = "<<aDot<<"\n";
+        cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
+        cout<<"; aVectorC = {"<<aVectorC[0]<<", "<<aVectorC[1]<<", "<<aVectorC[2]<<"}\n";
+        cout<<"\t\taDot = "<<aDot<<"\n";
       }
       if(aDot > 0){
-       aNormal[0] = -aNormal[0];
-       aNormal[1] = -aNormal[1];
-       aNormal[2] = -aNormal[2];
+        aNormal[0] = -aNormal[0];
+        aNormal[1] = -aNormal[1];
+        aNormal[2] = -aNormal[2];
       }
       
       // To calculate the primary direction for point set
       vtkFloatingPointType aVector0[3] = { aCoord[0][0] - aCenter[0],
-                                          aCoord[0][1] - aCenter[1],
-                                          aCoord[0][2] - aCenter[2] };
+                                           aCoord[0][1] - aCenter[1],
+                                           aCoord[0][2] - aCenter[2] };
       vtkMath::Normalize(aVector0);
       
       if(DEBUG_TRIA_EXECUTE) {
-       cout<<"\t\taCenter = {"<<aCenter[0]<<", "<<aCenter[1]<<", "<<aCenter[2]<<"}";
-       cout<<"; aVector0 = {"<<aVector0[0]<<", "<<aVector0[1]<<", "<<aVector0[2]<<"}\n";
+        cout<<"\t\taCenter = {"<<aCenter[0]<<", "<<aCenter[1]<<", "<<aCenter[2]<<"}";
+        cout<<"; aVector0 = {"<<aVector0[0]<<", "<<aVector0[1]<<", "<<aVector0[2]<<"}\n";
       }
       
       // To calculate the set of points by face those that belong to the plane
       TFace2PointIds aRemoveFace2PointIds;
       {
-       TFace2PointIds::const_iterator anIter = aFace2PointIds.begin();
-       TFace2PointIds::const_iterator anEndIter = aFace2PointIds.end();
-       for(; anIter != anEndIter; anIter++){
-         const TPointIds& anIds = *anIter;
-         TPointIds anIntersection;
-         std::set_intersection(aPointIds.begin(),aPointIds.end(),
-                               anIds.begin(),anIds.end(),
-                               std::inserter(anIntersection,anIntersection.begin()));
-         
-
-         if(DEBUG_TRIA_EXECUTE) {
-           cout << "anIntersection:";
-           TPointIds::iterator aII = anIntersection.begin();
-           for(;aII!=anIntersection.end();aII++)
-             cout << *aII << ",";
-           cout << endl;
-           cout << "anIds         :";
-           TPointIds::const_iterator aIIds = anIds.begin();
-           for(;aIIds!=anIds.end();aIIds++)
-             cout << *aIIds << ",";
-           cout << endl;
-         }
-         if(anIntersection == anIds){
-           aRemoveFace2PointIds.insert(anIds);
-         }
-       }
+        TFace2PointIds::const_iterator anIter = aFace2PointIds.begin();
+        TFace2PointIds::const_iterator anEndIter = aFace2PointIds.end();
+        for(; anIter != anEndIter; anIter++){
+          const TPointIds& anIds = *anIter;
+          TPointIds anIntersection;
+          std::set_intersection(aPointIds.begin(),aPointIds.end(),
+                                anIds.begin(),anIds.end(),
+                                std::inserter(anIntersection,anIntersection.begin()));
+          
+
+          if(DEBUG_TRIA_EXECUTE) {
+            cout << "anIntersection:";
+            TPointIds::iterator aII = anIntersection.begin();
+            for(;aII!=anIntersection.end();aII++)
+              cout << *aII << ",";
+            cout << endl;
+            cout << "anIds         :";
+            TPointIds::const_iterator aIIds = anIds.begin();
+            for(;aIIds!=anIds.end();aIIds++)
+              cout << *aIIds << ",";
+            cout << endl;
+          }
+          if(anIntersection == anIds){
+            aRemoveFace2PointIds.insert(anIds);
+          }
+        }
       }
       
       // To remove from the set of points by face those that belong to the plane
       {
-       TFace2PointIds::const_iterator anIter = aRemoveFace2PointIds.begin();
-       TFace2PointIds::const_iterator anEndIter = aRemoveFace2PointIds.end();
-       for(; anIter != anEndIter; anIter++){
-         const TPointIds& anIds = *anIter;
-         aFace2PointIds.erase(anIds);
-       }
+        TFace2PointIds::const_iterator anIter = aRemoveFace2PointIds.begin();
+        TFace2PointIds::const_iterator anEndIter = aRemoveFace2PointIds.end();
+        for(; anIter != anEndIter; anIter++){
+          const TPointIds& anIds = *anIter;
+          aFace2PointIds.erase(anIds);
+        }
       }
       
       // To sort the planar set of the points accrding to the angle
       {
-       typedef std::map<vtkFloatingPointType,vtkIdType> TSortedPointIds;
-       TSortedPointIds aSortedPointIds;
-       
-       TPointIds::const_iterator anIter = aPointIds.begin();
-       TPointIds::const_iterator anEndIter = aPointIds.end();
-       for(; anIter != anEndIter; anIter++){
-         vtkFloatingPointType aPntCoord[3];
-         vtkIdType aPntId = *anIter;
-         aPoints->GetPoint(aPntId,aPntCoord);
-         vtkFloatingPointType aVector[3] = { aPntCoord[0] - aCenter[0],
-                                             aPntCoord[1] - aCenter[1],
-                                             aPntCoord[2] - aCenter[2] };
-         vtkMath::Normalize(aVector);
-         
-         vtkFloatingPointType aCross[3];
-         vtkMath::Cross(aVector,aVector0,aCross);
-         vtkFloatingPointType aCr = vtkMath::Dot(aCross,aNormal);
-         bool aGreaterThanPi = aCr < 0;
-         vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0);
-         vtkFloatingPointType anAngle = 0.0;
-         if(aCosinus >= 1.0){
-           aCosinus = 1.0;
-         } else if (aCosinus <= -1.0){
-           aCosinus = -1.0;
-           anAngle = vtkMath::Pi();
-         } else {
-           anAngle = acos(aCosinus);
-           if(aGreaterThanPi)
-             anAngle = 2*vtkMath::Pi() - anAngle;
-         }
-         
-         if(DEBUG_TRIA_EXECUTE) {
-           cout << "\t\t\t vtkMath::Dot(aCross,aNormal)="<<aCr<<endl;
-           cout<<"\t\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}";
-           cout<<"; aGreaterThanPi = "<<aGreaterThanPi<<"; aCosinus = "<<aCosinus<<"; anAngle = "<<anAngle<<"\n";
-         }
-         aSortedPointIds[anAngle] = aPntId;
-       }
-
-       if(!aSortedPointIds.empty()){
-         int aNumFacePts = aSortedPointIds.size();
-         ::TConnectivities aConnectivities(aNumFacePts);
-         TSortedPointIds::const_iterator anIter = aSortedPointIds.begin();
-         TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end();
-         if(DEBUG_TRIA_EXECUTE) cout << "Polygon:";
-         for(vtkIdType anId = 0; anIter != anEndIter; anIter++, anId++){
-           vtkIdType aPntId = anIter->second;
-           aConnectivities[anId] = GetConnectivity(aPntId);
-           if(DEBUG_TRIA_EXECUTE) cout << aPntId << ",";
-         }
-         if(DEBUG_TRIA_EXECUTE) cout << endl;
-         aPolygons.push_back(::TPolygon(aConnectivities,aCenter,aNormal));
-       }
+        typedef std::map<vtkFloatingPointType,vtkIdType> TSortedPointIds;
+        TSortedPointIds aSortedPointIds;
+        
+        TPointIds::const_iterator anIter = aPointIds.begin();
+        TPointIds::const_iterator anEndIter = aPointIds.end();
+        for(; anIter != anEndIter; anIter++){
+          vtkFloatingPointType aPntCoord[3];
+          vtkIdType aPntId = *anIter;
+          aPoints->GetPoint(aPntId,aPntCoord);
+          vtkFloatingPointType aVector[3] = { aPntCoord[0] - aCenter[0],
+                                              aPntCoord[1] - aCenter[1],
+                                              aPntCoord[2] - aCenter[2] };
+          vtkMath::Normalize(aVector);
+          
+          vtkFloatingPointType aCross[3];
+          vtkMath::Cross(aVector,aVector0,aCross);
+          vtkFloatingPointType aCr = vtkMath::Dot(aCross,aNormal);
+          bool aGreaterThanPi = aCr < 0;
+          vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0);
+          vtkFloatingPointType anAngle = 0.0;
+          if(aCosinus >= 1.0){
+            aCosinus = 1.0;
+          } else if (aCosinus <= -1.0){
+            aCosinus = -1.0;
+            anAngle = vtkMath::Pi();
+          } else {
+            anAngle = acos(aCosinus);
+            if(aGreaterThanPi)
+              anAngle = 2*vtkMath::Pi() - anAngle;
+          }
+          
+          if(DEBUG_TRIA_EXECUTE) {
+            cout << "\t\t\t vtkMath::Dot(aCross,aNormal)="<<aCr<<endl;
+            cout<<"\t\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}";
+            cout<<"; aGreaterThanPi = "<<aGreaterThanPi<<"; aCosinus = "<<aCosinus<<"; anAngle = "<<anAngle<<"\n";
+          }
+          aSortedPointIds[anAngle] = aPntId;
+        }
+
+        if(!aSortedPointIds.empty()){
+          int aNumFacePts = aSortedPointIds.size();
+          ::TConnectivities aConnectivities(aNumFacePts);
+          TSortedPointIds::const_iterator anIter = aSortedPointIds.begin();
+          TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end();
+          if(DEBUG_TRIA_EXECUTE) cout << "Polygon:";
+          for(vtkIdType anId = 0; anIter != anEndIter; anIter++, anId++){
+            vtkIdType aPntId = anIter->second;
+            aConnectivities[anId] = GetConnectivity(aPntId);
+            if(DEBUG_TRIA_EXECUTE) cout << aPntId << ",";
+          }
+          if(DEBUG_TRIA_EXECUTE) cout << endl;
+          aPolygons.push_back(::TPolygon(aConnectivities,aCenter,aNormal));
+        }
       }
     }
   }
@@ -542,18 +542,18 @@ VTKViewer_Triangulator
       vtkFloatingPointType* aNormal = aPolygon.myNormal;
       vtkFloatingPointType* anOrigin = aPolygon.myOrigin;
       if(DEBUG_TRIA_EXECUTE) {
-       cout<<"\taPolygonId = "<<aPolygonId<<"\n";
-       cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
-       cout<<"; anOrigin = {"<<anOrigin[0]<<", "<<anOrigin[1]<<", "<<anOrigin[2]<<"}\n";
+        cout<<"\taPolygonId = "<<aPolygonId<<"\n";
+        cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
+        cout<<"; anOrigin = {"<<anOrigin[0]<<", "<<anOrigin[1]<<", "<<anOrigin[2]<<"}\n";
       }
       for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){
-       vtkFloatingPointType aPntCoord[3];
-       vtkIdType anId = GetPointId(aPntId);
-       aPoints->GetPoint(anId,aPntCoord);
-       vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
-       if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "<<anId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
-       if(aDist < -aDistEps)
-         return false;
+        vtkFloatingPointType aPntCoord[3];
+        vtkIdType anId = GetPointId(aPntId);
+        aPoints->GetPoint(anId,aPntCoord);
+        vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
+        if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "<<anId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
+        if(aDist < -aDistEps)
+          return false;
       }
     }
   }
@@ -567,14 +567,14 @@ VTKViewer_Triangulator
       if(DEBUG_TRIA_EXECUTE) cout << "PoilygonId="<<aPolygonId<<" | ";
       TConnectivities& aConnectivities = aPolygon.myConnectivities;
       if(DEBUG_TRIA_EXECUTE) {
-       for(int i=0;i<aConnectivities.size();i++)
-         cout << aConnectivities[i] << ",";
-       cout << endl;
+        for(int i=0;i<aConnectivities.size();i++)
+          cout << aConnectivities[i] << ",";
+        cout << endl;
       }
       int aNbPoints = aConnectivities.size();
       vtkIdType aNewCellId = theOutput->InsertNextCell(VTK_POLYGON,aNbPoints,&aConnectivities[0]);
       if(theStoreMapping)
-       theVTK2ObjIds.push_back(theCellId);
+        theVTK2ObjIds.push_back(theCellId);
       theOutputCD->CopyData(thInputCD,theCellId,aNewCellId);
     }
   }
@@ -611,7 +611,7 @@ VTKViewer_OrderedTriangulator
 vtkPoints*
 VTKViewer_OrderedTriangulator
 ::InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId)
+             vtkIdType theCellId)
 {
   myBoundaryTris->Reset();
 
@@ -709,7 +709,7 @@ VTKViewer_DelaunayTriangulator
 vtkPoints* 
 VTKViewer_DelaunayTriangulator
 ::InitPoints(vtkUnstructuredGrid *theInput,
-            vtkIdType theCellId)
+             vtkIdType theCellId)
 {
   vtkPoints* aPoints = VTKViewer_Triangulator::InitPoints(theInput, theCellId);
 
index 0203f97f10041ff65cf0b9f6dab1a3b6895d0d22..cb326fff6d2846869658cb8299d82e595f72d96d 100755 (executable)
@@ -99,14 +99,14 @@ vtkIdType VTKViewer_ExtractUnstructuredGrid::GetOutputId(int theInId) const{
 
 
 inline void InsertCell(vtkUnstructuredGrid *theInput,
-                      vtkCellArray *theConnectivity, 
-                      vtkUnsignedCharArray* theCellTypesArray,
-                      vtkIdType theCellId, 
-                      vtkIdList *theIdList,
-                      bool theStoreMapping,
-                      vtkIdType theOutId, 
-                      VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
-                      VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
+                       vtkCellArray *theConnectivity, 
+                       vtkUnsignedCharArray* theCellTypesArray,
+                       vtkIdType theCellId, 
+                       vtkIdList *theIdList,
+                       bool theStoreMapping,
+                       vtkIdType theOutId, 
+                       VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
+                       VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
 {
   vtkCell *aCell = theInput->GetCell(theCellId);
   vtkIdList *aPntIds = aCell->GetPointIds();
@@ -126,13 +126,13 @@ inline void InsertCell(vtkUnstructuredGrid *theInput,
 }
 
 inline void InsertPointCell(vtkCellArray *theConnectivity, 
-                           vtkUnsignedCharArray* theCellTypesArray,
-                           vtkIdType theCellId, 
-                           vtkIdList *theIdList,
-                           bool theStoreMapping,
-                           vtkIdType theOutId, 
-                           VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
-                           VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
+                            vtkUnsignedCharArray* theCellTypesArray,
+                            vtkIdType theCellId, 
+                            vtkIdList *theIdList,
+                            bool theStoreMapping,
+                            vtkIdType theOutId, 
+                            VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
+                            VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
 {
   theIdList->SetId(0,theCellId);
   theConnectivity->InsertNextCell(theIdList);
index 50600be3115069873dce0426425c70748529b015..bd20dc84b6a53c8b3dce99a6793aa6288e524918 100644 (file)
@@ -162,8 +162,8 @@ void VTKViewer_FramedTextActor::GetSize(vtkRenderer* theRenderer, int theSize[2]
 // purpose  :
 //==================================================================
 void VTKViewer_FramedTextActor::SetForegroundColor(const vtkFloatingPointType r,
-                                                  const vtkFloatingPointType g,
-                                                  const vtkFloatingPointType b)
+                                                   const vtkFloatingPointType g,
+                                                   const vtkFloatingPointType b)
 {
   myTextProperty->SetColor(r, g, b);
   myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
@@ -175,8 +175,8 @@ void VTKViewer_FramedTextActor::SetForegroundColor(const vtkFloatingPointType r,
 // purpose  :
 //==================================================================
 void VTKViewer_FramedTextActor::GetForegroundColor(vtkFloatingPointType& r,
-                                                  vtkFloatingPointType& g,
-                                                  vtkFloatingPointType& b)
+                                                   vtkFloatingPointType& g,
+                                                   vtkFloatingPointType& b)
 {
   vtkFloatingPointType aColor[3];
   myTextProperty->GetColor(aColor);
@@ -190,8 +190,8 @@ void VTKViewer_FramedTextActor::GetForegroundColor(vtkFloatingPointType& r,
 // purpose  :
 //==================================================================
 void VTKViewer_FramedTextActor::SetBackgroundColor(const vtkFloatingPointType r,
-                                                  const vtkFloatingPointType g,
-                                                  const vtkFloatingPointType b)
+                                                   const vtkFloatingPointType g,
+                                                   const vtkFloatingPointType b)
 {
   myBarActor->GetProperty()->SetColor(r, g, b);
   Modified();
@@ -202,8 +202,8 @@ void VTKViewer_FramedTextActor::SetBackgroundColor(const vtkFloatingPointType r,
 // purpose  :
 //==================================================================
 void VTKViewer_FramedTextActor::GetBackgroundColor(vtkFloatingPointType& r,
-                                                  vtkFloatingPointType& g,
-                                                  vtkFloatingPointType& b)
+                                                   vtkFloatingPointType& g,
+                                                   vtkFloatingPointType& b)
 {
   vtkFloatingPointType aColor[3];
   myBarActor->GetProperty()->GetColor(aColor);
@@ -485,7 +485,7 @@ VTKViewer_FramedTextActor
     }
 
     PositionCoordinate->SetValue(x / (vtkFloatingPointType)aViewPortWidth,
-                                y / (vtkFloatingPointType)aViewPortHeight);
+                                 y / (vtkFloatingPointType)aViewPortHeight);
   }
 
   aPoints->SetPoint(0, xMin, yMax, 0.0);
index 71130ac40908a4080d69f2ca1c520eeec577301f..abc93cb40f22dcd7469972ce34d2c96c98f56d7f 100644 (file)
@@ -73,18 +73,18 @@ public:
   vtkFloatingPointType        GetDistance() const;
 
   void                        SetForegroundColor(const vtkFloatingPointType r,
-                                                const vtkFloatingPointType g,
-                                                const vtkFloatingPointType b);
+                                                 const vtkFloatingPointType g,
+                                                 const vtkFloatingPointType b);
   void                        GetForegroundColor(vtkFloatingPointType& r,
-                                                vtkFloatingPointType& g,
-                                                vtkFloatingPointType& b);
+                                                 vtkFloatingPointType& g,
+                                                 vtkFloatingPointType& b);
 
   void                        SetBackgroundColor(const vtkFloatingPointType r,
-                                                const vtkFloatingPointType g,
-                                                const vtkFloatingPointType b);
+                                                 const vtkFloatingPointType g,
+                                                 const vtkFloatingPointType b);
   void                        GetBackgroundColor(vtkFloatingPointType& r,
-                                                vtkFloatingPointType& g,
-                                                vtkFloatingPointType& b);
+                                                 vtkFloatingPointType& g,
+                                                 vtkFloatingPointType& b);
 
   void                        SetTransparency(const vtkFloatingPointType theTransparency);
   vtkFloatingPointType        GetTransparency() const;
index e1bb57b173b8fe9dc895b51cc8285961e82634b3..b0cdf1483f94b272ed26c4689a20cf6c22834308 100644 (file)
@@ -43,14 +43,14 @@ namespace VTK
     {}
     void operator()(TActor* theActor)
     {
-           (theActor->*myAction)(myArg);
+            (theActor->*myAction)(myArg);
     }
   };
 
   template<class TActor, class TArg = int> struct TSetVisibility: TSetFunction<TActor,TArg>
   {
     TSetVisibility(TArg theArg): 
-           TSetFunction<TActor,TArg>(&TActor::SetVisibility,theArg)
+            TSetFunction<TActor,TArg>(&TActor::SetVisibility,theArg)
     {}
   };
 }
index be5781ae0489162deb6cdb20f699d35e8381c98b..b5f44058cb1826deec00c7cda4a0601d3d561dc8 100755 (executable)
@@ -117,9 +117,9 @@ VTKViewer_GeometryFilter
 int
 VTKViewer_GeometryFilter
 ::UnstructuredGridExecute(
-                         vtkDataSet *dataSetInput,
-                         vtkPolyData *output,
-                         vtkInformation *outInfo)
+                          vtkDataSet *dataSetInput,
+                          vtkPolyData *output,
+                          vtkInformation *outInfo)
 {
   
   vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput;
@@ -281,17 +281,17 @@ VTKViewer_GeometryFilter
         case VTK_VERTEX:
         case VTK_POLY_VERTEX:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping){
-           myVTK2ObjIds.push_back(cellId); //apo
-         }
+          if(myStoreMapping){
+            myVTK2ObjIds.push_back(cellId); //apo
+          }
           outputCD->CopyData(cd,cellId,newCellId);
           break;
 
         case VTK_LINE: 
         case VTK_POLY_LINE:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping)
-           myVTK2ObjIds.push_back(cellId);
+          if(myStoreMapping)
+            myVTK2ObjIds.push_back(cellId);
           outputCD->CopyData(cd,cellId,newCellId);
           break;
 
@@ -299,52 +299,52 @@ VTKViewer_GeometryFilter
         case VTK_QUAD:
         case VTK_POLYGON:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping)
-           myVTK2ObjIds.push_back(cellId);
+          if(myStoreMapping)
+            myVTK2ObjIds.push_back(cellId);
           outputCD->CopyData(cd,cellId,newCellId);
           break;
 
         case VTK_TRIANGLE_STRIP:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping)
-           myVTK2ObjIds.push_back(cellId);
+          if(myStoreMapping)
+            myVTK2ObjIds.push_back(cellId);
           outputCD->CopyData(cd,cellId,newCellId);
           break;
 
         case VTK_PIXEL:
           newCellId = output->InsertNextCell(aCellType,npts,pts);
-         if(myStoreMapping)
-           myVTK2ObjIds.push_back(cellId);
-         outputCD->CopyData(cd,cellId,newCellId);
+          if(myStoreMapping)
+            myVTK2ObjIds.push_back(cellId);
+          outputCD->CopyData(cd,cellId,newCellId);
+          break;
+          
+        case VTK_CONVEX_POINT_SET: {
+          bool anIsOk = anOrderedTriangulator.Execute(input,
+                                                      cd,
+                                                      cellId,
+                                                      myShowInside,
+                                                      allVisible,
+                                                      cellVis,
+                                                      output,
+                                                      outputCD,
+                                                      myStoreMapping,
+                                                      myVTK2ObjIds,
+                                                      true);
+          if(!anIsOk)
+            aDelaunayTriangulator.Execute(input,
+                                          cd,
+                                          cellId,
+                                          myShowInside,
+                                          allVisible,
+                                          cellVis,
+                                          output,
+                                          outputCD,
+                                          myStoreMapping,
+                                          myVTK2ObjIds,
+                                          false);
+              
           break;
-         
-       case VTK_CONVEX_POINT_SET: {
-         bool anIsOk = anOrderedTriangulator.Execute(input,
-                                                     cd,
-                                                     cellId,
-                                                     myShowInside,
-                                                     allVisible,
-                                                     cellVis,
-                                                     output,
-                                                     outputCD,
-                                                     myStoreMapping,
-                                                     myVTK2ObjIds,
-                                                     true);
-         if(!anIsOk)
-           aDelaunayTriangulator.Execute(input,
-                                         cd,
-                                         cellId,
-                                         myShowInside,
-                                         allVisible,
-                                         cellVis,
-                                         output,
-                                         outputCD,
-                                         myStoreMapping,
-                                         myVTK2ObjIds,
-                                         false);
-             
-         break;
-       }
+        }
         case VTK_TETRA: {
           for (faceId = 0; faceId < 4; faceId++)
             {
@@ -353,7 +353,7 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[0]]);
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
-           aCellType = VTK_TRIANGLE;
+            aCellType = VTK_TRIANGLE;
             numFacePts = 3;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
             if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
@@ -362,13 +362,13 @@ VTKViewer_GeometryFilter
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[i]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
         case VTK_VOXEL: {
           for (faceId = 0; faceId < 6; faceId++)
             {
@@ -378,7 +378,7 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
             faceIds->InsertNextId(pts[faceVerts[3]]);
-           aCellType = VTK_QUAD;
+            aCellType = VTK_QUAD;
             numFacePts = 4;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
             if ( cellIds->GetNumberOfIds() <= 0 || myShowInside || 
@@ -387,13 +387,13 @@ VTKViewer_GeometryFilter
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[PixelConvert[i]]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
         case VTK_HEXAHEDRON: {
           for (faceId = 0; faceId < 6; faceId++)
             {
@@ -403,7 +403,7 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
             faceIds->InsertNextId(pts[faceVerts[3]]);
-           aCellType = VTK_QUAD;
+            aCellType = VTK_QUAD;
             numFacePts = 4;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
             if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
@@ -412,13 +412,13 @@ VTKViewer_GeometryFilter
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[i]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
         case VTK_WEDGE: {
           for (faceId = 0; faceId < 5; faceId++)
             {
@@ -427,12 +427,12 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[0]]);
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
-           aCellType = VTK_TRIANGLE;
+            aCellType = VTK_TRIANGLE;
             numFacePts = 3;
             if (faceVerts[3] >= 0)
               {
               faceIds->InsertNextId(pts[faceVerts[3]]);
-             aCellType = VTK_QUAD;
+              aCellType = VTK_QUAD;
               numFacePts = 4;
               }
             input->GetCellNeighbors(cellId, faceIds, cellIds);
@@ -442,13 +442,13 @@ VTKViewer_GeometryFilter
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[i]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
         case VTK_PYRAMID: {
           for (faceId = 0; faceId < 5; faceId++)
             {
@@ -457,12 +457,12 @@ VTKViewer_GeometryFilter
             faceIds->InsertNextId(pts[faceVerts[0]]);
             faceIds->InsertNextId(pts[faceVerts[1]]);
             faceIds->InsertNextId(pts[faceVerts[2]]);
-           aCellType = VTK_TRIANGLE;
+            aCellType = VTK_TRIANGLE;
             numFacePts = 3;
             if (faceVerts[3] >= 0)
               {
               faceIds->InsertNextId(pts[faceVerts[3]]);
-             aCellType = VTK_QUAD;
+              aCellType = VTK_QUAD;
               numFacePts = 4;
               }
             input->GetCellNeighbors(cellId, faceIds, cellIds);
@@ -472,13 +472,13 @@ VTKViewer_GeometryFilter
               for ( i=0; i < numFacePts; i++)
                 aNewPts[i] = pts[faceVerts[i]];
               newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
               outputCD->CopyData(cd,cellId,newCellId);
               }
             }
           break;
-       }
+        }
         //Quadratic cells
         case VTK_QUADRATIC_EDGE:
         case VTK_QUADRATIC_TRIANGLE:
@@ -487,14 +487,14 @@ VTKViewer_GeometryFilter
         case VTK_QUADRATIC_HEXAHEDRON:
         case VTK_QUADRATIC_WEDGE:
         case VTK_QUADRATIC_PYRAMID:
-         if(!myIsWireframeMode){
-           input->GetCell(cellId,cell);
-           vtkIdList *lpts = vtkIdList::New();  
-           vtkPoints *coords = vtkPoints::New();
-           vtkIdList *cellIds = vtkIdList::New();
-           vtkIdType newCellId;
-           
-           if ( cell->GetCellDimension() == 1 ) {
+          if(!myIsWireframeMode){
+            input->GetCell(cellId,cell);
+            vtkIdList *lpts = vtkIdList::New();  
+            vtkPoints *coords = vtkPoints::New();
+            vtkIdList *cellIds = vtkIdList::New();
+            vtkIdType newCellId;
+            
+            if ( cell->GetCellDimension() == 1 ) {
               vtkIdType arcResult = -1;
               if(myIsBuildArc) {
                 arcResult = Build1DArc(cellId, input, output, pts, myMaxArcAngle);
@@ -520,7 +520,7 @@ VTKViewer_GeometryFilter
                 outputCD->CopyData(cd,cellId,newCellId);
               }            
             }
-           else if ( cell->GetCellDimension() == 2 ) {
+            else if ( cell->GetCellDimension() == 2 ) {
               if(!myIsBuildArc) {
                 aCellType = VTK_TRIANGLE;
                 numFacePts = 3;
@@ -539,34 +539,34 @@ VTKViewer_GeometryFilter
                 BuildArcedPolygon(cellId,input,output,true);
               }
             } 
-           else //3D nonlinear cell
+            else //3D nonlinear cell
             {
-             aCellType = VTK_TRIANGLE;
-             numFacePts = 3;
-             for (int j=0; j < cell->GetNumberOfFaces(); j++){
-               vtkCell *face = cell->GetFace(j);
-               input->GetCellNeighbors(cellId, face->PointIds, cellIds);
-               if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ) {
-                 face->Triangulate(0,lpts,coords);
-                 for (i=0; i < lpts->GetNumberOfIds(); i+=3) {
-                   aNewPts[0] = lpts->GetId(i);
-                   aNewPts[1] = lpts->GetId(i+1);
-                   aNewPts[2] = lpts->GetId(i+2);
-                   newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-                   if(myStoreMapping)
-                     myVTK2ObjIds.push_back(cellId);
-                   outputCD->CopyData(cd,cellId,newCellId);
+              aCellType = VTK_TRIANGLE;
+              numFacePts = 3;
+              for (int j=0; j < cell->GetNumberOfFaces(); j++){
+                vtkCell *face = cell->GetFace(j);
+                input->GetCellNeighbors(cellId, face->PointIds, cellIds);
+                if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ) {
+                  face->Triangulate(0,lpts,coords);
+                  for (i=0; i < lpts->GetNumberOfIds(); i+=3) {
+                    aNewPts[0] = lpts->GetId(i);
+                    aNewPts[1] = lpts->GetId(i+1);
+                    aNewPts[2] = lpts->GetId(i+2);
+                    newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+                    if(myStoreMapping)
+                      myVTK2ObjIds.push_back(cellId);
+                    outputCD->CopyData(cd,cellId,newCellId);
                   }
                 }
               }
             } //3d nonlinear cell
-           cellIds->Delete();
-           coords->Delete();
-           lpts->Delete();
-           break;
+            cellIds->Delete();
+            coords->Delete();
+            lpts->Delete();
+            break;
           }else{
-           switch(aCellType){
-           case VTK_QUADRATIC_EDGE: {
+            switch(aCellType){
+            case VTK_QUADRATIC_EDGE: {
               vtkIdType arcResult =-1;
               if(myIsBuildArc) {
                arcResult = Build1DArc(cellId, input, output, pts,myMaxArcAngle);
@@ -575,21 +575,21 @@ VTKViewer_GeometryFilter
               if(!myIsBuildArc || arcResult == -1) {
                 aCellType = VTK_POLY_LINE;
                 numFacePts = 3;
-             
+              
                 aNewPts[0] = pts[0];
                 aNewPts[2] = pts[1];
                 aNewPts[1] = pts[2];
-             
+              
                 newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
               }
               
               if(myStoreMapping)
                 myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             break;
-           }
-           case VTK_QUADRATIC_TRIANGLE: {            
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+              break;
+            }
+            case VTK_QUADRATIC_TRIANGLE: {            
               if(!myIsBuildArc) {
                 aCellType = VTK_POLYGON;
                 numFacePts = 6;              
@@ -600,18 +600,18 @@ VTKViewer_GeometryFilter
                 aNewPts[3] = pts[4];
                 aNewPts[4] = pts[2];
                 aNewPts[5] = pts[5];
-               
+                
                 newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-               if(myStoreMapping)
-                 myVTK2ObjIds.push_back(cellId);
-               
-               outputCD->CopyData(cd,cellId,newCellId);
+                if(myStoreMapping)
+                  myVTK2ObjIds.push_back(cellId);
+                
+                outputCD->CopyData(cd,cellId,newCellId);
               }
               else 
                 BuildArcedPolygon(cellId,input,output);
               break;
-           }
-           case VTK_QUADRATIC_QUAD: {                
+            }
+            case VTK_QUADRATIC_QUAD: {                
               if(!myIsBuildArc) {
                 aCellType = VTK_POLYGON;
                 numFacePts = 8;
@@ -624,338 +624,338 @@ VTKViewer_GeometryFilter
                 aNewPts[5] = pts[6];
                 aNewPts[6] = pts[3];
                 aNewPts[7] = pts[7];
-               
+                
                 newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-               if(myStoreMapping)
-                 myVTK2ObjIds.push_back(cellId);
-               
-               outputCD->CopyData(cd,cellId,newCellId);
+                if(myStoreMapping)
+                  myVTK2ObjIds.push_back(cellId);
+                
+                outputCD->CopyData(cd,cellId,newCellId);
               }
               else 
                 BuildArcedPolygon(cellId,input,output);
               break;
-           }
-           case VTK_QUADRATIC_TETRA: {
-             aCellType = VTK_POLYGON;
-             numFacePts = 6;
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[4];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[5];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[6];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[7];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[8];
-             aNewPts[4] = pts[1];
-             aNewPts[5] = pts[4];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[1];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[9];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[5];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[2];
-             aNewPts[1] = pts[9];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[7];
-             aNewPts[4] = pts[0];
-             aNewPts[5] = pts[6];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             break;
-           }
+            }
+            case VTK_QUADRATIC_TETRA: {
+              aCellType = VTK_POLYGON;
+              numFacePts = 6;
+              
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[4];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[5];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[6];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[7];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[8];
+              aNewPts[4] = pts[1];
+              aNewPts[5] = pts[4];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[1];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[9];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[5];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[2];
+              aNewPts[1] = pts[9];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[7];
+              aNewPts[4] = pts[0];
+              aNewPts[5] = pts[6];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              break;
+            }
             case VTK_QUADRATIC_WEDGE: {
               aCellType = VTK_POLYGON;
-             numFacePts = 6;
+              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];
+              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);
+              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];
+              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);
+              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];
+              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);
+              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];
+              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);
+              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[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);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              outputCD->CopyData(cd,cellId,newCellId);
+              break;
+            }
+            case VTK_QUADRATIC_HEXAHEDRON: {
+              aCellType = VTK_POLYGON;
+              numFacePts = 8;
+              
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[17];
+              aNewPts[4] = pts[5];
+              aNewPts[5] = pts[12];
+              aNewPts[6] = pts[4];
+              aNewPts[7] = pts[16];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[1];
+              aNewPts[1] = pts[9];
+              aNewPts[2] = pts[2];
+              aNewPts[3] = pts[18];
+              aNewPts[4] = pts[6];
+              aNewPts[5] = pts[13];
+              aNewPts[6] = pts[5];
+              aNewPts[7] = pts[17];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
               outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[2];
+              aNewPts[1] = pts[10];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[19];
+              aNewPts[4] = pts[7];
+              aNewPts[5] = pts[14];
+              aNewPts[6] = pts[6];
+              aNewPts[7] = pts[18];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[3];
+              aNewPts[1] = pts[11];
+              aNewPts[2] = pts[0];
+              aNewPts[3] = pts[16];
+              aNewPts[4] = pts[4];
+              aNewPts[5] = pts[15];
+              aNewPts[6] = pts[7];
+              aNewPts[7] = pts[19];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[9];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[10];
+              aNewPts[6] = pts[3];
+              aNewPts[7] = pts[11];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+              
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[4];
+              aNewPts[1] = pts[12];
+              aNewPts[2] = pts[5];
+              aNewPts[3] = pts[13];
+              aNewPts[4] = pts[6];
+              aNewPts[5] = pts[14];
+              aNewPts[6] = pts[7];
+              aNewPts[7] = pts[15];
+              
+              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;
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[17];
-             aNewPts[4] = pts[5];
-             aNewPts[5] = pts[12];
-             aNewPts[6] = pts[4];
-             aNewPts[7] = pts[16];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[1];
-             aNewPts[1] = pts[9];
-             aNewPts[2] = pts[2];
-             aNewPts[3] = pts[18];
-             aNewPts[4] = pts[6];
-             aNewPts[5] = pts[13];
-             aNewPts[6] = pts[5];
-             aNewPts[7] = pts[17];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[2];
-             aNewPts[1] = pts[10];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[19];
-             aNewPts[4] = pts[7];
-             aNewPts[5] = pts[14];
-             aNewPts[6] = pts[6];
-             aNewPts[7] = pts[18];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[3];
-             aNewPts[1] = pts[11];
-             aNewPts[2] = pts[0];
-             aNewPts[3] = pts[16];
-             aNewPts[4] = pts[4];
-             aNewPts[5] = pts[15];
-             aNewPts[6] = pts[7];
-             aNewPts[7] = pts[19];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[9];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[10];
-             aNewPts[6] = pts[3];
-             aNewPts[7] = pts[11];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[4];
-             aNewPts[1] = pts[12];
-             aNewPts[2] = pts[5];
-             aNewPts[3] = pts[13];
-             aNewPts[4] = pts[6];
-             aNewPts[5] = pts[14];
-             aNewPts[6] = pts[7];
-             aNewPts[7] = pts[15];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-             
-             break;
-           }
-           case VTK_QUADRATIC_PYRAMID: {
-             aCellType = VTK_POLYGON;
-             numFacePts = 6;
-             
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[8];
-             aNewPts[2] = pts[3];
-             aNewPts[3] = pts[12];
-             aNewPts[4] = pts[4];
-             aNewPts[5] = pts[9];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[9];
-             aNewPts[2] = pts[4];
-             aNewPts[3] = pts[10];
-             aNewPts[4] = pts[1];
-             aNewPts[5] = pts[5];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[1];
-             aNewPts[1] = pts[10];
-             aNewPts[2] = pts[4];
-             aNewPts[3] = pts[11];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[6];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
-             aNewPts[0] = pts[2];
-             aNewPts[1] = pts[11];
-             aNewPts[2] = pts[4];
-             aNewPts[3] = pts[12];
-             aNewPts[4] = pts[3];
-             aNewPts[5] = pts[7];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             //---------------------------------------------------------------
+            case VTK_QUADRATIC_PYRAMID: {
+              aCellType = VTK_POLYGON;
+              numFacePts = 6;
+              
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[8];
+              aNewPts[2] = pts[3];
+              aNewPts[3] = pts[12];
+              aNewPts[4] = pts[4];
+              aNewPts[5] = pts[9];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[9];
+              aNewPts[2] = pts[4];
+              aNewPts[3] = pts[10];
+              aNewPts[4] = pts[1];
+              aNewPts[5] = pts[5];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[1];
+              aNewPts[1] = pts[10];
+              aNewPts[2] = pts[4];
+              aNewPts[3] = pts[11];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[6];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
+              aNewPts[0] = pts[2];
+              aNewPts[1] = pts[11];
+              aNewPts[2] = pts[4];
+              aNewPts[3] = pts[12];
+              aNewPts[4] = pts[3];
+              aNewPts[5] = pts[7];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              //---------------------------------------------------------------
               numFacePts = 8;
-             aNewPts[0] = pts[0];
-             aNewPts[1] = pts[5];
-             aNewPts[2] = pts[1];
-             aNewPts[3] = pts[6];
-             aNewPts[4] = pts[2];
-             aNewPts[5] = pts[7];
-             aNewPts[6] = pts[3];
-             aNewPts[7] = pts[8];
-             
-             newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
-             if(myStoreMapping)
-               myVTK2ObjIds.push_back(cellId);
-             
-             outputCD->CopyData(cd,cellId,newCellId);
-
-             break;
-           }}
-         }
-       } //switch
+              aNewPts[0] = pts[0];
+              aNewPts[1] = pts[5];
+              aNewPts[2] = pts[1];
+              aNewPts[3] = pts[6];
+              aNewPts[4] = pts[2];
+              aNewPts[5] = pts[7];
+              aNewPts[6] = pts[3];
+              aNewPts[7] = pts[8];
+              
+              newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+              if(myStoreMapping)
+                myVTK2ObjIds.push_back(cellId);
+              
+              outputCD->CopyData(cd,cellId,newCellId);
+
+              break;
+            }}
+          }
+        } //switch
       } //if visible
     } //for all cells
     
@@ -1168,15 +1168,15 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId, vtkUnstructur
       aNewPts[2] = output->GetPoints()->InsertNextPoint(coords->GetPoint(i+2));
 
       if(outputScalars) {
-       outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i)]);
-       outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i+1)]);
-       outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i+2)]);
+        outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i)]);
+        outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i+1)]);
+        outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i+2)]);
       }
 
       aTriangleId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
 
       if(myStoreMapping)
-       myVTK2ObjIds.push_back(cellId);
+        myVTK2ObjIds.push_back(cellId);
       outputCD->CopyData(cd,cellId,aTriangleId);          
     }
     pts->Delete();
@@ -1188,7 +1188,7 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId, vtkUnstructur
     aNbPoints = MergevtkPoints(aCollection, aScalarCollection, output->GetPoints(), aPntId2ScalarValue, aNewPoints);
     if(outputScalars)
       for(vtkIdType i = 0; i < aNbPoints; i++)
-       outputScalars->InsertNextTuple1(aPntId2ScalarValue[aNewPoints[i]]);
+        outputScalars->InsertNextTuple1(aPntId2ScalarValue[aNewPoints[i]]);
     newCellId = output->InsertNextCell(aCellType,aNbPoints,aNewPoints);
     outputCD->CopyData(cd,cellId,newCellId);
 
index e69a47edf5092b0bf2fbcbf6685408be5475f217..6a11d6eda760125504d02622d27a515d4e3725d5 100644 (file)
@@ -68,12 +68,12 @@ static int GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId)
     float aMinDist = 1000000.0, aDist = 0;
     for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){
       if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){
-       int subId;  float pcoords[3], closestPoint[3], weights[3];
-       aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
-       if (aDist < aMinDist) {
-         aMinDist = aDist;
-         anEdgeId = i;
-       }
+        int subId;  float pcoords[3], closestPoint[3], weights[3];
+        aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
+        if (aDist < aMinDist) {
+          aMinDist = aDist;
+          anEdgeId = i;
+        }
       }
     }
   }
@@ -120,7 +120,7 @@ VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle()
  *\param theWidth - width..
  */
 void VTKViewer_InteractorStyle::setPreselectionProp(const double& theRed, const double& theGreen, 
-                                                         const double& theBlue, const int& theWidth) 
+                                                          const double& theBlue, const int& theWidth) 
 {
   if ( myPreSelectionActor->GetProperty() == 0 )
     return;
@@ -235,9 +235,9 @@ void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
     }
 
   double newAngle = atan2((double)(y - this->CurrentRenderer->GetCenter()[1]),
-                         (double)(x - this->CurrentRenderer->GetCenter()[0]));
+                          (double)(x - this->CurrentRenderer->GetCenter()[0]));
   double oldAngle = atan2((double)(oldY -this->CurrentRenderer->GetCenter()[1]),
-                         (double)(oldX - this->CurrentRenderer->GetCenter()[0]));
+                          (double)(oldX - this->CurrentRenderer->GetCenter()[0]));
   
   newAngle *= this->RadianToDegree;
   oldAngle *= this->RadianToDegree;
@@ -258,8 +258,8 @@ void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
  *\param y - y coordinate
  */
 void VTKViewer_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl), 
-                                                 int shift,
-                                                 int x, int y) 
+                                                  int shift,
+                                                  int x, int y) 
 {
   myShiftState = shift;
   if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
@@ -276,7 +276,7 @@ void VTKViewer_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl),
  *\param y - y coordinate
  */
 void VTKViewer_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, 
-                                                      int x, int y) 
+                                                       int x, int y) 
 {
   if (this->HasObserver(vtkCommand::LeftButtonPressEvent)) {
     this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
@@ -312,9 +312,9 @@ void VTKViewer_InteractorStyle::OnLeftButtonDown(int ctrl, int shift,
  *\param y - y coordinate (not used)
  */
 void VTKViewer_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
-                                                    int shift, 
-                                                    int vtkNotUsed(x),
-                                                    int vtkNotUsed(y))
+                                                     int shift, 
+                                                     int vtkNotUsed(x),
+                                                     int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -332,8 +332,8 @@ void VTKViewer_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
  *\param y - y coordinate
  */
 void VTKViewer_InteractorStyle::OnMiddleButtonDown(int ctrl,
-                                                        int shift, 
-                                                        int x, int y) 
+                                                         int shift, 
+                                                         int x, int y) 
 {
   if (this->HasObserver(vtkCommand::MiddleButtonPressEvent)) 
     {
@@ -369,9 +369,9 @@ void VTKViewer_InteractorStyle::OnMiddleButtonDown(int ctrl,
  *\param y - y coordinate (not used)
  */
 void VTKViewer_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
-                                                      int shift, 
-                                                      int vtkNotUsed(x),
-                                                      int vtkNotUsed(y))
+                                                       int shift, 
+                                                       int vtkNotUsed(x),
+                                                       int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -389,8 +389,8 @@ void VTKViewer_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
  *\param y - y coordinate
  */
 void VTKViewer_InteractorStyle::OnRightButtonDown(int ctrl,
-                                                       int shift, 
-                                                       int x, int y) 
+                                                        int shift, 
+                                                        int x, int y) 
 {
   if (this->HasObserver(vtkCommand::RightButtonPressEvent)) 
     {
@@ -425,9 +425,9 @@ void VTKViewer_InteractorStyle::OnRightButtonDown(int ctrl,
  *\param y - y coordinate (not used)
  */
 void VTKViewer_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl),
-                                                     int shift, 
-                                                     int vtkNotUsed(x),
-                                                     int vtkNotUsed(y))
+                                                      int shift, 
+                                                      int vtkNotUsed(x),
+                                                      int vtkNotUsed(y))
 {
   myShiftState = shift;
   // finishing current viewer operation
@@ -863,256 +863,256 @@ void VTKViewer_InteractorStyle::onFinishOperation()
       }
       else {
         if (myPoint == myOtherPoint) {
-         // process point selection
+          // process point selection
           int w, h, x, y;
           m_Interactor->GetSize(w, h);
           x = myPoint.x(); 
           y = h - myPoint.y() - 1;
 
           this->FindPokedRenderer(x, y);
-         m_Interactor->StartPickCallback();
+          m_Interactor->StartPickCallback();
 
-         vtkPicker* aPicker = vtkPicker::SafeDownCast(m_Interactor->GetPicker());
+          vtkPicker* aPicker = vtkPicker::SafeDownCast(m_Interactor->GetPicker());
           aPicker->Pick(x, y, 0.0, this->CurrentRenderer);
     
-         SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
+          SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
 
           if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) {
-           int aVtkId = picker->GetCellId();
-           if ( aVtkId >= 0 && SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
-             int anObjId = SActor->GetElemObjId(aVtkId);
-             if(anObjId >= 0){
-               Handle(SALOME_InteractiveObject) IO = SActor->getIO();
-               if(aSelectionMode != EdgeOfCellSelection) {
-                 if(CheckDimensionId(aSelectionMode,SActor,anObjId)){
-                   if (IsSelected(IO,aSel)) {
-                     // This IO is already in the selection
-                     aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
-                   } else {
-                     if (!myShiftState) {
-                       this->HighlightProp( NULL );
-                       aSel->ClearIObjects();
-                     }
-                     aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
-                     aSel->AddIObject( IO, false );
-                   }
-                 }
-               }else{
-                 if (!myShiftState) {
-                   this->HighlightProp( NULL );
-                   aSel->ClearIObjects();
-                 }
-                 int anEdgeId = GetEdgeId(picker,SActor,anObjId);
-                 if (anEdgeId >= 0) {
-                   aSel->AddOrRemoveIndex( IO, anObjId, true, false);
-                   aSel->AddOrRemoveIndex( IO, -anEdgeId-1, true, true );
-                   aSel->AddIObject( IO, false );
-                 } 
-               }
-             }
-           } else {
-             this->HighlightProp( NULL );
-             aSel->ClearIObjects();
-           }
+            int aVtkId = picker->GetCellId();
+            if ( aVtkId >= 0 && SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
+              int anObjId = SActor->GetElemObjId(aVtkId);
+              if(anObjId >= 0){
+                Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+                if(aSelectionMode != EdgeOfCellSelection) {
+                  if(CheckDimensionId(aSelectionMode,SActor,anObjId)){
+                    if (IsSelected(IO,aSel)) {
+                      // This IO is already in the selection
+                      aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+                    } else {
+                      if (!myShiftState) {
+                        this->HighlightProp( NULL );
+                        aSel->ClearIObjects();
+                      }
+                      aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+                      aSel->AddIObject( IO, false );
+                    }
+                  }
+                }else{
+                  if (!myShiftState) {
+                    this->HighlightProp( NULL );
+                    aSel->ClearIObjects();
+                  }
+                  int anEdgeId = GetEdgeId(picker,SActor,anObjId);
+                  if (anEdgeId >= 0) {
+                    aSel->AddOrRemoveIndex( IO, anObjId, true, false);
+                    aSel->AddOrRemoveIndex( IO, -anEdgeId-1, true, true );
+                    aSel->AddIObject( IO, false );
+                  
+                }
+              }
+            } else {
+              this->HighlightProp( NULL );
+              aSel->ClearIObjects();
+            }
           } else if ( vtkPointPicker* picker = vtkPointPicker::SafeDownCast(aPicker) ) {
-           int aVtkId = picker->GetPointId();
-           if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
-             if ( SActor && SActor->hasIO() ) {
-               int anObjId = SActor->GetNodeObjId(aVtkId);
-               if(anObjId >= 0){
-                 Handle(SALOME_InteractiveObject) IO = SActor->getIO();
-                 if(IsSelected(IO,aSel)) {
-                   // This IO is already in the selection
-                   aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
-                 } else {
-                   if(!myShiftState) {
-                     this->HighlightProp( NULL );
-                     aSel->ClearIObjects();
-                   }
-                   aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
-                   aSel->AddIObject( IO, false );
-                 }
-               }
-             }
-           } else {
-             this->HighlightProp( NULL );
-             aSel->ClearIObjects();
-           } 
-         } else {
-           if ( SActor && SActor->hasIO() ) {
-             this->PropPicked++;
-             Handle(SALOME_InteractiveObject) IO = SActor->getIO();
-             if(IsSelected(IO,aSel)) {
-               // This IO is already in the selection
-               if(myShiftState) {
-                 aSel->RemoveIObject(IO);
-               }
-             }
-             else {
-               if(!myShiftState) {
-                 this->HighlightProp( NULL );
-                 aSel->ClearIObjects();
-               }
-               aSel->AddIObject( IO, false );
-             }
-           }else{
-             // No selection clear all
-             this->PropPicked = 0;
-             this->HighlightProp( NULL );
-             aSel->ClearIObjects();
-           }
-         }
-         m_Interactor->EndPickCallback();
+            int aVtkId = picker->GetPointId();
+            if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
+              if ( SActor && SActor->hasIO() ) {
+                int anObjId = SActor->GetNodeObjId(aVtkId);
+                if(anObjId >= 0){
+                  Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+                  if(IsSelected(IO,aSel)) {
+                    // This IO is already in the selection
+                    aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+                  } else {
+                    if(!myShiftState) {
+                      this->HighlightProp( NULL );
+                      aSel->ClearIObjects();
+                    }
+                    aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+                    aSel->AddIObject( IO, false );
+                  }
+                }
+              }
+            } else {
+              this->HighlightProp( NULL );
+              aSel->ClearIObjects();
+            
+          } else {
+            if ( SActor && SActor->hasIO() ) {
+              this->PropPicked++;
+              Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+              if(IsSelected(IO,aSel)) {
+                // This IO is already in the selection
+                if(myShiftState) {
+                  aSel->RemoveIObject(IO);
+                }
+              }
+              else {
+                if(!myShiftState) {
+                  this->HighlightProp( NULL );
+                  aSel->ClearIObjects();
+                }
+                aSel->AddIObject( IO, false );
+              }
+            }else{
+              // No selection clear all
+              this->PropPicked = 0;
+              this->HighlightProp( NULL );
+              aSel->ClearIObjects();
+            }
+          }
+          m_Interactor->EndPickCallback();
         } else {
           //processing rectangle selection
-         QString aComponentDataType = SUIT_Application::getDesktop()->getComponentDataType();
-         if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
-         m_Interactor->StartPickCallback();
-
-         if (!myShiftState) {
-           this->PropPicked = 0;
-           this->HighlightProp( NULL );
-           aSel->ClearIObjects();
-         }
-
-         // Compute bounds
-         //      vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
-         QRect rect(myPoint, myOtherPoint);
-         rect = rect.normalize();
-         int w, h;
-         m_Interactor->GetSize(w, h);
-         int x1, y1, x2, y2;
-         x1 = rect.left(); 
-         y1 = h - rect.top() - 1;
-         x2 = rect.right(); 
-         y2 = h - rect.bottom() - 1;
-
-         switch (aSelectionMode) {
-         case NodeSelection: {
-           if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(m_Interactor->GetPicker()) ) {
-             vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
-             aListActors->InitTraversal();
-             while (vtkActor* aActor = aListActors->GetNextActor()) {
-               if (!aActor->GetVisibility()) 
-                 continue;
-               if(SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (SActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) IO = SActor->getIO();
-                   if (IO.IsNull()) 
-                     continue;
-                   if (aSelActiveCompOnly && aComponentDataType != IO->getComponentDataType())
-                     continue;
-                   if (vtkDataSet* aDataSet = SActor->GetInput()) {
-                     SALOME_Selection::TContainerOfId anIndices;
-                     for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
-                       float aPoint[3];
-                       aDataSet->GetPoint(i,aPoint);
-                       if (IsInRect(aPoint,x1,y1,x2,y2)){
-                         float aDisp[3];
-                         ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
-                         if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
-                           if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
-                             if(anActorCollection->IsItemPresent(SActor)){
-                               float aPickedPoint[3];
-                               aPointPicker->GetMapperPosition(aPickedPoint);
-                               vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
-                               if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ){
-                                 int anObjId = SActor->GetNodeObjId(aVtkId);
-                                 anIndices.insert(anObjId);
-                               }
-                             }
-                           }
-                         }
-                       }
-                     }
-                     if (!anIndices.empty()) {
-                       aSel->AddOrRemoveIndex(IO, anIndices, true, false);
-                       aSel->AddIObject(IO, false);
-                       anIndices.clear();
-                     }else{
-                       aSel->RemoveIObject(IO, false);
-                     }
-                   }
-                 }
-               }
-             }
-           }
-           break;
-         }
-         case CellSelection:
-         case EdgeOfCellSelection:
-         case EdgeSelection:
-         case FaceSelection:
-         case VolumeSelection: 
-           {
-             vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
-             picker->SetTolerance(0.001);
-             picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
-             
-             vtkActorCollection* aListActors = picker->GetActors();
-             aListActors->InitTraversal();
-             while(vtkActor* aActor = aListActors->GetNextActor()) {
-               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (aSActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
-                   if (aSelActiveCompOnly && aComponentDataType != aIO->getComponentDataType())
-                     continue;
-                   VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
-                   if ( !cellList.empty() ) {
-                     SALOME_Selection::TContainerOfId anIndexes;
-                     VTKViewer_CellDataSet::iterator it;
-                     for ( it = cellList.begin(); it != cellList.end(); ++it ) {
-                       int aCellId = (*it).cellId;
-                       
-                       if ( !IsValid( aSActor, aCellId ) )
-                         continue;
-                       
-                       int anObjId = aSActor->GetElemObjId(aCellId);
-                       if (anObjId != -1){
-                         if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
-                           anIndexes.insert(anObjId);
-                         }
-                       }
-                     }
-                     aSel->AddOrRemoveIndex(aIO, anIndexes, true, false);
-                     aSel->AddIObject(aIO, false);
-                   }
-                 }
-               }
-             }
-           }
-           break;          
-         case ActorSelection: // objects selection
-           {
-             vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
-             picker->SetTolerance(0.001);
-             picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
-
-             vtkActorCollection* aListActors = picker->GetActors();
-             SALOME_ListIO aListIO;
-             aListActors->InitTraversal();
-             while(vtkActor* aActor = aListActors->GetNextActor()) {
-               if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
-                 if (aSActor->hasIO()) {
-                   Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
-                   if (!IsStored(aIO,aListIO))
-                     aListIO.Append(aIO);
-                 }
-               }
-             }
-             if (!aListIO.IsEmpty()) {
-               SALOME_ListIteratorOfListIO It(aListIO);
-               for(;It.More();It.Next()) {
-                 Handle(SALOME_InteractiveObject) IOS = It.Value();
-                 this->PropPicked++;
-                 aSel->AddIObject( IOS, false );
-               }
-             }
-           } // end case 4
-         } //end switch
-         m_Interactor->EndPickCallback();
-       }
-       aActiveStudy->update3dViewers();
+          QString aComponentDataType = SUIT_Application::getDesktop()->getComponentDataType();
+          if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
+          m_Interactor->StartPickCallback();
+
+          if (!myShiftState) {
+            this->PropPicked = 0;
+            this->HighlightProp( NULL );
+            aSel->ClearIObjects();
+          }
+
+          // Compute bounds
+          //      vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
+          QRect rect(myPoint, myOtherPoint);
+          rect = rect.normalize();
+          int w, h;
+          m_Interactor->GetSize(w, h);
+          int x1, y1, x2, y2;
+          x1 = rect.left(); 
+          y1 = h - rect.top() - 1;
+          x2 = rect.right(); 
+          y2 = h - rect.bottom() - 1;
+
+          switch (aSelectionMode) {
+          case NodeSelection: {
+            if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(m_Interactor->GetPicker()) ) {
+              vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
+              aListActors->InitTraversal();
+              while (vtkActor* aActor = aListActors->GetNextActor()) {
+                if (!aActor->GetVisibility()) 
+                  continue;
+                if(SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aActor)) {
+                  if (SActor->hasIO()) {
+                    Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+                    if (IO.IsNull()) 
+                      continue;
+                    if (aSelActiveCompOnly && aComponentDataType != IO->getComponentDataType())
+                      continue;
+                    if (vtkDataSet* aDataSet = SActor->GetInput()) {
+                      SALOME_Selection::TContainerOfId anIndices;
+                      for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
+                        float aPoint[3];
+                        aDataSet->GetPoint(i,aPoint);
+                        if (IsInRect(aPoint,x1,y1,x2,y2)){
+                          float aDisp[3];
+                          ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
+                          if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
+                            if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
+                              if(anActorCollection->IsItemPresent(SActor)){
+                                float aPickedPoint[3];
+                                aPointPicker->GetMapperPosition(aPickedPoint);
+                                vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
+                                if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ){
+                                  int anObjId = SActor->GetNodeObjId(aVtkId);
+                                  anIndices.insert(anObjId);
+                                }
+                              }
+                            }
+                          }
+                        }
+                      }
+                      if (!anIndices.empty()) {
+                        aSel->AddOrRemoveIndex(IO, anIndices, true, false);
+                        aSel->AddIObject(IO, false);
+                        anIndices.clear();
+                      }else{
+                        aSel->RemoveIObject(IO, false);
+                      }
+                    }
+                  }
+                }
+              }
+            }
+            break;
+          }
+          case CellSelection:
+          case EdgeOfCellSelection:
+          case EdgeSelection:
+          case FaceSelection:
+          case VolumeSelection: 
+            {
+              vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
+              picker->SetTolerance(0.001);
+              picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
+              
+              vtkActorCollection* aListActors = picker->GetActors();
+              aListActors->InitTraversal();
+              while(vtkActor* aActor = aListActors->GetNextActor()) {
+                if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
+                  if (aSActor->hasIO()) {
+                    Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
+                    if (aSelActiveCompOnly && aComponentDataType != aIO->getComponentDataType())
+                      continue;
+                    VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
+                    if ( !cellList.empty() ) {
+                      SALOME_Selection::TContainerOfId anIndexes;
+                      VTKViewer_CellDataSet::iterator it;
+                      for ( it = cellList.begin(); it != cellList.end(); ++it ) {
+                        int aCellId = (*it).cellId;
+                        
+                        if ( !IsValid( aSActor, aCellId ) )
+                          continue;
+                        
+                        int anObjId = aSActor->GetElemObjId(aCellId);
+                        if (anObjId != -1){
+                          if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
+                            anIndexes.insert(anObjId);
+                          }
+                        }
+                      }
+                      aSel->AddOrRemoveIndex(aIO, anIndexes, true, false);
+                      aSel->AddIObject(aIO, false);
+                    }
+                  }
+                }
+              }
+            }
+            break;          
+          case ActorSelection: // objects selection
+            {
+              vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
+              picker->SetTolerance(0.001);
+              picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
+
+              vtkActorCollection* aListActors = picker->GetActors();
+              SALOME_ListIO aListIO;
+              aListActors->InitTraversal();
+              while(vtkActor* aActor = aListActors->GetNextActor()) {
+                if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
+                  if (aSActor->hasIO()) {
+                    Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
+                    if (!IsStored(aIO,aListIO))
+                      aListIO.Append(aIO);
+                  }
+                }
+              }
+              if (!aListIO.IsEmpty()) {
+                SALOME_ListIteratorOfListIO It(aListIO);
+                for(;It.More();It.Next()) {
+                  Handle(SALOME_InteractiveObject) IOS = It.Value();
+                  this->PropPicked++;
+                  aSel->AddIObject( IOS, false );
+                }
+              }
+            } // end case 4
+          } //end switch
+          m_Interactor->EndPickCallback();
+        }
+        aActiveStudy->update3dViewers();
       } 
     } 
     break;
@@ -1230,36 +1230,36 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) {
     if ( aVtkId >= 0 ) {
       int anObjId = SActor->GetElemObjId(aVtkId);
       if ( SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
-       bool anIsSameObjId = (mySelectedActor == SActor && myElemId == anObjId);
-       bool aResult = anIsSameObjId;
-       if(!anIsSameObjId) {
-         if(aSelectionMode != EdgeOfCellSelection) {
-           aResult = CheckDimensionId(aSelectionMode,SActor,anObjId);
-           if(aResult){
-             mySelectedActor = SActor;
-             myElemId = anObjId;
-             m_Interactor->setCellData(anObjId,SActor,myPreSelectionActor);
-           }
-         }
-       }
-       if(aSelectionMode == EdgeOfCellSelection){
-         int anEdgeId = GetEdgeId(picker,SActor,anObjId);
-         bool anIsSameEdgeId = (myEdgeId != anEdgeId) && anIsSameObjId;
-         aResult = anIsSameEdgeId;
-         if(!anIsSameEdgeId) {
-           aResult = (anEdgeId >= 0);
-           if (aResult) {
-             mySelectedActor = SActor;
-             myEdgeId = anEdgeId;
-             myElemId = anObjId;
-             m_Interactor->setEdgeData(anObjId,SActor,-anEdgeId-1,myPreSelectionActor);
-           } 
-         }
-       }
-       if(aResult) {
-         myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
-         myPreSelectionActor->SetVisibility(true);
-       }
+        bool anIsSameObjId = (mySelectedActor == SActor && myElemId == anObjId);
+        bool aResult = anIsSameObjId;
+        if(!anIsSameObjId) {
+          if(aSelectionMode != EdgeOfCellSelection) {
+            aResult = CheckDimensionId(aSelectionMode,SActor,anObjId);
+            if(aResult){
+              mySelectedActor = SActor;
+              myElemId = anObjId;
+              m_Interactor->setCellData(anObjId,SActor,myPreSelectionActor);
+            }
+          }
+        }
+        if(aSelectionMode == EdgeOfCellSelection){
+          int anEdgeId = GetEdgeId(picker,SActor,anObjId);
+          bool anIsSameEdgeId = (myEdgeId != anEdgeId) && anIsSameObjId;
+          aResult = anIsSameEdgeId;
+          if(!anIsSameEdgeId) {
+            aResult = (anEdgeId >= 0);
+            if (aResult) {
+              mySelectedActor = SActor;
+              myEdgeId = anEdgeId;
+              myElemId = anObjId;
+              m_Interactor->setEdgeData(anObjId,SActor,-anEdgeId-1,myPreSelectionActor);
+            
+          }
+        }
+        if(aResult) {
+          myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
+          myPreSelectionActor->SetVisibility(true);
+        }
       }
     }
   }
@@ -1267,44 +1267,44 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) {
     int aVtkId = picker->GetPointId();
     if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
       if ( SActor && SActor->hasIO() ) {
-       int anObjId = SActor->GetNodeObjId(aVtkId);
-       bool anIsSameObjId = (mySelectedActor == SActor && myNodeId == anObjId);
-       if(!anIsSameObjId) {
-         mySelectedActor = SActor;
-         myNodeId = anObjId;
-         m_Interactor->setPointData(anObjId,SActor,myPreSelectionActor);
-       }
-       myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
-       myPreSelectionActor->SetVisibility(true);
+        int anObjId = SActor->GetNodeObjId(aVtkId);
+        bool anIsSameObjId = (mySelectedActor == SActor && myNodeId == anObjId);
+        if(!anIsSameObjId) {
+          mySelectedActor = SActor;
+          myNodeId = anObjId;
+          m_Interactor->setPointData(anObjId,SActor,myPreSelectionActor);
+        }
+        myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
+        myPreSelectionActor->SetVisibility(true);
       }
     }
   }
   else if ( vtkPicker::SafeDownCast(aPicker) ) {
     if ( SActor ) {
       if ( myPreViewActor != SActor ) {
-       if ( myPreViewActor != NULL ) {
-         myPreViewActor->SetPreSelected( false );
-       }
-       myPreViewActor = SActor;
-             
-       if ( SActor->hasIO() ) {
-         Handle( SALOME_InteractiveObject) IO = SActor->getIO();
-         if ( !IsSelected(IO,Sel) ) {
+        if ( myPreViewActor != NULL ) {
+          myPreViewActor->SetPreSelected( false );
+        }
+        myPreViewActor = SActor;
+              
+        if ( SActor->hasIO() ) {
+          Handle( SALOME_InteractiveObject) IO = SActor->getIO();
+          if ( !IsSelected(IO,Sel) ) {
             // Find All actors with same IO
-           vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
-           theActors->InitTraversal();
-           while( vtkActor *ac = theActors->GetNextActor() ) {
-             if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
-               if ( anActor->hasIO() ) {
-                 Handle(SALOME_InteractiveObject) IOS = anActor->getIO();
-                 if(IO->isSame(IOS)) {
-                   anActor->SetPreSelected( true );
-                 }
-               }
-             }
-           }
-         }
-       }
+            vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
+            theActors->InitTraversal();
+            while( vtkActor *ac = theActors->GetNextActor() ) {
+              if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
+                if ( anActor->hasIO() ) {
+                  Handle(SALOME_InteractiveObject) IOS = anActor->getIO();
+                  if(IO->isSame(IOS)) {
+                    anActor->SetPreSelected( true );
+                  }
+                }
+              }
+            }
+          }
+        }
       }
     } else {
       myPreViewActor = NULL;
@@ -1359,13 +1359,13 @@ void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int f
   cam->GetFocalPoint(viewFocus);
 
   this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
-                             viewFocus[2], viewFocus);
+                              viewFocus[2], viewFocus);
   focalDepth = viewFocus[2];
 
   this->ComputeDisplayToWorld(vtkFloatingPointType(toX), vtkFloatingPointType(toY),
-                             focalDepth, newPickPoint);
+                              focalDepth, newPickPoint);
   this->ComputeDisplayToWorld(vtkFloatingPointType(fromX),vtkFloatingPointType(fromY),
-                             focalDepth, oldPickPoint);
+                              focalDepth, oldPickPoint);
   
   // camera motion is reversed
   motionVector[0] = oldPickPoint[0] - newPickPoint[0];
@@ -1375,18 +1375,18 @@ void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int f
   cam->GetFocalPoint(viewFocus);
   cam->GetPosition(viewPoint);
   cam->SetFocalPoint(motionVector[0] + viewFocus[0],
-                    motionVector[1] + viewFocus[1],
-                    motionVector[2] + viewFocus[2]);
+                     motionVector[1] + viewFocus[1],
+                     motionVector[2] + viewFocus[2]);
   cam->SetPosition(motionVector[0] + viewPoint[0],
-                  motionVector[1] + viewPoint[1],
-                  motionVector[2] + viewPoint[2]);
+                   motionVector[1] + viewPoint[1],
+                   motionVector[2] + viewPoint[2]);
 }
 
 
 /*! Checks: is the given Actor within display coordinates?*/
 bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor, 
-                                              const int left, const int top, 
-                                              const int right, const int bottom)
+                                               const int left, const int top, 
+                                               const int right, const int bottom)
 {
   vtkFloatingPointType* aBounds = theActor->GetBounds();
   vtkFloatingPointType aMin[3], aMax[3];
@@ -1409,8 +1409,8 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor,
 
 /*! Checks: is the given Cell within display coordinates?*/
 bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, 
-                                              const int left, const int top, 
-                                              const int right, const int bottom)
+                                               const int left, const int top, 
+                                               const int right, const int bottom)
 {
   vtkFloatingPointType* aBounds = theCell->GetBounds();
   vtkFloatingPointType aMin[3], aMax[3];
@@ -1432,8 +1432,8 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell,
 
 /*!Checks: is given point \a thePoint in rectangle*/
 bool VTKViewer_InteractorStyle::IsInRect(vtkFloatingPointType* thePoint, 
-                                        const int left, const int top, 
-                                        const int right, const int bottom)
+                                         const int left, const int top, 
+                                         const int right, const int bottom)
 {
   vtkFloatingPointType aPnt[3];
   ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
index a3e36e0976d54ba93f4a7a240225375dd63bfb0f..f7391b19c360c127873b21eb5e4ab2ee00478fb3 100644 (file)
@@ -78,7 +78,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
 
   void setTriedron(VTKViewer_Trihedron* theTrihedron);
   void setPreselectionProp(const double& theRed = 0, const double& theGreen = 1,
-                          const double& theBlue = 1, const int& theWidth = 5);
+                           const double& theBlue = 1, const int& theWidth = 5);
 
   // Generic event bindings must be overridden in subclasses
   void OnMouseMove  (int ctrl, int shift, int x, int y);
@@ -121,14 +121,14 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   void Place(const int theX, const int theY);
   void TranslateView(int toX, int toY, int fromX, int fromY);
   bool IsInRect(vtkActor* theActor, 
-               const int left, const int top, 
-               const int right, const int bottom);
+                const int left, const int top, 
+                const int right, const int bottom);
   bool IsInRect(vtkCell* theCell, 
-               const int left, const int top, 
-               const int right, const int bottom);
+                const int left, const int top, 
+                const int right, const int bottom);
   bool IsInRect(vtkFloatingPointType* thePoint, 
-               const int left, const int top, 
-               const int right, const int bottom);
+                const int left, const int top, 
+                const int right, const int bottom);
 
   int State;
   vtkFloatingPointType MotionFactor;
index e3039a3a4eeff294a27ff19d86264b1b1c2f42b2..62ad380d2292f9322486bcbee999310d9a3f058b 100755 (executable)
@@ -150,7 +150,7 @@ void VTKViewer_RenderWindow::onChangeBackgroundColor()
   vtkRenderer * theRenderer = theRenderers->GetNextItem();
   theRenderer->GetBackground(backint);
 
-  QColor selColor = QColorDialog::getColor ( QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)), NULL );    
+  QColor selColor = QColorDialog::getColor ( QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)), NULL );     
   if ( selColor.isValid() ) {
     theRenderer->SetBackground( selColor.red()/255., selColor.green()/255., selColor.blue()/255. ); 
     /* VSR : PAL5420 ---------------------------------------------------
index 4bb2dfab73961b67031deeaf0516214753b44481..8e6a7faef31b2f720a7f19a0d5db3397b3b576ad 100755 (executable)
@@ -391,8 +391,8 @@ void VTKViewer_RenderWindowInteractor::LeftButtonPressed(const QMouseEvent *even
     return ;
   }
   myInteractorStyle->OnLeftButtonDown((event->modifiers() & Qt::ControlModifier), 
-                                     (event->modifiers() & Qt::ShiftModifier), 
-                                     event->x(), event->y());
+                                      (event->modifiers() & Qt::ShiftModifier), 
+                                      event->x(), event->y());
 }
 
 /*!Reaction on left button releases.\n
@@ -404,8 +404,8 @@ void VTKViewer_RenderWindowInteractor::LeftButtonReleased(const QMouseEvent *eve
     return ;
   }
   myInteractorStyle->OnLeftButtonUp( (event->modifiers() & Qt::ControlModifier), 
-                                    (event->modifiers() & Qt::ShiftModifier), 
-                                    event->x(), event->y() ) ;
+                                     (event->modifiers() & Qt::ShiftModifier), 
+                                     event->x(), event->y() ) ;
 }
 
 /*!Reaction on middle button pressed.\n
@@ -417,8 +417,8 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonPressed(const QMouseEvent *ev
     return ;
   }
   myInteractorStyle->OnMiddleButtonDown((event->modifiers() & Qt::ControlModifier), 
-                                       (event->modifiers() & Qt::ShiftModifier), 
-                                       event->x(), event->y() ) ;
+                                        (event->modifiers() & Qt::ShiftModifier), 
+                                        event->x(), event->y() ) ;
 }
 
 /*!Reaction on middle button released.\n
@@ -430,8 +430,8 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonReleased(const QMouseEvent *e
     return ;
   }
   myInteractorStyle->OnMiddleButtonUp( (event->modifiers() & Qt::ControlModifier), 
-                                      (event->modifiers() & Qt::ShiftModifier), 
-                                      event->x(), event->y() ) ;
+                                       (event->modifiers() & Qt::ShiftModifier), 
+                                       event->x(), event->y() ) ;
 }
 
 /*!Reaction on right button pressed.\n
@@ -443,8 +443,8 @@ void VTKViewer_RenderWindowInteractor::RightButtonPressed(const QMouseEvent *eve
     return ;
   }
   myInteractorStyle->OnRightButtonDown( (event->modifiers() & Qt::ControlModifier), 
-                                       (event->modifiers() & Qt::ShiftModifier), 
-                                       event->x(), event->y() ) ;
+                                        (event->modifiers() & Qt::ShiftModifier), 
+                                        event->x(), event->y() ) ;
 }
 
 /*!Reaction on right button released.\n
@@ -457,8 +457,8 @@ void VTKViewer_RenderWindowInteractor::RightButtonReleased(const QMouseEvent *ev
   }
   bool isOperation = myInteractorStyle->CurrentState() != VTK_INTERACTOR_STYLE_CAMERA_NONE;
   myInteractorStyle->OnRightButtonUp( (event->modifiers() & Qt::ControlModifier),
-                                     (event->modifiers() & Qt::ShiftModifier),
-                                     event->x(), event->y() );
+                                      (event->modifiers() & Qt::ShiftModifier),
+                                      event->x(), event->y() );
   if ( !isOperation )
   {
     QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
@@ -518,8 +518,8 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe(vtkActorC
 {
   using namespace VTK;
   ForEach<VTKViewer_Actor>(theCollection,
-                       TSetFunction<VTKViewer_Actor,int>
-                       (&VTKViewer_Actor::setDisplayMode,0));
+                        TSetFunction<VTKViewer_Actor,int>
+                        (&VTKViewer_Actor::setDisplayMode,0));
   emit RenderWindowModified();
 }
 
@@ -530,8 +530,8 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface(vtkActorCol
 {
   using namespace VTK;
   ForEach<VTKViewer_Actor>(theCollection,
-                       TSetFunction<VTKViewer_Actor,int>
-                       (&VTKViewer_Actor::setDisplayMode,1));
+                        TSetFunction<VTKViewer_Actor,int>
+                        (&VTKViewer_Actor::setDisplayMode,1));
   emit RenderWindowModified();
 }
 
@@ -664,8 +664,8 @@ bool VTKViewer_RenderWindowInteractor::unHighlightAll(){
  * \li Emit render window modified, if flag \a update - true.
  */
 bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteger& theMapIndex,
-                                                VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
-                                                TUpdateActor theFun, bool hilight, bool update)
+                                                 VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
+                                                 TUpdateActor theFun, bool hilight, bool update)
 {
   if(theMapIndex.Extent() == 0) return false;
 
@@ -687,9 +687,9 @@ bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteg
 
 /*!Sets actors data.*/
 void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfInteger& theMapIndex,
-                                                   VTKViewer_Actor * theMapActor,
-                                                   VTKViewer_Actor * theActor,
-                                                   TUpdateActor theFun)
+                                                    VTKViewer_Actor * theMapActor,
+                                                    VTKViewer_Actor * theActor,
+                                                    TUpdateActor theFun)
 {
   (*theFun)(theMapIndex,theMapActor,theActor);
   vtkFloatingPointType aPos[3];
index 3edf9c8e32b78713b1800e779ca0faa1cb042c76..18d58645ca76f33820a276af4c639b9e98f4b065 100755 (executable)
@@ -104,24 +104,24 @@ public:
   /** @name Selection Management */
   //@{
   bool highlightCell(const TColStd_IndexedMapOfInteger& MapIndex,
-                    VTKViewer_Actor* theMapActor,
-                    bool hilight,
-                    bool update = true );
+                     VTKViewer_Actor* theMapActor,
+                     bool hilight,
+                     bool update = true );
   bool highlightEdge(const TColStd_IndexedMapOfInteger& MapIndex,
-                    VTKViewer_Actor* theMapActor,
-                    bool hilight,
-                    bool update = true );
+                     VTKViewer_Actor* theMapActor,
+                     bool hilight,
+                     bool update = true );
   bool highlightPoint(const TColStd_IndexedMapOfInteger& MapIndex,
-                     VTKViewer_Actor* theMapActor,
-                     bool hilight,
-                     bool update = true );
+                      VTKViewer_Actor* theMapActor,
+                      bool hilight,
+                      bool update = true );
 
   void unHighlightSubSelection();
   bool unHighlightAll();
 
   //void SetSelectionMode(Selection_Mode mode);
   void SetSelectionProp(const double& theRed = 1, const double& theGreen = 1,
-                       const double& theBlue = 0, const int& theWidth = 5);
+                        const double& theBlue = 0, const int& theWidth = 5);
   void SetSelectionTolerance(const double& theTolNodes = 0.025, const double& theTolCell = 0.001);
   //@}
 
@@ -161,19 +161,19 @@ public:
   void setViewWindow( VTKViewer_ViewWindow* theViewWnd );
 
   void setCellData(const int& theIndex,
-                  VTKViewer_Actor* theMapActor,
-                  VTKViewer_Actor* theActor) {}
+                   VTKViewer_Actor* theMapActor,
+                   VTKViewer_Actor* theActor) {}
   void setEdgeData(const int& theCellIndex,
-                  VTKViewer_Actor* theMapActor,
-                  const int& theEdgeIndex,
-                  VTKViewer_Actor* theActor ) {} //NB
+                   VTKViewer_Actor* theMapActor,
+                   const int& theEdgeIndex,
+                   VTKViewer_Actor* theActor ) {} //NB
   void setPointData(const int& theIndex,
-                   VTKViewer_Actor* theMapActor,
-                   VTKViewer_Actor* theActor) {}
+                    VTKViewer_Actor* theMapActor,
+                    VTKViewer_Actor* theActor) {}
 
   typedef void (*TUpdateActor)(const TColStd_IndexedMapOfInteger& theMapIndex,
-                              VTKViewer_Actor* theMapActor,
-                              VTKViewer_Actor* theActor);
+                               VTKViewer_Actor* theMapActor,
+                               VTKViewer_Actor* theActor);
  protected:
 
   VTKViewer_RenderWindowInteractor();
@@ -182,12 +182,12 @@ public:
   VTKViewer_InteractorStyle* myInteractorStyle;
 
   bool highlight(const TColStd_IndexedMapOfInteger& theMapIndex,
-                VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
-                TUpdateActor theFun, bool hilight, bool update);
+                 VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
+                 TUpdateActor theFun, bool hilight, bool update);
   void setActorData(const TColStd_IndexedMapOfInteger& theMapIndex,
-                   VTKViewer_Actor* theMapActor,
-                   VTKViewer_Actor *theActor,
-                   TUpdateActor theFun);
+                    VTKViewer_Actor* theMapActor,
+                    VTKViewer_Actor *theActor,
+                    TUpdateActor theFun);
 
   /*! Timer used during various mouse events to figure 
    * out mouse movements.
index 0084d939d5d9a7325426460c963f3875053815b1..8abd09202b94affa549123eb10b29f47317f454d 100755 (executable)
@@ -148,7 +148,7 @@ int VTKViewer_ShrinkFilter::RequestData(
       oldId = ptIds->GetId(i);
       newId = newPts->InsertNextPoint(pt);
       if(myStoreMapping)
-       myVTK2ObjIds.push_back(oldId);
+        myVTK2ObjIds.push_back(oldId);
       newPtIds->InsertId(i,newId);
 
       outPD->CopyData(pd, oldId, newId);
index 7b2f92767c6708d488fcd10050e7733c26299911..2385a2309075ddc92427c731b48c360874e9a7bb 100755 (executable)
@@ -61,6 +61,6 @@ int VTKViewer_Transform::IsIdentity(){
   double aScale[3];
   this->GetMatrixScale(aScale);
   return (fabs(aScale[0] - 1.0) < EPS && 
-         fabs(aScale[1] - 1.0) < EPS && 
-         fabs(aScale[2] - 1.0) < EPS);
+          fabs(aScale[1] - 1.0) < EPS && 
+          fabs(aScale[2] - 1.0) < EPS);
 }
index f847ad91bfc33c09e727e21d38f098a4f5315ddb..b0a608231a80a0751c5dec945762b71b7bb9f45a 100755 (executable)
@@ -24,6 +24,7 @@
 #include "VTKViewer_Algorithm.h"
 
 // VTK Includes
+#include <vtkConfigure.h>
 #include <vtkMath.h>
 #include <vtkMapper.h>
 #include <vtkDataSet.h>
 #include <vtkLineSource.h>
 #include <vtkConeSource.h>
 #include <vtkPolyDataMapper.h>
+#include <vtkPolyDataMapper2D.h>
 #include <vtkVectorText.h>
+#include <vtkTextActor.h>
+#include <vtkTextMapper.h>
+#include <vtkTextProperty.h>
 
 // QT includes
 #include <QtGlobal>
@@ -78,8 +83,8 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
     theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]);
     theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]);
     vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
-                                          (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
-                                          (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
+                                           (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
+                                           (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
     int* aSize = theRenderer->GetRenderWindow()->GetSize();
     vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
     vtkDataSet* aDataSet = GetMapper()->GetInput();
@@ -101,16 +106,22 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
 
 vtkStandardNewMacro(VTKViewer_LineActor);
 
+#ifdef IPAL21440
+vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,vtkTextActor);
+#else
 vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor);
+#endif
 vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower);
 
 /*!Adds Label and Arrow actors to \a theRenderer.*/
 void VTKViewer_LineActor::Render(vtkRenderer *theRenderer)
 {
+#ifndef IPAL21440
   if(LabelActor && LabelActor->GetVisibility()){
     LabelActor->Modified();
     LabelActor->Render(theRenderer);
   }
+#endif
   if(ArrowActor && ArrowActor->GetVisibility()){
     ArrowActor->Modified();
     ArrowActor->Render(theRenderer);
@@ -152,6 +163,18 @@ VTKViewer_Axis::VTKViewer_Axis()
   myLineActor->SetArrowActor(myArrowActor);
   
   /*! \li Initialize the Label pipe-line representation */
+#ifdef IPAL21440
+  myTextMapper = vtkTextMapper::New();
+  
+  myLabelActor = vtkTextActor::New();
+  myLabelActor->SetMapper(myTextMapper);
+  myLabelActor->ScaledTextOff();
+  myLabelActor->PickableOff();
+  
+  vtkCoordinate* aCoord = vtkCoordinate::New();
+  myLabelActor->GetPositionCoordinate()->SetReferenceCoordinate( aCoord );
+  aCoord->Delete();
+#else
   myVectorText = vtkVectorText::New();
   
   myMapper[2] = vtkPolyDataMapper::New();
@@ -163,6 +186,7 @@ VTKViewer_Axis::VTKViewer_Axis()
   myLabelActor->SetSize(aLabelActorSize);
   myLabelActor->PickableOff();
   //myLabelActor->DebugOn();
+#endif
   
   myLineActor->SetLabelActor(myLabelActor);
   
@@ -181,8 +205,6 @@ VTKViewer_Axis::~VTKViewer_Axis()
   myMapper[0]->RemoveAllInputs();
   myMapper[0]->Delete();
   
-  myVectorText->Delete();
-  
   /*! \li Destroy of the Arrow pipe-line representation */
   myArrowActor->Delete();
   
@@ -194,8 +216,15 @@ VTKViewer_Axis::~VTKViewer_Axis()
   /*! \li Destroy of the Line pipe-line representation */
   myLineActor->Delete();
   
+#ifdef IPAL21440
+  myTextMapper->RemoveAllInputs();
+  myTextMapper->Delete();
+#else
+  myVectorText->Delete();
+  
   myMapper[2]->RemoveAllInputs();
   myMapper[2]->Delete();
+#endif
   
   myLineSource->Delete();
 }
@@ -244,15 +273,36 @@ void VTKViewer_Axis::SetVisibility(VTKViewer_Trihedron::TVisibility theVis)
 /*! Set camera for myLabelActor
  */
 void VTKViewer_Axis::SetCamera(vtkCamera* theCamera){
+#ifndef IPAL21440
   myLabelActor->SetCamera(theCamera);
+#endif
 }
 
-/*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
+/*! Sets color for actors: myLineActor,myLabelActor,myArrowActor
  */
-void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){
-  myLabelActor->SetProperty(theProperty);
-  myArrowActor->SetProperty(theProperty);
-  myLineActor->SetProperty(theProperty);
+void VTKViewer_Axis::SetColor(double theRed, double theGreen, double theBlue)
+{
+  // Set color property for arrow and line actors
+  vtkProperty* aProperty = vtkProperty::New();
+  aProperty->SetColor(theRed, theGreen, theBlue);
+
+  myArrowActor->SetProperty(aProperty);
+  myLineActor->SetProperty(aProperty);
+#ifndef IPAL21440
+  myLabelActor->SetProperty(aProperty);
+#endif
+
+  aProperty->Delete();
+  
+  // Set color property for label actor
+#ifdef IPAL21440
+  vtkTextProperty* aTextProperty = vtkTextProperty::New();
+  aTextProperty->SetColor(theRed, theGreen, theBlue);
+
+  myLabelActor->SetTextProperty(aTextProperty);
+
+  aTextProperty->Delete();
+#endif
 }
 
 /*! Set size of VTKViewer_Axis
@@ -270,8 +320,13 @@ void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize)
   myArrowActor->SetOrientation(myRot);
   myArrowActor->SetScale(theSize / 10.);
   
+#ifdef IPAL21440
+  if( vtkCoordinate* aCoord = myLabelActor->GetPositionCoordinate()->GetReferenceCoordinate() )
+    aCoord->SetValue( aPosition );
+#else
   myLabelActor->SetPosition(0.0,0.0,0.0);
   myLabelActor->AddPosition(aPosition);
+#endif
 }
 
 /*! Check if actor belongs to the axis object
@@ -282,7 +337,11 @@ bool VTKViewer_Axis::OwnActor(const vtkActor* theActor)
 {
   return theActor == myLineActor  || 
          theActor == myArrowActor ||
+#ifdef IPAL21440
+         false;
+#else
          theActor == myLabelActor;
+#endif
 }
 
 /*! \class VTKViewer_XAxis
@@ -304,11 +363,12 @@ vtkStandardNewMacro(VTKViewer_XAxis);
 VTKViewer_XAxis::VTKViewer_XAxis(){ 
   myDir[0] = 1.0; myDir[1] = 0.0; myDir[2] = 0.0;
   myRot[0] = 0.0; myRot[1] = 0.0; myRot[2] = 0.0;
+#ifdef IPAL21440
+  myTextMapper->SetInput("X");
+#else
   myVectorText->SetText("X");
-  vtkProperty* aProperty = vtkProperty::New();
-  aProperty->SetColor(1.0,0.0,0.0);
-  SetProperty(aProperty);
-  aProperty->Delete();
+#endif
+  SetColor(1.0,0.0,0.0);
 }
 
 /*! \class VTKViewer_YAxis
@@ -330,11 +390,12 @@ VTKViewer_YAxis::VTKViewer_YAxis()
 { 
   myDir[0] = 0.0; myDir[1] = 1.0; myDir[2] = 0.0;
   myRot[0] = 0.0; myRot[1] = 0.0; myRot[2] = 90.;
+#ifdef IPAL21440
+  myTextMapper->SetInput("Y");
+#else
   myVectorText->SetText("Y");
-  vtkProperty* aProperty = vtkProperty::New();
-  aProperty->SetColor(0.0,1.0,0.0);
-  SetProperty(aProperty);
-  aProperty->Delete();
+#endif
+  SetColor(0.0,1.0,0.0);
 }
 
 /*! \class VTKViewer_ZAxis
@@ -357,11 +418,12 @@ VTKViewer_ZAxis::VTKViewer_ZAxis()
 {
   myDir[0] = 0.0; myDir[1] = 0.0; myDir[2] = 1.0;
   myRot[0] = 0.0; myRot[1] = -90; myRot[2] = 0.0;
+#ifdef IPAL21440
+  myTextMapper->SetInput("Z");
+#else
   myVectorText->SetText("Z");
-  vtkProperty* aProperty = vtkProperty::New();
-  aProperty->SetColor(0.0,0.0,1.0);
-  SetProperty(aProperty);
-  aProperty->Delete();
+#endif
+  SetColor(0.0,0.0,1.0);
 }
 
 vtkStandardNewMacro(VTKViewer_Trihedron);
@@ -451,16 +513,17 @@ int VTKViewer_Trihedron::GetVisibleActorCount(vtkRenderer* theRenderer)
   aCollection->InitTraversal();
   int aCount = 0;
   while(vtkActor* prop = aCollection->GetNextActor()) {
-    if( prop->GetVisibility())
+    if( prop->GetVisibility()) {
       if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(prop)) {
         if(!anActor->IsInfinitive()) 
-         aCount++;
+          aCount++;
       }
       else if ( !OwnActor( anActor ) ) {
-       aCount++;
+        aCount++;
       }
         //int aCount = theRenderer->VisibleActorCount();
         //SetVisibility(aVis);
+    }
   }
   return aCount;
 }
index f1bf77d3e66406c700f3c5844b915416be70a52c..dab330e615aae5aa02493dc1c39b96f70a41c4c9 100755 (executable)
@@ -35,9 +35,22 @@ class vtkPolyDataMapper;
 class vtkLineSource;
 class vtkConeSource;
 class vtkVectorText;
+class vtkTextActor;
+class vtkTextMapper;
 
 class VTKViewer_Axis;
 
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
+// VTKViewer_UnScaledActor is temporarily replaced with simple vtkTextActor
+// This workaround caused by the bug with disappeared labels of the trihedron
+// reproduced after migration from qt-4.4.3 to qt-4.5.2
+#if (VTK_XVERSION < 0x050200)
+#define IPAL21440
+#endif
+
 /*! \class vtkFollower
  * See <a href="http://www.vtk.org/">vtk documentation</a>
  */
@@ -81,10 +94,17 @@ public:
   /*!Create new instance of VTKViewer_LineActor.*/
   static VTKViewer_LineActor *New();
   
-  /*! Sets Lable actor.
+#ifdef IPAL21440
+  /*! Sets Label actor.
+   * \param theLabelActor - vtkTextActor
+   */
+  void SetLabelActor(vtkTextActor* theLabelActor);
+#else
+  /*! Sets Label actor.
    * \param theLabelActor - VTKViewer_UnScaledActor
    */
   void SetLabelActor(VTKViewer_UnScaledActor* theLabelActor);
+#endif
   
   /*! Sets Arrow actor.
    * \param theLabelActor - VTKViewer_UnScaledActor
@@ -108,7 +128,11 @@ protected:
   }
 
   /*!Label actor pointer*/
+#ifdef IPAL21440
+  vtkTextActor* LabelActor;
+#else
   VTKViewer_UnScaledActor* LabelActor;
+#endif
 
   /*!Arrow actor pointer*/
   vtkFollower* ArrowActor;
@@ -226,9 +250,12 @@ public:
    */
   virtual void SetCamera(vtkCamera* theCamera);
 
-  /*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
+  /*! Sets color for actors: myLineActor,myLabelActor,myArrowActor
+   * \param theRed - red component of the color
+   * \param theGreen - green component of the color
+   * \param theBlue - blue component of the color
    */
-  virtual void SetProperty(vtkProperty* theProperty);
+  virtual void SetColor(double theRed, double theGreen, double theBlue);
   
   /*! Set size of VTKViewer_Axis
    */
@@ -237,7 +264,11 @@ public:
   /*! Get label actor.
    * \retval Return myLabelActor.
    */
+#ifdef IPAL21440
+  virtual vtkTextActor* GetLabel() { return myLabelActor; }
+#else
   virtual VTKViewer_UnScaledActor* GetLabel() { return myLabelActor; }
+#endif
   
   /*! Get arrow actor.
    * \retval Return myArrowActor
@@ -273,7 +304,11 @@ protected:
 
   /*! VTKViewer_UnScaledActor actor pointer
    */
+#ifdef IPAL21440
+  vtkTextActor *myLabelActor;
+#else
   VTKViewer_UnScaledActor *myLabelActor;
+#endif
   
   /*! \li myMapper[0] - for the Line pipe-line representation
    *  \li myMapper[1] - for the Arrow pipe-line representation
@@ -289,9 +324,15 @@ protected:
    */
   vtkConeSource *myConeSource;
 
+#ifdef IPAL21440
+  /*! vtkTextMapper pointer (Label)
+   */
+  vtkTextMapper *myTextMapper;
+#else
   /*! VTKViewer_VectorText pointer (Label)
    */
   vtkVectorText* myVectorText;
+#endif
 };
 
 #endif
index 3714c74aa5b5f74b7140421e50853682eb8e725f..01e6e4ebeaddecade4fe01d53103946b3f270d22 100755 (executable)
@@ -36,7 +36,7 @@ using namespace std;
 /*!@see vtkRenderer::ResetCamera(vtkFloatingPointType bounds[6]) method*/
 void 
 ResetCamera(vtkRenderer* theRenderer, 
-           int theUsingZeroFocalPoint)
+            int theUsingZeroFocalPoint)
 {  
   if(!theRenderer)
     return;
@@ -60,8 +60,8 @@ ResetCamera(vtkRenderer* theRenderer,
 
     vtkFloatingPointType aWidth = 
       sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) +
-          (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
-          (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
+           (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
+           (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
     
     if(aWidth < MIN_DISTANCE)
       return;
@@ -88,8 +88,8 @@ ResetCamera(vtkRenderer* theRenderer,
     
     // update the camera
     aCamera->SetPosition(aCenter[0]+aDistance*aViewPlaneNormal[0],
-                        aCenter[1]+aDistance*aViewPlaneNormal[1],
-                        aCenter[2]+aDistance*aViewPlaneNormal[2]);
+                         aCenter[1]+aDistance*aViewPlaneNormal[1],
+                         aCenter[2]+aDistance*aViewPlaneNormal[2]);
 
     // find size of the window
     int* aWinSize = theRenderer->GetSize();
@@ -108,7 +108,7 @@ ResetCamera(vtkRenderer* theRenderer,
 /*! Compute the bounds of the visible props*/
 int
 ComputeVisiblePropBounds(vtkRenderer* theRenderer, 
-                        vtkFloatingPointType theBounds[6])
+                         vtkFloatingPointType theBounds[6])
 {
   int aCount = 0;
   
@@ -124,25 +124,25 @@ ComputeVisiblePropBounds(vtkRenderer* theRenderer,
     if(aProp->GetVisibility() && aProp->GetMapper() && vtkMath::AreBoundsInitialized(aProp->GetBounds())){
       if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(aProp))
         if(anActor->IsInfinitive())
-         continue;
-       
+          continue;
+        
       vtkFloatingPointType *aBounds = aProp->GetBounds();
       static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
       // make sure we haven't got bogus bounds
       if ( aBounds != NULL &&
-          aBounds[0] > -MAX_DISTANCE && aBounds[1] < MAX_DISTANCE &&
-          aBounds[2] > -MAX_DISTANCE && aBounds[3] < MAX_DISTANCE &&
-          aBounds[4] > -MAX_DISTANCE && aBounds[5] < MAX_DISTANCE )
+           aBounds[0] > -MAX_DISTANCE && aBounds[1] < MAX_DISTANCE &&
+           aBounds[2] > -MAX_DISTANCE && aBounds[3] < MAX_DISTANCE &&
+           aBounds[4] > -MAX_DISTANCE && aBounds[5] < MAX_DISTANCE )
       {
-       aCount++;
+        aCount++;
 
-       theBounds[0] = min(aBounds[0],theBounds[0]);
-       theBounds[2] = min(aBounds[2],theBounds[2]);
-       theBounds[4] = min(aBounds[4],theBounds[4]);
+        theBounds[0] = min(aBounds[0],theBounds[0]);
+        theBounds[2] = min(aBounds[2],theBounds[2]);
+        theBounds[4] = min(aBounds[4],theBounds[4]);
 
-       theBounds[1] = max(aBounds[1],theBounds[1]);
-       theBounds[3] = max(aBounds[3],theBounds[3]);
-       theBounds[5] = max(aBounds[5],theBounds[5]);
+        theBounds[1] = max(aBounds[1],theBounds[1]);
+        theBounds[3] = max(aBounds[3],theBounds[3]);
+        theBounds[5] = max(aBounds[5],theBounds[5]);
 
       }//not bogus
     }
@@ -194,9 +194,9 @@ ResetCameraClippingRange(vtkRenderer* theRenderer)
 /*!Compute trihedron size.*/
 bool
 ComputeTrihedronSize( vtkRenderer* theRenderer,
-                     vtkFloatingPointType& theNewSize,
-                     const vtkFloatingPointType theSize, 
-                     const vtkFloatingPointType theSizeInPercents )
+                      vtkFloatingPointType& theNewSize,
+                      const vtkFloatingPointType theSize, 
+                      const vtkFloatingPointType theSizeInPercents )
 {
   // calculating diagonal of visible props of the renderer
   vtkFloatingPointType bnd[ 6 ];
@@ -238,11 +238,11 @@ bool IsBBEmpty(vtkRenderer* theRenderer)
     if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(anAct))
       if(anActor->GetVisibility() && !anActor->IsInfinitive())
       {
-       vtkFloatingPointType *aBounds = anActor->GetBounds();
-       if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
-          aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
-          aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
-         isAny = true;
+        vtkFloatingPointType *aBounds = anActor->GetBounds();
+        if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
+           aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
+           aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+          isAny = true;
       }
   
   return !isAny;
@@ -271,19 +271,19 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
     {
       if(anActor->GetVisibility() && !anActor->IsInfinitive())
       {
-       vtkFloatingPointType *aBounds = anActor->GetBounds();
-       if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
-          aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
-          aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
-       {
-         for(int i = 0; i < 5; i = i + 2){
-           if(aBounds[i] < aNewBndBox[i]) 
-             aNewBndBox[i] = aBounds[i];
-           if(aBounds[i+1] > aNewBndBox[i+1]) 
-             aNewBndBox[i+1] = aBounds[i+1];
-         }
-         isAny = true;
-       }
+        vtkFloatingPointType *aBounds = anActor->GetBounds();
+        if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
+           aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
+           aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+        {
+          for(int i = 0; i < 5; i = i + 2){
+            if(aBounds[i] < aNewBndBox[i]) 
+              aNewBndBox[i] = aBounds[i];
+            if(aBounds[i+1] > aNewBndBox[i+1]) 
+              aNewBndBox[i+1] = aBounds[i+1];
+          }
+          isAny = true;
+        }
       }
     }
   }
@@ -309,8 +309,8 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
 
     vtkFloatingPointType aWidth = 
       sqrt((aNewBndBox[1]-aNewBndBox[0])*(aNewBndBox[1]-aNewBndBox[0]) +
-          (aNewBndBox[3]-aNewBndBox[2])*(aNewBndBox[3]-aNewBndBox[2]) +
-          (aNewBndBox[5]-aNewBndBox[4])*(aNewBndBox[5]-aNewBndBox[4]));
+           (aNewBndBox[3]-aNewBndBox[2])*(aNewBndBox[3]-aNewBndBox[2]) +
+           (aNewBndBox[5]-aNewBndBox[4])*(aNewBndBox[5]-aNewBndBox[4]));
     
     if(aWidth < MIN_DISTANCE)
       return false;
@@ -327,7 +327,7 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
   vtkFloatingPointType aBounds[6];
   int aCount = ComputeVisiblePropBounds(theRenderer,aBounds);
   printf("aNewBndBox[0] = %f, aNewBndBox[1] = %f,\naNewBndBox[2] = %f, aNewBndBox[3] = %f,\naNewBndBox[4] = %f, aNewBndBox[5] = %f\n",
-          aBounds[0],aBounds[1],aBounds[2],aBounds[3],aBounds[4],aBounds[5]);
+           aBounds[0],aBounds[1],aBounds[2],aBounds[3],aBounds[4],aBounds[5]);
   printf("aCount = %d\n",aCount);
 
   if(aCount){
@@ -342,8 +342,8 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3]
 
     vtkFloatingPointType aWidth = 
       sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) +
-          (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
-          (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
+           (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
+           (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
     
     if(aWidth < MIN_DISTANCE)
       return false;
index a9074da59cc17e3badef38d9afdf71d672a06b9a..b52ff5cbe2d35e4f4aafbc7007f048fe7e095735 100755 (executable)
@@ -30,13 +30,13 @@ VTKVIEWER_EXPORT
 extern
 void
 ResetCamera(vtkRenderer* theRenderer, 
-           int theUsingZeroFocalPoint = false);
+            int theUsingZeroFocalPoint = false);
 
 VTKVIEWER_EXPORT
 extern
 int
 ComputeVisiblePropBounds(vtkRenderer* theRenderer, 
-                        vtkFloatingPointType theBounds[6]);
+                         vtkFloatingPointType theBounds[6]);
 
 VTKVIEWER_EXPORT
 extern
@@ -46,9 +46,9 @@ VTKVIEWER_EXPORT
 extern
 bool
 ComputeTrihedronSize(vtkRenderer* theRenderer, 
-                    vtkFloatingPointType& theNewSize, 
-                    const vtkFloatingPointType theSize, 
-                    const vtkFloatingPointType theSizeInPercents);
+                     vtkFloatingPointType& theNewSize, 
+                     const vtkFloatingPointType theSize, 
+                     const vtkFloatingPointType theSizeInPercents);
 
 VTKVIEWER_EXPORT
 extern
@@ -56,5 +56,5 @@ bool IsBBEmpty(vtkRenderer* theRenderer);
 VTKVIEWER_EXPORT
 extern
 bool ComputeBBCenter(vtkRenderer* theRenderer, 
-                    vtkFloatingPointType theCenter[3]);
+                     vtkFloatingPointType theCenter[3]);
 #endif
index 20185b38afc4e90cac1c9d6621283cd051220ee6..58238ca4a7785dfef6c316105c9d4bbb1a33fe4e 100755 (executable)
@@ -44,8 +44,8 @@
 /*! Construction*/
 VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop, 
                                             VTKViewer_Viewer* theModel,
-                                           VTKViewer_InteractorStyle* iStyle,
-                                           VTKViewer_RenderWindowInteractor* rw )
+                                            VTKViewer_InteractorStyle* iStyle,
+                                            VTKViewer_RenderWindowInteractor* rw )
 : SUIT_ViewWindow( theDesktop )
 {
   myModel = theModel;
@@ -92,6 +92,7 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
   setCentralWidget( myRenderWindow );
 
   myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this );
+  myToolBar->setFloatable( false );
 
   createActions();
   createToolBar();
@@ -579,8 +580,8 @@ QString VTKViewer_ViewWindow::getVisualParameters()
 
   QString retStr;
   retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", 
-                 pos[0], pos[1], pos[2], focalPnt[0], focalPnt[1], focalPnt[2], viewUp[0], viewUp[1], 
-                 viewUp[2], parScale, scale[0], scale[1], scale[2] );
+                  pos[0], pos[1], pos[2], focalPnt[0], focalPnt[1], focalPnt[2], viewUp[0], viewUp[1], 
+                  viewUp[2], parScale, scale[0], scale[1], scale[2] );
   return retStr;
 }
 
index 3bceda6c595b55ebc9593477346daa9eb07c189d..56b139837ffe36855332d7129f89d8be295ff5bc 100755 (executable)
@@ -49,7 +49,7 @@ class VTKVIEWER_EXPORT VTKViewer_ViewWindow : public SUIT_ViewWindow
 public:
   VTKViewer_ViewWindow( SUIT_Desktop*, VTKViewer_Viewer*,
                         VTKViewer_InteractorStyle* = 0,
-                       VTKViewer_RenderWindowInteractor* = 0 );
+                        VTKViewer_RenderWindowInteractor* = 0 );
   virtual ~VTKViewer_ViewWindow();
   
   /*!Gets tool bar.*/
@@ -61,7 +61,7 @@ public:
   /*!Gets renderer.*/
   vtkRenderer*                      getRenderer()     { return myRenderer;     }
   /*!Gets render window.*/
-  VTKViewer_RenderWindow*          getRenderWindow() { return myRenderWindow; }
+  VTKViewer_RenderWindow*           getRenderWindow() { return myRenderWindow; }
   /*!Gets render window interactor.*/
   VTKViewer_RenderWindowInteractor* getRWInteractor() { return myRWInteractor; }
   bool                              isTrihedronDisplayed();