[vtkusers] Setting properties of a vtkAssembly
Derek Kivi
derek.kivi at cfx.aeat.com
Wed Dec 12 14:31:04 EST 2001
In my application I want to pick actors and assemblies and have them change
colors as they are picked.
I am able to change the color of the actors by setting the property of the
actors using $actor SetProperty Property, where the vtkProperty Property has
the color we want.
However, this does not work for the assemblies that are picked. The color
stays the same as it always was.
Several actors are added to each assembly using the AddPart method:
$assembly AddPart $actor
In the previous version of my application (built using vtk 2.2) we did the
following for the assemblies:
$assembly InitPartTraversal
set part [$assembly GetNextPart]
while {$part != ""} {
$part SetProperty Property
set part [$assembly GetNextPart]
}
The problem is InitPartTraversal and GetNextPart have been deprecated and
the documentation suggests using InitPathTraversal and GetNextPath instead.
I have tried to redo this routine using the new functions like so:
$assembly InitPathTraversal
set part [$assembly GetNextPath]
while {$part != ""} {
set prop [[$part GetFirstNode] GetProp]
$prop SetProperty JunctionProperty
set part [$assembly GetNextPath]
}
Unfortunately, the assembly does not change its color by doing this. If
anyone has any idea how I can get the assemblies in my program to change
colors, I would greatly appreciate it.
Thank you,
Derek Kivi
AEA Technology Engineering Software
More information about the vtkusers
mailing list