mi32/transmod.h

Go to the documentation of this file.
00001 /***
00002  * \file transmod.h <mi32/transmod.h>
00003  * \brief Definitions for TransModel object used in georeference
00004  *
00005  * \if NODOC
00006  * $Id: transmod.h_v 1.4 2003/09/15 13:49:56 fileserver!dwilliss Exp $
00007  *
00008  * $Log: transmod.h_v $
00009  * Revision 1.4  2003/09/15 13:49:56  fileserver!dwilliss
00010  * Doxygen
00011  *
00012  * Revision 1.3  2000/11/16 18:25:10  scowan
00013  * Updated for genator docs.
00014  *
00015  * Revision 1.2  2000/11/16 17:50:10  scowan
00016  * Proper id and log tags inserted.
00017  *
00018  * \endif
00019 ***/
00020 
00021 #ifndef  INC_MI32_TRANSMOD_H
00022 #define  INC_MI32_TRANSMOD_H
00023 
00024 #ifndef INC_MI32_STDDEFNS_H
00025 #include <mi32/stddefns.h>
00026 #endif
00027 
00028 #ifndef INC_MI32_TRANS2D_H
00029 #include <mi32/trans2d.h>
00030 #endif
00031 
00032 //!
00033 //!   TRANSMODEL class.  This class manages the different sections and values in the UINT16 CalibModel field 
00034 //! in the RVCGEOREFINFO struct.  This parameter is also used in some function calls, mainly in TRANSGEN
00035 //! and TRANS2D_MAPGEN classes.  Its main goal is to hide the annoying bit twiddling that the CalibModel variable
00036 //! requires.
00037 //!
00038 
00039 class TRANSMODEL {
00040 public:
00041 
00042    // ENUMERATIONS
00043    
00044    enum FLAGS {                     //! Translation model flags
00045       FLAGS_None = 0,
00046       FLAGS_OrientInvert = TRANS2DMODEL_OrientInvert,
00047       FLAGS_Piecewise = TRANS2DMODEL_Piecewise
00048       };
00049 
00050    enum TYPE {                      //! Translation model type, based off of TRANS2DMODEL values
00051       TYPE_None = 0,
00052       TYPE_Affine = 1,                 //!< Affine (MAT3X3)
00053       TYPE_PlaneProj,                     //!< Plane-projective
00054       TYPE_Bilinear,
00055       TYPE_Polynomial,
00056       TYPE_Quintic,
00057       TYPE_SpaceResect,                //!< Space resection (aerial photography)
00058       TYPE_Conformal,                     //!< Conformal transformation
00059       TYPE_RubberSheet                 //!< "Rubber Sheeting" or "Morphing" model
00060       };
00061 
00062    // CONSTRUCTORS / DESTRUCTOR
00063    
00064    //! Default constructor 
00065    TRANSMODEL (
00066       UINT16 model = 0                 //!< Old transmodel number (UINT16)
00067       ) :
00068       m_Order(0),
00069       m_Flags(FLAGS_None),
00070       m_Type(TYPE_None)
00071       {
00072       if (model != 0) SetModel(model);
00073       }
00074 
00075    //! Use default copy constructor
00076    
00077    //! Constructor with type
00078    TRANSMODEL (
00079       TYPE dfttype
00080       ) :
00081       m_Order(0),
00082       m_Flags(FLAGS_None),
00083       m_Type(dfttype)
00084       {}
00085       
00086    // OPERATORS
00087    //! Use default assignment operator
00088       
00089    // METHODS
00090 
00091    //! Obtain TRANSMODEL flags
00092    //!
00093    //! @return: TRANSMODEL::FLAGS
00094    FLAGS GetFlags (
00095       ) const {
00096       return (m_Flags);
00097       }
00098 
00099    //! Obtain old translation model combined value
00100    //!
00101    //! @return: Translation model combined value
00102    UINT16 GetModel (
00103       ) const {
00104       UINT16 retval = static_cast<UINT16>(m_Order | static_cast<UINT16>(m_Flags));
00105       retval |= static_cast<UINT16>(m_Type) << 8;
00106       return (retval);
00107       }
00108 
00109    //! Obtain translation model order
00110    //!
00111    //! @return: Translation model order
00112    UINT16 GetOrder (
00113       ) const {
00114       return (m_Order);
00115       }
00116 
00117    //! Obtain translation model type
00118    //!
00119    //! @return: Translation model type
00120    TYPE GetType (
00121       ) const {
00122       return (m_Type);
00123       }
00124 
00125    //! Determine translation model orientation
00126    //!
00127    //! @return: True if translation model inverted, false if not
00128    bool IsOrientInvert (
00129       ) const {
00130       return ((m_Flags & FLAGS_OrientInvert) != 0);
00131       }
00132 
00133    //! Determine if translation model is piecewise
00134    //!
00135    //! @return: True if translation model is piecewise, false if not
00136    bool IsPiecewise (
00137       ) const {
00138       return ((m_Flags & FLAGS_Piecewise) != 0);
00139       }
00140 
00141    //! Set translation model using old translation model value
00142    void SetModel (
00143       UINT16 model
00144       ) {
00145       m_Order = static_cast<UINT16>(model & 0x00FF),
00146       m_Flags = static_cast<FLAGS>(model & 0xF000);
00147       m_Type = static_cast<TYPE>((model & 0xF00) >> 8);
00148       return;
00149       }
00150 
00151    //! Set translation model flags
00152    void SetFlags (
00153       FLAGS flags
00154       ) {
00155       m_Flags = flags;
00156       return;
00157       }
00158 
00159    //! Set translation model order
00160    void SetOrder (
00161       UINT16 order
00162       ) {
00163       m_Order = order;
00164       return;
00165       }
00166 
00167    //! Set translation model type
00168    void SetType (
00169       TYPE type
00170       ) {
00171       m_Type = type;
00172       return;
00173       }
00174 
00175 private:
00176    #ifndef GENERATING_DOXYGEN_OUTPUT
00177    FLAGS m_Flags;
00178    TYPE m_Type;
00179    UINT16 m_Order;
00180    #endif // GENERATING_DOXYGEN_OUTPUT
00181 };
00182 
00183 DEFINE_ENUM_OPERATORS(TRANSMODEL::FLAGS);
00184 
00185 #endif               //!<  #ifndef  INC_MI32_TRANSMOD_H 

Generated on Thu Aug 12 06:19:11 2004 for TNTsdk by doxygen 1.3.4-20031026