[vtkusers] Coloring Angle or Distance Widgets

Eric E. Monson emonson at cs.duke.edu
Mon Apr 26 13:38:38 EDT 2010


Hey Robbie,

I've never used this, but I bet the GetRay1, GetRay2 and GetArc do this same job for vtkAngleRepresentation2D:

http://www.vtk.org/doc/nightly/html/classvtkAngleRepresentation2D.html

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


On Apr 26, 2010, at 1:22 PM, Robbie Banks wrote:

> 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.
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK 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