[vtkusers] Define a list of vtkContourWidget

rakesh patil prakeshofficial at gmail.com
Wed Mar 9 19:36:18 EST 2011


HI,

That will work only if you know in prior what is the size of the list. i.e.
if you are sure that there are 157 contours only in your app it will work.
If you want to dynamically keep on adding the contour widget in a list then
i would suggest you to make use of std::deque or std::vector (STL concept in
C++). These are more affective than arrays.

Good luck

Regards
Rakesh Patil

On Wed, Mar 9, 2011 at 7:25 PM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:

> Hi Dirk,
> It works for me. Thanks a lot.
> Best regards,
> Yang
>
> -----邮件原件-----
> 发件人: Dirk Fortmeier [mailto:fortmeier at imi.uni-luebeck.de]
> 发送时间: 2011년 3월 9일 수요일 오후 6:34
> 收件人: Xiaopeng Yang
> 抄送: 'vtk'
> 主题: Re: [vtkusers] Define a list of vtkContourWidget
>
> Hi Yang,
>
> have you tried something like this:
>
> vtkSmartPointer<vtkContourWidget> widgets[157];
> for(int i = 0; i < 157; i++) {
>    widgets[i] = vtkSmartPointer<vtkContourWidget>::New();
> }
>
> ?
>
> Regards,
> Dirk
>
> On Wed, 2011-03-09 at 16:34 +0900, Xiaopeng Yang wrote:
> > Hello,
> >
> >
> >
> > I’d like to define a list of vtkContourWidget. The code I thought
> > should be something like this:
> >
> >
> >
> > vtkContourWidget *ContourWidget[157] = vtkContourWidget::New();
> >
> >
> >
> > But I know it is wrong. Could you please tell me the right way?
> >
> >
> >
> > Thanks,
> >
> > Yang
> >
> >
> > _______________________________________________
> > 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
>
> --
> Dirk Fortmeier <fortmeier at imi.uni-luebeck.de>, PhD Student
>
> Institute of Medical Informatics
> Graduate School for Computing in Medicine and Life Sciences
> University of Lübeck
>
> Building 64, 2F, Room 4
> Ratzeburger Allee 160
> 23538 Lübeck
> Germany
>
> Tel.:+49 (451) 500-5635
> Fax.:+49 (451) 500-5610
>
>
>
>
>
>
>
>
> _______________________________________________
> 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/20110310/b81d7cf6/attachment.htm>


More information about the vtkusers mailing list