本文整理汇总了C++中ossimFilename类的典型用法代码示例。如果您正苦于以下问题:C++ ossimFilename类的具体用法?C++ ossimFilename怎么用?C++ ossimFilename使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ossimFilename类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: open
ossimErrorCode ossimVpfDatabaseHeader::open(const ossimFilename& databaseHeaderTable)
{
vpf_table_type tableTypeData;
if( is_vpf_table( databaseHeaderTable.c_str() ) )
{
tableTypeData = vpf_open_table(databaseHeaderTable.c_str(),
(storage_type)DISK,
"rb",
NULL);
if(isDatabaseHeaderTable(tableTypeData))
{
}
else
{
return ossimErrorCodes::OSSIM_ERROR;
}
}
else
{
return ossimErrorCodes::OSSIM_ERROR;
}
return ossimErrorCodes::OSSIM_OK;
}
示例2:
std::shared_ptr<ossim::ifstream> ossimStreamFactoryRegistry::createIFStream(
const ossimFilename& file, std::ios_base::openmode openMode) const
{
std::shared_ptr<ossim::ifstream>result(0);
for(ossim_uint32 idx = 0; ((idx < theFactoryList.size())&&(!result)); ++idx)
{
result = theFactoryList[idx]->createIFStream(file, openMode);
}
if(!result)
{
if(file.exists())
{
// there is a bug in gcc < 5.0 and we can't use constructors in the
// C++11 build. Will refactor to do a new ifstream then use open
//
result = std::make_shared<ossim::ifstream>();
result->open(file.c_str(), openMode);
if(!result->is_open())
{
result.reset();
}
}
}
return result;
}
示例3: openTable
bool ossimVpfTable::openTable(const ossimFilename& tableName)
{
closeTable();
if(is_vpf_table(const_cast<char*>(tableName.c_str())))
{
if(theTableInformation)
{
delete theTableInformation;
theTableInformation = NULL;
}
theTableInformation = new vpf_table_type;
memset(theTableInformation, 0, sizeof(vpf_table_type));
theTableName = tableName;
*theTableInformation = vpf_open_table(const_cast<char*>(tableName.c_str()),
disk,
"rb",
NULL);
}
else
{
delete theTableInformation;
theTableInformation = NULL;
return false;
}
return true;
}
示例4: isFiltered
bool ossimImageUtil::isFiltered(const ossimFilename& file) const
{
bool result = false;
if ( file.size() )
{
// Strip full path to base name.
std::string baseName = file.file().string();
if ( baseName.size() )
{
std::vector<std::string>::const_iterator i = m_filteredImages.begin();
while ( i != m_filteredImages.end() )
{
if ( baseName == (*i) )
{
result = true;
break;
}
++i;
}
}
}
#if 0 /* Please leave for debug. (drb) */
if(traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< "ossimFileWalker::isFiltered file " << (result?"filtered: ":"not filtered: ")
<< file << "\n";
}
#endif
return result;
}
示例5: writeDotRpfFiles
// Note: throws ossimException on error.
void ossimRpfUtil::writeDotRpfFiles( const ossimFilename& aDotTocFile,
const ossimFilename& outputDir )
{
static const char MODULE[] = "ossimRpfUtil::writeDotRpfFiles";
if ( traceDebug() )
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " entered..."
<< "\na.toc file: " << aDotTocFile
<< "\noutput directory: " << outputDir
<< "\n";
}
// Parse the a.toc file:
ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc();
if ( toc->parseFile(aDotTocFile) != ossimErrorCodes::OSSIM_OK )
{
std::string e = MODULE;
e += " ERROR:\nCould not open: ";
e+= aDotTocFile.string();
throw ossimException(e);
}
if ( outputDir.expand().exists() == false )
{
if ( !outputDir.createDirectory(true, 0775) )
{
std::string e = MODULE;
e += " ERROR:\nCould not create directory: ";
e+= outputDir.c_str();
throw ossimException(e);
}
}
//---
// Go through the entries...
//---
ossim_uint32 entries = toc->getNumberOfEntries();
for (ossim_uint32 entry = 0; entry < entries; ++entry)
{
const ossimRpfTocEntry* tocEntry = toc->getTocEntry(entry);
if (tocEntry)
{
if ( tocEntry->isEmpty() == false )
{
writeDotRpfFile(toc.get(), tocEntry, outputDir, entry);
}
}
else
{
std::string e = MODULE;
e += " ERROR: Null entry: ";
e += ossimString::toString(entry).string();
throw ossimException(e);
}
}
} // End: ossimRpfUtil::writeDotRpfFiles
示例6: ossimNotify
bool ossimplugins::ossimRadarSat2TiffReader::open(const ossimFilename& file)
{
static const char MODULE[] = "ossimplugins::ossimRadarSat2TiffReader::open";
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " entered...\n"
<< "file: " << file << "\n";
}
bool result = false;
if ( isOpen() )
{
close();
}
// Check extension to see if it's xml.
if ( file.ext().downcase() == "xml" )
{
ossimXmlDocument* xdoc = new ossimXmlDocument();
if ( xdoc->openFile(file) )
{
// See if it's a TerraSAR-X product xml file.
if ( isRadarSat2ProductFile(xdoc) )
{
ossimString s;
ossimRadarSat2ProductDoc helper;
if ( helper.getImageFile(xdoc, s) )
{
ossimFilename imageFile = file.expand().path();
imageFile = imageFile.dirCat(s);
setFilename(imageFile);
result = ossimTiffTileSource::open();
if (result)
{
theProductXmlFile = file;
completeOpen();
}
}
}
}
delete xdoc;
xdoc = 0;
} // matches: if ( file.ext().downcase() == "xml" )
if (traceDebug())
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " exit status = " << (result?"true":"false\n")
<< std::endl;
}
return result;
}
示例7: setLut
void ossimIndexToRgbLutFilter::setLut(const ossimFilename& file)
{
theLutFile = file;
if(file.exists())
{
ossimKeywordlist kwl(file.c_str());
loadState(kwl);
}
}
示例8: importHistogram
bool ossimMultiResLevelHistogram::importHistogram(const ossimFilename& file)
{
if( file.fileSize() > 0 )
{
theHistogramFile = file;
ifstream input(file.c_str());
return importHistogram(input);
}
return false;
}
示例9: displayImage
void ossimQtSingleImageWindow::displayImage(const ossimFilename& file)
{
ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(file);
if (!ih)
{
QString caption = "Sorry:";
QString text = "Could not find the image handler for file:\n";
text += file.c_str();
QMessageBox::information( this,
caption,
text,
QMessageBox::Ok );
return;
}
if (ih->getNumberOfDecimationLevels() == 1)
{
QString caption("Question:");
QString text = "Would you like to build reduced resolution data sets?\n";
text += "Note:\n";
text += "This can take some time depending on the size of your image.";
text += "\nAlternatively use the command line application: \"img2rr\"";
int answer = QMessageBox::question( this,
caption,
text,
QMessageBox::Yes,
QMessageBox::No);
if (answer == QMessageBox::Yes)
{
//---
// We need to listen for the open overview signal to rebuild the
// theResolutionLevelMenu.
//---
ih->addListener(this);
buildOverViews( ih.get() );
}
}
createImageChain( ih.get() );
// Build the resolution level menu.
buildResolutionLevelMenu();
// Give it to the widget.
theImageWidget->connectMyInputTo(theImageChain.get());
theImageWidget->refresh();
connectMyInputTo(theImageChain.get());
QString caption = "iview : ";
caption += file.file().c_str();
setCaption(caption);
}
示例10: catch
bool ossimH5Info::open(const ossimFilename& file)
{
bool result = false;
// Check for empty filename.
if (file.size())
{
try
{
//--
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
//---
H5::Exception::dontPrint();
if ( H5::H5File::isHdf5( file.string() ) )
{
m_file = file;
result = true;
}
}
catch( const H5::FileIException& error )
{
error.printError();
}
// catch failure caused by the DataSet operations
catch( const H5::DataSetIException& error )
{
error.printError();
}
// catch failure caused by the DataSpace operations
catch( const H5::DataSpaceIException& error )
{
error.printError();
}
// catch failure caused by the DataSpace operations
catch( const H5::DataTypeIException& error )
{
error.printError();
}
catch( ... )
{
}
}
return result;
}
示例11: open
bool ossimNitfInfo::open(const ossimFilename& file)
{
bool result = false;
std::string connectionString = file.c_str();
std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
if ( str )
{
result = open(str, connectionString);
}
return result;
}
示例12: in
//**************************************************************************
// CONSTRUCTOR
//**************************************************************************
ossimDtedUhl::ossimDtedUhl(const ossimFilename& dted_file, ossim_int32 offset)
:
theRecSen(),
theField2(),
theLonOrigin(),
theLatOrigin(),
theLonInterval(),
theLatInterval(),
theAbsoluteLE(),
theSecurityCode(),
theNumLonLines(),
theNumLatPoints(),
theMultipleAccuracy(),
theStartOffset(0),
theStopOffset(0)
{
if(!dted_file.empty())
{
// Check to see that dted file exists.
if(!dted_file.exists())
{
theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedUhl::ossimDtedUhl: The DTED file does not exist: " << dted_file << std::endl;
return;
}
// Check to see that the dted file is readable.
if(!dted_file.isReadable())
{
theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedUhl::ossimDtedUhl: The DTED file is not readable --> " << dted_file << std::endl;
return;
}
std::ifstream in(dted_file.c_str());
if(!in)
{
theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedUhl::ossimDtedUhl: Error opening the DTED file: " << dted_file << std::endl;
return;
}
in.seekg(offset);
parse(in);
in.close();
}
}
示例13: move
static void move( const ossimFilename& in, const ossimFilename& out )
{
#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
std::string moveCommand = "ren";
#else
std::string moveCommand = "mv";
#endif
std::string command = moveCommand;
command += " ";
command += in.string();
command += " ";
command += out.string();
cout << "Executing " << command << endl;
system(command.c_str());
}
示例14: tileFile
//*************************************************************************************************
//! Reads the TIL file for pertinent info. Returns TRUE if successful
//*************************************************************************************************
bool ossimQuickbirdRpcModel::parseTileData(const ossimFilename& image_file)
{
ossimFilename tileFile (image_file);
tileFile.setExtension("TIL");
if (!findSupportFile(tileFile))
return false;
ossimQuickbirdTile tileHdr;
if(!tileHdr.open(tileFile))
return false;
ossimQuickbirdTileInfo info;
if(!tileHdr.getInfo(info, image_file.file()))
return false;
if((info.theUlXOffset != OSSIM_INT_NAN) && (info.theUlYOffset != OSSIM_INT_NAN) &&
(info.theLrXOffset != OSSIM_INT_NAN) && (info.theLrYOffset != OSSIM_INT_NAN) &&
(info.theLlXOffset != OSSIM_INT_NAN) && (info.theLlYOffset != OSSIM_INT_NAN) &&
(info.theUrXOffset != OSSIM_INT_NAN) && (info.theUrYOffset != OSSIM_INT_NAN))
{
theImageClipRect = ossimIrect(ossimIpt(info.theUlXOffset, info.theUlYOffset),
ossimIpt(info.theUrXOffset, info.theUrYOffset),
ossimIpt(info.theLrXOffset, info.theLrYOffset),
ossimIpt(info.theLlXOffset, info.theLlYOffset));
}
else if ((info.theUlXOffset != OSSIM_INT_NAN) && (info.theUlYOffset != OSSIM_INT_NAN) &&
(theImageClipRect.width() != OSSIM_INT_NAN) && (theImageClipRect.height() != OSSIM_INT_NAN))
{
theImageClipRect = ossimIrect(info.theUlXOffset, info.theUlYOffset,
info.theUlXOffset+theImageClipRect.width()-1,
info.theUlYOffset+theImageClipRect.height()-1);
}
return true;
}
示例15: getModelFromExtFile
ossimRefPtr<ossimNitfRsmModel> getModelFromExtFile( const ossimFilename& file )
{
ossimRefPtr<ossimNitfRsmModel> result = 0;
if ( file.exists() )
{
result = new ossimNitfRsmModel();
if ( result->parseFile( file, 0 ) ) // Hard coded entry index of 0 for now.
{
cout << "Initialize from ext file success!" << endl;
}
else
{
result = 0;
cerr << "Could not open: " << file << endl;
}
}
else
{
cerr << "File does not exists: " << file << endl;
}
return result;
} // End: getModelFromExtFile(...)