Commit 310ae113 authored by Rick Avila's avatar Rick Avila
Browse files

BUG: Added methods to get/set ArrayComponent in vtkContourFilter. These...

BUG: Added methods to get/set ArrayComponent in vtkContourFilter. These methods were lost when vtkKitwareContourFilter was merged into vtkContourFilter. Also added a new test that exercises multiple components.
parent c939e4f5
......@@ -97,6 +97,7 @@ IF (VTK_USE_RENDERING)
mergeFilter
MultidimensionalSolution
multipleIso
multipleComponentContour
nacaBinary
NoLightGeneration
OBBCylinder
......
package require vtk
package require vtkinteraction
# get the interactor ui
## Graphics stuff
# Create the RenderWindow, Renderer and both Actors
#
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
vtkImageGaussianSource gs1
gs1 SetWholeExtent 0 31 0 31 0 31
gs1 SetCenter 10 16 16
gs1 SetMaximum 1000
gs1 SetStandardDeviation 7
vtkImageGaussianSource gs2
gs2 SetWholeExtent 0 31 0 31 0 31
gs2 SetCenter 22 16 16
gs2 SetMaximum 1000
gs2 SetStandardDeviation 7
vtkImageAppendComponents iac
iac AddInput [gs1 GetOutput]
iac AddInput [gs2 GetOutput]
vtkContourFilter cf1
cf1 SetInput [iac GetOutput]
cf1 SetValue 0 500
cf1 SetArrayComponent 0
vtkContourFilter cf2
cf2 SetInput [iac GetOutput]
cf2 SetValue 0 500
cf2 SetArrayComponent 1
vtkPolyDataMapper mapper1
mapper1 SetInput [cf1 GetOutput]
mapper1 SetImmediateModeRendering 1
mapper1 SetScalarRange 0 1
mapper1 SetScalarVisibility 0
mapper1 Update
vtkPolyDataMapper mapper2
mapper2 SetInput [cf2 GetOutput]
mapper2 SetImmediateModeRendering 1
mapper2 SetScalarRange 0 1
mapper2 SetScalarVisibility 0
vtkActor actor1
actor1 SetMapper mapper1
[actor1 GetProperty] SetColor 1 1 1
ren1 AddActor actor1
vtkActor actor2
actor2 SetMapper mapper2
[actor2 GetProperty] SetColor 1 0 0
ren1 AddActor actor2
# Add the actors to the renderer, set the background and size
#
ren1 SetBackground .3 .3 .3
renWin SetSize 400 400
# enable user interface interactor
iren AddObserver UserEvent {wm deiconify .vtkInteract}
iren Initialize
# prevent the tk window from showing up then start the event loop
wm withdraw .
......@@ -42,7 +42,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkContourFilter, "1.119");
vtkCxxRevisionMacro(vtkContourFilter, "1.120");
vtkStandardNewMacro(vtkContourFilter);
vtkCxxSetObjectMacro(vtkContourFilter,ScalarTree,vtkScalarTree);
......@@ -593,6 +593,18 @@ void vtkContourFilter::CreateDefaultLocator()
}
}
void vtkContourFilter::SetArrayComponent( int comp )
{
this->SynchronizedTemplates2D->SetArrayComponent( comp );
this->SynchronizedTemplates3D->SetArrayComponent( comp );
this->RectilinearSynchronizedTemplates->SetArrayComponent( comp );
}
int vtkContourFilter::GetArrayComponent()
{
return( this->SynchronizedTemplates2D->GetArrayComponent() );
}
int vtkContourFilter::FillInputPortInformation(int, vtkInformation *info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");
......
......@@ -130,6 +130,12 @@ public:
// specified. The locator is used to merge coincident points.
void CreateDefaultLocator();
// Description:
// Set/get which component of the scalar array to contour on; defaults to 0.
// Currently this feature only works if the input is a vtkImageData.
void SetArrayComponent( int );
int GetArrayComponent();
protected:
vtkContourFilter();
~vtkContourFilter();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment