
Thu, 12/07/2006 - 07:42
Forums:
hi,
i'm relatively new to open cascade...
i have actually did the process of reading the STEP file and allowing the model to be displayed in the window using the V3d_Viewer...
Now in my particular application instead of using the V3d_Viewer...i need to make use of the CWnd class in the visual c++ and also the viewer which is being provided by the CWnd class...
kindly reply as early as possible....
Regards,
E.G.Arun Prasath
Thu, 12/07/2006 - 14:50
I don't really understand what you mean. You should use a V3d_Viewer, but connect it to the window under a CWnd object. If you look at section 4.2 and 4.2 of the Visualization User's Guide, it gives a loose example. So, if you have a CWnd object called myWindow, you would want to do something like (untested):
Handle(Graphic3d_WNTGraphicDevice) hDevice = new Graphic3d_WNTGraphicDevice();
TCollection_ExtendedString viewerName("OCC Viewer");
Handle(V3d_Viewer) hViewer = new V3d_Viewer(hDevice, viewerName.ToExtString());
hViewer->Init();
Handle(WNT_Window) hWnd = new WNT_Window(hDevice, myWindow->GetSafeHWnd());
Handle(V3d_View) hView = hViewer->CreateView();
hView->SetWindow(hWnd);
Good luck.
Thu, 12/07/2006 - 15:27
hi Rob,
Thanks for your reply...
Actually i have did the same as what you have mentioned over here..i'll just submit a sample over here and you please refer and say whether the methodology i did is proper also say me it does satisfy the requirements which i specified in my earlier post...
Handle(Graphic3d_WNTGraphicDevice) hDevice = new Graphic3d_WNTGraphicDevice();
TCollection_ExtendedString viewerName("OCC Viewer");
Handle(V3d_Viewer) hViewer = new V3d_Viewer(hDevice, viewerName.ToExtString());
hViewer->Init();
Handle(WNT_Window) hWnd = new WNT_Window(hDevice,GetSafeHWnd());
Handle(V3d_View) hView = hViewer->CreateView();
hView->SetWindow(hWnd);
Here i haven't included the CWnd object(myWindow) as specified by you in ur post...This is wat i have did in my application..now please refer it and reply me at the earliest...
Regards,
E.G.Arun Prasath.
Thu, 12/07/2006 - 15:34
If this code is in member function of a CWnd derived class, it should work fine.
Rob
Thu, 12/07/2006 - 15:50
hi Rob,
Thanks again for your reply,
Yes this code is being wirtten under the class which is being inherited from CView class....Is it ok..
Regards,
E.G.Arun Prasath.
Thu, 12/07/2006 - 16:04
I haven't used MFC for over 10 years, but I believe this should be fine.
Thu, 12/07/2006 - 17:00
hi Rob,
Thanks you for your reply once again...
i hope i did everything right....thanks for your support....
Regards,
E.G.Arun Prasath