tmaire Fri, 08/08/2003 - 10:53 Forums: Other usage issuesHello everyboby, I have a profile (line and arc of circle) to display in V3d_Viewer, how can I do to display them with different colors? Thanks for answer. David Jorge Fri, 08/08/2003 - 17:38 This is what i do to display the point in a bspline curve with a diferent colors: Handle(TPrsStd_AISPresentation) prs; Handle(AIS_InteractiveObject) aObject; Handle(AIS_Drawer) aDrawer; Handle(AIS_InteractiveContext) IC; Handle(Prs3d_PointAspect) asp = new Prs3d_PointAspect(Aspect_TOM_O_POINT,Quantity_NOC_RED,1.0); for(int k=1;k<=nPnt;k++) { prs= TPrsStd_AISPresentation::Set(L.FindChild(k+1), TNaming_NamedShape::GetID()); prs->Display(FALSE); aObject = prs->GetAIS(); aDrawer =aObject->Attributes(); aDrawer->SetPointAspect(asp); aObject->SetAttributes(aDrawer); IC=aObject->GetContext(); IC->SetLocalAttributes(aObject,aDrawer,Standard_True); prs->Display(TRUE); } I think you can adapt to your code. I use the class Prs3d_PointAspect, in your case try to use the class Graphic3d_AspectLine3d. Best regards -- David Jorge Log in to post comments
Fri, 08/08/2003 - 17:38
This is what i do to display the point in a bspline curve with a diferent colors:
Handle(TPrsStd_AISPresentation) prs;
Handle(AIS_InteractiveObject) aObject;
Handle(AIS_Drawer) aDrawer;
Handle(AIS_InteractiveContext) IC;
Handle(Prs3d_PointAspect) asp = new Prs3d_PointAspect(Aspect_TOM_O_POINT,Quantity_NOC_RED,1.0);
for(int k=1;k<=nPnt;k++)
{
prs= TPrsStd_AISPresentation::Set(L.FindChild(k+1), TNaming_NamedShape::GetID());
prs->Display(FALSE);
aObject = prs->GetAIS();
aDrawer =aObject->Attributes();
aDrawer->SetPointAspect(asp);
aObject->SetAttributes(aDrawer);
IC=aObject->GetContext();
IC->SetLocalAttributes(aObject,aDrawer,Standard_True);
prs->Display(TRUE);
}
I think you can adapt to your code.
I use the class Prs3d_PointAspect, in your case try to use the class Graphic3d_AspectLine3d.
Best regards
--
David Jorge