Salome HOME
Dump of Image objects to python script corrected accordingly with changes for Feature #6.
[modules/hydro.git] / src / HYDROPy / HYDROData_Image.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_Image.h>
25 %End
26
27 class HYDROData_Image : HYDROData_Object
28 {
29
30 %ConvertToSubClassCode
31     if ( !Handle(HYDROData_Image)::DownCast( sipCpp ).IsNull() )
32       sipClass = sipClass_HYDROData_Image;
33     else
34       sipClass = NULL;
35 %End
36
37 %TypeHeaderCode
38 #include <HYDROData_Image.h>
39 %End
40
41 public:
42
43   const ObjectKind           GetKind() const;
44
45 public:      
46
47   /**
48    * Stores the image
49    * \param theImage new image
50    */
51   void                       SetImage( const QImage& theImage );
52
53   /**
54    * Load the image from file
55    * \param theFilePath path to image
56    */
57   bool                       LoadImage( const QString& theFilePath );
58
59   /**
60    * Returns the kept image
61    */
62   QImage                     Image();
63
64   /**
65    * Stores the image transformation
66    * \param theTrsf new transformation
67    */
68   void                       SetTrsf( const QTransform& theTrsf );
69
70   /**
71    * Returns the kept transformation, or "identity" if not yet stored
72    */
73   QTransform                 Trsf();
74
75   /**
76    * Stores the image transformation points (3 input + 3 output)
77    * \param thePointAIn input point A
78    * \param thePointBIn input point B
79    * \param thePointCIn input point C
80    * \param thePointAOut output point A
81    * \param thePointBOut output point B
82    * \param thePointCOut output point C
83    */
84   void                       SetTrsfPoints( const QPoint&  thePointAIn,
85                                             const QPoint&  thePointBIn,
86                                             const QPoint&  thePointCIn,
87                                             const QPointF& thePointAOut,
88                                             const QPointF& thePointBOut,
89                                             const QPointF& thePointCOut );
90
91   /**
92    * Returns the image transformation points (3 input + 3 output)
93    * \param thePointAIn input point A
94    * \param thePointBIn input point B
95    * \param thePointCIn input point C
96    * \param thePointAOut output point A
97    * \param thePointBOut output point B
98    * \param thePointCOut output point C
99    */
100   void                       TrsfPoints( QPoint&  thePointAIn,
101                                          QPoint&  thePointBIn,
102                                          QPoint&  thePointCIn,
103                                          QPointF& thePointAOut,
104                                          QPointF& thePointBOut,
105                                          QPointF& thePointCOut );
106
107   /**
108    * Appends reference to other image.
109    * \param theReferenced the image referenced by this
110    */
111   void AppendReference( HYDROData_Object theReferenced ) [void (Handle_HYDROData_Object)];
112   %MethodCode
113
114     Handle(HYDROData_Object) aRefObj = createHandle( a0 );
115     if ( !aRefObj.IsNull() )
116     {
117       Py_BEGIN_ALLOW_THREADS
118       sipSelfWasArg ? sipCpp->HYDROData_Image::AppendReference( aRefObj ) : 
119                       sipCpp->AppendReference( aRefObj );
120       Py_END_ALLOW_THREADS
121     }
122
123   %End
124
125   /**
126    * Returns the number of referenced images
127    * \return zero if there is no references
128    */
129   int                        NbReferences();
130
131   /**
132    * Returns reference by index.
133    * \param theIndex number of reference [0; NbReference)
134    * \returns the referenced image, or Null if index is invalid
135    */
136   HYDROData_Object Reference( const int theIndex ) const [Handle_HYDROData_Object (const int)];
137   %MethodCode
138
139     Handle(HYDROData_Object) aRefObj;
140     
141     Py_BEGIN_ALLOW_THREADS
142     aRefObj = sipSelfWasArg ? sipCpp->HYDROData_Image::Reference( a0 ) : 
143                               sipCpp->Reference( a0 );
144     Py_END_ALLOW_THREADS
145     
146     sipRes = createPointer( aRefObj );
147   
148   %End
149
150   /**
151    * Updates reference by index. If index is one-bigger than \a NbReferences, 
152    * this method appends it to the end (NbReferences is incremented).
153    * \param theIndex number of reference [0; NbReference]
154    * \param theReferenced the image referenced by this
155    */
156   void ChangeReference( const int theIndex, HYDROData_Object theReferenced ) [void (const int, Handle_HYDROData_Object)];
157   %MethodCode
158
159     Handle(HYDROData_Object) aRefObj = createHandle( a1 );
160     if ( !aRefObj.IsNull() )
161     {
162       Py_BEGIN_ALLOW_THREADS
163       sipSelfWasArg ? sipCpp->HYDROData_Image::ChangeReference( a0, aRefObj ) : 
164                       sipCpp->ChangeReference( a0, aRefObj );
165       Py_END_ALLOW_THREADS
166     }
167   
168   %End
169
170   /**
171    * Removes reference by index
172    * \param theIndex number of reference [0; NbReference)
173    */
174   void                       RemoveReference( const int theIndex );
175
176   /**
177    * Removes all references.
178    */
179   void                       ClearReferences();
180
181   /**
182    * Stores the operator name
183    * \param theOpName name of the operator that must be executed for image update
184    */
185   void                       SetOperatorName( const QString theOpName );
186
187   /**
188    * Returns the operator name
189    * \returns the name of the operator that must be executed for image update
190    */
191   QString                    OperatorName();
192
193   /**
194    * Stores the operator arguments
195    * \param theArgs array that stores the operator arguments, needed for execution
196    */
197   void                       SetArgs( const QByteArray& theArgs );
198
199   /**
200    * Returns the operator arguments
201    * \returns array that stores the operator arguments, needed for execution
202    */
203   QByteArray                 Args();
204   
205   /**
206    * Sets the "MustBeUpdated" flag: if image is depended on updated features.
207    * \param theFlag is true for images that must be updated, false for up-to-date
208    */
209   void                       MustBeUpdated( bool theFlag );
210
211   /**
212    * Returns the "MustBeUpdated" flag: is image must be recomputed or not
213    * \returns false if image is up to date
214    */
215   bool                       MustBeUpdated();
216
217
218 protected:
219
220   /**
221    * Creates new object in the internal data structure. Use higher level objects 
222    * to create objects with real content.
223    */
224   HYDROData_Image();
225
226   /**
227    * Destructs properties of the object and object itself, removes it from the document.
228    */
229   ~HYDROData_Image();
230 };
231
232