Property node that sets the current dataset id More...
#include <LDM/nodes/SoDataSetId.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoDataSetId () | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoSFInt32 | id |
When using multiple SoDataSet nodes, the dataSet id uniquely identifies each data set used in the compositing. It also specifies the OpenGL texture unit in which the textures for each data set will be stored for use by GLSL shader programs when doing render compositing.
If an SoDataSetId node is traversed before a data set node (SoDataSet, SoVolumeData, etc), the data set node's dataSetId field is ignored and the id from the SoDataSetId node is used.
In some cases we want to combine multiple data textures where each data texture comes from a different data set (SoVolumeData) node. In that case we could simply use each data set node's dataSetId field to assign each data texture a unique id. However it is also possible to create multiple data textures from a single data set using the SoVolumeTransform node. In this case the same data set node will be instanced in the scene graph multiple times (although its data will only be loaded in CPU memory once), but we still need to assign each data texture a unique id. This can be done using SoDataSetId nodes to specify a different data set id for each instance of the data set node. For example:
SoDataSetId* dataSetId1 = new SoDataSetId(); dataSetId1->id = 1; SoDataSetId* dataSetId2 = new SoDataSetId(); dataSetId2->id = 2; SoMultiDataSeparator* multiDataSep = new SoMultiDataSeparator(); multiDataSep->addChild( volumeShader ); // Shader to combine volumes multiDataSep->addChild( volumeTransform1 ); multiDataSep->addChild( dataSetId1 ); multiDataSep->addChild( volumeData ); multiDataSep->addChild( volumeTransform2 ); multiDataSep->addChild( dataSetId2 ); multiDataSep->addChild( volumeData ); // Same data node instanced again multiDataSep->addChild( volumeRender ); root->addChild( multiDataSep );
id | 1 |
SoDataSetId::SoDataSetId | ( | ) |
Constructor.
static SoType SoDataSetId::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoNode.
virtual SoType SoDataSetId::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoNode.
Data set id.
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 using SoDataSet::getMaxNumDataSet.