X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROPy%2FHYDROData_Profile.sip;h=11c9a2a8286ca0d417a246385a95797e1fcd38f9;hb=f2cd9ebfca8f8f58c6e98e30d2ebb387488016cc;hp=cfd37d46aebc174ad81d10550cc3462cea7b5238;hpb=1ec37f9d5e793698adfc0c1897d097ce14d287f1;p=modules%2Fhydro.git diff --git a/src/HYDROPy/HYDROData_Profile.sip b/src/HYDROPy/HYDROData_Profile.sip index cfd37d46..11c9a2a8 100644 --- a/src/HYDROPy/HYDROData_Profile.sip +++ b/src/HYDROPy/HYDROData_Profile.sip @@ -29,6 +29,10 @@ class HYDROData_Profile : public HYDROData_Object %TypeHeaderCode #include "HYDROData_Profile.h" %End +public: + + typedef gp_XYZ ProfilePoint; + typedef NCollection_Sequence ProfilePoints; public: /** @@ -65,84 +69,27 @@ public: * Set first(left) point for profile. * \param thePoint the point */ - void SetLeftPoint( const QPointF& thePoint ) [void (const gp_XY&)]; - %MethodCode - - // The C++ API gets the gp_XY object, we convert it from QPointF. - gp_XY aPoint( a0->x(), a0->y() ); - - Py_BEGIN_ALLOW_THREADS - if ( sipSelfWasArg ) - { - sipCpp->HYDROData_Profile::SetLeftPoint( aPoint ); - } - else - { - sipCpp->SetLeftPoint( aPoint ); - } - Py_END_ALLOW_THREADS - %End + void SetLeftPoint( const gp_XY& thePoint ); /** * Returns first(left) point of profile. * \param thePoint[out] profile first point * \return true if point has been set */ - bool GetLeftPoint( QPointF& thePoint ) const [bool (gp_XY&)]; - %MethodCode + bool GetLeftPoint( gp_XY& thePoint ) const; - // The C++ API gets the gp_XY object, then we convert it to QPointF. - gp_XY aPoint(); - - Py_BEGIN_ALLOW_THREADS - sipRes = sipSelfWasArg ? sipCpp->HYDROData_Profile::GetLeftPoint( aPoint ) : - sipCpp->GetLeftPoint( aPoint ); - Py_END_ALLOW_THREADS - - a0->SetX( aPoint.X() ); - a0->SetY( aPoint.Y() ); - %End - /** * Set last(right) point for profile. * \param thePoint the point */ - void SetRightPoint( const QPointF& thePoint ) [void (const gp_XY&)]; - %MethodCode - - // The C++ API gets the gp_XY object, we convert it from QPointF. - gp_XY aPoint( a0->x(), a0->y() ); - - Py_BEGIN_ALLOW_THREADS - { - sipCpp->HYDROData_Profile::SetRightPoint( aPoint ); - } - else - { - sipCpp->SetRightPoint( aPoint ); - } - Py_END_ALLOW_THREADS - %End + void SetRightPoint( const gp_XY& thePoint ); /** * Returns last(right) point of profile. * \param thePoint[out] profile last point * \return true if point has been set */ - bool GetRightPoint( QPointF& thePoint ) const [bool (gp_XY&)]; - %MethodCode - - // The C++ API gets the gp_XY object, then we convert it to QPointF. - gp_XY aPoint(); - - Py_BEGIN_ALLOW_THREADS - sipRes = sipSelfWasArg ? sipCpp->HYDROData_Profile::GetRightPoint( aPoint ) : - sipCpp->GetRightPoint( aPoint ); - Py_END_ALLOW_THREADS - - a0->SetX( aPoint.X() ); - a0->SetY( aPoint.Y() ); - %End + bool GetRightPoint( gp_XY& thePoint ) const; /** @@ -156,7 +103,7 @@ public: Handle(HYDROData_ProfileUZ) aRefProfileUZ; Py_BEGIN_ALLOW_THREADS - aRefProfileUZ = sipSelfWasArg ? sipCpp->HYDROData_ImmersibleZone::GetProfileUZ() : + aRefProfileUZ = sipSelfWasArg ? sipCpp->HYDROData_Profile::GetProfileUZ() : sipCpp->GetProfileUZ(); Py_END_ALLOW_THREADS @@ -181,13 +128,13 @@ public: * Replace current profile parametric points by new one. * \param thePoints the list with new points in parametric form */ - void SetParametricPoints( SIP_PYLIST thePoints ) [void ( const HYDROData_ProfileUZ::PointsList& )]; + void SetParametricPoints( const HYDROData_IPolyline::PointsList& thePoints ); /** * Returns profile points in parametric form. * \return points list */ - SIP_PYLIST GetParametricPoints() const [HYDROData_ProfileUZ::PointsList ()]; + HYDROData_IPolyline::PointsList GetParametricPoints() const; /** @@ -195,14 +142,14 @@ public: * First and last points will be automatically updated. * \param thePoints the list with new profile points */ - void SetProfilePoints( const SIP_PYLIST thePoints ) [void ( const ProfilePoints& )]; + void SetProfilePoints( const HYDROData_Profile::ProfilePoints thePoints ); /** * Returns profile points. * Empty sequence is returned if first or last point was not set. * \return profile points list */ - SIP_PYLIST GetProfilePoints() const [ProfilePoints ()]; + HYDROData_Profile::ProfilePoints GetProfilePoints() const; public: @@ -212,12 +159,12 @@ public: * Stores the profile file path * \param theFilePath profile file path */ - void SetFilePath( const QString& theFilePath ) [void ( const TCollection_AsciiString& )]; + void SetFilePath( const TCollection_AsciiString& theFilePath ); /** * Returns uploaded profile file path */ - QString GetFilePath() const [TCollection_AsciiString ()]; + TCollection_AsciiString GetFilePath() const; /** * Imports Profile data from file. The supported file types: @@ -225,26 +172,28 @@ public: * - georeferenced presentation of profile (3 points in line X,Y,Z) * Create as many objects as many profiles in the file are defined. * \param theFileName the path to file - * \return \c true if file has been successfully read - */ - static bool ImportFromFile( HYDROData_Document theDoc, - const QString& theFileName ) - [bool ( const Handle_HYDROData_Document&, - const TCollection_AsciiString& )]; + * \return \c number of successfully imported profiles + */ + static int ImportFromFile( HYDROData_Document theDoc, + const TCollection_AsciiString& theFileName, + NCollection_Sequence& theBadProfilesIds ) + [int ( const Handle_HYDROData_Document&, + const TCollection_AsciiString&, + NCollection_Sequence& )]; + %MethodCode + Py_BEGIN_ALLOW_THREADS + sipRes = HYDROData_Profile::ImportFromFile( a0, *a1, *a2 ); + Py_END_ALLOW_THREADS + %End /** * Imports Profile data from file. * \param theFileName the path to file + * \param theIsRead set to true if at least one non empty string was read from file * \return \c true if file has been successfully read */ - virtual bool ImportFromFile( const QString& theFileName ) [ bool ( const TCollection_AsciiString& ) ]; - - /** - * Imports Profile data from file. - * \param theFile file to read - * \return \c true if file has been successfully read - */ -// virtual bool ImportFromFile( OSD_File& theFile ); + virtual bool ImportFromFile( const TCollection_AsciiString& theFileName, + bool* theIsRead = 0 ); protected: /**