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


C++ GeoVector::GetNumberOfPoints方法代码示例

本文整理汇总了C++中GeoVector::GetNumberOfPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoVector::GetNumberOfPoints方法的具体用法?C++ GeoVector::GetNumberOfPoints怎么用?C++ GeoVector::GetNumberOfPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeoVector的用法示例。


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

示例1: SetupVectorScaling

bool ShpReader::SetupVectorScaling(VectorMapModelPtr vectorMapModel, ProgressDlgPtr progressDlg)
{
	double minX,minY,maxX,maxY;
	double aspect,width,height,scaleFactor;
	if ( App::Inst().GetLayerTreeController()->GetNumMapLayers() >0 )
	{
		MapControllerPtr mapController= App::Inst().GetLayerTreeController()->GetLayerTreeModel()->GetStudy(0)->GetMapLayer(0)->GetMapController();
		FileHeader* header=mapController->GetMapModel()->GetHeader();
		minX=header->projExtents.x;
		maxX=header->projExtents.dx;
		minY=header->projExtents.y;
		maxY=header->projExtents.dy;
		aspect = header->projExtents.Height() / header->projExtents.Width();		
		width = 2.0;
		height = 2.0*aspect;
		scaleFactor = 2.0 / header->projExtents.Width();
	}
	else{
		minX=vectorMapModel->GetVectorBoundary_MinX();
		minY=vectorMapModel->GetVectorBoundary_MinY();
		maxX=vectorMapModel->GetVectorBoundary_MaxX();
		maxY=vectorMapModel->GetVectorBoundary_MaxY();		
		aspect = fabs((maxY-minY) / (maxX-minX));
		width = 2.0;
		height = 2.0*aspect;
		scaleFactor = 2.0 / fabs(maxX-minX);
	}

	double scaledextent_minX= -1.0f + 2*((vectorMapModel->GetVectorBoundary_MinX() - minX) / fabs(maxX-minX));
	double scaledextent_minY = (1.0f + -2*((vectorMapModel->GetVectorBoundary_MinY() - minY) / fabs(maxY-minY)))*aspect;
	double scaledextent_maxX= -1.0f + 2*((vectorMapModel->GetVectorBoundary_MaxX() - minX) / fabs(maxX-minX));
	double scaledextent_maxY = (1.0f + -2*((vectorMapModel->GetVectorBoundary_MaxY() - minY) / fabs(maxY-minY)))*aspect;

	vectorMapModel->SetAspect(aspect);
	vectorMapModel->SetVectorBoundary_ScaledMinX(scaledextent_minX);
	vectorMapModel->SetVectorBoundary_ScaledMinY(scaledextent_minY);
	vectorMapModel->SetVectorBoundary_ScaledMaxX(scaledextent_maxX);
	vectorMapModel->SetVectorBoundary_ScaledMaxY(scaledextent_maxY);
	

	for ( unsigned int currGeometry = 0; currGeometry < vectorMapModel->GetNumberOfGeometries(); currGeometry++ )
	{
		GeoVector* GeoVector = vectorMapModel->GetGeoVector( currGeometry );

		for ( unsigned int currPoint = 0; currPoint < GeoVector->GetNumberOfPoints(); currPoint++ )
		{
			GeoVector->pointX[currPoint] = -1.0f + 2*((GeoVector->pointX[currPoint] - minX) / fabs(maxX-minX));
			GeoVector->pointY[currPoint] = (1.0f + -2*((GeoVector->pointY[currPoint] - minY) / fabs(maxY-minY)))*aspect;
		}

		if(progressDlg)
		{
			if(!progressDlg->Update(int(50 + (float(currGeometry)/vectorMapModel->GetNumberOfGeometries())*50)))
				return false;
		}
	}
	
	
	

	return true;
}
开发者ID:BioinformaticsArchive,项目名称:gengis,代码行数:62,代码来源:ShpReader.cpp


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