]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Boundary polyline added for calculation case.
authoradv <adv@opencascade.com>
Mon, 11 Nov 2013 08:04:36 +0000 (08:04 +0000)
committeradv <adv@opencascade.com>
Mon, 11 Nov 2013 08:04:36 +0000 (08:04 +0000)
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROData/HYDROData_SplitToZonesTool.cxx
src/HYDROData/HYDROData_SplitToZonesTool.h

index 0561d47e1d01cad1d95936428c1f67bf6f99d837..16f25745525c773a714e01df16afa2bc2794b6e7 100644 (file)
@@ -5,6 +5,7 @@
 #include "HYDROData_Document.h"
 #include "HYDROData_Iterator.h"
 #include "HYDROData_NaturalObject.h"
+#include "HYDROData_Polyline.h"
 #include "HYDROData_SplitToZonesTool.h"
 #include "HYDROData_Region.h"
 #include "HYDROData_Tool.h"
@@ -81,12 +82,13 @@ void HYDROData_CalculationCase::SplitGeometryObjects()
   if ( aDocument.IsNull() )
     return;
 
+  Handle(HYDROData_Polyline) aBoundaryPolyline = GetBoundaryPolyline();
   HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
   if ( aGeomObjects.IsEmpty() )
     return;
 
   HYDROData_SplitToZonesTool::SplitDataList aSplitedZones =
-    HYDROData_SplitToZonesTool::SplitToZones( aGeomObjects );
+    HYDROData_SplitToZonesTool::SplitToZones( aGeomObjects, aBoundaryPolyline );
   if ( aSplitedZones.isEmpty() )
     return;
 
@@ -168,6 +170,22 @@ void HYDROData_CalculationCase::RemoveGeometryObjects()
   SetToUpdate( true );
 }
 
+void HYDROData_CalculationCase::SetBoundaryPolyline( const Handle(HYDROData_Polyline)& thePolyline )
+{
+  SetReferenceObject( thePolyline, DataTag_Polyline );
+}
+
+Handle(HYDROData_Polyline) HYDROData_CalculationCase::GetBoundaryPolyline() const
+{
+  return Handle(HYDROData_Polyline)::DownCast( 
+           GetReferenceObject( DataTag_Polyline ) );
+}
+
+void HYDROData_CalculationCase::RemoveBoundaryPolyline()
+{
+  ClearReferenceObjects( DataTag_Polyline );
+}
+
 Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
 {
   Handle(HYDROData_Region) aNewRegion = addNewRegion();
index 79d3aae3921929a349964c9c6e8971b3ae50155d..d6d6ac45d55b10bd3a41be0f04227c2d514ecff3 100644 (file)
@@ -8,6 +8,7 @@
 class Handle(HYDROData_Object);
 class Handle(HYDROData_Region);
 class Handle(HYDROData_Zone);
+class Handle(HYDROData_Polyline);
 
 DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
 
@@ -29,7 +30,8 @@ protected:
     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
     DataTag_GeometryObject,   ///< reference geometry objects
     DataTag_ChildRegion,      ///< child regions
-    DataTag_Region            ///< reference regions
+    DataTag_Region,           ///< reference regions
+    DataTag_Polyline          ///< reference boundary polyline
   };
 
 public:
@@ -77,6 +79,22 @@ public:
   HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
 
 
+  /**
+   * Sets reference boundary polyline object for calculation case.
+   */
+  HYDRODATA_EXPORT virtual void SetBoundaryPolyline( const Handle(HYDROData_Polyline)& thePolyline );
+
+  /**
+   * Returns reference boundary polyline object of calculation case.
+   */
+  HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline) GetBoundaryPolyline() const;
+
+  /**
+   * Remove reference boundary polyline object from calculation case.
+   */
+  HYDRODATA_EXPORT virtual void RemoveBoundaryPolyline();
+
+
   /**
    * Add new one child region for calculation case.
    * The new region is added into the list of reference regions.
index dfd60b75e1264dfa2e594ad32dcae2d2f7d03dc6..2e29c18eef76aca72dcf33a0cdbfb00f9743dc42 100644 (file)
@@ -1,7 +1,7 @@
 
 #include "HYDROData_SplitToZonesTool.h"
 
-#include "HYDROData_Object.h"
+#include "HYDROData_Polyline.h"
 
 #include <BRepAlgoAPI_Common.hxx>
 #include <BRepAlgoAPI_Cut.hxx>
@@ -35,7 +35,8 @@ TopoDS_Face HYDROData_SplitToZonesTool::SplitData::Face() const
 }
 
 HYDROData_SplitToZonesTool::SplitDataList
-HYDROData_SplitToZonesTool::SplitToZones( const HYDROData_SequenceOfObjects& theObjectList )
+HYDROData_SplitToZonesTool::SplitToZones( const HYDROData_SequenceOfObjects& theObjectList,
+                                          const Handle(HYDROData_Polyline)&  thePolyline )
 {
   SplitDataList anOutputSplitDataList;
 
@@ -90,7 +91,6 @@ HYDROData_SplitToZonesTool::SplitToZones( const HYDROData_SequenceOfObjects& the
   }
 
   // Step 2. Take into account the boundary polyline.
-  /*
   if( !thePolyline.IsNull() )
   {
     TopoDS_Wire aWire = TopoDS::Wire( thePolyline->GetTopShape() );
@@ -117,7 +117,6 @@ HYDROData_SplitToZonesTool::SplitToZones( const HYDROData_SequenceOfObjects& the
       }
     }
   }
-  */
 
   // Step 3. Extract the separate regions.
   SplitDataList anExtractedSplitDataList;
index dd70ed421d8ff5615f27edc2fd393d0a23c6cdc1..4552dd8c1910820af1fe832bbc5aa36089782edd 100644 (file)
@@ -41,7 +41,8 @@ public:
 
 public:
 
-  static SplitDataList       SplitToZones( const HYDROData_SequenceOfObjects& theObjectList );
+  static SplitDataList       SplitToZones( const HYDROData_SequenceOfObjects& theObjectList,
+                                           const Handle(HYDROData_Polyline)&  thePolyline );
 
 private: