#include <TopoDS_Face.hxx>
#include <TopoDS_Wire.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopExp.hxx>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
}
}
- QColor aWireColor = aPolyline->GetWireColor();
- setBorderColor( aWireColor, false, false );
+ //QColor aWireColor = aPolyline->GetWireColor();
+ std::vector<QColor> aSectColors;
+ //TODO backward comp. with old aWireColor??
+ int nbSec = aPolyline->NbSections();
+ for (int i = 0; i < nbSec; i++)
+ {
+ QColor aColor;
+ aPolyline->GetSectionColor(i, aColor);
+ aSectColors.push_back(aColor);
+ }
+
+ //
+ //setBorderColor( aWireColor, false, false );
+
+ foreach( Handle(AIS_InteractiveObject) aShape, myShapes )
+ {
+ if( !myTopoShape.IsNull() )
+ {
+ Handle(HYDROGUI_Polyline) aPShape = Handle(HYDROGUI_Polyline)::DownCast( aShape );
+ bool WireOrCmp = myTopoShape.ShapeType() == TopAbs_WIRE || myTopoShape.ShapeType() == TopAbs_COMPOUND;
+ if ( !aPShape.IsNull() && WireOrCmp)
+ {
+ TopTools_IndexedMapOfShape MW;
+ TopExp::MapShapes(myTopoShape, TopAbs_WIRE, MW);
+ if (MW.Extent() == nbSec)
+ {
+ for (int i=0;i<nbSec;i++)
+ {
+ const TopoDS_Shape& CW = MW(i+1);
+ Quantity_Color aFColor( getQuantityColorVal( aSectColors[i].red() ),
+ getQuantityColorVal( aSectColors[i].green() ),
+ getQuantityColorVal( aSectColors[i].blue() ),
+ Quantity_TOC_RGB );
+ aPShape->myShapeToColor.Add(CW, aFColor);
+ }
+ }
+ }
+ }
+ }
+
+ //if ( theToDisplay && isVisible() && !myContext.IsNull() )
+ // displayShape( false );
}
else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Polyline3D) ) )
{