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 | ||
29 | #include <OpenGl_tsm.hxx> | |
30 | ||
4269bd1b | 31 | class OpenGl_Group; |
e276548b | 32 | class OpenGl_Structure; |
4269bd1b | 33 | |
34 | typedef NCollection_List<const OpenGl_Group* > OpenGl_ListOfGroup; | |
35 | ||
2166f0fa SK |
36 | struct OpenGl_ElementNode |
37 | { | |
38 | TelType type; | |
39 | OpenGl_Element *elem; | |
40 | OpenGl_ElementNode *next; | |
1c35b92f | 41 | DEFINE_STANDARD_ALLOC |
2166f0fa SK |
42 | }; |
43 | ||
44 | class OpenGl_Group : public OpenGl_Element | |
45 | { | |
5e27df78 | 46 | public: |
47 | ||
e276548b | 48 | #ifndef HAVE_OPENCL |
5e27df78 | 49 | OpenGl_Group(); |
e276548b | 50 | #else |
51 | OpenGl_Group (const OpenGl_Structure* theAncestorStructure); | |
52 | #endif | |
2166f0fa | 53 | |
fd4a6963 | 54 | void SetAspectLine (const CALL_DEF_CONTEXTLINE& theAspect, const Standard_Boolean IsGlobal = Standard_True); |
55 | void SetAspectFace (const CALL_DEF_CONTEXTFILLAREA& theAspect, const Standard_Boolean IsGlobal = Standard_True); | |
56 | void SetAspectMarker (const CALL_DEF_CONTEXTMARKER& theAspect, const Standard_Boolean IsGlobal = Standard_True); | |
57 | void SetAspectText (const CALL_DEF_CONTEXTTEXT& theAspect, const Standard_Boolean IsGlobal = Standard_True); | |
2166f0fa SK |
58 | |
59 | void AddElement (const TelType, OpenGl_Element * ); | |
2166f0fa | 60 | |
5e27df78 | 61 | virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const; |
62 | virtual void Release (const Handle(OpenGl_Context)& theGlCtx); | |
2166f0fa | 63 | |
e276548b | 64 | //! Returns first OpenGL element node of the group. |
65 | const OpenGl_ElementNode* FirstNode() const { return myFirst; } | |
66 | ||
67 | //! Returns OpenGL face aspect. | |
68 | const OpenGl_AspectFace* AspectFace() const { return myAspectFace; } | |
69 | ||
70 | #ifdef HAVE_OPENCL | |
71 | ||
72 | //! Returns modification state for ray-tracing. | |
73 | Standard_Size ModificationState() const { return myModificationState; } | |
74 | ||
75 | //! Is the group ray-tracable (contains ray-tracable elements)? | |
76 | Standard_Boolean IsRaytracable() const { return myIsRaytracable; } | |
77 | ||
78 | #endif | |
79 | ||
5e27df78 | 80 | protected: |
2166f0fa | 81 | |
5e27df78 | 82 | virtual ~OpenGl_Group(); |
83 | ||
84 | protected: | |
2166f0fa | 85 | |
e276548b | 86 | OpenGl_AspectLine* myAspectLine; |
87 | OpenGl_AspectFace* myAspectFace; | |
88 | OpenGl_AspectMarker* myAspectMarker; | |
89 | OpenGl_AspectText* myAspectText; | |
90 | ||
91 | OpenGl_ElementNode* myFirst; | |
92 | OpenGl_ElementNode* myLast; | |
93 | ||
94 | #ifdef HAVE_OPENCL | |
95 | const OpenGl_Structure* myAncestorStructure; | |
96 | Standard_Boolean myIsRaytracable; | |
97 | Standard_Size myModificationState; | |
98 | #endif | |
5e27df78 | 99 | |
100 | public: | |
2166f0fa | 101 | |
1c35b92f | 102 | DEFINE_STANDARD_ALLOC |
5e27df78 | 103 | |
2166f0fa SK |
104 | }; |
105 | ||
106 | #endif //_OpenGl_Group_Header |