[vtkusers] Why I can't create a global vtkPolyData instance?
Wenlong
scc.wwl at gmail.com
Tue May 1 08:44:22 EDT 2012
Hi, Alex
Many thanks to your reply. It is working now.
Thank you very much.
Best wishes
Wenlong
2012/5/1 alex Dowson [via VTK] <ml-node+s1045678n5677939h76 at n5.nabble.com>
> Hi
>
> Can you try this way ?
>
>
> //----------------------------------------------------
> #include <vtkPolyData.h>
> #include <vtkPoints.h>
> #include <vtkCellArray.h>
> #include <vtkGenericDataObjectReader.h>
>
> vtkPolyData* polydata;
> vtkPoints* points;
> vtkCellArray* polygon;
> vtkGenericDataObjectReader* reader;
>
>
> void main()
> {
> polydata = vtkPolyData::New();
> points = vtkPoints::New();
> polygon = vtkCellArray::New();
> reader = vtkGenericDataObjectReader::New();
>
> reader->SetFileName("C:\\Users\\Wenlong\\Desktop\\surface.vtk");
> reader->OpenVTKFile();
> reader->Update();
>
> polydata = reader->GetPolyDataOutput();
> points = polydata->GetPoints();
> polygon = polydata->GetPolys();
> }
>
>
> *From:* [hidden email]<http://user/SendEmail.jtp?type=node&node=5677939&i=0>
> *Sent:* Tuesday, May 01, 2012 5:39 PM
> *To:* [hidden email]<http://user/SendEmail.jtp?type=node&node=5677939&i=1>
> *Cc:* [hidden email]<http://user/SendEmail.jtp?type=node&node=5677939&i=2>
> *Subject:* Re: [vtkusers] Why I can't create a global vtkPolyData
> instance?
>
> Hi, David
>
> Here is a short demo code. It is built in an empty console application in
> Windows 7 with Visual Studio 2008(C++)
>
> //----------------------------------------------------
> #include <vtkPolyData.h>
> #include <vtkPoints.h>
> #include <vtkCellArray.h>
> #include <vtkGenericDataObjectReader.h>
>
> vtkPolyData* polydata = vtkPolyData::New(); // error pops
> vtkPoints* points = vtkPoints::New(); // no error
> vtkCellArray* polygon = vtkCellArray::New(); // no error
> vtkGenericDataObjectReader* reader = vtkGenericDataObjectReader::New();
>
> void main()
> {
> reader->SetFileName("C:\\Users\\Wenlong\\Desktop\\surface.vtk");
> reader->OpenVTKFile();
> reader->Update();
>
> polydata = reader->GetPolyDataOutput();
> points = polydata->GetPoints();
> polygon = polydata->GetPolys();
> }
>
> Many thanks.
>
> Wenlng
>
> ------------------------------
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://vtk.1045678.n5.nabble.com/Why-I-can-t-create-a-global-vtkPolyData-instance-tp5675843p5677939.html
> To unsubscribe from Why I can't create a global vtkPolyData instance?, click
> here<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5675843&code=c2NjLnd3bEBnbWFpbC5jb218NTY3NTg0M3wxMzIxMzQ3NDgy>
> .
> NAML<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://vtk.1045678.n5.nabble.com/Why-I-can-t-create-a-global-vtkPolyData-instance-tp5675843p5677970.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120501/7dc08b93/attachment.htm>
More information about the vtkusers
mailing list