]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_Calculation.cxx
Salome HOME
Splitting of czlculztion zones.
[modules/hydro.git] / src / HYDROData / HYDROData_Calculation.cxx
1
2 #include "HYDROData_Calculation.h"
3
4 #include "HYDROData_Document.h"
5 #include "HYDROData_Iterator.h"
6 #include "HYDROData_Polyline.h"
7 #include "HYDROData_Zone.h"
8
9 #include <TDataStd_ReferenceList.hxx>
10
11 #include <QStringList>
12
13 #define PYTHON_BATHYMETRY_ID "KIND_CALCULATION"
14
15 IMPLEMENT_STANDARD_HANDLE(HYDROData_Calculation, HYDROData_Object)
16 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Calculation, HYDROData_Object)
17
18 HYDROData_Calculation::HYDROData_Calculation()
19 {
20 }
21
22 HYDROData_Calculation::~HYDROData_Calculation()
23 {
24 }
25
26 QStringList HYDROData_Calculation::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
27 {
28   QStringList aResList;
29
30   Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
31   if ( aDocument.IsNull() )
32     return aResList;
33                              
34   QString aDocName = aDocument->GetDocPyName();
35   QString aCalculName = GetName();
36
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 );
41
42   // TO_IMPLEMENT
43
44   return aResList;
45 }
46
47 void HYDROData_Calculation::SetBoundaryPolyline( const Handle(HYDROData_Polyline)& thePolyline )
48 {
49   SetReferenceObject( thePolyline, DataTag_BoundaryPolyline );
50 }
51
52 Handle(HYDROData_Polyline) HYDROData_Calculation::GetBoundaryPolyline() const
53 {
54   return Handle(HYDROData_Polyline)::DownCast( 
55            GetReferenceObject( DataTag_BoundaryPolyline ) );
56 }
57
58 void HYDROData_Calculation::RemoveBoundaryPolyline()
59 {
60   ClearReferenceObjects( DataTag_BoundaryPolyline );
61 }
62
63 int HYDROData_Calculation::NbZones() const
64 {
65   return NbReferenceObjects( DataTag_Zone );
66 }
67
68 void HYDROData_Calculation::AddZone( const Handle(HYDROData_Zone)& theZone )
69 {
70   AddReferenceObject( theZone, DataTag_Zone );
71 }
72
73 void HYDROData_Calculation::SetZone( const int                     theIndex,
74                                      const Handle(HYDROData_Zone)& theZone )
75 {
76   SetReferenceObject( theZone, DataTag_Zone, theIndex );
77 }
78
79 void HYDROData_Calculation::SetZones( const HYDROData_SequenceOfObjects& theZones )
80 {
81   SetReferenceObjects( theZones, DataTag_Zone );
82 }
83
84 Handle(HYDROData_Zone) HYDROData_Calculation::GetZone( const int theIndex ) const
85 {
86   return Handle(HYDROData_Zone)::DownCast( 
87            GetReferenceObject( DataTag_Zone, theIndex ) );
88 }
89
90 HYDROData_SequenceOfObjects HYDROData_Calculation::GetZones() const
91 {
92   return GetReferenceObjects( DataTag_Zone );
93 }
94
95 void HYDROData_Calculation::RemoveZones()
96 {
97   ClearReferenceObjects( DataTag_Zone );
98 }
99
100 int HYDROData_Calculation::NbSplittedZones() const
101 {
102   return NbReferenceObjects( DataTag_SplittedZone );
103 }
104
105 void HYDROData_Calculation::AddSplittedZone( const Handle(HYDROData_Zone)& theZone )
106 {
107   AddReferenceObject( theZone, DataTag_SplittedZone );
108 }
109
110 void HYDROData_Calculation::SetSplittedZone( const int                     theIndex,
111                                              const Handle(HYDROData_Zone)& theZone )
112 {
113   SetReferenceObject( theZone, DataTag_SplittedZone, theIndex );
114 }
115
116 void HYDROData_Calculation::SetSplittedZones( const HYDROData_SequenceOfObjects& theZones )
117 {
118   SetReferenceObjects( theZones, DataTag_SplittedZone );
119 }
120
121 Handle(HYDROData_Zone) HYDROData_Calculation::GetSplittedZone( const int theIndex ) const
122 {
123   return Handle(HYDROData_Zone)::DownCast( 
124            GetReferenceObject( DataTag_SplittedZone, theIndex ) );
125 }
126
127 HYDROData_SequenceOfObjects HYDROData_Calculation::GetSplittedZones() const
128 {
129   return GetReferenceObjects( DataTag_SplittedZone );
130 }
131
132 void HYDROData_Calculation::RemoveSplittedZones()
133 {
134   ClearReferenceObjects( DataTag_SplittedZone );
135 }
136