本文整理汇总了C++中ossimRefPtr::lineSampleHeightToWorld方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimRefPtr::lineSampleHeightToWorld方法的具体用法?C++ ossimRefPtr::lineSampleHeightToWorld怎么用?C++ ossimRefPtr::lineSampleHeightToWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimRefPtr
的用法示例。
在下文中一共展示了ossimRefPtr::lineSampleHeightToWorld方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testIpts
void testIpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl )
{
if ( model.valid() )
{
cout << std::setfill(' ') << setiosflags(ios::left);
const std::string ID_KW = "itest_id";
const std::string IPT_KW = "itest_ipt";
const std::string IPT_GT_KW = "itest_gt"; // ground truth
const std::string IPT_HGT_KW = "itest_hgt";
const ossim_uint32 POINTS = kwl.numberOf( ID_KW.c_str() );
// Test data height values can be in feet.
ossimUnitType heightUnits = OSSIM_METERS;
std::string key = "itest_height_units";
std::string value = kwl.findKey( key );
if ( value.size() )
{
cout << key << ": " << value << "\n";
if ( value == "feet" )
{
heightUnits = OSSIM_FEET;
}
}
// Test the pixel type.
ossim_float64 iptShift = 0.0;
key = "pixel_type";
value = kwl.findKey( key );
if ( value.size() )
{
if ( value == "area" )
{
iptShift = -0.5;
cout << key << ": " << value << "\n";
cout << "input_line_sample_shift: " << iptShift << "\n";
}
}
cout << "\nitest begin ********************************\n\n"
<< "number_of_line_sample_points: " << POINTS << "\n";
ossim_uint32 foundPts = 0;
ossim_uint32 i = 0;
while ( foundPts < POINTS )
{
// ID:
key = ID_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
cout << "itest_id" << std::setw(9) << i << ": " << value << "\n";
}
// Image point, sample, line:
key = IPT_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
ossimDpt ipt; // image point
ossimGpt wpt; // world point
ossimGpt gt; // ground truth
ossimDpt gtd; // wpt to gt delta
ossimDpt rtp; // round trip point
ossimDpt rtd; // round trip delta;
ipt.toPoint( value );
ipt.x += iptShift;
ipt.y += iptShift;
cout << "itest_ipt" << std::setw(8) << i << ": " << value << "\n";
// Get the height above ellipsoid:
ossim_float64 hgt = 0.0;
key = IPT_HGT_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
ossimString os ( value );
hgt = os.toFloat64();
if ( heightUnits == OSSIM_FEET )
{
hgt *= MTRS_PER_FT;
}
}
else
{
cerr << "missing height above ellipsoid for point! Using 0.0."
<< endl;
}
cout << "itest_hgt" << std::setw(8) << i << ": " << value << "\n";
model->lineSampleHeightToWorld( ipt, hgt, wpt );
cout << "itest_wpt" << std::setw(8) << i << ": " << wpt << "\n";
//.........这里部分代码省略.........
示例2: testGpts
void testGpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl )
{
if ( model.valid() )
{
cout << std::setfill(' ') << setiosflags(ios::left);
const std::string ID_KW = "gtest_id";
const std::string GPT_KW = "gtest_gpt";
const ossim_uint32 POINTS = kwl.numberOf( ID_KW.c_str() );
cout << "\ngtest begin ********************************\n\n"
<< "number_of_points_world_points: " << POINTS << "\n";
ossim_uint32 foundPts = 0;
ossim_uint32 i = 0;
std::string key;
std::string value;
while ( foundPts < POINTS )
{
// ID:
key = ID_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
cout << "gtest_id" << std::setw(6) << i << ": " << value << "\n";
}
// World point :
key = GPT_KW + ossimString::toString( i ).string();
value = kwl.findKey( key );
if ( value.size() )
{
ossimDpt ipt; // image point
ossimGpt wpt; // world point
ossimGpt rtp; // round trip point
ossimDpt rtd; // round trip delta;
wpt.toPoint( value );
cout << "gtest_gpt" << std::setw(5) << i << ": " << wpt << "\n";
model->worldToLineSample( wpt, ipt );
if ( wpt.hasNans() == false )
{
model->lineSampleHeightToWorld( ipt, wpt.hgt, rtp );
rtd.x = wpt.lon - rtp.lon;
rtd.y = wpt.lat - rtp.lat;
cout << "gtest_ipt" << std::setw(5) << i << ": " << ipt << "\n"
<< "gtest_rtp" << std::setw(5) << i << ": " << rtp << "\n"
<< "gtest_rtd" << std::setw(5) << i << ": " << rtd << "\n\n";
}
else
{
cerr << "model->worldToLineSample(...) result has nans!\n"
<< wpt << endl;
}
++foundPts;
}
++i;
if ( i > POINTS+100 )
{
break;
}
}
cout << "\ngtest end **********************************\n\n";
}
} // End: testGpts