Thu, 12/13/2007 - 15:44
Forums:
hi i have drawn to skeches to diffranciate i want to change its line type. how can i do that?
i have gone through some of heders like Aspect_LineType, Prs2d_Type etc but not able to undestand how should i use it.......
thanks in advance !!!!!!
Wed, 12/19/2007 - 13:46
Try this:
myDrawer = new AIS_Drawer();
myDrawer->SetLineAspect(Prs3d_LineAspect(...));
myInteractiveObject->SetAttributes( myDrawer );
Thu, 12/20/2007 - 08:20
thanks a lot man
Thu, 12/20/2007 - 12:40
hi i ve tried the code u mentioned here but got some problem
i m having a member fun of doc file now when i write following code
Handle(AIS_InteractiveObject)CurObject = new AIS_InteractiveObject;
Handle(AIS_Drawer) myDrawer = new AIS_Drawer;
Handle(Prs3d_LineAspect) Lasp = new Prs3d_LineAspect(Quantity_NOC_RED,Aspect_TOL_DASH,1);
myDrawer->SetLineAspect(LAsp);
CurObject->SetAttributes( myDrawer );
for above code it is giving a runtime error at setting atribute ( that is on lastline)
so i ve tried some more part comented last line and added
myAISContext->SetLocalAttributes(CurObject,myDrawer);
here no error occurs but it dont chenges any aspect....
Thu, 12/20/2007 - 16:13
Look at the second line, I've change it.
Handle(AIS_InteractiveObject)CurObject = new AIS_InteractiveObject;
Handle(Prs3d_Drawer) myDrawer = myAISContext->DefaultDrawer();
Handle(Prs3d_LineAspect) Lasp = new Prs3d_LineAspect(Quantity_NOC_RED,Aspect_TOL_DASH,1);
myDrawer->SetLineAspect(LAsp);
CurObject->SetAttributes( myDrawer );
Sat, 11/30/2013 - 21:45
Hi, varad:
Try the following code:
// Make three dot dash line axis.
Handle_AIS_Shape xAxis = new AIS_Shape(BRepBuilderAPI_MakeEdge(gp_Pnt(-5000,0,0), gp_Pnt(5000, 0, 0)));
Handle_AIS_Shape yAxis = new AIS_Shape(BRepBuilderAPI_MakeEdge(gp_Pnt(0,-5000,0), gp_Pnt(0,5000, 0)));
Handle_AIS_Shape zAxis = new AIS_Shape(BRepBuilderAPI_MakeEdge(gp_Pnt(0, 0,-5000), gp_Pnt(0, 0, 5000)));
Handle_Prs3d_LineAspect lineAspect = new Prs3d_LineAspect(Quantity_NOC_WHITE, Aspect_TOL_DOTDASH, 1);
xAxis->Attributes()->SetWireAspect(lineAspect);
yAxis->Attributes()->SetWireAspect(lineAspect);
zAxis->Attributes()->SetWireAspect(lineAspect);
myAISContext->Display(xAxis, false);
myAISContext->Display(yAxis, false);
myAISContext->Display(zAxis, false);