1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 #include <HYDROData_Image.h>
27 class HYDROData_Image : HYDROData_Entity
30 %ConvertToSubClassCode
31 switch ( sipCpp->GetKind() )
34 sipClass = sipClass_HYDROData_Image;
38 // We don't recognise the type.
44 #include <HYDROData_Image.h>
51 * \param theImage new image
53 void SetImage( const QImage& theImage );
56 * Load the image from file
57 * \param theFilePath path to image
59 bool LoadImage( const QString& theFilePath );
62 * Returns the kept image
67 * Stores the image transformation
68 * \param theTrsf new transformation
70 void SetTrsf( const QTransform& theTrsf );
73 * Returns the kept transformation, or "identity" if not yet stored
78 * Stores the image transformation points (3 input + 3 output)
79 * \param thePointA input point A
80 * \param thePointB input point B
81 * \param thePointC input point C
82 * \param theLambertPointA output point A in Lambert93 coordinates
83 * \param theLambertPointB output point B in Lambert93 coordinates
84 * \param theLambertPointC output point C in Lambert93 coordinates
85 * \param theCartesianPointA output point A in Cartesian coordinates
86 * \param theCartesianPointB output point B in Cartesian coordinates
87 * \param theCartesianPointC output point C in Cartesian coordinates
89 void SetTrsfPoints( const QPoint& thePointA,
90 const QPoint& thePointB,
91 const QPoint& thePointC,
92 const QPointF& theLambertPointA,
93 const QPointF& theLambertPointB,
94 const QPointF& theLambertPointC,
95 const QPointF& theCartesianPointA,
96 const QPointF& theCartesianPointB,
97 const QPointF& theCartesianPointC );
100 * Returns the image transformation points (3 input + 3 output)
101 * \param thePointA input point A
102 * \param thePointB input point B
103 * \param thePointC input point C
104 * \param theLambertPointA output point A in Lambert93 coordinates
105 * \param theLambertPointB output point B in Lambert93 coordinates
106 * \param theLambertPointC output point C in Lambert93 coordinates
107 * \param theCartesianPointA output point A in Cartesian coordinates
108 * \param theCartesianPointB output point B in Cartesian coordinates
109 * \param theCartesianPointC output point C in Cartesian coordinates
111 void TrsfPoints( QPoint& thePointA,
114 QPointF& theLambertPointA,
115 QPointF& theLambertPointB,
116 QPointF& theLambertPointC,
117 QPointF& theCartesianPointA,
118 QPointF& theCartesianPointB,
119 QPointF& theCartesianPointC ) const;
122 * Returns true if the image has stored transformation points
124 bool HasTrsfPoints() const;
127 * Stores the transformation mode (0 - Lambert93, 1 - Cartesian)
129 void SetTrsfMode(const int theMode);
132 * Returns the transformation mode (0 - Lambert93, 1 - Cartesian)
134 int TrsfMode() const;
138 * Returns the number of referenced images
139 * \return zero if there is no references
144 * Appends reference to other image.
145 * \param theReferenced the image referenced by this
147 void AppendReference( HYDROData_Entity theReferenced ) [void (Handle_HYDROData_Entity)];
150 Handle(HYDROData_Entity) aRefObj = createHandle( a0 );
151 if ( !aRefObj.IsNull() )
153 Py_BEGIN_ALLOW_THREADS
154 sipSelfWasArg ? sipCpp->HYDROData_Image::AppendReference( aRefObj ) :
155 sipCpp->AppendReference( aRefObj );
162 * Returns reference by index.
163 * \param theIndex number of reference [0; NbReference)
164 * \returns the referenced image, or Null if index is invalid
166 HYDROData_Entity Reference( const int theIndex ) const [Handle_HYDROData_Entity (const int)];
169 Handle(HYDROData_Entity) aRefObj;
171 Py_BEGIN_ALLOW_THREADS
172 aRefObj = sipSelfWasArg ? sipCpp->HYDROData_Image::Reference( a0 ) :
173 sipCpp->Reference( a0 );
176 sipRes = createPointer( aRefObj );
181 * Updates reference by index. If index is one-bigger than \a NbReferences,
182 * this method appends it to the end (NbReferences is incremented).
183 * \param theIndex number of reference [0; NbReference]
184 * \param theReferenced the image referenced by this
186 void ChangeReference( const int theIndex, HYDROData_Entity theReferenced ) [void (const int, Handle_HYDROData_Entity)];
189 Handle(HYDROData_Entity) aRefObj = createHandle( a1 );
190 if ( !aRefObj.IsNull() )
192 Py_BEGIN_ALLOW_THREADS
193 sipSelfWasArg ? sipCpp->HYDROData_Image::ChangeReference( a0, aRefObj ) :
194 sipCpp->ChangeReference( a0, aRefObj );
201 * Removes reference by index
202 * \param theIndex number of reference [0; NbReference)
204 void RemoveReference( const int theIndex );
207 * Removes all references.
209 void ClearReferences();
212 * Stores the operator name
213 * \param theOpName name of the operator that must be executed for image update
215 void SetOperatorName( const QString theOpName );
218 * Returns the operator name
219 * \returns the name of the operator that must be executed for image update
221 QString OperatorName();
224 * Stores the operator arguments
225 * \param theArgs array that stores the operator arguments, needed for execution
227 void SetArgs( const QByteArray& theArgs );
230 * Returns the operator arguments
231 * \returns array that stores the operator arguments, needed for execution
236 * Sets the "MustBeUpdated" flag: if image is depended on updated features.
237 * \param theFlag is true for images that must be updated, false for up-to-date
239 void MustBeUpdated( bool theFlag );
242 * Returns the "MustBeUpdated" flag: is image must be recomputed or not
243 * \returns false if image is up to date
245 bool MustBeUpdated();
251 * Creates new object in the internal data structure. Use higher level objects
252 * to create objects with real content.
257 * Destructs properties of the object and object itself, removes it from the document.