#include "HYDROGUI_DataObject.h"
#include "HYDROGUI_PolylineDlg.h"
#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
#include "HYDROGUI_UpdateFlags.h"
#include <HYDROData_Document.h>
#include <CurveCreator_Curve.hxx>
#include <CurveCreator_Displayer.hxx>
+#include <CurveCreator_Utils.hxx>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
NCollection_Sequence<TCollection_AsciiString> aSectNames;
NCollection_Sequence<HYDROData_PolylineXY::SectionType> aSectTypes;
NCollection_Sequence<bool> aSectClosures;
+ bool aIsInCustom = myEditedObject->GetIsInCustomFlag();
+ myEditedObject->SetIsInCustomFlag( true );
myEditedObject->GetSections( aSectNames, aSectTypes, aSectClosures );
+ myEditedObject->SetIsInCustomFlag( aIsInCustom );
if (!aSectNames.IsEmpty())
{
aCurveCoords.push_back( aSectPoint.Y() );
}
+ Quantity_Color aColor = CurveCreator_Utils::getRandColor();
+ QColor aQColor = CurveCreator_Utils::colorConv(aColor);
+ myEditedObject->GetSectionColor(i-1, aQColor);
+
myCurve->addSectionInternal( aSectName.toStdString(),
- aCurveType, aSectClosure, aCurveCoords );
+ aCurveType, aSectClosure, aCurveCoords, CurveCreator_Utils::colorConv(aQColor) );
}
}
else
for (int aSI = 0; aSI < aSCount; ++aSI)
{
myCurve->addSectionInternal((aNamePrefix + (aSI + 1)).ToCString(),
- CurveCreator::Spline, isCloseds[aSI], aPs[aSI]);
+ CurveCreator::Spline, isCloseds[aSI], aPs[aSI], CurveCreator_Utils::getRandColor());
}
}
}
aPolylineObj->AddSection( aSectName, aSectType, aSectClosure );
- // Add the points fro section
- CurveCreator::Coordinates aCurveCoords = myCurve->getPoints( i );
+ Quantity_Color aColor = myCurve->getColorSection(i);
+ aPolylineObj->SetSectionColor(i, CurveCreator_Utils::colorConv(aColor));
+
+ // Add the points from section
+ CurveCreator::Coordinates aCurveCoords = myCurve->getCoords( i );
if ( aCurveCoords.size() <= 2 )
{
}
}
- if ( !myIsEdit )
- {
- aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
- }
+ //if ( !myIsEdit )
+ //{
+ // aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
+ //}
// Update the wire of polyline
aPolylineObj->Update();