]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Groups has been changed from edges to shapes storing
authoradv <adv@opencascade.com>
Tue, 17 Dec 2013 11:27:59 +0000 (11:27 +0000)
committeradv <adv@opencascade.com>
Tue, 17 Dec 2013 11:27:59 +0000 (11:27 +0000)
18 files changed:
src/HYDROData/CMakeLists.txt
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROData/HYDROData_EdgesGroup.cxx [deleted file]
src/HYDROData/HYDROData_EdgesGroup.h [deleted file]
src/HYDROData/HYDROData_Entity.h
src/HYDROData/HYDROData_Iterator.cxx
src/HYDROData/HYDROData_Object.cxx
src/HYDROData/HYDROData_Object.h
src/HYDROData/HYDROData_Obstacle.cxx
src/HYDROData/HYDROData_ShapesGroup.cxx [new file with mode: 0644]
src/HYDROData/HYDROData_ShapesGroup.h [new file with mode: 0644]
src/HYDROData/HYDROData_SplittedEdgesGroup.cxx [deleted file]
src/HYDROData/HYDROData_SplittedEdgesGroup.h [deleted file]
src/HYDROData/HYDROData_SplittedShapesGroup.cxx [new file with mode: 0644]
src/HYDROData/HYDROData_SplittedShapesGroup.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_DataModel.cxx

index e8840cd24e9520d46278dec7672c16ba5a1184f5..a3aff83555e9eccb10271ec5195757493b5211e9 100644 (file)
@@ -13,7 +13,6 @@ set(PROJECT_HEADERS
     HYDROData_Digue.h
     HYDROData_Document.h
     HYDROData_DummyObject3D.h
-    HYDROData_EdgesGroup.h
     HYDROData_Entity.h
     HYDROData_IAltitudeObject.h
     HYDROData_Image.h
@@ -32,7 +31,8 @@ set(PROJECT_HEADERS
     HYDROData_Projection.h
     HYDROData_Region.h
     HYDROData_River.h
-    HYDROData_SplittedEdgesGroup.h
+    HYDROData_ShapesGroup.h
+    HYDROData_SplittedShapesGroup.h
     HYDROData_SplitToZonesTool.h
     HYDROData_Stream.h
     HYDROData_Tool.h
@@ -52,7 +52,6 @@ set(PROJECT_SOURCES
     HYDROData_Digue.cxx
     HYDROData_Document.cxx
     HYDROData_DummyObject3D.cxx
-    HYDROData_EdgesGroup.cxx
     HYDROData_Entity.cxx
     HYDROData_IAltitudeObject.cxx
     HYDROData_Image.cxx
@@ -71,7 +70,8 @@ set(PROJECT_SOURCES
     HYDROData_Projection.cxx
     HYDROData_Region.cxx
     HYDROData_River.cxx
-    HYDROData_SplittedEdgesGroup.cxx
+    HYDROData_ShapesGroup.cxx
+    HYDROData_SplittedShapesGroup.cxx
     HYDROData_SplitToZonesTool.cxx
     HYDROData_Stream.cxx
     HYDROData_Tool.cxx
index f8d25eb746999b52c0aaa5e42442cedb827d18a9..4439850ae5daf0d4c47e70aec3ba5f8f3704229a 100644 (file)
@@ -4,12 +4,12 @@
 #include "HYDROData_ArtificialObject.h"
 #include "HYDROData_Bathymetry.h"
 #include "HYDROData_Document.h"
-#include "HYDROData_EdgesGroup.h"
+#include "HYDROData_ShapesGroup.h"
 #include "HYDROData_Iterator.h"
 #include "HYDROData_NaturalObject.h"
 #include "HYDROData_PolylineXY.h"
 #include "HYDROData_SplitToZonesTool.h"
-#include "HYDROData_SplittedEdgesGroup.h"
+#include "HYDROData_SplittedShapesGroup.h"
 #include "HYDROData_Region.h"
 #include "HYDROData_Tool.h"
 #include "HYDROData_Zone.h"
@@ -98,8 +98,8 @@ void HYDROData_CalculationCase::SetName( const QString& theName )
     anIter.Init( aGroups );
     for ( ; anIter.More(); anIter.Next() )
     {
-      Handle(HYDROData_SplittedEdgesGroup) aGroup =
-        Handle(HYDROData_SplittedEdgesGroup)::DownCast( anIter.Value() );
+      Handle(HYDROData_SplittedShapesGroup) aGroup =
+        Handle(HYDROData_SplittedShapesGroup)::DownCast( anIter.Value() );
       if ( aGroup.IsNull() )
         continue;
 
@@ -204,7 +204,7 @@ void HYDROData_CalculationCase::Update()
   QString aRegsPref = CALCULATION_REGIONS_PREF;
   QString aZonesPref = CALCULATION_ZONES_PREF;
 
-  QMap<QString,Handle(HYDROData_SplittedEdgesGroup)> aSplittedEdgesGroupsMap;
+  QMap<QString,Handle(HYDROData_SplittedShapesGroup)> aSplittedEdgesGroupsMap;
 
   // Create result regions for case, by default one zone for one region
   HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplitedObjects );
@@ -244,15 +244,14 @@ void HYDROData_CalculationCase::Update()
     else if ( aSplitData.Type == HYDROData_SplitToZonesTool::SplitData::Data_Edge )
     {
       // Create new edges group
-      if ( aSplitData.ObjectNames.isEmpty() || 
-           aSplitData.Shape.IsNull() || aSplitData.Shape.ShapeType() != TopAbs_EDGE )
+      if ( aSplitData.ObjectNames.isEmpty() || aSplitData.Shape.IsNull() )
         continue;
 
       QString anObjName = aSplitData.ObjectNames.first();
       if ( anObjName.isEmpty() )
         continue;
 
-      Handle(HYDROData_SplittedEdgesGroup) aSplittedGroup;
+      Handle(HYDROData_SplittedShapesGroup) aSplittedGroup;
       if ( !aSplittedEdgesGroupsMap.contains( anObjName ) )
       {
         aSplittedGroup = addNewSplittedGroup();
@@ -270,8 +269,7 @@ void HYDROData_CalculationCase::Update()
       if ( aSplittedGroup.IsNull() )
         continue;
 
-      TopoDS_Edge anEdge = TopoDS::Edge( aSplitData.Shape );
-      aSplittedGroup->AddEdge( anEdge );
+      aSplittedGroup->AddShape( aSplitData.Shape );
     }
   }
 }
@@ -316,7 +314,7 @@ void HYDROData_CalculationCase::RemoveGeometryObjects()
   SetToUpdate( true );
 }
 
-bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup )
+bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup )
 {
   if ( theGroup.IsNull() )
     return false;
@@ -337,7 +335,7 @@ HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryGroups() const
   return GetReferenceObjects( DataTag_GeometryGroup );
 }
 
-void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup )
+void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup )
 {
   if ( theGroup.IsNull() )
     return;
@@ -766,12 +764,12 @@ Handle(HYDROData_Region) HYDROData_CalculationCase::addNewRegion()
   return aNewRegion;
 }
 
-Handle(HYDROData_SplittedEdgesGroup) HYDROData_CalculationCase::addNewSplittedGroup()
+Handle(HYDROData_SplittedShapesGroup) HYDROData_CalculationCase::addNewSplittedGroup()
 {
   TDF_Label aNewLab = myLab.FindChild( DataTag_SplittedGroups ).NewChild();
 
-  Handle(HYDROData_SplittedEdgesGroup) aNewGroup =
-    Handle(HYDROData_SplittedEdgesGroup)::DownCast( 
+  Handle(HYDROData_SplittedShapesGroup) aNewGroup =
+    Handle(HYDROData_SplittedShapesGroup)::DownCast( 
       HYDROData_Iterator::CreateObject( aNewLab, KIND_SPLITTED_GROUP ) );
   AddReferenceObject( aNewGroup, DataTag_SplittedGroups );
 
index 30d61d53f6c611962bf8fffdfe708db363dfcfef..ed719a93709e92615376f6c8610661a87a542ed9 100644 (file)
@@ -19,8 +19,8 @@ class Handle(HYDROData_Object);
 class Handle(HYDROData_Region);
 class Handle(HYDROData_Zone);
 class Handle(HYDROData_PolylineXY);
-class Handle(HYDROData_EdgesGroup);
-class Handle(HYDROData_SplittedEdgesGroup);
+class Handle(HYDROData_ShapesGroup);
+class Handle(HYDROData_SplittedShapesGroup);
 
 DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
 
@@ -114,7 +114,7 @@ public:
   /**
    * Add new one reference geometry group for calculation case.
    */
-  HYDRODATA_EXPORT virtual bool AddGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup );
+  HYDRODATA_EXPORT virtual bool AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup );
 
   /**
    * Returns all reference geometry groups of calculation case.
@@ -124,7 +124,7 @@ public:
   /**
    * Removes reference geometry group from calculation case.
    */
-  HYDRODATA_EXPORT virtual void RemoveGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup );
+  HYDRODATA_EXPORT virtual void RemoveGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup );
 
   /**
    * Removes all reference geometry groups from calculation case.
@@ -242,7 +242,7 @@ private:
   /**
    * Add new one splitted edges group for calculation case.
    */
-  HYDRODATA_EXPORT virtual Handle(HYDROData_SplittedEdgesGroup) addNewSplittedGroup();
+  HYDRODATA_EXPORT virtual Handle(HYDROData_SplittedShapesGroup) addNewSplittedGroup();
 
   /**
    * Returns shell containing faces which correspond to regions.
diff --git a/src/HYDROData/HYDROData_EdgesGroup.cxx b/src/HYDROData/HYDROData_EdgesGroup.cxx
deleted file mode 100644 (file)
index 2b30ae8..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-
-#include "HYDROData_EdgesGroup.h"
-
-#include <TDF_ChildIDIterator.hxx>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
-IMPLEMENT_STANDARD_HANDLE(HYDROData_EdgesGroup,HYDROData_Entity)
-IMPLEMENT_STANDARD_RTTIEXT(HYDROData_EdgesGroup,HYDROData_Entity)
-
-HYDROData_EdgesGroup::HYDROData_EdgesGroup()
-: HYDROData_Entity()
-{
-}
-
-HYDROData_EdgesGroup::~HYDROData_EdgesGroup()
-{
-}
-
-bool HYDROData_EdgesGroup::CanBeUpdated() const
-{
-  return false;
-}
-
-bool HYDROData_EdgesGroup::CanRemove()
-{
-  return false;
-}
-
-void HYDROData_EdgesGroup::AddEdge( const TopoDS_Edge& theEdge )
-{
-  if ( theEdge.IsNull() )
-    return;
-
-  TDF_Label aNewLab = myLab.FindChild( DataTag_Edge ).NewChild();
-
-  TNaming_Builder aBuilder( aNewLab );
-  aBuilder.Generated( theEdge );
-}
-
-void HYDROData_EdgesGroup::SetEdges( const HYDROData_SequenceOfEdges& theEdges )
-{
-  RemoveEdges();
-
-  for ( int i = 1, n = theEdges.Length(); i <= n; ++i )
-  {
-    const TopoDS_Edge& anEdge = theEdges.Value( i );
-    AddEdge( anEdge );
-  }
-}
-
-HYDROData_SequenceOfEdges HYDROData_EdgesGroup::GetEdges() const
-{
-  HYDROData_SequenceOfEdges aResSeq;
-
-  TDF_Label aLabel = myLab.FindChild( DataTag_Edge, false );
-  if ( aLabel.IsNull() )
-    return aResSeq;
-
-  TDF_ChildIDIterator aChildIt( aLabel, TNaming_NamedShape::GetID() );
-  for ( ; aChildIt.More(); aChildIt.Next() )
-  {
-    Handle(TNaming_NamedShape) aNamedShape = 
-      Handle(TNaming_NamedShape)::DownCast( aChildIt.Value() );
-    if ( aNamedShape.IsNull() )
-      continue;
-
-    TopoDS_Shape aStoredShape = aNamedShape->Get();
-    if ( aStoredShape.IsNull() || aStoredShape.ShapeType() != TopAbs_EDGE )
-      continue;
-
-    TopoDS_Edge aStoredEdge = TopoDS::Edge( aStoredShape );
-    aResSeq.Append( aStoredEdge );
-  }
-
-  return aResSeq;
-}
-
-void HYDROData_EdgesGroup::RemoveEdges()
-{
-  TDF_Label aLabel = myLab.FindChild( DataTag_Edge, false );
-  if ( !aLabel.IsNull() )
-    aLabel.ForgetAllAttributes();
-}
-
diff --git a/src/HYDROData/HYDROData_EdgesGroup.h b/src/HYDROData/HYDROData_EdgesGroup.h
deleted file mode 100644 (file)
index 4fadbdb..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-
-#ifndef HYDROData_EdgesGroup_HeaderFile
-#define HYDROData_EdgesGroup_HeaderFile
-
-#include <HYDROData_Entity.h>
-
-class TopoDS_Edge;
-
-DEFINE_STANDARD_HANDLE(HYDROData_EdgesGroup, HYDROData_Entity)
-
-typedef NCollection_Sequence<TopoDS_Edge> HYDROData_SequenceOfEdges;
-
-/**\class HYDROData_EdgesGroup
- * \brief The artificial objects are objects created or planned for creation by human.
- *
- */
-class HYDROData_EdgesGroup : public HYDROData_Entity
-{
-protected:
-  /**
-   * Enumeration of tags corresponding to the persistent object parameters.
-   */
-  enum DataTag
-  {
-    DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
-    DataTag_Edge,   ///< reference edges
-  };
-
-public:
-  DEFINE_STANDARD_RTTI(HYDROData_EdgesGroup);
-
-  /**
-   * Returns the kind of this object. Must be redefined in all objects of known type.
-   */
-  HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_EDGES_GROUP; }
-
-  /**
-   * Returns flag indicating that object is updateble or not.
-   */
-  HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
-
-    /**
-   * Returns flag indicating that object can be removed or not.
-   */
-  HYDRODATA_EXPORT virtual bool CanRemove();
-
-public:      
-  // Public methods to work with reference Edges
-
-  /**
-   * Add new one edge for the group.
-   */
-  HYDRODATA_EXPORT virtual void AddEdge( const TopoDS_Edge& theEdge );
-
-  /**
-   * Sets new sequence of edges for the group.
-   */
-  HYDRODATA_EXPORT virtual void SetEdges( const HYDROData_SequenceOfEdges& theEdges );
-
-  /**
-   * Returns all edges of the group.
-   */
-  HYDRODATA_EXPORT virtual HYDROData_SequenceOfEdges GetEdges() const;
-
-  /**
-   * Removes all edges from the group.
-   */
-  HYDRODATA_EXPORT virtual void RemoveEdges();
-
-
-protected:
-
-  friend class HYDROData_Iterator;
-
-  /**
-   * Creates new object in the internal data structure. Use higher level objects 
-   * to create objects with real content.
-   */
-  HYDRODATA_EXPORT HYDROData_EdgesGroup();
-
-  /**
-   * Destructs properties of the object and object itself, removes it from the document.
-   */
-  virtual HYDRODATA_EXPORT ~HYDROData_EdgesGroup();
-};
-
-#endif
index c1a5fccc16ecbc8d5f61ad8b30ba86719a29d93b..9bf5894ba0710df02ee5baab55bf7350404eba50 100644 (file)
@@ -42,7 +42,7 @@ const ObjectKind KIND_VISUAL_STATE      = 18;
 const ObjectKind KIND_ARTIFICIAL_OBJECT = 19;
 const ObjectKind KIND_NATURAL_OBJECT    = 20;
 const ObjectKind KIND_DUMMY_3D          = 21;
-const ObjectKind KIND_EDGES_GROUP       = 22;
+const ObjectKind KIND_SHAPES_GROUP      = 22;
 const ObjectKind KIND_SPLITTED_GROUP    = 23;
 const ObjectKind KIND_LAST              = KIND_SPLITTED_GROUP;
 
index f0fa49b2b29bee41f13adbd125c7e210a65e2d7e..ae37a417c3f9d31b3ef4a4ca897bfbb46330999d 100644 (file)
@@ -8,7 +8,7 @@
 #include "HYDROData_Confluence.h"
 #include "HYDROData_DummyObject3D.h"
 #include "HYDROData_Digue.h"
-#include "HYDROData_EdgesGroup.h"
+#include "HYDROData_ShapesGroup.h"
 #include "HYDROData_Image.h"
 #include "HYDROData_ImmersibleZone.h"
 #include "HYDROData_Obstacle.h"
@@ -19,7 +19,7 @@
 #include "HYDROData_VisualState.h"
 #include "HYDROData_Region.h"
 #include "HYDROData_River.h"
-#include "HYDROData_SplittedEdgesGroup.h"
+#include "HYDROData_SplittedShapesGroup.h"
 #include "HYDROData_Stream.h"
 #include "HYDROData_Zone.h"
 
@@ -126,8 +126,8 @@ Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel )
     case KIND_ZONE:             aResult = new HYDROData_Zone();              break;
     case KIND_VISUAL_STATE:     aResult = new HYDROData_VisualState();       break;
     case KIND_DUMMY_3D:         aResult = new HYDROData_DummyObject3D();     break;
-    case KIND_EDGES_GROUP:      aResult = new HYDROData_EdgesGroup();        break;
-    case KIND_SPLITTED_GROUP:   aResult = new HYDROData_SplittedEdgesGroup();break;
+    case KIND_SHAPES_GROUP:      aResult = new HYDROData_ShapesGroup();        break;
+    case KIND_SPLITTED_GROUP:   aResult = new HYDROData_SplittedShapesGroup();break;
     default:                                                                 break;
   }
 
index 14304d7891febd64b8781f0e73ba51121fadd0cb..7dfbe8134ae4531f34a0a390c5ec1bc35c2fa972 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "HYDROData_Bathymetry.h"
 #include "HYDROData_DummyObject3D.h"
-#include "HYDROData_EdgesGroup.h"
+#include "HYDROData_ShapesGroup.h"
 #include "HYDROData_Iterator.h"
 
 #include <TNaming_Builder.hxx>
@@ -177,12 +177,12 @@ QColor HYDROData_Object::getDefaultBorderColor() const
   return DefaultBorderColor();
 }
 
-Handle(HYDROData_EdgesGroup) HYDROData_Object::createGroupObject()
+Handle(HYDROData_ShapesGroup) HYDROData_Object::createGroupObject()
 {
   TDF_Label aNewLab = myLab.FindChild( DataTag_EdgesGroup ).NewChild();
 
-  Handle(HYDROData_EdgesGroup) aNewGroup =
-    Handle(HYDROData_EdgesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_EDGES_GROUP ) );
+  Handle(HYDROData_ShapesGroup) aNewGroup =
+    Handle(HYDROData_ShapesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_SHAPES_GROUP ) );
   AddReferenceObject( aNewGroup, DataTag_EdgesGroup );
 
   return aNewGroup;
index 3bf31fe1e6141fcf26b2212d039759889a1e3faa..e20e47893a0088434f1fb2ce685d1fde88ed7fa0 100644 (file)
@@ -10,7 +10,7 @@ DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity)
 class TopoDS_Shape;
 class Handle(HYDROData_Bathymetry);
 class Handle(HYDROData_DummyObject3D);
-class Handle(HYDROData_EdgesGroup);
+class Handle(HYDROData_ShapesGroup);
 
 /**\class HYDROData_Object
  * \brief The base class for all geometrical objects in the HYDRO module.
@@ -170,7 +170,7 @@ protected:
   /**
    * Create new one child group object.
    */
-  HYDRODATA_EXPORT virtual Handle(HYDROData_EdgesGroup) createGroupObject();
+  HYDRODATA_EXPORT virtual Handle(HYDROData_ShapesGroup) createGroupObject();
 
   /**
    * Create all necessary child group objects.
index 76480bd1bd93b2e29a16e885173a7de8abd202cd..adf6b6da4280f0ad8cb8628c6d46580526749b98 100644 (file)
@@ -2,7 +2,7 @@
 #include "HYDROData_Obstacle.h"
 
 #include "HYDROData_Document.h"
-#include "HYDROData_EdgesGroup.h"
+#include "HYDROData_ShapesGroup.h"
 
 #include <Basics_Utils.hxx>
 
@@ -353,7 +353,7 @@ void HYDROData_Obstacle::createGroupObjects()
   TopoDS_Shape anObstacleShape = GetTopShape();
   if ( !anObstacleShape.IsNull() )
   {
-    HYDROData_SequenceOfEdges aWireEdges;
+    TopTools_SequenceOfShape aWireEdges;
 
     TopExp_Explorer anExp( anObstacleShape, TopAbs_EDGE );
     for ( ; anExp.More(); anExp.Next() )
@@ -369,10 +369,10 @@ void HYDROData_Obstacle::createGroupObjects()
     {
       QString aWireGroupName = GetName() + "_External_Wire";
 
-      Handle(HYDROData_EdgesGroup) anExtWireGroup = createGroupObject();
+      Handle(HYDROData_ShapesGroup) anExtWireGroup = createGroupObject();
       anExtWireGroup->SetName( aWireGroupName );
      
-      anExtWireGroup->SetEdges( aWireEdges );
+      anExtWireGroup->SetShapes( aWireEdges );
     }
   }
 }
diff --git a/src/HYDROData/HYDROData_ShapesGroup.cxx b/src/HYDROData/HYDROData_ShapesGroup.cxx
new file mode 100644 (file)
index 0000000..1ef3ad9
--- /dev/null
@@ -0,0 +1,86 @@
+
+#include "HYDROData_ShapesGroup.h"
+
+#include <TDF_ChildIDIterator.hxx>
+
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+
+IMPLEMENT_STANDARD_HANDLE(HYDROData_ShapesGroup,HYDROData_Entity)
+IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ShapesGroup,HYDROData_Entity)
+
+HYDROData_ShapesGroup::HYDROData_ShapesGroup()
+: HYDROData_Entity()
+{
+}
+
+HYDROData_ShapesGroup::~HYDROData_ShapesGroup()
+{
+}
+
+bool HYDROData_ShapesGroup::CanBeUpdated() const
+{
+  return false;
+}
+
+bool HYDROData_ShapesGroup::CanRemove()
+{
+  return false;
+}
+
+void HYDROData_ShapesGroup::AddShape( const TopoDS_Shape& theShape )
+{
+  if ( theShape.IsNull() )
+    return;
+
+  TDF_Label aNewLab = myLab.FindChild( DataTag_Shape ).NewChild();
+
+  TNaming_Builder aBuilder( aNewLab );
+  aBuilder.Generated( theShape );
+}
+
+void HYDROData_ShapesGroup::SetShapes( const TopTools_SequenceOfShape& theShapes )
+{
+  RemoveShapes();
+
+  for ( int i = 1, n = theShapes.Length(); i <= n; ++i )
+  {
+    const TopoDS_Shape& aShape = theShapes.Value( i );
+    AddShape( aShape );
+  }
+}
+
+void HYDROData_ShapesGroup::GeShapes( TopTools_SequenceOfShape& theShapes ) const
+{
+  theShapes.Clear();
+
+  TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false );
+  if ( aLabel.IsNull() )
+    return;
+
+  TDF_ChildIDIterator aChildIt( aLabel, TNaming_NamedShape::GetID() );
+  for ( ; aChildIt.More(); aChildIt.Next() )
+  {
+    Handle(TNaming_NamedShape) aNamedShape = 
+      Handle(TNaming_NamedShape)::DownCast( aChildIt.Value() );
+    if ( aNamedShape.IsNull() )
+      continue;
+
+    TopoDS_Shape aStoredShape = aNamedShape->Get();
+    if ( aStoredShape.IsNull() )
+      continue;
+
+    theShapes.Append( aStoredShape );
+  }
+}
+
+void HYDROData_ShapesGroup::RemoveShapes()
+{
+  TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false );
+  if ( !aLabel.IsNull() )
+    aLabel.ForgetAllAttributes();
+}
+
diff --git a/src/HYDROData/HYDROData_ShapesGroup.h b/src/HYDROData/HYDROData_ShapesGroup.h
new file mode 100644 (file)
index 0000000..1bf5532
--- /dev/null
@@ -0,0 +1,86 @@
+
+#ifndef HYDROData_ShapesGroup_HeaderFile
+#define HYDROData_ShapesGroup_HeaderFile
+
+#include <HYDROData_Entity.h>
+
+#include <TopTools_SequenceOfShape.hxx>
+
+class TopoDS_Shape;
+
+DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity)
+
+/**\class HYDROData_ShapesGroup
+ * \brief  Class that stores/retreives the sequence of shapes.
+ */
+class HYDROData_ShapesGroup : public HYDROData_Entity
+{
+protected:
+  /**
+   * Enumeration of tags corresponding to the persistent object parameters.
+   */
+  enum DataTag
+  {
+    DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
+    DataTag_Shape,   ///< reference edges
+  };
+
+public:
+  DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup);
+
+  /**
+   * Returns the kind of this object. Must be redefined in all objects of known type.
+   */
+  HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SHAPES_GROUP; }
+
+  /**
+   * Returns flag indicating that object is updateble or not.
+   */
+  HYDRODATA_EXPORT virtual bool CanBeUpdated() const;
+
+    /**
+   * Returns flag indicating that object can be removed or not.
+   */
+  HYDRODATA_EXPORT virtual bool CanRemove();
+
+public:      
+  // Public methods to work with reference Edges
+
+  /**
+   * Add new one edge for the group.
+   */
+  HYDRODATA_EXPORT virtual void AddShape( const TopoDS_Shape& theShape );
+
+  /**
+   * Sets new sequence of edges for the group.
+   */
+  HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes );
+
+  /**
+   * Returns all edges of the group.
+   */
+  HYDRODATA_EXPORT virtual void GeShapes( TopTools_SequenceOfShape& theShapes ) const;
+
+  /**
+   * Removes all edges from the group.
+   */
+  HYDRODATA_EXPORT virtual void RemoveShapes();
+
+
+protected:
+
+  friend class HYDROData_Iterator;
+
+  /**
+   * Creates new object in the internal data structure. Use higher level objects 
+   * to create objects with real content.
+   */
+  HYDRODATA_EXPORT HYDROData_ShapesGroup();
+
+  /**
+   * Destructs properties of the object and object itself, removes it from the document.
+   */
+  virtual HYDRODATA_EXPORT ~HYDROData_ShapesGroup();
+};
+
+#endif
diff --git a/src/HYDROData/HYDROData_SplittedEdgesGroup.cxx b/src/HYDROData/HYDROData_SplittedEdgesGroup.cxx
deleted file mode 100644 (file)
index 92a54e9..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#include "HYDROData_SplittedEdgesGroup.h"
-
-IMPLEMENT_STANDARD_HANDLE(HYDROData_SplittedEdgesGroup,HYDROData_EdgesGroup)
-IMPLEMENT_STANDARD_RTTIEXT(HYDROData_SplittedEdgesGroup,HYDROData_EdgesGroup)
-
-HYDROData_SplittedEdgesGroup::HYDROData_SplittedEdgesGroup()
-: HYDROData_EdgesGroup()
-{
-}
-
-HYDROData_SplittedEdgesGroup::~HYDROData_SplittedEdgesGroup()
-{
-}
-
-
diff --git a/src/HYDROData/HYDROData_SplittedEdgesGroup.h b/src/HYDROData/HYDROData_SplittedEdgesGroup.h
deleted file mode 100644 (file)
index e62cadb..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-
-#ifndef HYDROData_SplittedEdgesGroup_HeaderFile
-#define HYDROData_SplittedEdgesGroup_HeaderFile
-
-#include <HYDROData_EdgesGroup.h>
-
-DEFINE_STANDARD_HANDLE(HYDROData_SplittedEdgesGroup, HYDROData_EdgesGroup)
-
-
-/**\class HYDROData_SplittedEdgesGroup
- * \brief The artificial objects are objects created or planned for creation by human.
- *
- */
-class HYDROData_SplittedEdgesGroup : public HYDROData_EdgesGroup
-{
-protected:
-  /**
-   * Enumeration of tags corresponding to the persistent object parameters.
-   */
-  enum DataTag
-  {
-    DataTag_First = HYDROData_EdgesGroup::DataTag_First + 100 ///< first tag, to reserve
-  };
-
-public:
-  DEFINE_STANDARD_RTTI(HYDROData_SplittedEdgesGroup);
-
-  /**
-   * Returns the kind of this object. Must be redefined in all objects of known type.
-   */
-  HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SPLITTED_GROUP; }
-
-protected:
-
-  friend class HYDROData_Iterator;
-
-  /**
-   * Creates new object in the internal data structure. Use higher level objects 
-   * to create objects with real content.
-   */
-  HYDRODATA_EXPORT HYDROData_SplittedEdgesGroup();
-
-  /**
-   * Destructs properties of the object and object itself, removes it from the document.
-   */
-  virtual HYDRODATA_EXPORT ~HYDROData_SplittedEdgesGroup();
-};
-
-#endif
diff --git a/src/HYDROData/HYDROData_SplittedShapesGroup.cxx b/src/HYDROData/HYDROData_SplittedShapesGroup.cxx
new file mode 100644 (file)
index 0000000..41c14f2
--- /dev/null
@@ -0,0 +1,16 @@
+
+#include "HYDROData_SplittedShapesGroup.h"
+
+IMPLEMENT_STANDARD_HANDLE(HYDROData_SplittedShapesGroup,HYDROData_ShapesGroup)
+IMPLEMENT_STANDARD_RTTIEXT(HYDROData_SplittedShapesGroup,HYDROData_ShapesGroup)
+
+HYDROData_SplittedShapesGroup::HYDROData_SplittedShapesGroup()
+: HYDROData_ShapesGroup()
+{
+}
+
+HYDROData_SplittedShapesGroup::~HYDROData_SplittedShapesGroup()
+{
+}
+
+
diff --git a/src/HYDROData/HYDROData_SplittedShapesGroup.h b/src/HYDROData/HYDROData_SplittedShapesGroup.h
new file mode 100644 (file)
index 0000000..fd32749
--- /dev/null
@@ -0,0 +1,48 @@
+
+#ifndef HYDROData_SplittedShapesGroup_HeaderFile
+#define HYDROData_SplittedShapesGroup_HeaderFile
+
+#include <HYDROData_ShapesGroup.h>
+
+DEFINE_STANDARD_HANDLE(HYDROData_SplittedShapesGroup, HYDROData_ShapesGroup)
+
+
+/**\class HYDROData_SplittedShapesGroup
+ * \brief Class that stores/retreives the sequence of splitted shapes.
+ */
+class HYDROData_SplittedShapesGroup : public HYDROData_ShapesGroup
+{
+protected:
+  /**
+   * Enumeration of tags corresponding to the persistent object parameters.
+   */
+  enum DataTag
+  {
+    DataTag_First = HYDROData_ShapesGroup::DataTag_First + 100 ///< first tag, to reserve
+  };
+
+public:
+  DEFINE_STANDARD_RTTI(HYDROData_SplittedShapesGroup);
+
+  /**
+   * Returns the kind of this object. Must be redefined in all objects of known type.
+   */
+  HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SPLITTED_GROUP; }
+
+protected:
+
+  friend class HYDROData_Iterator;
+
+  /**
+   * Creates new object in the internal data structure. Use higher level objects 
+   * to create objects with real content.
+   */
+  HYDRODATA_EXPORT HYDROData_SplittedShapesGroup();
+
+  /**
+   * Destructs properties of the object and object itself, removes it from the document.
+   */
+  virtual HYDRODATA_EXPORT ~HYDROData_SplittedShapesGroup();
+};
+
+#endif
index 7b0bcaa3556cfd36ec997599eec8344187c5dc4c..e12aa5fc0496b1f34a63751419d9d85f97fce25f 100644 (file)
@@ -31,7 +31,7 @@
 #include "HYDROGUI_Region.h"
 
 #include <HYDROData_PolylineXY.h>
-#include <HYDROData_EdgesGroup.h>
+#include <HYDROData_ShapesGroup.h>
 #include <HYDROData_Iterator.h>
 #include <HYDROData_Object.h>
 #include <HYDROData_Tool.h>
@@ -788,7 +788,7 @@ void HYDROGUI_CalculationOp::setAvailableGroups()
     HYDROData_SequenceOfObjects aGroups = anObj->GetGroups();
     for( int aGIndex = 1, aGLength = aGroups.Length(); aGIndex <= aGLength; aGIndex++ )
     {
-      Handle_HYDROData_EdgesGroup aGroup = Handle_HYDROData_EdgesGroup::DownCast( aGroups.Value( aGIndex ) );
+      Handle_HYDROData_ShapesGroup aGroup = Handle_HYDROData_ShapesGroup::DownCast( aGroups.Value( aGIndex ) );
       aGroupsNames.append( aGroup->GetName() );
     }
   }
@@ -811,7 +811,7 @@ void HYDROGUI_CalculationOp::onAddGroups()
   QStringList anAddedList;
   for (int i = 0; i < aSelectedList.length(); i++)
   {
-    Handle(HYDROData_EdgesGroup) aGroup = Handle(HYDROData_EdgesGroup)::DownCast( 
+    Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( 
       HYDROGUI_Tool::FindObjectByName( module(), aSelectedList.at( i ) ) );
     if ( aGroup.IsNull() )
       continue;
@@ -840,7 +840,7 @@ void HYDROGUI_CalculationOp::onRemoveGroups()
 
   for (int i = 0; i < aSelectedList.length(); i++)
   {
-    Handle(HYDROData_EdgesGroup) aGroup = Handle(HYDROData_EdgesGroup)::DownCast( 
+    Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( 
       HYDROGUI_Tool::FindObjectByName( module(), aSelectedList.at(i) ) );
     if ( aGroup.IsNull() )
       continue;
index 084fab39315e0a7b4468ff2b3ef3768ab9a512ab..1fb7a1cca721691a06644edaa1d7b587ddd9a854 100644 (file)
@@ -72,7 +72,7 @@
 
 // #define DEB_GROUPS 1
 #ifdef DEB_GROUPS
-#include <HYDROData_EdgesGroup.h>
+#include <HYDROData_ShapesGroup.h>
 #endif
 
 static HYDROData_SequenceOfObjects myCopyingObjects;
@@ -735,8 +735,8 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent,
     HYDROData_SequenceOfObjects::Iterator anIter( anObjGroups );
     for ( ; anIter.More(); anIter.Next() )
     {
-      Handle(HYDROData_EdgesGroup) anObjGroup =
-        Handle(HYDROData_EdgesGroup)::DownCast( anIter.Value() );
+      Handle(HYDROData_ShapesGroup) anObjGroup =
+        Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() );
       if( !anObjGroup.IsNull() && !anObjGroup->IsRemoved() )
         createObject( aGroupsSect, anObjGroup, aGuiObj->entry(), false );
     }