It is currently Sat Aug 22, 2020 4:28 am


All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: LargeVolume broken?
PostPosted: Fri Dec 27, 2013 11:39 pm 

Joined: Sat Dec 21, 2013 3:41 pm
Posts: 10
Code:
LargeVolume<uint16_t> data(Region(Vector3DInt32(0, 0, 0), Vector3DInt32(256, 256, 256)));
      data.setVoxelAt(Vector3DInt32(10,10,10), 1);
      int w = data.getWidth();


Calling setVoxelAt throws uhandled runtime exception pointing to
Code:
m_pPager->pageIn(reg, pBlock);
in LargeVolume.inl at line 639

If I comment out
Code:
setVoxelAt
it sets
Code:
w
to some strange value, eg. -65555

I'm using mvc++ 10 and dev branch from few days ago.

SimpleVolume worked nicely and was able to extract surface with it.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume broken?
PostPosted: Sat Dec 28, 2013 9:32 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Yes... it looks like there could be an issue here. The LargeVolume is supposed to have pager and compressor objects but the constructor you have used does not set these up. I've forgotten what my logic was here... did I mean to check them for null before using them? I don't remember, but the important point is that you are going to want to set them up to get the benefits of the LargeVolume.

To do this, use the other constructor. You can find some code in 'TestVolume' as an example:

Code:
TestVolume::TestVolume()
{
   Region region(-57, -31, 12, 64, 96, 131); // Deliberatly awkward size

   //m_pCompressor = new RLECompressor<int32_t, uint16_t>;
   m_pBlockCompressor = new MinizBlockCompressor<int32_t>;
   m_pFilePager = new FilePager<int32_t>("./");

   //Create the volumes
   m_pRawVolume = new RawVolume<int32_t>(region);
   m_pSimpleVolume = new SimpleVolume<int32_t>(region);
   m_pLargeVolume = new LargeVolume<int32_t>(region, m_pBlockCompressor, m_pFilePager, 32);


The LargeVolume does work and we are using it in Cubiquity. That said, SimpleVolume is easier and you can probably have hundreds or millions of voxels before worrying too much about memory. Actually, we do have plans to merge these into a single volume type but I'll talk more about that in the future.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net