X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROPy%2FHYDROData_Object.sip;h=9b0fd58ee70b4dfebec055796f244e6c41c929b7;hb=b1a82c5ece18a663b8b601e209a45b1fa256722c;hp=5cec249f104ea2187d69f8a909e344a3f4a63ca9;hpb=3cff85424556651afcab2e7fa5081531d748b7cc;p=modules%2Fhydro.git diff --git a/src/HYDROPy/HYDROData_Object.sip b/src/HYDROPy/HYDROData_Object.sip index 5cec249f..9b0fd58e 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,108 +16,166 @@ // 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; - -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; + // 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_ZONE: - sipClass = sipClass_HYDROData_Zone; - break; +public: - case KIND_UNKNOWN: - sipClass = sipClass_HYDROData_Object; - break; + /** + * Set reference altitude object for geometry object. + */ + bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) [void (const opencascade::handle&)]; + %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 the kind of this object. Must be redefined in all objects of known type. + * Returns reference altitude object of geometry object. */ - const ObjectKind GetKind() const; + HYDROData_IAltitudeObject GetAltitudeObject() const [opencascade::handle ()]; + %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 name of this object. + * Clear the reference altitude object for geometry object. */ - QString GetName() const; + void RemoveAltitudeObject(); /** - * Updates the name of this object. + * Sets filling color for zone. */ - void SetName(const QString& theName); + virtual void SetFillingColor( const QColor& theColor ); /** - * Updates object state. - * \param theIsForce force reupdating of data object + * Returns filling color of zone. */ - void Update(const bool theIsForce); + virtual QColor GetFillingColor() const; /** - * Checks is object exists in the data structure. - * \returns true is object is not exists in the data model + * Sets border color for zone. */ - bool IsRemoved() const; + virtual void SetBorderColor( const QColor& theColor ); /** - * Removes object from the data structure. + * Returns border color of zone. */ - void Remove(); + virtual QColor GetBorderColor() const; + /** - * Returns unique integer identifier of the object (may be used for ordering of objects) + * Returns sequence of object groups. */ - int ID() const; + HYDROData_SequenceOfObjects GetGroups() const; /** - * 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 data model object by it id. */ - /* - void CopyTo( HYDROData_Object theDestination ) const; - */ + HYDROData_ShapesGroup GetGroup( const int theGroupId ) const [opencascade::handle ()]; + %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 + + /** + * Returns group id by data model object. + */ + int GetGroupId( HYDROData_ShapesGroup theGroup ) const [int (const opencascade::handle&)]; + %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 + + void SetIsSubmersible( bool ) const; protected: