Salome HOME
refs #1813 ... lot 14 combined commit : parts : 1 - 16
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.cxx
index 84a1ac7b64771dcb5a75e93b569cf83fb832dade..94c4921a78dc8e04e42db0b1440bd7abba083a6e 100644 (file)
@@ -77,11 +77,91 @@ QString HYDROData_Entity::GetName() const
   return QString();
 }
 
+QString HYDROData_Entity::GetType() const
+{
+  return Type( GetKind() );
+}
+
+QString HYDROData_Entity::Type( ObjectKind theKind )
+{
+  switch( theKind )
+  {
+  case KIND_UNKNOWN:
+    return "Unknown";
+  case KIND_IMAGE:
+    return "Image";
+  case KIND_POLYLINE:
+    return "Polyline";
+  case KIND_BATHYMETRY:
+    return "Bathymetry";
+  case KIND_ALTITUDE:
+    return "Altitude";
+  case KIND_IMMERSIBLE_ZONE:
+    return "Immersible_zone";
+  case KIND_RIVER:
+    return "River";
+  case KIND_STREAM:
+    return "Stream";
+  case KIND_CONFLUENCE:
+    return "Confluence";
+  case KIND_CHANNEL:
+    return "Channel";
+  case KIND_OBSTACLE:
+    return "Obstacle";
+  case KIND_DIGUE:
+    return "Digue";
+  case KIND_PROFILE:
+    return "Profile";
+  case KIND_PROFILEUZ:
+    return "Profile_UZ";
+  case KIND_POLYLINEXY:
+    return "Polyline_XY";
+  case KIND_CALCULATION:
+    return "Calculation_case";
+  case KIND_ZONE:
+    return "Zone";
+  case KIND_REGION:
+    return "Region";
+  case KIND_VISUAL_STATE:
+    return "Visual_state";
+  case KIND_ARTIFICIAL_OBJECT:
+    return "Artificial_object";
+  case KIND_NATURAL_OBJECT:
+    return "Natural_object";
+  case KIND_DUMMY_3D:
+    return "Dummy_3d";
+  case KIND_SHAPES_GROUP:
+    return "Shapes_group";
+  case KIND_SPLIT_GROUP:
+    return "Split_group";
+  case KIND_STREAM_ALTITUDE:
+    return "Stream_altitude";
+  case KIND_OBSTACLE_ALTITUDE:
+    return "Obstacle_altitude";
+  case KIND_STRICKLER_TABLE:
+    return "Strickler_table";
+  case KIND_LAND_COVER_OBSOLETE:
+    return "Land_cover";
+  case KIND_CHANNEL_ALTITUDE:
+    return "Channel_altitude";
+  case KIND_LAND_COVER_MAP:
+    return "Land_cover_map";
+  case KIND_DTM:
+    return "DTM";
+  case KIND_BC_POLYGON:
+    return "Boundary Polygon";
+  }
+  return "";
+}
+
 QString HYDROData_Entity::GetObjPyName() const
 {
   QString aName = GetName();
   aName.replace(QRegExp("[\\W]"), "_");
 
+  if( aName[0].isDigit() )
+    aName = GetType() + "_" + aName;
+
   return aName;
 }
 
@@ -705,6 +785,7 @@ QString HYDROData_Entity::getPyTypeID() const
     case KIND_LAND_COVER_OBSOLETE: return "";
     case KIND_CHANNEL_ALTITUDE:  return "KIND_CHANNEL_ALTITUDE";
     case KIND_LAND_COVER_MAP:    return "KIND_LAND_COVER_MAP";
+    case KIND_BC_POLYGON:        return "KIND_BC_POLYGON";
     default:                     return "KIND_UNKNOWN"; ///! Unrecognized object
   }
 }