#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"
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;
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();
class Handle(HYDROData_Object);
class Handle(HYDROData_Region);
class Handle(HYDROData_Zone);
+class Handle(HYDROData_Polyline);
DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
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:
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.
#include "HYDROData_SplitToZonesTool.h"
-#include "HYDROData_Object.h"
+#include "HYDROData_Polyline.h"
#include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Cut.hxx>
}
HYDROData_SplitToZonesTool::SplitDataList
-HYDROData_SplitToZonesTool::SplitToZones( const HYDROData_SequenceOfObjects& theObjectList )
+HYDROData_SplitToZonesTool::SplitToZones( const HYDROData_SequenceOfObjects& theObjectList,
+ const Handle(HYDROData_Polyline)& thePolyline )
{
SplitDataList anOutputSplitDataList;
}
// Step 2. Take into account the boundary polyline.
- /*
if( !thePolyline.IsNull() )
{
TopoDS_Wire aWire = TopoDS::Wire( thePolyline->GetTopShape() );
}
}
}
- */
// Step 3. Extract the separate regions.
SplitDataList anExtractedSplitDataList;
public:
- static SplitDataList SplitToZones( const HYDROData_SequenceOfObjects& theObjectList );
+ static SplitDataList SplitToZones( const HYDROData_SequenceOfObjects& theObjectList,
+ const Handle(HYDROData_Polyline)& thePolyline );
private: