0027606: Visualization - view is blocking when MSAA has been overridden in graphics...
[occt.git] / src / OpenGl / OpenGl_CappingAlgo.hxx
1 // Created on: 2013-09-05
2 // Created by: Anton POLETAEV
3 // Copyright (c) 2013-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _OpenGl_CappingAlgo_H__
17 #define _OpenGl_CappingAlgo_H__
18
19 #include <OpenGl_RenderFilter.hxx>
20 #include <OpenGl_Group.hxx>
21
22 // Forward declaration
23 class OpenGl_CappingAlgoFilter;
24 class OpenGl_Structure;
25 DEFINE_STANDARD_HANDLE (OpenGl_CappingAlgoFilter, OpenGl_RenderFilter)
26
27 //! Capping surface rendering algorithm.
28 class OpenGl_CappingAlgo
29 {
30 public:
31
32   //! Draw capping surfaces by OpenGl for the clipping planes enabled in current context state.
33   //! Depth buffer must be generated  for the passed groups.
34   //! @param theWorkspace [in] the GL workspace, context state
35   //! @param theStructure [in] the structure to be capped
36   Standard_EXPORT static void RenderCapping (const Handle(OpenGl_Workspace)& theWorkspace,
37                                              const OpenGl_Structure&         theStructure);
38
39   //! Render infinite capping plane.
40   //! @param theWorkspace [in] the GL workspace, context state.
41   //! @param thePlane [in] the graphical plane, for which the capping surface is rendered.
42   Standard_EXPORT static void RenderPlane (const Handle(OpenGl_Workspace)& theWorkspace,
43                                            const Handle(Graphic3d_ClipPlane)& thePlane);
44 };
45
46 //! Graphical capping rendering algorithm filter.
47 //! Filters out everything excepth shaded primitives.
48 class OpenGl_CappingAlgoFilter : public OpenGl_RenderFilter
49 {
50 public:
51
52   //! Default constructor.
53   OpenGl_CappingAlgoFilter() {}
54
55   //! Checks whether the element can be rendered or not.
56   //! @param theElement [in] the element to check.
57   //! @return True if element can be rendered.
58   virtual Standard_Boolean CanRender (const OpenGl_Element* theElement) Standard_OVERRIDE;
59
60 public:
61
62   DEFINE_STANDARD_RTTIEXT(OpenGl_CappingAlgoFilter,OpenGl_RenderFilter)
63 };
64
65 #endif