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

Generated on Thu Apr 26 04:03:31 2007 for TNTsdk by  doxygen 1.5.2