0030748: Visualization - Marker displayed in immediate layer ruins QT Quick view...
[occt.git] / src / OpenGl / OpenGl_View.hxx
index 4155221..44ead7c 100644 (file)
@@ -28,6 +28,7 @@
 #include <Aspect_GradientFillMethod.hxx>
 
 #include <Graphic3d_CView.hxx>
+#include <Graphic3d_CullingTool.hxx>
 #include <Graphic3d_GraduatedTrihedron.hxx>
 #include <Graphic3d_SequenceOfHClipPlane.hxx>
 #include <Graphic3d_ToneMappingMethod.hxx>
@@ -35,9 +36,8 @@
 #include <Graphic3d_WorldViewProjState.hxx>
 #include <Graphic3d_ZLayerSettings.hxx>
 
-#include <OpenGl_AspectFace.hxx>
+#include <OpenGl_Aspects.hxx>
 #include <OpenGl_BackgroundArray.hxx>
-#include <OpenGl_BVHTreeSelector.hxx>
 #include <OpenGl_Context.hxx>
 #include <OpenGl_FrameBuffer.hxx>
 #include <OpenGl_FrameStatsPrs.hxx>
@@ -127,21 +127,6 @@ public:
   //! Return true if view content cache has been invalidated.
   virtual Standard_Boolean IsInvalidated() Standard_OVERRIDE { return !myBackBufferRestored; }
 
-  //! Returns data of a graduated trihedron
-  const Graphic3d_GraduatedTrihedron& GetGraduatedTrihedron() Standard_OVERRIDE
-  { return myGTrihedronData; }
-
-  //! Displays Graduated Trihedron.
-  Standard_EXPORT virtual void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron& theTrihedronData) Standard_OVERRIDE;
-
-  //! Erases Graduated Trihedron.
-  Standard_EXPORT virtual void GraduatedTrihedronErase() Standard_OVERRIDE;
-
-  //! Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.
-  //! @param theMin [in] the minimum point of scene.
-  //! @param theMax [in] the maximum point of scene.
-  Standard_EXPORT virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) Standard_OVERRIDE;
-
   //! Dump active rendering buffer into specified memory buffer.
   //! In Ray-Tracing allow to get a raw HDR buffer using Graphic3d_BT_RGB_RayTraceHdrLeft buffer type,
   //! only Left view will be dumped ignoring stereoscopic parameter.
@@ -211,12 +196,6 @@ public:
 
 public:
 
-  //! Returns background  fill color.
-  Standard_EXPORT virtual Aspect_Background Background() const Standard_OVERRIDE;
-
-  //! Sets background fill color.
-  Standard_EXPORT virtual void SetBackground (const Aspect_Background& theBackground) Standard_OVERRIDE;
-
   //! Returns gradient background fill colors.
   Standard_EXPORT virtual Aspect_GradientBackground GradientBackground() const Standard_OVERRIDE;
 
@@ -247,18 +226,12 @@ public:
   //! Sets backfacing model for the view.
   virtual void SetBackfacingModel (const Graphic3d_TypeOfBackfacingModel theModel) Standard_OVERRIDE { myBackfacing = theModel; }
 
-  //! Returns camera object of the view.
-  virtual const Handle(Graphic3d_Camera)& Camera() const Standard_OVERRIDE { return myCamera; }
-
   //! Returns local camera origin currently set for rendering, might be modified during rendering.
   const gp_XYZ& LocalOrigin() const { return myLocalOrigin; }
 
   //! Setup local camera origin currently set for rendering.
   Standard_EXPORT void SetLocalOrigin (const gp_XYZ& theOrigin);
 
-  //! Sets camera used by the view.
-  Standard_EXPORT virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) Standard_OVERRIDE;
-
   //! Returns list of lights of the view.
   virtual const Handle(Graphic3d_LightSet)& Lights() const Standard_OVERRIDE { return myLights; }
 
@@ -319,7 +292,7 @@ public:
 
   //! Returns selector for BVH tree, providing a possibility to store information
   //! about current view volume and to detect which objects are overlapping it.
-  const OpenGl_BVHTreeSelector& BVHTreeSelector() const { return myBVHSelector; }
+  const Graphic3d_CullingTool& BVHTreeSelector() const { return myBVHSelector; }
 
   //! Returns true if there are immediate structures to display
   bool HasImmediateStructures() const
@@ -327,6 +300,19 @@ public:
     return myZLayers.NbImmediateStructures() != 0;
   }
 
+public: //! @name obsolete Graduated Trihedron functionality
+
+  //! Displays Graduated Trihedron.
+  Standard_EXPORT virtual void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron& theTrihedronData) Standard_OVERRIDE;
+
+  //! Erases Graduated Trihedron.
+  Standard_EXPORT virtual void GraduatedTrihedronErase() Standard_OVERRIDE;
+
+  //! Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.
+  //! @param theMin [in] the minimum point of scene.
+  //! @param theMax [in] the maximum point of scene.
+  Standard_EXPORT virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) Standard_OVERRIDE;
+
 protected: //! @name Internal methods for managing GL resources
 
   //! Initializes OpenGl resource for environment texture.
@@ -458,9 +444,7 @@ protected:
   Standard_Boolean         myWasRedrawnGL;
 
   Graphic3d_TypeOfBackfacingModel myBackfacing;
-  Quantity_ColorRGBA              myBgColor;
   Handle(Graphic3d_SequenceOfHClipPlane) myClipPlanes;
-  Handle(Graphic3d_Camera)        myCamera;
   gp_XYZ                          myLocalOrigin;
   Handle(OpenGl_FrameBuffer)      myFBO;
   Standard_Boolean                myToShowGradTrihedron;
@@ -484,7 +468,7 @@ protected:
   StateInfo myLastLightSourceState;
 
   //! Is needed for selection of overlapping objects and storage of the current view volume
-  OpenGl_BVHTreeSelector myBVHSelector;
+  Graphic3d_CullingTool myBVHSelector;
 
   OpenGl_GraduatedTrihedron myGraduatedTrihedron;
   OpenGl_FrameStatsPrs      myFrameStatsPrs;
@@ -520,7 +504,7 @@ protected: //! @name Rendering properties
 
 protected: //! @name Background parameters
 
-  OpenGl_AspectFace*      myTextureParams;   //!< Stores texture and its parameters for textured background
+  OpenGl_Aspects*         myTextureParams;   //!< Stores texture and its parameters for textured background
   OpenGl_BackgroundArray* myBgGradientArray; //!< Primitive array for gradient background
   OpenGl_BackgroundArray* myBgTextureArray;  //!< Primitive array for texture  background
 
@@ -773,7 +757,7 @@ protected: //! @name methods related to ray-tracing
                                       const Handle(OpenGl_Context)&  theGlContext);
 
   //! Creates ray-tracing material properties.
-  OpenGl_RaytraceMaterial convertMaterial (const OpenGl_AspectFace*      theAspect,
+  OpenGl_RaytraceMaterial convertMaterial (const OpenGl_Aspects* theAspect,
                                            const Handle(OpenGl_Context)& theGlContext);
 
   //! Adds OpenGL primitive array to ray-traced scene geometry.
@@ -848,7 +832,8 @@ protected: //! @name methods related to ray-tracing
   //! Creates shader program from the given vertex and fragment shaders.
   Handle(OpenGl_ShaderProgram) initProgram (const Handle(OpenGl_Context)&      theGlContext,
                                             const Handle(OpenGl_ShaderObject)& theVertShader,
-                                            const Handle(OpenGl_ShaderObject)& theFragShader);
+                                            const Handle(OpenGl_ShaderObject)& theFragShader,
+                                            const TCollection_AsciiString& theName);
 
   //! Initializes OpenGL/GLSL shader programs.
   Standard_Boolean initRaytraceResources (const Standard_Integer theSizeX,