X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_ViewWindow.h;h=57165f3bff5cfb7df4a4968352e164fca3dbc966;hb=8d986a56d8745aba15e2241a252c02bf30b53999;hp=ca1869d2ea022fb2c69319654346ba63a3e2be69;hpb=24c05aefb9c1992ed0947559d94783a7eff85971;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_ViewWindow.h b/src/OCCViewer/OCCViewer_ViewWindow.h index ca1869d2e..57165f3bf 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.h +++ b/src/OCCViewer/OCCViewer_ViewWindow.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -28,6 +28,7 @@ #include "SUIT_ViewWindow.h" #include #include +#include class QtxRectRubberBand; class SUIT_Desktop; @@ -142,7 +143,7 @@ class OCCVIEWER_EXPORT OCCViewer_ViewWindow : public SUIT_ViewWindow Q_OBJECT public: - enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, + enum ActionId { DumpId, FitAllId, FitRectId, FitSelectionId, ZoomId, PanId, GlobalPanId, ChangeRotationPointId, RotationId, FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId, ResetId, CloneId, ClippingId, MemId, RestoreId, @@ -150,19 +151,27 @@ public: SwitchInteractionStyleId, SwitchZoomingStyleId, SwitchPreselectionId, SwitchSelectionId, MaximizedId, SynchronizeId, ReturnTo3dViewId, + OrthographicId, PerspectiveId, StereoId, RayTracingId, EnvTextureId, LightSourceId, UserId }; enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, - PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW, + PANGLOBAL, WINDOWFIT, FITALLVIEW, FITSELECTION, RESETVIEW, FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW, - CLOCKWISEVIEW, ANTICLOCKWISEVIEW }; + CLOCKWISEVIEW, ANTICLOCKWISEVIEW, PROJECTION }; - enum RotationPointType{ GRAVITY, SELECTED }; + enum RotationPointType{ BBCENTER, SELECTED }; enum SketchingType { NoSketching, Rect, Polygon }; - enum Mode2dType { No2dMode, XYPlane, XZPlane, YZPlane}; + enum Mode2dType { No2dMode, XYPlane, XZPlane, YZPlane }; + enum ProjectionType { Orthographic, Perspective, Stereo }; + + enum StereoType { QuadBuffer, Anaglyph, RowInterlaced, ColumnInterlaced, ChessBoard, SideBySide, OverUnder, SoftPageFlip, NumberOfModes }; + + enum AnaglyphFilter { RedCyan, YellowBlue, GreenMagenta }; + + enum FocusIODType { Absolute, Relative }; OCCViewer_ViewWindow(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel); virtual ~OCCViewer_ViewWindow(); @@ -177,6 +186,8 @@ public: virtual void initLayout(); + virtual bool enableDrawMode( bool ); + virtual void updateEnabledDrawMode(); virtual void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0, @@ -205,10 +216,38 @@ public: virtual bool isSelectionEnabled() const; virtual void enableSelection( bool ); + virtual int projectionType() const; + virtual void setProjectionType( int ); + + virtual int stereoType() const; + virtual void setStereoType( const int ); + + virtual int anaglyphFilter() const; + virtual void setAnaglyphFilter( const int ); + + virtual void setStereographicFocus( const int, const double ); + virtual int stereographicFocusType() const; + virtual double stereographicFocusValue() const; + + virtual void setInterocularDistance( const int, const double ); + virtual int interocularDistanceType() const; + virtual double interocularDistanceValue() const; + + virtual bool isReverseStereo() const; + virtual void setReverseStereo( const bool ); + + virtual bool isVSync() const; + virtual void setVSync( const bool ); + + virtual bool isQuadBufferSupport() const; + virtual void setQuadBufferSupport( const bool ); + + virtual bool isAutomaticZoom() const; + virtual void setAutomaticZoom( const bool ); + void setTransformEnabled( const OperationType, const bool ); bool transformEnabled( const OperationType ) const; - void set2dMode( Mode2dType ); Mode2dType get2dMode() const { return my2dMode; } @@ -222,6 +261,8 @@ public: virtual QColor backgroundColor() const; // obsolete virtual void setBackgroundColor( const QColor& ); // obsolete + virtual void showStaticTrihedron( bool ); + virtual Qtx::BackgroundData background() const; virtual void setBackground( const Qtx::BackgroundData& ); @@ -232,6 +273,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(); @@ -243,8 +289,12 @@ public slots: virtual void onRightView(); virtual void onClockWiseView(); virtual void onAntiClockWiseView(); + virtual void onProjectionType( QAction* theAction ); + virtual void onStereoType( bool activate ); + virtual void onProjectionType(); virtual void onResetView(); virtual void onFitAll(); + virtual void onFitSelection(); virtual void activateZoom(); virtual void activateWindowFit(); virtual void activateRotation(); @@ -257,16 +307,20 @@ public slots: virtual void onAmbientToogle(); virtual void onMemorizeView(); virtual void onRestoreView(); - virtual void onTrihedronShow(); + virtual void onTrihedronShow(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 onRayTracing(); + virtual void onEnvTexture(); + virtual void onLightSource(); + virtual void onPanning(); virtual void activateSetRotationGravity(); virtual void activateSetRotationSelected( double theX, double theY, double theZ ); - virtual void activateStartPointSelection(); + virtual void activateStartPointSelection( TopAbs_ShapeEnum ); virtual void updateGravityCoords(); virtual void showEvent( QShowEvent * ); @@ -295,6 +349,8 @@ public: protected: virtual QString filter() const; + bool isOpenGlStereoSupport() const; + /* Transformation selected but not started yet */ bool transformRequested() const; bool setTransformRequested ( OperationType ); @@ -307,24 +363,27 @@ protected: void vpMouseReleaseEvent(QMouseEvent* theEvent); void vpMouseMoveEvent(QMouseEvent* theEvent); - void resetState(); void drawRect(); void endDrawRect(); void createActions(); void createToolBar(); - + virtual OperationType getButtonState(QMouseEvent* theEvent, int theInteractionStyle); viewAspect getViewParams() const; bool computeGravityCenter( double& theX, double& theY, double& theZ ); + void projAndPanToGravity(V3d_TypeOfOrientation CamOri); + virtual void onSketchingStarted(); virtual void onSketchingFinished(); virtual OCCViewer_ViewSketcher* createSketcher( int ); + void saveCursor(); + OCCViewer_ViewSketcher* mypSketcher; QList mySketchers; @@ -352,10 +411,11 @@ protected: bool myCursorIsHand; bool myDrawRect; // set when a rect is used for selection or magnify bool myEnableDrawMode; + bool myDrawRectEnabled; bool myPaintersRedrawing; // set to draw with external painters bool IsSketcherStyle; bool myIsKeyFree; - + bool myAutomaticZoom; QCursor myCursor; double myCurScale; @@ -380,6 +440,7 @@ private: Handle(V3d_Plane) myReserveClipPlane; viewAspectList myViewAspects; + bool myPanningByBtn; }; #ifdef WIN32