]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Adding of list of shapes method added.
authoradv <adv@opencascade.com>
Thu, 9 Jan 2014 10:22:11 +0000 (10:22 +0000)
committeradv <adv@opencascade.com>
Thu, 9 Jan 2014 10:22:11 +0000 (10:22 +0000)
src/HYDROData/HYDROData_ShapesGroup.cxx
src/HYDROData/HYDROData_ShapesGroup.h

index 7942fdf0792b6c2cd4e19c691777f3fb03c81658..237059c0a60afecd7bd458a0926e1773e4dbfedf 100644 (file)
@@ -6,6 +6,9 @@
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+
 #include <TNaming_Builder.hxx>
 #include <TNaming_NamedShape.hxx>
 
@@ -53,6 +56,18 @@ void HYDROData_ShapesGroup::SetShapes( const TopTools_SequenceOfShape& theShapes
   }
 }
 
+void HYDROData_ShapesGroup::SetShapes( const TopTools_ListOfShape& theShapes )
+{
+  RemoveShapes();
+
+  TopTools_ListIteratorOfListOfShape anIter( theShapes );
+  for ( ; anIter.More(); anIter.Next() )
+  {
+    const TopoDS_Shape& aShape = anIter.Value();
+    AddShape( aShape );
+  }
+}
+
 void HYDROData_ShapesGroup::GetShapes( TopTools_SequenceOfShape& theShapes ) const
 {
   theShapes.Clear();
index 798437b2150b6207c5955c95570e693f5d455089..8d6a1948ba44ab1c63c8994c495eb97c6fa5801e 100644 (file)
@@ -7,6 +7,7 @@
 #include <TopTools_SequenceOfShape.hxx>
 
 class TopoDS_Shape;
+class TopTools_ListOfShape;
 
 DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity)
 
@@ -56,6 +57,11 @@ public:
    */
   HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes );
 
+  /**
+   * Sets new list of shapes for the group.
+   */
+  HYDRODATA_EXPORT virtual void SetShapes( const TopTools_ListOfShape& theShapes );
+
   /**
    * Returns all shapes of the group.
    */