X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_ViewModel.h;h=63db7700b2b4dec9694189bbdc6a2f121da08fd1;hb=cc3aee928da1d8820c8f5857e5022dcd8b4951f0;hp=e6893e3073b4fdd967188a3aca643d1775de4277;hpb=22848c5a37cca698c3499080b49212bbcae0d93f;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_ViewModel.h b/src/OCCViewer/OCCViewer_ViewModel.h index e6893e307..63db7700b 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.h +++ b/src/OCCViewer/OCCViewer_ViewModel.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 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 @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -28,6 +28,7 @@ #include #include "OCCViewer.h" +#include "OCCViewer_ClipPlane.h" #include "Qtx.h" #include "SUIT_ViewModel.h" @@ -35,15 +36,20 @@ #include #include #include +#include +#include class QKeyEvent; class QMouseEvent; class SUIT_ViewWindow; class SUIT_Desktop; +class OCCViewer_ClippingDlg; class OCCViewer_ViewWindow; +class OCCViewer_ViewPort3d; + +class QtxAction; -class AIS_ListOfInteractive; #ifdef WIN32 #pragma warning( disable:4251 ) @@ -62,9 +68,17 @@ public: Corner3Gradient, Corner4Gradient, LastGradient = Corner4Gradient }; + /*! supported stereo types */ + enum { + QuadBufferType, AnaglyphType, + RowInterlacedType, ColumnInterlacedType, + ChessBoardType, SideBySideType, + OverUnderType + }; static QString Type() { return "OCCViewer"; } static QString backgroundData( QStringList&, QIntList&, QIntList& ); + static void stereoData( QStringList&, QIntList&); OCCViewer_Viewer( bool DisplayTrihedron = true); virtual ~OCCViewer_Viewer(); @@ -80,11 +94,13 @@ public: void getSelectedObjects(AIS_ListOfInteractive& theList); void setObjectsSelected(const AIS_ListOfInteractive& theList); - void setSelected(const Handle(AIS_InteractiveObject)& theIO) { myAISContext->SetSelected(theIO);} + void setSelected(const Handle(AIS_InteractiveObject)& theIO) { myAISContext->SetSelected(theIO,Standard_True);} void performSelectionChanged(); // emit signal selectionChanged + void setDefaultLights(); + QColor backgroundColor() const; // obsolete void setBackgroundColor( const QColor& ); // obsolete Qtx::BackgroundData background() const; @@ -107,8 +123,9 @@ public: bool trihedronRelative() const {return myIsRelative; } - // a utility function, used by SALOME_View_s methods + // a utility functions, used by SALOME_View_s methods bool computeTrihedronSize( double& theNewSize, double& theSize ); + virtual double computeSceneSize(const Handle(V3d_View)&) const; void updateTrihedron(); @@ -117,7 +134,6 @@ public: public: Handle(V3d_Viewer) getViewer3d() const { return myV3dViewer;} - Handle(V3d_Viewer) getCollector3d() const { return myV3dCollector; } Handle(AIS_InteractiveContext) getAISContext() const { return myAISContext; } Handle(AIS_Trihedron) getTrihedron() const { return myTrihedron; } @@ -126,6 +142,30 @@ public: int interactionStyle() const; void setInteractionStyle( const int ); + int projectionType() const; + void setProjectionType( const int ); + int stereoType() const; + void setStereoType( const int ); + + int anaglyphFilter() const; + void setAnaglyphFilter( const int ); + + void setStereographicFocus( const int, const double ); + int stereographicFocusType() const; + double stereographicFocusValue() const; + + void setInterocularDistance( const int, const double ); + int interocularDistanceType() const; + double interocularDistanceValue() const; + + bool isReverseStereo() const; + void setReverseStereo( const bool ); + + bool isVSync() const; + void setVSync( const bool ); + + bool isQuadBufferSupport() const; + void setQuadBufferSupport( const bool ); int zoomingStyle() const; void setZoomingStyle( const int ); @@ -140,11 +180,31 @@ public: void enableMultiselection(bool isEnable); bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; } + bool enableDrawMode( bool on ); + + void setClippingColor( const QColor& ); + QColor clippingColor() const; + + void setClippingTextureParams( const bool, const QString&, const bool, const double ); + bool isDefaultTextureUsed() const; + QString clippingTexture() const; + bool isTextureModulated() const; + double clippingTextureScale() const; + int getSelectionCount() const { return (!myAISContext.IsNull())? myAISContext->NbSelected():0; } - bool isStaticTrihedronDisplayed() { return myShowStaticTrihedron; } void setStaticTrihedronDisplayed(const bool on); + /* Clip planes management */ + Handle(Graphic3d_ClipPlane) createClipPlane(const gp_Pln& thePlane, const Standard_Boolean theIsOn); + void setClipPlanes (ClipPlanesList theList); + ClipPlanesList getClipPlanes() const; + void applyExistingClipPlanesToObject (const Handle(AIS_InteractiveObject)& theObject); + + OCCViewer_ClippingDlg* getClippingDlg() const; + void setClippingDlg(OCCViewer_ClippingDlg* theDlg); + + /* Selection management */ bool highlight( const Handle(AIS_InteractiveObject)&, bool, bool=true ); bool unHighlightAll( bool=true, bool=true ); @@ -168,37 +228,58 @@ protected slots: virtual void onMouseMove(SUIT_ViewWindow*, QMouseEvent*); virtual void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*); virtual void onKeyPress(SUIT_ViewWindow*, QKeyEvent*); - virtual void onViewClosed(); - virtual void onViewMapped(); + virtual void onViewClosed(OCCViewer_ViewPort3d*); + virtual void onViewMapped(OCCViewer_ViewPort3d*); void onDumpView(); void onChangeBackground(); protected: + Handle(V3d_Viewer) myV3dViewer; - Handle(V3d_Viewer) myV3dCollector; Handle(AIS_Trihedron) myTrihedron; - Handle(AIS_InteractiveContext) myAISContext; + Handle(AIS_InteractiveContext) myAISContext; int myInteractionStyle; int myZoomingStyle; + int myProjectionType; + int myStereoType; + int myAnaglyphFilter; + int myStereographicFocusType; + int myInterocularDistanceType; + + double myStereographicFocusValue; + double myInterocularDistanceValue; bool myPreselectionEnabled; bool mySelectionEnabled; bool myMultiSelectionEnabled; bool myIsRelative; + bool myToReverseStereo; + bool myVSyncMode; + bool myQuadBufferSupport; int myTopLayerId; //QColor myBgColor; QPoint myStartPnt, myEndPnt, myCurPnt; - bool myShowStaticTrihedron; - double myTrihedronSize; QVector myBackgrounds; + + OCCViewer_ClippingDlg* myClippingDlg; + + ClipPlanesList myClipPlanes; + Graphic3d_SequenceOfHClipPlane myInternalClipPlanes; + + QColor myClippingColor; + bool myDefaultTextureUsed; + QString myClippingTexture; + bool myTextureModulated; + double myClippingTextureScale; + }; #ifdef WIN32