• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Get_NY函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Get_NY函数的典型用法代码示例。如果您正苦于以下问题:C++ Get_NY函数的具体用法?C++ Get_NY怎么用?C++ Get_NY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Get_NY函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Set_NoData_Value_Range

//---------------------------------------------------------
bool CSG_Grid::_Assign_Interpolated(CSG_Grid *pGrid, TSG_Grid_Interpolation Interpolation)
{
	int		x, y;
	double	xPosition, yPosition, z;

	Set_NoData_Value_Range(pGrid->Get_NoData_Value(), pGrid->Get_NoData_hiValue());

	for(y=0, yPosition=Get_YMin(); y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++, yPosition+=Get_Cellsize())
	{
		for(x=0, xPosition=Get_XMin(); x<Get_NX(); x++, xPosition+=Get_Cellsize())
		{
			if( pGrid->Get_Value(xPosition, yPosition, z, Interpolation) )
			{
				Set_Value (x, y, z);
			}
			else
			{
				Set_NoData(x, y);
			}
		}
	}

	Get_History()	= pGrid->Get_History();
	Get_History().Add_Child(SG_T("GRID_OPERATION"), CSG_String::Format(SG_T("%f -> %f"), pGrid->Get_Cellsize(), Get_Cellsize()))->Add_Property(SG_T("NAME"), LNG("Resampling"));

	SG_UI_Process_Set_Ready();

	return( true );
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:30,代码来源:grid_operation.cpp


示例2: Parameters

//---------------------------------------------------------
bool CViGrA_Watershed::On_Execute(void)
{
	CSG_Grid	*pInput  = Parameters("INPUT" )->asGrid();
	CSG_Grid	*pOutput = Parameters("OUTPUT")->asGrid();

	//-----------------------------------------------------
	if( !Parameters("RGB")->asBool() )
	{
		vigra::FImage	Input, Output(Get_NX(), Get_NY());

		Copy_Grid_SAGA_to_VIGRA(*pInput, Input, true);

		Segmentation(Input, Output, Parameters("SCALE")->asDouble(), Parameters("EDGES")->asBool());

		Copy_Grid_VIGRA_to_SAGA(*pOutput, Output, false);
	}

	//-----------------------------------------------------
	else	// perform watershed segmentation on color image
	{
		vigra::BRGBImage	Input, Output(Get_NX(), Get_NY());

		Copy_RGBGrid_SAGA_to_VIGRA(*pInput, Input, true);

		Segmentation(Input, Output, Parameters("SCALE")->asDouble(), Parameters("EDGES")->asBool());

		Copy_RGBGrid_VIGRA_to_SAGA(*pOutput, Output, false);
	}

	//-----------------------------------------------------
	pOutput->Fmt_Name("%s [%s]", pInput->Get_Name(), Get_Name().c_str());

	return( true );
}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:35,代码来源:vigra_watershed.cpp


示例3: if

//---------------------------------------------------------
double CGSGrid_Variance::Get_GSGrid_Variance(int x, int y, int iRadius, int &Count)
{
	int		i, ix, iy;

	double	d, z, Variance;

	Variance	= 0;
	z			= pInput->asDouble(x,y);

	for(i=rLength[iRadius-1], Count=0; i<rLength[iRadius]; i++, Count++)
	{
		ix	= x + x_diff[i];
		if( ix < 0 )
			ix	= 0;
		else if( ix >= Get_NX() )
			ix	= Get_NX() - 1;

		iy	= y + y_diff[i];
		if( iy < 0 )
			iy	= 0;
		else if( iy >= Get_NY() )
			iy	= Get_NY() - 1;

		d			= z - pInput->asDouble(ix,iy);
		Variance	+= d * d;
	}

	return( Variance );
}
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:30,代码来源:GSGrid_Variance.cpp


示例4: Get_ZMin

//---------------------------------------------------------
void CSG_Grid::Invert(void)
{
	int		x, y;
	double	zMin, zMax;

	if( is_Valid() && Get_ZRange() > 0.0 )
	{
		zMin	= Get_ZMin();
		zMax	= Get_ZMax();

		for(y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
		{
			for(x=0; x<Get_NX(); x++)
			{
				if( !is_NoData(x, y) )
				{
					Set_Value(x, y, zMax - (asDouble(x, y) - zMin));
				}
			}
		}

		SG_UI_Process_Set_Ready();

		Get_History().Add_Child(SG_T("GRID_OPERATION"), LNG("Inversion"));
	}
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:27,代码来源:grid_operation.cpp


示例5: switch

//---------------------------------------------------------
CSG_Grid & CSG_Grid::_Operation_Arithmetic(double Value, TSG_Grid_Operation Operation)
{
	//-----------------------------------------------------
	switch( Operation )
	{
	case GRID_OPERATION_Addition:
		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Addition"));
		break;

	case GRID_OPERATION_Subtraction:
		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Subtraction"));
		Value	= -Value;
		break;

	case GRID_OPERATION_Multiplication:
		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Multiplication"));
		break;

	case GRID_OPERATION_Division:
		if( Value == 0.0 )
			return( *this );

		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Division"));
		Value	= 1.0 / Value;
		break;
	}

	//-----------------------------------------------------
	for(int y=0; y<Get_NY() && SG_UI_Process_Set_Progress(y, Get_NY()); y++)
	{
		for(int x=0; x<Get_NX(); x++)
		{
			if( !is_NoData(x, y) )
			{
				switch( Operation )
				{
				case GRID_OPERATION_Addition:
				case GRID_OPERATION_Subtraction:
					Add_Value(x, y, Value);
					break;

				case GRID_OPERATION_Multiplication:
				case GRID_OPERATION_Division:
					Mul_Value(x, y, Value);
					break;
				}
			}
		}
	}

	SG_UI_Process_Set_Ready();

	return( *this );
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:55,代码来源:grid_operation.cpp


示例6: Parameters

//---------------------------------------------------------
bool CGrid_Histogram_Surface::Get_Lines(bool bRows)
{
	int			i, j, n_i, n_j;
	CSG_Table	Values;
	CSG_Grid	*pHist;

	//-----------------------------------------------------
	Parameters("HIST")->Set_Value(pHist	= SG_Create_Grid(m_pGrid));

	pHist->Set_NoData_Value_Range(
		m_pGrid->Get_NoData_Value(),
		m_pGrid->Get_NoData_hiValue()
	);

	n_i	= bRows ? Get_NX() : Get_NY();
	n_j	= bRows ? Get_NY() : Get_NX();

	Values.Add_Field(SG_T("Z"), SG_DATATYPE_Double);

	for(i=0; i<n_i; i++)
	{
		Values.Add_Record();
	}

	//-----------------------------------------------------
	for(j=0; j<n_j && Set_Progress(j, n_j); j++)
	{
		for(i=0; i<n_i; i++)
		{
			Values.Get_Record(i)->Set_Value(0, bRows ? m_pGrid->asDouble(i, j) : m_pGrid->asDouble(j, i));
		}

		Values.Set_Index(0, TABLE_INDEX_Ascending);

		for(i=0; i<n_i; i++)
		{
			int		k	= i % 2 ? i / 2 : n_i - 1 - i / 2;

			if( bRows )
			{
				pHist->Set_Value(k, j, Values.Get_Record_byIndex(i)->asDouble(0));
			}
			else
			{
				pHist->Set_Value(j, k, Values.Get_Record_byIndex(i)->asDouble(0));
			}
		}
	}

	//-----------------------------------------------------
	return( true );
}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:53,代码来源:Grid_Histogram_Surface.cpp


示例7: is_InGrid

///////////////////////////////////////////////////////////
//---------------------------------------------------------
// This function modifies the incoming integer variables!!!
//---------------------------------------------------------
bool CGrid_Polygon_Clip::Get_Extent(int &xMin, int &xCount, int &yMin, int &yCount, CSG_Grid *pMask, CSG_Parameter_Grid_List *pGrids)
{
	bool	bFound;

	for(yMin=0, bFound=false; yMin<Get_NY() && !bFound && Process_Get_Okay(true); yMin++)
	{
		for(int x=0; x<Get_NX() && !bFound; x++)
		{
			bFound	= is_InGrid(x, yMin, pMask, pGrids);
		}
	}
	yMin--;
	

	//-----------------------------------------------------
	if( yMin < Get_NY() && Process_Get_Okay() )
	{
		int		xMax, yMax;

		for(yMax=Get_NY()-1, bFound=false; yMax>=yMin && !bFound && Process_Get_Okay(true); yMax--)
		{
			for(int x=0; x<Get_NX() && !bFound; x++)
			{
				bFound	= is_InGrid(x, yMax, pMask, pGrids);
			}
		}

		for(xMin=0, bFound=false; xMin<Get_NX() && !bFound && Process_Get_Okay(true); xMin++)
		{
			for(int y=yMin; y<yMax && !bFound; y++)
			{
				bFound	= is_InGrid(xMin, y, pMask, pGrids);
			}
		}
		xMin--;

		for(xMax=Get_NX()-1, bFound=false; xMax>=xMin && !bFound && Process_Get_Okay(true); xMax--)
		{
			for(int y=yMin; y<yMax && !bFound; y++)
			{
				bFound	= is_InGrid(xMax, y, pMask, pGrids);
			}
		}

		xCount	= 1 + xMax - xMin;
		yCount	= 1 + yMax - yMin;

		return( xCount > 0 && yCount > 0 );
	}

	return( false );
}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:56,代码来源:Grid_Polygon_Clip.cpp


示例8: return

//---------------------------------------------------------
bool CSG_Grid::_Assign_ExtremeValue(CSG_Grid *pGrid, bool bMaximum)
{
	if( Get_Cellsize() < pGrid->Get_Cellsize() || is_Intersecting(pGrid->Get_Extent()) == INTERSECTION_None )
	{
		return( false );
	}

	//-----------------------------------------------------
	int			x, y, ix, iy;
	double		px, py, ax, ay, d, z;
	CSG_Matrix	S(Get_NY(), Get_NX()), N(Get_NY(), Get_NX());

	d	= pGrid->Get_Cellsize() / Get_Cellsize();

	Set_NoData_Value(pGrid->Get_NoData_Value());

	Assign_NoData();

	//-----------------------------------------------------
	ax	= 0.5 + (pGrid->Get_XMin() - Get_XMin()) / Get_Cellsize();
	ay	= 0.5 + (pGrid->Get_YMin() - Get_YMin()) / Get_Cellsize();

	for(y=0, py=ay; y<pGrid->Get_NY() && SG_UI_Process_Set_Progress(y, pGrid->Get_NY()); y++, py+=d)
	{
		if( (iy = (int)floor(py)) >= 0 && iy < Get_NY() )
		{
			for(x=0, px=ax; x<pGrid->Get_NX(); x++, px+=d)
			{
				if( !pGrid->is_NoData(x, y) && (ix = (int)floor(px)) >= 0 && ix < Get_NX() )
				{
					z	= pGrid->asDouble(x, y);

					if( is_NoData(ix, iy)
					||	(bMaximum == true  && z > asDouble(ix, iy))
					||	(bMaximum == false && z < asDouble(ix, iy)) )
					{
						Set_Value(ix, iy, z);
					}
				}
			}
		}
	}

	//-----------------------------------------------------
	Get_History()	= pGrid->Get_History();
	Get_History().Add_Child(SG_T("GRID_OPERATION"), CSG_String::Format(SG_T("%f -> %f"), pGrid->Get_Cellsize(), Get_Cellsize()))->Add_Property(SG_T("NAME"), LNG("Resampling"));

	SG_UI_Process_Set_Ready();

	return( true );
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:52,代码来源:grid_operation.cpp


示例9: Parameters

//---------------------------------------------------------
bool CGSGrid_Variance::On_Execute(void)
{
	int		x, y;

	//-----------------------------------------------------
	pInput		= Parameters("INPUT"	)->asGrid();
	pOutput		= Parameters("RESULT"	)->asGrid();

	maxRadius	= Parameters("RADIUS"	)->asInt();
	Exponent	= Parameters("EXPONENT"	)->asDouble();

	//-----------------------------------------------------
	Initialize();

	//-----------------------------------------------------
	for(y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		for(x=0; x<Get_NX(); x++)
		{
			pOutput->Set_Value(x,y, Get_Laenge(x,y) );
		}
	}

	//-----------------------------------------------------
	Finalize();

	//-----------------------------------------------------
	return( true );
}
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:30,代码来源:GSGrid_Variance.cpp


示例10: log

//---------------------------------------------------------
bool CMRVBF::Get_MRVBF(int Level, CSG_Grid *pMRVBF, CSG_Grid *pVF, CSG_Grid *pMRRTF, CSG_Grid *pRF)
{
	if( pMRVBF && pVF && pMRRTF && pRF )
	{
		double	d, w, t, p;

		t	= 0.4;
		p	= log((Level - 0.5) / 0.1) / log(1.5);

		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
		{
			for(int x=0; x<Get_NX(); x++)
			{
				if( !pMRVBF->is_NoData(x, y) && !pVF->is_NoData(x, y) )
				{
					d	= pVF->asDouble(x, y);
					w	= 1.0 - Get_Transformation(d, t, p);
					pMRVBF->Set_Value(x, y, w * (Level - 1 + d) + (1.0 - w) * pMRVBF->asDouble(x, y));
				}

				if( !pMRRTF->is_NoData(x, y) && !pRF->is_NoData(x, y) )
				{
					d	= pRF->asDouble(x, y);
					w	= 1.0 - Get_Transformation(d, t, p);
					pMRRTF->Set_Value(x, y, w * (Level - 1 + d) + (1.0 - w) * pMRRTF->asDouble(x, y));
				}
			}
		}

		return( true );
	}

	return( false );
}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:35,代码来源:mrvbf.cpp


示例11: Parameters

//---------------------------------------------------------
bool CGrid_Volume::On_Execute(void)
{
	int			x, y, Method;
	double		Level, Volume, z;
	CSG_Grid		*pGrid;
	CSG_String	s;

	//-----------------------------------------------------
	pGrid	= Parameters("GRID")	->asGrid();
	Level	= Parameters("LEVEL")	->asDouble();
	Method	= Parameters("METHOD")	->asInt();

	//-----------------------------------------------------
	for(y=0, Volume=0.0; y<Get_NY() && Set_Progress(y); y++)
	{
		for(x=0; x<Get_NX(); x++)
		{
			if( !pGrid->is_NoData(x, y) )
			{
				z	= pGrid->asDouble(x, y) - Level;

				switch( Method )
				{
				case 0:	// Count Only Above Base Level
					if( z > 0.0 )
					{
						Volume	+= z;
					}
					break;

				case 1:	// Count Only Below Base Level
					if( z < 0.0 )
					{
						Volume	-= z;
					}
					break;

				case 2:	// Subtract Volumes Below Base Level
					Volume	+= z;
					break;

				case 3:	// Add Volumes Below Base Level
					Volume	+= fabs(z);
					break;
				}
			}
		}
	}

	//-----------------------------------------------------
	Volume	*= pGrid->Get_Cellarea();

	s.Printf(_TL("Volume: %f"), Volume);

	Message_Add(s);
	Message_Dlg(s, _TL("Grid Volume"));

	//-----------------------------------------------------
	return( true );
}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:61,代码来源:Grid_Volume.cpp


示例12: Parameters

//---------------------------------------------------------
bool CGradient_Polar_To_Cartes::On_Execute(void)
{
	bool		bDegree, bClockwise;
	int			Method;
	double		LEN, DIR, Zero;
	CSG_Grid	*pDX, *pDY, *pDIR, *pLEN;

	//-----------------------------------------------------
	pDX		= Parameters("DX")		->asGrid();
	pDY		= Parameters("DY")		->asGrid();
	pDIR	= Parameters("DIR")		->asGrid();
	pLEN	= Parameters("LEN")		->asGrid();

	bDegree	= Parameters("UNITS")	->asInt() == 1;
	Method	= Parameters("SYSTEM")	->asInt();

	if( Method == 0 )	// mathematic
	{
		Zero		= M_PI_090;
		bClockwise	= false;
	}
	else
	{
		Zero		= Parameters("SYSTEM_ZERO")->asDouble() * M_DEG_TO_RAD;
		bClockwise	= Parameters("SYSTEM_ORIENT")->asInt() == 0;
	}

	//-----------------------------------------------------
	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	{		
		for(int x=0; x<Get_NX(); x++)
		{
			if( pLEN->is_NoData(x, y) || pDIR->is_NoData(x, y) )
			{
				pDX->Set_NoData(x, y);
				pDY->Set_NoData(x, y);
			}
			else
			{
				LEN	= pLEN->asDouble(x, y);
			    DIR	= pDIR->asDouble(x, y);

				if( bDegree )
				{
					DIR	*= M_DEG_TO_RAD;
				}

				if( Method != 1 )	// not geographic
				{
					DIR	= bClockwise ? DIR - Zero : Zero - DIR;
				}

				pDX->Set_Value(x, y, LEN * sin(DIR));
				pDY->Set_Value(x, y, LEN * cos(DIR));
			}
		}
	}

	return( true );
}
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:61,代码来源:gradient_cartes_polar.cpp


示例13: Parameters

//---------------------------------------------------------
bool CCost_Accumulated::Get_Destinations(CPoints &Points)
{
	Points.Clear();

	m_pAccumulated->Set_NoData_Value(-1.0); m_pAccumulated->Assign(-1.0);
	m_pAllocation ->Set_NoData_Value(-1.0); m_pAllocation ->Assign( 0.0);

	if( Parameters("DEST_TYPE")->asInt() == 0 )	// Point
	{
		CSG_Shapes	*pDestinations	= Parameters("DEST_POINTS")->asShapes();

		for(int i=0, x, y; i<pDestinations->Get_Count(); i++)
		{
			if( Get_System().Get_World_to_Grid(x, y, pDestinations->Get_Shape(i)->Get_Point(0)) && !m_pCost->is_NoData(x, y) )
			{
				Points.Add(x, y); m_pAllocation->Set_Value(x, y, Points.Get_Count()); m_pAccumulated->Set_Value(x, y, 0.0);
			}
		}
	}
	else										// Grid
	{
		CSG_Grid	*pDestinations	= Parameters("DEST_GRID")->asGrid();

		for(int y=0; y<Get_NY(); y++)	for(int x=0; x<Get_NX(); x++)
		{
			if( !pDestinations->is_NoData(x, y) && !m_pCost->is_NoData(x, y) )
			{
				Points.Add(x, y); m_pAllocation->Set_Value(x, y, Points.Get_Count()); m_pAccumulated->Set_Value(x, y, 0.0);
			}
		}
	}

	return( Points.Get_Count() > 0 );
}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:35,代码来源:Cost_Isotropic.cpp


示例14: Parameters

//---------------------------------------------------------
bool CFragmentation_Classify::On_Execute(void)
{
	CSG_Grid	*pDensity, *pConnectivity, *pFragmentation;

	pDensity			= Parameters("DENSITY")			->asGrid();
	pConnectivity		= Parameters("CONNECTIVITY")	->asGrid();
	pFragmentation		= Parameters("FRAGMENTATION")	->asGrid();

	m_Weight			= Parameters("WEIGHT")			->asDouble();
	m_Density_Min		= Parameters("DENSITY_MIN")		->asDouble() / 100.0;
	m_Density_Interior	= Parameters("DENSITY_INT")		->asDouble() / 100.0;

	//-----------------------------------------------------
	CSG_Parameters	Parms;

	DataObject_Set_Colors(pFragmentation, 100, SG_COLORS_WHITE_GREEN, true);

	if( DataObject_Get_Parameters(pFragmentation, Parms) && Parms("COLORS_TYPE") && Parms("LUT") )
	{
		Parms("LUT")->asTable()->Assign_Values(&m_LUT);	// Lookup Table
		Parms("COLORS_TYPE")->Set_Value(1);				// Color Classification Type: Lookup Table

		DataObject_Set_Parameters(pFragmentation, Parms);
	}

//	pFragmentation->Set_NoData_Value(CLASS_NONE);

	//-----------------------------------------------------
	if( 1 )
	{
		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
		{
			for(int x=0; x<Get_NX(); x++)
			{
				if( !pDensity->is_NoData(x, y) && !pConnectivity->is_NoData(x, y) )
				{
					double	Density			= pDensity		->asDouble(x, y) / 100.0;
					double	Connectivity	= pConnectivity	->asDouble(x, y) / 100.0;

				//	pFragmentation	->Set_Value (x, y, 100.0 * Density * Connectivity);
					pFragmentation	->Set_Value (x, y, Get_Classification(Density, Connectivity));
				}
				else
				{
					pFragmentation	->Set_NoData(x, y);
				}
			}
		}

		//-------------------------------------------------
		if( Parameters("BORDER")->asBool() )
		{
			Add_Border(pFragmentation);
		}

		return( true );
	}

	return( false );
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:61,代码来源:fragmentation_classify.cpp


示例15: Parameters

//---------------------------------------------------------
bool CGrid_Division::On_Execute(void)
{
	//-----------------------------------------------------
	CSG_Grid	*pA	= Parameters("A")->asGrid();
	CSG_Grid	*pB	= Parameters("B")->asGrid();
	CSG_Grid	*pC	= Parameters("C")->asGrid();

	DataObject_Set_Colors(pC, 11, SG_COLORS_RED_GREY_BLUE);

	//-----------------------------------------------------
	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		#pragma omp parallel for
		for(int x=0; x<Get_NX(); x++)
		{
			if( pA->is_NoData(x, y) || pB->is_NoData(x, y) || pB->asDouble(x, y) == 0.0 )
			{
				pC->Set_NoData(x, y);
			}
			else
			{
				pC->Set_Value(x, y, pA->asDouble(x, y) / pB->asDouble(x, y));
			}
		}
	}

	//-----------------------------------------------------
	return( true );
}
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:30,代码来源:grid_difference.cpp


示例16: getEdgeContamination

int CEdgeContamination::getEdgeContamination(int x, int y){

    int iNextX, iNextY;
	int iEdgeContamination;

	if (x <= 1 || y <= 1 || x >= Get_NX() - 2 || y >= Get_NY() - 2){
		iEdgeContamination = 1;
	}//if
	else{
		iEdgeContamination = 0;
	}//else
			
	for (int i = -1; i<2; i++){
		for (int j = -1; j<2; j++){
			if (!(i == 0) || !(j == 0)) {
				getNextCell(m_pDEM, x + i, y + j, iNextX, iNextY);
				if (iNextY == y && iNextX == x) {
					if (m_pEdgeContamination->asInt(x+i,y+j)!=NOT_VISITED){
						iEdgeContamination += m_pEdgeContamination->asInt(x+i,y+j);
					}//if
					else{
						iEdgeContamination += getEdgeContamination(x+i,y+j);
					}//else
				}// if				
			}//if				
		}//for
	}//for

	m_pEdgeContamination->Set_Value(x, y, iEdgeContamination);

	return iEdgeContamination;

}//method
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:33,代码来源:EdgeContamination.cpp


示例17: Assign

//---------------------------------------------------------
bool CSG_Grid::Assign(double Value)
{
	if( is_Valid() )
	{
		if( Value == 0.0 && m_Memory_Type == GRID_MEMORY_Normal )
		{
			for(int n=0, m=_Get_nLineBytes(); n<Get_NY(); n++)
			{
				memset(m_Values[n], 0, m);
			}
		}
		else
		{
			for(int n=0; n<Get_NCells(); n++)
			{
				Set_Value(n, Value);
			}
		}

		//-------------------------------------------------
		Get_History().Destroy();
		Get_History().Add_Child(SG_T("GRID_OPERATION"), Value)->Add_Property(SG_T("NAME"), LNG("Assign"));

		//-------------------------------------------------
		m_zStats.Invalidate();

		Set_Update_Flag(false);

		return( true );
	}

	return( false );
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:34,代码来源:grid_operation.cpp


示例18: Parameters

//---------------------------------------------------------
bool CGrid_Plotter::On_Execute(void)
{
	pResult		= Parameters("RESULT")->asGrid();

	double xmin	= Parameters("XMIN")->asDouble();
	double ymin	= Parameters("YMIN")->asDouble();
	double xmax	= Parameters("XMAX")->asDouble();
	double ymax	= Parameters("YMAX")->asDouble();

	const SG_Char *formel  = Parameters("FORMUL")->asString();

	CSG_Formula Formel;

	Formel.Set_Formula(formel);

	CSG_String Msg;
	if (Formel.Get_Error(Msg))
	{
		Message_Add(Msg);
		
		return false;
	}

	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	for(int x=0; x<Get_NX(); x++)
	{
		pResult->Set_Value(x,y,Formel.Get_Value(SG_T("xy"),(xmax-xmin)*((double)x/Get_NX())+xmin,(ymax-ymin)*((double)y/Get_NY())+ymin)); 
	}
	return( true );
}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:31,代码来源:Grid_Plotter.cpp


示例19: Get_Classified

//---------------------------------------------------------
bool CMRVBF::Get_Classified(CSG_Grid *pMRF)
{
	if( pMRF && pMRF->is_Valid() )
	{
		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
		{
			for(int x=0; x<Get_NX(); x++)
			{
				if( !pMRF->is_NoData(x, y) )
				{
					double	d	= pMRF->asDouble(x, y);

					if		( d < 0.5 )
						pMRF->Set_Value(x, y, 0.0);
					else if	( d < 1.5 )
						pMRF->Set_Value(x, y, 1.0);
					else if	( d < 2.5 )
						pMRF->Set_Value(x, y, 2.0);
					else if	( d < 3.5 )
						pMRF->Set_Value(x, y, 3.0);
					else if	( d < 4.5 )
						pMRF->Set_Value(x, y, 4.0);
					else if	( d < 5.5 )
						pMRF->Set_Value(x, y, 5.0);
					else
						pMRF->Set_Value(x, y, 6.0);
				}
			}
		}

		return( true );
	}

	return( false );
}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:36,代码来源:mrvbf.cpp


示例20: Parameters

//---------------------------------------------------------
bool CExercise_10::On_Execute(void)
{
	bool	bAlive;
	int		x, y, i;
	CSG_Colors	Colors;


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

	m_pLife		= Parameters("RESULT")->asGrid();

	m_nColors	= Parameters("COLORS")->asInt();

	Colors.Set_Count(m_nColors + 1);
	Colors.Set_Ramp(SG_GET_RGB(127, 127, 127), SG_GET_RGB(0, 0, 0));
	Colors.Set_Color(0, SG_GET_RGB(255, 255, 255));
	DataObject_Set_Colors(m_pLife, Colors);


	//-----------------------------------------------------
	// Initialise life's world...

	if( Parameters("REFRESH")->asBool() )
	{
		srand((unsigned)time(NULL));

		for(y=0; y<Get_NY(); y++)
		{
			for(x=0; x<Get_NX(); x++)
			{
				m_pLife->Set_Value(x, y, rand() > RAND_MAX / 2 ? 0 : 1);
			}
		}
	}


	//-----------------------------------------------------
	// Execution...

	m_pTemp		= SG_Create_Grid(m_pLife, SG_DATATYPE_Byte);

	for(i=1, bAlive=true; bAlive && Process_Get_Okay(true); i++)
	{
		Process_Set_Text(CSG_String::Format(SG_T("%d %s"), i, _TL("Life Cycle")));

		if( (bAlive = Next_Step()) == false )
		{
			Message_Add(CSG_String::Format(SG_T("%s %d %s\n"), _TL("Dead after"), i, _TL("Life Cycles")));
		}
	}

	delete(m_pTemp);


	//-----------------------------------------------------
	// Finish...

	return( true );
}
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:61,代码来源:Exercise_10.cpp



注:本文中的Get_NY函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Get_S1函数代码示例发布时间:2022-05-30
下一篇:
C++ Get_NX函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap