2 #include "HYDROData_Calculation.h"
4 #include "HYDROData_Document.h"
5 #include "HYDROData_Iterator.h"
6 #include "HYDROData_Polyline.h"
7 #include "HYDROData_Zone.h"
9 #include <TDataStd_ReferenceList.hxx>
11 #include <QStringList>
13 #define PYTHON_BATHYMETRY_ID "KIND_CALCULATION"
15 IMPLEMENT_STANDARD_HANDLE(HYDROData_Calculation, HYDROData_Object)
16 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Calculation, HYDROData_Object)
18 HYDROData_Calculation::HYDROData_Calculation()
22 HYDROData_Calculation::~HYDROData_Calculation()
26 QStringList HYDROData_Calculation::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
30 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
31 if ( aDocument.IsNull() )
34 QString aDocName = aDocument->GetDocPyName();
35 QString aCalculName = GetName();
37 aResList << QString( "%1 = %2.CreateObject( %3 );" )
38 .arg( aCalculName ).arg( aDocName ).arg( PYTHON_BATHYMETRY_ID );
39 aResList << QString( "%1.SetName( \"%2\" );" )
40 .arg( aCalculName ).arg( aCalculName );
47 void HYDROData_Calculation::SetBoundaryPolyline( const Handle(HYDROData_Polyline)& thePolyline )
49 SetReferenceObject( thePolyline, DataTag_BoundaryPolyline );
52 Handle(HYDROData_Polyline) HYDROData_Calculation::GetBoundaryPolyline() const
54 return Handle(HYDROData_Polyline)::DownCast(
55 GetReferenceObject( DataTag_BoundaryPolyline ) );
58 void HYDROData_Calculation::RemoveBoundaryPolyline()
60 ClearReferenceObjects( DataTag_BoundaryPolyline );
63 int HYDROData_Calculation::NbZones() const
65 return NbReferenceObjects( DataTag_Zone );
68 void HYDROData_Calculation::AddZone( const Handle(HYDROData_Zone)& theZone )
70 AddReferenceObject( theZone, DataTag_Zone );
73 void HYDROData_Calculation::SetZone( const int theIndex,
74 const Handle(HYDROData_Zone)& theZone )
76 SetReferenceObject( theZone, DataTag_Zone, theIndex );
79 void HYDROData_Calculation::SetZones( const HYDROData_SequenceOfObjects& theZones )
81 SetReferenceObjects( theZones, DataTag_Zone );
84 Handle(HYDROData_Zone) HYDROData_Calculation::GetZone( const int theIndex ) const
86 return Handle(HYDROData_Zone)::DownCast(
87 GetReferenceObject( DataTag_Zone, theIndex ) );
90 HYDROData_SequenceOfObjects HYDROData_Calculation::GetZones() const
92 return GetReferenceObjects( DataTag_Zone );
95 void HYDROData_Calculation::RemoveZones()
97 ClearReferenceObjects( DataTag_Zone );
100 int HYDROData_Calculation::NbSplittedZones() const
102 return NbReferenceObjects( DataTag_SplittedZone );
105 void HYDROData_Calculation::AddSplittedZone( const Handle(HYDROData_Zone)& theZone )
107 AddReferenceObject( theZone, DataTag_SplittedZone );
110 void HYDROData_Calculation::SetSplittedZone( const int theIndex,
111 const Handle(HYDROData_Zone)& theZone )
113 SetReferenceObject( theZone, DataTag_SplittedZone, theIndex );
116 void HYDROData_Calculation::SetSplittedZones( const HYDROData_SequenceOfObjects& theZones )
118 SetReferenceObjects( theZones, DataTag_SplittedZone );
121 Handle(HYDROData_Zone) HYDROData_Calculation::GetSplittedZone( const int theIndex ) const
123 return Handle(HYDROData_Zone)::DownCast(
124 GetReferenceObject( DataTag_SplittedZone, theIndex ) );
127 HYDROData_SequenceOfObjects HYDROData_Calculation::GetSplittedZones() const
129 return GetReferenceObjects( DataTag_SplittedZone );
132 void HYDROData_Calculation::RemoveSplittedZones()
134 ClearReferenceObjects( DataTag_SplittedZone );