//---------------------------------------------------------
bool CVIEW_ScatterPlot::_Initialize_Table(void)
{
	int	xField	= m_Parameters("FIELD_X")->asInt();
	int	yField	= m_Parameters("FIELD_Y")->asInt();

	CHECK_DATA(m_pTable);

	if( !m_pTable || xField < 0 || xField >= m_pTable->Get_Field_Count() || yField < 0 || yField >= m_pTable->Get_Field_Count() )
	{
		return( false );
	}

	int	maxSamples	= m_Options("SAMPLES_MAX")->asInt();
	double	Step	= maxSamples > 0 && m_pTable->Get_Count() > maxSamples ? m_pTable->Get_Count() / maxSamples : 1.0;

	m_sTitle.Printf("%s: [%s]", _TL("Scatterplot"), m_pTable->Get_Name());

	m_sX.Printf("%s", m_pTable->Get_Field_Name(xField));
	m_sY.Printf("%s", m_pTable->Get_Field_Name(yField));

	for(double i=0; i<m_pTable->Get_Record_Count() && PROGRESSBAR_Set_Position(i, m_pTable->Get_Record_Count()); i+=Step)
	{
		CSG_Table_Record	*pRecord	= m_pTable->Get_Record((int)i);

		if( !pRecord->is_NoData(xField) && !pRecord->is_NoData(yField) )
		{
			m_Trend.Add_Data(pRecord->asDouble(xField), pRecord->asDouble(yField));
		}
	}

	return( true );
}
Beispiel #2
0
//---------------------------------------------------------
void CWKSP_TIN::On_Create_Parameters(void)
{
	CWKSP_Layer::On_Create_Parameters();

	//-----------------------------------------------------
	// General...

	m_Parameters.Add_Choice(
		m_Parameters("NODE_METRIC")		, "METRIC_ATTRIB"			, _TL("Attribute"),
		_TL(""),
		_TL("")
	);

	//-----------------------------------------------------
	m_Parameters.Add_Value(
		m_Parameters("NODE_DISPLAY")	, "DISPLAY_POINTS"			, _TL("Show Nodes"),
		_TL(""),
		PARAMETER_TYPE_Bool, false
	);

	//-----------------------------------------------------
	m_Parameters.Add_Value(
		m_Parameters("NODE_DISPLAY")	, "DISPLAY_EDGES"			, _TL("Show Edges"),
		_TL(""),
		PARAMETER_TYPE_Bool, true
	);

	//-----------------------------------------------------
	m_Parameters.Add_Value(
		m_Parameters("NODE_DISPLAY")	, "DISPLAY_TRIANGES"		, _TL("Show Filled"),
		_TL(""),
		PARAMETER_TYPE_Bool, true
	);
}
//---------------------------------------------------------
void CWKSP_Shapes_Point::On_DataObject_Changed(void)
{
	CWKSP_Shapes::On_DataObject_Changed();

	AttributeList_Set(m_Parameters("SIZE_ATTRIB")			, true);
	AttributeList_Set(m_Parameters("LABEL_ANGLE_ATTRIB")	, true);
}
//---------------------------------------------------------
void CWKSP_Data_Item::On_Create_Parameters(void)
{
	CWKSP_Base_Item::On_Create_Parameters();

	//-----------------------------------------------------
	// Nodes...

	m_Parameters.Add_Node(NULL, "NODE_GENERAL"  , _TL("General"  ), _TL(""));


	//-----------------------------------------------------
	// General...

	m_Parameters.Add_String(
		m_Parameters("NODE_GENERAL"), "OBJECT_NAME"   , _TL("Name")			, _TL(""),
		m_pObject->Get_Name()
	);

	m_Parameters.Add_String(
		m_Parameters("NODE_GENERAL"), "OBJECT_DESC"   , _TL("Description")	, _TL(""),
		m_pObject->Get_Description(), true
	);

	m_Parameters.Add_Range(
		m_Parameters("NODE_GENERAL"), "GENERAL_NODATA", _TL("No Data")		, _TL("")
	);
}
//---------------------------------------------------------
void CWKSP_TIN::_Draw_Triangles(CWKSP_Map_DC &dc_Map)
{
	if(	m_Parameters("DISPLAY_TRIANGES")->asBool() && dc_Map.IMG_Draw_Begin(m_Parameters("DISPLAY_TRANSPARENCY")->asDouble() / 100.0) )
	{
		for(int iTriangle=0; iTriangle<asTIN()->Get_Triangle_Count(); iTriangle++)
		{
			CSG_TIN_Triangle	*pTriangle	= asTIN()->Get_Triangle(iTriangle);

			if( dc_Map.m_rWorld.Intersects(pTriangle->Get_Extent()) != INTERSECTION_None )
			{
				TPoint	p[3];

				for(int iNode=0; iNode<3; iNode++)
				{
					CSG_TIN_Node	*pNode	= pTriangle->Get_Node(iNode);
					TSG_Point_Int	Point	= dc_Map.World2DC(pNode->Get_Point());

					p[iNode].x	= Point.x;
					p[iNode].y	= Point.y;
					p[iNode].z	= pNode->asDouble(m_fValue);
				}

				_Draw_Triangle(dc_Map, p);
			}
		}

		dc_Map.IMG_Draw_End();
	}
}
//---------------------------------------------------------
void CWKSP_Module_Manager::_Config_Read(void)
{
    bool		bValue;
    long		lValue;
    wxString	sValue;

    if( CONFIG_Read(wxT("/MODULES"), wxT("BEEP")		, bValue) )
    {
        m_Parameters("BEEP")		->Set_Value(bValue);
    }

    if( CONFIG_Read(wxT("/MODULES"), wxT("START_LOGO")	, lValue) )
    {
        m_Parameters("START_LOGO")	->Set_Value((int)lValue);
    }

    if( CONFIG_Read(wxT("/MODULES"), wxT("PROC_FREQ")	, lValue) )
    {
        m_Parameters("PROC_FREQ")	->Set_Value((int)lValue);
    }

    for(int i=0; CONFIG_Read(CFG_LIBS, wxString::Format(CFG_LIBF, i), sValue); i++)
    {
        Open(sValue);
    }

    m_pMenu->Update();
}
//---------------------------------------------------------
bool CVIEW_ScatterPlot::_Update_Data(void)
{
	bool	bResult;

	m_Trend.Clr_Data();

	m_Parameters.DataObjects_Check();

	if( m_pGrid )
	{
		bResult	= m_Parameters("CMP_WITH")->asInt() == 0
			? _Initialize_Grids(m_pGrid, m_Parameters("GRID")->asGrid())
			: _Initialize_Shapes();
	}
	else if( m_pGrids )
	{
		bResult	= _Initialize_Grids(
			m_pGrids->Get_Grid_Ptr(m_Parameters("BAND_X")->asInt()),
			m_pGrids->Get_Grid_Ptr(m_Parameters("BAND_Y")->asInt())
		);
	}
	else // if( m_pTable )
	{
		bResult	= _Initialize_Table();
	}

	PROCESS_Set_Okay(true);

	//-----------------------------------------------------
	if( bResult )
	{
		CSG_String	Info(_TL("Regression"));

		if( !m_Trend.Set_Formula(m_Options("REG_FORMULA")->asString()) || !m_Trend.Get_Trend() )
		{
			Info	+= CSG_String::Format(" %s!\n", _TL("failed"));
			Info	+= m_Trend.Get_Error();
		}
		else
		{
			Info	+= CSG_String::Format(" %s\n", _TL("Details"));
			Info	+= m_Trend.Get_Formula(SG_TREND_STRING_Complete);
		}

		m_Options("REG_INFO")->Set_Value(Info);

		_Initialize_Count();

		Refresh();

		return( true );
	}

	Refresh();

	return( false );
}
//---------------------------------------------------------
void CWKSP_Data_Item::On_Parameters_Changed(void)
{
	m_pObject->Set_Name       (m_Parameters("OBJECT_NAME")->asString());
	m_pObject->Set_Description(m_Parameters("OBJECT_DESC")->asString());

	m_pObject->Set_NoData_Value_Range(
		m_Parameters("GENERAL_NODATA")->asRange()->Get_LoVal(),
		m_Parameters("GENERAL_NODATA")->asRange()->Get_HiVal()
	);
}
Beispiel #9
0
//---------------------------------------------------------
void CWKSP_PointCloud::On_Parameters_Changed(void)
{
	if( (m_Color_Field = m_Parameters("COLORS_ATTRIB")->asInt()) >= m_pPointCloud->Get_Field_Count() )
	{
		m_Color_Field	= -1;
	}

	long	DefColor	= m_Parameters("UNISYMBOL_COLOR")->asColor();
	m_Color_Pen			= wxColour(SG_GET_R(DefColor), SG_GET_G(DefColor), SG_GET_B(DefColor));

	m_PointSize			= m_Parameters("DISPLAY_SIZE")	->asInt();
}
//---------------------------------------------------------
void CWKSP_Data_Item::On_DataObject_Changed(void)
{
	m_Parameters.Set_Name(CSG_String::Format(SG_T("%02d. %s"), 1 + Get_ID(), m_pObject->Get_Name()));

	m_Parameters("OBJECT_NAME")->Set_Value(m_pObject->Get_Name());
	m_Parameters("OBJECT_DESC")->Set_Value(m_pObject->Get_Description());

	m_Parameters("GENERAL_NODATA")->asRange()->Set_Range(
		m_pObject->Get_NoData_Value(),
		m_pObject->Get_NoData_hiValue()
	);
}
//---------------------------------------------------------
void CWKSP_TIN::On_Parameters_Changed(void)
{
	CWKSP_Layer::On_Parameters_Changed();

	if( (m_fValue = m_Parameters("METRIC_ATTRIB")->asInt()) >= asTIN()->Get_Field_Count() )
	{
		m_fValue	= -1;
	}

	long	DefColor	= m_Parameters("UNISYMBOL_COLOR")->asColor();
	m_Color_Pen			= wxColour(SG_GET_R(DefColor), SG_GET_G(DefColor), SG_GET_B(DefColor));
}
//---------------------------------------------------------
void CWKSP_Module_Manager::_Config_Write(void)
{
    CONFIG_Write(wxT("/MODULES")	, wxT("BEEP")		,		m_Parameters("BEEP")		->asBool());
    CONFIG_Write(wxT("/MODULES")	, wxT("START_LOGO")	, (long)m_Parameters("START_LOGO")	->asInt());
    CONFIG_Write(wxT("/MODULES")	, wxT("PROC_FREQ")	, (long)m_Parameters("PROC_FREQ")	->asInt());

    CONFIG_Delete(CFG_LIBS);

    for(int i=0; i<Get_Count(); i++)
    {
        CONFIG_Write(CFG_LIBS, wxString::Format(CFG_LIBF, i), Get_Library(i)->Get_File_Name());
    }
}
//---------------------------------------------------------
inline void CWKSP_Shapes_Point::Draw_Initialize(CWKSP_Map_DC &dc_Map)
{
	dc_Map.dc.SetBrush	(m_Brush);
	dc_Map.dc.SetPen	(m_Pen);

	m_Sel_Color_Fill	= Get_Color_asWX(m_Parameters("SEL_COLOR_FILL")->asInt());
}
Beispiel #14
0
//---------------------------------------------------------
void CWKSP_PointCloud::_Draw_Points(CWKSP_Map_DC &dc_Map)
{
	m_Aggregation	= m_Parameters("COLORS_AGGREGATE")->asInt();

	if( m_Aggregation != 1 )
	{
		m_Z.Create(SG_DATATYPE_Double, dc_Map.m_rDC.GetWidth(), dc_Map.m_rDC.GetHeight());
		m_N.Create(SG_DATATYPE_Int   , dc_Map.m_rDC.GetWidth(), dc_Map.m_rDC.GetHeight());
	}

	//-----------------------------------------------------
	for(int i=0; i<m_pPointCloud->Get_Count(); i++)
	{
		TSG_Point_Z	Point	= m_pPointCloud->Get_Point(i);

		if( dc_Map.m_rWorld.Contains(Point.x, Point.y) )
		{
			int		Color;
			int		x	= (int)dc_Map.xWorld2DC(Point.x);
			int		y	= (int)dc_Map.yWorld2DC(Point.y);

			m_pClassify->Get_Class_Color_byValue(m_pPointCloud->Get_Value(i, m_Color_Field), Color);

			_Draw_Point(dc_Map, x, y, Point.z, Color, m_PointSize);
		}
	}
}
Beispiel #15
0
//---------------------------------------------------------
CWKSP_PointCloud::CWKSP_PointCloud(CSG_PointCloud *pPointCloud)
	: CWKSP_Layer(pPointCloud)
{
	m_pPointCloud	= pPointCloud;

	m_Edit_Attributes.Destroy();
	m_Edit_Attributes.Add_Field(LNG("[CAP] Name") , SG_DATATYPE_String);
	m_Edit_Attributes.Add_Field(LNG("[CAP] Value"), SG_DATATYPE_String);

	Create_Parameters();

	//-----------------------------------------------------
	m_Parameters("COLORS_TYPE")		->Set_Value(CLASSIFY_METRIC);
	m_Parameters("COLORS_ATTRIB")	->Set_Value(2);

	On_Parameter_Changed(&m_Parameters, m_Parameters("COLORS_ATTRIB"));

	Parameters_Changed();
}
//---------------------------------------------------------
void CWKSP_Module_Manager::Parameters_Changed(void)
{
	CWKSP_Base_Item::Parameters_Changed();

	if( m_Parameters("SAVE_CONFIG")->asBool() == false )
	{
		CONFIG_Write("/MODULES", &m_Parameters);
	}

	CONFIG_Do_Save(m_Parameters("SAVE_CONFIG")->asBool());

	g_pSAGA->Process_Set_Frequency(m_Parameters("PROCESS_UPDATE")->asInt());

#ifdef _OPENMP
	SG_OMP_Set_Max_Num_Threads(m_Parameters("OMP_THREADS_MAX")->asInt());
#endif

	m_pMenu_Modules->Update();
}
//---------------------------------------------------------
bool CVIEW_ScatterPlot::_Initialize_Shapes(void)
{
	CSG_Shapes	*pPoints	= m_Parameters("POINTS")->asShapes();
	int			Field		= m_Parameters("FIELD" )->asInt();

	TSG_Grid_Resampling	Resampling;

	switch( m_Parameters("RESAMPLING")->asInt() )
	{
	default: Resampling = GRID_RESAMPLING_NearestNeighbour; break;
	case  1: Resampling = GRID_RESAMPLING_Bilinear        ; break;
	case  2: Resampling = GRID_RESAMPLING_BicubicSpline   ; break;
	case  3: Resampling = GRID_RESAMPLING_BSpline         ; break;
	}

	CHECK_DATA(m_pGrid);
	CHECK_DATA(pPoints);

	if( !m_pGrid || !pPoints || Field < 0 || Field >= pPoints->Get_Field_Count() )
	{
		return( false );
	}

	m_sTitle.Printf("%s: [%s/%s]", _TL("Scatterplot"), m_pGrid->Get_Name(), pPoints->Get_Name());

	m_sX.Printf("%s", m_pGrid->Get_Name());
	m_sY.Printf("%s", pPoints->Get_Field_Name(Field));

	int	maxSamples	= m_Options("SAMPLES_MAX")->asInt();
	double	x, Step	= maxSamples > 0 && pPoints->Get_Count() > maxSamples ? pPoints->Get_Count() / maxSamples : 1.0;

	for(double i=0; i<pPoints->Get_Count() && PROGRESSBAR_Set_Position(i, pPoints->Get_Count()); i+=Step)
	{
		CSG_Shape	*pShape	= pPoints->Get_Shape((int)i);

		if( !pShape->is_NoData(Field) && m_pGrid->Get_Value(pShape->Get_Point(0), x, Resampling) )
		{
			m_Trend.Add_Data(x, pShape->asDouble(Field));
		}
	}

	return( true );
}
Beispiel #18
0
//---------------------------------------------------------
wxString CWKSP_Map_Graticule::Get_Name(void)
{
	wxString	Name(m_Parameters("NAME")->asString());

	if( !m_bShow )
	{
		return( "[" + Name + "]" );
	}

	return( Name );
}
//---------------------------------------------------------
void CWKSP_TIN::On_Draw(CWKSP_Map_DC &dc_Map, int Flags)
{
	if( Get_Extent().Intersects(dc_Map.m_rWorld) != INTERSECTION_None )
	{
		if( m_fValue >= 0 )
		{
			_Draw_Triangles(dc_Map);
		}

		if( m_Parameters("DISPLAY_EDGES" )->asBool() )
		{
			_Draw_Edges    (dc_Map);
		}

		if( m_Parameters("DISPLAY_POINTS")->asBool() )
		{
			_Draw_Points   (dc_Map);
		}
	}
}
//---------------------------------------------------------
CView_Map_3DPanel::CView_Map_3DPanel(wxWindow *pParent, class CWKSP_Map *pMap)
	: CSG_3DView_Panel(pParent, &m_Map)
{
	m_pDEM		= NULL;
	m_pMap		= pMap;

	m_DEM_Res	= 100;
	m_Map_Res	= 400;

	m_Parameters("DRAW_BOX")->Set_Value(false);
}
Beispiel #21
0
//---------------------------------------------------------
void CWKSP_PointCloud::On_DataObject_Changed(void)
{
	int			i;
	wxString	sChoices;

	for(i=0; i<m_pPointCloud->Get_Field_Count(); i++)
	{
		sChoices.Append(wxString::Format(wxT("%s|"), m_pPointCloud->Get_Field_Name(i)));
	}

	m_Parameters("COLORS_ATTRIB")->asChoice()->Set_Items(sChoices);
}
//---------------------------------------------------------
bool CWKSP_Module_Manager::Initialise(void)
{
	CONFIG_Read("/MODULES", &m_Parameters);

	CONFIG_Do_Save(m_Parameters("SAVE_CONFIG")->asBool());

	g_pSAGA->Process_Set_Frequency(m_Parameters("PROCESS_UPDATE")->asInt());

#ifdef _OPENMP
	SG_OMP_Set_Max_Num_Threads(m_Parameters("OMP_THREADS_MAX")->asInt());
#endif

	//-----------------------------------------------------
	wxString	Library;

	for(int i=0; CONFIG_Read(CFG_LIBS, wxString::Format(CFG_LIBF, i), Library); i++)
	{
		if( !wxFileExists(Library) )
		{
			wxFileName	fn(Library);	fn.MakeAbsolute(g_pSAGA->Get_App_Path());

			Library	= fn.GetFullPath();
		}

		SG_Get_Module_Library_Manager().Add_Library(Library);
	}

	if( SG_Get_Module_Library_Manager().Get_Count() == 0 )
	{
#if defined(_SAGA_LINUX)
	if( (SG_Get_Module_Library_Manager().Add_Directory(CSG_String(MODULE_LIBRARY_PATH), false)
	   + SG_Get_Module_Library_Manager().Add_Directory(SG_File_Make_Path(CSG_String(SHARE_PATH), SG_T("toolchains")), false)) == 0 )
#endif
		SG_Get_Module_Library_Manager().Add_Directory(g_pSAGA->Get_App_Path(), true);
	}

	_Update(false);

	return( true );
}
Beispiel #23
0
//---------------------------------------------------------
bool CWKSP_Map_Graticule::Get_Graticule(const CSG_Rect &Extent)
{
	bool	bResult	= false;

	m_Graticule  .Create(SHAPE_TYPE_Line );
	m_Coordinates.Create(SHAPE_TYPE_Point);

	CSG_Tool	*pTool	= SG_Get_Tool_Library_Manager().Get_Tool("pj_proj4", 14);

	if(	pTool && Get_Map()->Get_Projection().is_Okay() )
	{
		SG_UI_Msg_Lock     (true);
		SG_UI_Progress_Lock(true);

		pTool->Settings_Push();

		if( pTool->Set_Parameter("XMIN"      , Extent.Get_XMin())
		&&  pTool->Set_Parameter("XMAX"      , Extent.Get_XMax())
		&&  pTool->Set_Parameter("YMIN"      , Extent.Get_YMin())
		&&  pTool->Set_Parameter("YMAX"      , Extent.Get_YMax())
		&&  pTool->Set_Parameter("INTERVAL"  , m_Parameters("INTERVAL"))
		&&  pTool->Set_Parameter("FIXED"     , m_Parameters("FIXED"))
		&&  pTool->Set_Parameter("FITTED"    , m_Parameters("FITTED"))
		&&  pTool->Set_Parameter("RESOLUTION", m_Parameters("RESOLUTION"))
		&&  pTool->Set_Parameter("GRATICULE" , &m_Graticule)
		&&  pTool->Set_Parameter("COORDS"    , &m_Coordinates)
		&&  pTool->Set_Parameter("CRS_PROJ4" , Get_Map()->Get_Projection().Get_Proj4())
		&&  pTool->On_Before_Execution() && pTool->Execute() )
		{
			bResult	= true;
		}

		pTool->Settings_Pop();

		SG_UI_Msg_Lock     (false);
		SG_UI_Progress_Lock(false);
	}

	return( bResult );
}
//---------------------------------------------------------
void CWKSP_Shapes::_Edit_Snap_Point(CSG_Point &Point, double ClientToWorld)
{
	if( m_Edit_pShape )
	{
		CSG_Parameter_Shapes_List	*pList	= m_Parameters("EDIT_SNAP_LIST")->asShapesList();

		if( pList->Get_Count() > 0 )
		{
			int			i;
			double		snap_Dist, max_Dist;
			CSG_Point	snap_Point;

			max_Dist	= m_Parameters("EDIT_SNAP_DIST")->asDouble() * ClientToWorld;
			snap_Dist	= max_Dist + 1.0;

			for(i=0; i<pList->Get_Count(); i++)
			{
				_Edit_Snap_Point(Point, snap_Point, snap_Dist, pList->asShapes(i), false);
			}

			if( snap_Dist <= max_Dist )
			{
				Point	= snap_Point;
			}
			else if( Get_Shapes()->Get_Type() == SHAPE_TYPE_Line || Get_Shapes()->Get_Type() == SHAPE_TYPE_Polygon )
			{
				for(i=0; i<pList->Get_Count(); i++)
				{
					_Edit_Snap_Point(Point, snap_Point, snap_Dist, pList->asShapes(i), true);
				}

				if( snap_Dist <= max_Dist )
				{
					Point	= snap_Point;
				}
			}
		}
	}
}
Beispiel #25
0
//---------------------------------------------------------
void CWKSP_TIN::On_DataObject_Changed(void)
{
	CWKSP_Layer::On_DataObject_Changed();

	wxString	sChoices;

	for(int i=0; i<Get_TIN()->Get_Field_Count(); i++)
	{
		sChoices.Append(wxString::Format(wxT("%s|"), Get_TIN()->Get_Field_Name(i)));
	}

	m_Parameters("METRIC_ATTRIB")->asChoice()->Set_Items(sChoices);
}
//---------------------------------------------------------
void CWKSP_TIN::On_DataObject_Changed(void)
{
	CSG_String	Choices;

	for(int i=0; i<asTIN()->Get_Field_Count(); i++)
	{
		Choices	+= asTIN()->Get_Field_Name(i) + '|';
	}

	m_Parameters("METRIC_ATTRIB")->asChoice()->Set_Items(Choices);

	//-----------------------------------------------------
	CWKSP_Layer::On_DataObject_Changed();
}
Beispiel #27
0
//---------------------------------------------------------
wxMenu * CWKSP_Map_Graticule::Get_Menu(void)
{
	wxMenu	*pMenu	= new wxMenu(m_Parameters("NAME")->asString());

	CMD_Menu_Add_Item(pMenu, false, ID_CMD_WKSP_ITEM_CLOSE);
	CMD_Menu_Add_Item(pMenu,  true, ID_CMD_MAPS_LAYER_SHOW);
	pMenu->AppendSeparator();
	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_MOVE_TOP);
	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_MOVE_UP);
	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_MOVE_DOWN);
	CMD_Menu_Add_Item(pMenu, false, ID_CMD_MAPS_MOVE_BOTTOM);

	return( pMenu );
}
//---------------------------------------------------------
void CWKSP_Shapes::Edit_Shape_Draw(CWKSP_Map_DC &dc_Map)
{
	int		iPart, iPoint;

	if( m_Edit_pShape )
	{
		for(iPart=0; iPart<m_Edit_pShape->Get_Part_Count(); iPart++)
		{
			for(iPoint=0; iPoint<m_Edit_pShape->Get_Point_Count(iPart); iPoint++)
			{
				_Edit_Shape_Draw_Point(dc_Map.dc, dc_Map.World2DC(m_Edit_pShape->Get_Point(iPoint, iPart)), false);
			}
		}

		if( m_Edit_iPart >= 0 && m_Edit_iPoint >= 0 )
		{
			_Edit_Shape_Draw_Point(dc_Map.dc, dc_Map.World2DC(m_Edit_pShape->Get_Point(m_Edit_iPoint, m_Edit_iPart)), true);
		}

		if( m_Parameters("EDIT_SNAP_LIST")->asShapesList()->Get_Count() > 0 )
		{
			iPoint	= m_Parameters("EDIT_SNAP_DIST")->asInt();

			dc_Map.dc.SetBrush(wxNullBrush);
			dc_Map.dc.SetPen  (*wxWHITE);
			dc_Map.dc.DrawCircle(1 + iPoint, 1 + iPoint, iPoint - 1);
			dc_Map.dc.DrawCircle(1 + iPoint, 1 + iPoint, iPoint + 1);

			dc_Map.dc.SetPen  (*wxBLACK);
			dc_Map.dc.DrawCircle(1 + iPoint, 1 + iPoint, iPoint);

			dc_Map.dc.SetBrush(*wxBLACK);
			dc_Map.dc.SetPen  (*wxBLACK);
			dc_Map.dc.DrawCircle(1 + iPoint, 1 + iPoint, 1);
		}
	}
}
Beispiel #29
0
//---------------------------------------------------------
void CWKSP_PointCloud::On_Create_Parameters(void)
{
	//-----------------------------------------------------
	// General...

	m_Parameters.Add_Choice(
		m_Parameters("NODE_COLORS")		, "COLORS_ATTRIB"			, LNG("[CAP] Attribute"),
		LNG(""),
		LNG("")
	);

	m_Parameters.Add_Choice(
		m_Parameters("NODE_COLORS")		, "COLORS_AGGREGATE"		, LNG("[CAP] Value Aggregation"),
		LNG(""),
		CSG_String::Format(SG_T("%s|%s|%s|%s|"),
			LNG("first value"),
			LNG("last value"),
			LNG("lowest z"),
			LNG("highest z")
		), 1
	);

	//-----------------------------------------------------
	m_Parameters.Add_Value(
		m_Parameters("NODE_DISPLAY")	, "DISPLAY_SIZE"			, LNG("[CAP] Point Size"),
		LNG(""),
		PARAMETER_TYPE_Int, 0, 0, true
	);

	//-----------------------------------------------------
	m_Parameters.Add_Value(
		m_Parameters("NODE_DISPLAY")	, "DISPLAY_TRANSPARENCY"	, LNG("[CAP] Transparency [%]"),
		LNG(""),
		PARAMETER_TYPE_Double, 0.0, 0.0, true, 100.0, true
	);

	//-----------------------------------------------------
	// Classification...

	((CSG_Parameter_Choice *)m_Parameters("COLORS_TYPE")->Get_Data())->Set_Items(
		wxString::Format(wxT("%s|%s|%s|%s|"),
			LNG("[VAL] Unique Symbol"),
			LNG("[VAL] Lookup Table"),
			LNG("[VAL] Graduated Color"),
			LNG("[VAL] RGB")
		)
	);

	m_Parameters("COLORS_TYPE")->Set_Value(CLASSIFY_METRIC);


	//-----------------------------------------------------
	DataObject_Changed((CSG_Parameters *)NULL);
}
Beispiel #30
0
//---------------------------------------------------------
wxString CWKSP_Map_Graticule::Get_Description(void)
{
	wxString	s;

	//-----------------------------------------------------
	s	+= wxString::Format("<h4>%s</h4>", _TL("Graticule"));

	s	+= "<table border=\"0\">";

	DESC_ADD_STR(_TL("Name"      ), m_Parameters("NAME")->asString());
	DESC_ADD_STR(_TL("Projection"), Get_Map()->Get_Projection().Get_Description().c_str());

	s	+= wxT("</table>");

	//-----------------------------------------------------
	return( s );
}