Salome HOME
copyrights in HYDRO files are updated
[modules/hydro.git] / src / HYDROPy / HYDROData_PolylineXY.sip
1 // Copyright (C) 2007-2015  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, or (at your option) any later version.
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 : public 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 public:
69
70   /**
71    * Imports shape from IOR.
72    * \param theIOR the IOR of Geom object
73    * \return \c true if shape has been successfully imported
74    */
75   bool ImportFromGeomIOR( const TCollection_AsciiString& theIOR );
76
77   /**
78    * Stores the study entry of the imported GEOM object.
79    * \param theEntry GEOM object entry
80    */
81   void SetGeomObjectEntry( const TCollection_AsciiString& theEntry );
82
83   /**
84    * Returns the imported GEOM object entry.
85    */
86   TCollection_AsciiString GetGeomObjectEntry() const;
87
88
89 public:
90
91   /**
92    * Returns true if polyline is closed
93    * \param theIsSimpleCheck flag indicating the type of checking
94    *        - if true then all wires checked on closures
95    *        - if false then for positive result polyline should consist of
96    *          only one wire and which must be closed
97    */
98   bool IsClosed( const bool theIsSimpleCheck = true ) const;
99
100    /**
101    * Returns the distance beetwen first and point with index thePointIndex
102    * at the section with index theSectionIndex. -1 is returned if error is occurred.
103    */
104   double GetDistance( const int theSectionIndex,
105                       const int thePointIndex ) const;
106
107   /**
108    * Adds new one section.
109    * \param theSectName name of the section
110    * \param theSectionType type of section
111    * \param theIsClosed flag indicates closures of section
112    */
113   void GetSections( NCollection_Sequence<TCollection_AsciiString>& theSectNames /Out/,
114                     NCollection_Sequence<HYDROData_IPolyline::SectionType>& theSectTypes /Out/,
115                     NCollection_Sequence<bool>& theSectClosures /Out/ ) const;
116
117   /**
118    * Replaces point for section with index "theSectionIndex".
119    * \param theSectionIndex index of section
120    * \param thePoints new points
121    */
122   void SetPoints( const int         theSectionIndex,
123                   const HYDROData_IPolyline::PointsList& thePoints );
124
125   /**
126    * Returns the painter path.
127    * Note: currently only the first section of the polyline data is taken into account.
128    * \return polyline painter path.
129    */
130   virtual QPainterPath GetPainterPath() const;
131
132 protected:
133
134   /**
135    * Creates new object in the internal data structure. Use higher level objects 
136    * to create objects with real content.
137    */
138   HYDROData_PolylineXY();
139
140   /**
141    * Destructs properties of the object and object itself, removes it from the document.
142    */
143   ~HYDROData_PolylineXY();
144 };
145
146