]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROPy/HYDROData_Bathymetry.sip
Salome HOME
refs# 1917 + protection against null shapes wires in GetMiddlePoint()
[modules/hydro.git] / src / HYDROPy / HYDROData_Bathymetry.sip
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 %ExportedHeaderCode
20 #include <HYDROData_Bathymetry.h>
21 %End
22
23 class HYDROData_Bathymetry : public HYDROData_IAltitudeObject
24 {
25 %ConvertToSubClassCode
26     switch ( sipCpp->GetKind() )
27     {
28       case KIND_BATHYMETRY:
29         sipClass = sipClass_HYDROData_Bathymetry;
30         break;
31
32       default:
33         // We don't recognise the type.
34         sipClass = NULL;
35     }
36 %End
37
38 public:
39   struct AltitudePoint
40   {
41     double X;
42     double Y;
43     double Z;
44   };
45   typedef std::vector<HYDROData_Bathymetry::AltitudePoint> AltitudePoints;
46
47
48 %TypeHeaderCode
49 #include <HYDROData_Bathymetry.h>
50 %End
51
52 public:      
53   virtual void SetAltitudePoints( const HYDROData_Bathymetry::AltitudePoints& );
54   HYDROData_Bathymetry::AltitudePoints GetAltitudePoints() const;
55
56   NCollection_Sequence<double> GetAltitudesForPoints( const NCollection_Sequence<double>& theCoordsX,
57                                                       const NCollection_Sequence<double>& theCoordsY,
58                                                       int                                 theMethod = 0) const
59   [NCollection_Sequence<double> ( const NCollection_Sequence<gp_XY>&, int)];
60   %MethodCode
61
62     NCollection_Sequence<gp_XY> aPnts;
63
64     int aLen = qMin( a0->Length(), a1->Length() );
65     for ( int i = 1; i <= aLen; ++i )
66     {
67       gp_XY aPnt( a0->Value( i ), a1->Value( i ) );
68       aPnts.Append( aPnt );
69     }
70
71     int aMethod = a2;
72     
73     NCollection_Sequence<double> aRes;
74     Py_BEGIN_ALLOW_THREADS
75     aRes = sipSelfWasArg ? sipCpp->HYDROData_Bathymetry::GetAltitudesForPoints( aPnts, aMethod ) : 
76                            sipCpp->GetAltitudesForPoints( aPnts, aMethod );
77     Py_END_ALLOW_THREADS
78     
79     sipRes = new NCollection_Sequence<double>( aRes );
80   %End
81
82
83   void RemoveAltitudePoints();
84
85 public:
86   void SetAltitudesInverted( const bool theIsInverted, const bool theIsUpdate = true );
87   bool IsAltitudesInverted() const;
88
89   bool ImportFromFiles( const QStringList& theFileNames );
90   bool ImportFromFile( const QString& theFileName );
91
92 protected:
93   HYDROData_Bathymetry();
94   ~HYDROData_Bathymetry();
95 };
96
97