[vtkusers] Problem in obtaining world position with vtkSeedWidget
    Xiaopeng Yang 
    yxp233 at postech.ac.kr
       
    Tue Jan 11 04:44:12 EST 2011
    
    
  
Dear Users,
 
I am trying to get world position by
SeedRepresentation->GetSeedWorldPosition(I, pos). But comparing with other
software, I got the wrong value in z coordinate. The values of x and y
coordinates are correct. I would appreciate if anyone can point me in the
right direction. 
 
Thanks,
Yang
 
class vtkSeedCallback : public vtkCommand
{
  public:
    static vtkSeedCallback *New()
    { 
      return new vtkSeedCallback; 
    }
    vtkSeedCallback() {}
    virtual void Execute(vtkObject*, unsigned long event, void *calldata)
    {
      if(event == vtkCommand::PlacePointEvent)
      {
        std::cout << "Point placed, total of: " 
            << this->SeedRepresentation->GetNumberOfSeeds() << std::endl;
      }
      if(event == vtkCommand::InteractionEvent)
      {
        if(calldata)
        {
          std::cout << "Interacting with seed : " 
              << *(static_cast< int * >(calldata)) << std::endl;
        }
      }
  
      std::cout << "List of seeds (Display coordinates):" << std::endl;
         
      for(vtkIdType i = 0; i < this->SeedRepresentation->GetNumberOfSeeds();
i++)
        {
        double pos[3];
        this->SeedRepresentation->GetSeedWorldPosition(i, pos);
        std::cout << "(" << pos[0] << " " << pos[1] << " " << pos[2] << ")"
<< std::endl;
        }
              
     }
       
    void SetRepresentation(vtkSmartPointer<vtkSeedRepresentation> rep)
{this->SeedRepresentation = rep;}
    private:
    vtkSmartPointer<vtkSeedRepresentation> SeedRepresentation;
};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110111/ff164c73/attachment.htm>
    
    
More information about the vtkusers
mailing list