HI,<div><br></div><div>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.</div>
<div><br></div><div>Good luck</div><div><br></div><div>Regards</div><div>Rakesh Patil<br><br><div class="gmail_quote">On Wed, Mar 9, 2011 at 7:25 PM, Xiaopeng Yang <span dir="ltr"><<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Dirk,<br>
It works for me. Thanks a lot.<br>
Best regards,<br>
Yang<br>
<br>
-----邮件原件-----<br>
发件人: Dirk Fortmeier [mailto:<a href="mailto:fortmeier@imi.uni-luebeck.de">fortmeier@imi.uni-luebeck.de</a>]<br>
发送时间: 2011년 3월 9일 수요일 오후 6:34<br>
收件人: Xiaopeng Yang<br>
抄送: 'vtk'<br>
主题: Re: [vtkusers] Define a list of vtkContourWidget<br>
<div class="im"><br>
Hi Yang,<br>
<br>
have you tried something like this:<br>
<br>
vtkSmartPointer<vtkContourWidget> widgets[157];<br>
for(int i = 0; i < 157; i++) {<br>
widgets[i] = vtkSmartPointer<vtkContourWidget>::New();<br>
}<br>
<br>
?<br>
<br>
Regards,<br>
Dirk<br>
<br>
On Wed, 2011-03-09 at 16:34 +0900, Xiaopeng Yang wrote:<br>
</div><div><div></div><div class="h5">> Hello,<br>
><br>
><br>
><br>
> I’d like to define a list of vtkContourWidget. The code I thought<br>
> should be something like this:<br>
><br>
><br>
><br>
> vtkContourWidget *ContourWidget[157] = vtkContourWidget::New();<br>
><br>
><br>
><br>
> But I know it is wrong. Could you please tell me the right way?<br>
><br>
><br>
><br>
> Thanks,<br>
><br>
> Yang<br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
--<br>
Dirk Fortmeier <<a href="mailto:fortmeier@imi.uni-luebeck.de">fortmeier@imi.uni-luebeck.de</a>>, PhD Student<br>
<br>
Institute of Medical Informatics<br>
Graduate School for Computing in Medicine and Life Sciences<br>
University of Lübeck<br>
<br>
Building 64, 2F, Room 4<br>
Ratzeburger Allee 160<br>
23538 Lübeck<br>
Germany<br>
<br>
Tel.:+49 (451) 500-5635<br>
Fax.:+49 (451) 500-5610<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>