need help on bulding geometry "dinamically&qu

Hi, where i can find a little sample of geometry creation by mouse-input (the function of all CAD's, ie: point'n'click then drag to get the circle....)?

thanks to anyone for the help !

thanx

kim wj's picture

This pseudo code may help you.

//init ais Handle_AIS_InteractiveContext ctxt; Handle_V3d_Viewer viewer; Handle_V3d_View view; ...

//When click mouse Handle_AIS_MyObj =new AIS_MyObj(); ctxt->Display(AIS_MyObj); ...

//when mouse move int mx,my; //pixel coordinate double x,y //view coordinate view->Convert(mx,my,x,y) AIS_MyObj->DeformShape(x,y); ctxt->Redisplay(AIS_MyObj); ...

You must write your own 'Myobj' and implement 'DeformShape' member function. Be careful of graphic performance!

Davide's picture

> You must write your own 'Myobj' and
> implement 'DeformShape' member function. Be
> careful of graphic performance!

thanx for the fast answer....

if i understood i create the object i want to create and then i "deform" it right?

but MyObj what is it? how i have to wriye it? is it like the "driver" in the OCAF sample?

Can i derive it from an existing class?

and to convert pixel in world coordinates?

Again thanx for the help!

Davide

kim wj's picture

No,No!!

'MyObj' is a class inherited from AIS_InteractiveObject. First,you had better read documents in OpenCascade .

Davide's picture

now it is clear :) the problem is that the docs are very huge.. :) im reading them but i would like to have an idea of the "difficulty" of the opencascade package...

thanks for the help :)