X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_Shape.cxx;h=eb05a9b4dd816d214b3f9fb818d9e4a49b1d7e32;hb=81c9f5cdf82909d0aebd2c491c50fa7516cc80b7;hp=0dd9f0ba5d51125e76bfd90a10abb6b26e603b38;hpb=1922ed077531b39ed7cfafbe677efc9d19ea0b58;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index 0dd9f0ba..eb05a9b4 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -165,7 +165,9 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer ) setWire( aPolylineWire, false, false ); } else { myTopoShape = aPolylineShape; - myDisplayMode = AIS_WireFrame; + // Set shading mode to avoid that hilight presentation is equal to "normal" object presentation. + // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ). + myDisplayMode = AIS_Shaded; buildShape(); updateShape( false, false ); @@ -188,7 +190,9 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer ) setWire( aPolylineWire, false, false ); } else { myTopoShape = aPolylineShape; - myDisplayMode = AIS_WireFrame; + // Set shading mode to avoid that hilight presentation is equal to "normal" object presentation. + // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ). + myDisplayMode = AIS_Shaded; buildShape(); updateShape( false, false ); @@ -303,6 +307,12 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer ) gp_Pnt aPnt3( aRect.bottomRight().x(), aRect.bottomRight().y(), 0 ); gp_Pnt aPnt4( aRect.bottomLeft().x(), aRect.bottomLeft().y(), 0 ); + Handle_HYDROData_Document aDoc = HYDROData_Document::Document( anImageObj->Label() ); + aDoc->Transform( aPnt1, true ); + aDoc->Transform( aPnt2, true ); + aDoc->Transform( aPnt3, true ); + aDoc->Transform( aPnt4, true ); + TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge( aPnt1, aPnt2 ).Edge(); TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge( aPnt2, aPnt3 ).Edge(); TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge( aPnt3, aPnt4 ).Edge(); @@ -441,7 +451,9 @@ void HYDROGUI_Shape::setWire( const TopoDS_Wire& theWire, const bool theIsUpdateViewer ) { myTopoShape = theWire; - myDisplayMode = AIS_WireFrame; + // To avoid that hilight presentation is equal to "normal" object presentation. + // Note that hilight presentation is always to be on top ( i.e. in the top Z layer ). + myDisplayMode = AIS_Shaded; buildShape(); updateShape( theToDisplay, theIsUpdateViewer ); @@ -721,7 +733,12 @@ void HYDROGUI_Shape::colorShapeBorder( const QColor& theColor ) getQuantityColorVal( theColor.green() ), getQuantityColorVal( theColor.blue() ), Quantity_TOC_RGB ); - if ( myDisplayMode == AIS_Shaded ) + + + if ( myTopoShape.ShapeType() == TopAbs_WIRE ) // Note that we display polylines in shaded mode + { + myShape->SetColor( aBorderColor ); + } else if ( myDisplayMode == AIS_Shaded ) { if ( theColor.alpha() == 0 ) { @@ -737,6 +754,12 @@ void HYDROGUI_Shape::colorShapeBorder( const QColor& theColor ) aBoundaryAspect->SetColor( aBorderColor ); anAttributes->SetFaceBoundaryAspect( aBoundaryAspect ); } + Handle(Prs3d_LineAspect) aWireAspect = anAttributes->WireAspect(); + if ( !aWireAspect.IsNull() ) + { + aWireAspect->SetColor( aBorderColor ); + anAttributes->SetWireAspect( aWireAspect ); + } } } else if ( myDisplayMode == AIS_WireFrame )