
Fri, 03/29/2013 - 18:01
Data in class or global data:
Handle_Graphic3d_WNTGraphicDevice myGraphicDevice;
Handle_V3d_Viewer myViewer;
Handle_AIS_InteractiveContext myAISContext;
Handle_V3d_View myView;
Handle_WNT_WClass myWClass;
Handle(WNT_Window) aWNTWindow;
Code of 3D view initialization:
myGraphicDevice = new Graphic3d_WNTGraphicDevice();
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice = myGraphicDevice;
theGraphicDevice = myGraphicDevice;
//Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,parent_window);
try {
myWClass= new WNT_WClass((char*)L"some_class_fdfdddd",NULL,CS_HREDRAW|CS_VREDRAW);
} catch (WNT_ClassDefinitionError &err) {
int errcode=GetLastError();
int x=0;
}
WNT_Window * t = new WNT_Window(theGraphicDevice,"some_win_mmmmddddd",myWClass,WS_VISIBLE ,1,1,400,400,Quantity_NOC_MATRAGRAY,NULL);
//WNT_Window * t = new WNT_Window(theGraphicDevice,"some_win_mmmmddddd",myWClass,WS_CHILD | WS_VISIBLE | WS_TABSTOP,1,1,400,400,Quantity_NOC_MATRAGRAY,parent_window);
aWNTWindow = t;
myViewer = new V3d_Viewer(theGraphicDevice,(short *) "Visu3D");
myViewer->SetDefaultLights();
myViewer->SetLightOn();
myView = myViewer->CreateView();
myView->SetWindow(aWNTWindow);
if (!aWNTWindow->IsMapped()){
aWNTWindow->Map();
}
myAISContext =new AIS_InteractiveContext(myViewer);
Handle(V3d_Viewer) aViewer = myViewer;
Handle(AIS_InteractiveContext) aContext;
aContext = new AIS_InteractiveContext(aViewer);
BRepPrimAPI_MakeSphere S(gp_Pnt(0,300,0), 100.);
Handle(AIS_Shape) aisthing=new AIS_Shape(S.Shape());
aContext->SetDisplayMode(aisthing,AIS_Shaded);
aContext->Display(aisthing);
aContext->DisplayAll();
thanks for Travers Biddle http://www.opencascade.org/org/forum/thread_23530/?forum=3
Be sure to call
aContext->SetDisplayMode(aisthing,AIS_Shaded);
aContext->Display(aisthing);
everytime when you modify the shape.
Be sure to call
aContext->Display(aisthing);
everytime when WM_PAINT processed
Mon, 11/16/2015 - 12:13
Hello,
This is my first time using OpenCASCADE, so please be patient with me
.
I'm trying for 4 days to make it works but have nothing yet, And each time I find a good example to follow I find some changes in the OCCT versions.
For example: I have no Handle_Graphic3d_WNTGraphicDevice (I'm on ubuntu, but there is no such thing with xw), no Graphic3d.hxx (used in some examples), no Handle_Aspect_GraphicDevice (also used in another example), for Graphic3d_GraphicDriver I have to use OpenGl_GraphicDriver ... and too many others!.
So I have some questions:
Here is the code I have:
INFO:
OCCT 6.8.0
OS : Ubuntu 14.04 32bit
Tue, 11/17/2015 - 17:43
Dear Amine,
The source package of Open CASCADE Technology 6.9.1 (including documentation, source files of samples and a set of building procedures) is available for all platforms via OCCT Download Center - http://www.opencascade.com/content/latest-release.
Detailed instructions you can find at the sub-folder of installation package - .../opencascade-6.9.1/doc/overview/.
See chapters "../Developer Guides / Building OCCT from sources " and "../Tutorial".
Best regards.
FSR.
Wed, 11/18/2015 - 12:10
Dear Amine,
To be more clear I suggest you OCCT Qt sample $CASROOT/samples/qt/Tutorial as a place to consult.
Best regards
Sergey