0030748: Visualization - Marker displayed in immediate layer ruins QT Quick view...
[occt.git] / src / OpenGl / OpenGl_GraphicDriver.hxx
index fe14f3a..a07ec64 100644 (file)
 
 #include <Aspect_Display.hxx>
 #include <Aspect_DisplayConnection.hxx>
-#include <Aspect_GradientFillMethod.hxx>
-#include <Aspect_FillMethod.hxx>
-#include <Aspect_TypeOfTriedronPosition.hxx>
-#include <Aspect_TypeOfTriedronEcho.hxx>
-#include <Aspect_Handle.hxx>
 #include <Aspect_RenderingContext.hxx>
-#include <gp_Ax2.hxx>
 #include <Graphic3d_CView.hxx>
 #include <Graphic3d_CStructure.hxx>
-#include <Graphic3d_TextPath.hxx>
-#include <Graphic3d_HorizontalTextAlignment.hxx>
-#include <Graphic3d_VerticalTextAlignment.hxx>
-#include <Graphic3d_GraduatedTrihedron.hxx>
-#include <Graphic3d_TypeOfComposition.hxx>
-#include <Graphic3d_ExportFormat.hxx>
-#include <Graphic3d_SortType.hxx>
-#include <Graphic3d_BufferType.hxx>
 #include <NCollection_DataMap.hxx>
 #include <OpenGl_Context.hxx>
-#include <OpenGl_MapOfZLayerSettings.hxx>
-#include <Quantity_PlaneAngle.hxx>
-#include <Quantity_NameOfColor.hxx>
-#include <Standard_CString.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <TColStd_Array2OfReal.hxx>
-#include <TColStd_HArray1OfByte.hxx>
-#include <TColStd_HArray1OfReal.hxx>
-#include <TColStd_MapOfInteger.hxx>
 
 class Aspect_Window;
-class Graphic3d_Vector;
 class Quantity_Color;
-class Graphic3d_Vertex;
-class TCollection_ExtendedString;
-class Image_PixMap;
-class OpenGl_Element;
 class OpenGl_Structure;
-class OpenGl_Text;
 class OpenGl_View;
 class OpenGl_Window;
 
@@ -76,13 +47,10 @@ private:
   Standard_Size myCounter;
 };
 
-class OpenGl_GraphicDriver;
-
-DEFINE_STANDARD_HANDLE(OpenGl_GraphicDriver,Graphic3d_GraphicDriver)
-
 //! This class defines an OpenGl graphic driver
 class OpenGl_GraphicDriver : public Graphic3d_GraphicDriver
 {
+  DEFINE_STANDARD_RTTIEXT(OpenGl_GraphicDriver, Graphic3d_GraphicDriver)
 public:
 
   //! Constructor.
@@ -151,15 +119,9 @@ public:
   //! (reserved for default layers that can not be removed).
   Standard_EXPORT void RemoveZLayer (const Graphic3d_ZLayerId theLayerId) Standard_OVERRIDE;
 
-  //! Returns list of Z layers defined for the graphical driver.
-  Standard_EXPORT void ZLayers (TColStd_SequenceOfInteger& theLayerSeq) const Standard_OVERRIDE;
-
   //! Sets the settings for a single Z layer.
   Standard_EXPORT void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings& theSettings) Standard_OVERRIDE;
 
-  //! Returns the settings of a single Z layer.
-  Standard_EXPORT virtual Graphic3d_ZLayerSettings ZLayerSettings (const Graphic3d_ZLayerId theLayerId) Standard_OVERRIDE;
-
 public:
 
   //! @return the visualization options
@@ -191,7 +153,9 @@ public:
 
   //! Method to retrieve valid GL context.
   //! Could return NULL-handle if no window created by this driver.
-  Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const;
+  //! @param theBound if TRUE then currently bound context will be returned,
+  //!                 any context will be returned otherwise
+  Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext (bool theBound = false) const;
 
 #if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
   Aspect_Display          getRawGlDisplay() const { return myEglDisplay; }
@@ -199,12 +163,16 @@ public:
   void*                   getRawGlConfig()  const { return myEglConfig; }
 #endif
 
-  //! Insert index layer at proper position.
-  Standard_EXPORT void addZLayerIndex (const Graphic3d_ZLayerId theLayerId);
+  //! Set device lost flag for redrawn views.
+  Standard_EXPORT void setDeviceLost();
 
 public:
 
-  DEFINE_STANDARD_RTTIEXT(OpenGl_GraphicDriver,Graphic3d_GraphicDriver)
+  //! State counter for OpenGl structures.
+  OpenGl_StateCounter* GetStateCounter() const { return &myStateCounter; }
+
+  //! Returns unique ID for primitive arrays.
+  Standard_Size GetNextPrimitiveArrayUID() const { return myUIDGenerator.Increment(); }
 
 protected:
 
@@ -215,29 +183,15 @@ protected:
   void*                   myEglConfig;    //!< EGL configuration             : EGLConfig
 #endif
 
-  Handle(OpenGl_Caps)                                             myCaps;
-  NCollection_Map<Handle(OpenGl_View)>                            myMapOfView;
-  NCollection_DataMap<Standard_Integer, OpenGl_Structure*>        myMapOfStructure;
-
-public:
-
-  TColStd_MapOfInteger       myLayerIds;
-  TColStd_SequenceOfInteger  myLayerSeq;
-  OpenGl_MapOfZLayerSettings myMapOfZLayerSettings;
-
-public:
-
-  //! State counter for OpenGl structures.
-  OpenGl_StateCounter* GetStateCounter() const { return &myStateCounter; }
-
-  //! Returns unique ID for primitive arrays.
-  Standard_Size GetNextPrimitiveArrayUID() const { return myUIDGenerator.Increment(); }
-
-protected:
+  Handle(OpenGl_Caps)                                      myCaps;
+  NCollection_Map<Handle(OpenGl_View)>                     myMapOfView;
+  NCollection_DataMap<Standard_Integer, OpenGl_Structure*> myMapOfStructure;
 
   mutable OpenGl_StateCounter myStateCounter; //!< State counter for OpenGl structures.
   mutable OpenGl_StateCounter myUIDGenerator; //!< Unique ID counter for primitive arrays.
 
 };
 
+DEFINE_STANDARD_HANDLE(OpenGl_GraphicDriver, Graphic3d_GraphicDriver)
+
 #endif //_OpenGl_GraphicDriver_HeaderFile