Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

LargeVolume broken?
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=562
Page 1 of 1

Author:  Neomex [ Fri Dec 27, 2013 11:39 pm ]
Post subject:  LargeVolume broken?

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.

Author:  David Williams [ Sat Dec 28, 2013 9:32 am ]
Post subject:  Re: LargeVolume broken?

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.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/