rvcgref.h

Go to the documentation of this file.
00001 /**
00002  * \file rvcgref.h <mi32/rvcgref.h>
00003  * \brief Definitions for georeference objects and functions
00004  *
00005  * \if NODOC
00006  * $Id: rvcgref.h_v 1.48 2004/07/29 21:55:43 scowan Exp $
00007  *
00008  * $Log: rvcgref.h_v $
00009  * Revision 1.48  2004/07/29 21:55:43  scowan
00010  * Moved read trans parm out of dll.
00011  *
00012  * Revision 1.47  2004/07/08 21:57:49  scowan
00013  * Fixed inline prtototype.
00014  *
00015  * Revision 1.46  2004/07/08 21:46:41  scowan
00016  * Removed unused prototype function.
00017  * Changed macro's into inlines.
00018  *
00019  * Revision 1.45  2004/03/24 18:48:25  scowan
00020  * Deprecated more modules.
00021  *
00022  * Revision 1.44  2004/03/10 21:34:02  mju
00023  * Remove mdlgGetGeorefObject.
00024  *
00025  * Revision 1.43  2004/02/06 14:16:12  scowan
00026  * *** empty log message ***
00027  *
00028  * Revision 1.42  2004/02/05 20:45:09  vdronov
00029  * GEOREF_MANIFOLD is added
00030  *
00031  * Revision 1.41  2004/01/23 16:31:43  scowan
00032  * Removed legacy tie point items.
00033  *
00034  * Revision 1.40  2003/12/19 21:07:30  scowan
00035  * Something.
00036  *
00037  * Revision 1.39  2003/12/09 22:16:18  scowan
00038  * Removed unused inline.
00039  *
00040  * Revision 1.38  2003/10/20 23:38:29  scowan
00041  * Removed unused inlines and functions.
00042  *
00043  * Revision 1.37  2003/10/15 17:39:16  mju
00044  * Deprecate groupkey.
00045  *
00046  * Revision 1.36  2003/09/15 13:49:56  fileserver!dwilliss
00047  * Doxygen
00048  *
00049  * Revision 1.35  2002/09/09 13:54:46  mju
00050  * Always prevent_memfunc.
00051  *
00052  * Revision 1.34  2002/08/20 15:15:50  mju
00053  * Remove old dialog #defines.
00054  * Use prevent_memfunc macro, still checks no_deprecated.
00055  *
00056  * Revision 1.33  2002/03/28 20:02:18  scowan
00057  * Fixed again.
00058  *
00059  * Revision 1.32  2002/03/28 18:59:03  scowan
00060  * Make read georef header call georef read header.
00061  *
00062  * Revision 1.31  2002/03/08 18:32:34  scowan
00063  * Added clear methods.
00064  * deprecated mem... functions for info structs.
00065  *
00066  * Revision 1.30  2001/09/14 14:49:29  mju
00067  * Don't define Mdlg stuff for win32native.
00068  *
00069  * Revision 1.29  2001/07/18 23:10:28  scowan
00070  * Added projection conversion routine.
00071  *
00072  * Revision 1.28  2001/05/21 21:01:33  mju
00073  * Remove redundant macro.
00074  *
00075  * Revision 1.27  2000/12/13 21:47:19  scowan
00076  * Added filepath type get sub object functions.
00077  *
00078  * Revision 1.26  2000/07/19 17:56:38  sparsons
00079  * Genitor documentation.
00080  *
00081  * Revision 1.25  2000/07/13 21:30:54  mju
00082  * Deprecate old MfGet...UC #defines.
00083  *
00084  * Revision 1.24  2000/07/13 17:40:58  mju
00085  * Add default for flags in MfGeorefGet...
00086  *
00087  * Revision 1.23  2000/03/27 17:45:28  scowan
00088  * More assignment operators.
00089  *
00090  * Revision 1.22  2000/03/24 23:35:41  scowan
00091  * Added operator =.
00092  *
00093  * Revision 1.21  2000/03/13 21:38:12  scowan
00094  * More const.
00095  *
00096  * Revision 1.20  2000/02/17 14:44:26  mju
00097  * Add MfGeorefChkDefault.
00098  *
00099  * Revision 1.19  1999/11/19 14:21:43  mju
00100  * MdlgGet... prompt const.
00101  *
00102  * Revision 1.18  1999/10/21  21:07:27  scowan
00103  * Made more const.
00104  *
00105  * Revision 1.17  1999/10/21 15:08:10  scowan
00106  * More const updates.
00107  *
00108  * Revision 1.16  1999/10/06 15:07:30  scowan
00109  * Added write georef header inline function.
00110  *
00111  * Revision 1.15  1999/10/05 22:46:23  scowan
00112  * *** empty log message ***
00113  *
00114  * Revision 1.14  1999/10/05 22:45:52  scowan
00115  * Changed headers to inheritance.
00116  *
00117  * Revision 1.13  1999/06/11 14:49:01  mju
00118  * In obj sel dlg provide defaults for filter + filtdata.
00119  *
00120  * Revision 1.12  1999/06/10  22:11:05  mju
00121  * Object selection dialog update.
00122  *
00123  * Revision 1.11  1999/05/07  21:22:44  mju
00124  * Header restruct.
00125  *
00126  * Revision 1.10  1999/04/28  17:40:11  mju
00127  * Include ctrlpt.h and tiepoint.h.
00128  *
00129  * Revision 1.9  1999/01/05  19:12:28  scowan
00130  * Swapped multiple keywords
00131  *
00132  * Revision 1.8  1998/10/05 17:46:44  scowan
00133  * *** empty log message ***
00134  *
00135  * Revision 1.7  1998/09/30  21:54:02  scowan
00136  * Setup DLL.
00137  *
00138  * Revision 1.6  1998/09/18  22:55:09  scowan
00139  * Changed functions for DLL.
00140  *
00141  * Revision 1.5  1998/08/24  20:39:46  scowan
00142  * Changed function calls to take a size parm.
00143  *
00144  * Revision 1.4  1998/01/30  22:15:34  scowan
00145  * Added prototypes.
00146  *
00147  * Revision 1.3  1996/06/04  16:35:49  scowan
00148  * Parameter change for MfReadGeorefTransParm.
00149  * Added flag to read transparm into output side.
00150  *
00151  * Revision 1.2  1996/05/15  23:54:06  mju
00152  * Change prototype for MfReadGeorefTransParm().
00153  *
00154  * Revision 1.1  1996/05/14  15:47:36  mju
00155  * Initial revision
00156  *
00157  * \endif
00158 **/
00159 
00160 #ifndef INC_MI32_RVCGREF_H
00161 #define INC_MI32_RVCGREF_H
00162 
00163 #ifndef INC_MI32_RVCDEFNS_H
00164 #include <mi32/rvcdefns.h>
00165 #endif
00166 
00167 #ifndef INC_MI32_CTRLPT_H
00168 #include <mi32/ctrlpt.h>
00169 #endif
00170 #ifndef INC_MI32_TIEPOINT_H
00171 #include <mi32/tiepoint.h>
00172 #endif
00173 
00174 /*----------------------------------------------------------------------------*/
00175 /*    Define georeference data structures, flags, types, etc...               */
00176 /*----------------------------------------------------------------------------*/
00177 
00178 struct GEOREFMATRIX {                  /* Georeference data for GEOREF_MATRIX type */
00179    Mat3x3 forward;                     //!<  Translation from file coords to map coords 
00180    Mat3x3 inverse;                     //!<  Translation from map coords to file coords 
00181    };
00182 
00183 struct RVCGEOREFINFO : public RVCGENINFO {   /* Georeference information structure */
00184    DOUBLE tparm[15];                   //!<  Projection-dependent transformation parameters 
00185    UINT16 georeftype;                  //!<  Type of georeference used 
00186    INT16 mapproj;                      //!<  Map projection registered to 
00187    UINT16 numctrlpts;                  //!<  Number of registration points (not incl center) 
00188    UINT16 CalibModel;                  //!<  Calibration model using TRANS2DMODEL values defined in <mi32/trans2d.h> 
00189    UINT16 zone[4];                     //!<  Zone numbers 
00190    UNICODE projname[32];               //!<  Map projection text name 
00191    INT32 m_CtrlPtSize;                 //!<  Size of internal ctrl point structure
00192    INT32 m_EdgeSize;                   //!<  Size of internal ctrl point edge structure
00193    
00194    RVCGEOREFINFO (
00195       ) {Clear();}
00196    
00197    RVCGEOREFINFO (
00198       const RVCGENINFO& ginfo
00199       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00200    
00201    RVCGEOREFINFO& operator= (
00202       const RVCGENINFO& ginfo
00203       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00204 
00205    void Clear (
00206       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00207    
00208    };
00209 
00210 #define  GEOREF_IMPLIED    5           //!<  Georeference information is implied in the data 
00211 #define  GEOREF_MATRIX     6           //!<  Uses 2-D transformation matrix 
00212 #define  GEOREF_CTRLPOINT  7           //!<  List of CTRLPOINT3's 
00213 //#define   GEOREF_MANIFOLD   8           //!<  Not to be defined here
00214 
00215 #define  RVCGREF_FlagMask        0xFFFF0000
00216 #define  RVCGREF_TransGenOutput  0x00010000     //!<  MfReadGeorefTransParm - Setup output side of TRANSPARM 
00217 #define  RVCGREF_IncludeArb      0x00020000     //!<  MfGeorefGetDeafult - Include PROJ_Arbitrary in default check 
00218 
00219 struct RVCCAMERAINFO : public RVCGENINFO {   /* Camera position information structure */
00220    DPOINT2D PrincPoint;                //!<  Principle point 
00221    DPOINT3D CameraPosition;            //!<  Position of camera relative to raster 
00222    DOUBLE EpipolarAngle;               //!<  Angle to epipolar line for stereo analysis 
00223    DOUBLE TiltAngle;                   //!<  Angle measured in principle plane from optical axis of camera 
00224    DOUBLE SwingAngle;                  //!<  Direction of tilt with respect to photographic axes 
00225    DOUBLE FocalLength;                 //!<  Focal length of camera converted to cells 
00226    DOUBLE ImageScale;                  //!<  Size of pixel in camera image plane 
00227    
00228    RVCCAMERAINFO (
00229       ) {Clear();}
00230    
00231    RVCCAMERAINFO (
00232       const RVCGENINFO& ginfo
00233       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00234    
00235    RVCCAMERAINFO& operator= (
00236       const RVCGENINFO& ginfo
00237       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00238    
00239    void Clear (
00240       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00241    
00242    };
00243 
00244 
00245 //! Disallow memset/memcpy
00246 PREVENT_MEMFUNC(RVCGEOREFINFO)
00247 PREVENT_MEMFUNC(RVCCAMERAINFO)
00248 
00249 /*-------------------------------------------------------------------------*/
00250 /*    Object Selection Dialogs                                             */
00251 /*-------------------------------------------------------------------------*/
00252 
00253 //! Write the header information for the georef object.
00254 DEPRECATED inline int MfWriteGeorefHeader (
00255    int fhandle, 
00256    RVCINODENUM inode, 
00257    RVCGEOREFINFO* info
00258    ) {
00259    return (_MfWriteHeader(fhandle,inode,info,sizeof(RVCGEOREFINFO),RVCCONV_GEOREF));
00260    }
00261 
00262 class IMapInfoFile;
00263 RVCAPPLIBEXPORT ERRVALUE ProjSetMapInfoTAB (MAPPROJPARM& ProjParm, IMapInfoFile* pFile, double& scale);
00264 
00265 /*----------------------------------------------------------------------------*/
00266 /*    Function prototypes                                                     */
00267 /*----------------------------------------------------------------------------*/
00268 
00269 #define MfCameraCalibRead(_f,_oi,_info)                  _MfCameraCalibRead((_f),(_oi),(_info),sizeof(RVCCAMERAINFO))
00270 #define MfCameraCalibWrite(_f,_oi,_info)                 _MfCameraCalibWrite((_f),(_oi),(_info),sizeof(RVCCAMERAINFO))
00271 
00272 extern "C" {
00273 
00274    #ifndef GENERATING_DOXYGEN_OUTPUT
00275    RVCAPPLIBEXPORT   int _MfCameraCalibRead (int fhandle, INT32 objinode, RVCCAMERAINFO*, int);
00276    RVCAPPLIBEXPORT   int _MfCameraCalibWrite (int fhandle, INT32 objinode, RVCCAMERAINFO*, int);
00277 
00278    RVCAPPLIBEXPORT   int _MfGeorefRead (int fhandle, INT32 grinode, RVCGEOREFINFO*, int, void**);
00279    RVCAPPLIBEXPORT   int _MfGeorefReadHeader (int fhandle, INT32 grinode, RVCGEOREFINFO*, int);
00280    RVCAPPLIBEXPORT   int _MfGeorefReadMatrix (int fhandle, INT32 grinode, RVCGEOREFINFO*, int, Mat3x3, Mat3x3, MAPPROJPARM*);
00281    RVCAPPLIBEXPORT   int _MfGeorefWrite (int fhandle, INT32 grinode, RVCGEOREFINFO*, int, const void*);
00282    #endif //!< GENERATING_DOXYGEN_OUTPUT
00283    
00284    //! Compute object scale / cell size from specified georeference object.
00285    //! \deprecated Replaced by RVC::GEOSPATIAL::ComputeScaleFromGeoref()
00286    DEPRECATED RVCAPPLIBEXPORT int MfComputeScaleFromGeoref (
00287       int fhandle,                     //!< Handle for open RVC file
00288       INT32 georefinode,               //!< Georeference object to use
00289       double *xscale,                  //!< X scale or raster cell size returned
00290       double *yscale                   //!< Y scale or raster cell size returned
00291       );
00292 
00293    //! Get default georeference under an object.
00294    //!
00295    //! @return Inode of default georef object or -1 if no georef object or < 0 Error.
00296    //!
00297    //! This function determines the default georeference to use based on time / date stamps.
00298    //! Arbitrary georeference objects are not considered unless there are no other georeferences or 
00299    //! the RVCGREF_IncludeArb flag is passed.  For Raster Set objects, the georeference under the 
00300    //! raster set is first considered then the georeferences under the raster object, if the raster 
00301    //! object inode is passed as the parent inode.
00302    DEPRECATED RVCAPPLIBEXPORT INT32 MfGeorefGetDefault (
00303       int findex,                      //!< File handle returned by MfMakeFile or MfOpenFile
00304       INT32 parent,                    //!< Inode of parent object to search for georeference under
00305       UINT32 flags = 0                 //!< Flags
00306       );
00307 
00308    //! Set X/Y scale fields in object header based on specified georeference object.
00309    //! \deprecated Replaced by RVC::GEOSPATIAL::SetScaleFromGeoref()
00310    DEPRECATED RVCAPPLIBEXPORT int MfSetScaleFromGeoref (
00311       int fhandle,                     //!< RVC file handle
00312       INT32 objinode,                  //!< Inode for object
00313       INT32 georefinode,               //!< Inode for georeference object
00314       int OnlyIfZero                   //!< Flag - only change scale values if they are currently zero
00315       );
00316 
00317    //! Copy fields from RVCGEOREFINFO structure to MAPPROJPARM structure.
00318    DEPRECATED RVCAPPLIBEXPORT void CopyGEOREFINFOtoMAPPROJPARM (
00319       MAPPROJPARM *projparm, 
00320       const RVCGEOREFINFO *georefinfo
00321       );
00322 
00323    //! Copy fields from MAPPROJPARM structure to RVCGEOREFINFO structure.
00324    DEPRECATED RVCAPPLIBEXPORT void CopyMAPPROJPARMtoGEOREFINFO (
00325       RVCGEOREFINFO *georefinfo, 
00326       const MAPPROJPARM *projparm
00327       );
00328 
00329    //! Set default name, desc from a MAPPROJPARM.
00330    DEPRECATED RVCAPPLIBEXPORT int SetDftGeorefNameDesc (
00331       RVCGEOREFINFO *ginfo,            //!< The header
00332       const MAPPROJPARM *projparm      //!< Projection parameters
00333       );
00334 }
00335 
00336 DEPRECATED inline ERRVALUE MfReadGeoref (
00337    int fhandle, 
00338    RVCINODENUM inode, 
00339    RVCGEOREFINFO* info,
00340    void** data
00341    ) { return (_MfGeorefRead(fhandle, inode, info, sizeof(RVCGEOREFINFO), data)); }
00342 
00343 //! Read the header information for the georef object.
00344 DEPRECATED inline int MfReadGeorefHeader (
00345    int fhandle, 
00346    RVCINODENUM inode, 
00347    RVCGEOREFINFO* info
00348    ) { return (_MfGeorefReadHeader(fhandle,inode,info,sizeof(RVCGEOREFINFO))); }
00349 
00350 DEPRECATED inline ERRVALUE MfReadGeorefMatrix (
00351    int fhandle, 
00352    INT32 grinode, 
00353    RVCGEOREFINFO* info, 
00354    Mat3x3 fwd, 
00355    Mat3x3 inv, 
00356    MAPPROJPARM* pp
00357    ) { return (_MfGeorefReadMatrix(fhandle, grinode, info, sizeof(RVCGEOREFINFO), fwd, inv, pp)); }
00358 
00359 ERRVALUE MfReadGeorefTransParm (
00360    int fhandle, 
00361    RVCINODENUM inode, 
00362    RVCGEOREFINFO* info,
00363    TRANSPARM *transparm, 
00364    UINT32 flags
00365    );
00366    
00367 DEPRECATED inline ERRVALUE MfWriteGeoref (
00368    int fhandle, 
00369    RVCINODENUM inode, 
00370    RVCGEOREFINFO* info,
00371    const void* data
00372    ) { return (_MfGeorefWrite(fhandle, inode, info, sizeof(RVCGEOREFINFO), data)); }
00373 
00374 #endif   //!<  #ifndef INC_MI32_RVCGREF_H 

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