[vtkusers] error when compiling codes

da xu remywendy at gmail.com
Thu Aug 6 11:32:38 EDT 2009


Salih,
You need to #include "vtkProperty.h"

On Thu, Aug 6, 2009 at 2:10 AM, salih halil sonmez <
salihhalilsonmez at gmail.com> wrote:

> eror c2027: use of undefined type ' vtk porperty '. What is the mean of
> this error? I compile this code :
>
> #include "vtkSphereSource.h"
> #include "vtkPolyDataMapper.h"
> #include "vtkActor.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderer.h"
> #include "vtkRenderWindowInteractor.h"
>
> void main ()
> {
>
>   // create sphere geometry
>   vtkSphereSource *sphere = vtkSphereSource::New();
>   sphere->SetRadius(1.0);
>   sphere->SetThetaResolution(18);
>   sphere->SetPhiResolution(18);
>
>   // map to graphics library
>   vtkPolyDataMapper *map = vtkPolyDataMapper::New();
>   map->SetInput(sphere->GetOutput());
>
>   // actor coordinates geometry, properties, transformation
>   vtkActor *aSphere = vtkActor::New();
>   aSphere->SetMapper(map);
>   aSphere->GetProperty()->SetColor(0,0,1); // sphere color blue
>
>   // a renderer and render window
>   vtkRenderer *ren1 = vtkRenderer::New();
>   vtkRenderWindow *renWin = vtkRenderWindow::New();
>   renWin->AddRenderer(ren1);
>
>   // an interactor
>   vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>   iren->SetRenderWindow(renWin);
>
>   // add the actor to the scene
>   ren1->AddActor(aSphere);
>   ren1->SetBackground(1,1,1); // Background color white
>
>   // render an image (lights and cameras are created automatically)
>   renWin->Render();
>
>   // begin mouse interaction
>    iren->Start();
> }
> moreover    ;  error c2227 :  left of'-> setcolor' must point to
> class/struct/union/generic type
>
> what is the reason of these two errors?
>
>
> salih halil sonmez salihhalilsonmez at gmail.com
>
> _______________________________________________
> 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/20090806/41a1a6b4/attachment.htm>


More information about the vtkusers mailing list