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


C++ StelProjectorP::getFov方法代码示例

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


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

示例1: draw

double StelGeodesicGridDrawer::draw(StelCore* core, int maxSearchLevel)
{
	const StelProjectorP prj = core->getProjection();
	StelPainter sPainter(prj);
	StelGeodesicGrid* geodesicGrid = core->getGeodesicGrid();

	const GeodesicSearchResult* geodesic_search_result = geodesicGrid->search(prj->unprojectViewport(), maxSearchLevel);
	
	glDisable(GL_TEXTURE_2D);
	glEnable(GL_BLEND);	
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode
	core->setCurrentFrame(StelCore::FrameJ2000);	// set 2D coordinate
	sPainter.setColor(0.2,0.3,0.2);
	
	int lev = (int)(7./pow(prj->getFov(), 0.4))+2;
	if (lev>geodesicGrid->getMaxLevel()) 
		lev = geodesicGrid->getMaxLevel();

	lev = maxSearchLevel;
	Vec3d win1, win2;
	int index;
	Vec3d v0, v1, v2;
	{
		GeodesicSearchInsideIterator it1(*geodesic_search_result, lev);
		while((index = it1.next()) >= 0)
		{
			Vec3d center(0);
			geodesicGrid->getTriangleCorners(lev, index, v0, v1, v2);
			prj->project(v0, win1);
			prj->project(v1, win2);
			center += win1;
			sPainter.drawLine2d(win1[0],win1[1], win2[0],win2[1]);
			prj->project(v1, win1);
			prj->project(v2, win2);
			sPainter.drawLine2d(win1[0],win1[1], win2[0],win2[1]);
			center += win1;
			prj->project(v2, win1);
			prj->project(v0, win2);
			sPainter.drawLine2d(win1[0],win1[1], win2[0],win2[1]);
			center += win1;
			center*=0.33333;
			QString str = QString("%1 (%2)").arg(index)
			                                .arg(geodesicGrid->getPartnerTriangle(lev, index));
			glEnable(GL_TEXTURE_2D);
				prj->drawText(font,center[0]-6, center[1]+6, str);
			glDisable(GL_TEXTURE_2D);
		}
	}
	GeodesicSearchBorderIterator it1(*geodesic_search_result, lev);
	while((index = it1.next()) >= 0)
	{
		Vec3d center(0);
		geodesicGrid->getTriangleCorners(lev, index, v0, v1, v2);
		prj->project(v0, win1);
		prj->project(v1, win2);
		center += win1;
		sPainter.drawLine2d(win1[0],win1[1], win2[0],win2[1]);
		prj->project(v1, win1);
		prj->project(v2, win2);
		sPainter.drawLine2d(win1[0],win1[1], win2[0],win2[1]);
		center += win1;
		prj->project(v2, win1);
		prj->project(v0, win2);
		sPainter.drawLine2d(win1[0],win1[1], win2[0],win2[1]);
		center += win1;
		center*=0.33333;
		QString str = QString("%1 (%2)").arg(index)
		                                .arg(geodesicGrid->getPartnerTriangle(lev, index));
		glEnable(GL_TEXTURE_2D);
			prj->drawText(font,center[0]-6, center[1]+6, str);
		glDisable(GL_TEXTURE_2D);
	}
	
	return 0.;
}
开发者ID:Astrocoderguy,项目名称:stellarium,代码行数:75,代码来源:GeodesicGridDrawer.cpp


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