Salome HOME
Common part of dump to python is moved to HYDROData_Entity.
[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    typedef bool BOOLTYPE;
26 %End
27
28 class HYDROData_PolylineXY : HYDROData_IPolyline
29 {
30
31 %TypeHeaderCode
32 #include <HYDROData_PolylineXY.h>
33 %End
34
35 %ConvertToSubClassCode
36     switch ( sipCpp->GetKind() )
37     {
38       case KIND_POLYLINEXY:
39         sipClass = sipClass_HYDROData_PolylineXY;
40         break;
41
42       default:
43         // We don't recognise the type.
44         sipClass = NULL;
45     }
46 %End
47
48 public:      
49
50   /**
51    * Returns default wire color for new polyline.
52    */
53   static QColor DefaultWireColor();
54
55   /**
56    * Returns the presentation of polyline section in Qt maner.
57    */
58   static void BuildPainterPath( QPainterPath&                       thePath,
59                                 const SectionType&                  theType,
60                                 const bool&                         theIsClosed,
61                                 const NCollection_Sequence<gp_XYZ>& thePoints );
62
63   /**
64    * Returns flag indicating that polyline can be edited or not.
65    */
66   virtual bool IsEditable() const;
67
68   
69   /**
70    * Returns true if polyline is closed
71    * \param theIsSimpleCheck flag indicating the type of checking
72    *        - if true then all wires checked on closures
73    *        - if false then for positive result polyline should consist of
74    *          only one wire and which must be closed
75    */
76   bool IsClosed( const bool theIsSimpleCheck = true ) const;
77
78    /**
79    * Returns the distance beetwen first and point with index thePointIndex
80    * at the section with index theSectionIndex. -1 is returned if error is occurred.
81    */
82   double GetDistance( const int theSectionIndex,
83                       const int thePointIndex ) const;
84
85   /**
86    * Adds new one section.
87    * \param theSectName name of the section
88    * \param theSectionType type of section
89    * \param theIsClosed flag indicates closures of section
90    */
91   void GetSections( NCollection_Sequence<TCollection_AsciiString>& theSectNames,
92                     NCollection_Sequence<HYDROData_IPolyline::SectionType>& theSectTypes,
93                     /*NCollection_Sequence<bool>&*/ NCollection_Sequence<BOOLTYPE>& theSectClosures ) const;
94
95   /**
96    * Replaces point for section with index "theSectionIndex".
97    * \param theSectionIndex index of section
98    * \param thePoints new points
99    */
100   void SetPoints( const int         theSectionIndex,
101                   const HYDROData_IPolyline::PointsList& thePoints );
102
103   /**
104    * Returns the painter path.
105    * Note: currently only the first section of the polyline data is taken into account.
106    * \return polyline painter path.
107    */
108   virtual QPainterPath GetPainterPath() const;
109
110 protected:
111
112   /**
113    * Creates new object in the internal data structure. Use higher level objects 
114    * to create objects with real content.
115    */
116   HYDROData_PolylineXY();
117
118   /**
119    * Destructs properties of the object and object itself, removes it from the document.
120    */
121   ~HYDROData_PolylineXY();
122 };
123
124