lrlegend.h

Go to the documentation of this file.
00001 /**
00002  * \file lrlegend.h <gre/lrlegend.h>
00003  * \brief GRE_LAYER_LEGEND class definitions
00004  *
00005  * \if NODOC
00006  * $Id: lrlegend.h_v 1.5 2004/10/01 17:19:55 mju Exp $
00007  *
00008  * $Log: lrlegend.h_v $
00009  * Revision 1.5  2004/10/01 17:19:55  mju
00010  * Add dlgparent to assignObject.
00011  *
00012  * Revision 1.4  2004/03/05 18:53:41  mju
00013  * Use virtual dtor if virtual fns.
00014  *
00015  * Revision 1.3  2003/09/15 13:48:59  fileserver!dwilliss
00016  * Doxygen
00017  *
00018  * Revision 1.2  2003/07/30 15:21:53  mju
00019  * Ignore private section.
00020  *
00021  * Revision 1.1  2002/09/20 17:37:28  mju
00022  * Initial revision
00023  *
00024  * \endif
00025 **/
00026 
00027 #ifndef  INC_GRE_LRLEGEND_H
00028 #define  INC_GRE_LRLEGEND_H
00029 
00030 #ifndef  INC_MI32_GRE_H
00031 #include <mi32/gre.h>
00032 #endif
00033 
00034 //===================================================================================================================
00035 
00036 class GRE_LAYER_LEGEND : public GRE_LAYER {
00037    public:
00038 
00039       enum SUBTYPE {
00040          //! These types are stored in layouts by number
00041          //! and thus must not be changed
00042          SUBTYPE_Point =         0,
00043          SUBTYPE_Line =          1,
00044          SUBTYPE_Poly =          2,
00045          SUBTYPE_ColorSample =   3,
00046          SUBTYPE_ColorScale =    4,
00047          SUBTYPE_RasterSample =  5
00048          };
00049 
00050       class DISPPARM : public GRE_LAYER::DISPPARM {
00051          public:
00052 
00053             class DLG;
00054 
00055             UNICODE filename[FILENAME_MAX];        //!< Filename of the object
00056             UNICODE stylefilename[FILENAME_MAX];   //!< File for style object if needed, blank if under vector
00057             INT32 styleinode;                      //!< Inode for style object if needed, <= 0 if under vector
00058             RVCLEGENDINFO objinfo;
00059 
00060          /*=================This stuff must be saved/loaded by mdlegend.c=============*/
00061             INT32 flags;                        //!< LEGENDFLAG_...
00062             SUBTYPE LegendType;                 //!< Legend subtype
00063             int StyleTable;                     //!< Style assignment table (-1 if not used)
00064             int NumCols;                        //!< # of columns of legend stuff
00065             TEXTSTYLE Style[4];                 //!< Font styles to use
00066             COLOR BackgroundColor;              //!< Color for background (default: transparent)
00067             COLOR SampleBorderColor;            //!< Sample border color
00068             COLOR LegendBorderColor;            //!< Legend border color
00069             //! All measurements are stored in output mm
00070             double SampleBorderWidth;
00071             double LegendBorderWidth;
00072             double ColSpace;                    //!< Space between columns
00073             double SampleSpace;                 //!< Space between sample and description
00074             double SampleHeight;                //!< Size of sample
00075             double SampleWidth;                 //!< Size of sample
00076             double SampleOffset;                //!< Offset from left edge
00077             double MapScale;                    //!< Map scale all measurements are relative to
00078             double LineSpace;                   //!< Minimum space between lines
00079             double MarginWidth;                 //!< Margin around whole legend
00080             int units;                          //!< Units user wants to edit sizes in
00081 
00082             //! Stuff for LAYERTYPE_LegendColorScale
00083             double MinIndex;                    //!< Minimum colormap index
00084             double MaxIndex;                    //!< Maximum colormap index
00085             UINT32 NumTicksL;                   //!< Number of ticks
00086             UINT32 NumTicksR;                   //!< Number of ticks
00087             double MinValL;                     //!< Minimum Value
00088             double MinValR;                     //!< Minimum Value
00089             double MaxValL;                     //!< Maximum Value
00090             double MaxValR;                     //!< Maximum Value
00091 
00092          /*=================This stuff is just internal=========================*/
00093 
00094             double Height, Width;      //!< Size of layer in ground meters (computed)
00095             double FullDescHeightM; 
00096 
00097             DISPPARM ();
00098             DISPPARM (const DISPPARM& rhs) {
00099                Copy(rhs);
00100                }
00101             virtual ~DISPPARM () {
00102                Free();
00103                }
00104 
00105             DISPPARM& operator= (const DISPPARM& rhs) {
00106                if (this != &rhs) {
00107                   Free();
00108                   Copy(rhs);
00109                   }
00110                return (*this);
00111                }
00112 
00113          protected:
00114             virtual const SERIALIZER::ITEMDEF* SerialGetItemDef (SERIALIZER& serializer) const;
00115 
00116          private:
00117             #ifndef GENERATING_DOXYGEN_OUTPUT
00118             void Copy (const DISPPARM&);
00119             void Free ();
00120             #endif //!< GENERATING_DOXYGEN_OUTPUT
00121          };
00122 
00123       //! Construct instance of this layer type
00124       static int Construct (
00125          GRE_GROUP *group,                      //!< Group to contain layer
00126          GRE_LAYER **retlayer,                  //!< Layer returned
00127          GRE_LAYER *reflayer,                   //!< Reference layer for insertion
00128          UINT32 flags                           //!< Creation flags
00129          );
00130 
00131       //! Register this layer type
00132       static void RegisterType (
00133          );
00134 
00135       //! Construct layer and insert into list
00136       explicit GRE_LAYER_LEGEND (
00137          GRE_GROUP *group,                      //!< Group to contain layer
00138          GRE_LAYER *reflayer = 0,               //!< Reference layer for insertion
00139          UINT32 flags = MDISPCREATE_InsertAfter //!< MDISPCREATE flags
00140          );
00141 
00142       virtual ~GRE_LAYER_LEGEND ();
00143 
00144       //! Retrieve layer-specific display parameters.
00145       const DISPPARM& GetDispParm (
00146          ) const { return (m_dispparm); }
00147 
00148       //! Set layer-specific display parameters.
00149       //! This is the recommended method for changing how an existing layer is to be
00150       //! rendered.  Validation will be performed on the specified parameters and
00151       //! adjustments made to the layer's copy if necessary.  Use of this method
00152       //! usually result in a ChangeBegin / ChangeEnd message pair, and will also
00153       //! generate a ChangeObject message if the spatial object used in the layer
00154       //! is changed.
00155       ERRVALUE SetDispParm (
00156          const DISPPARM& dispparm               //!< Parameters to set
00157          );
00158 
00159    protected:
00160 
00161       DISPPARM m_dispparm;                      //!< Layer-specific display parameters
00162 
00163    private:
00164       #ifndef GENERATING_DOXYGEN_OUTPUT
00165 
00166    #ifndef WIN32_NATIVE
00167       static void CB_CreateDialog (Widget, void*, void*);
00168    #endif
00169 
00170       int DrawLegend (void*, int);
00171       int SetupLegend (void*);
00172 
00173       //! Overrides from GRE_LAYER.
00174       virtual ERRVALUE v_AssignObject (const RVC::OBJITEM& objitem, MDLGPARENT dlgparent);
00175    #if defined(X_NATIVE) || defined(WIN32_MFC)
00176       virtual int v_ControlPanel (MDLGPARENT dlgparent,UINT32 flags = 0);
00177    #endif
00178       virtual ERRVALUE v_Draw (GRE_LAYERDC& layerdc);
00179       virtual const RVC::OBJITEM& v_GetObjItem (int component) const;
00180       virtual const char* v_SerialGetTagName () const;
00181       virtual void v_SetDftName (bool ReplaceExisting);
00182       virtual ERRVALUE v_TemplateRead (SERIALIZER& serializer);
00183       virtual int v_UpdateExtents (bool forceupdate);
00184 
00185       GRE_LAYER_LEGEND (const GRE_LAYER_LEGEND&);
00186       GRE_LAYER_LEGEND& operator= (const GRE_LAYER_LEGEND&);
00187 
00188       #endif //!< GENERATING_DOXYGEN_OUTPUT
00189    };
00190 
00191 
00192 #define LEGENDFLAG_ConstantSize     0x00000001
00193 #define LEGENDFLAG_RowMajor         0x00000002
00194 #define LEGENDFLAG_LayoutScale      0x00000004  //!< Use layout scale for sizes
00195 #define LEGENDFLAG_RightJustify     0x00000008  //!< Right justify descriptions
00196 #define LEGENDFLAG_SampleOnRight    0x00000010  //!< Samples on the right
00197 #define LEGENDFLAG_SideA            0x00000040  //!< Labels on top/left
00198 #define LEGENDFLAG_SideB            0x00000080  //!< Labels on bottom/right
00199 #define LEGENDFLAG_DescCenterVert   0x00000100
00200 #define LEGENDFLAG_CenterHeadings   0x00000200
00201 #define LEGENDFLAG_Horizontal    LEGENDFLAG_RowMajor
00202 
00203 //===================================================================================================================
00204 
00205 #endif   //!< INC_GRE_LRLEGEND_H

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