[vtkusers] How to draw a point with specific size on a 3D model

Liu_tj tjlp at netease.com
Sat Sep 3 12:27:27 EDT 2016


Hi,

I have 2 problems.

1. I want to select a point on a 3D model and mark it with specific size with red color (like a filled solid circle). I follow the example http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/CellPicking, use the vtkCellPicker to select a cell on the 3D model and draw it. But the point is very small. How can I draw the point with some size?

2. As I add the callback for left button press event to get the selected point, how to revert that then I can rotate the 3D model? Below is my C# code to set and remove the callback for left button press event. I even restore the interactorstyle. That does not work.

        public DotAnnotation()
        {
          m_style = vtkInteractorStyleUser.New();
          m_leftButtonEvent = new vtkObject.vtkObjectEventHandler(DotAnnotation_LeftButtonEvt);
        }
        public void SetEventCallBack()
        {
            m_originalStyle = m_renderWin.GetInteractor().GetInteractorStyle();
            m_style.LeftButtonPressEvt += m_leftButtonEvent;
        }

        public override void RemoveEventCallBack()
        {
            m_style.LeftButtonPressEvt -= m_leftButtonEvent;
            m_renderWin.GetInteractor().SetInteractorStyle(m_originalStyle);
        }

Thanks
Liu Peng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160904/4776bd51/attachment.html>


More information about the vtkusers mailing list