X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_ViewPort3d.h;h=834f061bf552257f2c5da41500d65335734e9dff;hb=ebe38156f99322f96cfe86347908c7a55f340afe;hp=427152779122440a3383984ffa8fb1e46f63a0f4;hpb=8091ffdec0e55752a16ec4d46ac1b944fc1e1ddf;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.h b/src/OCCViewer/OCCViewer_ViewPort3d.h index 427152779..834f061bf 100644 --- a/src/OCCViewer/OCCViewer_ViewPort3d.h +++ b/src/OCCViewer/OCCViewer_ViewPort3d.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -29,6 +29,8 @@ #include #include +#include + class QColor; class QString; class QRect; @@ -81,6 +83,12 @@ public: virtual void startRotation( int, int, int, const gp_Pnt& ); virtual void rotate( int, int, int, const gp_Pnt& ); virtual void endRotation(); + + // Set the rotation axis and start automatic rotation + void setRotationAxis(const gp_Vec& theAxis, double theAngle, double theZAngle); + // Stop the automatic rotation + void stopRotation(); + bool isBusy() {return myBusy;} // check that View Port is fully initialized void setAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; } @@ -101,6 +109,7 @@ public slots: virtual bool synchronize( OCCViewer_ViewPort* ); private slots: + void updateRotation(); void repaintViewAfterMove(); protected: @@ -129,6 +138,12 @@ private: int myBgImgHeight; int myBgImgWidth; QCursor* myCursor; + // Fields for automatic rotation + gp_Ax1 myRotAxis; // The rotation axis + double myRotAngle; // The angular rotation speed + bool myIsRotating; // Whether rotation animation is active + qint64 myLastRender; // Timestamp of last paint event + QTimer* myRotTimer; // Rotation timer }; #ifdef WIN32