[vtkusers] Point Data of Polydata

rahul indoria rahulindoria5 at gmail.com
Mon Jul 29 13:00:58 EDT 2013


Hi,
    could you please tell me, how to get the point data of the poly data.

i am trying to do something like that,

   vtkSmartPointer<vtkPolyData> polydata =
 vtkPolyData::SafeDownCast(sampleVolume->GetOutput());


  // Get the number of points in the polydata
  vtkIdType idNumPointsInFile = polydata->GetNumberOfPoints();
  cout<< " number of points " << idNumPointsInFile;


  vtkSmartPointer<vtkDoubleArray> array =
  vtkSmartPointer<vtkDoubleArray>::New();
array->SetName("Distances");



vtkDoubleArray::SafeDownCast(polydata->GetPointData()->GetArray("Distances"));

 if(array)
    {
    for(int i = 0; i < idNumPointsInFile; i++)
      {
     std::cout << "Got array." << std::endl;

      double dist;

*      dist = array->GetValue(i);  // here i am getting error*

      //if the array held arrays instead of scalars, you would use this:
    /*  double location[3];
    array->GetTupleValue(i, location);
  std::cout << "Location: " << location[0] << ","  << location[1] << "," <<
location[2] << std::endl;
     */
   cout<< "where is the problem";
      std::cout << "Distance: " << dist << std::endl;
      }
    }//end if(array)
  else
    {
    std::cout << "no array." << std::endl;
    }

  return EXIT_SUCCESS;

could you please tell me, why i am getting error at this position?

Looking forward your reply soon.










On Mon, Jul 29, 2013 at 6:00 PM, <vtkusers-request at vtk.org> wrote:

> Send vtkusers mailing list submissions to
>         vtkusers at vtk.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://www.vtk.org/mailman/listinfo/vtkusers
> or, via email, send a message with subject or body 'help' to
>         vtkusers-request at vtk.org
>
> You can reach the person managing the list at
>         vtkusers-owner at vtk.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vtkusers digest..."
>
>
> Today's Topics:
>
>    1. dll file (Zohreh Tavakoli)
>    2. Can VTK be used with Codegear XE4 compilers??? (Bo Berglund)
>    3. Real time 3D model (Zohreh Tavakoli)
>    4. Re: Real time 3D model (Felipe Bordeu Weldt)
>    5. [VTKUsers] How to change the color of the contour line?
>       (hongsongyang)
>    6. Re: Texture (Max)
>    7. ??:  [VTKUsers] How to change the color of the contour line?
>       (hongsongyang)
>    8. move actor (Max)
>    9. Re: move actor (David Cole)
>   10. Re: move actor (Max)
>   11. Re: Real time 3D model (Max)
>   12. Re: Can VTK be used with Codegear XE4 compilers??? (Sean McBride)
>   13. Real Time 3D model (Zohreh Tavakoli)
>   14. Re: [Insight-users] Real Time 3D model (Cory Quammen)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 28 Jul 2013 09:18:57 -0700 (PDT)
> From: Zohreh Tavakoli <tavakoli.0991 at yahoo.com>
> Subject: [vtkusers] dll file
> To: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Message-ID:
>         <1375028337.4746.YahooMailNeo at web160201.mail.bf1.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
> ?
> VtkRenderingFreeType-6.0.dll is missing from my computer.
> I need that soon for runing my project ,I would be happy ,if anybody send
> this file to me.
> ?
> Thanks
> Zoya
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130728/ccdcee2a/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 2
> Date: Sun, 28 Jul 2013 17:34:58 +0200
> From: Bo Berglund <bo.berglund at gmail.com>
> Subject: [vtkusers] Can VTK be used with Codegear XE4 compilers???
> To: vtkusers at public.kitware.com
> Message-ID: <1aeav8ha2ulg3fv8c1nuph9j15rb5qiofj at 4ax.com>
> Content-Type: text/plain; charset=us-ascii
>
> I have an old application developed with BDS2006 that needs to be
> maintained. Current development IDE is XE4 level (with 32 and 64 bit
> compilers).
> Is it possible to compile VTK with these compilers?
>
> I ask before trying because when I last tried it with the BDS2006
> compiler it was a nightmarish experience with compilation taking an
> entire afternoon...
> (I am not the author of the application code, that developer has left
> the company, so I have to take over without his experience...)
>
> Much obliged for any insight on this!
>
>
> --
> Bo Berglund
> Developer in Sweden
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sun, 28 Jul 2013 13:44:52 -0700 (PDT)
> From: Zohreh Tavakoli <tavakoli.0991 at yahoo.com>
> Subject: [vtkusers] Real time 3D model
> To: "insight-users at itk.org" <insight-users at itk.org>
> Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Message-ID:
>         <1375044292.21466.YahooMailIosMobile at web160218.mail.bf1.yahoo.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi<br/><br/>I want to know ,Is it possible to make a Real time 3D model ,
> In ITK or VTk or not??<br/><br/>Thanks<br/>Zoya<br/><br/>Sent from Yahoo!
> Mail for iPhone
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130728/2ee34bf6/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 4
> Date: Sun, 28 Jul 2013 23:17:37 +0200
> From: Felipe Bordeu Weldt <felipe.bordeu at ec-nantes.fr>
> Subject: Re: [vtkusers] Real time 3D model
> Cc: vtkusers at vtk.org
> Message-ID: <C48435C9-4871-48D9-9A22-DE6E460A74F3 at ec-nantes.fr>
> Content-Type: text/plain; charset="iso-8859-1"
>
> What do you mean by real time? Plotting realtime changing data? something
> like the Catalyst library from ParaView (http://catalyst.paraview.org).
>
>
> Felipe
>
> Le 28 juil. 2013 ? 22:44, Zohreh Tavakoli <tavakoli.0991 at yahoo.com> a
> ?crit :
>
> >
> > Hi
> >
> > I want to know ,Is it possible to make a Real time 3D model , In ITK or
> VTk or not??
> >
> > Thanks
> > Zoya
> >
> > Sent from Yahoo! Mail for iPhone
> > _______________________________________________
> > 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
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130728/823b6ab0/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 5
> Date: Mon, 29 Jul 2013 11:41:00 +0800
> From: "hongsongyang" <hongsongyang at 163.com>
> Subject: [vtkusers] [VTKUsers] How to change the color of the contour
>         line?
> To: <vtkusers at vtk.org>
> Message-ID: <C08DFE300A124D03AED839D04848A4AD at WlfPC>
> Content-Type: text/plain; charset="us-ascii"
>
> Dear all,
>
> I have a question about the colors of the contour lines.
>
> When I use the vtkContourFilter as follow:
>
>
>
> vtkContourFilter contours
>
>   contours SetInputConnection [extract GetOutputPort]
>
>   contours GenerateValues 2  0  100
>
>
>
> There will be 2 contour lines generated, the 1st line color will always be
> BLUE, and the
>
> Second line color will always be RED.
>
>
>
> How could I change the contour line color manually?
>
>
>
> Thanks a lot.
>
>
>
> Best regards,
>
> Hongsongyang.
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130729/dbc09896/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 6
> Date: Sun, 28 Jul 2013 23:34:53 -0700 (PDT)
> From: Max <smapersmaper at gmail.com>
> Subject: Re: [vtkusers] Texture
> To: vtkusers at vtk.org
> Message-ID: <1375079693130-5722298.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Right now I'm getting a texture that is warped according to some shape.
> In short, can VTK recognize my mesh (arbitrary shape) and wrap it with a
> texture accordingly?
>
> Thank you,
> Max
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Texture-tp5722231p5722298.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 29 Jul 2013 15:16:51 +0800
> From: "hongsongyang" <hongsongyang at 163.com>
> Subject: [vtkusers] ??:  [VTKUsers] How to change the color of the
>         contour line?
> To: "'hongsongyang'" <hongsongyang at 163.com>,    <vtkusers at vtk.org>
> Message-ID: <7E925012646E403CBDE6F0E324A01CE2 at WlfPC>
> Content-Type: text/plain; charset="gb2312"
>
> Oh, I have got the solution for this issue.
>
> Thanks a lot.
>
>
>
>   _____
>
> ???: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] ??
> hongsongyang
> ????: Monday, July 29, 2013 11:41 AM
> ???: vtkusers at vtk.org
> ??: [vtkusers] [VTKUsers] How to change the color of the contour line?
>
>
>
> Dear all,
>
> I have a question about the colors of the contour lines.
>
> When I use the vtkContourFilter as follow:
>
>
>
> vtkContourFilter contours
>
>   contours SetInputConnection [extract GetOutputPort]
>
>   contours GenerateValues 2  0  100
>
>
>
> There will be 2 contour lines generated, the 1st line color will always be
> BLUE, and the
>
> Second line color will always be RED.
>
>
>
> How could I change the contour line color manually?
>
>
>
> Thanks a lot.
>
>
>
> Best regards,
>
> Hongsongyang.
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130729/bbdcb0cb/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 8
> Date: Mon, 29 Jul 2013 05:25:06 -0700 (PDT)
> From: Max <smapersmaper at gmail.com>
> Subject: [vtkusers] move actor
> To: vtkusers at vtk.org
> Message-ID: <1375100706737-5722302.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Dear VTKers,
> I want to move an actor. When i use the function setPosition of the actor i
> see that the coordinates are actor coords.
> Is there any other function/class/way to move an actor in the world
> coordinates?
>
> Thank you,
> Max
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/move-actor-tp5722302.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 9
> Date: Mon, 29 Jul 2013 13:14:11 +0000
> From: David Cole <dlrdave at aol.com>
> Subject: Re: [vtkusers] move actor
> To: " vtkusers at vtk.org " <vtkusers at vtk.org>, Max
>         <smapersmaper at gmail.com>
> Message-ID: <20130729131914.7545565B36 at public.kitware.com>
> Content-Type: text/plain; charset="utf-8"
>
> > I want to move an actor. When i use the function setPosition of the
> actor i
> > see that the coordinates are actor coords.
> > Is there any other function/class/way to move an actor in the world
> > coordinates?
>
>
> Use SetUserTransform with a vtkTransform object that does a translation
> transformation.
>
>
> Some examples:
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/TransformOrderDemo
>
>
>
> HTH,
>
> David C.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130729/ca39110f/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 10
> Date: Mon, 29 Jul 2013 06:38:30 -0700 (PDT)
> From: Max <smapersmaper at gmail.com>
> Subject: Re: [vtkusers] move actor
> To: vtkusers at vtk.org
> Message-ID: <1375105110342-5722304.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Thank you, David.
> I have a problem to move a mesh with vtkTransform.
> When i'm trying to move vtkSphereSource it works fine.
> But for the mesh(read with vtkSTLReader) it refuses to translate.
> What could be the problem?
>
>
> Thank you,
> Max
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/move-actor-tp5722302p5722304.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 11
> Date: Mon, 29 Jul 2013 06:52:02 -0700 (PDT)
> From: Max <smapersmaper at gmail.com>
> Subject: Re: [vtkusers] Real time 3D model
> To: vtkusers at vtk.org
> Message-ID: <1375105922748-5722305.post at n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Zoya,
> What do you mean 3d model? a mesh?
> real time you mean that you can ratate it? please explain...
>
> Max
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Real-time-3D-model-tp5722295p5722305.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 12
> Date: Mon, 29 Jul 2013 10:56:41 -0400
> From: "Sean McBride" <sean at rogue-research.com>
> Subject: Re: [vtkusers] Can VTK be used with Codegear XE4 compilers???
> To: <bo.berglund at gmail.com>, <vtkusers at public.kitware.com>
> Message-ID: <20130729145641.462465351 at mail.rogue-research.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sun, 28 Jul 2013 17:34:58 +0200, Bo Berglund said:
>
> >I have an old application developed with BDS2006 that needs to be
> >maintained. Current development IDE is XE4 level (with 32 and 64 bit
> >compilers).
> >Is it possible to compile VTK with these compilers?
> >
> >I ask before trying because when I last tried it with the BDS2006
> >compiler it was a nightmarish experience with compilation taking an
> >entire afternoon...
>
> 2006 was a long time ago.  Wikipedia tells me XE4 was released this year.
>  It may work better.  I think you'll just have to try it.  I'm not aware of
> any Embarcadero compilers on the VTK dashboard.  If supporting this
> compiler is important to you, the best thing to do is set up an automated
> nightly build of VTK using that compiler.
>
> Cheers,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montr?al, Qu?bec, Canada
>
>
>
>
> ------------------------------
>
> Message: 13
> Date: Mon, 29 Jul 2013 08:36:40 -0700 (PDT)
> From: Zohreh Tavakoli <tavakoli.0991 at yahoo.com>
> Subject: [vtkusers] Real Time 3D model
> To: "insight-users at itk.org" <insight-users at itk.org>
> Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
> Message-ID:
>         <1375112200.34586.YahooMailIosMobile at web160201.mail.bf1.yahoo.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi every one<br/><br/>Is it possible to make a Realtime 3D model in Itk
> Vtk or not??<br/><br/>Thanks<br/>Zoya<br/><br/>Sent from Yahoo! Mail for
> iPhone
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130729/0dba8f9b/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 14
> Date: Mon, 29 Jul 2013 11:41:06 -0400
> From: Cory Quammen <cquammen at cs.unc.edu>
> Subject: Re: [vtkusers] [Insight-users] Real Time 3D model
> To: Zohreh Tavakoli <tavakoli.0991 at yahoo.com>
> Cc: "insight-users at itk.org" <insight-users at itk.org>,
>         "vtkusers at vtk.org" <vtkusers at vtk.org>
> Message-ID:
>         <
> CANmPiKDEaW4jCmbw8q0rctaVpwzG-098Y6kpjBnLBaUtQ8Q-qA at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Zoya,
>
> You are going to have to be more specific about what you mean by "Realtime
> 3D model" before anyone can answer your question. What are you trying to
> do?
>
> - Cory
>
> On Mon, Jul 29, 2013 at 11:36 AM, Zohreh Tavakoli
> <tavakoli.0991 at yahoo.com>wrote:
>
> > Hi every one
> >
> > Is it possible to make a Realtime 3D model in Itk Vtk or not??
> >
> > Thanks
> > Zoya
> >
> > Sent from Yahoo! Mail for iPhone
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.php
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-users
> >
> >
>
>
> --
> Cory Quammen
> Research Associate
> Department of Computer Science
> The University of North Carolina at Chapel Hill
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://www.vtk.org/pipermail/vtkusers/attachments/20130729/670fde6d/attachment-0001.htm
> >
>
> ------------------------------
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> End of vtkusers Digest, Vol 111, Issue 45
> *****************************************
>



-- 
*Best  Regards
Rahul Indoria
Mobile No: +49-157-35652212*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130729/6b67743b/attachment.htm>


More information about the vtkusers mailing list