#include "HYDROData_Iterator.h"
+#include "HYDROData_AltitudeObject.h"
#include "HYDROData_Bathymetry.h"
-#include "HYDROData_Calculation.h"
+#include "HYDROData_CalculationCase.h"
+#include "HYDROData_Channel.h"
+#include "HYDROData_Confluence.h"
+#include "HYDROData_Digue.h"
#include "HYDROData_Image.h"
#include "HYDROData_ImmersibleZone.h"
+#include "HYDROData_Obstacle.h"
#include "HYDROData_Polyline.h"
#include "HYDROData_VisualState.h"
#include "HYDROData_Region.h"
+#include "HYDROData_River.h"
+#include "HYDROData_Stream.h"
#include "HYDROData_Zone.h"
#include <TDataStd_Name.hxx>
return Object( theNewLabel );
}
-Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label theLabel )
+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
if ( aKind == KIND_UNKNOWN )
aKind = theLabel.Father().Tag(); // Try to get type from father label
- Handle(HYDROData_Entity) aResult;
switch( aKind )
{
case KIND_IMAGE:
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_CALCULATION:
- aResult = new HYDROData_Calculation();
+ aResult = new HYDROData_CalculationCase();
break;
case KIND_REGION:
aResult = new HYDROData_Region();