X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROPy%2FHYDROData_Zone.sip;h=b3eb9bac5bee845f0238240d2f77766b16e13c65;hb=474c2cd65280d793f1c81ca528bc92e1cff988e6;hp=892ef0aa2e847edf229fd07a49cb7147c8012f23;hpb=3cff85424556651afcab2e7fa5081531d748b7cc;p=modules%2Fhydro.git diff --git a/src/HYDROPy/HYDROData_Zone.sip b/src/HYDROPy/HYDROData_Zone.sip index 892ef0aa..b3eb9bac 100644 --- a/src/HYDROPy/HYDROData_Zone.sip +++ b/src/HYDROPy/HYDROData_Zone.sip @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 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 @@ -6,7 +6,7 @@ // 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 @@ -24,159 +24,133 @@ #include %End -class HYDROData_Zone : HYDROData_Object +class HYDROData_Zone : public HYDROData_Entity { -%TypeHeaderCode -#include +%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 %End public: - const ObjectKind GetKind() const; + // Enumeration of mergin types for conflict altitudes + enum MergeAltitudesType + { + 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. + * Sets the merging type for conflict altitudes. + * By default it is set to Merge_ZMIN. */ - void SetFillingColor( const QColor& theColor ); + void SetMergeType( const MergeAltitudesType& theType ); /** - * Returns filling color of zone. + * Returns the merging type for conflict altitudes. */ - QColor GetFillingColor() const; + MergeAltitudesType GetMergeType() 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. + * Sets the reference altitude to resolve the conflict. + * This object is used only in case of "Merge_Object" merge type. */ - void SetPolyline( HYDROData_Polyline thePolyline ) [void (const Handle_HYDROData_Polyline&)]; + void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)]; %MethodCode - Handle(HYDROData_Polyline) aRefPolyline = - Handle(HYDROData_Polyline)::DownCast( createHandle( a0 ) ); - if ( !aRefPolyline.IsNull() ) + 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::SetMergeAltitude( aRefAltitude ) : + sipCpp->SetMergeAltitude( aRefAltitude ); Py_END_ALLOW_THREADS } %End /** - * Returns reference polyline object of zone. + * Returns the reference altitude to resolve the conflict. */ - 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(); + aRefAltitude = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeAltitude() : + sipCpp->GetMergeAltitude(); Py_END_ALLOW_THREADS - sipRes = (HYDROData_Polyline*)createPointer( aRefPolyline ); + sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude ); %End /** - * Remove reference polyline object of zone. + * Removes the reference altitude for resolving the conflict. */ - void RemovePolyline(); + void RemoveMergeAltitude(); - /** - * Returns number of bathymetry objects for zone. - */ - int NbBathymetries() const; /** - * Add reference bathymetry object for zone. + * dd new one geometry object for zone. */ - void AddBathymetry( HYDROData_Bathymetry theBathymetry ) [void (const Handle_HYDROData_Bathymetry&)]; + void AddGeometryObject( HYDROData_Object theRegion ) [void (const Handle_HYDROData_Object&)]; %MethodCode - Handle(HYDROData_Bathymetry) aRefBath = - Handle(HYDROData_Bathymetry)::DownCast( createHandle( a0 ) ); - if ( !aRefBath.IsNull() ) + Handle(HYDROData_Object) aGeomObj = + Handle(HYDROData_Object)::DownCast( createHandle( a0 ) ); + if ( !aGeomObj.IsNull() ) { Py_BEGIN_ALLOW_THREADS - sipSelfWasArg ? sipCpp->HYDROData_Zone::AddBathymetry( aRefBath ) : - sipCpp->AddBathymetry( aRefBath ); + sipSelfWasArg ? sipCpp->HYDROData_Zone::AddGeometryObject( aGeomObj ) : + sipCpp->AddGeometryObject( aGeomObj ); Py_END_ALLOW_THREADS } %End /** - * Change reference bathymetry object with given index for zone. + * Returns all geometry objects of zone. */ - void SetBathymetry( const int theIndex, - HYDROData_Bathymetry theBathymetry ) [void (const int, const Handle_HYDROData_Bathymetry&)]; - %MethodCode - - Handle(HYDROData_Bathymetry) aRefBath = - Handle(HYDROData_Bathymetry)::DownCast( createHandle( a1 ) ); - if ( !aRefBath.IsNull() ) - { - Py_BEGIN_ALLOW_THREADS - sipSelfWasArg ? sipCpp->HYDROData_Zone::SetBathymetry( a0, aRefBath ) : - sipCpp->SetBathymetry( a0, aRefBath ); - Py_END_ALLOW_THREADS - } - - %End + HYDROData_SequenceOfObjects GetGeometryObjects() const; /** - * Returns reference bathymetry object of zone by it index. + * Removes all geometry objects from zone. */ - HYDROData_Bathymetry GetBathymetry( const int theIndex ) const [Handle_HYDROData_Bathymetry (const int)]; - %MethodCode + void RemoveGeometryObjects(); - 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; /** - * Clear list of bathymetry objects of zone. + * Sets the interpolator for zone. By default it is NULL and original + * interpolation algorithms are used to calculate points altitudes. + * If you set interpolator it won't be stored in the data model structure, + * it will be deleted during that time as this zone will be freed. */ - void RemoveBathymetries(); + void SetInterpolator( HYDROData_IInterpolator* theInter ); /** - * Returns the painter path. The painter path is construct by polyline + * * Returns the interpolator of zone object. */ - QPainterPath GetPainterPath() const; + HYDROData_IInterpolator* GetInterpolator() const; protected: