
Fri, 04/07/2006 - 18:51
Forums:
Hi guys;
I want to display all the faces of the Box in different location .But they can't display at all and there is no error arrised:
myAISContext->OpenLocalContext();
TopoDS_Shape Sh=Box->Shape();
TopExp_Explorer expFace(Sh,TopAbs_FACE);
gp_Vec veclocation(100, 0, 0);
gp_Trsf trsf;
trsf.SetTranslation(veclocation);
TopLoc_Location toploc_location(trsf);
TopoDS_Shape aFace ;
while (expFace.More())
{
aFace = expFace.Current();
aFace.Location(toploc_location);
Handle(AIS_Shape) bFace = new AIS_Shape(aFace);
myAISContext->SetColor(bFace,Quantity_NOC_BLACK);
myAISContext->Display(bFace,Standard_True);
}
Thanks a lot !!!
Sun, 05/28/2006 - 07:40
Hi,
I may not understand the problem, but I think you must at least put a
expFace.Next()
in your while loop, so that it won't access the same face in all loop, which was doing a never ending loop . I think that the member function .More() only tells if there's a Next shape in the TopExp_Explorer object, but it doesn't move to the Next shape.
I hope it helps you.
Miguel