本文整理汇总了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