X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_ViewWindow.h;h=00a376e3b256c30b3cd3e3cef0b695ce2fb99543;hb=b6e35aa42d3c67a529d7f9339718dfaed6891323;hp=a9f65625778f6862c1b4eb571710c4e12333fe26;hpb=ad6276bbf89c70b93ccef9a82800f18ff5578a00;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_ViewWindow.h b/src/OCCViewer/OCCViewer_ViewWindow.h old mode 100755 new mode 100644 index a9f656257..00a376e3b --- a/src/OCCViewer/OCCViewer_ViewWindow.h +++ b/src/OCCViewer/OCCViewer_ViewWindow.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 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 @@ -34,6 +34,7 @@ class QtxRectRubberBand; class SUIT_Desktop; class OCCViewer_ViewPort3d; class OCCViewer_ViewSketcher; +class OCCViewer_AutoRotate; class OCCViewer_AxialScaleDlg; class OCCViewer_SetRotationPointDlg; class OCCViewer_Viewer; @@ -60,8 +61,11 @@ public: double scaleY; double scaleZ; QString name; + // trihedron bool isVisible; double size; + // view cube + bool vcIsVisible; // graduated trihedron bool gtIsVisible; bool gtDrawNameX; @@ -116,6 +120,7 @@ public: name(), isVisible( false ), size( 0.0 ), + vcIsVisible( false ), gtIsVisible( false ), gtDrawNameX( false ), gtDrawNameY( false ), gtDrawNameZ( false ), gtNameX(), gtNameY(), gtNameZ(), @@ -143,26 +148,30 @@ class OCCVIEWER_EXPORT OCCViewer_ViewWindow : public SUIT_ViewWindow Q_OBJECT public: - enum { DumpId, FitAllId, FitRectId, FitSelectionId, ZoomId, PanId, GlobalPanId, - ChangeRotationPointId, RotationId, - FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId, - ResetId, CloneId, ClippingId, MemId, RestoreId, - TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId, - SwitchInteractionStyleId, SwitchZoomingStyleId, - SwitchPreselectionId, SwitchSelectionId, - MaximizedId, SynchronizeId, ReturnTo3dViewId, - OrthographicId, PerspectiveId, StereoId, RayTracingId, EnvTextureId, LightSourceId, - UserId }; - - enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, + enum ActionId { DumpId, FitAllId, FitRectId, FitSelectionId, ZoomId, PanId, GlobalPanId, + ChangeRotationPointId, RotationId, + FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId, + ResetId, CloneId, ClippingId, MemId, RestoreId, + TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId, + SwitchInteractionStyleId, SwitchZoomingStyleId, + SwitchPreselectionId, SwitchSelectionId, + MaximizedId, SynchronizeId, ReturnTo3dViewId, + OrthographicId, PerspectiveId, StereoId, RayTracingId, EnvTextureId, LightSourceId, + RectangleSelectionStyleId, PolygonSelectionStyleId, CircleSelectionStyleId, + ViewCubeShowId, + UserId }; + + enum OperationType{ NOVIEWOP, PANVIEW, ZOOMVIEW, ROTATE, PANGLOBAL, WINDOWFIT, FITALLVIEW, FITSELECTION, RESETVIEW, FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW, CLOCKWISEVIEW, ANTICLOCKWISEVIEW, PROJECTION }; - enum RotationPointType{ GRAVITY, SELECTED }; + enum RotationPointType{ BBCENTER, SELECTED }; enum SketchingType { NoSketching, Rect, Polygon }; + enum SelectionStyle { RectStyle, PolygonStyle, CyrcleStyle }; + enum Mode2dType { No2dMode, XYPlane, XZPlane, YZPlane }; enum ProjectionType { Orthographic, Perspective, Stereo }; @@ -201,7 +210,7 @@ public: virtual void setVisualParameters( const QString& parameters ); virtual void initSketchers(); - virtual OCCViewer_ViewSketcher* getSketcher( const int ); + virtual OCCViewer_ViewSketcher* getSketcher( const int ) const; virtual void activateSketching( int ); @@ -219,6 +228,9 @@ public: virtual int projectionType() const; virtual void setProjectionType( int ); + virtual SelectionStyle selectionStyle() const; + virtual void setSelectionStyle(SelectionStyle); + virtual int stereoType() const; virtual void setStereoType( const int ); @@ -242,6 +254,11 @@ public: virtual bool isQuadBufferSupport() const; virtual void setQuadBufferSupport( const bool ); + virtual bool isAutomaticZoom() const; + virtual void setAutomaticZoom( const bool ); + + virtual void enableAutoRotation( const bool ); + void setTransformEnabled( const OperationType, const bool ); bool transformEnabled( const OperationType ) const; @@ -270,6 +287,11 @@ public: virtual SUIT_CameraProperties cameraProperties(); + bool isActionVisible( ActionId theId ) const; + void setActionVisible( ActionId theId, bool isVisible ); + + void resetState(); + public slots: virtual void onFrontView(); virtual void onViewFitAll(); @@ -300,14 +322,17 @@ public slots: virtual void onMemorizeView(); virtual void onRestoreView(); virtual void onTrihedronShow(bool); + virtual void onViewCubeShow(bool); virtual void setRestoreFlag(); virtual void onSwitchInteractionStyle( bool on ); virtual void onSwitchZoomingStyle( bool on ); virtual void onSwitchPreselection( bool on ); virtual void onSwitchSelection( bool on ); + virtual void onSwitchSelectionStyle(QAction* theAction); virtual void onRayTracing(); virtual void onEnvTexture(); virtual void onLightSource(); + virtual void onPanning(); virtual void activateSetRotationGravity(); virtual void activateSetRotationSelected( double theX, double theY, double theZ ); @@ -354,7 +379,6 @@ protected: void vpMouseReleaseEvent(QMouseEvent* theEvent); void vpMouseMoveEvent(QMouseEvent* theEvent); - void resetState(); void drawRect(); void endDrawRect(); @@ -367,6 +391,8 @@ protected: bool computeGravityCenter( double& theX, double& theY, double& theZ ); + void projAndPanToGravity(V3d_TypeOfOrientation CamOri); + virtual void onSketchingStarted(); virtual void onSketchingFinished(); @@ -390,12 +416,14 @@ protected: gp_Pnt mySelectedPoint; bool myRotationPointSelection; - int myRestoreFlag; + int myRestoreFlag; - int myStartX; - int myStartY; - int myCurrX; - int myCurrY; + int myStartX; + int myStartY; + qint64 myStartTime; + int myCurrX; + int myCurrY; + qint64 myCurrTime; bool myEventStarted; // set when transformation is in process bool myCursorIsHand; @@ -405,7 +433,7 @@ protected: bool myPaintersRedrawing; // set to draw with external painters bool IsSketcherStyle; bool myIsKeyFree; - + bool myAutomaticZoom; QCursor myCursor; double myCurScale; @@ -418,6 +446,8 @@ private: QtxRectRubberBand* myRectBand; //!< selection rectangle rubber band + OCCViewer_AutoRotate *myAutoRotate; + bool mySelectionEnabled; bool myPreselectionEnabled; int myInteractionStyle; @@ -430,6 +460,7 @@ private: Handle(V3d_Plane) myReserveClipPlane; viewAspectList myViewAspects; + bool myPanningByBtn; }; #ifdef WIN32