[vtkusers] How to initialize the distancewidget with my specified two world positions?

lee lihouxing at yeah.net
Sat Apr 23 23:47:14 EDT 2016


Hi all,
     I want to show the distance between two points in 3D, I believe
vtkDistanceWidget can realize this function. I tried the code below, but the
position of the two point handles is always at {0,0,0}. Anybody know why,or
have another option for me to realzie the function?
      Any suggestion would be appriciated, thanks in advance!

	m_distanceWidget=vtkSmartPointer<vtkDistanceWidget>::New();

	m_distanceRep=vtkSmartPointer<vtkDistanceRepresentation3D>::New();
	m_distanceRep->SetPoint1WorldPosition(IntersectionPoint);
	m_distanceRep->SetPoint2WorldPosition(sagitalProjectionPoint);

	m_distanceWidget->SetInteractor(ui.ModelView->interactor());	
	m_distanceWidget->SetRepresentation(m_distanceRep);	
	m_distanceWidget->SetWidgetStateToManipulate();
        m_distanceWidget->EnabledOn();
        m_distanceWidget->Render();	



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-initialize-the-distancewidget-with-my-specified-two-world-positions-tp5737857.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list