0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / samples / qt / Tutorial / src / DocumentTut.cxx
1 #include "DocumentTut.h"
2
3 #include <Standard_WarningsDisable.hxx>
4 #include <QFileDialog>
5 #include <QMessageBox>
6 #include <QApplication>
7 #include <Standard_WarningsRestore.hxx>
8
9 #include <TopoDS_Shape.hxx>
10 #include <AIS_Shape.hxx>
11 #include <V3d_View.hxx>
12 #include <V3d_Viewer.hxx>
13
14 TopoDS_Shape
15 MakeBottle(const Standard_Real myWidth , const Standard_Real myHeight , const Standard_Real myThickness);
16
17 DocumentTut::DocumentTut( const int theIndex, ApplicationCommonWindow* app )
18 : DocumentCommon( theIndex, app )
19 {
20 }
21
22 DocumentTut::~DocumentTut()
23 {
24 }
25
26 void DocumentTut::onMakeBottle()
27 {
28     Handle(AIS_InteractiveContext) aCtx = getContext();
29     for (V3d_ListOfView::Iterator aViewIter (aCtx->CurrentViewer()->ActiveViews()); aViewIter.More(); aViewIter.Next())
30     {
31       const Handle(V3d_View)& aView = aViewIter.Value();
32       Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams();
33       aParams.RenderResolutionScale = 2.0f;
34     }
35
36     const Handle(Prs3d_Drawer)& aDefDrawer = aCtx->DefaultDrawer();
37     aDefDrawer->SetIsoOnTriangulation (true);
38
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();
48     fitAll();
49     QApplication::restoreOverrideCursor();
50 }
51
52