]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
rnc :
authorgdd <gdd>
Mon, 26 Sep 2011 15:19:04 +0000 (15:19 +0000)
committergdd <gdd>
Mon, 26 Sep 2011 15:19:04 +0000 (15:19 +0000)
- removed unuseful code previously written for testing
- modified initview for OCC views in order to allow putting textures on shapes

src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewWindow.cxx

index 8bdb3b0d6192e571c86b18f8e8e4ee808c0126b0..0d9aae581962b577c299467bf872f4c4b56fcf21 100755 (executable)
@@ -167,7 +167,10 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view )
     
     OCCViewer_ViewPort3d* vp3d = view->getViewPort();
     if ( vp3d )
+    {
       vp3d->setBackgroundColor( myColors[0] );
+      vp3d->getView()->SetSurfaceDetail(V3d_TEX_ALL);
+    }
   }
 }
 
index 4014a6e5a3a1f32ab2a496aaff69236178ba9989..647a755cd944af9c8c20561083755bc7dc6221e3 100755 (executable)
@@ -2419,49 +2419,7 @@ QString OCCViewer_ViewWindow::backgroundImageFilename() const
 void OCCViewer_ViewWindow::setBackgroundImage( const QString& theFileName,const Aspect_FillMethod& theFillMethod)
 {
   if ( myViewPort ) 
-  {
     myViewPort->setBackgroundImage( theFileName ,theFillMethod);
-    myViewPort->getView()->SetSurfaceDetail(V3d_TEX_ALL);
-  //     set2dMode(XYPlane);
-  //     onTopView();
-//       //TEST
-//     OCCViewer_Viewer*           anOCCViewer = ((OCCViewer_ViewManager*)getViewManager())->getOCCViewer();
-//   //   QString                theImgFileName   = backgroundImageFilename();
-//     Handle(AIS_InteractiveContext) aContext = anOCCViewer->getAISContext(); 
-//     
-//     IplImage* img = cvLoadImage( theFileName.toStdString().c_str(),CV_LOAD_IMAGE_GRAYSCALE);
-//     int height = img->height;
-//     int width  = img->width;
-//     
-//     gp_Pnt p1(0,0,0);
-//     gp_Pnt p2(0,height,0);
-//     gp_Pnt p3(width,height,0);
-//     gp_Pnt p4(width,0,0);
-//     
-//     BRepBuilderAPI_MakePolygon Wire(p1,p2,p3,p4, Standard_True); 
-//     BRepBuilderAPI_MakeFace Face(Wire,Standard_True);
-//     const TopoDS_Shape& S = Face.Shape();
-//     Handle(AIS_TexturedShape) anAIS = new AIS_TexturedShape(S);
-//     if (!theFileName.isEmpty())
-//     {
-//       MESSAGE("filename is not empty")
-//       anAIS->SetTextureFileName(TCollection_AsciiString(theFileName.toStdString().c_str()));
-//       anAIS->SetTextureMapOn();
-//       anAIS->DisableTextureModulate();
-//       myViewPort->getView()->SetSurfaceDetail(V3d_TEX_ALL);
-//   //     anAIS->SetDisplayMode(AIS_Shaded); 
-//     }
-//     else
-//       anAIS->SetTextureMapOff();
-// //     creation of the presentable object
-//     aContext->SetDisplayMode(anAIS,3);
-// //     anAIS->SetDisplayMode(3);
-//     aContext->SetMaterial(anAIS,Graphic3d_NOM_SATIN);
-//     aContext->Display(anAIS);
-//     onTopView();
-//     aContext->UpdateCurrentViewer();
-    
-  }
 }
 
 /*!