1 // Copyright (C) 2013-2023 CEA, EDF, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "ImageComposer_CutOperator.h"
21 #include "ImageComposer_MetaTypes.h"
29 ImageComposer_CutOperator::ImageComposer_CutOperator()
30 : ImageComposer_Operator()
36 ImageComposer_CutOperator::~ImageComposer_CutOperator()
42 QString ImageComposer_CutOperator::name() const
49 QRectF ImageComposer_CutOperator::calcResultBoundingRect( const QVariant& theObj1,
50 const QVariant& ) const
53 if ( !theObj1.isNull() && theObj1.canConvert<ImageComposer_Image>() )
55 ImageComposer_Image anImage1 = theObj1.value<ImageComposer_Image>();
56 aResRect = anImage1.boundingRect();
63 void ImageComposer_CutOperator::drawResult( QPainter& thePainter,
64 const QVariant& theObj1,
65 const QVariant& theObj2 ) const
67 if ( !theObj1.isNull() && theObj1.canConvert<ImageComposer_Image>() )
69 ImageComposer_Image anImage1 = theObj1.value<ImageComposer_Image>();
70 anImage1.draw( thePainter );
73 if ( !theObj2.isNull() && theObj2.canConvert<ImageComposer_Image>() )
75 ImageComposer_Image anImage2 = theObj2.value<ImageComposer_Image>();
76 anImage2.draw( thePainter );