TopoDS_Shape cylinder = BRepPrimAPI_MakeCylinder(ax1,R,H1).Shape();
Handle(AIS_Shape) ais_cylinder = new AIS_Shape(cylinder);
ais_cylinder->SetColor(Quantity_NOC_RED);
m_context->Display(ais_cylinder, Standard_True);
创建圆锥
TopoDS_Shape cone = BRepPrimAPI_MakeCone(ax2,R1,R2,H2).Shape();
Handle(AIS_Shape) ais_cone = new AIS_Shape(cone);
m_context->Display(ais_cone, Standard_True);
得到的图形显示结果为
如图所示 圆柱颜色更改为红色 圆锥为黄色