Adding svn:eol-style=LF property
[occt.git] / samples / qt / Graphic3dDemo / src / View.cxx
index 6b1cc6b..091145b 100755 (executable)
@@ -6,8 +6,8 @@
 #include <qpainter.h>
 #include <qmenu.h>
 #include <qcolordialog.h>
 #include <qpainter.h>
 #include <qmenu.h>
 #include <qcolordialog.h>
-#include <qcursor.h>\r
-#include <qevent.h>\r
+#include <qcursor.h>
+#include <qevent.h>
 #include <qrubberband.h>
 
 #include "View.h"
 #include <qrubberband.h>
 
 #include "View.h"
 View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindow* mdi )
 : QWidget( parent ), myMDI( mdi ), myRubberBand( 0 )
 {
 View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindow* mdi )
 : QWidget( parent ), myMDI( mdi ), myRubberBand( 0 )
 {
-  setBackgroundRole( QPalette::NoRole );//NoBackground );\r
-  // set focus policy to threat QContextMenuEvent from keyboard  \r
-  setFocusPolicy( Qt::StrongFocus );\r
-  setAttribute( Qt::WA_PaintOnScreen );\r
-  setAttribute( Qt::WA_NoSystemBackground );\r
-\r
+  setBackgroundRole( QPalette::NoRole );//NoBackground );
+  // set focus policy to threat QContextMenuEvent from keyboard  
+  setFocusPolicy( Qt::StrongFocus );
+  setAttribute( Qt::WA_PaintOnScreen );
+  setAttribute( Qt::WA_NoSystemBackground );
+
 #ifndef WNT
   XSynchronize( x11Display(), true ); // it is possible to use QApplication::syncX();
 #endif
 #ifndef WNT
   XSynchronize( x11Display(), true ); // it is possible to use QApplication::syncX();
 #endif
@@ -88,17 +88,17 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindo
     */
     Visual *v = DefaultVisual( x11Display(), DefaultScreen( x11Display() ) );
     int visualID = XVisualIDFromVisual( v );
     */
     Visual *v = DefaultVisual( x11Display(), DefaultScreen( x11Display() ) );
     int visualID = XVisualIDFromVisual( v );
-\r
+
     /* Here we use the settings from
        Optimizer_ViewInfo::TxglCreateWindow()
     */
     int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1,
                          GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
                          GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER,
     /* Here we use the settings from
        Optimizer_ViewInfo::TxglCreateWindow()
     */
     int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1,
                          GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
                          GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER,
-                         None };\r
+                         None };
     pVisualInfo = ::glXChooseVisual (x11Display(), DefaultScreen(x11Display()), visualAttr);
 
     pVisualInfo = ::glXChooseVisual (x11Display(), DefaultScreen(x11Display()), visualAttr);
 
-    if ( isVisible() )\r
+    if ( isVisible() )
       hide();
 
     XSetWindowAttributes a;
       hide();
 
     XSetWindowAttributes a;
@@ -119,81 +119,81 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindo
     int count;
     if ( XGetWMColormapWindows( x11Display(), topLevelWidget()->winId(), 
                                 &cmwret, &count ) ) {
     int count;
     if ( XGetWMColormapWindows( x11Display(), topLevelWidget()->winId(), 
                                 &cmwret, &count ) ) {
-      cmw = new Window[count+1];\r
-      memcpy( (char *)cmw, (char *)cmwret, sizeof(Window)*count );\r
-      XFree( (char *)cmwret );\r
-      int i;\r
-      for (i = 0; i < count; i++) {\r
-        if ( cmw[i] == winId() ) { /* replace old window */\r
-          cmw[i] = w;\r
-          break;\r
-        }\r
-      }\r
-      if ( i >= count )                         /* append new window */\r
-        cmw[count++] = w;\r
-    } else {\r
-      count = 1;\r
-      cmw = new Window[count];\r
-      cmw[0] = w;\r
-    }\r
-    /* Creating new window (with good VisualID) for this widget */\r
-    create( w );\r
-    XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count );\r
-    delete [] cmw;\r
-\r
-    if ( isVisible() )\r
-      show();\r
-    if ( pVisualInfo ) {\r
-      XFree( (char *)pVisualInfo );\r
-    }\r
-    XFlush( x11Display() );\r
-  }\r
-#endif // !defined WNT\r
-  \r
-  // will be set in OnInitial update, but, for more security :\r
-  myCurrentMode = CurAction3d_Nothing;\r
-  setMouseTracking( true );\r
-  myView = NULL;\r
+      cmw = new Window[count+1];
+      memcpy( (char *)cmw, (char *)cmwret, sizeof(Window)*count );
+      XFree( (char *)cmwret );
+      int i;
+      for (i = 0; i < count; i++) {
+        if ( cmw[i] == winId() ) { /* replace old window */
+          cmw[i] = w;
+          break;
+        }
+      }
+      if ( i >= count )                         /* append new window */
+        cmw[count++] = w;
+    } else {
+      count = 1;
+      cmw = new Window[count];
+      cmw[0] = w;
+    }
+    /* Creating new window (with good VisualID) for this widget */
+    create( w );
+    XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count );
+    delete [] cmw;
+
+    if ( isVisible() )
+      show();
+    if ( pVisualInfo ) {
+      XFree( (char *)pVisualInfo );
+    }
+    XFlush( x11Display() );
+  }
+#endif // !defined WNT
+  
+  // will be set in OnInitial update, but, for more security :
+  myCurrentMode = CurAction3d_Nothing;
+  setMouseTracking( true );
+  myView = NULL;
 }
 
 View::~View()
 }
 
 View::~View()
-{\r
+{
 }
 
 void View::init()
 }
 
 void View::init()
-{\r
-  myView = myContext->CurrentViewer()->CreateView();\r
-  int windowHandle = (int) winId();\r
-  short hi, lo;\r
-  lo = (short) windowHandle;\r
-  hi = (short) ( windowHandle >> 16 );\r
-#ifdef WNT\r
-  Handle(WNT_Window) hWnd = \r
-    new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::\r
-    DownCast( myContext->CurrentViewer()->Device() ) , (int) hi, (int) lo );\r
-#else\r
-  Handle(Xw_Window) hWnd = \r
-    new Xw_Window( Handle(Graphic3d_GraphicDevice)::\r
-    DownCast( myContext->CurrentViewer()->Device() ),\r
-    (int) hi, (int) lo, Xw_WQ_SAMEQUALITY, Quantity_NOC_BLACK );\r
-#endif // WNT\r
-  myView->SetWindow( hWnd );\r
-  if ( !hWnd->IsMapped() )\r
-    hWnd->Map();\r
-  myView->SetBackgroundColor(Quantity_NOC_GRAY40);\r
-  myView->MustBeResized();\r
-\r
-  Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement( gp::XOY() );\r
-  myTrihedron = new AIS_Trihedron( anAxis );\r
-  myContext->Display( myTrihedron );\r
-\r
-  //myView->SetAntialiasingOn();\r
-  myComputedModeIsOn = true;\r
-  myView->SetScale(3.0316);\r
-\r
-  // This is to update View properties dialog\r
-  emit ViewInitialized();\r
-}\r
+{
+  myView = myContext->CurrentViewer()->CreateView();
+  int windowHandle = (int) winId();
+  short hi, lo;
+  lo = (short) windowHandle;
+  hi = (short) ( windowHandle >> 16 );
+#ifdef WNT
+  Handle(WNT_Window) hWnd = 
+    new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::
+    DownCast( myContext->CurrentViewer()->Device() ) , (int) hi, (int) lo );
+#else
+  Handle(Xw_Window) hWnd = 
+    new Xw_Window( Handle(Graphic3d_GraphicDevice)::
+    DownCast( myContext->CurrentViewer()->Device() ),
+    (int) hi, (int) lo, Xw_WQ_SAMEQUALITY, Quantity_NOC_BLACK );
+#endif // WNT
+  myView->SetWindow( hWnd );
+  if ( !hWnd->IsMapped() )
+    hWnd->Map();
+  myView->SetBackgroundColor(Quantity_NOC_GRAY40);
+  myView->MustBeResized();
+
+  Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement( gp::XOY() );
+  myTrihedron = new AIS_Trihedron( anAxis );
+  myContext->Display( myTrihedron );
+
+  //myView->SetAntialiasingOn();
+  myComputedModeIsOn = true;
+  myView->SetScale(3.0316);
+
+  // This is to update View properties dialog
+  emit ViewInitialized();
+}
 
 void View::paintEvent ( QPaintEvent * e)
 {
 
 void View::paintEvent ( QPaintEvent * e)
 {
@@ -268,9 +268,9 @@ void View::onLButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
             case CurAction3d_GlobalPanning :// noting
                 break;
             case  CurAction3d_DynamicRotation :
             case CurAction3d_GlobalPanning :// noting
                 break;
             case  CurAction3d_DynamicRotation :
-                if (!myComputedModeIsOn){\r
-                                       myView->SetComputedMode(false);\r
-                               }\r
+                if (!myComputedModeIsOn){
+                                       myView->SetComputedMode(false);
+                               }
                                myView->SetAnimationModeOn();
                 myView->StartRotation(point.x(),point.y());  
                 break;
                                myView->SetAnimationModeOn();
                 myView->StartRotation(point.x(),point.y());  
                 break;
@@ -283,15 +283,15 @@ void View::onLButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
 
 void View::onRButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
 {
 
 void View::onRButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
 {
-    if ( nFlags == CASCADESHORTCUTKEY ) {\r
+    if ( nFlags == CASCADESHORTCUTKEY ) {
         if ( !myComputedModeIsOn )
                        myView->SetComputedMode(false);
         if ( !myComputedModeIsOn )
                        myView->SetComputedMode(false);
-//                     Standard_Boolean anim, deg;\r
-//                     anim = myView->AnimationMode( deg );\r
-//                     if ( anim /*&& deg*/ ) {\r
+//                     Standard_Boolean anim, deg;
+//                     anim = myView->AnimationMode( deg );
+//                     if ( anim /*&& deg*/ ) {
             myCycleCounter = 0;
             Application::startTimer();
             myCycleCounter = 0;
             Application::startTimer();
-            myView->SetAnimationModeOn();\r
+            myView->SetAnimationModeOn();
 //                     myView->SetAnimationMode(true,true);
 //          myContext->DeactivateStandardMode( TopAbs_SHAPE );
 //                     }
 //                     myView->SetAnimationMode(true,true);
 //          myContext->DeactivateStandardMode( TopAbs_SHAPE );
 //                     }
@@ -366,7 +366,7 @@ void View::onLButtonUp(Qt::KeyboardModifiers nFlags, const QPoint point)
                   emit noActiveActions();
         break;
         case  CurAction3d_DynamicRotation :
                   emit noActiveActions();
         break;
         case  CurAction3d_DynamicRotation :
-              myCurrentMode = CurAction3d_Nothing;\r
+              myCurrentMode = CurAction3d_Nothing;
                   myView->SetAnimationModeOff();
                   emit noActiveActions();
         break;
                   myView->SetAnimationModeOff();
                   emit noActiveActions();
         break;
@@ -382,16 +382,16 @@ void View::onRButtonUp(Qt::KeyboardModifiers nFlags, const QPoint point)
     QApplication::setOverrideCursor( Qt::WaitCursor );
     // reset computed mode according to the stored one
     //   --> dynamic rotation may have change it 
     QApplication::setOverrideCursor( Qt::WaitCursor );
     // reset computed mode according to the stored one
     //   --> dynamic rotation may have change it 
-\r
+
     if (!myComputedModeIsOn)
     if (!myComputedModeIsOn)
-    { \r
+    { 
       myView->SetComputedMode(false);
       myComputedModeIsOn = Standard_False;
     } else
       myView->SetComputedMode(false);
       myComputedModeIsOn = Standard_False;
     } else
-    {\r
+    {
       myView->SetComputedMode(false);
       myComputedModeIsOn = Standard_True;
       myView->SetComputedMode(false);
       myComputedModeIsOn = Standard_True;
-    }\r
+    }
 
     //if ( myView->AnimationModeIsOn() ) {
         myView->SetAnimationModeOff();
 
     //if ( myView->AnimationModeIsOn() ) {
         myView->SetAnimationModeOff();
@@ -555,83 +555,83 @@ void View::Popup()
 {
     QMenu* popMenu = new QMenu( this );
 
 {
     QMenu* popMenu = new QMenu( this );
 
-    if( myContext->NbCurrents()) {\r
-               QAction* a;\r
-               myContext->InitCurrent();\r
-               if (! myContext->Current()->IsKind(STANDARD_TYPE(AIS_Trihedron)))\r
+    if( myContext->NbCurrents()) {
+               QAction* a;
+               myContext->InitCurrent();
+               if (! myContext->Current()->IsKind(STANDARD_TYPE(AIS_Trihedron)))
                {
                        a = new QAction( tr( "MEN_POP_OBJPROP" ), this );
                {
                        a = new QAction( tr( "MEN_POP_OBJPROP" ), this );
-                       verify( connect( a, SIGNAL( activated() ), SLOT( onEditObjectProperties() ) ) );\r
+                       verify( connect( a, SIGNAL( activated() ), SLOT( onEditObjectProperties() ) ) );
       popMenu->addAction( a );
                        
                        QMenu* dMode = popMenu->addMenu( tr( "MEN_POP_DISPLAYMODE" ) );
 
                        a = new QAction( tr( "MEN_POP_WIREFRAME" ), this );
       popMenu->addAction( a );
                        
                        QMenu* dMode = popMenu->addMenu( tr( "MEN_POP_DISPLAYMODE" ) );
 
                        a = new QAction( tr( "MEN_POP_WIREFRAME" ), this );
-                       verify( connect( a, SIGNAL( activated() ), SLOT( onWireframeMode() ) ) );\r
+                       verify( connect( a, SIGNAL( activated() ), SLOT( onWireframeMode() ) ) );
       dMode->addAction( a );
       dMode->addAction( a );
-\r
+
                        a = new QAction( tr( "MEN_POP_SHADING" ), this );
                        verify( connect( a, SIGNAL( activated() ), SLOT( onShadingMode() ) ) );
                        a = new QAction( tr( "MEN_POP_SHADING" ), this );
                        verify( connect( a, SIGNAL( activated() ), SLOT( onShadingMode() ) ) );
-      dMode->addAction( a );\r
+      dMode->addAction( a );
                }
                a = new QAction( tr( "MEN_POP_REMOVEOBJECT" ), this );
                verify( connect( a, SIGNAL( activated() ), SLOT( onRemoveObject() ) ) );
                }
                a = new QAction( tr( "MEN_POP_REMOVEOBJECT" ), this );
                verify( connect( a, SIGNAL( activated() ), SLOT( onRemoveObject() ) ) );
-    popMenu->addAction( a );\r
+    popMenu->addAction( a );
     }
     else {
         QAction* a = new QAction( tr( "MEN_POP_VIEWPROP" ), this );
         verify( connect( a, SIGNAL( activated() ), Application::getApplication(), SLOT( onEditViewProperties() ) ) );
     }
     else {
         QAction* a = new QAction( tr( "MEN_POP_VIEWPROP" ), this );
         verify( connect( a, SIGNAL( activated() ), Application::getApplication(), SLOT( onEditViewProperties() ) ) );
-        popMenu->addAction( a );\r
+        popMenu->addAction( a );
 
         a = new QAction( tr( "MEN_POP_IMPORT" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onImportObject() ) ) );
 
         a = new QAction( tr( "MEN_POP_IMPORT" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onImportObject() ) ) );
-        popMenu->addAction( a );\r
+        popMenu->addAction( a );
 
         popMenu->addSeparator();
         if ( myContext->IsDisplayed( myTrihedron ) ) {
             a = new QAction( tr( "MEN_POP_ERASETRIHEDRON" ), this );
             verify( connect( a, SIGNAL( activated() ), SLOT( onEraseTrihedron() ) ) );
 
         popMenu->addSeparator();
         if ( myContext->IsDisplayed( myTrihedron ) ) {
             a = new QAction( tr( "MEN_POP_ERASETRIHEDRON" ), this );
             verify( connect( a, SIGNAL( activated() ), SLOT( onEraseTrihedron() ) ) );
-            popMenu->addAction( a );\r
+            popMenu->addAction( a );
         }
         else {
             a = new QAction( tr( "MEN_POP_DISPLAYTRIHEDRON" ), this );
             verify( connect( a, SIGNAL( activated() ), SLOT( onDisplayTrihedron() ) ) );
         }
         else {
             a = new QAction( tr( "MEN_POP_DISPLAYTRIHEDRON" ), this );
             verify( connect( a, SIGNAL( activated() ), SLOT( onDisplayTrihedron() ) ) );
-            popMenu->addAction( a );\r
+            popMenu->addAction( a );
         }
 
         popMenu->addSeparator();
         a = new QAction( tr( "MEN_POP_CREATESHAPE" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onCreateShape() ) ) );
         }
 
         popMenu->addSeparator();
         a = new QAction( tr( "MEN_POP_CREATESHAPE" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onCreateShape() ) ) );
-        popMenu->addAction( a );\r
+        popMenu->addAction( a );
 
         QMenu* loadObj = popMenu->addMenu( tr( "MEN_POP_LOADOBJECT" ) );
 
         a = new QAction( tr( "MEN_POP_BOX" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onLoadBox() ) ) );
 
         QMenu* loadObj = popMenu->addMenu( tr( "MEN_POP_LOADOBJECT" ) );
 
         a = new QAction( tr( "MEN_POP_BOX" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onLoadBox() ) ) );
-        loadObj->addAction( a );\r
+        loadObj->addAction( a );
 
         a = new QAction( tr( "MEN_POP_SPHERE" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onLoadSphere() ) ) );
 
         a = new QAction( tr( "MEN_POP_SPHERE" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onLoadSphere() ) ) );
-        loadObj->addAction( a );\r
+        loadObj->addAction( a );
 
         a = new QAction( tr( "MEN_POP_TORUS" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onLoadTorus() ) ) );
 
         a = new QAction( tr( "MEN_POP_TORUS" ), this );
         verify( connect( a, SIGNAL( activated() ), SLOT( onLoadTorus() ) ) );
-        loadObj->addAction( a );\r
+        loadObj->addAction( a );
 
 
-//        a = new QAction( tr( "MEN_POP_LINE" ), this );\r
-//        verify( connect( a, SIGNAL( activated() ), SLOT( onLoadLine() ) ) );\r
-//        loadObj->addAction( a );\r
+//        a = new QAction( tr( "MEN_POP_LINE" ), this );
+//        verify( connect( a, SIGNAL( activated() ), SLOT( onLoadLine() ) ) );
+//        loadObj->addAction( a );
        }
     popMenu->exec( QCursor::pos() );
 }
 
 void View::DrawRectangle( int  MinX, int MinY, int MaxX, int MaxY, bool Draw )
        }
     popMenu->exec( QCursor::pos() );
 }
 
 void View::DrawRectangle( int  MinX, int MinY, int MaxX, int MaxY, bool Draw )
-{\r
-  if ( !myRubberBand )\r
-    myRubberBand = new QRubberBand( QRubberBand::Rectangle, this );\r
-  \r
-  myRubberBand->setGeometry( QRect( QPoint( MinX, MinY ), QPoint( MaxX, MaxY ) ).normalized() );\r
-  myRubberBand->setVisible( Draw );\r
+{
+  if ( !myRubberBand )
+    myRubberBand = new QRubberBand( QRubberBand::Rectangle, this );
+  
+  myRubberBand->setGeometry( QRect( QPoint( MinX, MinY ), QPoint( MaxX, MaxY ) ).normalized() );
+  myRubberBand->setVisible( Draw );
 /*
        QPainter thePainter(this);
        thePainter.setRasterOp(Qt::XorROP);
 /*
        QPainter thePainter(this);
        thePainter.setRasterOp(Qt::XorROP);
@@ -658,7 +658,7 @@ void View::DrawRectangle( int  MinX, int MinY, int MaxX, int MaxY, bool Draw )
         thePainter.drawRect(aRect);
      m_IsVisible = true;
    }
         thePainter.drawRect(aRect);
      m_IsVisible = true;
    }
-       */\r
+       */
 }
 
 void View::onImportObject()
 }
 
 void View::onImportObject()
@@ -756,7 +756,7 @@ void View::startAction( ViewOperations::Action action )
 }
 
 void View::onCreateShape()
 }
 
 void View::onCreateShape()
-{\r
+{
        myView->SetScale(3.0316);
     if ( !myShapeDlg )
         myShapeDlg = new ShapeDlg( Application::getApplication(), myView, myContext );
        myView->SetScale(3.0316);
     if ( !myShapeDlg )
         myShapeDlg = new ShapeDlg( Application::getApplication(), myView, myContext );
@@ -764,7 +764,7 @@ void View::onCreateShape()
 }
 
 void View::onLoadBox()
 }
 
 void View::onLoadBox()
-{\r
+{
        myView->SetScale(1.0);
     Standard_Real size = myContext->CurrentViewer()->DefaultViewSize() / 4.;
     gp_Pnt origin( -size / 2., -size / 2., -size / 2. );
        myView->SetScale(1.0);
     Standard_Real size = myContext->CurrentViewer()->DefaultViewSize() / 4.;
     gp_Pnt origin( -size / 2., -size / 2., -size / 2. );
@@ -783,7 +783,7 @@ void View::onLoadBox()
 }
 
 void View::onLoadSphere()
 }
 
 void View::onLoadSphere()
-{\r
+{
        myView->SetScale(1.0);
     Standard_Real radius = myContext->CurrentViewer()->DefaultViewSize() / 4.;
     Handle(AIS_Shape) sphere = 
        myView->SetScale(1.0);
     Standard_Real radius = myContext->CurrentViewer()->DefaultViewSize() / 4.;
     Handle(AIS_Shape) sphere = 
@@ -801,7 +801,7 @@ void View::onLoadSphere()
 }
 
 void View::onLoadTorus()
 }
 
 void View::onLoadTorus()
-{\r
+{
        myView->SetScale(1.0);
     Handle(V3d_Viewer) viewer = myContext->CurrentViewer();
     Standard_Real r1 = viewer->DefaultViewSize() / 3.;
        myView->SetScale(1.0);
     Handle(V3d_Viewer) viewer = myContext->CurrentViewer();
     Standard_Real r1 = viewer->DefaultViewSize() / 3.;
@@ -820,7 +820,7 @@ void View::onLoadTorus()
 }
 
 void View::onLoadLine()
 }
 
 void View::onLoadLine()
-{\r
+{
        myView->SetScale(1.0);
     Handle(AIS_Line) line = 
         new AIS_Line( new Geom_Line( gp_Pnt( 0, 0, 0), gp_Dir( 0, 0, 1) ) );
        myView->SetScale(1.0);
     Handle(AIS_Line) line = 
         new AIS_Line( new Geom_Line( gp_Pnt( 0, 0, 0), gp_Dir( 0, 0, 1) ) );
@@ -857,18 +857,18 @@ void View::onWireframeMode()
 }
 
 void View::onShadingMode()
 }
 
 void View::onShadingMode()
-{\r
-       \r
-    myContext->InitSelected();\r
-    for( ; myContext->MoreSelected(); myContext->NextSelected() ) {\r
-        Handle(AIS_InteractiveObject) obj = myContext->SelectedInteractive();\r
-        //myContext->Erase( obj, false );\r
-        //myContext->Display( obj /*, 1, 0*/, false );\r
-        //myContext->Activate( obj, 0 );\r
-        myContext->SetDisplayMode( obj, 1 );\r
-    }\r
-    myContext->UpdateCurrentViewer();\r
-       \r
+{
+       
+    myContext->InitSelected();
+    for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
+        Handle(AIS_InteractiveObject) obj = myContext->SelectedInteractive();
+        //myContext->Erase( obj, false );
+        //myContext->Display( obj /*, 1, 0*/, false );
+        //myContext->Activate( obj, 0 );
+        myContext->SetDisplayMode( obj, 1 );
+    }
+    myContext->UpdateCurrentViewer();
+       
 }
 
 void View::onDisplayTrihedron()
 }
 
 void View::onDisplayTrihedron()