Salome HOME
Merge branch 'master' of https://git.salome-platform.org/git/modules/hydro
[modules/hydro.git] / src / HYDROData / HYDROData_Object.cxx
index 927bd86524aee657da9c88063146792e5aa3da40..20eead85ab2a6ab08dbbced470a32b015fe94632 100644 (file)
@@ -73,11 +73,11 @@ void HYDROData_Object::Update()
 {
   if( IsMustBeUpdated( Geom_2d ) )
   {
-    removeTopShape();
-    removeGroupObjects();
+    RemoveTopShape();
+    RemoveGroupObjects();
   }
   if( IsMustBeUpdated( Geom_3d ) )
-    removeShape3D();
+    RemoveShape3D();
 
   checkAndSetAltitudeObject();
   HYDROData_Entity::Update();
@@ -374,3 +374,26 @@ void HYDROData_Object::SetIsSubmersible( bool isSubmersible ) const
 {
   TDataStd_Integer::Set( myLab, isSubmersible ? 1 : 0 );
 }
+
+void HYDROData_Object::GetBoundaries( QList<TopoDS_Shape>& theBoundShapes,
+                                      QStringList& theBoundNames ) const
+{
+  HYDROData_SequenceOfObjects aGroups = GetGroups();
+    HYDROData_SequenceOfObjects::Iterator anIter( aGroups );
+    for ( ; anIter.More(); anIter.Next() )
+    {
+      Handle(HYDROData_ShapesGroup) aGroup =
+        Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() );
+      if( aGroup.IsNull() )
+        continue;
+
+      QString aName = aGroup->GetName();
+      TopTools_SequenceOfShape aShapes;
+      aGroup->GetShapes( aShapes );
+      for( int i=1, n=aShapes.Length(); i<=n; i++ )
+      {
+        theBoundShapes.append( aShapes( i ) );
+        theBoundNames.append( aName );
+      }
+    }
+}