[vtkusers] Coloring Angle or Distance Widgets
Robbie Banks
robbie.banks at gmail.com
Mon Apr 26 13:22:40 EDT 2010
Yes, this works for the distanceWidget, but there is no GetAxis for the
Angle widget and that is where my problems are coming about I think
R
-----Original Message-----
From: mirko heuegger [mailto:mheuegger at gmail.com]
Sent: Sunday, April 25, 2010 11:41 PM
To: Robbie Banks
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Coloring Angle or Distance Widgets
Hello!
On Fri, Apr 23, 2010 at 8:42 PM, Robbie Banks <robbie.banks at gmail.com>
wrote:
> How do I change the color of the lines in an Angle or Distance Widget?
I have only done this for the vtkDistanceWidget, but the
vtkAngleWidget should work similar,
and the code-segment is in C# (and ActiViz.NET), so some conversions
might be needed ;-)
vtkDistanceWidget distWidGet = new vtkDistanceWidget();
/* init, ... DistanceWidget */
//get 2D representation
vtkDistanceRepresentation2D rep2D =
(vtkDistanceRepresentation2D)distWidGet.GetRepresentation();
vtkPropCollection propies = new vtkPropCollection();
rep2D.GetAxis().GetActors2D(propies);
//propies.GetItemAsObject(0) |-> vtkAxisActor2D
if (propies.GetItemAsObject(0) is vtkAxisActor2D)
{
vtkAxisActor2D ax =
(vtkAxisActor2D) propies.GetItemAsObject(0);
ax.GetProperty().SetColor(0, 0, 0); //black
}
hth
mirko
--
Real programmers don't document; if it was
hard to write, it should be hard to understand.
More information about the vtkusers
mailing list