[vtkusers] AppendPolyData Problem

Secolas UA secolasua at gmail.com
Tue Jan 23 11:35:41 EST 2007


Hello,

i've tried the code you sent me but it still doesn't work... i am beginning
to wonder that the problem is the model i am importing, could you please
suply me with a tested model, just for debugging?

Thanks

Ricardo Seco

On 1/23/07, Patrícia Gonçalves <pgoncalves at inegi.up.pt> wrote:
>
>  Pessoalmente, não me importo nada que escrevam em português, mas não me
> parece que a maioria da comunidade VTK aprecie muito... ;-)
>
>   *Patrícia Gonçalves* | Bolseira de Investigação Laboratório de Óptica e
> Mecânica Experimental *tlf.:* 22 508 21 51   INEGI  - INSTITUTO DE
> ENGENHARIA MECÂNICA E GESTÃO INDUSTRIAL 20 anos |  motor de inovação
>  www.inegi.up.pt
>
>
>
>
>
>  ----- Original Message -----
> *From:* Secolas UA <secolasua at gmail.com>
> *To:* vtkusers at vtk.org
> *Sent:* Tuesday, January 23, 2007 4:24 PM
> *Subject:* Re: [vtkusers] AppendPolyData Problem
>
> Olá,
>
> experimentei o código e mesmo assim não funciona... começo a pensar que
> talvez seja do modelo que eu estou a importar, poderia-me fornecer um modelo
> que tenha testado para eu tirar as dúvidas?
>
> Desde já o meu obrigado
>
> Ricardo Seco
> Universidade de Aveiro
>
> On 1/23/07, Paulo José Correia Bernardes <pbernardes at uaum.uminho.pt>
> wrote:
> >
> >  Viva,
> >
> >
> >
> > O código que lhe envio está a funcionar…
> >
> > Veja se lhe serve.
> >
> >
> >
> > Cumprimentos,
> >
> >
> >
> > Paulo Bernardes
> >
> >
> >
> >
> >
> > vtkAppendPolyData *appendDataFromVRMLFile ( vtkVRMLImporter *vrmlData )
> >
> > {
> >
> >       vtkAppendPolyData *apd=vtkAppendPolyData::New();
> >
> >       vtkPolyData *vrmlPolyData=vtkPolyData::New();
> >
> >       vtkActorCollection *actorCollection=vtkActorCollection::New();
> >
> >       vtkActor *actorOfCollection=vtkActor::New();
> >
> >
> >
> >       actorCollection = vrmlData->GetRenderer()->GetActors();
> >
> >
> >
> >       actorCollection->InitTraversal();
> >
> >       actorOfCollection = actorCollection->GetNextActor();
> >
> >
> >
> >       while( actorOfCollection != NULL )
> >
> >       {
> >
> >             vrmlPolyData = reinterpret_cast<vtkPolyData
> > *>(actorOfCollection->GetMapper()->GetInput());
> >
> >             apd->AddInput(vrmlPolyData);
> >
> >
> >
> >             actorOfCollection = actorCollection->GetNextActor();
> >
> >       }
> >
> >
> >
> >       return apd;
> >
> > }
> >
> >
> >  ------------------------------
> >
> > *De:* vtkusers-bounces+pbernardes=uaum.uminho.pt at vtk.org [mailto:
> > vtkusers-bounces+pbernardes=uaum.uminho.pt at vtk.org] *Em nome de *Secolas
> > UA
> > *Enviada:* terça-feira, 23 de Janeiro de 2007 15:57
> > *Para:* vtkusers at vtk.org
> > *Assunto:* [vtkusers] AppendPolyData Problem
> >
> >
> >
> > Hello!
> >
> > I am importing a Vrml Model and i want to append to the same polydata
> > the polydata information of all the actors, but I have a problem when I do
> > the
> > appendSet->Update(); the following message appears Unhandled exception
> > at 0x004771b7 in Visualization_Tool.exe: 0xC00000FD: Stack overflow.
> >
> > I think i'm doing everything right, so i'll put the relevant part of the
> > code hoping that someone will have a solution.
> >
> > Thanks
> > Ricardo Seco
> > University of Aveiro
> >
> > ...
> > if (NumberOfActors >0)
> >     {
> >           // Obtenção dos actores da cena
> >
> >         ActColection = ren1->GetActors();
> >
> >         tmpData = (vtkPolyData *)
> > ((vtkActor*)ActColection->GetLastActor())->GetMapper()->GetInput();
> >
> >         appendSet->AddInput(tmpData);
> >
> >         ActColection->InitTraversal();
> >
> >         // Para cada iteração ...
> >         for (int i=0;i<NumberOfActors;i++)
> >         {
> >             auxiliar++;
> >
> >             // Obter esse actor
> >
> >             Act = ActColection->GetNextActor();
> >
> >             if (Act!=NULL)
> >             {
> >                 if (Act->GetMapper()!=NULL)
> >                 {
> >
> > printf("------------------------------------------------------------------
> > \n");
> >
> >                     // Este código consoante o indice do actor
> >                     // que "engloba" o modelo torna-o ou não
> >                     // pickable. No caso de só existir um actor
> >                     // este é sempre pickable
> >
> >                     if ((auxiliar==1) && (NumberOfActors>1))
> >                     {
> >                         Act->PickableOff();
> >                         Act->GetProperty()->SetOpacity(0.5);
> >                     }
> >
> >                     // Vai buscar ao Mapper os dados poligonais
> >                     tmpData = (vtkPolyData* )
> > Act->GetMapper()->GetInput();
> >
> >                     appendSet->AddInput(appendSet->GetOutput());
> >
> >                     appendSet->AddInput(tmpData);
> >
> >                     appendSet->Update(); //-> Stack OverFlow
> >
> >                     polyData = (vtkPolyData* )appendSet->GetOutput();
> > ...
> >
>
>  ------------------------------
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the 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/20070123/4d1e417c/attachment.htm>


More information about the vtkusers mailing list