Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoVolumeWriter Class Referenceabstract

Large Data Management Abstract base class for volume data writer. More...

#include <LDM/writers/SoVolumeWriter.h>

+ Inheritance diagram for SoVolumeWriter:

Public Types

enum  WordFormat {
  WF_BIG_ENDIAN = 0 ,
  WF_LITTLE_ENDIAN = 1
}
 Endianess. More...
 

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
virtual SbBool initialize ()
 Initialize writer.
 
virtual SbBool closeAllHandles ()
 Close all ressources that are locked by the writer so that someone else can read or write to them.
 
virtual SbBool restoreAllHandles ()
 Restore ressources that was closed by closeAllHandles.
 
virtual SbBool isDataConverted () const =0
 Returns TRUE if the data is already organized in tiles for the LDM module.
 
virtual SbBool writeTile (const SoLDMTileID &tileId, SoBufferObject *buffer)
 Given a tileID, writes a tile if the data is organized in tiles (see SoLDMTileID).
 
virtual SbBool writeSubSlice (int sliceIndex, const SbBox2i32 &subSlice, SoBufferObject *buffer)
 Writes the data contained in the specified subslice.
 
virtual SbBool finish ()
 Finish writing the file, free ressources, ... depending on kind of writer.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Public Attributes

SoSFBox3f extent
 Extent of dataset.
 
SoSFVec3i32 dimension
 Dimension of dataset, in voxels.
 
SoSFEnum dataType
 Type of input data (that will be given in the writeXXX method) Use enum SoDataSet::DataType.
 
SoSFEnum wordFormat
 Endianess of data.
 

Detailed Description

Large Data Management Abstract base class for volume data writer.

Base class used to write volume data. Data are generally organised by tiles (like in LDM) or by slices (like in DICOM).

The isDataConverted() method must be reimplemented in derived classes and return TRUE if the data is organized in tiles. In this case, the writeTile() method MUST be implemented and will be used to write data.

If isDataConverted() returns FALSE, the writeSubSlice() method MUST be implemented and will be used to write data.

EXAMPLE

SEE ALSO

SoVRLdmFileWriter, SoVRMemoryWriter

Definition at line 147 of file SoVolumeWriter.h.

Member Enumeration Documentation

◆ WordFormat

Endianess.

Big endian or little endian.

Enumerator
WF_BIG_ENDIAN 
WF_LITTLE_ENDIAN 

Definition at line 172 of file SoVolumeWriter.h.

Member Function Documentation

◆ closeAllHandles()

virtual SbBool SoVolumeWriter::closeAllHandles ( )
virtual

Close all ressources that are locked by the writer so that someone else can read or write to them.

For example, if the writer write to a file, this method must close the file so that someone else can re-open it in read mode.

Reimplemented in SoVRLdmFileWriter.

◆ finish()

virtual SbBool SoVolumeWriter::finish ( )
virtual

Finish writing the file, free ressources, ... depending on kind of writer.

Reimplemented in SoVRLdmFileWriter.

◆ getClassTypeId()

static SoType SoVolumeWriter::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getTypeId()

virtual SoType SoVolumeWriter::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Implements SoTypedObject.

Reimplemented in SoVRLdmFileWriter, and SoVRMemoryWriter.

◆ initialize()

virtual SbBool SoVolumeWriter::initialize ( )
virtual

Initialize writer.

Allocates memory and other resources depending on the kind of writer.
By default do nothing.

Reimplemented in SoVRLdmFileWriter, and SoVRMemoryWriter.

◆ isDataConverted()

virtual SbBool SoVolumeWriter::isDataConverted ( ) const
pure virtual

Returns TRUE if the data is already organized in tiles for the LDM module.


In other words, all writers that directly support the writeTile() method should return TRUE from isDataConverted.

If TRUE is returned, VolumeViz will use the writeTile method and will not call writeSubVolume() or writeSubSlice().

Must be reimplemented in children classes.

Implemented in SoVRLdmFileWriter, and SoVRMemoryWriter.

◆ restoreAllHandles()

virtual SbBool SoVolumeWriter::restoreAllHandles ( )
virtual

Restore ressources that was closed by closeAllHandles.

Reimplemented in SoVRLdmFileWriter.

◆ writeSubSlice()

virtual SbBool SoVolumeWriter::writeSubSlice ( int  sliceIndex,
const SbBox2i32 subSlice,
SoBufferObject buffer 
)
virtual

Writes the data contained in the specified subslice.

This function must be called only if isDataConverted() return FALSE.

Must be reimplemented in children classes.

Reimplemented in SoVRMemoryWriter.

◆ writeTile()

virtual SbBool SoVolumeWriter::writeTile ( const SoLDMTileID tileId,
SoBufferObject buffer 
)
virtual

Given a tileID, writes a tile if the data is organized in tiles (see SoLDMTileID).


This function must be called only if isDataConverted() return TRUE.

Must be reimplemented in children classes.

Please refer to SoLDMTileID and SoLDMTopoOctree for relation between tileId and tile position.

Reimplemented in SoVRLdmFileWriter.

Member Data Documentation

◆ dataType

SoSFEnum SoVolumeWriter::dataType

Type of input data (that will be given in the writeXXX method) Use enum SoDataSet::DataType.

Default is UNSIGNED_BYTE.

Definition at line 163 of file SoVolumeWriter.h.

◆ dimension

SoSFVec3i32 SoVolumeWriter::dimension

Dimension of dataset, in voxels.

Default is empty.

Definition at line 157 of file SoVolumeWriter.h.

◆ extent

SoSFBox3f SoVolumeWriter::extent

Extent of dataset.

Default is (-1, -1, -1, 1, 1, 1)

Definition at line 154 of file SoVolumeWriter.h.

◆ wordFormat

SoSFEnum SoVolumeWriter::wordFormat

Endianess of data.

Use enum WordFormat. Default is current machine endianess.

Definition at line 169 of file SoVolumeWriter.h.


The documentation for this class was generated from the following file: