[vtkusers] questions on vtk in win32

cly clyao at cugb.edu.cn
Sat Mar 13 21:45:18 EST 1999

Hi, Roland,

We hope you do some improvment of the only MFC sample in vtk.
It's better with some interactions, such as slicing, other than only 'mousemoving' and 'zooming'.

Thanks in advance.


----- Original Message ----- 
From: "Roland Schwarz" <roland.schwarz at chello.at>
To: "VTK users list" <vtkusers at public.kitware.com>
Sent: Wednesday, March 13, 2002 3:00 AM
Subject: Re: [vtkusers] questions on vtk in win32

> What I've found out so far:
> The example, showing MFC binding simply seems to be outdated.
> You can get rid of the access violatins the following way:
> In the destructor of
> SampleView release the resources:
> CSampleView::~CSampleView()
> {
>     vtkPropCollection *propc;
>     vtkProp *prop;
>     propc = this->Renderer->GetProps();
>     propc->InitTraversal();
>     while (prop = propc->GetNextProp()) {
>         this->Renderer->RemoveProp(prop);
>     }
> }
> I think an even better place would be in the handler of the WM_DESTROY
> message,
> since releasing the resources might access the Window handle, which normally
> has gone
> when the destuctor is seen.
> The problem is, that you may not destroy
> vtkRenderer, vtkRenderInteractor and vtkRenderWindow without releasing its
> graphic resources.
> The above code will do just that.
> If you do not do it like above, the release of the graphic resources is
> delayed (glDisplayLists in this case)
> is delayed until you destroy the mapper object, which is in the scope of
> SampleDoc.
> When you later try to destroy SampleDoc, the Window (which has long gone
> away at this stage) is
> needed again and a crash is the result.
> I am not quite sure what would be the best practice. I just yet ordered a
> copy of the User Manual,
> hopefully getting more insight into the intende correct usage of the
> objects.
> However I'll try to post a overhauled version of the example if some one is
> interested in this.
> ( I would like some vtk-insider having some comments on this. )
> > And what is the function of "ALL_Build" in each folder generated bu CMak?
> > When I build the win32SampleMfc project generated by Cmake (using cmake in
> this example alone ), there is  "Performing Custom Build Step on ALL_BUILD"
> and never stop and response again.
> >
> When the project consists of subprojects (as is the case with VTK library)
> Setting ALL_BUILD as the current project
> and starting a rebuild will compile complete library.
> Roland
> _______________________________________________
> 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://public.kitware.com/mailman/listinfo/vtkusers

More information about the vtkusers mailing list