Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Usage issues / problem of visualization of TopoDS_Shape

problem of visualization of TopoDS_Shape

problem of visualization of TopoDS_Shape
Canan Gunicen 2012/06/08 17:15
I have an object of type TopoDS_Shape. Now I wanted to visualize this data, which classes I can use, I searched the forum, I try the sample codes in forum but they were not working. Is there any thread or any classes you could advice?

Thank you already.
Marco Nanni 2012/06/11 01:48
Hello Canan,

Give a look to the doc visu at "4. 2. 4 Create an interactive context".
I assume you have already set up a window, a viewer, a view, and an ais interactive context. If not, look as well some page backward.

Cheers,
Marco.
Canan Gunicen 2012/06/11 15:47
Thank you Marco.
I will be grateful if you help me with problem below.

After I saw your post,

     Handle(Graphic3d_WNTGraphicDevice) TheGraphicDevice = new Graphic3d_WNTGraphicDevice();
     TCollection_ExtendedString aName("3DV");
     Handle (V3d_Viewer) myViewer;
     myViewer = new V3d_Viewer ( TheGraphicDevice, aName.ToExtString(), "");
     
     myViewer->SetDefaultLights();
     myViewer->SetLightOn();

     Handle ( WNT_Window) aWNTWindow;
     aWNTWindow = new WNT_Window(TheGraphicDevice, theApp.m_pMainWnd->GetSafeHwnd());
     Handle(V3d_View) myView = myViewer->CreateView();
     myView->SetWindow(aWNTWindow);

     StlAPI_Reader reader;
     TopoDS_Shape aShape;
     std::string filename = "flank_original.tcl";
     reader.Read(aShape, (char*)filename.c_str());
     
     Handle(AIS_InteractiveContext) myAISContext = new AIS_InteractiveContext(myViewer);
     Handle(AIS_Shape) aAISShape = new AIS_Shape(aShape);
     myAISContext->Display(aAISShape);

I created this code piece, but there is a problem with this line :

     Handle(Graphic3d_WNTGraphicDevice) TheGraphicDevice = new Graphic3d_WNTGraphicDevice();

The error says unhandled exception. Btw I am running MFC application.

What can be the problem?

Thank you already!
Canan.
Marco Nanni 2012/06/11 16:44
Hello Canan,

This should work well.

I never used MFC, but I usually you do not use the macro Handle() to declare the type:

Could you try insteed:

Handle_Graphic3d_WNTGraphicDevice TheGraphicDevice = new Graphic3d_WNTGraphicDevice();

I guess you forget to import Standard_Macro.hxx.

Cheers,

Marco.
Canan Gunicen 2012/06/11 17:01
Hi Marco,

I guess you forgot something here, what will I try instead :

Handle_Graphic3d_WNTGraphicDevice TheGraphicDevice = new Graphic3d_WNTGraphicDevice();

Btw I also included Standard_Macro.hxx but it didn't work.

What do you recommend to use instead of MFC?

I know I am keeping you busy and I am sorry, but I hope you can help.

Cheers,

Canan.
Marco Nanni 2012/06/11 17:08
No problem Canan,

MFC is not the problem, I would stay with it.

It is like you have an initialization problem. Try to study the samples. There is one very good based on MFC. You will find it in the binary distribution as well (under samples).

I am sorry but, as I do not use MFC, I cannot help you further.

Cheers,

Marco.
shmsh 2013/02/09 03:53
Dear Canan Gunicen

I also tried to do the same thing but it did not work ...
did you get a solution for that ???
if you got it kindly post it ???
I'm also using MFC , and when i try to debug it ,it gives me an error of
"First-chance exception at 0x75c0c41f in CIRCLE.exe: Microsoft C++ exception: Aspect_GraphicDeviceDefinitionError at memory location 0x002ae98c..
Unhandled exception at 0x75c0c41f in CIRCLE.exe: Microsoft C++ exception: Aspect_GraphicDeviceDefinitionError at memory location 0x002ae98c.."

Regards
Marco Nanni 2012/06/11 16:54
Hello Canan,

try to put as well after SetWindow(aWNTWindow):

if (!aWNTWindow->IsMapped()) aWNTWindow->Map();

Cheers,

Marco.
 
 
Latest news
  • Open CASCADE Technology 6.7.0 is available for download!
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map