convert 3D to 2D problem

HI. I have a plane which my program operate in 3D workspace. And then using operator pan, change the 2D workspace. So i initialize the Viewer and view at C****Doc::C****Doc().

first question is,

if i change the workspace from 3D to 2D, Can i use the 2D operator?
for example, trim. intersection and another functions.

second question is,
if first question is possible, How do i generate the 2D Trihedron and rectangular grid??

Hi yeon cheol,

Use a 3D viewer and project your view to say XOY plane, do your 2d geometric sketches, apply your 2d operations like trimming, extends etc, it works right? and regarding 2D Tridhedron, I didn't try but don't you think the 3D Trihedron is enough as it automatically orients based on which view you choose? may be you want 2d trihedron for some reason other than this, I am not sure. But you can again try Qt example provided witht he OCC package or see QtOCC done by Pete Dolbey to get an idea what I mean.

Thanks,
Venu

Hi Venu, you help me again.

Exactly, Right!!!. It's my mistake that don't read document in detail. almost 2D operator exist in 3D. So I think divided workspace is not necessary. But I already try to make a 2D Tridhedron at 2D workspace using by serving on OCC. But I can't. Of course, Using the Line segement and Vector, It's possible to make a Tridhedron. I agree your idea which is related with orients of view. So Todays I use Tridhedron. Your kinds always make me happy and thanks to you.

PS) If you know how to display the Point Position at 3D Workspace in realtime, please tell me what i use the function? for example,2D Workspace, V2d_View and Graphic2D_Buffer is offered. (I See the this code in OCC Geometry example, ISession2D_InteractiveContext::Move). I try to find the similar function, I haven't fined it yet.

Have a nice day

Venu

Hi Yeon Cheol,
please look at Geometry examples of mfc. But you can store a point in gp_Pnt or gp_Pnt2d as the case may be and use AIS_Point to display and interactive point, but please remember that gp_Pnt and gp_Pnt2d are not persistent, ie they are not created on heap. You have to use Handle variables to gain persistence and most of the operations you may want to implement are already done in mfc/java examples. Hope that helps.

Venu

HI Venu!!

I read a your Reply. Already, I create 3D point using by gp_pnt class. written the reply which comment your first suggestion is not enough to explain what do i want. I'm sorry about that. what i means about display point is display both point which is relate with marker and the text related with point position. Before the question, I success displaying point. of course, It's possible that you help me.

My problem is to display the text about position relate with point. maybe you look the text which is located in left down corner, if you run Geometry example and after click the rectangular grid with line. It's not text, P1 or P2, just numeric character and change in realtime, if you mouse move.

that's my want and try to do it. But You Know, It's in 2D workspace, But I want to make In 3D workspace. Too many class and function in OCC, sometimes i can't find proper function or class to solve the problem. I think you have many experience Using OCC. But i'm not,

I always thank about your kind. and never forget it. I'm really thank you.

thanks Venu!!!

Don't forget it!!!