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