Salome HOME
Merge V9_dev branch into master
[modules/gui.git] / src / OCCViewer / OCCViewer_Utilities.h
index 1cbbacf2442a7c4239ef38d9ba9e52dd112aa934..7db427e50ebd56b899b3d9dc7f3d7b71e540ac6c 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -49,10 +49,39 @@ public:
    * Set 2D mode for the viewer. Hide or show 3D actions.
    * \param theViewer an OCC viewer
    * \param theMode OCC view window mode
+   * \return the old 2d mode.
    */
-  static void setViewer2DMode( OCCViewer_Viewer* theViewer,
+  static OCCViewer_ViewWindow::Mode2dType
+              setViewer2DMode( OCCViewer_Viewer* theViewer,
                                const OCCViewer_ViewWindow::Mode2dType& theMode );
 
+  /*!
+   * Find dialog in the current view frame by name
+   * \param theView an OCC view
+   * \param theName name of dialog
+   * \return true/false if dialog is opened/isn't opened
+   */
+  static bool isDialogOpened( OCCViewer_ViewWindow* theView, const QString& theName );
+
+  /*!
+   * Get bounding box of visible objects.
+   * \param theView defined occ view
+   * \param theBounds used to return bounds of the bounding box
+   * \return \c true if the bounding box is computed
+   */
+  static bool computeVisibleBounds( const Handle(V3d_View) theView, double theBounds[6] );
+
+  /*!
+   * Compute the bounding box center of visible objects.
+   * \param theView defined occ view
+   * \param theX used to return X coordinate of the bounding box center
+   * \param theY used to return Y coordinate of the bounding box center
+   * \param theZ used to return Z coordinate of the bounding box center
+   * \return \c true if the bounding box center is computed
+   */
+  static bool computeVisibleBBCenter( const Handle(V3d_View) theView, double& theX, double& theY, double& theZ );
+
+  static bool computeSceneBBCenter( const Handle(V3d_View) theView, double& theX, double& theY, double& theZ );
 };
 
 #endif // OCCVIEWER_UTILITIES_H