{
anObjectName = myEditedObject->GetName();
- // TODO: Temporary commented until getPolylinesCount, GetPolyline and GetStricklerType data model methods will be implemented
- /*
- int nNoPolylines = myEditedObject->getPolylinesCount();
- for (int i=0; i<nNoPolylines; i++)
- {
- Handle(HYDROData_PolylineXY) aRefPolyline = myEditedObject->GetPolyline(i);
- if ( !aRefPolyline.IsNull() )
- aSelectedPolylines.append( aRefPolyline->GetName() );
+ HYDROData_SequenceOfObjects aRefPolylines = myEditedObject->GetPolylines();
+ for ( int i = aRefPolylines.Lower(); i <= aRefPolylines.Upper(); i++ ) {
+ Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aRefPolylines.Value( i ) );
+ if ( !aPolyline.IsNull() ) {
+ aSelectedPolylines.append( aPolyline->GetName() );
+ }
}
-
- aSelectedStricklerType = myEditedObject->GetStricklerType();
- */
-
- // The code below is a sample of data filling Land cover object
- aSelectedPolylines.append( "Lake_1" );
- aSelectedPolylines.append( "Polyline_1" );
- aSelectedStricklerType = "Canaux naturels";
}
+
+ aSelectedStricklerType = myEditedObject->GetStricklerType();
}
aPanel->setObjectName( anObjectName );
Handle(HYDROData_StricklerTable)::DownCast( anIterator.Current() );
if ( !aStricklerTableObj.IsNull() )
{
- // TODO: implement GetTypes method in data model
- //QStringList aTypes = aStricklerTableObj->GetTypes();
- // The code below is a sample of data filling list of Strickler types
- QStringList aTypes;
- aTypes.append("Zones de champs, prairies, sans cultures");
- aTypes.append("Canaux naturels");
- aTypes.append("Zones à faible urbanization (bourg)");
- QStringList::const_iterator anIt = aTypes.begin(), aLast = aTypes.end();
- for( ; anIt!=aLast; anIt++ )
+ // Get Strickler table data from the data model
+ TColStd_SequenceOfExtendedString aTypes = aStricklerTableObj->GetTypes();
+ for ( int i = 1; i <= aTypes.Length(); i++ )
{
- QString aType = *anIt;
+ QString aType = HYDROGUI_Tool::ToQString( aTypes.Value( i ) );
if ( !aType.isEmpty() && !aStricklerTypes.contains( aType ))
aStricklerTypes.append( aType );
}
}
}
- QList<Handle(HYDROData_PolylineXY)> aZonePolylines;
+ HYDROData_SequenceOfObjects aZonePolylines;
QString aStricklerType;
QStringList aSelectedPolylineNames = aPanel->getSelectedPolylineNames();
QString aPolylineName = *anIt;
if ( !aPolylineName.isEmpty() )
{
- aZonePolylines.append( Handle(HYDROData_PolylineXY)::DownCast(
+ aZonePolylines.Append( Handle(HYDROData_PolylineXY)::DownCast(
HYDROGUI_Tool::FindObjectByName( module(), aPolylineName, KIND_POLYLINEXY ) ) );
}
}
aZoneObj->SetName( anObjectName );
- // TODO: Temporary commented until SetFillingColor, DefaultFillingColor,
- // SetBorderColor and DefaultBorderColor data model methods will be implemented
- /*
if ( !myIsEdit )
{
aZoneObj->SetFillingColor( HYDROData_LandCover::DefaultFillingColor() );
aZoneObj->SetBorderColor( HYDROData_LandCover::DefaultBorderColor() );
}
- */
- // TODO: Temporary commented until SetPolylines and SetStricklerType data model methods will be implemented
- //aZoneObj->SetPolylines( aZonePolylines );
- //aZoneObj->SetStricklerType( aSelectedStricklerType );
+ aZoneObj->SetPolylines( aZonePolylines );
+ aZoneObj->SetStricklerType( aSelectedStricklerType );
aZoneObj->Update();
closePreview();
if ( aViewManager && myPreviewPrs )
{
- // TODO: Temporary commented until GetFillingColor, DefaultFillingColor,
- // GetBorderColor and DefaultBorderColor data model methods will be implemented
- /*
QColor aFillingColor = HYDROData_LandCover::DefaultFillingColor();
QColor aBorderColor = HYDROData_LandCover::DefaultBorderColor();
if ( !myEditedObject.IsNull() ) {
myPreviewPrs->setFillingColor( aFillingColor, false, false );
myPreviewPrs->setBorderColor( aBorderColor, false, false );
- */
TopoDS_Face aFace;
if( !aZoneShape.IsNull() )