1 // Created on: 2011-08-01
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _OpenGl_Group_Header
17 #define _OpenGl_Group_Header
19 #include <NCollection_List.hxx>
20 #include <InterfaceGraphic_Graphic3d.hxx>
22 #include <OpenGl_Element.hxx>
24 #include <OpenGl_AspectLine.hxx>
25 #include <OpenGl_AspectFace.hxx>
26 #include <OpenGl_AspectMarker.hxx>
27 #include <OpenGl_AspectText.hxx>
30 class OpenGl_Structure;
32 typedef NCollection_List<const OpenGl_Group* > OpenGl_ListOfGroup;
34 struct OpenGl_ElementNode
37 OpenGl_ElementNode* next;
41 class OpenGl_Group : public OpenGl_Element
48 OpenGl_Group (const OpenGl_Structure* theAncestorStructure);
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);
56 void AddElement (OpenGl_Element* theElem);
58 virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
59 virtual void Release (const Handle(OpenGl_Context)& theGlCtx);
61 //! Returns first OpenGL element node of the group.
62 const OpenGl_ElementNode* FirstNode() const { return myFirst; }
64 //! Returns OpenGL face aspect.
65 const OpenGl_AspectFace* AspectFace() const { return myAspectFace; }
69 //! Returns modification state for ray-tracing.
70 Standard_Size ModificationState() const { return myModificationState; }
72 //! Is the group ray-tracable (contains ray-tracable elements)?
73 Standard_Boolean IsRaytracable() const { return myIsRaytracable; }
79 virtual ~OpenGl_Group();
83 OpenGl_AspectLine* myAspectLine;
84 OpenGl_AspectFace* myAspectFace;
85 OpenGl_AspectMarker* myAspectMarker;
86 OpenGl_AspectText* myAspectText;
88 OpenGl_ElementNode* myFirst;
89 OpenGl_ElementNode* myLast;
92 const OpenGl_Structure* myAncestorStructure;
93 Standard_Boolean myIsRaytracable;
94 Standard_Size myModificationState;
103 #endif //_OpenGl_Group_Header