本文整理汇总了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;
}