X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROPy%2FHYDROData_Object.sip;h=abe2d98498078952d577b4dfb8499ee902d4017e;hb=09203a28a524e987ab86ad2c85026555e4f37c98;hp=1d67675dd6e7791121d7d116d5389df865f3105a;hpb=8409849256ec79e1fe34fa460d46f0a91e646606;p=modules%2Fhydro.git diff --git a/src/HYDROPy/HYDROData_Object.sip b/src/HYDROPy/HYDROData_Object.sip index 1d67675d..abe2d984 100644 --- a/src/HYDROPy/HYDROData_Object.sip +++ b/src/HYDROPy/HYDROData_Object.sip @@ -1,12 +1,8 @@ -// 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 @@ -20,113 +16,165 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - %ExportedHeaderCode #include %End -typedef int ObjectKind; - -const ObjectKind KIND_UNKNOWN; -const ObjectKind KIND_IMAGE; -const ObjectKind KIND_POLYLINE; -const ObjectKind KIND_VISUAL_STATE; -const ObjectKind KIND_BATHYMETRY; -const ObjectKind KIND_CALCULATION; -const ObjectKind KIND_ZONE; -const ObjectKind KIND_REGION; - -class HYDROData_Object +class HYDROData_Object : public HYDROData_Entity /Abstract/ { %TypeHeaderCode #include %End %ConvertToSubClassCode - // HYDROData_Object sub-classes provide a unique kind ID. - switch ( sipCpp->GetKind() ) - { - case KIND_IMAGE: - sipClass = sipClass_HYDROData_Image; - break; - - case KIND_POLYLINE: - sipClass = sipClass_HYDROData_Polyline; - break; - - case KIND_BATHYMETRY: - sipClass = sipClass_HYDROData_Bathymetry; - break; - - case KIND_CALCULATION: - sipClass = sipClass_HYDROData_Calculation; - break; - - case KIND_ZONE: - sipClass = sipClass_HYDROData_Zone; - break; + // HYDROData_Object sub-classes provide a unique kind ID. + switch ( sipCpp->GetKind() ) + { + case KIND_OBSTACLE: + sipClass = sipClass_HYDROData_Obstacle; + break; + + case KIND_CONFLUENCE: + sipClass = sipClass_HYDROData_Confluence; + break; + + case KIND_IMMERSIBLE_ZONE: + sipClass = sipClass_HYDROData_ImmersibleZone; + break; + + case KIND_DIGUE: + sipClass = sipClass_HYDROData_Digue; + break; + + case KIND_CHANNEL: + sipClass = sipClass_HYDROData_Channel; + break; + + case KIND_POLYLINE: + sipClass = sipClass_HYDROData_Polyline3D; + break; + + case KIND_PROFILE: + sipClass = sipClass_HYDROData_Profile; + break; + + case KIND_STREAM: + sipClass = sipClass_HYDROData_Stream; + break; + + case KIND_UNKNOWN: + sipClass = sipClass_HYDROData_Entity; + break; + + default: + // We don't recognise the type. + sipClass = NULL; + } +%End - case KIND_REGION: - sipClass = sipClass_HYDROData_Region; - break; +public: - case KIND_UNKNOWN: - sipClass = sipClass_HYDROData_Object; - break; + /** + * Set reference altitude object for geometry object. + */ + bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)]; + %MethodCode - default: - // We don't recognise the type. - sipClass = NULL; + Handle(HYDROData_IAltitudeObject) aRefAltitude = + Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) ); + if ( !aRefAltitude.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_Object::SetAltitudeObject( aRefAltitude ) : + sipCpp->SetAltitudeObject( aRefAltitude ); + Py_END_ALLOW_THREADS } -%End -public: + %End + + /** + * Returns reference altitude object of geometry object. + */ + HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()]; + %MethodCode + + Handle(HYDROData_IAltitudeObject) aRefAltitude; + + Py_BEGIN_ALLOW_THREADS + aRefAltitude = sipSelfWasArg ? sipCpp->HYDROData_Object::GetAltitudeObject() : + sipCpp->GetAltitudeObject(); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude ); + + %End /** - * Returns the kind of this object. Must be redefined in all objects of known type. + * Clear the reference altitude object for geometry object. */ - const ObjectKind GetKind() const; + void RemoveAltitudeObject(); /** - * Returns the name of this object. + * Sets filling color for zone. */ - QString GetName() const; + virtual void SetFillingColor( const QColor& theColor ); /** - * Updates the name of this object. + * Returns filling color of zone. */ - void SetName(const QString& theName); + virtual QColor GetFillingColor() const; /** - * Updates object state. - * \param theIsForce force reupdating of data object + * Sets border color for zone. */ - void Update(const bool theIsForce); + virtual void SetBorderColor( const QColor& theColor ); /** - * Checks is object exists in the data structure. - * \returns true is object is not exists in the data model + * Returns border color of zone. */ - bool IsRemoved() const; + virtual QColor GetBorderColor() const; + /** - * Removes object from the data structure. + * Returns sequence of object groups. */ - void Remove(); + HYDROData_SequenceOfObjects GetGroups() const; /** - * Returns unique integer identifier of the object (may be used for ordering of objects) + * Returns group data model object by it id. */ - int ID() const; + HYDROData_ShapesGroup GetGroup( const int theGroupId ) const [Handle_HYDROData_ShapesGroup ()]; + %MethodCode + + Handle(HYDROData_ShapesGroup) aRefGroup; + + Py_BEGIN_ALLOW_THREADS + aRefGroup = sipSelfWasArg ? sipCpp->HYDROData_Object::GetGroup( a0 ) : + sipCpp->GetGroup( a0 ); + Py_END_ALLOW_THREADS + + sipRes = (HYDROData_ShapesGroup*)createPointer( aRefGroup ); + + %End /** - * Copies all properties of this to the destinated object. - * Objects must be the same type. - * \param theDestination initialized object (from any document) - target of copying + * Returns group id by data model object. */ - /* - void CopyTo( HYDROData_Object theDestination ) const; - */ + int GetGroupId( HYDROData_ShapesGroup theGroup ) const [int (const Handle_HYDROData_ShapesGroup&)]; + %MethodCode + + Handle(HYDROData_ShapesGroup) aRefGroup = + Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) ); + if ( !aRefGroup.IsNull() ) + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipSelfWasArg ? sipCpp->HYDROData_Object::GetGroupId( aRefGroup ) : + sipCpp->GetGroupId( aRefGroup ); + Py_END_ALLOW_THREADS + } + + %End + protected: