当前位置: 首页>>代码示例>>C++>>正文


C++ Set_Progress函数代码示例

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


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

示例1: Demand_Db_Base

void TripSum::Read_Vehicle (void)
{
	int id, num_out;

	Vehicle_File *file, *new_file;
	
	file = (Vehicle_File *) Demand_Db_Base (VEHICLE);
	new_file = (Vehicle_File *) Demand_Db_Base (NEW_VEHICLE);

	//---- process each vehicle ----

	Show_Message ("Reading %s -- Record", file->File_Type ());
	Set_Progress (10000);

	num_out = 0;

	while (file->Read ()) {
		Show_Progress ();

		id = file->Vehicle ();
		if (id == 0) continue;

		if (vehicle_list.Get_Index (id) == 0) continue;

		new_file->Copy_Fields (file);

		if (!new_file->Write ()) {
			Error ("Writing %s", new_file->File_Type ());
		}
		num_out++;
	}
	End_Progress ();

	Print (2, "Number of Vehicle Records Read = %d", Progress_Count ());
	Print (1, "Number of Vehicle Records Written = %d", num_out);

	file->Close ();
	new_file->Close ();
}
开发者ID:kravitz,项目名称:transims4,代码行数:39,代码来源:Read_Vehicle.cpp

示例2: xPow

//---------------------------------------------------------
bool CPoint_Trend_Surface::Set_Regression(CSG_Grid *pRegression)
{
	int			x, y, i, j, Field;
	double		z;
	TSG_Point	Point;
	CSG_Vector	xPow(m_xOrder + 1), yPow(m_yOrder + 1);

	xPow[0]	= 1.0;
	yPow[0]	= 1.0;

	for(y=0, Point.y=pRegression->Get_YMin(); y<pRegression->Get_NY() && Set_Progress(y, pRegression->Get_NY()); y++, Point.y+=pRegression->Get_Cellsize())
	{
		for(x=0, Point.x=pRegression->Get_XMin(); x<pRegression->Get_NX(); x++, Point.x+=pRegression->Get_Cellsize())
		{
			z	 = m_Coefficients[0];

			for(i=1, Field=1; i<=m_xOrder; i++)
			{
				z	+= m_Coefficients[Field++] * (xPow[i] = xPow[i - 1] * Point.x);
			}

			for(i=1; i<=m_yOrder; i++)
			{
				z	+= m_Coefficients[Field++] * (yPow[i] = yPow[i - 1] * Point.y);

				for(j=1; j<=m_xOrder && i<m_tOrder && j<m_tOrder; j++)
				{
					z	+= m_Coefficients[Field++] * xPow[j] * yPow[i];
				}
			}

			pRegression->Set_Value(x, y, z);
		}
	}

	DataObject_Update(pRegression);

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

示例3: Show_Message

void PlanSum::Read_HHList (void)
{
	int nfile, hhold;

	//---- read the household list files ----

	for (nfile=0; ; nfile++) {
		if (!hhlist_file.Open (nfile)) break;

		if (hhlist_file.Extend ()) {
			Show_Message ("Reading %s %s -- Record", hhlist_file.File_Type (), hhlist_file.Extension ());
		} else {
			Show_Message ("Reading %s -- Record", hhlist_file.File_Type ());
		}
		Set_Progress ();

		//---- store the household list ----

		while (hhlist_file.Read ()) {
			Show_Progress ();

			Get_Integer (hhlist_file.Record (), &hhold);

			if (hhold <= 0) continue;

			if (!hhold_list.Add (hhold)) {
				Error ("Adding Household %d", hhold);
			}
		}
		End_Progress ();

		hhlist_file.Close ();
	}
	hhold = hhold_list.Num_Records ();

	hhold_list.Max_Records (hhold);
	
	Print (2, "Number of Household List Records = %d", hhold);
}
开发者ID:kravitz,项目名称:transims4,代码行数:39,代码来源:Read_HHList.cpp

示例4: Show_Message

void LinkSum::Write_Activity (void)
{
	Show_Message ("Writing Link Activity File -- Record");
	Set_Progress ();

	link_db.Rewind ();

	while (link_db.Read_Record ()) {
		Show_Progress ();

		activity_file.Copy_Fields (&link_db);

		if (!activity_file.Write ()) {
			Error ("Writing the Link Activity File");
		}
	}
	End_Progress ();

	Print (2, "Number of Link Activity Records = %d", Progress_Count ());

	activity_file.Close ();
}
开发者ID:kravitz,项目名称:transims4,代码行数:22,代码来源:Write_Activity.cpp

示例5: sqrt

//---------------------------------------------------------
bool CGrid_Histogram_Surface::Get_Circle(void)
{
	long		i;
	int			n;
	double		r;
	CSG_Grid	*pHist;

	r	= sqrt(m_pGrid->Get_NCells() / M_PI);
	n	= 1 + (int)(2.0 * r);

	//-----------------------------------------------------
	Parameters("HIST")->Set_Value(pHist	= SG_Create_Grid(m_pGrid->Get_Type(), n, n, m_pGrid->Get_Cellsize(), -r * m_pGrid->Get_Cellsize(), -r * m_pGrid->Get_Cellsize()));

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

	//-----------------------------------------------------
	for(int y=0; y<n && Set_Progress(y, n); y++)
	{
		for(int x=0; x<n; x++)
		{
			double	d	= SG_Get_Distance(x, y, r, r);

			if( d < r && m_pGrid->Get_Sorted((long)(d*d*M_PI), i) )
			{
				pHist->Set_Value(x, y, m_pGrid->asDouble(i));
			}
			else
			{
				pHist->Set_NoData(x, y);
			}
		}
	}

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

示例6: Init_XY

//---------------------------------------------------------
bool CPROJ4_Grid::Set_Grid(CSG_Grid *pSource, CSG_Grid *pTarget)
{
	if( pSource && pTarget && Set_Inverse() )
	{
		int			x, y;
		double		z;
		TSG_Point	Pt_Source, Pt_Target;
		CSG_Grid	*pX, *pY;

		Init_XY(pTarget->Get_System(), &pX, &pY);

		Init_Target(pSource, pTarget);

		//-------------------------------------------------
		for(y=0, Pt_Target.y=pTarget->Get_YMin(); y<pTarget->Get_NY() && Set_Progress(y, pTarget->Get_NY()); y++, Pt_Target.y+=pTarget->Get_Cellsize())
		{
			for(x=0, Pt_Target.x=pTarget->Get_XMin(); x<pTarget->Get_NX(); x++, Pt_Target.x+=pTarget->Get_Cellsize())
			{
				Pt_Source	= Pt_Target;

				if( Get_Converted(Pt_Source) )
				{
					if( pX )	pX->Set_Value(x, y, Pt_Source.x);
					if( pY )	pY->Set_Value(x, y, Pt_Source.y);

					if( pSource->Get_Value(Pt_Source, z, m_Interpolation) )
					{
						pTarget->Set_Value(x, y, z);
					}
				}
			}
		}

		return( true );
	}

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

示例7: Tmp

//---------------------------------------------------------
bool CPolygon_Intersection::Get_Difference(CSG_Shapes *pShapes_A, CSG_Shapes *pShapes_B, int Mode)
{
	CSG_Shape	*pShape_A;
	CSG_Shapes	Tmp(SHAPE_TYPE_Polygon);

	m_Mode		= Mode;

	pShape_A	= Tmp.Add_Shape();

	for(int iShape_A=0; iShape_A<pShapes_A->Get_Count() && Set_Progress(iShape_A, pShapes_A->Get_Count()); iShape_A++)
	{
		if( pShapes_B->Select(pShapes_A->Get_Shape(iShape_A)->Get_Extent()) )
		{
			int		nIntersections	= 0;

			pShape_A->Assign(pShapes_A->Get_Shape(iShape_A));

			for(int iShape_B=0; iShape_B<pShapes_B->Get_Selection_Count(); iShape_B++)
			{
				if( GPC_Difference(pShape_A, pShapes_B->Get_Selection(iShape_B)) )
				{
					nIntersections++;
				}
			}

			if( nIntersections && pShape_A->is_Valid() )
			{
				Add_Polygon(pShape_A, iShape_A);
			}
		}
		else
		{
			Add_Polygon(pShapes_A->Get_Shape(iShape_A), iShape_A);
		}
	}

	return( m_pShapes_AB->is_Valid() );
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:39,代码来源:Polygon_Intersection.cpp

示例8: return

//---------------------------------------------------------
bool CCRS_Transform_Grid::Transform(CSG_Grid *pGrid, CSG_Shapes *pPoints)
{
	if( !pPoints || !pGrid )
	{
		return( false );
	}

	if( !m_Projector.Set_Source(pGrid->Get_Projection()) )
	{
		return( false );
	}

	int			x, y;
	TSG_Point	Point;

	pPoints->Create(SHAPE_TYPE_Point, _TL("Points"));
	pPoints->Get_Projection()	= m_Projector.Get_Target();
	pPoints->Add_Field(pGrid->Get_Name(), pGrid->Get_Type());

	for(y=0, Point.y=pGrid->Get_YMin(); y<pGrid->Get_NY() && Set_Progress(y, pGrid->Get_NY()); y++, Point.y+=pGrid->Get_Cellsize())
	{
		for(x=0, Point.x=pGrid->Get_XMin(); x<pGrid->Get_NX(); x++, Point.x+=pGrid->Get_Cellsize())
		{
			TSG_Point	Point_Transformed	= Point;

			if( !pGrid->is_NoData(x, y) && m_Projector.Get_Projection(Point_Transformed) )
			{
				CSG_Shape	*pPoint	= pPoints->Add_Shape();

				pPoint->Add_Point(Point_Transformed);

				pPoint->Set_Value(0, pGrid->asDouble(x, y));
			}
		}
	}

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

示例9: Show_Message

void NewFormat::Read_Persons (void)
{
	int hhold;

	Person_Data person_rec;
	Int_Map_Itr map_itr;
	Household_Data *hhold_ptr;

	//---- process the person file ----

	Show_Message (String ("Reading %s -- Record") % person_file.File_Type ());
	Set_Progress ();

	while (person_file.Read ()) {
		Show_Progress ();

		hhold = person_file.Household ();

		map_itr = hhold_map.find (hhold);
		if (map_itr == hhold_map.end ()) {
			Error (String ("Person %d Household %d was Not Found") % Progress_Count () % hhold);
		}
		hhold_ptr = &hhold_array [map_itr->second];

		person_rec.Person (person_file.Person ());
		person_rec.Age (person_file.Age ());
		person_rec.Relate (person_file.Relate ());
		person_rec.Gender (person_file.Gender ());
		person_rec.Work (person_file.Work ());
		person_rec.Drive (person_file.Drive ());

		hhold_ptr->push_back (person_rec);
	}
	End_Progress ();
	person_file.Close ();

	Print (2, String ("Number of %s Records = %d") % person_file.File_Type () % Progress_Count ());
}
开发者ID:kravitz,项目名称:transims5,代码行数:38,代码来源:Read_Persons.cpp

示例10: Get_Flatness

//---------------------------------------------------------
bool CMRVBF::Get_Flatness(CSG_Grid *pSlopes, CSG_Grid *pPercentiles, CSG_Grid *pCF, CSG_Grid *pVF, CSG_Grid *pRF, double T_Slope)
{
//	const int	Interpolation	= GRID_INTERPOLATION_Bilinear;
	const int	Interpolation	= GRID_INTERPOLATION_BSpline;

	if( pSlopes && pSlopes->is_Valid() && pPercentiles && pPercentiles->is_Valid() )
	{
		int		x, y;
		double	xp, yp, Slope, Percentile, cf, vf, rf;

		for(y=0, yp=Get_YMin(); y<Get_NY() && Set_Progress(y); y++, yp+=Get_Cellsize())
		{
			for(x=0, xp=Get_XMin(); x<Get_NX(); x++, xp+=Get_Cellsize())
			{
				if( pSlopes		->Get_Value(xp, yp, Slope     , Interpolation)
				&&	pPercentiles->Get_Value(xp, yp, Percentile, Interpolation) )
				{
					cf	= pCF->asDouble(x, y) * Get_Transformation(Slope, T_Slope, m_P_Slope);
					vf	= cf * Get_Transformation(      Percentile, m_T_Pctl_V, m_P_Pctl);
					rf	= cf * Get_Transformation(1.0 - Percentile, m_T_Pctl_R, m_P_Pctl);

					pCF->Set_Value	(x, y, cf);
					pVF->Set_Value	(x, y, 1.0 - Get_Transformation(vf, 0.3, 4.0));
					pRF->Set_Value	(x, y, 1.0 - Get_Transformation(rf, 0.3, 4.0));
				}
				else
				{
					pVF->Set_NoData	(x, y);
					pRF->Set_NoData	(x, y);
				}
			}
		}

		return( true );
	}

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

示例11: _TL

//---------------------------------------------------------
void CExercise_14::Vectorise(void)
{
	int			x, y, Segment_ID;
	double		Length;
	CSG_Shape	*pSegment;

	m_pShapes->Create(SHAPE_TYPE_Line, _TL("Channels"));

	m_pShapes->Add_Field("SEGMENT_ID"	, SG_DATATYPE_Int);
	m_pShapes->Add_Field("LENGTH"		, SG_DATATYPE_Double);

	//-----------------------------------------------------
	for(y=0, Segment_ID=0; y<Get_NY() && Set_Progress(y); y++)
	{
		for(x=0; x<Get_NX(); x++)
		{
			switch( m_pChnl->asInt(x, y) )
			{
			case SPRING: case MOUTH:
				pSegment	= m_pShapes->Add_Shape();

				Length		= Vectorise(x, y, pSegment);

				if( Length > 0.0 )
				{
					pSegment->Set_Value(0, ++Segment_ID);
					pSegment->Set_Value(1, Length);
				}
				else
				{
					m_pShapes->Del_Shape(pSegment);
				}

				break;
			}
		}
	}
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:39,代码来源:Exercise_14.cpp

示例12: Show_Message

void TourData::Attraction_Report (void)
{
	int i, zone, attr;
	Integers totals;
	
	Table_Itr table_itr;
	Int_Map_Itr map_itr;

	Show_Message ("Zone Attractions Report -- Record");
	Set_Progress ();

	Header_Number (ATTRACTIONS);
	New_Page ();

	totals.assign (table_groups.size (), 0);

	for (map_itr = zone_map.begin (); map_itr != zone_map.end (); map_itr++) {
		zone = map_itr->first;
		Show_Progress ();

		Print (1, String ("%5d") % zone);

		for (i=0, table_itr = table_groups.begin (); table_itr != table_groups.end (); table_itr++, i++) {
			attr = table_itr->zone_wt [zone];
			Print (0, String (" %8d") % attr);
			totals [i] += attr;
		}
	}
	End_Progress ();

	Print (2, "Total");

	for (i=0, table_itr = table_groups.begin (); table_itr != table_groups.end (); table_itr++, i++) {
		Print (0, String (" %8d") % totals [i]);
	}

	Header_Number (0);
}
开发者ID:qingswu,项目名称:Transim,代码行数:38,代码来源:Zone_Report.cpp

示例13: Write

void SmoothData::Execute (void)
{
	int n = 0;

	//---- process each group ----

	for (group_ptr = file_group.First (); group_ptr; group_ptr = file_group.Next ()) {

		if (n++) {
			Write (1);
			diurnal_data.Reset ();
		}
		Show_Message ("Processing Smooth Group %d -- Record", n);
		Set_Progress ();

		num_group = num_ini = num_in = num_out = 0;

		Read_Input ();

		End_Progress ();

		group_ptr->Input_File ()->Close ();
		group_ptr->Output_File ()->Close ();

		if (group_ptr->Initial_File () != NULL) {
			Write (1, "Number of %s Records = %d", group_ptr->Initial_File ()->File_Type (), num_ini);
			group_ptr->Initial_File ()->Close ();
		}
		Write (1, "Number of %s Records = %d", group_ptr->Input_File ()->File_Type (), num_in);
		Write (1, "Number of %s Records = %d", group_ptr->Output_File ()->File_Type (), num_out);

		if (num_group > 1) {
			Write (1, "Number of Smooth Groups within File #%d = %d", n, num_group);
		}
	}
	Exit_Stat (DONE);
}
开发者ID:kravitz,项目名称:transims4,代码行数:37,代码来源:Execute.cpp

示例14: Parameters

//---------------------------------------------------------
CSG_Shapes * CInterpolation::Get_Points(bool bOnlyNonPoints)
{
	m_pShapes	= Parameters("SHAPES")	->asShapes();

	if( !bOnlyNonPoints || m_pShapes->Get_Type() != SHAPE_TYPE_Point )
	{
		CSG_Shapes	*pPoints	= SG_Create_Shapes(SHAPE_TYPE_Point);

		pPoints->Set_NoData_Value_Range(m_pShapes->Get_NoData_Value(), m_pShapes->Get_NoData_hiValue());
		pPoints->Add_Field(SG_T("Z"), SG_DATATYPE_Double);

		for(int iShape=0; iShape<m_pShapes->Get_Count() && Set_Progress(iShape, m_pShapes->Get_Count()); iShape++)
		{
			CSG_Shape	*pShape	= m_pShapes->Get_Shape(iShape);

			if( !pShape->is_NoData(m_zField) )
			{
				for(int iPart=0; iPart<pShape->Get_Part_Count(); iPart++)
				{
					for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
					{
						CSG_Shape	*pPoint	= pPoints->Add_Shape();

						pPoint->Add_Point(pShape->Get_Point(iPoint, iPart));

						pPoint->Set_Value(0, pShape->asDouble(m_zField));
					}
				}
			}
		}

		m_zField	= 0;
		m_pShapes	= pPoints;
	}

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

示例15: Show_Message

void NetPrep::Write_Link_Nodes (void)
{
	int count = 0;
	Int_Map_Itr itr;
	Int_List_Itr list_itr;
	Link_Nodes *ptr;
	Link_Data *link_ptr;

	Show_Message (String ("Writing %s -- Record") % link_node_file.File_Type ());
	Set_Progress ();

	fstream &file = link_node_file.File ();

	for (itr = link_map.begin (); itr != link_map.end (); itr++) {
		Show_Progress ();

		link_ptr = &link_array [itr->second];

		if (!drop_flag || link_ptr->Length () > 0) {
			count++;

			ptr = &link_node_array [itr->second];

			file << ptr->link << " =";

			for (list_itr = ptr->nodes.begin (); list_itr != ptr->nodes.end (); list_itr++) {
				file << " " << *list_itr;
			}
			file << endl;
		}
	}
	Show_Progress (count);
	End_Progress ();
	link_node_file.Close ();
	
	Print (2, String ("%s Records = %d") % link_node_file.File_Type () % count);
}
开发者ID:qingswu,项目名称:Transim,代码行数:37,代码来源:Write_Link_Nodes.cpp


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