From 943b17a1c8522bf7e64a4c20ed840ae1e7a98bd2 Mon Sep 17 00:00:00 2001 From: gdd Date: Mon, 26 Sep 2011 15:19:04 +0000 Subject: [PATCH] rnc : - 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 | 3 ++ src/OCCViewer/OCCViewer_ViewWindow.cxx | 42 -------------------------- 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 8bdb3b0d6..0d9aae581 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -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); + } } } diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 4014a6e5a..647a755cd 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -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(); - - } } /*! -- 2.39.2