From: adv Date: Thu, 14 Nov 2013 08:51:54 +0000 (+0000) Subject: Transparency for immersible zones correction(Bug #71). X-Git-Tag: BR_hydro_v_0_3~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8327e5c3c27781a982e5258fd5a94dfef5d2dcf1;p=modules%2Fhydro.git Transparency for immersible zones correction(Bug #71). --- diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index 9a6c0ca7..41cf8299 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -26,6 +26,7 @@ #include "HYDROGUI_Tool.h" #include +#include #include #include @@ -359,7 +360,17 @@ void HYDROGUI_Shape::buildShape() if ( myTopoShape.IsNull() ) return; - myShape = new AIS_TexturedShape( myTopoShape ); + QString aTextureFileName = getTextureFileName(); + bool anIsTexture = !aTextureFileName.isEmpty(); + + if ( anIsTexture ) + { + myShape = new AIS_TexturedShape( myTopoShape ); + } + else + { + myShape = new AIS_Shape( myTopoShape ); + } if ( !myObject.IsNull() ) myShape->SetOwner( myObject ); @@ -367,12 +378,14 @@ void HYDROGUI_Shape::buildShape() myShape->SetTransparency( 0 ); myShape->SetDisplayMode( (AIS_DisplayMode)myDisplayMode ); - QString aTextureFileName = getTextureFileName(); - if( !aTextureFileName.isEmpty() ) + if( anIsTexture ) { - myShape->SetTextureFileName( HYDROGUI_Tool::ToAsciiString( aTextureFileName ) ); - myShape->SetTextureMapOn(); - myShape->DisableTextureModulate(); + Handle(AIS_TexturedShape) aTexturedShape = + Handle(AIS_TexturedShape)::DownCast( myShape ); + + aTexturedShape->SetTextureFileName( HYDROGUI_Tool::ToAsciiString( aTextureFileName ) ); + aTexturedShape->SetTextureMapOn(); + aTexturedShape->DisableTextureModulate(); } // Init default params for shape diff --git a/src/HYDROGUI/HYDROGUI_Shape.h b/src/HYDROGUI/HYDROGUI_Shape.h index 007c3e52..84880112 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.h +++ b/src/HYDROGUI/HYDROGUI_Shape.h @@ -24,7 +24,7 @@ #define HYDROGUI_SHAPE_H #include -#include +#include #include @@ -107,7 +107,7 @@ private: private: Handle(AIS_InteractiveContext) myContext; Handle(HYDROData_Entity) myObject; - Handle(AIS_TexturedShape) myShape; + Handle(AIS_Shape) myShape; bool myIsToUpdate; bool myIsVisible;