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