1 2 /////////////////////////////////////////////////////////// 3 // // 4 // SAGA // 5 // // 6 // System for Automated Geoscientific Analyses // 7 // // 8 // Application Programming Interface // 9 // // 10 // Library: SAGA_GDI // 11 // // 12 //-------------------------------------------------------// 13 // // 14 // sgdi_helper.h // 15 // // 16 // Copyright (C) 2009 by // 17 // Olaf Conrad // 18 // // 19 //-------------------------------------------------------// 20 // // 21 // This file is part of 'SAGA - System for Automated // 22 // Geoscientific Analyses'. SAGA is free software; you // 23 // can redistribute it and/or modify it under the terms // 24 // of the GNU General Public License as published by the // 25 // Free Software Foundation, either version 2 of the // 26 // License, or (at your option) any later version. // 27 // // 28 // SAGA is distributed in the hope that it will be // 29 // useful, but WITHOUT ANY WARRANTY; without even the // 30 // implied warranty of MERCHANTABILITY or FITNESS FOR A // 31 // PARTICULAR PURPOSE. See the GNU General Public // 32 // License for more details. // 33 // // 34 // You should have received a copy of the GNU General // 35 // Public License along with this program; if not, see // 36 // <http://www.gnu.org/licenses/>. // 37 // // 38 //-------------------------------------------------------// 39 // // 40 // e-mail: oconrad@saga-gis.org // 41 // // 42 // contact: Olaf Conrad // 43 // Institute of Geography // 44 // University of Hamburg // 45 // Germany // 46 // // 47 /////////////////////////////////////////////////////////// 48 49 //--------------------------------------------------------- 50 #ifndef HEADER_INCLUDED__SAGA_GDI_sgdi_helper_H 51 #define HEADER_INCLUDED__SAGA_GDI_sgdi_helper_H 52 53 54 /////////////////////////////////////////////////////////// 55 // // 56 // // 57 // // 58 /////////////////////////////////////////////////////////// 59 60 //--------------------------------------------------------- 61 #include "sgdi_core.h" 62 63 //--------------------------------------------------------- 64 #include <wx/dc.h> 65 66 67 /////////////////////////////////////////////////////////// 68 // // 69 // // 70 // // 71 /////////////////////////////////////////////////////////// 72 73 //--------------------------------------------------------- 74 enum 75 { 76 EDGE_STYLE_SIMPLE, 77 EDGE_STYLE_STATIC, 78 EDGE_STYLE_SUNKEN, 79 EDGE_STYLE_RAISED 80 }; 81 82 //--------------------------------------------------------- 83 SGDI_API_DLL_EXPORT void Draw_Edge (wxDC &dc, int Edge_Style, int ax, int ay, int bx, int by); 84 SGDI_API_DLL_EXPORT void Draw_Edge (wxDC &dc, int Edge_Style, wxRect r); 85 86 //--------------------------------------------------------- 87 SGDI_API_DLL_EXPORT void Draw_Rect (wxDC &dc, wxColour Color, int ax, int ay, int bx, int by); 88 SGDI_API_DLL_EXPORT void Draw_Rect (wxDC &dc, wxColour Color, wxRect r); 89 90 //--------------------------------------------------------- 91 SGDI_API_DLL_EXPORT void Draw_FillRect (wxDC &dc, wxColour Color, int ax, int ay, int bx, int by); 92 SGDI_API_DLL_EXPORT void Draw_FillRect (wxDC &dc, wxColour Color, wxRect r); 93 94 95 /////////////////////////////////////////////////////////// 96 // // 97 // // 98 // // 99 /////////////////////////////////////////////////////////// 100 101 //--------------------------------------------------------- 102 #define TEXTALIGN_LEFT 0x01 103 #define TEXTALIGN_XCENTER 0x02 104 #define TEXTALIGN_RIGHT 0x04 105 #define TEXTALIGN_TOP 0x08 106 #define TEXTALIGN_YCENTER 0x10 107 #define TEXTALIGN_BOTTOM 0x20 108 109 #define TEXTALIGN_TOPLEFT (TEXTALIGN_TOP |TEXTALIGN_LEFT) 110 #define TEXTALIGN_TOPCENTER (TEXTALIGN_TOP |TEXTALIGN_XCENTER) 111 #define TEXTALIGN_TOPRIGHT (TEXTALIGN_TOP |TEXTALIGN_RIGHT) 112 #define TEXTALIGN_CENTERLEFT (TEXTALIGN_YCENTER|TEXTALIGN_LEFT) 113 #define TEXTALIGN_CENTER (TEXTALIGN_YCENTER|TEXTALIGN_XCENTER) 114 #define TEXTALIGN_CENTERRIGHT (TEXTALIGN_YCENTER|TEXTALIGN_RIGHT) 115 #define TEXTALIGN_BOTTOMLEFT (TEXTALIGN_BOTTOM |TEXTALIGN_LEFT) 116 #define TEXTALIGN_BOTTOMCENTER (TEXTALIGN_BOTTOM |TEXTALIGN_XCENTER) 117 #define TEXTALIGN_BOTTOMRIGHT (TEXTALIGN_BOTTOM |TEXTALIGN_RIGHT) 118 119 #define TEXTEFFECT_NONE 0x00 120 #define TEXTEFFECT_TOP 0x01 121 #define TEXTEFFECT_TOPLEFT 0x02 122 #define TEXTEFFECT_LEFT 0x04 123 #define TEXTEFFECT_BOTTOMLEFT 0x08 124 #define TEXTEFFECT_BOTTOM 0x10 125 #define TEXTEFFECT_BOTTOMRIGHT 0x20 126 #define TEXTEFFECT_RIGHT 0x40 127 #define TEXTEFFECT_TOPRIGHT 0x80 128 #define TEXTEFFECT_FRAME (TEXTEFFECT_TOPLEFT|TEXTEFFECT_BOTTOMLEFT|TEXTEFFECT_BOTTOMRIGHT|TEXTEFFECT_TOPRIGHT) 129 130 //--------------------------------------------------------- 131 SGDI_API_DLL_EXPORT void Draw_Text (wxDC &dc, int Align, int x, int y, const wxString &Text); 132 SGDI_API_DLL_EXPORT void Draw_Text (wxDC &dc, int Align, int x, int y, double Angle, const wxString &Text); 133 134 SGDI_API_DLL_EXPORT void Draw_Text (wxDC &dc, int Align, int x, int y , const wxString &Text, int Effect, wxColour Effect_Color, int Effect_Size = 1); 135 SGDI_API_DLL_EXPORT void Draw_Text (wxDC &dc, int Align, int x, int y, double Angle, const wxString &Text, int Effect, wxColour Effect_Color, int Effect_Size = 1); 136 137 138 /////////////////////////////////////////////////////////// 139 // // 140 // // 141 // // 142 /////////////////////////////////////////////////////////// 143 144 //--------------------------------------------------------- 145 #define SCALE_HORIZONTAL 0x00 146 #define SCALE_VERTICAL 0x01 147 148 //--------------------------------------------------------- 149 #define SCALE_TICK_NONE 0x00 150 #define SCALE_TICK_TOP 0x01 151 #define SCALE_TICK_BOTTOM 0x02 152 153 //--------------------------------------------------------- 154 #define SCALE_STYLE_DEFAULT 0x00 155 #define SCALE_STYLE_DESCENDENT 0x02 156 #define SCALE_STYLE_LINECONN 0x04 157 #define SCALE_STYLE_BLACKWHITE 0x08 158 #define SCALE_STYLE_GLOOMING 0x10 159 #define SCALE_STYLE_UNIT_ABOVE 0x20 160 #define SCALE_STYLE_UNIT_BELOW 0x40 161 162 //--------------------------------------------------------- 163 SGDI_API_DLL_EXPORT void Draw_Scale (wxDC &dc, const wxRect &r, double min_Value, double max_Value, int Orientation = SCALE_HORIZONTAL, int Tick = SCALE_TICK_NONE, int Style = SCALE_STYLE_DEFAULT, const wxString &Unit = ""); 164 SGDI_API_DLL_EXPORT void Draw_Scale (wxDC &dc, const wxRect &r, double min_Value, double max_Value, bool bHorizontal, bool bAscendent, bool bTickAtTop); 165 166 SGDI_API_DLL_EXPORT bool Draw_Ruler (wxDC &dc, const wxRect &r, bool bHorizontal, double zMin, double zMax, bool bAscendent = true, int FontSize = 7, const wxColour &Colour = wxColour(127, 127, 127)); 167 168 169 /////////////////////////////////////////////////////////// 170 // // 171 // // 172 // // 173 /////////////////////////////////////////////////////////// 174 175 //--------------------------------------------------------- 176 #endif // #ifndef HEADER_INCLUDED__SAGA_GDI_sgdi_helper_H 177