+ // Object exists if there is a name attribute
+ TDataStd_Name::Set( theNewLabel, "" );
+
+ // Store the type of object in data label
+ TDataStd_NamedData::Set( theNewLabel );
+
+ Handle(TDataStd_NamedData) aNamedData;
+ theNewLabel.FindAttribute( TDataStd_NamedData::GetID(), aNamedData );
+ aNamedData->SetInteger( "ObjectKind", theObjectKind );
+
+ return Object( theNewLabel );
+}
+
+Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel )
+{
+ Handle(HYDROData_Entity) aResult;
+
+ // If label has no name attribute it mean that this is not object or
+ // this object has been removed from document
+ Handle(TDataStd_Name) aNameAtt;
+ if ( !theLabel.FindAttribute( TDataStd_Name::GetID(), aNameAtt ) )
+ return aResult;
+
+ ObjectKind aKind = KIND_UNKNOWN;
+
+ // Retrieve the type of object from label
+ Handle(TDataStd_NamedData) aNamedData;
+ if ( theLabel.FindAttribute( TDataStd_NamedData::GetID(), aNamedData ) )
+ aKind = aNamedData->GetInteger( "ObjectKind" );
+
+ if ( aKind == KIND_UNKNOWN )
+ aKind = theLabel.Father().Tag(); // Try to get type from father label
+
+ switch( aKind )
+ {
+ DEBTRACE("HYDROData_Iterator::Object " << aKind);
+ case KIND_IMAGE: aResult = new HYDROData_Image(); break;
+ case KIND_POLYLINE: aResult = new HYDROData_Polyline3D(); break;
+ case KIND_BATHYMETRY: aResult = new HYDROData_Bathymetry(); break;
+ case KIND_ALTITUDE: aResult = new HYDROData_AltitudeObject(); break;
+ case KIND_IMMERSIBLE_ZONE: aResult = new HYDROData_ImmersibleZone(); break;
+ case KIND_RIVER: aResult = new HYDROData_River(); break;
+ case KIND_STREAM: aResult = new HYDROData_Stream(); break;
+ case KIND_CONFLUENCE: aResult = new HYDROData_Confluence(); break;
+ case KIND_CHANNEL: aResult = new HYDROData_Channel(); break;
+ case KIND_OBSTACLE: aResult = new HYDROData_Obstacle(); break;
+ case KIND_DIGUE: aResult = new HYDROData_Digue(); break;
+ case KIND_PROFILE: aResult = new HYDROData_Profile(); break;
+ case KIND_PROFILEUZ: aResult = new HYDROData_ProfileUZ(); break;
+ case KIND_POLYLINEXY: aResult = new HYDROData_PolylineXY(); break;
+ case KIND_CALCULATION: aResult = new HYDROData_CalculationCase(); break;
+ case KIND_REGION: aResult = new HYDROData_Region(); break;
+ case KIND_ZONE: aResult = new HYDROData_Zone(); break;
+ case KIND_VISUAL_STATE: aResult = new HYDROData_VisualState(); break;
+ case KIND_DUMMY_3D: aResult = new HYDROData_DummyObject3D(); break;
+ case KIND_SHAPES_GROUP: aResult = new HYDROData_ShapesGroup(); break;
+ case KIND_SPLIT_GROUP: aResult = new HYDROData_SplitShapesGroup(); break;
+ case KIND_STREAM_ALTITUDE: aResult = new HYDROData_StreamAltitude(); break;
+ case KIND_OBSTACLE_ALTITUDE: aResult = new HYDROData_ObstacleAltitude(); break;
+ case KIND_STRICKLER_TABLE: aResult = new HYDROData_StricklerTable(); break;
+ case KIND_LAND_COVER_OBSOLETE: break;
+ case KIND_CHANNEL_ALTITUDE: aResult = new HYDROData_ChannelAltitude(); break;
+ case KIND_LAND_COVER_MAP: aResult = new HYDROData_LandCoverMap(); break;
+ case KIND_DTM: aResult = new HYDROData_DTM(); break;
+ default: break;