[vtkusers] How to tune the line with of vtkProperty2D

Liu_tj tjlp at netease.com
Mon Aug 22 21:10:55 EDT 2016


Hi,

I use vtkAngleWidget to measure angle. I want to tune the line width of the angle leaders and arc. Below is my C# code:

            m_angleWidget = vtkAngleWidget.New();
            m_angleWidget.SetInteractor(m_renderWin.GetInteractor());
            m_angleWidget.PlacePointEvt += new vtkObject.vtkObjectEventHandler(AngleWidget_PlacePointEvt);
            m_angleRep = vtkAngleRepresentation2D.New();
            m_angleRep.GetRay1().GetProperty().SetColor(0.0, 1.0, 0.0);
            m_angleRep.GetRay1().GetProperty().SetLineWidth(8.0f);
            m_angleRep.GetRay2().GetProperty().SetColor(0.0, 1.0, 0.0);
            m_angleRep.GetRay2().GetProperty().SetLineWidth(8.0f);
            m_angleRep.GetArc().GetProperty().SetColor(0.0, 1.0, 0.0);
            m_angleRep.GetArc().GetProperty().SetLineWidth(8.0f);
            m_angleRep.GetArc().GetLabelTextProperty().SetColor(0.0, 0.0, 1.0);
            m_angleWidget.SetRepresentation(m_angleRep);

If I call SetLineWidth with 5.0f, 6.0f, 7.0f and 7.5f, I get the same effect as 1.jpg; if I call SetLineWidth with 8.0f, the effect is as 2.jpg. For me, the line in 1.jpg is too slim, the line in 2.jpg is too wide, how to tune it?

Thanks
Liu Peng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160823/c304a4d3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.jpg
Type: image/jpeg
Size: 66576 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160823/c304a4d3/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.jpg
Type: image/jpeg
Size: 65631 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160823/c304a4d3/attachment-0003.jpg>


More information about the vtkusers mailing list