| Compute() color problem |
 |
| seumonkey |
2012/12/21 19:25 |
I inherit myclass from AIS_InteractiveObject, and I want to set shape\shape2\shape3 with different color,however I cannot make it .Please help ,thanks.
Compute function as below:
(The final display : three shapes are the same color ,which is same with last color set of myDrawer)
void DblYellowLine::Compute(const Handle_PrsMgr_PresentationManager3d& aPresentationManager,
const Handle_Prs3d_Presentation& aPresentation,
const Standard_Integer aMode )
{
switch (aMode)
{
case 0:
StdPrs_WFDeflectionShape::Add(aPresentation,myShape2, myDrawer ); //Wire Frame 线框
StdPrs_WFDeflectionShape::Add(aPresentation,myShape, myDrawer ); //Wire Frame 线框
break;
case 1:
myDrawer->ShadingAspect()->SetColor(Quantity_NOC_GREEN);
StdPrs_ShadedShape::Add(aPresentation,myShape, myDrawer);
myDrawer->ShadingAspect()->SetColor(Quantity_NOC_BLUE1);
StdPrs_ShadedShape::Add(aPresentation,myShape2, myDrawer);
myDrawer->ShadingAspect()->SetColor(Quantity_NOC_YELLOW);
StdPrs_ShadedShape::Add(aPresentation,myShape3, myDrawer);
}
} |
 |
| | | |