void MainWindow::on_drawCone() { gp_Ax2 anAxis; anAxis.SetLocation(gp_Pnt(0.0, 10.0, 0.0)); TopoDS_Shape aTopoCone = BRepPrimAPI_MakeCone(anAxis, 3.0, 0.0, 5.0).Shape(); occView->DrawShape(aTopoCone); }
void CCone::MakeTransformedShape(const gp_Trsf &mat) { m_pos.Transform(mat); double scale = gp_Vec(1, 0, 0).Transformed(mat).Magnitude(); m_r1 = fabs(m_r1 * scale); m_r2 = fabs(m_r2 * scale); m_height = fabs(m_height * scale); m_shape = BRepPrimAPI_MakeCone(m_pos, m_r1, m_r2, m_height).Shape(); }
void occQt::makeCone() { gp_Ax2 anAxis; anAxis.SetLocation(gp_Pnt(0.0, 10.0, 0.0)); TopoDS_Shape aTopoReducer = BRepPrimAPI_MakeCone(anAxis, 3.0, 1.5, 5.0); Handle_AIS_Shape anAisReducer = new AIS_Shape(aTopoReducer); anAisReducer->SetColor(Quantity_NOC_BISQUE); anAxis.SetLocation(gp_Pnt(8.0, 10.0, 0.0)); TopoDS_Shape aTopoCone = BRepPrimAPI_MakeCone(anAxis, 3.0, 0.0, 5.0); Handle_AIS_Shape anAisCone = new AIS_Shape(aTopoCone); anAisCone->SetColor(Quantity_NOC_CHOCOLATE); mContext->Display(anAisReducer); mContext->Display(anAisCone); }
CCone::CCone(const gp_Ax2& pos, double r1, double r2, double height, const wxChar* title, const HeeksColor& col, float opacity):CSolid(BRepPrimAPI_MakeCone(pos, r1, r2, height), title, col, opacity), m_render_without_OpenCASCADE(false), m_pos(pos), m_r1(r1), m_r2(r2), m_height(height) { }