Salome HOME
SIP: HYDROData_PolylineXY is completed except one method.
[modules/hydro.git] / src / HYDROPy / HYDROData_PolylineXY.sip
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 %ExportedHeaderCode
24 #include <HYDROData_PolylineXY.h>
25 %End
26
27 class HYDROData_PolylineXY : HYDROData_IPolyline
28 {
29
30 %TypeHeaderCode
31 #include <HYDROData_PolylineXY.h>
32 %End
33
34 %ConvertToSubClassCode
35     switch ( sipCpp->GetKind() )
36     {
37       case KIND_POLYLINEXY:
38         sipClass = sipClass_HYDROData_PolylineXY;
39         break;
40
41       default:
42         // We don't recognise the type.
43         sipClass = NULL;
44     }
45 %End
46
47 public:      
48
49   /**
50    * Returns default wire color for new polyline.
51    */
52   static QColor DefaultWireColor();
53
54   /**
55    * Returns the presentation of polyline section in Qt maner.
56    */
57   static void BuildPainterPath( QPainterPath&                       thePath,
58                                 const SectionType&                  theType,
59                                 const bool&                         theIsClosed,
60                                 const NCollection_Sequence<gp_XYZ>& thePoints );
61
62   /**
63    * Returns flag indicating that polyline can be edited or not.
64    */
65   virtual bool IsEditable() const;
66
67   
68   /**
69    * Returns true if polyline is closed
70    * \param theIsSimpleCheck flag indicating the type of checking
71    *        - if true then all wires checked on closures
72    *        - if false then for positive result polyline should consist of
73    *          only one wire and which must be closed
74    */
75   bool IsClosed( const bool theIsSimpleCheck = true ) const;
76
77    /**
78    * Returns the distance beetwen first and point with index thePointIndex
79    * at the section with index theSectionIndex. -1 is returned if error is occurred.
80    */
81   double GetDistance( const int theSectionIndex,
82                       const int thePointIndex ) const;
83
84   /**
85    * Adds new one section.
86    * \param theSectName name of the section
87    * \param theSectionType type of section
88    * \param theIsClosed flag indicates closures of section
89    */
90 /*TODO:  void GetSections( NCollection_Sequence<TCollection_AsciiString>& theSectNames,
91                     NCollection_Sequence<HYDROData_IPolyline::SectionType>& theSectTypes,
92                     NCollection_Sequence<bool>&                    theSectClosures  /Constrained/) const;
93 */
94   /**
95    * Replaces point for section with index "theSectionIndex".
96    * \param theSectionIndex index of section
97    * \param thePoints new points
98    */
99   void SetPoints( const int         theSectionIndex,
100                   const PointsList& thePoints );
101
102   /**
103    * Returns the painter path.
104    * Note: currently only the first section of the polyline data is taken into account.
105    * \return polyline painter path.
106    */
107   virtual QPainterPath GetPainterPath() const;
108
109 protected:
110
111   /**
112    * Creates new object in the internal data structure. Use higher level objects 
113    * to create objects with real content.
114    */
115   HYDROData_PolylineXY();
116
117   /**
118    * Destructs properties of the object and object itself, removes it from the document.
119    */
120   ~HYDROData_PolylineXY();
121 };
122
123