本文整理汇总了C++中ossimFilename::trim方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimFilename::trim方法的具体用法?C++ ossimFilename::trim怎么用?C++ ossimFilename::trim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimFilename
的用法示例。
在下文中一共展示了ossimFilename::trim方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setFilename
bool ossimGeneralRasterElevHandler::setFilename(const ossimFilename& file)
{
if(file.trim() == "")
{
return false;
}
theFilename = file;
ossimFilename hdrFile = file;
ossimFilename geomFile = file;
theGeneralRasterInfo.theFilename = file;
theGeneralRasterInfo.theWidth = 0;
theGeneralRasterInfo.theHeight = 0;
theNullHeightValue = ossim::nan();
hdrFile = hdrFile.setExtension("omd");
geomFile = geomFile.setExtension("geom");
if(!hdrFile.exists()||
!geomFile.exists())
{
return false;
}
ossimKeywordlist kwl(hdrFile);
if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
{
return false;
}
kwl.add(ossimKeywordNames::FILENAME_KW,
file.c_str(),
true);
ossimGeneralRasterInfo generalInfo;
if(!generalInfo.loadState(kwl))
{
return false;
}
if(generalInfo.numberOfBands() != 1)
{
ossimNotify(ossimNotifyLevel_WARN) << "ossimGeneralRasterElevHandler::initializeInfo WARNING:The number of bands are not specified in the header file" << std::endl;
return false;
}
kwl.clear();
if(kwl.addFile(geomFile))
{
theGeneralRasterInfo.theNullHeightValue = generalInfo.getNullPixelValue(0);
theGeneralRasterInfo.theImageRect = generalInfo.imageRect();
theGeneralRasterInfo.theUl = theGeneralRasterInfo.theImageRect.ul();
theGeneralRasterInfo.theLr = theGeneralRasterInfo.theImageRect.lr();
theGeneralRasterInfo.theWidth = theGeneralRasterInfo.theImageRect.width();
theGeneralRasterInfo.theHeight = theGeneralRasterInfo.theImageRect.height();
theGeneralRasterInfo.theImageRect = generalInfo.imageRect();
theGeneralRasterInfo.theByteOrder = generalInfo.getImageDataByteOrder();
theGeneralRasterInfo.theScalarType = generalInfo.getScalarType();
theGeneralRasterInfo.theBytesPerRawLine = generalInfo.bytesPerRawLine();
//add by simbla
theGeneralRasterInfo.theGeometry = new ossimImageGeometry;
if(!theGeneralRasterInfo.theGeometry->loadState(kwl))
{
theGeneralRasterInfo.theGeometry = 0;
}
if(!theGeneralRasterInfo.theGeometry.valid())
{
return false;
}
ossimGpt defaultDatum;
ossimGpt ulGpt;
ossimGpt urGpt;
ossimGpt lrGpt;
ossimGpt llGpt;
theGeneralRasterInfo.theDatum = defaultDatum.datum();
theGeneralRasterInfo.theGeometry->localToWorld(theGeneralRasterInfo.theImageRect.ul(), ulGpt);
theGeneralRasterInfo.theGeometry->localToWorld(theGeneralRasterInfo.theImageRect.ur(), urGpt);
theGeneralRasterInfo.theGeometry->localToWorld(theGeneralRasterInfo.theImageRect.lr(), lrGpt);
theGeneralRasterInfo.theGeometry->localToWorld(theGeneralRasterInfo.theImageRect.ll(), llGpt);
ulGpt.changeDatum(theGeneralRasterInfo.theDatum);
urGpt.changeDatum(theGeneralRasterInfo.theDatum);
lrGpt.changeDatum(theGeneralRasterInfo.theDatum);
llGpt.changeDatum(theGeneralRasterInfo.theDatum);
theMeanSpacing = theGeneralRasterInfo.theGeometry->getMetersPerPixel().y;
theGroundRect = ossimGrect(ulGpt, urGpt, lrGpt, llGpt);
theGeneralRasterInfo.theWgs84GroundRect = ossimDrect(ulGpt, urGpt, lrGpt, llGpt, OSSIM_RIGHT_HANDED);
theNullHeightValue = theGeneralRasterInfo.theNullHeightValue;
}
else
{
return false;
}
return true;
}