How to get Box height/depth using mouse input?

Hi I want to build a simple cube/box with first point in XY Plane this way :

gp_Pnt p1(-100,-60, 0.0);
gp_Pnt p2(110, 200, ???);

TopoDS_Solid S = BRepPrimAPI_MakeBox(p1,p2);
Handle(AIS_Shape) ais1 = new AIS_Shape(S);
myContext->SetColor(ais1,Quantity_NOC_RED,Standard_False);
myContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False);
myContext->Display(ais1,Standard_False);
myContext->SetCurrentObject(ais1,Standard_False);

For p1 and p2, I get X and Y coordinates through mouse inputs. But How can I specify Z coordinate? could anyone please explain how I can convert Qpoint mouse input to gp_Pnt from which I can extract my Z coordinate to specify my Box height/depth ?

Please help.

Thanks in advance.

Venu

Venugopal Gudimetla's picture

I guess this has be discussed before :
http://www.opencascade.org/org/forum/thread_2785/

in that case...could anyone who has implemented what I am trying to do, could you please tell me if convertToPlane function provided by Dolby is a step in the right direction?

Thanks,

V