-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015 EDF-R&D
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <HYDROData_Zone.h>
%End
-class HYDROData_Zone : HYDROData_Object
+class HYDROData_Zone : public HYDROData_Entity
{
-%TypeHeaderCode
-#include <HYDROData_Zone.h>
+%ConvertToSubClassCode
+ switch ( sipCpp->GetKind() )
+ {
+ case KIND_ZONE:
+ sipClass = sipClass_HYDROData_Zone;
+ break;
+
+ default:
+ // We don't recognise the type.
+ sipClass = NULL;
+ }
%End
-%ConvertToSubClassCode
- if ( !Handle(HYDROData_Zone)::DownCast( sipCpp ).IsNull() )
- sipClass = sipClass_HYDROData_Zone;
- else
- sipClass = NULL;
+%TypeHeaderCode
+#include <HYDROData_Zone.h>
%End
public:
- const ObjectKind GetKind() const;
+ // Enumeration of mergin types for conflict altitudes
+ enum MergeType
+ {
+ Merge_ZMIN, // The minimum values
+ Merge_ZMAX, // The maximum values
+ Merge_Object // Only one altitude will be taken into account
+ };
public:
- /**
- * Sets filling color for zone.
- */
- void SetFillingColor( const QColor& theColor );
-
- /**
- * Returns filling color of zone.
- */
- QColor GetFillingColor() const;
-
- /**
- * Sets border color for zone.
- */
- void SetBorderColor( const QColor& theColor );
-
- /**
- * Returns border color of zone.
- */
- QColor GetBorderColor() const;
-
- /**
- * Sets reference polyline object for zone.
- */
- void SetPolyline( HYDROData_Polyline thePolyline ) [void (const Handle_HYDROData_Polyline&)];
- %MethodCode
+ void SetMergeType( const MergeType& theType );
+ MergeType GetMergeType() const;
- Handle(HYDROData_Polyline) aRefPolyline =
- Handle(HYDROData_Polyline)::DownCast( createHandle( a0 ) );
- if ( !aRefPolyline.IsNull() )
+ void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude )
+ [void (const Handle_HYDROData_IAltitudeObject&)];
+ %MethodCode
+ Handle(HYDROData_IAltitudeObject) aRefAltitude =
+ Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
+ if ( !aRefAltitude.IsNull() )
{
Py_BEGIN_ALLOW_THREADS
- sipSelfWasArg ? sipCpp->HYDROData_Zone::SetPolyline( aRefPolyline ) :
- sipCpp->SetPolyline( aRefPolyline );
+ sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeObject( aRefAltitude ) :
+ sipCpp->SetMergeObject( aRefAltitude );
Py_END_ALLOW_THREADS
}
-
%End
- /**
- * Returns reference polyline object of zone.
- */
- HYDROData_Polyline GetPolyline() const [Handle_HYDROData_Polyline ()];
+ HYDROData_IAltitudeObject GetMergeAltitude() const [Handle_HYDROData_IAltitudeObject ()];
%MethodCode
-
- Handle(HYDROData_Polyline) aRefPolyline;
-
+ Handle(HYDROData_IAltitudeObject) aRefAltitude;
Py_BEGIN_ALLOW_THREADS
- aRefPolyline = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetPolyline() :
- sipCpp->GetPolyline();
+ Handle(HYDROData_Entity) aRefObject = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeObject() :
+ sipCpp->GetMergeObject();
+ aRefAltitude = Handle(HYDROData_IAltitudeObject)::DownCast( aRefObject );
Py_END_ALLOW_THREADS
-
- sipRes = (HYDROData_Polyline*)createPointer( aRefPolyline );
-
+ sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude );
%End
- /**
- * Remove reference polyline object of zone.
- */
- void RemovePolyline();
-
- /**
- * Returns number of bathymetry objects for zone.
- */
- int NbBathymetries() const;
-
- /**
- * Add reference bathymetry object for zone.
- */
- void AddBathymetry( HYDROData_Bathymetry theBathymetry ) [void (const Handle_HYDROData_Bathymetry&)];
+ void RemoveMergeAltitude();
%MethodCode
+ Py_BEGIN_ALLOW_THREADS
+ sipSelfWasArg ? sipCpp->HYDROData_Zone::RemoveMergeObject() :
+ sipCpp->RemoveMergeObject();
+ Py_END_ALLOW_THREADS
+ %End
- Handle(HYDROData_Bathymetry) aRefBath =
- Handle(HYDROData_Bathymetry)::DownCast( createHandle( a0 ) );
- if ( !aRefBath.IsNull() )
+ void SetMergeObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)];
+ %MethodCode
+ Handle(HYDROData_Entity) aRefObject =
+ Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
+ if ( !aRefObject.IsNull() )
{
Py_BEGIN_ALLOW_THREADS
- sipSelfWasArg ? sipCpp->HYDROData_Zone::AddBathymetry( aRefBath ) :
- sipCpp->AddBathymetry( aRefBath );
+ sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeObject( aRefObject ) :
+ sipCpp->SetMergeObject( aRefObject );
Py_END_ALLOW_THREADS
}
+ %End
+ HYDROData_Entity GetMergeObject() const [Handle_HYDROData_Entity ()];
+ %MethodCode
+ Handle(HYDROData_Entity) aRefObject;
+ Py_BEGIN_ALLOW_THREADS
+ aRefObject = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeObject() :
+ sipCpp->GetMergeObject();
+ Py_END_ALLOW_THREADS
+ sipRes = (HYDROData_Entity*)createPointer( aRefObject );
%End
- /**
- * Change reference bathymetry object with given index for zone.
- */
- void SetBathymetry( const int theIndex,
- HYDROData_Bathymetry theBathymetry ) [void (const int, const Handle_HYDROData_Bathymetry&)];
+ void RemoveMergeObject();
+
+ void AddObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)];
%MethodCode
- Handle(HYDROData_Bathymetry) aRefBath =
- Handle(HYDROData_Bathymetry)::DownCast( createHandle( a1 ) );
- if ( !aRefBath.IsNull() )
+ Handle(HYDROData_Entity) anObj =
+ Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
+ if ( !anObj.IsNull() )
{
Py_BEGIN_ALLOW_THREADS
- sipSelfWasArg ? sipCpp->HYDROData_Zone::SetBathymetry( a0, aRefBath ) :
- sipCpp->SetBathymetry( a0, aRefBath );
+ sipSelfWasArg ? sipCpp->HYDROData_Zone::AddObject( anObj ) :
+ sipCpp->AddObject( anObj );
Py_END_ALLOW_THREADS
}
%End
- /**
- * Returns reference bathymetry object of zone by it index.
- */
- HYDROData_Bathymetry GetBathymetry( const int theIndex ) const [Handle_HYDROData_Bathymetry (const int)];
- %MethodCode
-
- Handle(HYDROData_Bathymetry) aRefBath;
-
- Py_BEGIN_ALLOW_THREADS
- aRefBath = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetBathymetry( a0 ) :
- sipCpp->GetBathymetry( a0 );
- Py_END_ALLOW_THREADS
-
- sipRes = (HYDROData_Bathymetry*)createPointer( aRefBath );
-
- %End
-
- /**
- * Returns list of all reference bathymetry objects of zone.
- */
- //HYDROData_SequenceOfObjects GetBathymetries() const;
+ HYDROData_SequenceOfObjects GetObjects() const;
- /**
- * Clear list of bathymetry objects of zone.
- */
- void RemoveBathymetries();
-
- /**
- * Returns the painter path. The painter path is construct by polyline
- */
- QPainterPath GetPainterPath() const;
+ void RemoveObjects();
+ void SetInterpolator( HYDROData_IInterpolator* theInter );
+ HYDROData_IInterpolator* GetInterpolator() const;
protected:
- /**
- * Creates new object in the internal data structure. Use higher level objects
- * to create objects with real content.
- */
HYDROData_Zone();
-
- /**
- * Destructs properties of the object and object itself, removes it from the document.
- */
~HYDROData_Zone();
};
-
-