//--------------------------------------------------------- CVIEW_Map_Control::CVIEW_Map_Control(CVIEW_Map *pParent, CWKSP_Map *pMap) : wxPanel(pParent, -1, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE) { SYS_Set_Color_BG_Window(this); m_pParent = (CVIEW_Map *)pParent; m_pMap = pMap; m_Mode = -1; Set_Mode(MAP_MODE_ZOOM); m_Drag_Mode = TOOL_INTERACTIVE_DRAG_NONE; }
//--------------------------------------------------------- CVIEW_Map::CVIEW_Map(CWKSP_Map *pMap, int Frame_Width) : CVIEW_Base(ID_VIEW_MAP, pMap->Get_Name(), ID_IMG_WND_MAP, CVIEW_Map::_Create_Menu(), LNG("[CAP] Map")) { SYS_Set_Color_BG_Window(this); m_pMap = pMap; m_pControl = new CVIEW_Map_Control(this, m_pMap); m_pRuler_X1 = new CVIEW_Ruler(this, RULER_HORIZONTAL|RULER_MODE_NORMAL|RULER_TICKATBOTTOM); m_pRuler_X2 = new CVIEW_Ruler(this, RULER_HORIZONTAL|RULER_MODE_SCALE ); m_pRuler_Y1 = new CVIEW_Ruler(this, RULER_VERTICAL |RULER_MODE_NORMAL|RULER_DESCENDING|RULER_TICKATBOTTOM); m_pRuler_Y2 = new CVIEW_Ruler(this, RULER_VERTICAL |RULER_MODE_SCALE |RULER_DESCENDING); m_Ruler_Size = 20; Ruler_Set_Width(Frame_Width); }
//--------------------------------------------------------- void CVIEW_ScatterPlot::_On_Construction(void) { SYS_Set_Color_BG_Window(this); //----------------------------------------------------- if( m_pGrid ) { m_Parameters.Add_Grid("", "GRID" , _TL("Grid"), _TL(""), PARAMETER_INPUT, false ); m_Parameters.Add_Shapes("", "POINTS" , _TL("Points"), _TL(""), PARAMETER_INPUT, SHAPE_TYPE_Point ); m_Parameters.Add_Table_Field("POINTS", "FIELD" , _TL("Attribute"), _TL("") ); m_Parameters.Add_Choice("", "CMP_WITH" , _TL("Compare with..."), _TL(""), CSG_String::Format("%s|%s|", _TL("another grid"), _TL("points") ), 0 ); m_Parameters.Add_Choice("POINTS", "RESAMPLING", _TL("Resampling"), _TL(""), CSG_String::Format("%s|%s|%s|%s", _TL("Nearest Neighbour"), _TL("Bilinear Interpolation"), _TL("Bicubic Spline Interpolation"), _TL("B-Spline Interpolation") ), 3 ); } else if( m_pGrids ) { CSG_String sChoices; for(int i=0; i<m_pGrids->Get_Grid_Count(); i++) { sChoices.Append(m_pGrids->Get_Grid_Name(i, SG_GRIDS_NAME_GRID) + "|"); } m_Parameters.Add_Choice("", "BAND_X", "X", _TL(""), sChoices, 0); m_Parameters.Add_Choice("", "BAND_Y", "Y", _TL(""), sChoices, 1); } else if( m_pTable ) { CSG_String sChoices; for(int i=0; i<m_pTable->Get_Field_Count(); i++) { sChoices.Append(CSG_String::Format("%s|", m_pTable->Get_Field_Name(i))); } m_Parameters.Add_Choice("", "FIELD_X", "X", _TL(""), sChoices, 0); m_Parameters.Add_Choice("", "FIELD_Y", "Y", _TL(""), sChoices, 1); } //----------------------------------------------------- // m_Parameters.Add_Parameters("", "OPTIONS", _TL("Options"), _TL("")); m_Options.Add_Int("", "SAMPLES_MAX", _TL("Maximimum Number of Samples"), _TL(""), 100000, 0, true ); m_Options.Add_Bool("", "REG_SHOW" , _TL("Show Regression"), _TL(""), true ); m_Options.Add_String("REG_SHOW", "REG_FORMULA", _TL("Regression Formula"), _TL(""), "a + b * x" ); m_Options.Add_Color("REG_SHOW", "REG_COLOR" , _TL("Line Colour"), _TL(""), SG_COLOR_RED ); m_Options.Add_Int("REG_SHOW", "REG_SIZE" , _TL("Line Size"), _TL(""), 0, 0, true ); m_Options.Add_Info_String("REG_SHOW", "REG_INFO" , _TL("Regression Details"), _TL(""), _TL(""), true ); m_Options.Add_Choice("", "DISPLAY" , _TL("Display Type"), _TL(""), CSG_String::Format("%s|%s", _TL("Points"), _TL("Density") ), m_pGrid || m_pGrids ? 1 : 0 ); m_Options.Add_Int("DISPLAY", "DENSITY_RES" , _TL("Display Resolution"), _TL(""), 50, 10, true ); CSG_Colors Colors(7, SG_COLORS_RAINBOW); Colors.Set_Color(0, 255, 255, 255); Colors.Set_Count(100); m_Options.Add_Colors("DISPLAY", "DENSITY_PAL" , _TL("Colors"), _TL(""), &Colors ); m_Options.Add_Bool("DISPLAY", "DENSITY_LEG" , _TL("Show Legend"), _TL(""), true ); //----------------------------------------------------- m_Parameters.Set_Callback_On_Parameter_Changed(&Scatter_Plot_On_Parameter_Changed); }