Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 2011-08-01 |
2 | // Created by: Sergey ZERCHANINOV | |
973c2be1 | 3 | // Copyright (c) 2011-2014 OPEN CASCADE SAS |
b311480e | 4 | // |
973c2be1 | 5 | // This file is part of Open CASCADE Technology software library. |
b311480e | 6 | // |
973c2be1 | 7 | // This library is free software; you can redistribute it and / or modify it |
8 | // under the terms of the GNU Lesser General Public 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. | |
b311480e | 12 | // |
973c2be1 | 13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. | |
b311480e | 15 | |
2166f0fa SK |
16 | #ifndef _OpenGl_Group_Header |
17 | #define _OpenGl_Group_Header | |
18 | ||
4269bd1b | 19 | #include <NCollection_List.hxx> |
2166f0fa SK |
20 | #include <InterfaceGraphic_Graphic3d.hxx> |
21 | ||
22 | #include <OpenGl_Element.hxx> | |
23 | ||
24 | #include <OpenGl_AspectLine.hxx> | |
25 | #include <OpenGl_AspectFace.hxx> | |
26 | #include <OpenGl_AspectMarker.hxx> | |
27 | #include <OpenGl_AspectText.hxx> | |
28 | ||
4269bd1b | 29 | class OpenGl_Group; |
e276548b | 30 | class OpenGl_Structure; |
4269bd1b | 31 | |
5322131b | 32 | typedef NCollection_List<const OpenGl_Group* > OpenGl_ListOfGroup; |
4269bd1b | 33 | |
2166f0fa SK |
34 | struct OpenGl_ElementNode |
35 | { | |
5322131b | 36 | OpenGl_Element* elem; |
37 | OpenGl_ElementNode* next; | |
1c35b92f | 38 | DEFINE_STANDARD_ALLOC |
2166f0fa SK |
39 | }; |
40 | ||
41 | class OpenGl_Group : public OpenGl_Element | |
42 | { | |
5e27df78 | 43 | public: |
44 | ||
e276548b | 45 | #ifndef HAVE_OPENCL |
5e27df78 | 46 | OpenGl_Group(); |
e276548b | 47 | #else |
48 | OpenGl_Group (const OpenGl_Structure* theAncestorStructure); | |
49 | #endif | |
2166f0fa | 50 | |
fd4a6963 | 51 | void SetAspectLine (const CALL_DEF_CONTEXTLINE& theAspect, const Standard_Boolean IsGlobal = Standard_True); |
52 | void SetAspectFace (const CALL_DEF_CONTEXTFILLAREA& theAspect, const Standard_Boolean IsGlobal = Standard_True); | |
53 | void SetAspectMarker (const CALL_DEF_CONTEXTMARKER& theAspect, const Standard_Boolean IsGlobal = Standard_True); | |
54 | void SetAspectText (const CALL_DEF_CONTEXTTEXT& theAspect, const Standard_Boolean IsGlobal = Standard_True); | |
2166f0fa | 55 | |
5322131b | 56 | void AddElement (OpenGl_Element* theElem); |
2166f0fa | 57 | |
5e27df78 | 58 | virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const; |
59 | virtual void Release (const Handle(OpenGl_Context)& theGlCtx); | |
2166f0fa | 60 | |
e276548b | 61 | //! Returns first OpenGL element node of the group. |
62 | const OpenGl_ElementNode* FirstNode() const { return myFirst; } | |
63 | ||
64 | //! Returns OpenGL face aspect. | |
65 | const OpenGl_AspectFace* AspectFace() const { return myAspectFace; } | |
66 | ||
67 | #ifdef HAVE_OPENCL | |
68 | ||
69 | //! Returns modification state for ray-tracing. | |
70 | Standard_Size ModificationState() const { return myModificationState; } | |
71 | ||
72 | //! Is the group ray-tracable (contains ray-tracable elements)? | |
73 | Standard_Boolean IsRaytracable() const { return myIsRaytracable; } | |
74 | ||
75 | #endif | |
76 | ||
5e27df78 | 77 | protected: |
2166f0fa | 78 | |
5e27df78 | 79 | virtual ~OpenGl_Group(); |
80 | ||
81 | protected: | |
2166f0fa | 82 | |
e276548b | 83 | OpenGl_AspectLine* myAspectLine; |
84 | OpenGl_AspectFace* myAspectFace; | |
85 | OpenGl_AspectMarker* myAspectMarker; | |
86 | OpenGl_AspectText* myAspectText; | |
87 | ||
88 | OpenGl_ElementNode* myFirst; | |
89 | OpenGl_ElementNode* myLast; | |
5322131b | 90 | |
e276548b | 91 | #ifdef HAVE_OPENCL |
92 | const OpenGl_Structure* myAncestorStructure; | |
93 | Standard_Boolean myIsRaytracable; | |
94 | Standard_Size myModificationState; | |
95 | #endif | |
5e27df78 | 96 | |
97 | public: | |
2166f0fa | 98 | |
1c35b92f | 99 | DEFINE_STANDARD_ALLOC |
5e27df78 | 100 | |
2166f0fa SK |
101 | }; |
102 | ||
103 | #endif //_OpenGl_Group_Header |