#pragma once
#endif // _MSC_VER >= 1000
-#include "Tune.h"
#include "AnimationDoc.h"
#include "..\..\Common\res\OCC_Resource.h"
+#include <AIS_AnimationTimer.hxx>
+#include <AIS_ViewController.hxx>
+
class AIS_RubberBand;
enum View3D_CurrentAction {
CurrentAction3d_Turn
};
-class CAnimationView3D : public CView
+class CAnimationView3D : public CView, public AIS_ViewController
{
protected: // create from serialization only
CAnimationView3D();
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
- void SetDimensions ();
- void ReloadData();
- CTune m_Tune;
- void SetFocal (double theFocus, double theAngle);
- void Fly (int x , int y);
- void Turn (int x , int y);
- void Roll (int x , int y);
- void Twist (int x , int y);
protected:
double m_dAngle;
BOOL m_bShift;
- int m_cx , m_cy ;
- int m_curx , m_cury ;
// Generated message map functions
protected:
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnBUTTONZoomProg();
afx_msg void OnBUTTONZoomWin();
+ afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI);
afx_msg void OnChangeBackground();
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- afx_msg void OnSensitivity();
afx_msg void OnBUTTONFly();
afx_msg void OnBUTTONTurn();
afx_msg void OnUpdateBUTTONFly(CCmdUI* pCmdUI);
afx_msg void OnUpdateBUTTONTurn(CCmdUI* pCmdUI);
- afx_msg void OnViewDisplaystatus();
- afx_msg void OnUpdateViewDisplaystatus(CCmdUI* pCmdUI);
//}}AFX_MSG
public :
Handle(V3d_View) myView;
public:
Handle(V3d_View)& GetView() { return myView;};
- void DisplayTuneDialog();
+
+ //! Request view redrawing.
+ void update3dView();
+
+ //! Flush events and redraw view.
+ void redraw3dView();
+
+protected:
+
+ //! Handle view redraw.
+ virtual void handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx,
+ const Handle(V3d_View)& theView) Standard_OVERRIDE;
+
+protected:
+
+ //! Setup mouse gestures.
+ void defineMouseGestures();
+
+ //! Get current action.
+ View3D_CurrentAction getCurrentAction() const { return myCurrentMode; }
+
+ //! Set current action.
+ void setCurrentAction (View3D_CurrentAction theAction)
+ {
+ myCurrentMode = theAction;
+ defineMouseGestures();
+ }
+
private:
- Standard_Integer myXmin;
- Standard_Integer myYmin;
- Standard_Integer myXmax;
- Standard_Integer myYmax;
+ AIS_AnimationTimer myAnimTimer;
+ AIS_MouseGestureMap myDefaultGestures;
+ Graphic3d_Vec2i myClickPos;
Standard_Real myCurZoom;
Standard_Boolean myHlrModeIsOn;
+ Standard_Boolean myIsTurnStarted;
+ unsigned int myUpdateRequests; //!< counter for unhandled update requests
View3D_CurrentAction myCurrentMode;
- double m_Atx , m_Aty , m_Atz ;
- double m_Eyex , m_Eyey , m_Eyez ;
- double m_FlySens ;
- double m_TurnSens ;
- double m_Focus ;
-
-private:
- Handle(AIS_RubberBand) myRect; //!< Rubber rectangle for selection
- void DrawRectangle (Standard_Integer theMinX, Standard_Integer theMinY, Standard_Integer theMaxX, Standard_Integer theMaxY,
- Standard_Boolean theToDraw, Aspect_TypeOfLine theLineType = Aspect_TOL_SOLID);
};
#ifndef _DEBUG // debug version in AnimationView.cpp