[vtkusers] About Volume Rendering in VTK
Lisa Avila
lisa.avila at kitware.com
Tue Feb 22 13:50:52 EST 2005
Hello Juan,
The vtkUnstructuredGridVolumeRayCastMapper works on the scalars in your
data - either point data or cell data or you can point it to some field
data. These are the methods you need to look at:
// Description:
// Control how the filter works with scalar point data and cell attribute
// data. By default (ScalarModeToDefault), the filter will use point data,
// and if no point data is available, then cell data is used. Alternatively
// you can explicitly set the filter to use point data
// (ScalarModeToUsePointData) or cell data (ScalarModeToUseCellData).
// You can also choose to get the scalars from an array in point field
// data (ScalarModeToUsePointFieldData) or cell field data
// (ScalarModeToUseCellFieldData). If scalars are coming from a field
// data array, you must call SelectColorArray before you call
// GetColors.
vtkSetMacro(ScalarMode,int);
vtkGetMacro(ScalarMode,int);
void SetScalarModeToDefault() {
this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
void SetScalarModeToUsePointData() {
this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
void SetScalarModeToUseCellData() {
this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
void SetScalarModeToUsePointFieldData() {
this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);};
void SetScalarModeToUseCellFieldData() {
this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);};
// Description:
// When ScalarMode is set to UsePointFileData or UseCellFieldData,
// you can specify which array to use for coloring using these methods.
// The transfer function in the vtkVolumeProperty (attached to the calling
// vtkVolume) will decide how to convert vectors to colors.
virtual void SelectScalarArray(int arrayNum);
virtual void SelectScalarArray(const char* arrayName);
// Description:
// Get the array name or number and component to color by.
virtual char* GetArrayName() { return this->ArrayName; }
virtual int GetArrayId() { return this->ArrayId; }
virtual int GetArrayAccessMode() { return this->ArrayAccessMode; }
// Description:
// Return the method for obtaining scalar data.
const char *GetScalarModeAsString();
Lisa
At 06:33 PM 2/16/2005, Juan José Aja Fernández wrote:
>Hi.
>I've posted a couple of questions about volume rendering, but I guess
>they were too generic so I'm going to make it simple.
>
>I want to volume render an unstructured grid, so I guess I should use
>vtkUnstructuredGridVolumeRayCastFunction and Mapper.
>What I want to know is: What do I need to do this?
>
>I gues I will need a couple of points and voxels to define the grid.
>What else? Point Data or Cell Data?
>
>What I'm trying to say is: How does vtk does the volume rendering in
>unstructured grids? Does it work on the scalars of the grid?, or does
>it work on the point/cell Data?.
>
>
>Thanks in advance.
>
>Juan.
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list