[vtkusers] (no subject)
Timo Frenzel
rohlof at gmx.de
Thu Oct 7 12:08:37 EDT 2004
Hi,
i'm trying to handle some pointdata of an image-based volume (like medical
in the vtk-examples) after picking it.
To get the data i created a callback function like pointpicker:
static vtkActor *m_coneActor1;
class vtkMyCallback : public vtkCommand
{
public:
vtkMyCallback::vtkMyCallback() { };
static vtkMyCallback *New() { return new vtkMyCallback; }
public:
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)
{
int m_pointID = m_ppicker -> GetPointId();
float m_pointValue[3];
m_ppicker -> GetPickPosition(m_pointValue);
m_coneActor1 ->
SetPosition(m_ppicker->GetPickPosition());
otherclassfunction -> Pick3DPointID(&m_pointID);
otherclassfunction -> Pick3DPointValue(&m_pointValue[0],
&m_pointValue[1], &m_pointValue[2]);
}
}
};
With this code, i get a pointID (pointpicker) and the position. After i left
the callback function the association of the pointID with the coordinates
seems not to be the same.
Cause if i try to re-get the coordinates with this code...
vtkPoints *m_points;
m_points = vtkPoints::New();
m_points -> GetPoint(pointID, p0); //pointID from callback function
...i get a access violation. (debugging shows that the ID is not allocated.)
is it, cause there are no points defined? are cells defined and how can i
access the pointID and the coordinates like pointpicker do?
thx for help. timo frenzel.
--
+++ GMX DSL Premiumtarife 3 Monate gratis* + WLAN-Router 0,- EUR* +++
Clevere DSL-Nutzer wechseln jetzt zu GMX: http://www.gmx.net/de/go/dsl
More information about the vtkusers
mailing list