7fd59977 |
1 | #include "DocumentTut.h" |
2 | |
55a40de8 |
3 | #include <Standard_WarningsDisable.hxx> |
7fd59977 |
4 | #include <QFileDialog> |
5 | #include <QMessageBox> |
6 | #include <QApplication> |
55a40de8 |
7 | #include <Standard_WarningsRestore.hxx> |
7fd59977 |
8 | |
9 | #include <TopoDS_Shape.hxx> |
10 | #include <AIS_Shape.hxx> |
11 | |
12 | TopoDS_Shape |
13 | MakeBottle(const Standard_Real myWidth , const Standard_Real myHeight , const Standard_Real myThickness); |
14 | |
15 | DocumentTut::DocumentTut( const int theIndex, ApplicationCommonWindow* app ) |
16 | : DocumentCommon( theIndex, app ) |
17 | { |
18 | } |
19 | |
20 | DocumentTut::~DocumentTut() |
21 | { |
22 | } |
23 | |
24 | void DocumentTut::onMakeBottle() |
25 | { |
26 | QApplication::setOverrideCursor( Qt::WaitCursor ); |
27 | TopoDS_Shape aBottle=MakeBottle(50,70,30); |
28 | Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle); |
a966542b |
29 | getContext()->SetMaterial (AISBottle, Graphic3d_NameOfMaterial_Gold, Standard_False); |
0577ae8c |
30 | getContext()->SetDisplayMode(AISBottle, 1, Standard_False); |
7fd59977 |
31 | getContext()->Display(AISBottle, Standard_False); |
404c8936 |
32 | const Handle(AIS_InteractiveObject)& anIOAISBottle = AISBottle; |
33 | getContext()->SetSelected(anIOAISBottle,Standard_False); |
7fd59977 |
34 | emit selectionChanged(); |
35 | fitAll(); |
36 | QApplication::restoreOverrideCursor(); |
37 | } |
38 | |
39 | |