#include "HYDROGUI_Tool.h"
#include <AIS_Drawer.hxx>
+#include <AIS_TexturedShape.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
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 );
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
#define HYDROGUI_SHAPE_H
#include <AIS_InteractiveContext.hxx>
-#include <AIS_TexturedShape.hxx>
+#include <AIS_Shape.hxx>
#include <HYDROData_Entity.h>
private:
Handle(AIS_InteractiveContext) myContext;
Handle(HYDROData_Entity) myObject;
- Handle(AIS_TexturedShape) myShape;
+ Handle(AIS_Shape) myShape;
bool myIsToUpdate;
bool myIsVisible;