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

C++ Get_NX函数代码示例

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

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



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

示例1: ZeroToNoData

void CSinuosity::ZeroToNoData(void){
		
    for(int y=0; y<Get_NY() && Set_Progress(y); y++){		
		for(int x=0; x<Get_NX(); x++){			
            if (m_pSinuosity->asDouble(x,y) == 0){
				m_pSinuosity->Set_Value(x,y,m_pSinuosity->Get_NoData_Value());
			}//if
        }// for
    }// for

}//method
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:11,代码来源:Sinuosity.cpp


示例2: 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


示例3: Tension_Change

//---------------------------------------------------------
double CGrid_Gaps::Tension_Step(int iStep)
{
	int		x, y;

	double	d, dMax;

	dMax	= 0.0;

	for(y=0; y<Get_NY(); y+=iStep)
	{
		for(x=0; x<Get_NX(); x+=iStep)
		{
			if( pTension_Keep->asByte(x, y) == false )
			{
				d	= Tension_Change(x, y, iStep);

				pTension_Temp->Set_Value(x, y, d);

				d	= fabs(d - pResult->asDouble(x, y));

				if( d > dMax )
				{
					dMax	= d;
				}
			}
		}
	}

	for(y=0; y<Get_NY(); y+=iStep)
	{
		for(x=0; x<Get_NX(); x+=iStep)
		{
			if( pTension_Keep->asByte(x, y) == false )
			{
				pResult->Set_Value(x, y, pTension_Temp->asDouble(x, y));
			}
		}
	}

	return( dMax );
}
开发者ID:sina-masoud-ansari,项目名称:saga-gis,代码行数:42,代码来源:Grid_Gaps.cpp


示例4: Get_Allocation

//---------------------------------------------------------
bool CCost_Accumulated::Get_Allocation(void)
{
	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		for(int x=0; x<Get_NX(); x++)
		{
			Get_Allocation(x, y);
		}
	}

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


示例5: Get_NX

//---------------------------------------------------------
void CGrid_3D_Image::_Set_Grid(void)
{
	T3DPoint	*a, *b, *c, *d, p[3];

	//-----------------------------------------------------
	a	= (T3DPoint *)SG_Malloc(sizeof(T3DPoint) *  Get_NX());
	b	= (T3DPoint *)SG_Malloc(sizeof(T3DPoint) *  Get_NX());
	c	= (T3DPoint *)SG_Malloc(sizeof(T3DPoint) * (Get_NX() - 1));

	//-----------------------------------------------------
	_Get_Line(0, b);

	for(int y=1; y<Get_NY() && Set_Progress(y); y++)
	{
		d	= a;
		a	= b;
		b	= d;

		_Get_Line(y, b);
		_Get_Line(a, b, c);

		for(int ax=0, bx=1; bx<Get_NX(); ax++, bx++)
		{
			DRAW_TRIANGLE(a[ax], a[bx], c[ax]);
			DRAW_TRIANGLE(b[ax], b[bx], c[ax]);
			DRAW_TRIANGLE(a[ax], b[ax], c[ax]);
			DRAW_TRIANGLE(a[bx], b[bx], c[ax]);
		}
	}

	//-----------------------------------------------------
	SG_Free(a);
	SG_Free(b);
	SG_Free(c);

	//-----------------------------------------------------
	DataObject_Add(m_pRGB_Z);
	DataObject_Add(m_pRGB);
	DataObject_Set_Colors(m_pRGB, 100, SG_COLORS_BLACK_WHITE);
}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:41,代码来源:Grid_3D_Image.cpp


示例6: DataObject_Set_Colors

//---------------------------------------------------------
bool CKinWav_D8::Initialize(double Roughness)
{
	m_Flow_Last	.Create(*Get_System(), SG_DATATYPE_Float);
	m_Alpha		.Create(*Get_System(), SG_DATATYPE_Float);
	m_Direction	.Create(*Get_System(), SG_DATATYPE_Char);
	m_Direction	.Set_NoData_Value(-1);

	m_pFlow->Assign(0.0);
	DataObject_Set_Colors(m_pFlow, 100, SG_COLORS_WHITE_BLUE);
	DataObject_Update(m_pFlow, 0.0, 100.0, SG_UI_DATAOBJECT_SHOW);

	//-----------------------------------------------------
	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		for(int x=0; x<Get_NX(); x++)
		{
			if( !m_pDEM->is_NoData(x, y) )
			{
				int		i, ix, iy, iMax;
				double	z, d, dMax;

				for(i=0, iMax=-1, dMax=0.0, z=m_pDEM->asDouble(x, y); i<8; i++)
				{
					ix	= Get_xTo(i, x);
					iy	= Get_yTo(i, y);

					if( is_InGrid(ix, iy) && (d = (z - m_pDEM->asDouble(ix, iy)) / Get_Length(i)) > dMax )
					{
						dMax	= d;
						iMax	= i;
					}
				}

				if( iMax < 0 )
				{
					m_Direction	 .Set_NoData(x, y);
				}
				else
				{
					m_Direction	.Set_Value(x, y, iMax);

					m_Alpha		.Set_Value(x, y, pow(Roughness / sqrt(dMax), Beta_0));

					if( m_Alpha.asDouble(x, y) > 10 )
						m_Alpha.Set_Value(x, y, 10);
				}
			}
		}
	}

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


示例7: Calculate

//---------------------------------------------------------
bool CFlow_Parallel::Calculate(void)
{
	for(int y=0; y<Get_NY() && Set_Progress(y); y+=m_Step)
	{
		#pragma omp parallel for
		for(int x=0; x<Get_NX(); x+=m_Step)
		{
			Init_Cell(x, y);
		}
	}

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


示例8: Parameters

//---------------------------------------------------------
bool CLand_Surface_Temperature::On_Execute(void)
{
	double		Z_reference, T_reference, T_gradient, C_Factor, LAI_max, Z, SWR, LAI, LST;
	CSG_Grid	*pDEM, *pSWR, *pLAI, *pLST;

	//-----------------------------------------------------
	pDEM		= Parameters("DEM")			->asGrid();
	pSWR		= Parameters("SWR")			->asGrid();
	pLAI		= Parameters("LAI")			->asGrid();
	pLST		= Parameters("LST")			->asGrid();

	Z_reference	= Parameters("Z_REFERENCE")	->asDouble();
	T_reference	= Parameters("T_REFERENCE")	->asDouble();
	T_gradient	= Parameters("T_GRADIENT")	->asDouble();
	C_Factor	= Parameters("C_FACTOR")	->asDouble();

	LAI_max		= pLAI->Get_ZMax();

	//-----------------------------------------------------
	if( LAI_max > 0.0 )
	{
		for(int y=0; y<Get_NY() && Set_Progress(y); y++)
		{
			for(int x=0; x<Get_NX(); x++)
			{
				if( pDEM->is_NoData(x, y) || pSWR->is_NoData(x, y) || pLAI->is_NoData(x, y) || (SWR = pSWR->asDouble(x, y)) <= 0.0 )
				{
					pLST->Set_NoData(x, y);
				}
				else
				{
					Z	= pDEM->asDouble(x, y);
					SWR	= pSWR->asDouble(x, y);
					LAI	= pLAI->asDouble(x, y);

					LST	= T_reference
						- (T_gradient * (Z - Z_reference)) / 1000.0
						+ C_Factor * (SWR - 1.0 / SWR) * (1.0 - LAI / LAI_max);

					pLST->Set_Value(x, y, LST);
				}
			}
		}

		return( true );
	}

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


示例9: Fill_Sinks

//---------------------------------------------------------
bool CPit_Eliminator::Fill_Sinks(void)
{
	int		x, y;

	for(y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		for(x=0; x<Get_NX(); x++)
		{
			Fill_Check(x, y);
		}
	}

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


示例10: CSG_Table

//---------------------------------------------------------
CvMat* COpenCV_NNet::GetEvalMatrix(CSG_Parameter_Grid_List *gl_grids, int type)
{
	bool				b_NoData;
	int					x,y,i_Grid;
	CSG_Table			*t_data;
	CSG_Table_Record	*tr_rec;
	TSG_Point			p;
	CvMat				*mat;

	// We will use this table as a temporary data store,
	// since we cannot dynamically resize the CvMat
	t_data = new CSG_Table();
	
	// We need a column for each grid and the output lable
	for (int i = 0; i < gl_grids->Get_Count(); i++)
	{
		t_data->Add_Field(CSG_String::Format(SG_T("GRID_%d"), i), SG_DATATYPE_Float, i); 
	}

	// Traverse all grids, every point
	for(y=0, p.y=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, p.y+=Get_Cellsize())
	{
		for(x=0, p.x=Get_XMin(); x<Get_NX(); x++, p.x+=Get_Cellsize())
		{
			for(i_Grid=0, b_NoData=false; i_Grid<gl_grids->Get_Count() && !b_NoData; i_Grid++)
			{
				// If there is one grid that has no data in this point p, then set the no data flag
				if( gl_grids->asGrid(i_Grid)->is_NoData(x, y) )
				{
					b_NoData = true;
				}
			}

			if (!b_NoData)
			{
				// We have data in all grids, so lets add them to the eval data table
				tr_rec = t_data->Add_Record();
				for(i_Grid=0; i_Grid<gl_grids->Get_Count(); i_Grid++)
				{
					tr_rec->Set_Value(i_Grid, (float) gl_grids->asGrid(i_Grid)->asFloat(x, y));
				}				
			}
		}
	}

	// Now create the matrix and add all data from the table to the matrix
	mat = GetEvalMatrix(t_data, type);

	return mat;
}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:51,代码来源:opencv_nnet.cpp


示例11: while

//---------------------------------------------------------
bool CExercise_03::Method_02(void)
{
	int		x, y, ix;
	double	a, b, c;

	//-----------------------------------------------------
	for(y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		x	= 0;	// initialize x...
		
		while( x < Get_NX() - 1 )	// condition for x...
		{
			ix	= x + 1;

			if( m_pInput->is_NoData(x, y) || m_pInput->is_NoData(ix, y) )	// don't work with 'no data'...
			{
				m_pOutput->Set_NoData(x, y);
			}
			else
			{
				a	= m_pInput->asDouble( x, y);
				b	= m_pInput->asDouble(ix, y);

				c	= a - b;

				m_pOutput->Set_Value(x, y, c);
			}

			x++;	// increment x...
		}

		m_pOutput->Set_NoData(Get_NX() - 1, y);	// what shall we do with the last cell in a row ??!!
	}

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


示例12: Get_Shade

//---------------------------------------------------------
bool CSADO_SolarRadiation::Set_Insolation(double Decline, double Azimuth)
{
	int		x, y;
	double	a, e, Direct, Diffus;

	Get_Shade(Decline, Azimuth);

	e	= Get_Vapour_Exponent	(m_VP);
	a	= Get_Vapour_A			(m_VP);

	for(y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		for(x=0; x<Get_NX(); x++)
		{
			if( m_pDEM->is_NoData(x, y) )
			{
				if( m_pSumDirect )	m_pSumDirect->Set_NoData(x, y);
				if( m_pSumDiffus )	m_pSumDiffus->Set_NoData(x, y);
				if( m_pSumTotal )	m_pSumTotal ->Set_NoData(x, y);
			}
			else
			{
				if( m_pVP != NULL )
				{
					e	= Get_Vapour_Exponent	(m_pVP->asDouble(x, y));
					a	= Get_Vapour_A			(m_pVP->asDouble(x, y));
				}

				if( m_bBending )
				{
					Azimuth	= m_Azimuth.asDouble(x, y);
					Decline	= m_Decline.asDouble(x, y);
				}

				if( Decline > 0.0 )
				{
					Direct	= Get_Solar_Direct(x, y, Decline, Azimuth, e);
					Diffus	= Get_Solar_Diffus(x, y, Decline, a      , e);

					if( m_pSumDirect )	m_pSumDirect->Add_Value(x, y, Direct);
					if( m_pSumDiffus )	m_pSumDiffus->Add_Value(x, y, Diffus);
					if( m_pSumTotal  )	m_pSumTotal ->Add_Value(x, y, Direct + Diffus);
				}
			}
		}
	}

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


示例13: Parameters

//---------------------------------------------------------
bool CGrids_Sum::On_Execute(void)
{
	//-----------------------------------------------------
	CSG_Parameter_Grid_List	*pGrids	= Parameters("GRIDS" )->asGridList();

	if( pGrids->Get_Count() < 1 )
	{
		Error_Set(_TL("no grid in list"));

		return( false );
	}

	//-----------------------------------------------------
	CSG_Grid	*pResult	= Parameters("RESULT")->asGrid();

	bool	bNoData	= Parameters("NODATA")->asBool();

	//-----------------------------------------------------
	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		#pragma omp parallel for
		for(int x=0; x<Get_NX(); x++)
		{
			int		n	= 0;
			double	d	= 0.0;

			for(int i=0; i<pGrids->Get_Count(); i++)
			{
				if( pGrids->asGrid(i)->is_InGrid(x, y) )
				{
					n	++;
					d	+= pGrids->asGrid(i)->asDouble(x, y);
				}
			}

			if( bNoData ? n > 0 : n == pGrids->Get_Count() )
			{
				pResult->Set_Value(x, y, d);
			}
			else
			{
				pResult->Set_NoData(x, y);
			}
		}
	}

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


示例14: sizeof

//---------------------------------------------------------
void CSG_Grid::Flip(void)
{
	int		x, yA, yB;
	double	*Line, d;

	if( is_Valid() )
	{
		Line	= (double *)SG_Malloc(Get_NX() * sizeof(double));

		for(yA=0, yB=Get_NY()-1; yA<yB && SG_UI_Process_Set_Progress(2 * yA, Get_NY()); yA++, yB--)
		{
			for(x=0; x<Get_NX(); x++)
			{
				Line[x]	= asDouble(x, yA);
			}

			for(x=0; x<Get_NX(); x++)
			{
				d		= Line[x];
				Line[x]	= asDouble(x, yB);
				Set_Value(x, yB, d);
			}

			for(x=0; x<Get_NX(); x++)
			{
				Set_Value(x, yA, Line[x]);
			}
		}

		SG_UI_Process_Set_Ready();

		SG_Free(Line);

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


示例15: Parameters

//---------------------------------------------------------
void CGrid_Gaps::Tension_Main(void)
{
	int		iStep, iStart, n;

	double	max, Threshold;

	Threshold	= Parameters("THRESHOLD")->asDouble();

	n			= Get_NX() > Get_NY() ? Get_NX() : Get_NY();
	iStep		= 0;
	do	{	iStep++;	}	while( pow(2.0, iStep + 1) < n );
	iStart		= (int)pow(2.0, iStep);

	pTension_Keep		= new CSG_Grid(pResult, SG_DATATYPE_Byte);
	pTension_Temp		= new CSG_Grid(pResult);

	pResult->Assign_NoData();

	for(iStep=iStart; iStep>=1; iStep/=2)
	{
		Tension_Init(iStep);

		do
		{
			max		= Tension_Step(iStep);

			Process_Set_Text(CSG_String::Format(SG_T("[%d] %s: %f"), iStep, _TL("max. change"), max));
		}
		while( max > Threshold && Process_Get_Okay(true) );

		DataObject_Update(pResult, pInput->Get_ZMin(), pInput->Get_ZMax(), true);
	}

	delete(pTension_Keep);
	delete(pTension_Temp);
}
开发者ID:sina-masoud-ansari,项目名称:saga-gis,代码行数:37,代码来源:Grid_Gaps.cpp


示例16: ZeroToNoData

void CIsochronesVar::ZeroToNoData(void){


    for(int y=0; y<Get_NY() && Set_Progress(y); y++){
		for(int x=0; x<Get_NX(); x++){
            if (m_pTime->asDouble(x,y) == 0){
				m_pTime->Set_Value(x,y,m_pTime->Get_NoData_Value());
			}//if
            if (m_pSpeed->asDouble(x,y) == 0){
				m_pSpeed->Set_Value(x,y,m_pSpeed->Get_NoData_Value());
			}//if
        }// for
    }// for

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


示例17: Parameters

//---------------------------------------------------------
bool CGrid_Mask::On_Execute(void)
{
	CSG_Grid	*pGrid	= Parameters("GRID")->asGrid();
	CSG_Grid	*pMask	= Parameters("MASK")->asGrid();

	if( !pGrid->is_Intersecting(pMask->Get_Extent()) )
	{
		Message_Add(_TL("no intersection with mask grid."));

		return( false );
	}

	//-----------------------------------------------------
	CSG_Grid	*pMasked	= Parameters("MASKED")->asGrid();

	if( pMasked && pMasked != pGrid )
	{
		pMasked->Create(*pGrid);
		pMasked->Fmt_Name("%s [%s]", pGrid->Get_Name(), _TL("masked"));

		pGrid	= pMasked;
	}

	//-----------------------------------------------------
	Process_Set_Text(_TL("masking..."));

	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		double	py	= Get_YMin() + y * Get_Cellsize();

		#pragma omp parallel for
		for(int x=0; x<Get_NX(); x++)
		{
			if( !pGrid->is_NoData(x, y) )
			{
				double	px	= Get_XMin() + x * Get_Cellsize();

				if( !pMask->is_InGrid_byPos(px, py) )
				{
					pGrid->Set_NoData(x, y);
				}
			}
		}
	}

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


示例18: Parameters

//---------------------------------------------------------
bool CDiversity_Analysis::On_Execute(void)
{
	//-----------------------------------------------------
	m_pClasses		= Parameters("CATEGORIES"  )->asGrid();
	m_pCount		= Parameters("COUNT"       )->asGrid();
	m_pDiversity	= Parameters("DIVERSITY"   )->asGrid();
	m_pConnectivity	= Parameters("CONNECTIVITY")->asGrid();
	m_pConnectedAvg	= Parameters("CONNECTEDAVG")->asGrid();

	m_pCount		->Set_Name(CSG_String::Format("%s [%s]", m_pClasses->Get_Name(), _TL("Count"                )));
	m_pDiversity	->Set_Name(CSG_String::Format("%s [%s]", m_pClasses->Get_Name(), _TL("Diversity"            )));
	m_pConnectivity	->Set_Name(CSG_String::Format("%s [%s]", m_pClasses->Get_Name(), _TL("Connectivity"         )));
	m_pConnectedAvg	->Set_Name(CSG_String::Format("%s [%s]", m_pClasses->Get_Name(), _TL("Averaged Connectivity")));

	DataObject_Set_Colors(m_pCount       , 11, SG_COLORS_RAINBOW, false);
	DataObject_Set_Colors(m_pDiversity   , 11, SG_COLORS_RAINBOW, false);
	DataObject_Set_Colors(m_pConnectivity, 11, SG_COLORS_RAINBOW,  true);
	DataObject_Set_Colors(m_pConnectedAvg, 11, SG_COLORS_RAINBOW,  true);

	//-----------------------------------------------------
	m_Search.Get_Weighting().Set_Parameters(&Parameters);
	m_Search.Get_Weighting().Set_BandWidth(Parameters("SEARCH_RADIUS")->asDouble() * m_Search.Get_Weighting().Get_BandWidth());
	m_Search.Set_Radius(m_Radius = Parameters("SEARCH_RADIUS")->asInt(), Parameters("SEARCH_MODE")->asInt() == 0);

	m_NB_Step	= Parameters("NB_CASE"  )->asInt() == 0 ? 2 : 1;
	m_Normalize	= Parameters("NORMALIZE")->asInt();

	//-----------------------------------------------------
	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		#pragma omp parallel for
		for(int x=0; x<Get_NX(); x++)
		{
			if( !Get_Diversity(x, y) )
			{
				m_pCount       ->Set_NoData(x, y);
				m_pDiversity   ->Set_NoData(x, y);
				m_pConnectivity->Set_NoData(x, y);
				m_pConnectedAvg->Set_NoData(x, y);
			}
		}
	}

	//-----------------------------------------------------
	m_Search.Destroy();

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


示例19: Parameters

//---------------------------------------------------------
bool CGSGrid_Residuals::On_Execute(void)
{
	m_pGrid		= Parameters("GRID")	->asGrid();

	m_pMean		= Parameters("MEAN")	->asGrid();
	m_pDiff		= Parameters("DIFF")	->asGrid();
	m_pStdDev	= Parameters("STDDEV")	->asGrid();
	m_pRange	= Parameters("RANGE")	->asGrid();
	m_pMin		= Parameters("MIN")		->asGrid();
	m_pMax		= Parameters("MAX")		->asGrid();
	m_pDevMean	= Parameters("DEVMEAN")	->asGrid();
	m_pPercent	= Parameters("PERCENT")	->asGrid();

	DataObject_Set_Colors(m_pDiff	, 100, SG_COLORS_RED_GREY_BLUE, true);
	DataObject_Set_Colors(m_pStdDev	, 100, SG_COLORS_RED_GREY_BLUE, true);
	DataObject_Set_Colors(m_pRange	, 100, SG_COLORS_RED_GREY_BLUE, true);
	DataObject_Set_Colors(m_pMin	, 100, SG_COLORS_RED_GREY_BLUE, true);
	DataObject_Set_Colors(m_pMax	, 100, SG_COLORS_RED_GREY_BLUE, true);
	DataObject_Set_Colors(m_pDevMean, 100, SG_COLORS_RED_GREY_BLUE, true);
	DataObject_Set_Colors(m_pPercent, 100, SG_COLORS_RED_GREY_BLUE, true);

	//-----------------------------------------------------
	bool	bSquare = Parameters("MODE")->asBool() ? false : true;

	m_Cells.Get_Weighting().Set_Parameters(Parameters("WEIGHTING")->asParameters());

	if( !m_Cells.Set_Radius(Parameters("RADIUS")->asInt(), bSquare) )
	{
		return( false );
	}

	bool	bCenter	= Parameters("BCENTER")->asBool();

	//-----------------------------------------------------
	for(int y=0; y<Get_NY() && Set_Progress(y); y++)
	{
		#pragma omp parallel for
		for(int x=0; x<Get_NX(); x++)
		{
			Get_Statistics(x, y, bCenter);
		}
	}

	//-----------------------------------------------------
	m_Cells.Destroy();

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


示例20: Do_Gradient

//---------------------------------------------------------
void CConvergence::Do_Gradient(void)
{
    int		x, y, i, ix, iy, n;
    double	z, Slope, Aspect, iSlope, iAspect, d, dSum;

    for(y=0; y<Get_NY() && Set_Progress(y); y++)
    {
        for(x=0; x<Get_NX(); x++)
        {
            if( pDTM->is_InGrid(x, y) )
            {
                z	= pDTM->asDouble(x, y);

                for(i=0, n=0, dSum=0.0, iAspect=-M_PI_180; i<8; i++, iAspect+=M_PI_045)
                {
                    ix	= Get_xTo(i, x);
                    iy	= Get_yTo(i, y);

                    if( pDTM->is_InGrid(ix, iy) && pDTM->Get_Gradient(ix, iy, Slope, Aspect) && Aspect >= 0.0 )
                    {
                        iSlope	= atan((pDTM->asDouble(ix, iy) - z) / Get_Length(i));

                        // Nach dem Seiten-Kosinus-Satz...
                        d		= acos(sin(Slope) * sin(iSlope) + cos(Slope) * cos(iSlope) * cos(iAspect - Aspect));

                        //---------------------------------
                        d		= fmod(d, M_PI_360);

                        if( d < -M_PI_180 )
                        {
                            d	+= M_PI_360;
                        }
                        else if( d > M_PI_180 )
                        {
                            d	-= M_PI_360;
                        }

                        //---------------------------------
                        dSum	+= fabs(d);
                        n++;
                    }
                }

                pConvergence->Set_Value(x, y, n > 0 ? (dSum / (double)n - M_PI_090) * 100.0 / M_PI_090 : 0.0);
            }
        }
    }
}
开发者ID:gregorburger,项目名称:SAGA-GIS,代码行数:49,代码来源:Convergence.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Get_NY函数代码示例发布时间:2022-05-30
下一篇:
C++ Get_L4函数代码示例发布时间: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