00001 00020 #ifndef INC_GRE_VIEWPOS_H 00021 #define INC_GRE_VIEWPOS_H 00022 00023 #ifndef INC_GRE_VIEWPLACE_H 00024 #include <gre/viewplace.h> 00025 #endif 00026 00027 #ifndef INC_MI32_TRANS2DAFFINE_H 00028 #include <mi32/trans2daffine.h> 00029 #endif 00030 00031 namespace GRE { 00032 //=================================================================================================================== 00033 00035 class VIEWPOS { 00036 public: 00037 00038 VIEWPOS (); 00039 00040 ~VIEWPOS (); 00041 00043 const DPOINT2D& GetCenterPoint ( 00044 ) const { return (m_ViewPlace.GetPoint()); } 00045 00047 const SPATREF::COORDREFSYS& GetCenterCRS ( 00048 ) const { return (m_ViewPlace.GetCoordRefSys()); } 00049 00051 double GetMapScale ( 00052 ) const { return (m_ViewPlace.GetSize()); } 00053 00055 const VIEWPLACE& GetPlace ( 00056 ) const { return (m_ViewPlace); } 00057 00059 const TRANS2D_AFFINE& GetTransViewDevice ( 00060 ) const { return (m_TransViewToDevice); } 00061 00063 const DPOINT2D& GetZoom ( 00064 ) const { return (m_Zoom); } 00065 00067 void ScaleZoom ( 00068 double scale 00069 ) { m_Zoom *= scale; } 00070 00072 void SetCenterPoint ( 00073 const SPATREF::COORDREFSYS& CenterCRS, 00074 const DPOINT2D& CenterPoint 00075 ) { m_ViewPlace.SetPoint(CenterCRS,CenterPoint); } 00076 00078 void SetCenterPoint ( 00079 const DPOINT2D& CenterPoint 00080 ) { m_ViewPlace.SetPoint(CenterPoint); } 00081 00083 void SetMapScale ( 00084 double MapScale 00085 ) { m_ViewPlace.SetSize(MapScale); } 00086 00088 void SetPlace ( 00089 const VIEWPLACE& ViewPlace 00090 ) { m_ViewPlace = ViewPlace; } 00091 00093 void SetTransViewDevice ( 00094 const TRANS2D_AFFINE& TransViewDevice 00095 ) { m_TransViewToDevice = TransViewDevice; } 00096 00098 void SetZoom ( 00099 double zoom 00100 ) { m_Zoom.x = m_Zoom.y = zoom; } 00101 00103 void SetZoom ( 00104 const DPOINT2D& zoom 00105 ) { m_Zoom = zoom; } 00106 00108 void ValidateZoom ( 00109 bool AllowDifferXY 00110 ); 00111 00112 private: 00113 #ifndef GENERATING_DOXYGEN_OUTPUT 00114 VIEWPLACE m_ViewPlace; 00115 TRANS2D_AFFINE m_TransViewToDevice; // Transformation between view and device 00116 DPOINT2D m_Zoom; // Zoom factor, full view = 1.0 00117 #endif // GENERATING_DOXYGEN_OUTPUT 00118 }; 00119 00120 //=================================================================================================================== 00121 } // End namespace GRE 00122 00123 #endif // INC_GRE_VIEWPOS_H
1.6.1