[vtkusers] Picking Points from a image-based Volume doesn't work

rohlof rohlof at gmx.de
Wed Sep 29 06:26:42 EDT 2004


Hi, I solve my problem with the callback-function in the header-file.


static	vtkPoints		*m_points;
static	vtkActor		*m_coneActor;

class vtkMyCallback : public vtkCommand
{
public:
	vtkMyCallback::vtkMyCallback() { };
	static vtkMyCallback *New() { return new vtkMyCallback; }

	virtual void Execute(vtkObject *caller, unsigned long, void*)
	{
		vtkRenderWindowInteractor *m_iren =
reinterpret_cast<vtkRenderWindowInteractor*>(caller);
		vtkPointPicker *m_ppicker = (vtkPointPicker
*)m_iren->GetPicker();

		if (m_ppicker->GetPointId() != -1)
			m_points	= m_ppicker	->
GetPickedPositions();
			m_coneActor	->
SetPosition(m_ppicker->GetPickPosition());

		}

    }
};


or look at this post:
http://public.kitware.com/pipermail/vtkusers/2004-February/071852.html

----------------------------------------------------------------------------
---- 

Hi,

I want to create a MFC Application, which is visualizing an image-based
Volume and is able to give me information about the position and orientation
of some picked points.
So i used PointPicker...
But I cannot get any Information about picked points, perhaps somebody could
help me with this code:

Thx, Timo.



	//Picking Points
	m_ppicker	->	SetTolerance(0.001);
	m_ppicker	->	GetPointId();
	m_iren		->	SetPicker(m_ppicker);
//	int p = m_ppicker -> GetPointId();

	//Function Hedgehog to visualize Normals
	m_hhog		->	SetInput((vtkDataSet *) m_boneNormals ->
GetOutput());
    m_hhog		->	SetScaleFactor(10.3);
	m_hhog		->	SetVectorModeToUseNormal();

	//LookupTable
	m_lut		->	Build();

	m_hhogMapper	->	SetInput(m_hhog->GetOutput());
    m_hhogMapper	->	SetScalarRange(50, 550);
    m_hhogMapper	->	SetLookupTable(m_lut);
    m_hhogMapper	->	ImmediateModeRenderingOn();

	m_hhogActor	->	SetMapper(m_hhogMapper);
	m_ren		->	AddActor(m_hhogActor);





More information about the vtkusers mailing list