Added support of archiving into osgTerrain::DataSet and osgdem.
This commit is contained in:
@@ -99,7 +99,8 @@ int main( int argc, char **argv )
|
||||
{
|
||||
if (insert)
|
||||
{
|
||||
osgDB::FileType fileType = osgDB::fileType(arguments[pos]);
|
||||
std::string filePath = osgDB::findDataFile(arguments[pos]);
|
||||
osgDB::FileType fileType = osgDB::fileType(filePath);
|
||||
if (fileType==osgDB::REGULAR_FILE)
|
||||
{
|
||||
files.push_back(arguments[pos]);
|
||||
@@ -110,10 +111,6 @@ int main( int argc, char **argv )
|
||||
files.insert(files.end(),directory.begin(),directory.end());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
files.push_back(arguments[pos]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,13 +149,17 @@ int main( int argc, char **argv )
|
||||
osgDB::Archive archive;
|
||||
archive.open(archiveFilename, osgDB::Archive::WRITE);
|
||||
|
||||
std::cout<<"Going through files"<<files.size()<<std::endl;
|
||||
|
||||
for (FileNameList::iterator itr=files.begin();
|
||||
itr!=files.end();
|
||||
++itr)
|
||||
{
|
||||
std::cout<<" Tring to read"<<*itr<<std::endl;
|
||||
osg::ref_ptr<osg::Object> obj = osgDB::readObjectFile(*itr);
|
||||
if (obj.valid())
|
||||
{
|
||||
std::cout<<" Have read"<<*itr<<std::endl;
|
||||
archive.writeObject(*obj, *itr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ int main( int argc, char **argv )
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-d <filename>","Specify the digital elevation map input file to process");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-t <filename>","Specify the texture map input file to process");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-m <filename>","Specify the 3D database model input file to process");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-a <archivename>","Specify the archive to place the generated database");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-o <outputfile>","Specify the output master file to generate");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-l <numOfLevels>","Specify the number of PagedLOD levels to generate");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-e <x> <y> <w> <h>","Extents of the model to generate");
|
||||
@@ -263,6 +264,8 @@ int main( int argc, char **argv )
|
||||
std::string comment;
|
||||
while (arguments.read("--comment",comment)) { dataset->setCommentString(comment); }
|
||||
|
||||
std::string archiveName;
|
||||
while (arguments.read("-a",archiveName)) { dataset->setArchiveName(archiveName); }
|
||||
|
||||
dataset->setDestinationTileBaseName("output");
|
||||
dataset->setDestinationTileExtension(".ive");
|
||||
|
||||
Reference in New Issue
Block a user