[vtkusers] a strange error when using vtk on MFC

Nuria Paniagua gva06 at elai.upm.es
Mon Aug 2 09:40:56 EDT 2004


Hello.

I am trying to do a program based on MFC and that simultaneously uses the
bookshops VTK but not as doing it.

The problem is that not like beginning. Because if I open first MFC's
project it cannot include the VTK because these generate his own project on
having used the CMake.

Please, Could you help me?

Thank you
----- Original Message ----- 
From: "jiang-gx" <jxjx at sjtu.edu.cn>
To: "vtk" <vtkusers at vtk.org>
Sent: Tuesday, July 27, 2004 4:49 PM
Subject: [vtkusers] a strange error when using vtk on MFC


> hi everyone:
>     there was a strange mistake occured   when i used the vtk in the MFC
platform, the problem is as below:
>
> i wrote a new vtk class named "vtkCenterLine" which calculates the
skeleton line of input image such as  the tharm image. and a use the
vtkMarchingCube meanwhile.
>
> when i write the pipline like :
> "
> pDoc->centerLine->SetInput(pDoc->v16->GetOutput());
> pDoc->centerLineMapper ->SetInput(pDoc->centerLine->GetOutput());
> pDoc->centerLineActor ->SetMapper(pDoc->centerLineMapper );
> pDoc->centerLineActor ->GetProperty()->SetColor(1,0,0);
> this->ren1 ->AddActor(pDoc->centerLineActor);
>
>         pDoc->volume_Extractor->SetInput(pDoc->v16->GetOutput());
> pDoc->volume_Extractor->SetValue(0, 500);
> pDoc->volume_Stripper->SetInput(pDoc->volume_Extractor->GetOutput());
> pDoc->volume_Mapper->SetInput(pDoc->volume_Stripper->GetOutput());
> pDoc->volume_Mapper->ScalarVisibilityOff();
> pDoc->volume_Actor ->SetMapper(pDoc->volume_Mapper);
> pDoc->volume_Actor->GetProperty()->SetDiffuseColor(0.8, 0.8, 0.6);
> pDoc->volume_Actor->GetProperty()->SetSpecular(.3);
> pDoc->volume_Actor->GetProperty()->SetSpecularPower(20);
> pDoc->volume_Actor->GetProperty()->SetOpacity(0.5);
>     this->ren1 ->AddActor(pDoc->volume_Actor);
>
> "
> it get a right result.
>
> but when i change the code a little as
> "
> pDoc->volume_Extractor->SetInput(pDoc->v16->GetOutput());
> pDoc->volume_Extractor->SetValue(0, 500);
> pDoc->volume_Stripper->SetInput(pDoc->volume_Extractor->GetOutput());
> pDoc->volume_Mapper->SetInput(pDoc->volume_Stripper->GetOutput());
> pDoc->volume_Mapper->ScalarVisibilityOff();
> pDoc->volume_Actor ->SetMapper(pDoc->volume_Mapper);
> pDoc->volume_Actor->GetProperty()->SetDiffuseColor(0.8, 0.8, 0.6);
> pDoc->volume_Actor->GetProperty()->SetSpecular(.3);
> pDoc->volume_Actor->GetProperty()->SetSpecularPower(20);
> pDoc->volume_Actor->GetProperty()->SetOpacity(0.5);
>     this->ren1 ->AddActor(pDoc->volume_Actor);
>
>
>
> pDoc->centerLine->SetInput(pDoc->v16->GetOutput());
> pDoc->centerLineMapper ->SetInput(pDoc->centerLine->GetOutput());
> pDoc->centerLineActor ->SetMapper(pDoc->centerLineMapper );
> pDoc->centerLineActor ->GetProperty()->SetColor(1,0,0);
> this->ren1 ->AddActor(pDoc->centerLineActor);
> "
>
> a error will occured at the runtime.
>
> why ?  thank you for answerring!!
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list