<div>no there's no warning.and the problem is running when excuting </div><FONT size=2> <div>m_polydata->InsertNextCell(VTK_VERTEX, 1, &cellId);</div> <div></FONT>because i tried to run without this line,and there no error but nothing appear.</div> <div> <BR><BR><B><I>Amy Squillacote <amy.squillacote@kitware.com></I></B> a écrit :</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Please keep the discussion on the vtkusers mailing list rather than<BR>emailing me directly. That way the discussion is archived and other<BR>people can contribute to finding a solution to your problem.<BR><BR>Also, please describe in more detail what run-time problem you're<BR>seeing. Is there an error or warning message displayed? Does the program<BR>crash? (If so, a stack trace would be helpful.)<BR><BR>- Amy<BR><BR>Miladi Med Amine wrote:<BR>> i tried to do this;but the problem inthe running
there is a beug in <BR>> vtkcellarray.h.<BR>> what's wrong.<BR>> Thanks<BR>><BR>> */Amy Squillacote <AMY.SQUILLACOTE@KITWARE.COM>/* a écrit :<BR>><BR>> Sorry, I must have gotten in a hurry when I typed that. I meant<BR>> vtkIdType.<BR>><BR>> - Amy<BR>><BR>> medamine wrote:<BR>> > Thanks<BR>> > do you mean vtkIdTypes?because using vtkCellType i get an error<BR>> that did not<BR>> > exist(vtkCellType.h is included).<BR>> > so i do this:<BR>> > vtkIdTypes cellId = i;<BR>> > m_polydata->InsertNextCell(VTK_VERTEX, 1, &cellId);<BR>> > but, the debugger is declanched.<BR>> ><BR>> ><BR>> > Amy Squillacote wrote:<BR>> ><BR>> >> In VTK, you must have cells to render. If your dataset only<BR>> contains<BR>> >> points and you want to render points, you will need to create a<BR>> >> vtkVertex cell per point in your dataset. The code to do
that<BR>> would look<BR>> >> something like the following.<BR>> >><BR>> >> Inside your while loop, before the line "i++;", add these lines.<BR>> >><BR>> >> vtkCellType cellId = i;<BR>> >> m_polydata->InsertNextCell(VTK_VERTEX, 1, &cellId);<BR>> >><BR>> >> - Amy<BR>> >><BR>> >> medamine wrote:<BR>> >><BR>> >>> Hi;<BR>> >>> i'm trying to create a mesh from .txt file in witch i have only<BR>> >>> points.after<BR>> >>> creation i get a mesh with 1024 pts but nothing appear in the<BR>> screan when<BR>> >>> rendring.<BR>> >>> Thanks<BR>> >>><BR>> >>> FILE *fp;<BR>> >>> float x=0;<BR>> >>> float y=0;<BR>> >>> float z=0;<BR>> >>> const float p[3]={0,0,0};<BR>> >>> char *c;<BR>> >>> int i=0;<BR>>
>>> vtkPolyData *m_polydata=vtkPolyData::New();<BR>> >>> vtkPoints *points = vtkPoints::New();<BR>> >>> float pts[3]={10,10,10};<BR>> >>> if((fp=fopen(resfile,"r"))==NULL)<BR>> >>> { printf("Le fichier FILES ne veut pas s'ouvrire! \n"); exit(1);}<BR>> >>> while(!feof(fp))<BR>> >>> { fscanf(fp,"%c %f %f %f",&c,&x,&y,&z);<BR>> >>> pts[0]=x;pts[1]=y;pts[2]=z;<BR>> >>> points->InsertPoint(i,pts);<BR>> >>> i++;<BR>> >>> }<BR>> >>> m_polydata->SetPoints(points);<BR>> >>> m_polydata->Update();<BR>> >>><BR>> >>> vtkPolyDataWriter *writer=vtkPolyDataWriter::New();<BR>> >>> writer->SetFileName(plyfile);<BR>> >>> writer->SetInput(m_polydata);<BR>> >>> writer->Update();<BR>> >>><BR>> >>> /////////test
visualisation<BR>> >>> vtkPolyDataMapper *m_polydataMapper = vtkPolyDataMapper::New();<BR>> >>> m_polydataMapper->SetInput(m_polydata);<BR>> >>> // m_polydataMapper->SetScalarRange(0,256);<BR>> >>> vtkActor *m_Actor = vtkActor::New();<BR>> >>> m_Actor->SetMapper(m_polydataMapper);<BR>> >>> //m_Actor->GetProperty()->SetRepresentationToPoints();<BR>> >>> m_Actor->GetProperty()->SetColor(1, 0, 0);<BR>> >>> // m_Actor->GetProperty()->SetDiffuseColor(1,1,1);<BR>> >>> vtkRenderer *m_renderer = vtkRenderer::New();<BR>> >>> vtkRenderWindow *m_renWin = vtkRenderWindow::New();<BR>> >>> m_renWin->AddRenderer(m_renderer);<BR>> >>> vtkRenderWindowInteractor *m_iren =<BR>> vtkRenderWindowInteractor::New();<BR>> >>> m_iren->SetRenderWindow(m_renWin);<BR>> >>>
vtkInteractorStyleTrackballCamera *m_style =<BR>> >>> vtkInteractorStyleTrackballCamera::New();<BR>> >>> m_iren->SetInteractorStyle(m_style);<BR>> >>> m_renderer->AddActor(m_Actor);<BR>> >>> m_renderer->SetBackground(0, 0, 0);<BR>> >>> m_renWin->SetSize(300,300);<BR>> >>> m_renWin->Render();<BR>> >>> m_iren->Start();<BR>> >>> //Free<BR>> >>> m_polydata->Delete();<BR>> >>> m_polydataMapper->Delete();<BR>> >>> m_Actor->Delete();<BR>> >>> m_renderer->Delete();<BR>> >>> m_renWin->Delete();<BR>> >>> m_iren->Delete();<BR>> >>><BR>> >>><BR>> >> --<BR>> >> Amy Squillacote<BR>> >> Kitware, Inc.<BR>> >> 28 Corporate Drive<BR>> >> Clifton Park, NY 12065<BR>> >> Phone: (518) 371-3971 x106<BR>>
>><BR>> >> _______________________________________________<BR>> >> This is the private VTK discussion list.<BR>> >> Please keep messages on-topic. Check the FAQ at:<BR>> >> http://www.vtk.org/Wiki/VTK_FAQ<BR>> >> Follow this link to subscribe/unsubscribe:<BR>> >> http://www.vtk.org/mailman/listinfo/vtkusers<BR>> >><BR>> >><BR>> >><BR>> ><BR>> ><BR>><BR>> -- <BR>> Amy Squillacote<BR>> Kitware, Inc.<BR>> 28 Corporate Drive<BR>> Clifton Park, NY 12065<BR>> Phone: (518) 371-3971 x106<BR>><BR>><BR>> ------------------------------------------------------------------------<BR>> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails <BR>> <HTTP: yahoo-fr www.trueswitch.com />vers Yahoo! Mail <BR><BR>-- <BR>Amy Squillacote<BR>Kitware, Inc.<BR>28 Corporate Drive<BR>Clifton Park, NY 12065<BR>Phone: (518) 371-3971
x106<BR><BR><BR></BLOCKQUOTE><BR><p> 
<hr size="1">
Ne gardez plus qu'une seule adresse mail ! <a href="http://www.trueswitch.com/yahoo-fr/">Copiez vos mails</a> vers Yahoo! Mail