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


C++ ossimIrect::midPoint方法代码示例

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


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

示例1: gridSize

void ossimH5GridModel::initializeModelParams(ossimIrect imageBounds)
{
   theLatGrid.enableExtrapolation();
   theLonGrid.enableExtrapolation();
   theHeightEnabledFlag = false;

   // NOTE: it is assumed that the grid size and spacing is the same for ALL grids:
   ossimIpt gridSize (theLatGrid.size());
   ossimDpt spacing  (theLatGrid.spacing());
   ossimDpt v[4];
   v[0].lat = theLatGrid.getNode(0,0);
   v[0].lon = theLonGrid.getNode(0,0);
   v[1].lat = theLatGrid.getNode(gridSize.x-1, 0);
   v[1].lon = theLonGrid.getNode(gridSize.x-1, 0);
   v[2].lat = theLatGrid.getNode(gridSize.x-1, gridSize.y-1);
   v[2].lon = theLonGrid.getNode(gridSize.x-1, gridSize.y-1);
   v[3].lat = theLatGrid.getNode(0, gridSize.y-1);
   v[3].lon = theLonGrid.getNode(0, gridSize.y-1);

   if ( m_crossesDateline )
   {
      // Longitude values between 0 and 360.
      m_boundGndPolygon = ossimPolygon(4, v);
   }
   
   // Guaranty longitude values are -180 to 180
   for (int i=0; i<4; ++i)
   {
      if (v[i].lon > 180.0) v[i].lon -= 360.0;
   }

   theBoundGndPolygon = ossimPolygon(4, v);

   if ( !m_crossesDateline )
   {
      // Longitude values between -180 and 180.
      m_boundGndPolygon = theBoundGndPolygon;
   }
   
   theImageSize  = ossimDpt(imageBounds.width(), imageBounds.height());
   theRefImgPt   = imageBounds.midPoint();
   theRefGndPt.lat = theLatGrid(theRefImgPt);
   theRefGndPt.lon = theLonGrid(theRefImgPt);
   
   ossimDpt ref_ip_dx (theRefImgPt.x+1.0, theRefImgPt.y    );
   ossimDpt ref_ip_dy (theRefImgPt.x    , theRefImgPt.y+1.0);
   ossimGpt ref_gp_dx (theLatGrid(ref_ip_dx), theLonGrid(ref_ip_dx));
   ossimGpt ref_gp_dy (theLatGrid(ref_ip_dy), theLonGrid(ref_ip_dy));

   theGSD.x   = theRefGndPt.distanceTo(ref_gp_dx);
   theGSD.y   = theRefGndPt.distanceTo(ref_gp_dy);

   theMeanGSD = (theGSD.line + theGSD.samp)/2.0;
   theImageClipRect  = imageBounds;

   // Image is clipped to valid rect so no sub image offset.
   theSubImageOffset = ossimDpt(0.0, 0.0); //imageBounds.ul();

   theRefGndPt.limitLonTo180();

   // debugDump();
   
} // End: initializeModelParams
开发者ID:bradh,项目名称:ossim-plugins,代码行数:63,代码来源:ossimH5GridModel.cpp


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