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


C++ ossimDpt::isNan方法代码示例

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


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

示例1: clip

//*******************************************************************
// Public Method: ossimDrect::clip
//*******************************************************************
bool ossimDrect::clip(ossimDpt &p1, ossimDpt &p2)const
{
    if(p1.isNan() || p2.isNan())
    {
        return false;
    }
    ossimDpt shift(-theUlCorner.x,
                   -theUlCorner.y);

    ossimDpt tempShiftP1 = p1+shift;
    ossimDpt tempShiftP2 = p2+shift;
    double maxW = width()-1;
    double maxH = height()-1;
    if (clip_1d (&tempShiftP1.x, &tempShiftP1.y,
                 &tempShiftP2.x, &tempShiftP2.y,
                 maxW) == 0)
    {
        return false;
    }
    if(clip_1d (&tempShiftP1.y,
                &tempShiftP1.x,
                &tempShiftP2.y,
                &tempShiftP2.x, maxH) == 0)
    {
        return false;
    }
    p1 = tempShiftP1-shift;
    p2 = tempShiftP2-shift;
    return true;
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:33,代码来源:ossimDrect.cpp

示例2: worldToLineSample

void ossimEquDistCylProjection::worldToLineSample(const ossimGpt &worldPoint,
                                                  ossimDpt&       lineSample)const
{
   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
   {
      ossimMapProjection::worldToLineSample(worldPoint, lineSample);
      
      return;
   }
   else
   {
      // make sure our tie point is good and world point
      // is good.
      //
      if(theUlEastingNorthing.isNan()||
         worldPoint.isLatNan() || worldPoint.isLonNan())
      {
         lineSample.makeNan();
         return;
      }
      // initialize line sample
      //   lineSample = ossimDpt(0,0);
      
      // I am commenting this code out because I am going to
      // move it to the ossimImageViewProjectionTransform.
      //
      // see if we have a datum set and if so
      // shift the world to our datum.  If not then
      // find the easting northing value for the world
      // point.
      if(theDatum)
      {
         ossimGpt gpt = worldPoint;
         
         gpt.changeDatum(theDatum);
         
         // lineSample is currently in easting northing
         // and will need to be converted to line sample.
         lineSample = forward(gpt);
      }
      else
      {
         // lineSample is currently in easting northing
         // and will need to be converted to line sample.
         lineSample = forward(worldPoint);
      }
      
      // check the final result to make sure there were no
      // problems.
      //
      if(!lineSample.isNan())
      {
         //       if(!isIdentityMatrix())
         //       {
         //          ossimDpt temp = lineSample;
         
         //          lineSample.x = theInverseTrans[0][0]*temp.x+
         //                         theInverseTrans[0][1]*temp.y+
         //                         theInverseTrans[0][2];
         
         //          lineSample.y = theInverseTrans[1][0]*temp.x+
         //                         theInverseTrans[1][1]*temp.y+
         //                         theInverseTrans[1][2];
         //       }
         //       else
         {
            lineSample.x = ((lineSample.x  - theUlEastingNorthing.x)/theMetersPerPixel.x);
            
            // We must remember that the Northing is negative since the positive
            // axis for an image is assumed to go down since it's image space.
            lineSample.y = (-(lineSample.y - theUlEastingNorthing.y)/theMetersPerPixel.y);
         }
      }
   }
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:75,代码来源:ossimEquDistCylProjection.cpp


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