]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
rnc : added Texture in the available display modes of the pop up menu
authorgdd <gdd>
Mon, 26 Sep 2011 16:22:58 +0000 (16:22 +0000)
committergdd <gdd>
Mon, 26 Sep 2011 16:22:58 +0000 (16:22 +0000)
src/DisplayGUI/DisplayGUI.cxx
src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI_Operations.h
src/OBJECT/GEOM_AISShape.cxx

index 53c04c20430eb272baf87eb6ff3c1264258409cb..bbcd7853b41f6af4274ca1fde019786c50218469 100644 (file)
@@ -128,6 +128,9 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpShading:        // POPUP MENU - DISPLAY MODE - SHADING
     ChangeDisplayMode( 1 );
     break;
+  case GEOMOp::OpTexture:        // POPUP MENU - DISPLAY MODE - TEXTURE
+    ChangeDisplayMode( 3 );
+    break;
   case GEOMOp::OpVectors:        // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
     ChangeDisplayMode( 2 );
     break;
@@ -543,20 +546,22 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
             ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
           else if ( mode == 1 )
             ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false );
-          if (mode == 2 ) {
+          else if ( mode == 3 )
+            ic->SetDisplayMode( interIter.Value(), AIS_ExactHLR, false );
+          else if (mode == 2 ) {
             Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
             if ( !aSh.IsNull() ) {
-             vectorMode = !aSh->isShowVectors();      
+              vectorMode = !aSh->isShowVectors();      
               aSh->SetDisplayVectors(vectorMode);
               ic->RecomputePrsOnly(interIter.Value());
             }
           }
         }
-       if(mode == 0 || mode == 1) {
-         aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),DISPLAY_MODE_PROP, mode);
-       } else if (mode == 2) {
-         aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),VECTOR_MODE_PROP, vectorMode);
-       }
+        if(mode == 0 || mode == 1) {
+          aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),DISPLAY_MODE_PROP, mode);
+        } else if (mode == 2) {
+          aStudy->setObjectProperty(mgrId, It.Value()->getEntry(),VECTOR_MODE_PROP, vectorMode);
+        }
       }
     }
     ic->UpdateCurrentViewer();
index e597f78e23e6b9bab0974d32087fbcfe749ea236..62376c1a8060c2369500c0a2ab61e79eec44c0cc 100644 (file)
@@ -740,7 +740,7 @@ bool EntityGUI_FeatureDetectorDlg::execute( ObjectList& objects )
     GEOM::GEOM_IBlocksOperations_var aBlocksOperations = myGeomGUI->GetGeomGen()->GetIBlocksOperations( getStudyId() );
     GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices(P1,P2,P3,P4);
     getDisplayer()->SetTexture(theImgFileName.toStdString());
-    getDisplayer()->SetDisplayMode((Standard_Integer) StdSelect_DM_HLR);
+    getDisplayer()->SetDisplayMode( 3 );
 //     OCCViewer_Viewer*              anOCCViewer =((OCCViewer_ViewWindow*)theViewWindow)->getViewManager())->getOCCViewer();
 //     Handle(AIS_InteractiveContext) aContext = anOCCViewer->getAISContext(); 
     
index 880b98a3e088612e04fb62386c04f5517cc03842..2769ab63dee9e98aa70eeacdc0e130d3b18da1b5 100644 (file)
@@ -652,6 +652,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
           } else
             useObjColor = true;
         }else {
+          MESSAGE("myDisplayMode = "<< myDisplayMode)
           AISShape->SetDisplayMode( myDisplayMode );
           AISShape->SetShadingColor( myShadingColor );
         }
@@ -731,6 +732,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
           AISShape->SetTextureFileName(TCollection_AsciiString(myTexture.c_str()));
           AISShape->SetTextureMapOn();
           AISShape->DisableTextureModulate();
+          AISShape->SetDisplayMode(3);
 //           AISShape->SetDisplayMode( (Standard_Integer) StdSelect_DM_HLR );
         }
         else
index 4881c4e10304d5c8c283637ebbaed92481478f32..db3aba2b110a8f3a0285b97865141413cbf61fc5 100644 (file)
@@ -428,6 +428,7 @@ void GeometryGUI::OnGUIEvent( int id )
   case GEOMOp::OpSwitchVectors:    // MENU VIEW - VECTOR MODE
   case GEOMOp::OpWireframe:        // POPUP MENU - WIREFRAME
   case GEOMOp::OpShading:          // POPUP MENU - SHADING
+  case GEOMOp::OpTexture:          // POPUP MENU - TEXTURE
   case GEOMOp::OpVectors:          // POPUP MENU - VECTORS
     libName = "DisplayGUI";
     break;
@@ -797,6 +798,7 @@ void GeometryGUI::initialize( CAM_Application* app )
 
   createGeomAction( GEOMOp::OpWireframe,        "POP_WIREFRAME", "", 0, true );
   createGeomAction( GEOMOp::OpShading,          "POP_SHADING", "", 0, true );
+  createGeomAction( GEOMOp::OpTexture,          "POP_TEXTURE", "", 0, true );
   createGeomAction( GEOMOp::OpVectors,          "POP_VECTORS", "", 0, true );
   createGeomAction( GEOMOp::OpDeflection,       "POP_DEFLECTION" );
   createGeomAction( GEOMOp::OpColor,            "POP_COLOR" );
@@ -1146,6 +1148,9 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->insert( action(  GEOMOp::OpShading ), dispmodeId, -1 ); // shading
   mgr->setRule( action( GEOMOp::OpShading ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
   mgr->setRule( action( GEOMOp::OpShading ), clientOCCorVTK + " and displaymode='Shading'", QtxPopupMgr::ToggleRule );
+  mgr->insert( action(  GEOMOp::OpTexture ), dispmodeId, -1 ); // wireframe
+  mgr->setRule( action( GEOMOp::OpTexture ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
+  mgr->setRule( action( GEOMOp::OpTexture), clientOCCorVTK + " and displaymode='Texture'", QtxPopupMgr::ToggleRule );
   mgr->insert( separator(), dispmodeId, -1 );
   mgr->insert( action(  GEOMOp::OpVectors ), dispmodeId, -1 ); // vectors
   mgr->setRule( action( GEOMOp::OpVectors ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
index f891de5a7ba22c943ef4908f5b3bf23ca67a99eb..93bfd2a42c69c496d7d892888e42c13d90fbd426 100644 (file)
@@ -64,6 +64,7 @@ namespace GEOMOp {
     OpWireframe         = 2200,   // POPUP MENU - DISPLAY MODE - WIREFRAME
     OpShading           = 2201,   // POPUP MENU - DISPLAY MODE - SHADING
     OpVectors           = 2202,   // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
+    OpTexture           = 2203,   // POPUP MENU - DISPLAY MODE - TEXTURE
     // BasicGUI ------------------//--------------------------------
     OpPoint             = 3000,   // MENU NEW ENTITY - BASIC - POINT
     OpLine              = 3001,   // MENU NEW ENTITY - BASIC - LINE
index 860d6c14c60fc286f47fe4f0df0c6286af71ec20..f50b29ed092a6ba9a39d124aeb362f450e65e59e 100644 (file)
@@ -168,15 +168,15 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
 {  
   if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL
   
-  StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode;
-
-  switch (d) {
-  case StdSelect_DM_Wireframe: 
+//   StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode;
+  std::cout<<"aMode = "<<aMode<<" ======================= GEOM_AISShape::Compute ========================="<<std::endl;
+  switch (aMode) {
+    case 0://StdSelect_DM_Wireframe: 
     {
       StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
       break;
     }
-  case StdSelect_DM_Shading:
+    case 1://StdSelect_DM_Shading:
     {
       myDrawer->ShadingAspect()->Aspect()->SetDistinguishOn();
       
@@ -207,9 +207,9 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
       AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
       break;
     }
-  case StdSelect_DM_HLR:
+    case 3: //StdSelect_DM_HLR:
     {
-      AIS_TexturedShape::Compute(aPresentationManager, aPrs, 3);
+      AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
       break;
     }
   }