8 #include <AIS_InteractiveContext.hxx>
9 #include <V3d_View.hxx>
14 //class COMMONSAMPLE_EXPORT View: public QWidget
15 class View: public QWidget
19 enum CurrentAction3d { CurAction3d_Nothing, CurAction3d_DynamicZooming,
20 CurAction3d_WindowZooming, CurAction3d_DynamicPanning,
21 CurAction3d_GlobalPanning, CurAction3d_DynamicRotation };
24 enum ViewAction { ViewFitAllId, ViewFitAreaId, ViewZoomId, ViewPanId, ViewGlobalPanId,
25 ViewFrontId, ViewBackId, ViewTopId, ViewBottomId, ViewLeftId, ViewRightId,
26 ViewAxoId, ViewRotationId, ViewResetId, ViewHlrOffId, ViewHlrOnId };
28 View( Handle(AIS_InteractiveContext) theContext,
35 bool dump( Standard_CString theFile );
36 QList<QAction*>* getViewActions();
37 void noActiveActions();
40 void setRaytracedShadows( int state );
41 void setRaytracedReflections( int state );
42 void setRaytracedAntialiasing( int state );
44 static QString GetMessages( int type,TopAbs_ShapeEnum aSubShapeType,
45 TopAbs_ShapeEnum aShapeType );
46 static QString GetShapeType( TopAbs_ShapeEnum aShapeType );
48 Standard_EXPORT static void OnButtonuseraction( int ExerciceSTEP,
49 Handle(AIS_InteractiveContext)& );
50 Standard_EXPORT static void DoSelection( int Id,
51 Handle(AIS_InteractiveContext)& );
52 Standard_EXPORT static void OnSetSelectionMode( Handle(AIS_InteractiveContext)&,
54 TopAbs_ShapeEnum& SelectionMode,
56 virtual QPaintEngine* paintEngine() const;
58 void selectionChanged();
77 void updateToggled( bool );
79 void onEnvironmentMap();
82 virtual void paintEvent( QPaintEvent* );
83 virtual void resizeEvent( QResizeEvent* );
84 virtual void mousePressEvent( QMouseEvent* );
85 virtual void mouseReleaseEvent(QMouseEvent* );
86 virtual void mouseMoveEvent( QMouseEvent* );
88 virtual void addItemInPopup( QMenu* );
90 Handle(V3d_View)& getView();
91 Handle(AIS_InteractiveContext)& getContext();
92 void activateCursor( const CurrentAction3d );
93 void Popup( const int x, const int y );
94 CurrentAction3d getCurrentMode();
96 virtual void onLButtonDown( const int nFlags, const QPoint point );
97 virtual void onMButtonDown( const int nFlags, const QPoint point );
98 virtual void onRButtonDown( const int nFlags, const QPoint point );
99 virtual void onLButtonUp( Qt::MouseButtons nFlags, const QPoint point );
100 virtual void onMButtonUp( Qt::MouseButtons nFlags, const QPoint point );
101 virtual void onRButtonUp( Qt::MouseButtons nFlags, const QPoint point );
102 virtual void onMouseMove( Qt::MouseButtons nFlags, const QPoint point );
106 void initViewActions();
107 void DragEvent( const int x, const int y, const int TheState );
108 void InputEvent( const int x, const int y );
109 void MoveEvent( const int x, const int y );
110 void MultiMoveEvent( const int x, const int y );
111 void MultiDragEvent( const int x, const int y, const int TheState );
112 void MultiInputEvent( const int x, const int y );
113 void DrawRectangle( const int MinX, const int MinY,
114 const int MaxX, const int MaxY, const bool Draw );
119 bool myDrawRect; // set when a rect is used for selection or magnify
120 Handle(V3d_View) myView;
121 Handle(AIS_InteractiveContext) myContext;
122 CurrentAction3d myCurrentMode;
123 Standard_Integer myXmin;
124 Standard_Integer myYmin;
125 Standard_Integer myXmax;
126 Standard_Integer myYmax;
127 Quantity_Factor myCurZoom;
128 Standard_Boolean myHlrModeIsOn;
129 QList<QAction*>* myViewActions;
131 QRubberBand* myRectBand; //!< selection rectangle rubber band