Isosurface Generation Using VTK |
||||
VTK Basics |
||||
|
||||
3.5.1.4. Creating the Pipeline: vtkPolyDataMapper and vtkLODActor
You are here:
The pipeline so far is:
Studying the highlighted section: ·
“By
itself, this isosurface will be invisible unless some additional
configuration occurs. For this reason,
the user should be able to choose any color and amount of opacity of the
surface. In order to get better
interactive performance when manipulating the model, it might be helpful to
have the model have a lower level of details.” o
This section is a perfect example of filling
in the missing details. From reading
the previous sections, changing any sort of properties of an object requires
working with the VTK class vtkActor or vtkLODActor. Since the description mentions allowing the
model to have a “lower level of
details”, this means that using vtkLODActor is preferable to vtkActor. However, there is a missing link that is
needed to move to the vtkLODActor. Specifically, the data must be mapped to
geometry, and that task was not completed yet. So, it is necessary to add vtkPolyDataMapper
to the pipeline first before vtkLODActor. Details of the pipeline generation will be
given later in this page. §
In order to allow a specific color and opacity
to be used without any regard to the values in the image file, make sure to
call: ScalarVisibilityOff(). o
After adding the vtkPolyDataMapper
object to the pipeline with an attachment to vtkActor, it is now possible to
adjust the isosurface’s color and opacity in addition to adjusting the
specified detail level. §
To change the color, issue the following call:
GetProperty().SetColor( float
r, float g, float b ).
Substitute the appropriate values to obtain the desired color. §
To change the opacity, issue the following
call: GetProperty
().SetOpacity( float ). Substitute
the appropriate value to obtain the desired opacity. §
Finally, it is necessary to set a degree of
detail by specifying the number of cloud points. Pick any number that you think would be
sufficient using the call SetNumberOfCloudPoints(
int ). In order to add this object to the pipeline, issue a form of the
following command:
|
||||
|
||||
Creating
the Pipeline: vtkMarchingCubes /
vtkContourFitler |
|
|||