problem about making a non zoomable object

hi. i make a xy, yz, zx plane which is base on workspace.

first i use gP package to generate an origin and each direction and then make gp_Pln.

from this, make Handle(Geom_Plane) using GC_MakePlane.

finally Handle(AIS_Plane) object is maden.

of course, it is not difficult to make each plane. but i face a problem is non zoomable object.

when i call the zoom operator, plane also change it's size.

could you help me?

EricThompson's picture

The only way I found to do this was to draw the non-zoomable object myself in OpenGL in a callback function ( Aspect_GraphicCallbackProc )

The callback function is specified in the mView->SetWindow(...) method, and is called each time OpenCascade is about to redraw the window.

shudolf's picture

thanks Eric.

i appreciate your kind and try to it. but i confuse what do i input the argument?

there is 4 type in V3d_View->SetWindows() method.

1st argument, in my case, my OS is windows so i use the WNT_Windows.

But other argument, i don't know how do i control of it. could you more explain?

1. when i call this function? which location?
2. detailed explaination about argument.


EricThompson's picture

You are correct, the first parameter is your WNT_Window.
The second parameter can be NULL.
The third parameter is the function you want to have called when it is time for you to draw your stuff.
The fourth is a void*, and you can pass in a pointer to anything you want, and that pointer will be passed along to your callback function. If you don't need anything passed to your callback, you can pass in NULL for this.

In my case, my SetWindows call looks like this:

mView->SetWindow( mWindow, NULL, WindowRenderCallback, pMyWindow );

And my WindowRenderCallback is defined like this:

int WindowRenderCallback( Aspect_Drawable windowId, void* pMyWin, Aspect_GraphicCallbackStruct* callbackData )
MyWindowClass* pMyWindow = (MyWindowClass*) pMyWin;

Note that the last parameter in my call to SetWindow is the second parameter to my callback method.

shudolf's picture

Hi Eric!!

I would learn more about OCC as your kinds. of course, i saw some structure like Aspect_GraphicCallbackStruct at first time. But i think, i got it whenever :-)

really appriciate your kind !!

Yeon Cheol