OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

osgarchive


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission
View previous topic :: View next topic  
Author Message
Mathieu MARACHE
Guest





PostPosted: Fri Feb 20, 2009 3:40 pm    Post subject:
osgarchive
Reply with quote

Hi Robert,

I was trying to use the archive output of osgdem without success when
I eventually found out that it was now disabled (the mailing list
archive tells me it is because of multithreaded write issues with
vpn). I then decided to use osgarchive to make it myself from the
generated output. However if one of the insert parameters is a
directory, it won't be able to find them. The attached versions
corrects this.

Index: osgarchive.cpp
===================================================================
--- osgarchive.cpp (revision 9808)
+++ osgarchive.cpp (working copy)
@@ -79,7 +79,12 @@
else if (fileType==osgDB::DIRECTORY)
{
osgDB::DirectoryContents directory =
osgDB::getDirectoryContents(arguments[pos]);
-
files.insert(files.end(),directory.begin(),directory.end());
+ osgDB::DirectoryContents::iterator it = directory.begin();
+ while( it != directory.end())
+ {
+ files.push_back(filePath + "/" + (*it));
+ ++it;
+ }
}
}
else


now "osgarchive --archive hf.osga --insert hf.ive hf_root_L0_X0_Y0"
will work as (I) expected.

However, when using the newly made osga archive, the PageLoader finds
only the first level of the generated PageLOD DB.
Let me detail a bit, is the file layout inside hf.osga (I sorted to
have the first levels)

hf.ive
hf_root_L0_X0_Y0/hf_L0_X0_Y0_subtile.ive
hf_root_L0_X0_Y0/hf_L1_X0_Y0_subtile.ive
hf_root_L0_X0_Y0/hf_L2_X0_Y0_subtile.ive
hf_root_L0_X0_Y0/hf_L2_X0_Y1_subtile.ive
hf_root_L0_X0_Y0/hf_L2_X1_Y0_subtile.ive
hf_root_L0_X0_Y0/hf_L2_X1_Y1_subtile.ive
...

"osgviewer hf.osga" will load hf.ive from the archive, then
hf_root_L0_X0_Y0/hf_L0_X0_Y0_subtile.ive also from the archive, but
then will never find hf_root_L0_X0_Y0/hf_L1_X0_Y0_subtile.ive (with
DEBUG_INFO turned on it is clear that the DatabasePager doesn't look
into the archive anymore for files)

Any idea of what's going wrong ? Maybe the attached hf.txt would help
(I snipped out the very verbose not related things )

regards,

--
Mathieu
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Fri Feb 20, 2009 5:28 pm    Post subject:
osgarchive
Reply with quote

Thanks Mathieu, changes merge with svn/trunk and OSG-2.8.

On Fri, Feb 20, 2009 at 3:40 PM, Mathieu MARACHE
<> wrote:
Quote:
Hi Robert,

I was trying to use the archive output of osgdem without success when
I eventually found out that it was now disabled (the mailing list
archive tells me it is because of multithreaded write issues with
vpn). I then decided to use osgarchive to make it myself from the
generated output. However if one of the insert parameters is a
directory, it won't be able to find them. The attached versions
corrects this.

Index: osgarchive.cpp
===================================================================
--- osgarchive.cpp (revision 9808)
+++ osgarchive.cpp (working copy)
@@ -79,7 +79,12 @@
else if (fileType==osgDB::DIRECTORY)
{
osgDB::DirectoryContents directory =
osgDB::getDirectoryContents(arguments[pos]);
-
files.insert(files.end(),directory.begin(),directory.end());
+ osgDB::DirectoryContents::iterator it = directory.begin();
+ while( it != directory.end())
+ {
+ files.push_back(filePath + "/" + (*it));
+ ++it;
+ }
}
}
else


now "osgarchive --archive hf.osga --insert hf.ive hf_root_L0_X0_Y0"
will work as (I) expected.

However, when using the newly made osga archive, the PageLoader finds
only the first level of the generated PageLOD DB.
Let me detail a bit, is the file layout inside hf.osga (I sorted to
have the first levels)

hf.ive
hf_root_L0_X0_Y0/hf_L0_X0_Y0_subtile.ive
hf_root_L0_X0_Y0/hf_L1_X0_Y0_subtile.ive
hf_root_L0_X0_Y0/hf_L2_X0_Y0_subtile.ive
hf_root_L0_X0_Y0/hf_L2_X0_Y1_subtile.ive
hf_root_L0_X0_Y0/hf_L2_X1_Y0_subtile.ive
hf_root_L0_X0_Y0/hf_L2_X1_Y1_subtile.ive
...

"osgviewer hf.osga" will load hf.ive from the archive, then
hf_root_L0_X0_Y0/hf_L0_X0_Y0_subtile.ive also from the archive, but
then will never find hf_root_L0_X0_Y0/hf_L1_X0_Y0_subtile.ive (with
DEBUG_INFO turned on it is clear that the DatabasePager doesn't look
into the archive anymore for files)

Any idea of what's going wrong ? Maybe the attached hf.txt would help
(I snipped out the very verbose not related things )

regards,

--
Mathieu
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org






------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Bug fix for osgb serializer, and osgA... Aurelien Submission 2 Wed Jun 18, 2014 2:31 pm View latest post
No new posts osgarchive and PagedLOD SMesserschmidt General 1 Tue Sep 24, 2013 5:53 pm View latest post
No new posts How to use osgArchive to write textur... Yansi Yao General 1 Thu Nov 22, 2012 7:05 am View latest post
No new posts [osg]How to use osgArchive to package... Yansi Yao General 0 Wed Nov 21, 2012 10:28 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP