rnc : added Texture in the available display modes of the pop up menu

This commit is contained in:
gdd 2011-09-26 16:22:58 +00:00
parent bd4d3a51c9
commit c0790b80d5
6 changed files with 28 additions and 15 deletions

View File

@ -128,6 +128,9 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
case GEOMOp::OpShading: // POPUP MENU - DISPLAY MODE - SHADING case GEOMOp::OpShading: // POPUP MENU - DISPLAY MODE - SHADING
ChangeDisplayMode( 1 ); ChangeDisplayMode( 1 );
break; break;
case GEOMOp::OpTexture: // POPUP MENU - DISPLAY MODE - TEXTURE
ChangeDisplayMode( 3 );
break;
case GEOMOp::OpVectors: // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION case GEOMOp::OpVectors: // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
ChangeDisplayMode( 2 ); ChangeDisplayMode( 2 );
break; break;
@ -543,7 +546,9 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false ); ic->SetDisplayMode( interIter.Value(), AIS_WireFrame, false );
else if ( mode == 1 ) else if ( mode == 1 )
ic->SetDisplayMode( interIter.Value(), AIS_Shaded, false ); 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() ); Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast( interIter.Value() );
if ( !aSh.IsNull() ) { if ( !aSh.IsNull() ) {
vectorMode = !aSh->isShowVectors(); vectorMode = !aSh->isShowVectors();

View File

@ -740,7 +740,7 @@ bool EntityGUI_FeatureDetectorDlg::execute( ObjectList& objects )
GEOM::GEOM_IBlocksOperations_var aBlocksOperations = myGeomGUI->GetGeomGen()->GetIBlocksOperations( getStudyId() ); GEOM::GEOM_IBlocksOperations_var aBlocksOperations = myGeomGUI->GetGeomGen()->GetIBlocksOperations( getStudyId() );
GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices(P1,P2,P3,P4); GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices(P1,P2,P3,P4);
getDisplayer()->SetTexture(theImgFileName.toStdString()); getDisplayer()->SetTexture(theImgFileName.toStdString());
getDisplayer()->SetDisplayMode((Standard_Integer) StdSelect_DM_HLR); getDisplayer()->SetDisplayMode( 3 );
// OCCViewer_Viewer* anOCCViewer =((OCCViewer_ViewWindow*)theViewWindow)->getViewManager())->getOCCViewer(); // OCCViewer_Viewer* anOCCViewer =((OCCViewer_ViewWindow*)theViewWindow)->getViewManager())->getOCCViewer();
// Handle(AIS_InteractiveContext) aContext = anOCCViewer->getAISContext(); // Handle(AIS_InteractiveContext) aContext = anOCCViewer->getAISContext();

View File

@ -652,6 +652,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
} else } else
useObjColor = true; useObjColor = true;
}else { }else {
MESSAGE("myDisplayMode = "<< myDisplayMode)
AISShape->SetDisplayMode( myDisplayMode ); AISShape->SetDisplayMode( myDisplayMode );
AISShape->SetShadingColor( myShadingColor ); AISShape->SetShadingColor( myShadingColor );
} }
@ -731,6 +732,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
AISShape->SetTextureFileName(TCollection_AsciiString(myTexture.c_str())); AISShape->SetTextureFileName(TCollection_AsciiString(myTexture.c_str()));
AISShape->SetTextureMapOn(); AISShape->SetTextureMapOn();
AISShape->DisableTextureModulate(); AISShape->DisableTextureModulate();
AISShape->SetDisplayMode(3);
// AISShape->SetDisplayMode( (Standard_Integer) StdSelect_DM_HLR ); // AISShape->SetDisplayMode( (Standard_Integer) StdSelect_DM_HLR );
} }
else else

View File

@ -428,6 +428,7 @@ void GeometryGUI::OnGUIEvent( int id )
case GEOMOp::OpSwitchVectors: // MENU VIEW - VECTOR MODE case GEOMOp::OpSwitchVectors: // MENU VIEW - VECTOR MODE
case GEOMOp::OpWireframe: // POPUP MENU - WIREFRAME case GEOMOp::OpWireframe: // POPUP MENU - WIREFRAME
case GEOMOp::OpShading: // POPUP MENU - SHADING case GEOMOp::OpShading: // POPUP MENU - SHADING
case GEOMOp::OpTexture: // POPUP MENU - TEXTURE
case GEOMOp::OpVectors: // POPUP MENU - VECTORS case GEOMOp::OpVectors: // POPUP MENU - VECTORS
libName = "DisplayGUI"; libName = "DisplayGUI";
break; break;
@ -797,6 +798,7 @@ void GeometryGUI::initialize( CAM_Application* app )
createGeomAction( GEOMOp::OpWireframe, "POP_WIREFRAME", "", 0, true ); createGeomAction( GEOMOp::OpWireframe, "POP_WIREFRAME", "", 0, true );
createGeomAction( GEOMOp::OpShading, "POP_SHADING", "", 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::OpVectors, "POP_VECTORS", "", 0, true );
createGeomAction( GEOMOp::OpDeflection, "POP_DEFLECTION" ); createGeomAction( GEOMOp::OpDeflection, "POP_DEFLECTION" );
createGeomAction( GEOMOp::OpColor, "POP_COLOR" ); createGeomAction( GEOMOp::OpColor, "POP_COLOR" );
@ -1146,6 +1148,9 @@ void GeometryGUI::initialize( CAM_Application* app )
mgr->insert( action( GEOMOp::OpShading ), dispmodeId, -1 ); // shading mgr->insert( action( GEOMOp::OpShading ), dispmodeId, -1 ); // shading
mgr->setRule( action( GEOMOp::OpShading ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule ); mgr->setRule( action( GEOMOp::OpShading ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );
mgr->setRule( action( GEOMOp::OpShading ), clientOCCorVTK + " and displaymode='Shading'", QtxPopupMgr::ToggleRule ); 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( separator(), dispmodeId, -1 );
mgr->insert( action( GEOMOp::OpVectors ), dispmodeId, -1 ); // vectors mgr->insert( action( GEOMOp::OpVectors ), dispmodeId, -1 ); // vectors
mgr->setRule( action( GEOMOp::OpVectors ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule ); mgr->setRule( action( GEOMOp::OpVectors ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule );

View File

@ -64,6 +64,7 @@ namespace GEOMOp {
OpWireframe = 2200, // POPUP MENU - DISPLAY MODE - WIREFRAME OpWireframe = 2200, // POPUP MENU - DISPLAY MODE - WIREFRAME
OpShading = 2201, // POPUP MENU - DISPLAY MODE - SHADING OpShading = 2201, // POPUP MENU - DISPLAY MODE - SHADING
OpVectors = 2202, // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION OpVectors = 2202, // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
OpTexture = 2203, // POPUP MENU - DISPLAY MODE - TEXTURE
// BasicGUI ------------------//-------------------------------- // BasicGUI ------------------//--------------------------------
OpPoint = 3000, // MENU NEW ENTITY - BASIC - POINT OpPoint = 3000, // MENU NEW ENTITY - BASIC - POINT
OpLine = 3001, // MENU NEW ENTITY - BASIC - LINE OpLine = 3001, // MENU NEW ENTITY - BASIC - LINE

View 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 if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL
StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode; // StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode;
std::cout<<"aMode = "<<aMode<<" ======================= GEOM_AISShape::Compute ========================="<<std::endl;
switch (d) { switch (aMode) {
case StdSelect_DM_Wireframe: case 0://StdSelect_DM_Wireframe:
{ {
StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer); StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
break; break;
} }
case StdSelect_DM_Shading: case 1://StdSelect_DM_Shading:
{ {
myDrawer->ShadingAspect()->Aspect()->SetDistinguishOn(); myDrawer->ShadingAspect()->Aspect()->SetDistinguishOn();
@ -207,9 +207,9 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
AIS_Shape::Compute(aPresentationManager, aPrs, aMode); AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
break; break;
} }
case StdSelect_DM_HLR: case 3: //StdSelect_DM_HLR:
{ {
AIS_TexturedShape::Compute(aPresentationManager, aPrs, 3); AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
break; break;
} }
} }