void HYDROData_IPolyline::SetWireColor( const QColor& theColor )
{
- SetColor( theColor, DataTag_WireColor );
+ //SetColor( theColor, DataTag_WireColor ); //DEPRECATED;
+ //set theColor for all sections
+ int nbSec = NbSections();
+ for (int i = 0; i < nbSec; i++)
+ SetSectionColor(i, theColor);
}
QColor HYDROData_IPolyline::GetWireColor() const
}
}
-bool HYDROData_IPolyline::getSectionColor( const int theSectionIndex, QColor &theColor) const
+bool HYDROData_IPolyline::GetSectionColor( const int theSectionIndex, QColor &theColor) const
{
TDF_Label aLabel = myLab.FindChild( DataTag_SectionColors, false );
if ( aLabel.IsNull() )
}
}
-void HYDROData_IPolyline::setSectionColor( const int theSectionIndex,
- const QColor& theColor ) const
+void HYDROData_IPolyline::SetSectionColor( const int theSectionIndex,
+ const QColor& theColor )
{
TDF_Label aLabel = myLab.FindChild( DataTag_SectionColors, true );
if ( aLabel.IsNull() )
aSectLabel.ForgetAllAttributes();
}
}
+
+ void HYDROData_IPolyline::setPythonPolylineSectionColor( QStringList& theScript,
+ const int theSectIndex,
+ const QColor& theColor ) const
+{
+ QString anObjName = GetObjPyName();
+ theScript << QString( "%1.SetSectionColor( %2, QColor( %3, %4, %5, %6 ) )" )
+ .arg( anObjName ).arg( theSectIndex )
+ .arg( theColor.red() ).arg( theColor.green() )
+ .arg( theColor.blue() ).arg( theColor.alpha() );
+}