Hi:
Thanks for your answer. But, It get error on
myPlane->Display(GetViewer()->ActiveView(), Quantity_NOC_GRAY);
I have tried to do:
Handle(Geom_Plane) aPlane = new Geom_Plane(P1, aDir); BRepBuilderAPI_MakeFace MakeFace(gp_Pln(aPlane->Pln()), 200, -200, 410, -410);
TopoDS_Face S = MakeFace.Face();
myCurrentIC->Display(new AIS_Shape(S),AIS_Shaded);
It doesn't work. I think that is because of gp_Pln. Do you have any suggestion that I can do? Thanks, again.
Best regards,
Commenter-2
03Commenter-1
Hi,
Is used "GetViewer()->ActiveView()" to get my active V3d_View.
What kind of error do you get with this code ?
and with your code, what do you get ?
Try this :
gp_Pnt P1 (0, 0, 0);
gp_Dir aDir (1, 0, 0);
Handle(Geom_Plane) aPlane = new Geom_Plane(P1, aDir);
BRepBuilderAPI_MakeFace MakeFace(gp_Pln(aPlane->Pln()), -200, 200, -410, 410);
TopoDS_Face S = MakeFace.Face();
Handle (AIS_Shape) AIS_S = new AIS_Shape (S);
AIS_S->SetDisplayMode(1);
myAISContext->Display(AIS_S);
With this code, you get a shaded face. I think it is what you need !
Did you include gp_Pln ?
If you don't, you get a "strange" error : error C2440: 'type cast' : cannot convert from 'class gp_Pln' to 'class gp_Pln' !
Commenter-1
04Commenter-2
Hi mbd,
Thanks for your answer, this is my mistake, I use "myAISContext->Display(AIS_S,AIS_Shaded)" to display so shading mode is not use. I change the code to be "myAISContext->Display(AIS_S,1,Standard_True)" and it is work.