1 #include "DocumentTut.h"
3 #include <Standard_WarningsDisable.hxx>
6 #include <QApplication>
7 #include <Standard_WarningsRestore.hxx>
9 #include <TopoDS_Shape.hxx>
10 #include <AIS_Shape.hxx>
11 #include <V3d_View.hxx>
12 #include <V3d_Viewer.hxx>
15 MakeBottle(const Standard_Real myWidth , const Standard_Real myHeight , const Standard_Real myThickness);
17 DocumentTut::DocumentTut( const int theIndex, ApplicationCommonWindow* app )
18 : DocumentCommon( theIndex, app )
22 DocumentTut::~DocumentTut()
26 void DocumentTut::onMakeBottle()
28 Handle(AIS_InteractiveContext) aCtx = getContext();
29 for (V3d_ListOfView::Iterator aViewIter (aCtx->CurrentViewer()->ActiveViews()); aViewIter.More(); aViewIter.Next())
31 const Handle(V3d_View)& aView = aViewIter.Value();
32 Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams();
33 aParams.RenderResolutionScale = 2.0f;
36 const Handle(Prs3d_Drawer)& aDefDrawer = aCtx->DefaultDrawer();
37 aDefDrawer->SetIsoOnTriangulation (true);
39 QApplication::setOverrideCursor( Qt::WaitCursor );
40 TopoDS_Shape aBottle=MakeBottle(50,70,30);
41 Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);
42 getContext()->SetMaterial (AISBottle, Graphic3d_NameOfMaterial_Gold, Standard_False);
43 getContext()->SetDisplayMode(AISBottle, 1, Standard_False);
44 getContext()->Display(AISBottle, Standard_False);
45 const Handle(AIS_InteractiveObject)& anIOAISBottle = AISBottle;
46 getContext()->SetSelected(anIOAISBottle,Standard_False);
47 emit selectionChanged();
49 QApplication::restoreOverrideCursor();