X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ShapeImage.cxx;h=d57f726dac12cf044c2699d731436a6d89e14984;hb=fce3f1240b6161d7cb837344078e5943b90eca65;hp=9b56208a47a31e5fe26104c03d27a53d7c625a1c;hpb=abab708d83b68396ab353ff300f2185297597178;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ShapeImage.cxx b/src/HYDROGUI/HYDROGUI_ShapeImage.cxx index 9b56208a..d57f726d 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeImage.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeImage.cxx @@ -1,8 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -31,7 +27,7 @@ #include HYDROGUI_ShapeImage::HYDROGUI_ShapeImage( const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_Image& theImage, + const Handle(HYDROData_Image)& theImage, const int theZLayer ) : HYDROGUI_Shape( theContext, theImage, theZLayer ) { @@ -50,14 +46,20 @@ void HYDROGUI_ShapeImage::update( bool theIsUpdateViewer, bool isDeactivateSelec HYDROGUI_Shape::update( theIsUpdateViewer, isDeactivateSelection ); } -Handle(AIS_InteractiveObject) HYDROGUI_ShapeImage::createShape() const +QList HYDROGUI_ShapeImage::createShape() const { - Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( getObject() ); - if ( anImageObj.IsNull() ) - return Handle_AIS_InteractiveObject(); + QList shapes; + + Handle(HYDROGUI_ImagePrs) aPrs; + + Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( getObject() ); + if ( !anImageObj.IsNull() ) + { + aPrs = new HYDROGUI_ImagePrs( imagePixMap( anImageObj ), imageContour( anImageObj ) ); + shapes.append( aPrs ); + } - Handle(HYDROGUI_ImagePrs) aPrs = new HYDROGUI_ImagePrs( imagePixMap( anImageObj ), imageContour( anImageObj ) ); - return aPrs; + return shapes; } Handle(Image_PixMap) HYDROGUI_ShapeImage::imagePixMap( const Handle(HYDROData_Image)& theImageObj ) const @@ -85,7 +87,7 @@ Handle(Image_PixMap) HYDROGUI_ShapeImage::imagePixMap( const Handle(HYDROData_Im return aPix; } -QPolygonF HYDROGUI_ShapeImage::imageContour( const Handle_HYDROData_Image& theImageObj ) const +QPolygonF HYDROGUI_ShapeImage::imageContour( const Handle(HYDROData_Image)& theImageObj ) const { QPolygonF aContour; if ( !theImageObj.IsNull() )