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