rvclegnd.h

Go to the documentation of this file.
00001 /**
00002  * \file rvclegnd.h <mi32/rvclegnd.h>
00003  * \brief Definitions for RVC LEGEND object structures
00004  *
00005  * \if NODOC
00006  * $Id: rvclegnd.h_v 1.8 2003/09/15 13:49:56 fileserver!dwilliss Exp $
00007  *
00008  * $Log: rvclegnd.h_v $
00009  * Revision 1.8  2003/09/15 13:49:56  fileserver!dwilliss
00010  * Doxygen
00011  *
00012  * Revision 1.7  2002/08/20 15:06:39  mju
00013  * Use prevent_memfunc().
00014  *
00015  * Revision 1.6  2002/03/08 18:16:24  scowan
00016  * Added clear and set methods for info structure.
00017  *
00018  * Revision 1.5  2000/12/15 16:33:26  msmith
00019  * Genitor documentation.
00020  *
00021  * Revision 1.4  2000/09/01 14:47:44  dwilliss
00022  * Changed SpareDouble to SampleOffset
00023  *
00024  * Revision 1.3  2000/08/11 16:44:37  scowan
00025  * More const.
00026  *
00027  * Revision 1.2  1999/10/05 22:47:16  scowan
00028  * Changed header to use inheritance.
00029  *
00030  * Revision 1.1  1999/05/06 22:15:27  mju
00031  * Initial revision
00032  *
00033  * \endif
00034 **/
00035 
00036 #ifndef  INC_MI32_RVCLEGND_H
00037 #define  INC_MI32_RVCLEGND_H
00038 
00039 #ifndef  INC_MI32_RVCDEFNS_H
00040    #include <mi32/rvcdefns.h>
00041 #endif
00042 
00043 #ifndef  INC_MI32_COLOR_H
00044    #include <mi32/color.h>
00045 #endif
00046 
00047 //! Legend text style structure.
00048 struct RVCLEGENDTEXTSTYLE {
00049    UINT32 StyleFlags;                  //!< STYLEFLAG_????
00050    INT32 FontNumber;                   //!< Font
00051    COLOR FGColor;                      //!< Foreground color
00052    COLOR BGColor;                      //!< Background color
00053    FLOAT GlyphRotation;                //!< Rotation of each glyph individually
00054    FLOAT GlyphAspect;                  //!< Height to width aspect ratio
00055    FLOAT Shear;                        //!< Italics angle
00056    FLOAT Height;                       //!< Height of glyph in "HeightUnits"
00057    FLOAT LineSpace;                    //!< Line spacing in "SpaceUnits"
00058    UINT32 FontFlags;                   //!< FONTSTYLE_???? or'ed together
00059    DOUBLE MapScale;                    //!< Map scale
00060    UNICODE fontname[32];               //!< font name (eg: "SYSTEM.OF")
00061    UINT16 HeightUnits;                 //!< Units for height (SCREENUNIT_...)
00062    UINT16 SpaceUnits;                  //!< Units for line spacing (SCREENUNIT_...)
00063    UINT16 Predefined;                  //!< Predefined label styles
00064    UINT8 spare[2];
00065    };
00066 
00067 //! Legend Header.
00068 struct RVCLEGENDINFO : public RVCGENLISTINFO {
00069    DOUBLE MapScale;                    //!< Map scale
00070    DOUBLE ColSpace;                    //!< Column spacing
00071    DOUBLE ColWidth;                    //!< Column width
00072    DOUBLE SampleSpace;                 //!< Sample spacing
00073    DOUBLE SampleHeight;                //!< Sample height
00074    DOUBLE SampleWidth;                 //!< Sample width
00075    DOUBLE LineSpace;                   //!< Line spacing
00076    DOUBLE SATableNum;                  //!< Table number - Yes, its a double -- don't ask 
00077    DOUBLE SampleOffset;                //!< Sample offset
00078    INT32 ContrastType;                 //!< Contrast type
00079    INT32 SpareLong;                    //!< Reserved
00080    COLOR BackgroundColor;              //!< Background color
00081    RVCLEGENDTEXTSTYLE Style[4];        //!< Text style structures
00082    UINT16 ElementType;                 //!< Element type
00083    UINT16 version;                     //!< Version
00084    UINT32 units;                       //!< Units
00085    UINT32 numcols;                     //!< Number of columns
00086    UINT32 DispFlags;                   //!< Flags
00087    COLOR SampleBorderColor;            //!< Sample border color
00088    COLOR LegendBorderColor;            //!< Legend border color
00089    DOUBLE SampleBorderWidth;           //!< Sample border width in mm at given MapScale
00090    DOUBLE LegendBorderWidth;           //!< Legend border width in mm at given MapScale
00091    DOUBLE MarginWidth;                 //!< Margin width
00092    DOUBLE MinL;                        //!< Left minimum
00093    DOUBLE MaxL;                        //!< Left maximum
00094    DOUBLE MinR;                        //!< Right minimum
00095    DOUBLE MaxR;                        //!< Right maximum
00096    UINT32   UMinIndex;                 //!< Minimum index - used to be named MinIndex
00097    UINT32   UMaxIndex;                 //!< Maximum index - used to be named MaxIndex
00098    UINT32   NumTicksL;                 //!< Number of ticks left
00099    UINT32   NumTicksR;                 //!< Number of ticks right
00100    DOUBLE MinIndex;                    //!< Because MinIndex was unsigned
00101    DOUBLE MaxIndex;                    //!< Because MaxIndex was unsigned
00102    
00103    RVCLEGENDINFO (
00104       ) {Clear();}
00105    
00106    RVCLEGENDINFO (
00107       const RVCGENINFO& ginfo
00108       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00109    
00110    //! Assignment operator.
00111    RVCLEGENDINFO& operator= (
00112       const RVCGENINFO& ginfo          //!< RVCGENINFO structure to copy from
00113       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00114       
00115    void Clear (
00116       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00117       
00118    };
00119 
00120 PREVENT_MEMFUNC(RVCLEGENDINFO)
00121 
00122 //! All list entries in a legend object are a series of UWORDs
00123 //! This structure is used in-memory only
00124 struct RVCLEGENDLINE {
00125    UINT16 type;                        //!< 1 == normal legend data
00126    UINT16 flags;                       //!< Flags
00127    UNICODE *style;                     //!< Style
00128    UNICODE *heading;                   //!< Heading
00129    UNICODE *desc;                      //!< Description
00130    };
00131 
00132 #define LEGENDFLAG_Selected      0x01  //!< Draw an entry for this style
00133 #define LEGENDFLAG_DescFromField 0x02  //!< Description just gives table.field
00134 #define LEGENDFLAG_DescQuery     0x04  //!< Description is a string query
00135 #define LEGENDFLAG_DescDQuery    0x08  //!< Get description from default query
00136 #define LEGENDFLAG_DescFromTheme 0x10  //!< Get description from a theme
00137 
00138 //! Read legend header.
00139 inline int MfReadLegendHeader (
00140    int fhandle,                        //!< Open file handle
00141    RVCINODENUM inode,                  //!< Legend object inode
00142    RVCLEGENDINFO* info                 //!< Legend header passed / returned
00143    ) {
00144    return (_MfReadHeader(fhandle,inode,info,sizeof(RVCLEGENDINFO),RVCCONV_LegendInfo));
00145    }
00146 
00147 //! Write legend header.
00148 inline int MfWriteLegendHeader (
00149    int fhandle,                        //!< Open file handle
00150    RVCINODENUM inode,                  //!< Legend object inode
00151    RVCLEGENDINFO* info                 //!< Legend header to write
00152    ) {
00153    return (_MfWriteHeader(fhandle,inode,info,sizeof(RVCLEGENDINFO),RVCCONV_LegendInfo));
00154    }
00155 
00156 #if defined(__cplusplus)
00157 extern "C" {
00158 #endif
00159 
00160 //! Legend functions
00161 
00162 #ifndef GENERATING_DOXYGEN_OUTPUT
00163 
00164 RVCAPPLIBEXPORT int _MfLegendClose (
00165    int id, 
00166    RVCLEGENDINFO *info,
00167    int HeaderSize
00168    );
00169 
00170 RVCAPPLIBEXPORT void _MfLegendFreeLine (
00171    RVCLEGENDLINE *llp, 
00172    int LegendSize
00173    );
00174 
00175 RVCAPPLIBEXPORT int _MfLegendMake (
00176    int fid, 
00177    RVCLEGENDINFO *info,
00178    int HeaderSize,
00179    UINT32 flags
00180    );
00181 
00182 RVCAPPLIBEXPORT int _MfLegendOpen (
00183    int fid, 
00184    INT32 inode, 
00185    RVCLEGENDINFO *info, 
00186    int HeaderSize, 
00187    UINT32 flags
00188    );
00189 
00190 RVCAPPLIBEXPORT int _MfLegendRead (
00191    int id, 
00192    INT32 num, 
00193    RVCLEGENDLINE *inllp, 
00194    int LegendSize
00195    );
00196 
00197 RVCAPPLIBEXPORT int _MfLegendWrite (
00198    int id, 
00199    INT32 num, 
00200    RVCLEGENDLINE *inllp,
00201    int LegendSize
00202    );
00203 
00204 #endif //!< GENERATING_DOXYGEN_OUTPUT
00205 
00206 //! Read a legend into a buffer.
00207 RVCAPPLIBEXPORT int MfReadLegendBuf (
00208    int id,                             //!< Legend object handle
00209    INT32 num,                          //!< Item number
00210    void *buf                           //!< Buffer to read to
00211    );
00212 
00213 //! Write a legend from a buffer.
00214 RVCAPPLIBEXPORT int MfWriteLegendBuf (
00215    int id,                             //!< Legend object handle
00216    INT32 num,                          //!< Item number
00217    INT32 size,                         //!< Size of buffer
00218    const void *buf                     //!< Buffer to write from
00219    );
00220 
00221 //! Close a legend.
00222 inline int MfCloseLegend (
00223    int id,                             //!< Legend object handle
00224    RVCLEGENDINFO *info                 //!< Legend object to close
00225    ) {
00226    return _MfLegendClose(id, info, sizeof(RVCLEGENDINFO));
00227    }
00228 
00229 //! Make a legend.
00230 inline int MfMakeLegend (
00231    int fid,                            //!< Open file handle
00232    RVCLEGENDINFO *info,                //!< Legend structure passed / returned
00233    UINT32 flags                        //!< Flags
00234    ) {
00235    return _MfLegendMake(fid, info, sizeof(RVCLEGENDINFO), flags);
00236    }
00237 
00238 //! Open a legend.
00239 inline int MfOpenLegend (
00240    int fid,                            //!< Open file handle
00241    INT32 inode,                        //!< Legend object inode
00242    RVCLEGENDINFO *info,                //!< Legend structure passed / returned
00243    UINT32 flags                        //!< Flags
00244    ) {
00245    return _MfLegendOpen(fid, inode, info, sizeof(RVCLEGENDINFO), flags);
00246    }
00247 
00248 //! Read a legend.
00249 inline int MfReadLegend (
00250    int id,                             //!< Legend object handle
00251    INT32 num,                          //!< Item number
00252    RVCLEGENDLINE *inllp                //!< Legend line structure returned
00253    ) {
00254    return _MfLegendRead(id, num, inllp, sizeof(RVCLEGENDLINE));
00255    }
00256 
00257 //! Write a legend.
00258 inline int MfWriteLegend (
00259    int id,                             //!< Legend object handle
00260    INT32 num,                          //!< Item number
00261    RVCLEGENDLINE *inllp                //!< Legend line structure to write from
00262    ) {
00263    return _MfLegendWrite(id, num, inllp, sizeof(RVCLEGENDLINE));
00264    }
00265 
00266 //! Free a legend.
00267 inline void MfFreeLegendLine (
00268    RVCLEGENDLINE *llp                  //!< Legend line structure to free
00269    ) {
00270    _MfLegendFreeLine(llp, sizeof(RVCLEGENDLINE));
00271    }
00272 
00273 #if defined(__cplusplus)
00274 }
00275 #endif
00276 
00277 #endif   //!< INC_MI32_RVCLEGND_H

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