public abstract class SoVolumeWriter extends SoFieldContainer
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.
SoVRLdmFileWriter writer = new SoVRLdmFileWriter(); // set parameters writer.headerFilename.setValue( "myFile.ldm" ); writer.dimension.setValue( 128, 128, 128 ); writer.extent.setValue( -1,-1,-1, 1,1,1 ); // Initialize writer.initialize(); // Write data if ( writer.isDataConverted() ) { SoLDMTileID tileID = new SoLDMTileID( 0 ); SoCpuBufferObject tileBuffer = new SoCpuBufferObject(); writer.writeTile( tileID, tileBuffer ); } else { int sliceIndex = 0; SbBox2i32 subSlice = new SbBox2i32( 0,0, 128,128 ); SoCpuBufferObject sliceBuffer = new SoCpuBufferObject(); writer.writeSubSlice( sliceIndex, subSlice, sliceBuffer ); } // Finalize writer.finish();
See also:
Modifier and Type | Class and Description |
---|---|
static class |
SoVolumeWriter.WordFormats
Endianess.
|
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFEnum<SoDataSet.DataTypes> |
dataType
Type of input data (that will be given in the writeXXX method) .
|
SoSFVec3i32 |
dimension
Dimension of dataset, in voxels.
|
SoSFBox3f |
extent
Extent of dataset.
|
static int |
WF_BIG_ENDIAN
Deprecated.
Use
SoVolumeWriter.WordFormats.WF_BIG_ENDIAN instead. |
static int |
WF_LITTLE_ENDIAN
Deprecated.
Use
SoVolumeWriter.WordFormats.WF_LITTLE_ENDIAN instead. |
SoSFEnum<SoVolumeWriter.WordFormats> |
wordFormat
Endianess of data.
|
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and Description |
---|---|
boolean |
closeAllHandles()
Close all ressources that are locked by the writer so that someone else can read or write to them.
|
boolean |
finish()
Finish writing the file, free ressources, ...
|
boolean |
initialize()
Initialize writer.
|
boolean |
isDataConverted()
Returns true if the data is already organized in tiles for the LDM module.
|
boolean |
restoreAllHandles()
Restore ressources that was closed by
closeAllHandles . |
boolean |
writeSubSlice(int sliceIndex,
SbBox2i32 subSlice,
SoBufferObject buffer)
Writes the data contained in the specified subslice.
|
boolean |
writeTile(SoLDMTileID tileId,
SoBufferObject buffer)
Given a tileID, writes a tile if the data is organized in tiles (see
SoLDMTileID ). |
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable, touch
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int WF_BIG_ENDIAN
SoVolumeWriter.WordFormats.WF_BIG_ENDIAN
instead.@Deprecated public static final int WF_LITTLE_ENDIAN
SoVolumeWriter.WordFormats.WF_LITTLE_ENDIAN
instead.public final SoSFBox3f extent
public final SoSFVec3i32 dimension
public final SoSFEnum<SoDataSet.DataTypes> dataType
public final SoSFEnum<SoVolumeWriter.WordFormats> wordFormat
public boolean writeTile(SoLDMTileID tileId, SoBufferObject buffer)
SoLDMTileID
).
isDataConverted()
return true.
Must be reimplemented in children classes.
Please refer to SoLDMTileID
and SoLDMTopoOctree
for relation between tileId and tile position.
public boolean initialize()
public boolean closeAllHandles()
public boolean finish()
public boolean restoreAllHandles()
closeAllHandles
.public boolean isDataConverted()
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.
public boolean writeSubSlice(int sliceIndex, SbBox2i32 subSlice, SoBufferObject buffer)
isDataConverted()
return false.
Must be reimplemented in children classes.
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com