[vtkusers] problem for create and visualize new polydate.

Dongqing Chen dqchen at cvip.louisville.edu
Fri Dec 8 17:45:20 EST 2006


Dear All:

   I just want to visulize a new dataset. The new dataset only contains the new positions of some mesh vertices, and others (most of the vertices) will keep their positions unchanged. I knew exactly all the new positions. I just want to associate  the new position with the original point ID, then visualize the new dataset.

/*************************************************************************************************
   vtkPolyData *poly=normals->GetOutput(); //original dataset 
   vtkPolyData *polyNew=vtkPolyData::New(); //new dataset after each iteration

  // Create vtkPoints 
  vtkPoints* points = vtkPoints::New();
  points->SetNumberOfPoints(numPoints); 

  //Create Stripe to define topology
  vtkCellArray *strips=vtkCellArray::New();
  strips->InsertNextCell(numPoints);  

if (maxCurvature[i]<-0.10 && shapeIndex[i]>=SILowLimit && shapeIndex[i]<=SIUpLimit
       && sphericity[i]<=spLimit)
   {
     //Get the new positon and save in vertexNew, 
    
       points->InsertPoint(i,vertexNew); 
        trips->InsertCellPoint(i);
       // Assign points and cells
       polyNew->SetPoints(points);
       polyNew->SetPolys(strips);                

 }//end of if (minCurvature[i]>0.0)
   else
   {
    //Get the vertex
    double vertex[3]; 
    poly->GetPoint(i,vertex);
    
    points->InsertPoint(i,vertex);
    strips->InsertCellPoint(i);
    // Assign points and cells
    polyNew->SetPoints(points);
    polyNew->SetStrips(strips);  
   }
 
****************************************************************************************************/

The problem is that I could not visualize polyNew as a polydata which I use for poly successfully.

I think it should be caused by the non-proper polydata structure of polyNew;

Please help me to figure out the problem.



Best Wishes,
-----------------------------------------------------------------
Dongqing Chen
Ph.D Research Assistant
Rm. 07, Paul C. Lutz Hall
Computer Vision & Image Processing (CVIP) Lab
Department of Electrical & Computer Engineering
Speed School of Engineering
University of Louisville
Louisville, KY. 40292
U.S.A
Email: dqchen at cvip.louisville.edu
Phone:+1-502-852-2789 (Lab)
            +1-502-852-6130 (Office)
-----------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061208/aee932a8/attachment.htm>


More information about the vtkusers mailing list