]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Dump arguments of color mask operator to python string representation.
authoradv <adv@opencascade.com>
Wed, 11 Sep 2013 07:06:23 +0000 (07:06 +0000)
committeradv <adv@opencascade.com>
Wed, 11 Sep 2013 07:06:23 +0000 (07:06 +0000)
src/ImageComposer/ImageComposer_ColorMaskOperator.cxx
src/ImageComposer/ImageComposer_ColorMaskOperator.h

index 8f0f64b25662a59cc81b468ead3f920c3069ca5a..45ee5c901880ac8f1421233d601d0db9a4244844 100644 (file)
@@ -48,6 +48,34 @@ QString ImageComposer_ColorMaskOperator::name() const
   return "colormask";
 }
 
+QStringList ImageComposer_ColorMaskOperator::dumpArgsToPython( QString& theArrayName ) const
+{
+  QStringList aResList = ImageComposer_Operator::dumpArgsToPython( theArrayName );
+
+  QString aStreamName = theArrayName + "_stream";
+
+  //Dump operator arguments
+  aResList << QString( "" );
+  aResList << QString( "mask_color = QColor( %1, %2, %3, %4 );" )
+              .arg( myRefColor.red() ).arg( myRefColor.green() )
+              .arg( myRefColor.blue() ).arg( myRefColor.alpha() );
+  aResList << QString( "%1 << mask_color;" ).arg( aStreamName );
+
+  aResList << QString( "" );
+  aResList << QString( "make_transparent = %1;" ).arg( myIsMakeTransparent );
+  aResList << QString( "%1 << make_transparent;" ).arg( aStreamName );
+
+  aResList << QString( "" );
+  aResList << QString( "rgb_threshold = %1;" ).arg( myRGBThreshold );
+  aResList << QString( "%1 << rgb_threshold;" ).arg( aStreamName );
+
+  aResList << QString( "" );
+  aResList << QString( "alpha_threshold = %1;" ).arg( myAlphaThreshold );
+  aResList << QString( "%1 << alpha_threshold;" ).arg( aStreamName );
+
+  return aResList;
+}
+
 /**
 */
 QRectF ImageComposer_ColorMaskOperator::calcResultBoundingRect( const QRectF& theImage1Bounds, 
index fec0c90252632fa5eb561ddcacb76c1aaefeed0e..1e51315602cd5277682c120b9748022d0f978534 100644 (file)
@@ -22,6 +22,13 @@ public:
 
   virtual QString name() const;
 
+  /**
+    Dumps arguments of operator to python script representation
+    @param theArrayName name of result \c QByteArray array variable
+    @return list of strings with python representation
+  **/
+  QStringList dumpArgsToPython( QString& theArrayName ) const;
+
 protected:
   virtual QRectF calcResultBoundingRect( const QRectF& theImage1Bounds, 
                                          const QRectF& theImage2Bounds ) const;