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