[vtk-developers] Linking a VTK viewer in MFC Application

Leo van Ruijven LvRuijven at gmx.com
Wed Nov 16 07:09:53 EST 2011


Hello Sridhar,

I have tried to link several controls with a VTK viewer, but until now I had no success (if somebody else knows how to do this, please post it). So I link the VTK Viewer to the document view (see code below). I call this function in the Create function of the document view. Allthough I used a multiple document interface, I think it will also work for your single document viewS.

void VTK_Image_Pipe::Create(CWnd *Parent, RECT r1) {
 IRenWin->SetParentId(Parent->m_hWnd);
 IRenWin->SetPosition(r1.left, r1.top);
 IRenWin->SetSize(r1.right-r1.left, r1.top-r1.bottom);

 iren->Initialize();
 iren->SetRenderWindow(IRenWin);
 IRenWin->Render();
}

Regards,
Leo.




> Message: 6
> Date: Wed, 16 Nov 2011 17:17:51 +0530
> From: Sridhar Ponnangatti Masilamani <Sridhar.Masilamani at hcl.com>
> Subject: Re: [vtk-developers] Linking a VTK viewer in MFC Application
> To: David Cole <david.cole at kitware.com>
> Cc: "vtk-developers at vtk.org" <vtk-developers at vtk.org>
> Message-ID:
> <9CD842E470496C4EB9FD76E837FC5CD426EEB89C37 at CHN-HCLT-EVS09.HCLT.CORP.HCL.IN>
> 
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi David,
> 
> I have gone through the specified examples and was able to get the output.
> 
> I am able to get a VTK Viewer and also a MFC window. I am displaying two windows.
> 
> 
> My question is can we integrate a VTK viewer window into a picture control of a MFC application i.e. I want the VTK viewer to be displayed in a single window not displaying as two separate windows?
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: vtk-developers-bounces at vtk.org [mailto:vtk-developers-bounces at vtk.org] On Behalf Of David Cole
> Sent: Wednesday, November 16, 2011 5:08 PM
> To: Sridhar Ponnangatti Masilamani
> Cc: vtk-developers at vtk.org
> Subject: Re: [vtk-developers] Linking a VTK viewer in MFC Application
> 
> Please see the MFC related examples in VTK/Examples/GUI/Win32.
> 
> Adding your ITK support to an app based on one of those examples
> should be a good start.
> 
> 
> HTH,
> David
> 
> On Wed, Nov 16, 2011 at 12:49 AM, Sridhar Ponnangatti Masilamani
> <Sridhar.Masilamani at hcl.com> wrote:
> > Hi,
> >
> >
> >
> > I have made a application in which I read an image using ITK, display it in
> > VTK viewer.
> >
> > I have combined the above two in a MFC Single Document application.
> >
> >
> >
> > So when I click a button on GUI,
> >
> >
> >
> > The image is read in ITK and displayed using a VTK viewer.
> >
> >
> >
> > My concern is I am getting two separate windows i.e. one for the MFC and the
> > other the VTK viewer.
> >
> >
> >
> > Can we combine the VTK Viewer into an MFC GUI i.e. I want to embed that VTK
> > viewer my MFC. I don't want two separate windows coming up.
> >
> >
> >
> > Please provide some suggestions on this.
> >
> >
> >
> >
> >
> > Regards,
> >
> > Sridhar.
> >
> > ________________________________
> > ::DISCLAIMER::
> > -----------------------------------------------------------------------------------------------------------------------
> >
> > The contents of this e-mail and any attachment(s) are confidential and
> > intended for the named recipient(s) only.
> > It shall not attach any liability on the originator or HCL or its
> > affiliates. Any views or opinions presented in
> > this email are solely those of the author and may not necessarily reflect
> > the opinions of HCL or its affiliates.
> > Any form of reproduction, dissemination, copying, disclosure, modification,
> > distribution and / or publication of
> > this message without the prior written consent of the author of this e-mail
> > is strictly prohibited. If you have
> > received this email in error please delete it and notify the sender
> > immediately. Before opening any mail and
> > attachments please check them for viruses and defect.
> >
> > -----------------------------------------------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtk-developers
> >
> >
> >
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
> 
> 
> End of vtk-developers Digest, Vol 91, Issue 13
> **********************************************


L van Ruijven
Functional Anatomy (ACTA)
Gustav Mahlerlaan 3004
1081 LA Amsterdam
Netherlands
Ph. +31(0)20-5980852 (out of office on friday)



More information about the vtk-developers mailing list