From: adv Date: Wed, 11 Sep 2013 07:27:33 +0000 (+0000) Subject: Naming of operators. X-Git-Tag: BR_hydro_v_0_1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d497ef017f7caefe8869d657234ef994b61f7989;p=modules%2Fgui.git Naming of operators. --- diff --git a/src/ImageComposer/ImageComposer_ColorMaskOperator.cxx b/src/ImageComposer/ImageComposer_ColorMaskOperator.cxx index 45ee5c901..3a788f54f 100644 --- a/src/ImageComposer/ImageComposer_ColorMaskOperator.cxx +++ b/src/ImageComposer/ImageComposer_ColorMaskOperator.cxx @@ -45,7 +45,7 @@ void ImageComposer_ColorMaskOperator::setArgs( const QColor& theRefColor, */ QString ImageComposer_ColorMaskOperator::name() const { - return "colormask"; + return Type(); } QStringList ImageComposer_ColorMaskOperator::dumpArgsToPython( QString& theArrayName ) const diff --git a/src/ImageComposer/ImageComposer_ColorMaskOperator.h b/src/ImageComposer/ImageComposer_ColorMaskOperator.h index 1e5131560..d79034491 100644 --- a/src/ImageComposer/ImageComposer_ColorMaskOperator.h +++ b/src/ImageComposer/ImageComposer_ColorMaskOperator.h @@ -20,6 +20,8 @@ public: int theRGBThreshold, int theAlphaThreshold ); + static QString Type() { return "colormask"; } + virtual QString name() const; /** diff --git a/src/ImageComposer/ImageComposer_CropOperator.cxx b/src/ImageComposer/ImageComposer_CropOperator.cxx index 7519788b7..65aed89de 100644 --- a/src/ImageComposer/ImageComposer_CropOperator.cxx +++ b/src/ImageComposer/ImageComposer_CropOperator.cxx @@ -54,7 +54,7 @@ QPainterPath ImageComposer_CropOperator::clipPath() const */ QString ImageComposer_CropOperator::name() const { - return "crop"; + return Type(); } /** diff --git a/src/ImageComposer/ImageComposer_CropOperator.h b/src/ImageComposer/ImageComposer_CropOperator.h index 1a2525efe..e1740c332 100644 --- a/src/ImageComposer/ImageComposer_CropOperator.h +++ b/src/ImageComposer/ImageComposer_CropOperator.h @@ -21,7 +21,10 @@ public: QPainterPath clipPath() const; + static QString Type() { return "crop"; } + virtual QString name() const; + virtual ImageComposer_Image process( const ImageComposer_Image& theImage1, const ImageComposer_Image& theImage2 ) const; diff --git a/src/ImageComposer/ImageComposer_CutOperator.cxx b/src/ImageComposer/ImageComposer_CutOperator.cxx index 3ecf2265e..25ceb4c83 100644 --- a/src/ImageComposer/ImageComposer_CutOperator.cxx +++ b/src/ImageComposer/ImageComposer_CutOperator.cxx @@ -23,7 +23,7 @@ ImageComposer_CutOperator::~ImageComposer_CutOperator() */ QString ImageComposer_CutOperator::name() const { - return "cut"; + return Type(); } /** diff --git a/src/ImageComposer/ImageComposer_CutOperator.h b/src/ImageComposer/ImageComposer_CutOperator.h index d85923c41..15026dc3c 100644 --- a/src/ImageComposer/ImageComposer_CutOperator.h +++ b/src/ImageComposer/ImageComposer_CutOperator.h @@ -15,6 +15,8 @@ public: ImageComposer_CutOperator(); virtual ~ImageComposer_CutOperator(); + static QString Type() { return "cut"; } + virtual QString name() const; protected: diff --git a/src/ImageComposer/ImageComposer_FuseOperator.cxx b/src/ImageComposer/ImageComposer_FuseOperator.cxx index b68ad1741..e23d58296 100644 --- a/src/ImageComposer/ImageComposer_FuseOperator.cxx +++ b/src/ImageComposer/ImageComposer_FuseOperator.cxx @@ -23,7 +23,7 @@ ImageComposer_FuseOperator::~ImageComposer_FuseOperator() */ QString ImageComposer_FuseOperator::name() const { - return "fuse"; + return Type(); } /** diff --git a/src/ImageComposer/ImageComposer_FuseOperator.h b/src/ImageComposer/ImageComposer_FuseOperator.h index 857ad54e9..ac9c5f60b 100644 --- a/src/ImageComposer/ImageComposer_FuseOperator.h +++ b/src/ImageComposer/ImageComposer_FuseOperator.h @@ -15,6 +15,8 @@ public: ImageComposer_FuseOperator(); virtual ~ImageComposer_FuseOperator(); + static QString Type() { return "fuse"; } + virtual QString name() const; protected: diff --git a/src/ImageComposer/ImageComposer_Operator.cxx b/src/ImageComposer/ImageComposer_Operator.cxx index c9cdc7735..e296b4d4d 100644 --- a/src/ImageComposer/ImageComposer_Operator.cxx +++ b/src/ImageComposer/ImageComposer_Operator.cxx @@ -37,15 +37,6 @@ void ImageComposer_Operator::setArgs( const QColor& theBackground ) myBackground = theBackground; } -/** - Return name of the operator - @return name of the operator -*/ -QString ImageComposer_Operator::name() const -{ - return ""; -} - /** Perform the composing of images @param theImage1 the first image to compose diff --git a/src/ImageComposer/ImageComposer_Operator.h b/src/ImageComposer/ImageComposer_Operator.h index cfece776d..ab29b6359 100644 --- a/src/ImageComposer/ImageComposer_Operator.h +++ b/src/ImageComposer/ImageComposer_Operator.h @@ -36,7 +36,12 @@ public: **/ QStringList dumpArgsToPython( QString& theArrayName ) const; - virtual QString name() const; + /** + Return name of the operator. + @return name of the operator + */ + virtual QString name() const = 0; + virtual ImageComposer_Image process( const ImageComposer_Image& theImage1, const ImageComposer_Image& theImage2 ) const;