本文整理汇总了C++中ossimDrect::hasNans方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimDrect::hasNans方法的具体用法?C++ ossimDrect::hasNans怎么用?C++ ossimDrect::hasNans使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimDrect
的用法示例。
在下文中一共展示了ossimDrect::hasNans方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersects
//*******************************************************************
// Public Method:
//*******************************************************************
bool ossimDrect::intersects(const ossimDrect& rect) const
{
if(rect.hasNans() || hasNans())
{
return false;
}
if (theOrientMode != rect.theOrientMode)
return false;
ossim_float64 ulx = ossim::max(rect.ul().x,ul().x);
ossim_float64 lrx = ossim::min(rect.lr().x,lr().x);
ossim_float64 uly, lry;
bool rtn=false;
if (theOrientMode == OSSIM_LEFT_HANDED)
{
uly = ossim::max(rect.ul().y,ul().y);
lry = ossim::min(rect.lr().y,lr().y);
rtn = ((ulx <= lrx) && (uly <= lry));
}
else
{
uly = ossim::max(rect.ll().y,ll().y);
lry = ossim::min(rect.ur().y,ur().y);
rtn = ((ulx <= lrx) && (uly <= lry));
}
return (rtn);
}
示例2: completely_within
//*******************************************************************
// Public Method: ossimDrect::completely_within
//*******************************************************************
bool ossimDrect::completely_within(const ossimDrect& rect) const
{
if(hasNans() || rect.hasNans())
{
return false;
}
if (theOrientMode != rect.theOrientMode)
return false;
/* --------------
| 1 |
| ---------- |
| | | |
| | | |
| | 2 | |
| | | |
| | | |
| ---------- |
| |
-------------- */
bool rtn = true;
if (theUlCorner.x < rect.ul().x)
rtn = false;
else if (theLrCorner.x > rect.lr().x)
rtn = false;
else if (theOrientMode == OSSIM_LEFT_HANDED)
{
if (theUlCorner.y < rect.ul().y)
rtn = false;
else if (theLrCorner.y > rect.lr().y)
rtn = false;
}
else
{
if (theUlCorner.y > rect.ul().y)
rtn = false;
else if (theLrCorner.y < rect.lr().y)
rtn = false;
}
return rtn;
}
示例3: intersects
bool ossimAnnotationMultiPolyObject::intersects(const ossimDrect& rect)const
{
// do the quick checks first
//
if(rect.hasNans()) return false;
if(!rect.intersects(theBoundingRect)) return false;
if(theMultiPolygon.size()<1) return false;
for(ossim_uint32 i =0; i < theMultiPolygon.size(); ++i)
{
vector<ossimPolygon> result;
if(theMultiPolygon[i].clipToRect(result, rect))
{
return true;
}
}
return false;
}
示例4: clipToRect
//*******************************************************************
// Public Method: ossimDrect::clipToRect
//*******************************************************************
ossimDrect ossimDrect::clipToRect(const ossimDrect& rect)const
{
ossimDrect result;
result.makeNan();
if(rect.hasNans() || hasNans())
{
return result;
}
if (theOrientMode != rect.theOrientMode)
return (*this);
double x0 = ossim::max(rect.ul().x, ul().x);
double x1 = ossim::min(rect.lr().x, lr().x);
double y0, y1;
if (theOrientMode == OSSIM_LEFT_HANDED)
{
y0 = ossim::max(rect.ll().y, ll().y);
y1 = ossim::min(rect.ur().y, ur().y);
if( (x1 < x0) || (y1 < y0) )
return result;
else
result = ossimDrect(x0, y0, x1, y1, theOrientMode);
}
else
{
y0 = ossim::max(rect.ll().y,ll().y);
y1 = ossim::min(rect.ur().y,ur().y);
if((x0 <= x1) && (y0 <= y1))
{
result = ossimDrect(x0, y1, x1, y0, theOrientMode);
}
}
return result;
}
示例5: getScaleChangeImageToView
void ossimImageViewTransform::getScaleChangeImageToView(ossimDpt& result,
const ossimDrect& imageRect)
{
result.makeNan();
if(!imageRect.hasNans())
{
ossimDpt vul;
ossimDpt vur;
ossimDpt vlr;
ossimDpt vll;
imageToView(imageRect.ul(),
vul);
imageToView(imageRect.ur(),
vur);
imageToView(imageRect.lr(),
vlr);
imageToView(imageRect.ll(),
vll);
if(!vul.hasNans()&&
!vur.hasNans()&&
!vlr.hasNans()&&
!vll.hasNans())
{
double deltaTop = (vul - vur).length();
double deltaBottom = (vll - vlr).length();
double deltaRight = (vur - vlr).length();
double w = imageRect.width();
double h = imageRect.height();
result.x = (deltaTop/w + deltaBottom/w)*.5;
result.y = (deltaRight/h + deltaRight/h)*.5;
}
}
}
示例6: getScaleChangeViewToImage
void ossimImageViewTransform::getScaleChangeViewToImage(ossimDpt& result,
const ossimDrect& viewRect)
{
result.makeNan();
if(!viewRect.hasNans())
{
ossimDpt iul;
ossimDpt iur;
ossimDpt ilr;
ossimDpt ill;
imageToView(viewRect.ul(),
iul);
imageToView(viewRect.ur(),
iur);
imageToView(viewRect.lr(),
ilr);
imageToView(viewRect.ll(),
ill);
if(!iul.hasNans()&&
!iur.hasNans()&&
!ilr.hasNans()&&
!ill.hasNans())
{
double deltaTop = (iul - iur).length();
double deltaBottom = (ill - ilr).length();
double deltaRight = (iur - ilr).length();
double w = viewRect.width();
double h = viewRect.height();
result.x = (deltaTop/w + deltaBottom/w)*.5;
result.y = (deltaRight/h + deltaRight/h)*.5;
}
}
}