gre/elemsampledc.h

Go to the documentation of this file.
00001 /**
00002  * \file elemsampledc.h <gre/elemsampledc.h>
00003  * \brief GRE ELEMSAMPLE_DC class definitions
00004  *
00005  * \if NODOC
00006  * $Id: elemsampledc.h_v 1.8 2005/12/19 18:46:54 dwilliss Exp $
00007  *
00008  * $Log: elemsampledc.h_v $
00009  * Revision 1.8  2005/12/19 18:46:54  dwilliss
00010  * added optional credentials to a method
00011  *
00012  * Revision 1.7  2005/10/14 17:30:06  mju
00013  * GRE namespace.
00014  *
00015  * Revision 1.6  2004/02/13 15:32:09  dwilliss
00016  * deprecated old mgd
00017  *
00018  * Revision 1.5  2003/09/15 13:48:59  fileserver!dwilliss
00019  * Doxygen
00020  *
00021  * Revision 1.4  2003/07/30 15:18:16  mju
00022  * Change back to GRE_ name as requires too many other changes.
00023  *
00024  * Revision 1.3  2003/07/30 14:47:37  mju
00025  * Put class in GRE namespace with typedef for old name.
00026  * Ignore private section.
00027  *
00028  * Revision 1.2  2003/06/18 13:57:05  mju
00029  * Include more req'd headers.
00030  *
00031  * Revision 1.1  2003/06/17 13:39:44  mju
00032  * Initial revision
00033  * \endif
00034 **/
00035 
00036 #ifndef  INC_GRE_ELEMSAMPLEDC_H
00037 #define  INC_GRE_ELEMSAMPLEDC_H
00038 
00039 #ifndef  INC_GRE_BASE_H
00040    #include <gre/base.h>
00041 #endif
00042 
00043 #ifndef  INC_MI32_MGD2_H
00044    #include <mi32/mgd2.h>
00045 #endif
00046 
00047 #ifndef  INC_MI32_TRANS2DC_H
00048    #include <mi32/trans2dc.h>
00049 #endif
00050 
00051 #ifndef  INC_RVC_STYLE_H
00052    #include <rvc/style.h>
00053 #endif
00054 
00055 namespace GRE {
00056 //===================================================================================================================
00057 
00058 //! Drawing Context for Element Samples.
00059 class ELEMSAMPLE_DC {
00060    public:
00061 
00062       //! Constructor.
00063       explicit ELEMSAMPLE_DC (
00064          MGD::STYLESAMPLEFLAGS SampleFlags = MGD::STYLESAMPLE_ShrinkToFit
00065          );
00066 
00067       //! Construct with MGC_GC.
00068       explicit ELEMSAMPLE_DC (
00069          MGD::CONTEXT *gc,
00070          MGD::STYLESAMPLEFLAGS SampleFlags = MGD::STYLESAMPLE_ShrinkToFit
00071          );
00072 
00073       //! Destructor.
00074       virtual ~ELEMSAMPLE_DC (
00075          );
00076 
00077       //! Close style object if was opened.
00078       void CloseStyleObject (
00079          ) { m_StyleObj.Close(); }
00080 
00081       //! Get graphic drawing context.
00082       MGD::CONTEXT* GetGC (
00083          ) const { return (m_gc); }
00084 
00085       //! Get flags for Draw...StyleSample() usage.
00086       MGD::STYLESAMPLEFLAGS GetSampleFlags (
00087          ) const { return (m_SampleFlags); }
00088 
00089       //! Get reference to style object.
00090       const RVC::STYLE& GetStyleObject (
00091          ) const { return (m_StyleObj); }
00092 
00093       //! Get the TransGen used to draw this sample
00094       //! Will be NULL if drawing into legend view, 
00095       //! Will be valid if drawing for legend layer.
00096       const TRANS2D_MAPGEN* GetTransGen (
00097          ) const { return (m_TransGen); }
00098 
00099       //! Open specified style object.
00100       //! If specified path/inode matches currently open object it will not be opened again.
00101       ERRVALUE OpenStyleObject (
00102          const RVC::OBJITEM& StyleObj,
00103          const RVC::CREDENTIALS* Credentials = 0
00104          ) { return (m_StyleObj.Open(StyleObj, RVC::OBJECT::OPENMODE_Read, 0, Credentials)); }
00105 
00106       //! Set flags for Draw...StyleSample() usage.
00107       void SetSampleFlags (
00108          MGD::STYLESAMPLEFLAGS SampleFlags
00109          ) { m_SampleFlags = SampleFlags; return; }
00110 
00111       void SetTransGen (
00112          const TRANS2D_MAPGEN* trans
00113          ) { m_TransGen = trans; return; }
00114 
00115    private:
00116       #ifndef GENERATING_DOXYGEN_OUTPUT
00117 
00118       MGD::CONTEXT *m_gc;
00119       MGD::STYLESAMPLEFLAGS m_SampleFlags;
00120       RVC::STYLE m_StyleObj;
00121       const TRANS2D_MAPGEN* m_TransGen;
00122 
00123       ELEMSAMPLE_DC (const ELEMSAMPLE_DC&);
00124       ELEMSAMPLE_DC& operator= (const ELEMSAMPLE_DC&);
00125 
00126       #endif //!< GENERATING_DOXYGEN_OUTPUT
00127    };
00128 
00129 //===================================================================================================================
00130 }  // End namespace GRE
00131 
00132 #endif   //!< INC_GRE_ELEMSAMPLEDC_H

Generated on Thu Apr 26 04:44:39 2007 for TNTsdk by  doxygen 1.5.2