trans2dc.h

Go to the documentation of this file.
00001 /**
00002  * \file trans2dc.h <mi32/trans2dc.h>
00003  * \brief Classes for 2D coordinate transformation
00004  *
00005  * \if NODOC
00006  * $Id: trans2dc.h_v 1.44 2004/11/15 23:26:48 dwilliss Exp $
00007  *
00008  * $Log: trans2dc.h_v $
00009  * Revision 1.44  2004/11/15 23:26:48  dwilliss
00010  * TRANS2D_AFFINE now exported from geom.dll.  4 methods no longer inlineable.
00011  *
00012  * Revision 1.43  2004/08/30 20:57:56  mju
00013  * Return error from SetCtrlPoint.
00014  *
00015  * Revision 1.42  2004/07/09 20:30:06  mju
00016  * Add mapgen IsInput/OutputTransIdentity.
00017  *
00018  * Revision 1.41  2004/07/07 22:02:07  mju
00019  * Return errvalue from getaffine.
00020  *
00021  * Revision 1.40  2004/06/24 20:39:55  mju
00022  * Add Apply...Reverse operations for affine.
00023  *
00024  * Revision 1.39  2004/06/22 15:30:55  mju
00025  * remove trans2d_carto as no longer used, replaced by spatref system.
00026  *
00027  * Revision 1.38  2004/06/18 21:48:09  mju
00028  * Remove GCTP references.
00029  * Support SPATREF.
00030  *
00031  * Revision 1.37  2004/03/04 17:55:47  scowan
00032  * Fixed new compiler warnings.
00033  *
00034  * Revision 1.36  2004/01/20 14:30:54  scowan
00035  * Added is equivalent to method for affine.
00036  *
00037  * Revision 1.35  2004/01/19 21:46:53  scowan
00038  * Added is identity method.
00039  *
00040  * Revision 1.34  2004/01/02 20:50:29  vdronov
00041  * add some methods
00042  *
00043  * Revision 1.33  2003/09/15 13:49:56  fileserver!dwilliss
00044  * Doxygen
00045  *
00046  * Revision 1.32  2003/08/13 20:18:34  scowan
00047  * Added bool value to disable cancel class.
00048  *
00049  * Revision 1.31  2003/06/12 19:33:09  scowan
00050  * Added set full affine.
00051  *
00052  * Revision 1.30  2003/06/11 19:36:32  scowan
00053  * More const.
00054  *
00055  * Revision 1.29  2002/07/30 18:52:52  dwilliss
00056  * Use 0 instead of NULL
00057  *
00058  * Revision 1.28  2002/05/31 22:02:58  dwilliss
00059  * *** empty log message ***
00060  *
00061  * Revision 1.27  2002/04/29 17:39:03  dwilliss
00062  * Added an ApplyPrescale method to TRANS2D_AFFINE
00063  *
00064  * Revision 1.26  2002/04/29 17:00:33  mju
00065  * Add GetInputTrans methods.
00066  *
00067  * Revision 1.25  2002/03/07 15:52:12  mju
00068  * Add AFFINE::setctrlpoints using CTRLPOINT3.
00069  *
00070  * Revision 1.24  2001/08/17 20:36:01  scowan
00071  * Added method to set affine with control points.
00072  *
00073  * Revision 1.23  2001/06/15 21:38:19  scowan
00074  * Nothing.
00075  *
00076  * Revision 1.22  2000/12/06 16:25:32  scowan
00077  * Fixed conversion warning.
00078  *
00079  * Revision 1.21  2000/10/03 22:21:53  msmith
00080  * Genitor documentation.
00081  *
00082  * Revision 1.20  2000/07/18 21:53:11  mju
00083  * Add ReadGeoreference().
00084  *
00085  * Revision 1.19  2000/05/12 16:15:53  scowan
00086  * Added disect methods
00087  *
00088  * Revision 1.18  2000/03/13 16:03:26  mju
00089  * Add MAPGEN::ConvertForward/Inverse for generic point array.
00090  *
00091  * Revision 1.17  2000/03/07 16:52:51  scowan
00092  * Added method to cast to const trans parm automatically.
00093  *
00094  * Revision 1.15  2000/01/26 17:13:44  scowan
00095  * Added update and clear methods.
00096  *
00097  * Revision 1.14  2000/01/26 14:41:05  mju
00098  * Change CARTO and MAPGEN classes to return converted values in reference parm.
00099  *
00100  * Revision 1.10  1999/12/16 23:57:30  scowan
00101  * Added more methods.
00102  *
00103  * Revision 1.9  1999/05/26 14:09:02  mju
00104  * Add AFFINE.ReverseDirection() method.
00105  *
00106  * Revision 1.8  1999/05/20  15:46:45  mju
00107  * Use INT32 for all "NumPoints" parameters.
00108  *
00109  * Revision 1.7  1999/05/19  17:28:41  mju
00110  * Add MAPGEN.GetTransParm.
00111  * Include rect.h.
00112  *
00113  * Revision 1.6  1999/05/19  17:22:05  mju
00114  * Use TransGenCopy().
00115  *
00116  * Revision 1.5  1999/05/19  13:51:40  mju
00117  * Add AFFINE.ConvertForward/Inverse for arrays.
00118  *
00119  * Revision 1.4  1999/05/06  22:14:48  mju
00120  * Add Disect methods.
00121  *
00122  * Revision 1.3  1999/05/05  13:52:51  mju
00123  * Add MAPGEN.Disect methods.
00124  *
00125  * Revision 1.2  1999/04/28  17:41:26  mju
00126  * Include ctrlpt.h.
00127  *
00128  * Revision 1.1  1999/04/19  14:15:57  mju
00129  * Initial revision
00130  *
00131  * \endif
00132 **/
00133 
00134 #ifndef  INC_MI32_TRANS2DC_H
00135 #define  INC_MI32_TRANS2DC_H
00136 
00137 #ifndef  INC_MI32_TRANS2D_H
00138 #include <mi32/trans2d.h>
00139 #endif
00140 
00141 #ifndef  INC_MI32_TRANSGEN_H
00142 #include <mi32/transgen.h>
00143 #endif
00144 
00145 #ifndef  INC_MI32_RECT_H
00146 #include <mi32/rect.h>
00147 #endif
00148 
00149 #ifndef  INC_MI32_MAPPROJ_H
00150 #include <mi32/mapproj.h>
00151 #endif
00152 
00153 #ifndef  INC_MI32_CTRLPT_H
00154 #include <mi32/ctrlpt.h>
00155 #endif
00156 
00157 #ifndef  INC_MI32_RVCGREF_H
00158 #include <mi32/rvcgref.h>
00159 #endif
00160 
00161 #include <memory.h>     //! For memcpy() prototype
00162 
00163 
00164 #ifndef GENERATING_DOXYGEN_OUTPUT
00165 #ifdef GEOMDLL
00166    #define GEOMLIBEXPORT MI_DLLEXPORT
00167    #define GEOMLIBCLASSEXPORT MI_DLLCLASSEXPORT
00168 #else
00169    #define GEOMLIBEXPORT MI_DLLIMPORT
00170    #define GEOMLIBCLASSEXPORT MI_DLLCLASSIMPORT
00171 #endif
00172 
00173 //! Forward declarations
00174 
00175 class TRANS2D_MAPGEN;
00176 
00177 #endif // GENERATING_DOXYGEN_OUTPUT
00178 
00179 //-------------------------------------------------------------------------------------------------------------------
00180 //! Simple affine X/Y coordinate transformation.
00181 //!
00182 //! All conversion methods are inline for maximum speed.  For single point
00183 //! conversion, no function call will occur (assuming the compiler actually
00184 //! inlines the method).  This class replaces the trans2d...() C functions.
00185 class GEOMLIBCLASSEXPORT TRANS2D_AFFINE {
00186 
00187    public:
00188 
00189       enum AXIS {
00190          AXIS_X = 0,
00191          AXIS_Y = 1
00192          };
00193 
00194       //! Default constructor, create identity transformation.
00195       TRANS2D_AFFINE (
00196          ) { trans2dinit(m_fwd,m_inv); }
00197 
00198       //! Copy constructor.
00199       TRANS2D_AFFINE (
00200          const TRANS2D_AFFINE& rhs
00201          ) {
00202          memcpy(m_fwd,rhs.m_fwd,sizeof(MAT3X3));
00203          memcpy(m_inv,rhs.m_inv,sizeof(MAT3X3));
00204          }
00205 
00206       //! Construct from affine matrices.
00207       TRANS2D_AFFINE (
00208          const MAT3X3 fwd,                //!< Forward transformation matrix
00209          const MAT3X3 inv                 //!< Inverse transformation matrix
00210          ) {
00211          memcpy(m_fwd,fwd,sizeof(MAT3X3));
00212          memcpy(m_inv,inv,sizeof(MAT3X3));
00213          }
00214 
00215       //! Construct from combination of two affine transformations.
00216       TRANS2D_AFFINE (
00217          const TRANS2D_AFFINE& trans1,    //!< First transformation
00218          const TRANS2D_AFFINE& trans2     //!< Second transformation
00219          ) { trans2dmatrix2(m_fwd,m_inv,trans1.m_fwd,trans1.m_inv,trans2.m_fwd,trans2.m_inv); }
00220 
00221       //! Construct from CTRLPOINT array.
00222       TRANS2D_AFFINE (
00223          const CTRLPOINT *cp,             //!< Control point array
00224          int numpoints,                   //!< Number of control points
00225          bool invert = false              //!< Invert coordinate system (for images)
00226          ) { FindBestTrans2DA(numpoints,cp,m_fwd,m_inv,(invert)?TRANS2DMODEL_OrientInvert:0); }
00227 
00228       //! Construct from CTRLPOINT3 array.
00229       TRANS2D_AFFINE (
00230          const CTRLPOINT3 *cp,            //!< Control point array
00231          int numpoints,                   //!< Number of control points
00232          bool invert = false              //!< Invert coordinate system (for images)
00233          ) { FindBestTrans2D3A(numpoints,cp,m_fwd,m_inv,(invert)?TRANS2DMODEL_OrientInvert:0); }
00234 
00235       //! Destructor.
00236       ~TRANS2D_AFFINE (
00237          ) {}
00238 
00239       //! Assignment from TRANS2D_AFFINE.
00240       TRANS2D_AFFINE& operator= (
00241          const TRANS2D_AFFINE& rhs
00242          ) {
00243          if (this != &rhs) {
00244             memcpy(m_fwd,rhs.m_fwd,sizeof(MAT3X3));
00245             memcpy(m_inv,rhs.m_inv,sizeof(MAT3X3));
00246             }
00247          return (*this);
00248          }
00249 
00250       //! Apply coordinate offset.
00251       void ApplyOffset (
00252          double xoffset,                  //!< X offset
00253          double yoffset                   //!< Y offset
00254          ) { trans2dshift(m_fwd,m_inv,xoffset,yoffset); }
00255 
00256       //! Apply coordinate offset.
00257       void ApplyOffset (
00258          const DPOINT2D& offset           //!< Offset
00259          ) { trans2dshift(m_fwd,m_inv,offset.x,offset.y); }
00260 
00261       //! Apply coordinate offset relative to reverse direction.
00262       void ApplyOffsetReverse (
00263          double xoffset,                  //!< X offset
00264          double yoffset                   //!< Y offset
00265          ) { trans2dshift(m_inv,m_fwd,xoffset,yoffset); }
00266 
00267       //! Apply coordinate offset relative to reverse direction.
00268       void ApplyOffsetReverse (
00269          const DPOINT2D& offset           //!< Offset
00270          ) { trans2dshift(m_inv,m_fwd,offset.x,offset.y); }
00271 
00272       //! Apply rotation angle.
00273       void ApplyRotation (
00274          double angle                     //!< Rotation angle in radians
00275          ) { trans2drot(m_fwd,m_inv,angle); }
00276 
00277       //! Apply scale equally to X/Y axes.
00278       void ApplyScale (
00279          double scale                     //!< Scale
00280          ) { trans2dscale(m_fwd,m_inv,scale,scale); }
00281 
00282       //! Apply scale to X/Y axes.
00283       void ApplyScale (
00284          double xscale,                   //!< X scale
00285          double yscale                    //!< Y scale
00286          ) { trans2dscale(m_fwd,m_inv,xscale,yscale); }
00287 
00288       //! Apply scale to X/Y axes.
00289       void ApplyScale (
00290          const DPOINT2D &scale            //!< X/Y scale
00291          ) { trans2dscale(m_fwd,m_inv,scale.x,scale.y); }
00292 
00293       //! Apply scale to X/Y axes, relative to reverse direction.
00294       void ApplyScaleReverse (
00295          double xscale,                   //!< X scale
00296          double yscale                    //!< Y scale
00297          ) { trans2dscale(m_inv,m_fwd,xscale,yscale); }
00298 
00299       //! Apply scale to X/Y axes, relative to reverse direction.
00300       void ApplyScaleReverse (
00301          const DPOINT2D &scale            //!< X/Y scale
00302          ) { trans2dscale(m_inv,m_fwd,scale.x,scale.y); }
00303 
00304       //! Apply shear relative to specified axis.
00305       void ApplyShear (
00306          double angle,                    //!< Shear angle in radians
00307          AXIS axis                        //!< Axis to shear (AXIS_X or AXIS_Y)
00308          ) { trans2dshear(m_fwd,m_inv,angle,static_cast<int>(axis)); }
00309 
00310       //! Combine two affine transformations.
00311       void Combine (
00312          const TRANS2D_AFFINE& trans1     //!< First transformation
00313          ) {
00314          trans2dmatrix(m_fwd,trans1.m_fwd);
00315          trans2dmatrix(m_inv,trans1.m_inv);
00316          }
00317 
00318       //! Combine two affine transformations.
00319       void Combine (
00320          const TRANS2D_AFFINE& trans1,    //!< First transformation
00321          const TRANS2D_AFFINE& trans2     //!< Second transformation
00322          ) { trans2dmatrix2(m_fwd,m_inv,trans1.m_fwd,trans1.m_inv,trans2.m_fwd,trans2.m_inv); }
00323 
00324       //! Perform forward transformation on X/Y point.
00325       //! @return Converted point.
00326       DPOINT2D ConvertForward (
00327          double x,                        //!< X coordinate
00328          double y                         //!< Y coordinate
00329          ) const { return (DPOINT2D(trans2dx(x,y,m_fwd),trans2dy(x,y,m_fwd))); }
00330 
00331       //! Perform forward transformation on X/Y point.
00332       void ConvertForward (
00333          double x,                        //!< X coordinate
00334          double y,                        //!< Y coordinate
00335          double& ox,                      //!< X coordinate
00336          double& oy                       //!< Y coordinate
00337          ) const { ox = trans2dx(x,y,m_fwd); oy = trans2dy(x,y,m_fwd); }
00338 
00339       //! Perform forward transformation on DPOINT2D.
00340       //! @return Converted point.
00341       DPOINT2D ConvertForward (
00342          const DPOINT2D& ipoint           //!< Input point
00343          ) const { return (DPOINT2D(trans2dx(ipoint.x,ipoint.y,m_fwd),trans2dy(ipoint.x,ipoint.y,m_fwd))); }
00344 
00345       //! Perform forward transformation on DPOINT3D.
00346       //! @return Converted point.
00347       DPOINT3D ConvertForward (
00348          const DPOINT3D& ipoint           //!< Input point
00349          ) const { return (DPOINT3D(trans2dx(ipoint.x,ipoint.y,m_fwd),trans2dy(ipoint.x,ipoint.y,m_fwd),ipoint.z)); }
00350 
00351       //! Perform forward transformation on DPOINT2D array.
00352       void ConvertForward (
00353          const DPOINT2D* ipoints,         //!< Input point array
00354          DPOINT2D* opoints,               //!< Output point array
00355          INT32 NumPoints                  //!< Number of points to convert
00356          ) const;
00357 
00358       //! Perform forward transformation on DPOINT3D array.
00359       void ConvertForward (
00360          const DPOINT3D* ipoints,         //!< Input point array
00361          DPOINT3D* opoints,               //!< Output point array
00362          INT32 NumPoints                  //!< Number of points to convert
00363          ) const;
00364 
00365       //! Perform forward transformation on DRECT2D.
00366       //! @return Converted rectangle.
00367       DRECT2D ConvertForward (
00368          const DRECT2D& irect             //!< Input rectangle
00369          ) const {
00370          DRECT2D orect;
00371          Trans2DRect(m_fwd,&irect,&orect);
00372          return (orect);
00373          }
00374 
00375       //! Perform forward transformation on DRECT2D.
00376       void ConvertForward (
00377          const DRECT2D& irect,            //!< Input rectangle
00378          DRECT2D& orect                   //!< Output rectangle
00379          ) const { Trans2DRect(m_fwd,&irect,&orect); }
00380 
00381       //! Perform inverse transformation on X/Y point.
00382       //! @return Converted point.
00383       DPOINT2D ConvertInverse (
00384          double x,                        //!< X coordinate
00385          double y                         //!< Y coordinate
00386          ) const { return (DPOINT2D(trans2dx(x,y,m_inv),trans2dy(x,y,m_inv))); }
00387 
00388       //! Perform inverse transformation on DPOINT2D.
00389       //! @return Converted point.
00390       DPOINT2D ConvertInverse (
00391          const DPOINT2D& ipoint           //!< Input point
00392          ) const { return (DPOINT2D(trans2dx(ipoint.x,ipoint.y,m_inv),trans2dy(ipoint.x,ipoint.y,m_inv))); }
00393 
00394       //! Perform inverse transformation on DPOINT3D.
00395       //! @return Converted point.
00396       DPOINT3D ConvertInverse (
00397          const DPOINT3D& ipoint           //!< Input point
00398          ) const { return (DPOINT3D(trans2dx(ipoint.x,ipoint.y,m_inv),trans2dy(ipoint.x,ipoint.y,m_inv),ipoint.z)); }
00399 
00400       //! Perform inverse transformation on DPOINT2D array.
00401       void ConvertInverse (
00402          const DPOINT2D* ipoints,         //!< Input point array
00403          DPOINT2D* opoints,               //!< Output point array
00404          INT32 NumPoints                  //!< Number of points to convert
00405          ) const;
00406 
00407       //! Perform inverse transformation on DPOINT3D array.
00408       void ConvertInverse (
00409          const DPOINT3D* ipoints,         //!< Input point array
00410          DPOINT3D* opoints,               //!< Output point array
00411          INT32 NumPoints                  //!< Number of points to convert
00412          ) const;
00413 
00414       //! Perform inverse transformation on DRECT2D.
00415       //! @return Converted rectangle.
00416       DRECT2D ConvertInverse (
00417          const DRECT2D& irect             //!< Input rectangle
00418          ) const {
00419          DRECT2D orect;
00420          Trans2DRect(m_inv,&irect,&orect);
00421          return (orect);
00422          }
00423 
00424       //! Perform inverse transformation on DRECT2D.
00425       void ConvertInverse (
00426          const DRECT2D& irect,            //!< Input rectangle
00427          DRECT2D& orect                   //!< Output rectangle
00428          ) const { Trans2DRect(m_inv,&irect,&orect); }
00429 
00430       //! Determine scale/rotation/shear for forward transformation
00431       void DisectForward (
00432          double *xscale,                  //!< X scale returned (0 if don't need)
00433          double *yscale,                  //!< Y scale returned (0 if don't need)
00434          double *rotangle = 0,            //!< Rotation angle in radians returned (0 if don't need)
00435          double *shearangle = 0           //!< Shear angle in radians returned (0 if don't need)
00436          ) const { DisectTrans2D(m_fwd,xscale,yscale,rotangle,shearangle); }
00437          
00438       //! Determine scale/rotation/shear for inverse transformation
00439       void DisectInverse (
00440          double *xscale,                  //!< X scale returned (0 if don't need)
00441          double *yscale,                  //!< Y scale returned (0 if don't need)
00442          double *rotangle = 0,            //!< Rotation angle in radians returned (0 if don't need)
00443          double *shearangle = 0           //!< Shear angle in radians returned (0 if don't need)
00444          ) const { DisectTrans2D(m_inv,xscale,yscale,rotangle,shearangle); }
00445 
00446       //! Retrieve copy of affine matrices      
00447       void GetMatrices (
00448          MAT3X3 fwd,                      //!< Forward matrix returned
00449          MAT3X3 inv                       //!< Inverse matrix returned
00450          ) const { memcpy(fwd,m_fwd,sizeof(MAT3X3)); memcpy(inv,m_inv,sizeof(MAT3X3)); }
00451 
00452       //! Determine if the two transformation's are equivalent
00453       //! @return 'True' if equivalent, 'false' if not         
00454       bool IsEquivalentTo (
00455          const TRANS2D_AFFINE& rhs
00456          ) const {
00457          for (int i = 0;(i < 3);++i) {
00458             for (int j = 0;(j < 3);++j) {
00459                if (fabs(m_fwd[i][j] - rhs.m_fwd[i][j]) > 0.0000001) return (false);
00460                }
00461             }
00462          return (true);
00463          }
00464 
00465       //! Determine if the transformation is an identity
00466       //! @return 'True' if identity, 'false' if not        
00467       bool IsIdentity (
00468          ) const {
00469          return (m_fwd[0][0] == 1.0 && m_fwd[1][1] == 1.0 && m_fwd[0][1] == 0.0 && m_fwd[0][2] == 0.0 && m_fwd[1][0] == 0.0 && m_fwd[1][2] == 0.0);
00470          }
00471 
00472       //! Reverse direction of transformation.
00473       void ReverseDirection (
00474          ) {
00475          MAT3X3 temp;
00476          memcpy(temp,m_fwd,sizeof(MAT3X3));
00477          memcpy(m_fwd,m_inv,sizeof(MAT3X3));
00478          memcpy(m_inv,temp,sizeof(MAT3X3));
00479          }
00480 
00481       //! Set transformation from CTRLPOINT array.
00482       ERRVALUE SetCtrlPoint (
00483          const CTRLPOINT *cp,             //!< Control point array
00484          int numpoints,                   //!< Number of control points
00485          bool invert = false              //!< Invert coordinate system (for images)
00486          ) { return (FindBestTrans2DA(numpoints,cp,m_fwd,m_inv,(invert)?TRANS2DMODEL_OrientInvert:0)); }
00487          
00488       //! Set transformation from CTRLPOINT3 array.
00489       ERRVALUE SetCtrlPoint (
00490          const CTRLPOINT3 *cp,            //!< Control point array
00491          int numpoints,                   //!< Number of control points
00492          bool invert = false              //!< Invert coordinate system (for images)
00493          ) { return (FindBestTrans2D3A(numpoints,cp,m_fwd,m_inv,(invert)?TRANS2DMODEL_OrientInvert:0)); }
00494          
00495       //! Set transformation to "identity".
00496       void SetIdentity (
00497          ) { trans2dinit(m_fwd,m_inv); }
00498 
00499       //! Set transformation from affine matrices.
00500       void SetMatrices (
00501          const MAT3X3 fwd,                //!< Forward transformation
00502          const MAT3X3 inv                 //!< Inverse transformation
00503          ) { memcpy(m_fwd,fwd,sizeof(MAT3X3)); memcpy(m_inv,inv,sizeof(MAT3X3)); }
00504 
00505    private:
00506       #ifndef GENERATING_DOXYGEN_OUTPUT
00507       MAT3X3 m_fwd;                       //!< Forward transformation matrix
00508       MAT3X3 m_inv;                       //!< Inverse transformation matrix
00509 
00510       friend class TRANS2D_MAPGEN;
00511       #endif // GENERATING_DOXYGEN_OUTPUT
00512    };
00513 
00514 
00515 //-------------------------------------------------------------------------------------------
00516 //!      TRANS2D_MAPGEN
00517 //-------------------------------------------------------------------------------------------
00518 
00519 //! Encapsulate TRANSPARM structure and TransGen...() functions
00520 class TRANS2D_MAPGEN {
00521    public:
00522 
00523       //! Transformation direction
00524       enum DIRECTION {
00525          DIRECTION_Forward = TRANSDIR_Forward,
00526          DIRECTION_Inverse = TRANSDIR_Inverse
00527          };
00528 
00529       //! Default constructor, create identity transformation
00530       TRANS2D_MAPGEN (
00531          ) { TransGenInit(&m_transparm); }
00532 
00533       //! Copy constructor.
00534       TRANS2D_MAPGEN (
00535          const TRANS2D_MAPGEN &rhs
00536          ) {
00537          TransGenInit(&m_transparm);
00538          TransGenCopy(&m_transparm,&rhs.m_transparm);
00539          }
00540 
00541       //! Construct from TRANSPARM (allows implicit conversion).
00542       TRANS2D_MAPGEN (
00543          const TRANSPARM& transparm
00544          ) {
00545          TransGenInit(&m_transparm);
00546          TransGenCopy(&m_transparm,&transparm);
00547          }
00548 
00549       //! Destructor.
00550       ~TRANS2D_MAPGEN (
00551          ) { TransGenFreeParm(&m_transparm); }
00552 
00553       //! Assignment from TRANS2D_MAPGEN.
00554       TRANS2D_MAPGEN& operator= (
00555          const TRANS2D_MAPGEN &rhs
00556          ) {
00557          if (this != &rhs) {
00558             TransGenCopy(&m_transparm,&rhs.m_transparm);
00559             }
00560          return (*this);
00561          }
00562 
00563       //! Assignment from TRANSPARM.
00564       TRANS2D_MAPGEN& operator= (
00565          const TRANSPARM &rhs
00566          ) {
00567          TransGenCopy(&m_transparm,&rhs);
00568          return (*this);
00569          }
00570 
00571       //! Cast to (const TRANSPARM *).
00572       operator const TRANSPARM* (
00573          ) const { return (&m_transparm); }
00574 
00575       void Clear (
00576          ) { TransGenFreeParm(&m_transparm); TransGenInit(&m_transparm); }
00577 
00578       //! Perform forward transformation on DPOINT2D
00579       ERRVALUE ConvertForward (
00580          const DPOINT2D& ipoint,          //!< Input point
00581          DPOINT2D& opoint                 //!< Output point
00582          ) const { return (TransGenConvPointFwd(&m_transparm,&ipoint,&opoint)); }
00583 
00584       //! Perform forward transformation on DPOINT3D.
00585       ERRVALUE ConvertForward (
00586          const DPOINT3D& ipoint,          //!< Input point
00587          DPOINT3D& opoint                 //!< Output point
00588          ) const { opoint.z = ipoint.z; return (TransGenConvPointFwd(&m_transparm, &ipoint, &opoint)); }
00589 
00590       //! Perform forward transformation on DPOINT2D array.
00591       ERRVALUE ConvertForward (
00592          const DPOINT2D* ipoints,         //!< Input point array
00593          DPOINT2D* opoints,               //!< Output point array
00594          INT32 NumPoints                  //!< Number of points to convert
00595          ) const { return (TransGenConvPointSetFwd(&m_transparm,reinterpret_cast<const double*>(ipoints),NumPoints,2,reinterpret_cast<double*>(opoints))); }
00596 
00597       //! Perform forward transformation on DPOINT3D array.
00598       ERRVALUE ConvertForward (
00599          const DPOINT3D* ipoints,         //!< Input point array
00600          DPOINT3D* opoints,               //!< Output point array
00601          INT32 NumPoints                  //!< Number of points to convert
00602          ) const { return (TransGenConvPointSetFwd(&m_transparm,reinterpret_cast<const double*>(ipoints),NumPoints,3,reinterpret_cast<double*>(opoints))); }
00603 
00604       //! Perform forward transformation on generic point array.
00605       ERRVALUE ConvertForward (
00606          const void* ipoints,             //!< Input point array
00607          void* opoints,                   //!< Output point array
00608          INT32 NumPoints,                 //!< Number of points to convert
00609          int NumDim                       //!< Number of dimensions
00610          ) const { return (TransGenConvPointSetFwd(&m_transparm,reinterpret_cast<const double*>(ipoints),NumPoints,NumDim,reinterpret_cast<double*>(opoints))); }
00611 
00612       //! Perform forward transformation on rectangle.
00613       ERRVALUE ConvertForward (
00614          const DRECT2D& irect,            //!< Input rectangle
00615          DRECT2D& orect,                  //!< Output rectangle
00616          int sidepoints=0                 //!< Number of extra points along sides for interpolation
00617          ) const { return (TransGenConvRectFwd(&m_transparm,&irect,&orect,sidepoints)); }
00618 
00619       //! Perform forward transformation on DPOINT2D array with possible densification.
00620       INT32 ConvertForwardDense (
00621          const DPOINT2D* ipoint,          //!< Input point array
00622          INT32 iNumPoints,                //!< Number of input points
00623          DPOINT2D** opoint                //!< Pointer to output point array (internal, DO NOT FREE)
00624          ) const {                        //! Returns number of output points or error < 0
00625          INT32 oNumPoints;
00626          int err;
00627          if ((err = TransGenConvPointsFwd(&m_transparm,reinterpret_cast<const double*>(ipoint),iNumPoints,2,reinterpret_cast<double**>(opoint),&oNumPoints)) < 0) return (err);
00628          return (oNumPoints);
00629          }
00630 
00631       //! Perform forward transformation on DPOINT3D array with possible densification.
00632       INT32 ConvertForwardDense (
00633          const DPOINT3D* ipoint,          //!< Input point array
00634          INT32 iNumPoints,                //!< Number of input points
00635          DPOINT3D** opoint                //!< Pointer to output point array (internal, DO NOT FREE)
00636          ) const {                        //! Returns number of output points or error < 0
00637          INT32 oNumPoints;
00638          int err;
00639          if ((err = TransGenConvPointsFwd(&m_transparm,reinterpret_cast<const double*>(ipoint),iNumPoints,3,reinterpret_cast<double**>(opoint),&oNumPoints)) < 0) return (err);
00640          return (oNumPoints);
00641          }
00642 
00643       //! Perform inverse transformation on DPOINT2D.
00644       ERRVALUE ConvertInverse (
00645          const DPOINT2D& ipoint,          //!< Input point
00646          DPOINT2D& opoint                 //!< Output point
00647          ) const { return (TransGenConvPointInv(&m_transparm,&ipoint,&opoint)); }
00648 
00649       //! Perform inverse transformation on DPOINT3D.
00650       ERRVALUE ConvertInverse (
00651          const DPOINT3D& ipoint,          //!< Input point
00652          DPOINT3D& opoint                 //!< Output point
00653          ) const { opoint.z = ipoint.z; return (TransGenConvPointInv(&m_transparm,&ipoint,&opoint)); }
00654 
00655       //! Perform inverse transformation on DPOINT2D array.
00656       ERRVALUE ConvertInverse (
00657          const DPOINT2D* ipoints,         //!< Input point array
00658          DPOINT2D* opoints,               //!< Output point array
00659          INT32 NumPoints                  //!< Number of points to convert
00660          ) const { return (TransGenConvPointSetInv(&m_transparm,reinterpret_cast<const double*>(ipoints),NumPoints,2,reinterpret_cast<double*>(opoints))); }
00661 
00662       //! Perform inverse transformation on DPOINT3D array.
00663       ERRVALUE ConvertInverse (
00664          const DPOINT3D* ipoints,         //!< Input point array
00665          DPOINT3D* opoints,               //!< Output point array
00666          INT32 NumPoints                  //!< Number of points to convert
00667          ) const { return (TransGenConvPointSetInv(&m_transparm,reinterpret_cast<const double*>(ipoints),NumPoints,3,reinterpret_cast<double*>(opoints))); }
00668 
00669       //! Perform inverse transformation on generic point array.
00670       ERRVALUE ConvertInverse (
00671          const void* ipoints,             //!< Input point array
00672          void* opoints,                   //!< Output point array
00673          INT32 NumPoints,                 //!< Number of points to convert
00674          int NumDim                       //!< Number of dimensions
00675          ) const { return (TransGenConvPointSetInv(&m_transparm,reinterpret_cast<const double*>(ipoints),NumPoints,NumDim,reinterpret_cast<double*>(opoints))); }
00676 
00677       //! Perform inverse transformation on rectangle.
00678       ERRVALUE ConvertInverse (
00679          const DRECT2D& irect,            //!< Input rectangle
00680          DRECT2D& orect,                  //!< Output rectangle
00681          int sidepoints=0                 //!< Number of extra points along sides for interpolation
00682          ) const { return (TransGenConvRectInv(&m_transparm,&irect,&orect,sidepoints)); }
00683 
00684       //! Perform inverse transformation on DPOINT2D array with possible densification.
00685       INT32 ConvertInverseDense (
00686          const DPOINT2D* ipoint,          //!< Input point array
00687          INT32 iNumPoints,                //!< Number of input points
00688          DPOINT2D** opoint                //!< Pointer to output point array (internal, DO NOT FREE)
00689          ) const {                        //! Returns number of output points or error < 0
00690          INT32 oNumPoints;
00691          int err;
00692          if ((err = TransGenConvPointsInv(&m_transparm,reinterpret_cast<const double*>(ipoint),iNumPoints,2,reinterpret_cast<double**>(opoint),&oNumPoints)) < 0) return (err);
00693          return (oNumPoints);
00694          }
00695 
00696       //! Perform inverse transformation on DPOINT3D array with possible densification.
00697       INT32 ConvertInverseDense (
00698          const DPOINT3D* ipoint,          //!< Input point array
00699          INT32 iNumPoints,                //!< Number of input points
00700          DPOINT3D** opoint                //!< Pointer to output point array (internal, DO NOT FREE)
00701          ) const {                        //! Returns number of output points or error < 0
00702          INT32 oNumPoints;
00703          int err;
00704          if ((err = TransGenConvPointsInv(&m_transparm,reinterpret_cast<const double*>(ipoint),iNumPoints,3,reinterpret_cast<double**>(opoint),&oNumPoints)) < 0) return (err);
00705          return (oNumPoints);
00706          }
00707 
00708       //! Convert from input map coordinates to output map coordinates.
00709       ERRVALUE ConvertMapToMapForward (
00710          const DPOINT2D& ipoint,          //!< Point to convert
00711          DPOINT2D& opoint                 //!< Output point
00712          ) const { return (TransGenConvPointMapToMapFwd(&m_transparm,&ipoint,&opoint)); }
00713 
00714       //! Convert from output map coordinates to input map coordinates.
00715       ERRVALUE ConvertMapToMapInverse (
00716          const DPOINT2D& ipoint,          //!< Point to convert
00717          DPOINT2D& opoint                 //!< Output point
00718          ) const { return (TransGenConvPointMapToMapInv(&m_transparm,&ipoint,&opoint)); }
00719 
00720       //! Convert from "output" to "map" coordinates.
00721       ERRVALUE ConvertOutputToMap (
00722          const DPOINT2D& ipoint,          //!< Point to convert
00723          DPOINT2D& opoint                 //!< Output point
00724          ) const { return (TransGenConvPointOutputToMap(&m_transparm,&ipoint,&opoint)); }
00725 
00726       //! Copy TRANSPARM "input" parameters to "input" parameters.
00727       void CopyInputToInput (
00728          const TRANSPARM& transparm
00729          ) {
00730          int err;
00731          if ((err = TransGenCopyInputParms(&m_transparm,&transparm)) < 0) {
00732             //! XXX throw an exception
00733             }
00734          return;
00735          }
00736 
00737       //! Copy MAPGEN "input" parameters to "input" parameters.
00738       void CopyInputToInput (
00739          const TRANS2D_MAPGEN& itrans
00740          ) { CopyInputToInput(itrans.m_transparm); }
00741 
00742       //! Copy TRANSPARM "input" parameters to "output" parameters.
00743       void CopyInputToOutput (
00744          const TRANSPARM& transparm
00745          ) {
00746          int err;
00747          if ((err = TransGenCopyInputToOutput(&m_transparm,&transparm)) < 0) {
00748             //! XXX throw an exception
00749             }
00750          return;
00751          }
00752 
00753       //! Copy MAPGEN "input" parameters to "output" parameters.
00754       void CopyInputToOutput (
00755          const TRANS2D_MAPGEN& itrans
00756          ) { CopyInputToOutput(itrans.m_transparm); }
00757 
00758       //! Copy TRANSPARM "output" parameters to "input" parameters.
00759       void CopyOutputToInput (
00760          const TRANSPARM& transparm
00761          ) {
00762          int err;
00763          if ((err = TransGenCopyOutputToInput(&m_transparm,&transparm)) < 0) {
00764             //! XXX throw an exception
00765             }
00766          return;
00767          }
00768 
00769       //! Copy MAPGEN "output" parameters to "input" parameters.
00770       void CopyOutputToInput (
00771          const TRANS2D_MAPGEN& itrans
00772          ) { CopyOutputToInput(itrans.m_transparm); }
00773 
00774       //! Copy TRANSPARM "output" parameters to "output" parameters.
00775       void CopyOutputToOutput (
00776          const TRANSPARM& transparm
00777          ) {
00778          int err;
00779          if ((err = TransGenCopyOutputParms(&m_transparm,&transparm)) < 0) {
00780             //! XXX throw an exception
00781             }
00782          return;
00783          }
00784 
00785       //! Copy MAPGEN "output" parameters to "output" parameters.
00786       void CopyOutputToOutput (
00787          const TRANS2D_MAPGEN& itrans
00788          ) { CopyOutputToOutput(itrans.m_transparm); }
00789 
00790       //! Determine scale/rotation/shear at specified point for forward transformation.
00791       ERRVALUE DisectForward (
00792          const DPOINT2D& point,           //!< Reference point at which values will be computed
00793          double *xscale,                  //!< X scale returned (0 if don't need)
00794          double *yscale,                  //!< Y scale returned (0 if don't need)
00795          double *rotangle = 0,            //!< Rotation angle in radians returned (0 if don't need)
00796          double *shearangle = 0,          //!< Shear angle in radians returned (0 if don't need)
00797          double size = 1.0                //!< Size of area over which to compute values
00798          ) const {
00799          return (TransGenDisectFwd(&m_transparm,&point,size,xscale,yscale,rotangle,shearangle));
00800          }
00801 
00802       //! Determine scale/rotation/shear at specified point for inverse transformation.
00803       ERRVALUE DisectInverse (
00804          const DPOINT2D& point,           //!< Reference point at which values will be computed
00805          double *xscale,                  //!< X scale returned (0 if don't need)
00806          double *yscale,                  //!< Y scale returned (0 if don't need)
00807          double *rotangle = 0,            //!< Rotation angle in radians returned (0 if don't need)
00808          double *shearangle = 0,          //!< Shear angle in radians returned (0 if don't need)
00809          double size = 1.0                //!< Size of area over which to compute values
00810          ) const {
00811          return (TransGenDisectInv(&m_transparm,&point,size,xscale,yscale,rotangle,shearangle));
00812          }
00813 
00814       //! Get affine transformation if available.
00815       //! Will return error if transformation is not affine.
00816       ERRVALUE GetAffine (
00817          MAT3X3 fwd,                      //!< Forward transformation
00818          MAT3X3 inv                       //!< Inverse transformation
00819          ) const { return (TransGenGetAffine(&m_transparm, fwd, inv)); }
00820 
00821       //! Get affine transformation if available.
00822       //! Will return error if transformation is not affine.
00823       ERRVALUE GetAffine (
00824          TRANS2D_AFFINE& trans            //!< Affine transformation
00825          ) const { return (TransGenGetAffine(&m_transparm, trans.m_fwd, trans.m_inv)); }
00826 
00827       //! Get 'input' map coordinate reference system.
00828       const SPATREF::COORDREFSYS& GetInputMapCoordRefSys (
00829          ) const { return (TransGenGetInputMapCoordRefSys(m_transparm)); }
00830 
00831       //! Get input model
00832       UINT16 GetInputModel (
00833          ) const {                       
00834          return (TransGenGetInputModel(&m_transparm));
00835          }
00836 
00837       //! Get "input" map projection parameters.
00838       MAPPROJPARM GetInputProjection (
00839          ) const {                        //! Returns projection parameters
00840          MAPPROJPARM projparm;
00841          TransGenGetInputProj(&m_transparm,&projparm);
00842          return (projparm);
00843          }
00844 
00845       //! Get input transformation as affine.
00846       ERRVALUE GetInputTrans (
00847          TRANS2D_AFFINE& trans            //!< Affine transformation
00848          ) { return (TransGenGetInputTransAffine(&m_transparm,trans.m_fwd,trans.m_inv)); }
00849 
00850       //! Get input transformation as affine.
00851       ERRVALUE GetInputTrans (
00852          MAT3X3 fwd,
00853          MAT3X3 inv
00854          ) { return (TransGenGetInputTransAffine(&m_transparm,fwd,inv)); }
00855 
00856       //! Get input transformation as control points.
00857       //! Will return number of points if any or error
00858       int GetInputTrans (
00859          CTRLPOINT3 **ctrlpoint           
00860          ) { return (TransGenGetInputTransCtrlPoint(&m_transparm, ctrlpoint)); }
00861 
00862       //! Get local affine transformation.
00863       ERRVALUE GetLocalAffine (
00864          const DPOINT2D& point,
00865          MAT3X3 fwd,                      //!< Forward transformation
00866          MAT3X3 inv,                      //!< Inverse transformation
00867          double size = 1.0,
00868          UINT32 flags = 0
00869          ) { return (TransGenGetAffineLocal(&m_transparm, &point, size, fwd, inv, flags)); }
00870 
00871       //! Get local affine transformation.
00872       ERRVALUE GetLocalAffine (
00873          const DPOINT2D& point,
00874          TRANS2D_AFFINE& trans,           //!< Affine transformation
00875          double size = 1.0,
00876          UINT32 flags = 0
00877          ) { return (TransGenGetAffineLocal(&m_transparm, &point, size, trans.m_fwd, trans.m_inv, flags)); }
00878 
00879       //! Get 'output' map coordinate reference system.
00880       const SPATREF::COORDREFSYS& GetOutputMapCoordRefSys (
00881          ) const { return (TransGenGetOutputMapCoordRefSys(m_transparm)); }
00882 
00883       //! Get output model
00884       UINT16 GetOutputModel (
00885          ) const {                       
00886          return (TransGenGetOutputModel(&m_transparm));
00887          }
00888 
00889       //! Get "output" map projection parameters.
00890       MAPPROJPARM GetOutputProjection (
00891          ) const {                        //! Returns projection parameters
00892          MAPPROJPARM projparm;
00893          TransGenGetOutputProj(&m_transparm,&projparm);
00894          return (projparm);
00895          }
00896 
00897       //! Get output transformation as affine.
00898       ERRVALUE GetOutputTrans (
00899          TRANS2D_AFFINE& trans            //!< Affine transformation
00900          ) { return (TransGenGetOutputTransAffine(&m_transparm,trans.m_fwd,trans.m_inv)); }
00901 
00902       //! Get output transformation as affine.
00903       ERRVALUE GetOutputTrans (
00904          MAT3X3 fwd,
00905          MAT3X3 inv
00906          ) { return (TransGenGetOutputTransAffine(&m_transparm,fwd,inv)); }
00907 
00908       //! Get output transformation as control points.
00909       //! Will return number of points if any or error
00910       int GetOutputTrans (
00911          CTRLPOINT3 **ctrlpoint           
00912          ) { return (TransGenGetOutputTransCtrlPoint(&m_transparm, ctrlpoint)); }
00913 
00914       const TRANSPARM& GetTransParm (
00915          ) const { return (m_transparm); }
00916 
00917       //! Determine if transformation is "affine".
00918       bool IsAffine (
00919          ) const { return (TransGenIsAffine(&m_transparm)); }
00920 
00921       //! Determine if transformation is "identity".
00922       bool IsIdentity (
00923          ) const { return (TransGenIsIdentity(&m_transparm)); }
00924 
00925       //! Determine if 'input' transformation is 'identity'.
00926       bool IsInputTransIdentity (
00927          ) const { return (TransGenIsInputTransIdentity(&m_transparm)); }
00928 
00929       //! Determine if 'output' transformation is 'identity'.
00930       bool IsOutputTransIdentity (
00931          ) const { return (TransGenIsOutputTransIdentity(&m_transparm)); }
00932 
00933       //! Determine if transformation is "reversible".
00934       bool IsReversible (
00935          ) const { return (TransGenIsReversible(&m_transparm)); }
00936 
00937       //! Read georeference from RVC object.
00938       ERRVALUE ReadGeoreference (
00939          int fhandle,                     //!< Open RVC file hadnle
00940          RVCINODENUM inode,               //!< Georeference object inode
00941          bool dooutput = false            //!< Use "output" side of transformation
00942          ) {
00943          return (MfReadGeorefTransParm(fhandle,inode,0,&m_transparm,(dooutput)?RVCGREF_TransGenOutput:0));
00944          }
00945 
00946       //! Set full transformation to approximated affine if within specified tolerance.
00947       //! The approximate affine transformation will be retained until the next "Set" method is used
00948       //! at which time the transformation will revert to its "exact" mode (which may also be affine).
00949       ERRVALUE SetAffineApproximation (
00950          const DRECT2D& rect,             //!< Rectangle over which transformation is to be used
00951          double tolerance,                //!< Tolerance in opposite coordinates from rectangle
00952          UINT32 coord                     //!< Coordinates of rectangle (XXX change to enum)
00953          ) { return (TransGenSetAffineApprox(&m_transparm,&rect,tolerance,static_cast<UINT32>(coord))); }
00954 
00955       //! Set whether to perform extrapolation outside specified bounds.
00956       //! If extrapolation is not enabled then an exception -may- occur if and attempt is made
00957       //! to convert points outside the previously-specified input/output bounds.  This is the
00958       //! default condition and will generally be much faster than extrapolating.
00959       void SetExtrapolation (
00960          bool extrapolate                 //!< Perform extrapolation if true, don't extrapolate if false
00961          ) { TransGenSetExtrapOutside(&m_transparm,extrapolate); }
00962 
00963       //! Set entire transformation as affine.
00964       void SetFullTransAffine (
00965          const TRANS2D_AFFINE& trans      //!< Affine transformation
00966          ) { TransGenSetFullTransAffine(&m_transparm,trans.m_fwd,trans.m_inv); }
00967 
00968       //! Set boundaries for valid transformation in input coordinates
00969       ERRVALUE SetInputBounds (
00970          const DRECT2D& boundrect         //!< Bounding rectangle in input coordinates
00971          ) { return (TransGenSetInputBound(&m_transparm,&boundrect)); }
00972 
00973       //! Set maximum error for point densification in input coordinates.
00974       void SetInputMaxError (
00975          double maxerror                  //!< Maximum error value to set
00976          ) {
00977          TransGenSetInputInsertMaxError(&m_transparm,maxerror);
00978          TransGenSetDoInsert(&m_transparm,1);
00979          }
00980 
00981       //! Set input map coordinate reference system.
00982       ERRVALUE SetInputMapCoordRefSys (
00983          const SPATREF::COORDREFSYS& MapCRS  //!< Map coordinate reference system
00984          ) { return (TransGenSetInputMapCoordRefSys(m_transparm,MapCRS)); }
00985 
00986       //! Set input projection parameters.
00987       ERRVALUE SetInputProjection (
00988          const MAPPROJPARM& projparm      //!< Projection parameters
00989          ) { return ( TransGenSetInputProj(&m_transparm,&projparm)); }
00990 
00991       //! Set input transformation as affine.
00992       void SetInputTrans (
00993          const TRANS2D_AFFINE& trans      //!< Affine transformation
00994          ) { TransGenSetInputTransAffine(&m_transparm,trans.m_fwd,trans.m_inv); }
00995 
00996       //! Set input transformation as affine.
00997       void SetInputTrans (
00998          const MAT3X3 fwd,                //!< Forward transformation
00999          const MAT3X3 inv                 //!< Inverse transformation
01000          ) { TransGenSetInputTransAffine(&m_transparm,fwd,inv); }
01001 
01002       //! Set input transformation from control point array.
01003       ERRVALUE SetInputTrans (
01004          const CTRLPOINT3 *CtrlPoint,     //!< Control point array
01005          INT32 NumPoints,                 //!< Number of control points
01006          UINT16 Model                     //!< Transformation model
01007          ) { return (TransGenSetInputTransCtrlPoint(&m_transparm,CtrlPoint,NumPoints,Model)); }
01008 
01009       //! Set input transformation to identity.
01010       void SetInputTransIdentity (
01011          ) { TransGenSetInputTransIdentity(&m_transparm); }
01012 
01013       //! Set maximum number of vertices to insert if densifying points
01014       void SetMaxVertices (
01015          INT32 MaxVertices
01016          ) { TransGenSetMaxInsertVertices(&m_transparm, MaxVertices); }
01017 
01018       //! Set boundaries for valid transformation in output coordinates.
01019       ERRVALUE SetOutputBounds (
01020          const DRECT2D& boundrect         //!< Bounding rectangle in output coordinates
01021          ) { return (TransGenSetOutputBound(&m_transparm,&boundrect)); }
01022 
01023       //! Set maximum error for point densification in output coordinates.
01024       void SetOutputMaxError (
01025          double maxerror                  //!< Maximum error value to set
01026          ) { 
01027          TransGenSetOutputInsertMaxError(&m_transparm,maxerror);
01028          TransGenSetDoInsert(&m_transparm,1);
01029          }
01030 
01031       //! Set output map coordinate reference system.
01032       ERRVALUE SetOutputMapCoordRefSys (
01033          const SPATREF::COORDREFSYS& MapCRS  //!< Map coordinate reference system
01034          ) { return (TransGenSetOutputMapCoordRefSys(m_transparm,MapCRS)); }
01035 
01036       //! Set output projection parameters.
01037       ERRVALUE SetOutputProjection (
01038          const MAPPROJPARM& projparm      //!< Projection parameters
01039          ) { return (TransGenSetOutputProj(&m_transparm,&projparm)); }
01040 
01041       //! Set output transformation as affine.
01042       void SetOutputTrans (
01043          const TRANS2D_AFFINE& trans      //!< Affine transformation
01044          ) { TransGenSetOutputTransAffine(&m_transparm,trans.m_fwd,trans.m_inv); }
01045 
01046       //! Set output transformation as affine.
01047       void SetOutputTrans (
01048          const MAT3X3 fwd,
01049          const MAT3X3 inv
01050          ) { TransGenSetOutputTransAffine(&m_transparm,fwd,inv); }
01051 
01052       //! Set output transformation from control point array.
01053       ERRVALUE SetOutputTrans (
01054          const CTRLPOINT3 *CtrlPoint,     //!< Control point array
01055          INT32 NumPoints,                 //!< Number of control points
01056          UINT16 Model                     //!< Transformation model
01057          ) { return (TransGenSetOutputTransCtrlPoint(&m_transparm,CtrlPoint,NumPoints,Model)); }
01058 
01059       //! Set output transformation to identity.
01060       void SetOutputTransIdentity (
01061          ) { TransGenSetOutputTransIdentity(&m_transparm); }
01062 
01063       //! Set primary transformation direction.
01064       //! The default transformation direction if not set explicitly is "forward".  This method
01065       //! is used in cases where the time to do a reverse transformation is much higher than in
01066       //! the primary direction.  This is commonly used for raster warping.
01067       void SetPrimaryDirection (
01068          DIRECTION direction              //!< DIRECTION_Forward or DIRECTION_Inverse
01069          ) { TransGenSetPrimaryDirection(&m_transparm,static_cast<UINT8>(direction)); }
01070 
01071       ERRVALUE Update (
01072          ) { return (TransGenUpdate(&m_transparm)); }
01073 
01074 
01075    private:
01076       #ifndef GENERATING_DOXYGEN_OUTPUT
01077       TRANSPARM m_transparm;
01078       #endif // GENERATING_DOXYGEN_OUTPUT
01079    };
01080 
01081 
01082 #endif   //!< INC_MI32_TRANS2DC_H

Generated on Tue Dec 14 13:18:40 2004 for TNTsdk by  doxygen 1.3.8-20040913