Class SoDataSet
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.ldm.nodes.SoDataSet
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoVolumeData
public class SoDataSet extends SoNode
Data set node. This class specifies a data set and its properties, and also provides utilities for extracting a subset of the data set and for resampling the data set. The data can be read directly from a file or can be accessed via a user-defined volume reader. This class is the parent class of the VolumeViz data nodes:SoVolumeData
,SoHeightFieldGeometry
,SoHeightFieldProperty
, etc. Those nodes provide the data for VolumeViz rendering nodes:SoVolumeRender
,SoOrthoSlice
,SoObliqueSlice
, etc. SeeSoVolumeData
for more details about loading and managing volume data.The data set can be specified by:
- Setting the
fileName
field
This implies that the data set is stored on disk, in one of the file formats for which LDM has a built-in reader. LDM will automatically select a reader based on the file extension, for example ".am" for the AmiraMesh file format.
Calling the
setReader()
method
This is the most general method because an application can specify one of the standard LDM readers or implement a customized subclass ofSoVolumeReader
. LDM will get the data set properties (dimensions, size, data type, etc) and access the data through the specified reader object. This allows the application to completely control how, and from where, the data is loaded.SoDataSetId
,SoDataCompositor
,SoVolumeData
, SoMeshGeometry, SoMeshProperty
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoDataSet.DataTypes
Supported data type.class
SoDataSet.LDMDataModifier
Deprecated.As of Open Inventor 9.9, should usedataTransform
field instead ofsetLDMDataModifier(LDMDataModifier)
method.-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFBool
allocateResourceOnRender
Indicates if resource allocation is done only on first render traversal or as soon as the node is created.SoSFInt32
dataSetId
SoSFLDMDataTransform
dataTransform
If set to an appropriateSoLDMDataTransform
object, the object's transformFunction method is called after each tile is loaded, but before it is stored in main memory.SoSFBox3f
extent
The real size (extent) of the volume in modeling coordinates.SoSFFilePathString
fileName
Indicates the file location containing the data set.SoSFLDMResourceParameters
ldmResourceParameters
Contains anSoLDMResourceParameters
object which allows you to set LDM resource parameters.SoSFUShort
texturePrecision
For scalar (non-RGBA) data, specifies the size of voxel values on the GPU in bits.SoSFDouble
undefinedValue
Data with this value won't be rendered.SoSFBool
useCompressedTexture
Controls use of OpenGL lossy texture compression for RGBA data (if available).-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
callback(SoCallbackAction action)
static int
dataSize(SoDataSet.DataTypes dataType)
Returns the number of bytes per voxel of the specified data type.void
doAction(SoAction action)
int
editBoxes(java.util.Collection<SbVec3i32> boxCenters, int boxSize, double newValue)
Replace all voxels in the region defined by a list of boxes with the specified value.int
editSolidShape(SoNode solidShape, double value)
Replaces all voxels intersecting the given shape with the specified value.int
editSubVolume(SbBox3i32 subVolume, double value)
Replaces the contents of a subvolume with the specified value.int
editSubVolume(SbBox3i32 subVolume, SoBufferObject userData)
Replaces the contents of a subvolume with the given data.int
editSurfaceShape(SoNode surfaceShape, float thickness, double value)
Replaces all voxels intersecting the polygons or lines defined by the surfaceShape and given thickness with the specified value.int
editTile(SoLDMTileID tileId, double value)
Replaces the contents of a tile with the specified value.int
editTile(SoLDMTileID tileId, SoBufferObject userData)
Replaces the contents of a tile with the given data.boolean
finishEditing(int transactionId)
Terminates an editing transaction.void
getBoundingBox(SoGetBoundingBoxAction action)
int
getDataSize()
Returns the number of bytes per voxel in VolumeViz.SoDataSet.DataTypes
getDataType()
Returns the data type.int
getDatumSize()
Returns the number of bytes per voxel.SbVec3i32
getDimension()
Returns the data set dimension.double[]
getDoubleMinMax()
Returns min and max values of the data set.SoLDMDataAccess
getLdmDataAccess()
Returns a reference to theSoLDMDataAccess
object.SoLDMReader
getLDMReader()
Returns a pointer to the current data set reader object.SoLDMTopoOctree
getLDMTopoOctree()
Returns the LDMTopoOctree used by thisSoDataSet
.static int
getMaxNumDataSets()
Returns the maximum number of data sets that can be render composited on the current hardware (essentially the number of texture units - 1).long[]
getMinMax()
Returns min and max values of the data set data.int
getOverlapping()
Deprecated.As of Open Inventor 9000.SoVolumeReader
getReader()
Returns the current data set reader object.SbVec3i32
getTileDimension()
Returns the tile dimension.void
GLRender(SoGLRenderAction action)
void
handleEvent(SoHandleEventAction action)
boolean
hasEditedTile()
Returns true if DataSet has edited tiles.static boolean
isDataFloat(SoDataSet.DataTypes dataType)
Returns true if the given data type is a float data type.boolean
isDataInMemory(SoLDMTileID tileID)
Indicates whether the data attached to a tile is in main memory.static boolean
isDataSigned(SoDataSet.DataTypes dataType)
Returns true if the given data type is a signed integer data type.boolean
isInMemory(SoLDMTileID tileID)
Indicates whether a tile is in main memory.int
numSigBits()
Returns the number of significant bits.void
pick(SoPickAction action)
void
readTile(SoLDMTileID tileID, SoBufferObject buffer, boolean transform)
Copies the specified tile into the provided buffer.boolean
redoEditing(int transactionId)
Redo all modifications associated with the specified transaction id.void
resetReader()
Resets previously set custom reader setup by setReader call.void
setLDMDataModifier(SoDataSet.LDMDataModifier transformer)
Deprecated.As of Open Inventor 9.9, should usedataTransform
field instead.void
setLDMReader(SoLDMReader reader)
Sets the LDM volume reader object to use.void
setReader(SoVolumeReader reader)
Calls setReader(reader, false).void
setReader(SoVolumeReader reader, boolean takeOwnership)
This method allows the data to be read directly from the disk using the specified subclass ofSoVolumeReader
.int
startEditing()
Initiate an editing transaction.boolean
undoEditing(int transactionId)
Undo all modifications associated with the specified transaction id.void
useFakeData(SoLDMTileID name_10874, SoBufferObject name_10875)
Creates fake data in buffer.SbBox3f
voxelToXYZ(SbBox3f box)
Converts the specified box in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z).SbVec3f
voxelToXYZ(SbVec3f dataPosition)
Converts the specified point in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z).void
write(SoWriteAction action)
void
writeTile(SoLDMTileID tileID, SoBufferObject buffer, SoVolumeWriter writer)
Write the specified tile using the specified writer.SbBox3f
XYZToVoxel(SbBox3f xyzBox)
Converts the specified box in geometric coordinates to voxel coordinates.SbVec3f
XYZToVoxel(SbVec3f dataPosition)
Converts the specified point in geometric coordinates (X,Y,Z) to voxel coordinates (I,J,K).-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, copy, copy, distribute, getAlternateRep, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, isBoundingBoxIgnoring, isOverride, rayPick, search, setOverride, touch
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
dataSetId
public final SoSFInt32 dataSetId
When using multipleSoDataSet
nodes, thedataSetId
field uniquely identifies each data set used in the compositing. It also specifies the OpenGL texture unit in which the textures for this data set will be stored when doing render compositing. It is 1 by default (texture unit 0 is reserved for the color lookup table by default). The number of available texture units depends on your hardware. You can query this number usinggetMaxNumDataSets
.Note: The
SoDataSetId
node can also be used to define dataSetId. If anSoDataSetId
node is traversed before theSoDataSet
node, the id from theSoDataSetId
node is used and this field is ignored.- Since:
- Open Inventor 6.0
-
fileName
public final SoSFFilePathString fileName
Indicates the file location containing the data set. Default is an empty string. Depending on the file type, the correspondingSoVolumeReader
(if it exists) is used.File Extension Loader Class Description .am SoVRAmFileReader
Amira Mesh file format .dc3, .dic, .dicom SoVRDicomFileReader
Dicom file format .fld SoVRAvsFileReader
AVS field file format .lda or .ldm SoVRLdmFileReader
Large Data Management file format .sgy or .segy SoVRSegyFileReader
SEG Y revision 1 file format .vol SoVRVolFileReader
Vol file format .vox SoVRVoxFileReader
Vox file format .lst SoVRRasterStackReader
Lst file format The filename extension is not case sensitive.
Note:
SoDataSet
and its derived classes (SoVolumeData
, etc) do not search theSoInput
directory list to find files specified in this field. To check file existence and other properties theSbFileHelper
class may be useful.
-
useCompressedTexture
public final SoSFBool useCompressedTexture
Controls use of OpenGL lossy texture compression for RGBA data (if available). Default is true.A significant advantage of compressed textures is that they conserve texture memory space. At the moment, the extension works on RGBA textures only, not on paletted textures. The compression factor is about 5.
A potential drawback of compressed textures is that lossy compression can result in values on the GPU that are slightly different from the actual value in the volume. For example "gray scale" colors could have a slight color in some cases. You should always set this option to false when using "RGBA" data to store 32-bit "id" values.
-
texturePrecision
public final SoSFUShort texturePrecision
For scalar (non-RGBA) data, specifies the size of voxel values on the GPU in bits. The valid values are: 0 (default), 8 and 16.
When set to 0, LDM chooses the best precision based on the size of the data type (or if specified, the number of significant bits) - meaning that LDM will store 8-bit values on the GPU for 8-bit data and store 16-bit values for all other data types.There are several trade-offs influenced by this value, including:
- 8 bit values use less memory on the GPU than 16-bit values, allowing more data to be stored on the GPU. 8-bit values are adequate for many visualization tasks. But...
- If the specified (or chosen) precision is smaller than the data type, then LDM must
scale down the data values before sending them to the GPU.
- Limitation: This is currently unavoidable for 32-bit data.
- Down scaling adds some time whenever a tile of data must be sent to the GPU.
- In particular, all tiles currently stored on the GPU must be
rescaled if the application changes the data range (
SoDataRange
node).
Note: As a result, changing the data range may be slow for large volumes. - Down scaling also means "aliasing" data values, i.e. multiple data values may scale to the same value on the GPU.
- Since:
- Open Inventor 6.0
-
-
extent
public final SoSFBox3f extent
The real size (extent) of the volume in modeling coordinates. Default is -1,-1,-1 to 1,1,1.Note this can be used to define a volume with non-uniform voxel spacing. For example, if the volume dimensions (voxels) are 64x64x64, but the voxel spacing in Z is twice the X and Y spacing, then you might specify the volume size as -1 to 1 for X and Y but -2 to 2 for Z.
-
dataTransform
public final SoSFLDMDataTransform dataTransform
If set to an appropriateSoLDMDataTransform
object, the object's transformFunction method is called after each tile is loaded, but before it is stored in main memory. This allows you to modify the original data (for example, scaling or filtering) before it is displayed. Default is no transform.Note: Before Open Inventor 8.0, the data transformFunction was set using the setLDMDataModifier method. That method is now deprecated.
- Since:
- Open Inventor 8.0
-
allocateResourceOnRender
public final SoSFBool allocateResourceOnRender
Indicates if resource allocation is done only on first render traversal or as soon as the node is created. Default is true. It must be set to false if the dataset is not inserted in a scene graph but will be used for data access for example. Otherwise, memory resources will still remain on default value.
-
undefinedValue
public final SoSFDouble undefinedValue
Data with this value won't be rendered.
Default is NaN (Not a Number) which means that this value is not taken into account. Otherwise, value must be in agreement with data type. Limitations: There are several limitations in order for the undefined value to work :- The texturePrecision must be at least equal to the number of significant bits of the data type.
- The data type must be BYTE, SHORT (either SIGNED or UNSIGNED) or FLOAT
- The field is ignored in the following classes :
SoHeightFieldProperty
,SoHeightFieldPropertyMask
andSoVolumeMask
. Setting this field has no effect in these cases. - In the case of multiple
SoVolumeData
,the undefinedValue must be the same in allSoVolumeData
. If different values are provided, only the latest one on the state will be considered for the rendering.
- Since:
- Open Inventor 10.11
-
-
ldmResourceParameters
public final SoSFLDMResourceParameters ldmResourceParameters
Contains anSoLDMResourceParameters
object which allows you to set LDM resource parameters.
-
Method Detail
-
setLDMDataModifier
@Deprecated public void setLDMDataModifier(SoDataSet.LDMDataModifier transformer)
Deprecated.As of Open Inventor 9.9, should usedataTransform
field instead.This method allows you to modify the original data (for example, attribute calculation) before it's displayed. The modifyData method of the given LDMDataModifier is called after each tile is loaded.- Since:
- 6.0
-
setReader
public void setReader(SoVolumeReader reader)
Calls setReader(reader, false).
-
isDataInMemory
public boolean isDataInMemory(SoLDMTileID tileID)
Indicates whether the data attached to a tile is in main memory. Called when the node front manager evaluates the texture front.This allows to manage data that implements SoBufferAsyncInterface. If the specified tile does not implement SoBufferAsyncInterface then this method always returns true. So effectively it always returns true for non-LDM volumes.
-
dataSize
public static int dataSize(SoDataSet.DataTypes dataType)
Returns the number of bytes per voxel of the specified data type.
-
isInMemory
public boolean isInMemory(SoLDMTileID tileID)
Indicates whether a tile is in main memory. Called when the node front manager evaluates the texture front.
-
isDataSigned
public static boolean isDataSigned(SoDataSet.DataTypes dataType)
Returns true if the given data type is a signed integer data type.
-
voxelToXYZ
public SbVec3f voxelToXYZ(SbVec3f dataPosition)
Converts the specified point in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z). The geometric coordinates are expressed in "extent" space, where voxel coordinates are mapped to the box defined by the volume extent.The left bottom coordinate of the voxel is returned. Correctly converts coordinates that are outside the volume dimensions, but the resulting geometric coordinate is outside the volume extent.
-
getLDMReader
public SoLDMReader getLDMReader()
Returns a pointer to the current data set reader object.
The actual type will be a subclass ofSoVolumeReader
, either one of the predefined subclasses or an application-defined subclass. Returns NULL if no reader is currently being used (for example if setVolumeData() was called).
-
getLDMTopoOctree
public SoLDMTopoOctree getLDMTopoOctree()
Returns the LDMTopoOctree used by thisSoDataSet
. The LDMTopoOctree is initialized at the initialization of the reader.
-
getOverlapping
@Deprecated public int getOverlapping()
Deprecated.As of Open Inventor 9000. No longer used.Returns the tile border (overlap) in voxels. Since OIV 9.0 always returns 0.Warning Deprecated since Open Inventor 9000. No longer used.
-
resetReader
public void resetReader()
Resets previously set custom reader setup by setReader call.
-
XYZToVoxel
public SbVec3f XYZToVoxel(SbVec3f dataPosition)
Converts the specified point in geometric coordinates (X,Y,Z) to voxel coordinates (I,J,K). The geometric coordinates are expressed in "extent" space, where voxel coordinates are mapped to the box defined by the volume extent.Correctly converts coordinates that are outside the volume extent, but the resulting voxel coordinate is outside the volume dimensions.
-
voxelToXYZ
public SbBox3f voxelToXYZ(SbBox3f box)
Converts the specified box in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z). The geometric coordinates are expressed in "extent" space, where voxel coordinates are mapped to the box defined by the volume extent.Correctly converts coordinates that are outside the volume dimensions, but the resulting geometric coordinate is outside the volume extent.
-
getDatumSize
public int getDatumSize()
Returns the number of bytes per voxel.
-
getDimension
public SbVec3i32 getDimension()
Returns the data set dimension.
-
getTileDimension
public SbVec3i32 getTileDimension()
Returns the tile dimension.
-
getMaxNumDataSets
public static int getMaxNumDataSets()
Returns the maximum number of data sets that can be render composited on the current hardware (essentially the number of texture units - 1).
-
isDataFloat
public static boolean isDataFloat(SoDataSet.DataTypes dataType)
Returns true if the given data type is a float data type.
-
writeTile
public void writeTile(SoLDMTileID tileID, SoBufferObject buffer, SoVolumeWriter writer)
Write the specified tile using the specified writer. No operations are done on buffer (dataTransform or edition), the buffer is written as is. The writer must be initialized and handles must be properly set (seeSoVolumeReader.closeAllHandles
andSoVolumeWriter.restoreAllHandles
), ie. the current reader's handles must be closed, and the specified writer's handles must be opened.
-
XYZToVoxel
public SbBox3f XYZToVoxel(SbBox3f xyzBox)
Converts the specified box in geometric coordinates to voxel coordinates. The geometric coordinates are expressed in "extent" space, where voxel coordinates are mapped to the box defined by the volume extent.Correctly converts coordinates that are outside the volume extent, but the resulting voxel coordinate is outside the volume dimensions.
-
readTile
public void readTile(SoLDMTileID tileID, SoBufferObject buffer, boolean transform)
Copies the specified tile into the provided buffer.
Applies the data transformation (set in dataTransform field) if transform is true.
-
pick
public void pick(SoPickAction action)
-
getDataSize
public int getDataSize()
Returns the number of bytes per voxel in VolumeViz.
-
handleEvent
public void handleEvent(SoHandleEventAction action)
- Overrides:
handleEvent
in classSoNode
-
getReader
public SoVolumeReader getReader()
Returns the current data set reader object.
The actual type will be a subclass ofSoVolumeReader
, either one of the predefined subclasses or an application-defined subclass. Returns null if no reader is currently set. Applications should always verify the class type before using the returned object as a specific sub-class ofSoVolumeReader
.
-
setLDMReader
public void setLDMReader(SoLDMReader reader)
Sets the LDM volume reader object to use.
This method allows the data to be read directly from the disk using the specified subclass ofSoVolumeReader
.
-
write
public void write(SoWriteAction action)
-
getDoubleMinMax
public double[] getDoubleMinMax()
Returns min and max values of the data set.
Returns nullif the requested data is not available (for example, if no data set exists).
NOTE: This method might force LDM to load the entire data set if the volume reader does not respond to the getMinMax query. Normally for an LDM format data set, the min and max values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, LDM will load the entire data set to compute the min and max values. For a large data set this may take a long time.
-
callback
public void callback(SoCallbackAction action)
-
getDataType
public SoDataSet.DataTypes getDataType()
Returns the data type.
-
GLRender
public void GLRender(SoGLRenderAction action)
-
numSigBits
public int numSigBits()
Returns the number of significant bits.
-
getBoundingBox
public void getBoundingBox(SoGetBoundingBoxAction action)
- Overrides:
getBoundingBox
in classSoNode
-
getMinMax
public long[] getMinMax()
Returns min and max values of the data set data.
Returns nullif the requested data is not available (for example, if no data set exists).
NOTE: This method might force LDM to load the entire data set if the volume reader does not respond to the getMinMax query. Normally for an LDM format data set, the min and max values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, LDM will load the entire data set to compute the min and max values. For a large data set this may take a long time.
-
setReader
public void setReader(SoVolumeReader reader, boolean takeOwnership)
This method allows the data to be read directly from the disk using the specified subclass ofSoVolumeReader
. If the takeOwnership parameter is false (default), LDM will not delete the specified instance. Otherwise, LDM will automatically delete the specified instance, for example, when theSoDataSet
node is deleted. If filename is not set before setting the reader, LDM will display an error message just to warn that the reader has not opened any file yet. LDM continues to work as expected.Note: When using a custom reader, any reader method that changes the volume properties (dimension, size, data type, etc) should notify the
SoVolumeData
node by calling the reader'stouch()
method. If this notification is not done,SoDataSet
fields, for exampleSoDataSet.extent
, won't be updated correctly.
-
editSubVolume
public int editSubVolume(SbBox3i32 subVolume, SoBufferObject userData)
Replaces the contents of a subvolume with the given data.
The buffer size (in bytes) must match the subvolume size (in bytes) exactly. The subvolume is specified in voxel/cell coordinates. CallstartEditing()
before calling this method. Returns 0 if successful.Warning The modification may be postponed until the tiles are really needed. Therefore the contents of the userData buffer must not be modified until after saveEditing() is called.
-
editTile
public int editTile(SoLDMTileID tileId, double value)
Replaces the contents of a tile with the specified value.
CallstartEditing()
before calling this method. Returns 0 if successful.
-
editSubVolume
public int editSubVolume(SbBox3i32 subVolume, double value)
Replaces the contents of a subvolume with the specified value.
The subvolume is specified in voxel/cell coordinates. CallstartEditing()
before calling this method. Returns 0 if successful.
-
editTile
public int editTile(SoLDMTileID tileId, SoBufferObject userData)
Replaces the contents of a tile with the given data.
The buffer size (in bytes) must match the tile size (in bytes) exactly. CallstartEditing()
before calling this method. Returns 0 if successful.Warning The modification may be postponed until the tile is really needed. Therefore the contents of the userData buffer must not be modified until after saveEditing() is called.
-
getLdmDataAccess
public SoLDMDataAccess getLdmDataAccess()
Returns a reference to theSoLDMDataAccess
object.
This object can be used to query data from the volume.
-
startEditing
public int startEditing()
Initiate an editing transaction.
Returns true if successful and also returns a unique transaction id. This value is required for finishing the edit transaction (seefinishEditing()
) and for undo/redo (seeundoEditing()
andredoEditing()
). Multiple transactions may be active at the same time.
-
finishEditing
public boolean finishEditing(int transactionId)
Terminates an editing transaction.
Returns true if successful. May only be called with a valid transaction id returned by thestartEditing()
method. On error does nothing. The finish method will schedule a redraw so the correct data is displayed. To commit the edits, in other words to save the edited data back to the data source, call saveEditing().
-
redoEditing
public boolean redoEditing(int transactionId)
Redo all modifications associated with the specified transaction id. Returns true if successful. On error does nothing. May only be called after the specified transaction has been terminated (seefinishEditing()
method) and undone (seeundoEditing()
method). Schedules a redraw so the correct data is displayed.Note: Redo is no longer available after transactions are saved. After calling saveEditing(), the transaction ids are no longer valid and the modified data is the new reference.
-
hasEditedTile
public boolean hasEditedTile()
Returns true if DataSet has edited tiles.
-
useFakeData
public void useFakeData(SoLDMTileID name_10874, SoBufferObject name_10875)
Creates fake data in buffer.
-
undoEditing
public boolean undoEditing(int transactionId)
Undo all modifications associated with the specified transaction id. Returns true if successful. On error does nothing. May only be called after the specified transaction has been terminated (seefinishEditing()
method). Schedules a redraw so the correct data is displayed.Note: Undo is no longer available after transactions are saved. After calling saveEditing(), the transaction ids are no longer valid and the modified data is the new reference.
-
editSurfaceShape
public int editSurfaceShape(SoNode surfaceShape, float thickness, double value)
Replaces all voxels intersecting the polygons or lines defined by the surfaceShape and given thickness with the specified value. surfaceShape is defined in the same 3D space as the dataSet. thickness is defined in voxels. The surfaceShape can be deleted after calling this function.Call
startEditing()
before calling this method. Returns 0 if successful.Warning The modification may be postponed until the tiles are really needed. Therefore the surfaceShape node (and children if any) must not be modified until after saveEditing() is called.
-
editSolidShape
public int editSolidShape(SoNode solidShape, double value)
Replaces all voxels intersecting the given shape with the specified value. The geometry defined under solidShape must represent a list of closed surfaces otherwise the result is unpredictable. solidShape must not contain any lines or open polyhedrons (polyhedron with shapes). The result is based on the odd-winding rule, so the result is not necessarily the union or the intersection of the closed surfaces. If you want to voxelize lines or single polygons, see also theeditSurfaceShape
method.If the goal is to define a shape which is the result of the intersection/union of multiple closed surfaces, see the
SoCSGShape
node.solidShape is defined in the same 3D space as the dataSet. The solidShape can be deleted after calling this function.
Call
startEditing()
before calling this method. Returns 0 if successful.Warning The modification may be postponed until the tiles are really needed. Therefore the surfaceShape node (and children if any) must not be modified until after saveEditing() is called.
-
editBoxes
public int editBoxes(java.util.Collection<SbVec3i32> boxCenters, int boxSize, double newValue)
Replace all voxels in the region defined by a list of boxes with the specified value. boxCenter and boxSize are defined in ijk (voxel) space.Call
startEditing()
before calling this method. Returns 0 if successful.
-