[vtkusers] color/emphasize a picked cell (of vtkPolyData)

Nigel Nunn nNunn at ausport.gov.au
Fri Apr 26 22:07:30 EDT 2002


Hi Bjoern, 
Assuming the cells in your grid have scalars, 
 
   (m_Grid->GetCellData())->SetScalars(m_Scalars);
 
and that you want to change the scalar for the selected cell,
and that you have the selected cell's id from the pick, then
 
   // Get m_nCellId from pick operation. 
   // Use a color distinct among the scalar data. 
   double hilight[] = {100.0}; 
   m_Grid->GetCellData()->GetScalars()->SetTuple(m_nCellId, hilight); 
   m_Grid->Modified(); 
   this->Render();     // "this" is an MFC CView
 
Nigel
 
 
-----Original Message-----
bjoern.koertner at ira.uka.de
Sent: Saturday, 27 April 2002 8:38 AM
To: vtkusers at public.kitware.com
Subject: [vtkusers] color/emphasize a picked cell (of vtkPolyData)

Hello vtkusers, 
 
there is an application that displays an vtkPolyData-Object. 
I am using a vtkCellPicker to get the cellid and the position 
the mouse pointer points at. Now I want to color this picked 
cell, but even after reading a lot in the "Users Guide" and 
after searching in the Archive I don't know how I can achieve 
this aim. It would be very nice if someone would help me.  
If it is not possible to color single cells, it would be 
great if someone could give me other proposals how to emphasize 
this cell.  

Best regards, Bjoern 




More information about the vtkusers mailing list