- if( !myEditedObject.IsNull() ) {
- // Get colors from the object
- QColor aFillingColor = myEditedObject->GetFillingColor();
- QColor aBorderColor = myEditedObject->GetBorderColor();
+ bool anIsOneColor = false;
+
+ // Get colors from the object
+ QColor aFirstColor, aSecondColor;
+ if ( myEditedObject->IsKind( STANDARD_TYPE(HYDROData_Object) ) )
+ {
+ Handle(HYDROData_Object) aGeomObject =
+ Handle(HYDROData_Object)::DownCast( myEditedObject );
+
+ if ( myEditedObject->GetKind() == KIND_POLYLINE ||
+ myEditedObject->GetKind() == KIND_PROFILE )
+ {
+ aFirstColor = aGeomObject->GetBorderColor();
+ anIsOneColor = true;
+ }
+ else
+ {
+ aFirstColor = aGeomObject->GetFillingColor();
+ aSecondColor = aGeomObject->GetBorderColor();
+ }
+ }
+ else if ( myEditedObject->IsKind( STANDARD_TYPE(HYDROData_IPolyline) ) )
+ {
+ Handle(HYDROData_IPolyline) aPolyObject =
+ Handle(HYDROData_IPolyline)::DownCast( myEditedObject );