2 #include "HYDROData_Zone.h"
4 #include "HYDROData_Bathymetry.h"
5 #include "HYDROData_Document.h"
6 #include "HYDROData_Polyline.h"
7 #include "HYDROData_Iterator.h"
9 #include <TDataStd_IntegerArray.hxx>
12 #include <QStringList>
14 #define PYTHON_POLYLINE_ID "KIND_ZONE"
16 IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Object)
17 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Object)
19 HYDROData_Zone::HYDROData_Zone()
23 HYDROData_Zone::~HYDROData_Zone()
27 QStringList HYDROData_Zone::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
31 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
32 if ( aDocument.IsNull() )
38 QColor HYDROData_Zone::DefaultFillingColor()
40 return QColor( Qt::green );
43 void HYDROData_Zone::SetFillingColor( const QColor& theColor )
45 return SetColor( theColor, DataTag_FillingColor );
48 QColor HYDROData_Zone::GetFillingColor() const
50 return GetColor( DefaultFillingColor(), DataTag_FillingColor );
53 QColor HYDROData_Zone::DefaultBorderColor()
55 return QColor( Qt::transparent );
58 void HYDROData_Zone::SetBorderColor( const QColor& theColor )
60 return SetColor( theColor, DataTag_BorderColor );
63 QColor HYDROData_Zone::GetBorderColor() const
65 return GetColor( DefaultBorderColor(), DataTag_BorderColor );
68 void HYDROData_Zone::SetPolyline( const Handle(HYDROData_Polyline)& thePolyline )
70 SetReferenceObject( thePolyline, DataTag_Polyline );
73 Handle(HYDROData_Polyline) HYDROData_Zone::GetPolyline() const
75 return Handle(HYDROData_Polyline)::DownCast(
76 GetReferenceObject( DataTag_Polyline ) );
79 void HYDROData_Zone::RemovePolyline()
81 ClearReferenceObjects( DataTag_Polyline );
84 int HYDROData_Zone::NbBathymetries() const
86 return NbReferenceObjects( DataTag_Bathymetry );
89 void HYDROData_Zone::AddBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry )
91 AddReferenceObject( theBathymetry, DataTag_Bathymetry );
94 void HYDROData_Zone::SetBathymetry( const int theIndex,
95 const Handle(HYDROData_Bathymetry)& theBathymetry )
97 SetReferenceObject( theBathymetry, DataTag_Bathymetry, theIndex );
100 Handle(HYDROData_Bathymetry) HYDROData_Zone::GetBathymetry( const int theIndex ) const
102 return Handle(HYDROData_Bathymetry)::DownCast(
103 GetReferenceObject( DataTag_Bathymetry, theIndex ) );
106 HYDROData_SequenceOfObjects HYDROData_Zone::GetBathymetries() const
108 return GetReferenceObjects( DataTag_Bathymetry );
111 void HYDROData_Zone::RemoveBathymetries()
113 ClearReferenceObjects( DataTag_Bathymetry );
116 QPainterPath HYDROData_Zone::GetPainterPath() const
120 Handle(HYDROData_Polyline) aPolyline = GetPolyline();
121 if ( !aPolyline.IsNull() )
123 aPath = aPolyline->painterPath();