4269bd1b |
1 | // Created on: 2013-09-05 |
2 | // Created by: Anton POLETAEV |
d5f74e42 |
3 | // Copyright (c) 2013-2014 OPEN CASCADE SAS |
4269bd1b |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
4269bd1b |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
4269bd1b |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
4269bd1b |
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 |
c04c30b3 |
23 | class OpenGl_CappingAlgoFilter; |
cc6852f3 |
24 | class OpenGl_Structure; |
4269bd1b |
25 | DEFINE_STANDARD_HANDLE (OpenGl_CappingAlgoFilter, OpenGl_RenderFilter) |
26 | |
27 | //! Capping surface rendering algorithm. |
28 | class OpenGl_CappingAlgo |
29 | { |
30 | public: |
31 | |
cc6852f3 |
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); |
4269bd1b |
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); |
4269bd1b |
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. |
79104795 |
58 | virtual Standard_Boolean CanRender (const OpenGl_Element* theElement) Standard_OVERRIDE; |
4269bd1b |
59 | |
60 | public: |
61 | |
ec357c5c |
62 | DEFINE_STANDARD_RTTI(OpenGl_CappingAlgoFilter, OpenGl_RenderFilter) |
4269bd1b |
63 | }; |
64 | |
65 | #endif |