{
}
-void HYDROData_Entity::CopyTo( const Handle(HYDROData_Entity)& theDestination ) const
+void HYDROData_Entity::CopyTo( const Handle(HYDROData_Entity)& theDestination,
+ bool isGenerateNewName ) const
{
Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
if ( aDocument.IsNull() ) {
TDF_CopyLabel aCopy(myLab, theDestination->Label());
aCopy.Perform();
- // generate a new unique name for the clone object:
- // case 1: Image_1 -> Image_2
- // case 2: ImageObj -> ImageObj_1
- QString aName = theDestination->GetName();
- QString aPrefix = aName;
- if( aName.contains( '_' ) ) { // case 1
- QString aSuffix = aName.section( '_', -1 );
- bool anIsInteger = false;
- aSuffix.toInt( &anIsInteger );
- if( anIsInteger )
- aPrefix = aName.section( '_', 0, -2 );
- } else { // case 2
- aPrefix = aName;
- }
+ if( isGenerateNewName )
+ {
+ // generate a new unique name for the clone object:
+ // case 1: Image_1 -> Image_2
+ // case 2: ImageObj -> ImageObj_1
+ QString aName = theDestination->GetName();
+ QString aPrefix = aName;
+ if( aName.contains( '_' ) ) { // case 1
+ QString aSuffix = aName.section( '_', -1 );
+ bool anIsInteger = false;
+ aSuffix.toInt( &anIsInteger );
+ if( anIsInteger )
+ aPrefix = aName.section( '_', 0, -2 );
+ } else { // case 2
+ aPrefix = aName;
+ }
- aName = HYDROData_Tool::GenerateObjectName( aDocument, aPrefix );
- theDestination->SetName( aName );
+ aName = HYDROData_Tool::GenerateObjectName( aDocument, aPrefix );
+ theDestination->SetName( aName );
+ }
}
Handle(HYDROData_Entity) HYDROData_Entity::GetFatherObject() const
case KIND_SPLITTED_GROUP: return "KIND_SPLITTED_GROUP";
case KIND_STREAM_ALTITUDE: return "KIND_STREAM_ALTITUDE";
case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE";
- case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE";
+ case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE";
+ case KIND_LAND_COVER: return "KIND_LAND_COVER";
+ case KIND_LAND_COVER_MAP: return "KIND_LAND_COVER_MAP";
default: return "KIND_UNKNOWN"; ///! Unrecognized object
}
}