Salome HOME
15246161d2b3710adeebe6801dff6cd379787a02
[modules/hydro.git] / src / HYDROData / HYDROData_Zone.cxx
1
2 #include "HYDROData_Zone.h"
3
4 #include "HYDROData_Bathymetry.h"
5 #include "HYDROData_Document.h"
6 #include "HYDROData_Polyline.h"
7 #include "HYDROData_Iterator.h"
8
9 #include <TDataStd_IntegerArray.hxx>
10
11 #include <QColor>
12 #include <QStringList>
13
14 #define PYTHON_ZONE_ID "KIND_ZONE"
15
16 IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Domain)
17 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Domain)
18
19 HYDROData_Zone::HYDROData_Zone()
20 {
21 }
22
23 HYDROData_Zone::~HYDROData_Zone()
24 {
25 }
26
27 QStringList HYDROData_Zone::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
28 {
29   QStringList aResList = HYDROData_Domain::DumpToPython( theTreatedObjects );
30   if ( aResList.isEmpty() )
31     return aResList;
32
33   aResList << QString( "" );
34
35   Handle(HYDROData_Polyline) aRefPolyline = GetPolyline();
36   setPythonReferenceObject( theTreatedObjects, aResList, aRefPolyline, "SetPolyline" );
37
38   return aResList;
39 }
40
41 void HYDROData_Zone::SetPolyline( const Handle(HYDROData_Polyline)& thePolyline )
42 {
43   SetReferenceObject( thePolyline, DataTag_Polyline );
44 }
45
46 Handle(HYDROData_Polyline) HYDROData_Zone::GetPolyline() const
47 {
48   return Handle(HYDROData_Polyline)::DownCast( 
49            GetReferenceObject( DataTag_Polyline ) );
50 }
51
52 void HYDROData_Zone::RemovePolyline()
53 {
54   ClearReferenceObjects( DataTag_Polyline );
55 }
56
57 QPainterPath HYDROData_Zone::GetPainterPath() const
58 {
59   QPainterPath aPath;
60
61   Handle(HYDROData_Polyline) aPolyline = GetPolyline();
62   if ( !aPolyline.IsNull() )
63   {
64     aPath = aPolyline->painterPath();
65   }
66
67   return aPath;
68 }
69
70 QString HYDROData_Zone::getPythonKindId() const
71 {
72   return QString( PYTHON_ZONE_ID );
73 }
74
75
76