Coin Logo http://www.sim.no
http://www.coin3d.org

SoVolumeReader.h
1 #ifndef COIN_SOVOLUMEREADER_H
2 #define COIN_SOVOLUMEREADER_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the SIM Voleon visualization library.
7  * Copyright (C) 2003-2004 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using SIM Voleon with software that can not be combined with
16  * the GNU GPL, and for taking advantage of the additional benefits
17  * of our support services, please contact Systems in Motion about
18  * acquiring a SIM Voleon Professional Edition License.
19  *
20  * See <URL:http://www.coin3d.org/> for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * <URL:http://www.sim.no/>.
24  *
25 \**************************************************************************/
26 
27 #include <VolumeViz/nodes/SoVolumeData.h>
28 
29 class SbBox2s;
30 class SbBox3f;
31 class SbVec3s;
32 
33 
34 class SIMVOLEON_DLL_API SoVolumeReader {
35 public:
36  SoVolumeReader(void);
37  virtual ~SoVolumeReader();
38 
39  virtual void setUserData(void * data);
40  virtual int getNumSignificantBits(void);
41 
42  virtual void getDataChar(SbBox3f & size, SoVolumeData::DataType & type,
43  SbVec3s & dim) = 0;
44 
45  enum CopyPolicy { COPY, NO_COPY, NO_COPY_AND_DELETE };
46 
47  virtual void getSubSlice(SbBox2s & slice, int slicenumber, void * voxels) = 0;
48  virtual SbBool getSubVolume(SbBox3s & volume, void * voxels);
49  virtual SbBool getSubVolume(const SbBox3s & volume,
50  const SbVec3s subsamplelevel, void *& voxels);
51  virtual SbBool getSubVolumeInfo(SbBox3s & volume,
52  SbVec3s reqsubsamplelevel,
53  SbVec3s & subsamplelevel,
54  SoVolumeReader::CopyPolicy & policy);
55 
56  SbVec3s getNumVoxels(SbVec3s realsize, SbVec3s subsamplinglevel) const;
57  SbVec3s getSizeToAllocate(SbVec3s realsize, SbVec3s subsamplinglevel) const;
58 
59  int setFilename(const char * filename);
60 
61 protected:
62  void * getBuffer(int64_t offset, unsigned int size);
63  int bytesToInt(unsigned char * ptr, int sizeBytes);
64  void swapBytes(int * intPtr, int sizeBytes);
65  int64_t fileSize(void);
66 
67  void * m_data;
68 
69 private:
70  friend class SoVolumeReaderP;
71  class SoVolumeReaderP * pimpl;
72 
73  // FIXME: SoVolumeData shouldn't really access m_data, as voxel data
74  // should be stored within SoVolumeData, and not on this pointer.
75  // 20041008 mortene.
76  friend class SoVolumeData; // For m_data access.
77 };
78 
79 #endif // !COIN_SOVOLUMEREADER_H
The main interface for setting up volume data sets.
Definition: SoVolumeData.h:45
Abstract superclass for all volume data reader classes.
Definition: SoVolumeReader.h:34

Copyright © 1998-2004 by Systems in Motion AS. All rights reserved.

Generated on Fri Jul 31 2015 13:47:24 for SIMVoleon by Doxygen. 1.8.9.1